From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 00:00:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF5F106568D; Sun, 19 Jun 2011 00:00:37 +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 1B1E58FC26; Sun, 19 Jun 2011 00:00:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5J00a26069441; Sun, 19 Jun 2011 00:00:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J00af3069440; Sun, 19 Jun 2011 00:00:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106190000.p5J00af3069440@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 00:00: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: r223283 - head/tools/regression/bin/sh/execution X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 00:00:37 -0000 Author: jilles Date: Sun Jun 19 00:00:36 2011 New Revision: 223283 URL: http://svn.freebsd.org/changeset/base/223283 Log: sh: Add test for r223282. Added: head/tools/regression/bin/sh/execution/bg4.0 (contents, props changed) Added: head/tools/regression/bin/sh/execution/bg4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/bg4.0 Sun Jun 19 00:00:36 2011 (r223283) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +x='' +: ${x:=1} & +wait +exit ${x:-0} From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 00:07:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB750106564A; Sun, 19 Jun 2011 00:07:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3D08F8FC1F; Sun, 19 Jun 2011 00:07:10 +0000 (UTC) Received: by gwb15 with SMTP id 15so368911gwb.13 for ; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=hTDFOFtk0ICIo1WmJD2ne/uwztrU/nRVGPvqXeCLUU4=; b=q0gjOT3tnG1p+aSvYyO3zsnamL1YsTonpR2H4/LLgn9cQAWV1B9W1rQPfoESYW+4OY cRvHC80020qFM9tvgCcf+nM7anHirNmU1ELG5a8jY8fREbwWwTEXfU6oisYslhRC4iTS 8zIBmLMUvGqf3lcJhvqNT7FxaoIm93Yda16ME= 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=ilrgZtSTD3h/7T2hQ2fJzdHPykB+jtK2BGi8W56zXGyIViX5dD3+oxgqBpeu7gtrMN LVROOTlo5IoNJnHYv/wShCOeBrcaObXGrTWcCsUasIurDfe+zXH5wdsoVWzMuXYiaDfI EYoE029jvrIm2X518NUEEIadnz8vZjAdqA3Gw= MIME-Version: 1.0 Received: by 10.150.132.15 with SMTP id f15mr3973092ybd.388.1308442030440; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.58.10 with HTTP; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) In-Reply-To: <4DFD0BBA.1010502@freebsd.org> References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> <4DFD0BBA.1010502@freebsd.org> Date: Sun, 19 Jun 2011 08:07:10 +0800 X-Google-Sender-Auth: bO5ztR9FUGPb7uRZ5hBg3MPfxcQ Message-ID: From: Adrian Chadd To: Nathan Whitehorn Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 00:07:11 -0000 On 19 June 2011 04:34, Nathan Whitehorn wrote: > Since all of our install CDs for 9.0 (even the boot-only ones!) will be live > CDs, the full versions of everything in /rescue are on the CD in their usual > locations in /bin, /sbin, etc. and these can be used just as well for fixing > a system as the /rescue tools. > -Nathan Question - is sysinstall still installed on those? If so (it was installed on the USB -current image I used to install from a month or so ago) it confused me as I ran sysinstall fine but I couldn't install anything using it. Thanks, Adrian From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 02:47:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27978106566B; Sun, 19 Jun 2011 02:47:10 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id A09F28FC14; Sun, 19 Jun 2011 02:47:09 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id p5J2l5jS018653; Sun, 19 Jun 2011 11:47:07 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 19 Jun 2011 11:47:04 +0900 (JST) Message-Id: <20110619.114704.59640143160110864.nyan@FreeBSD.org> To: benl@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.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: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 02:47:10 -0000 In article <201106181356.p5IDuXhW044171@svn.freebsd.org> Ben Laurie writes: > Author: benl > Date: Sat Jun 18 13:56:33 2011 > New Revision: 223262 > URL: http://svn.freebsd.org/changeset/base/223262 > > Log: > Fix clang warnings. > > Modified: head/sys/sys/diskpc98.h > ============================================================================== > --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) > +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) > @@ -36,8 +36,11 @@ > #include > > #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ > +#undef DOSPARTOFF > #define DOSPARTOFF 0 > +#undef DOSPARTSIZE > #define DOSPARTSIZE 32 > +#undef NDOSPART > #define NDOSPART 16 > #define DOSMAGICOFFSET 510 > #define DOSMAGIC 0xAA55 > @@ -52,6 +55,7 @@ > > #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) > #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) > +#undef DOSPTYP_386BSD > #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) > > struct pc98_partition { > I wonder why this is needed, and why only for diskpc98.h, not diskmbr.h. --- TAKAHASHI Yoshihiro From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 08:34:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FD9B106564A; Sun, 19 Jun 2011 08:34:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7378FC0C; Sun, 19 Jun 2011 08:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5J8YBvO084691; Sun, 19 Jun 2011 08:34:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J8YBNo084688; Sun, 19 Jun 2011 08:34:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106190834.p5J8YBNo084688@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 19 Jun 2011 08:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223288 - in head/sys/dev/usb: . 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: Sun, 19 Jun 2011 08:34:11 -0000 Author: hselasky Date: Sun Jun 19 08:34:10 2011 New Revision: 223288 URL: http://svn.freebsd.org/changeset/base/223288 Log: Add new USB ID to UDAV driver. Submitted by: Luiz Gustavo S. Costa MFC after: 7 days Modified: head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Sun Jun 19 02:39:02 2011 (r223287) +++ head/sys/dev/usb/net/if_udav.c Sun Jun 19 08:34:10 2011 (r223288) @@ -210,6 +210,7 @@ static const struct usb_device_id udav_d {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, }; static void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jun 19 02:39:02 2011 (r223287) +++ head/sys/dev/usb/usbdevs Sun Jun 19 08:34:10 2011 (r223288) @@ -2014,6 +2014,7 @@ product KODAK DC280 0x0130 Digital Scie /* Kontron AG products */ product KONTRON DM9601 0x8101 USB Ethernet +product KONTRON JP1082 0x9700 USB Ethernet /* Konica Corp. Products */ product KONICA CAMERA 0x0720 Digital Color Camera From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 08:35:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6770E10656B7; Sun, 19 Jun 2011 08:35:54 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 941568FC17; Sun, 19 Jun 2011 08:35:53 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=3OyxrDLVq9sri6DuQhVzJBEiMCfYdL5zDZJFh5fE9Ak= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=V4P58aWE2P4A:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=56DwDi9HZ6sdPNhyP0QA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 142098522; Sun, 19 Jun 2011 10:35:51 +0200 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Sun, 19 Jun 2011 10:34:22 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106190834.p5J8YBNo084688@svn.freebsd.org> In-Reply-To: <201106190834.p5J8YBNo084688@svn.freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106191034.22488.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r223288 - in head/sys/dev/usb: . 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: Sun, 19 Jun 2011 08:35:54 -0000 On Sunday 19 June 2011 10:34:11 Hans Petter Selasky wrote: > Author: hselasky > Date: Sun Jun 19 08:34:10 2011 > New Revision: 223288 > URL: http://svn.freebsd.org/changeset/base/223288 > > Log: > Add new USB ID to UDAV driver. > Hope this commit was not too late for the code slush. --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 08:38:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3203A1065677; Sun, 19 Jun 2011 08:38:52 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from emx.nitro.dk (emx.nitro.dk [IPv6:2a01:4f8:120:7384::102]) by mx1.freebsd.org (Postfix) with ESMTP id BA2818FC1D; Sun, 19 Jun 2011 08:38:51 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id E5180913F4; Sun, 19 Jun 2011 08:38:50 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id QOQOz2agq0m9; Sun, 19 Jun 2011 08:38:46 +0000 (UTC) Received: from [192.168.4.32] (unknown [90.184.171.166]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 7D831913EC; Sun, 19 Jun 2011 08:38:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Simon L. B. Nielsen" In-Reply-To: <20110618204836.GA46582@stack.nl> Date: Sun, 19 Jun 2011 10:38:44 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618204836.GA46582@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1084) Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Philip Paeps Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 08:38:52 -0000 On 18 Jun 2011, at 22:48, Jilles Tjoelker wrote: > On Sat, Jun 18, 2011 at 01:56:33PM +0000, Ben Laurie wrote: >> Modified: = head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c = Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c = Sat Jun 18 13:56:33 2011 (r223262) >> @@ -45,6 +45,7 @@ >> #include >> #include >> #include >> +#include >>=20 >> #include >>=20 >> @@ -811,15 +812,14 @@ dt_basename(char *str) >> ulong_t >> dt_popc(ulong_t x) >> { >> -#ifdef _ILP32 >> +#if defined(_ILP32) >> x =3D x - ((x >> 1) & 0x55555555UL); >> x =3D (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); >> x =3D (x + (x >> 4)) & 0x0F0F0F0FUL; >> x =3D x + (x >> 8); >> x =3D x + (x >> 16); >> return (x & 0x3F); >> -#endif >> -#ifdef _LP64 >> +#elif defined(_LP64) >> x =3D x - ((x >> 1) & 0x5555555555555555ULL); >> x =3D (x & 0x3333333333333333ULL) + ((x >> 2) & = 0x3333333333333333ULL); >> x =3D (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; >> @@ -827,6 +827,8 @@ dt_popc(ulong_t x) >> x =3D x + (x >> 16); >> x =3D x + (x >> 32); >> return (x & 0x7F); >> +#else >> +# warning need td_popc() implementation >> #endif >> } >=20 > This commit uncovers breakage that had been present for a while. If I > compile this on stable/8 i386 for head i386, _ILP32 is not defined and > the warning is hit, breaking the build. Apparently, the code had been > broken for a while but I do not use dtrace so I would not have = noticed. > The tinderboxes have now also noticed the problem so it is not = something > weird about my system. What would be the correct (at least temporary) fix? Replace the _ILP32 = / _LP64 checks with specific architecture checks ? I can see that on i386 _ILP32 isn't actually defined - but on amd64 = _LP64 is... and it still breaks. [simon@zaphod:~] ssh ref9-i386.freebsd.org 'cpp -dM < /dev/null | grep = LP' [simon@zaphod:~] ssh ref9-amd64.freebsd.org 'cpp -dM < /dev/null | grep = LP' #define __LP64__ 1 #define _LP64 1 [simon@zaphod:~] ssh ref8-amd64.freebsd.org 'cpp -dM < /dev/null | grep = LP' #define __LP64__ 1 #define _LP64 1 I must be missing something... --=20 Simon L. B. Nielsen From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 08:51:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8867D106568D; Sun, 19 Jun 2011 08:51:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1E4758FC13; Sun, 19 Jun 2011 08:51:55 +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 p5J8pqvb070168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jun 2011 11:51:52 +0300 (EEST) (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.4/8.14.4) with ESMTP id p5J8ppvM093412; Sun, 19 Jun 2011 11:51:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5J8ppEk093411; Sun, 19 Jun 2011 11:51:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Jun 2011 11:51:51 +0300 From: Kostik Belousov To: "Simon L. B. Nielsen" Message-ID: <20110619085151.GB48734@deviant.kiev.zoral.com.ua> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618204836.GA46582@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zk+PeIDuky64cHni" Content-Disposition: inline In-Reply-To: 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=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, Jilles Tjoelker , Ben Laurie , svn-src-all@freebsd.org, Philip Paeps , svn-src-head@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 08:51:56 -0000 --Zk+PeIDuky64cHni Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2011 at 10:38:44AM +0200, Simon L. B. Nielsen wrote: >=20 > On 18 Jun 2011, at 22:48, Jilles Tjoelker wrote: >=20 > > On Sat, Jun 18, 2011 at 01:56:33PM +0000, Ben Laurie wrote: > >> Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat J= un 18 13:54:36 2011 (r223261) > >> +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat J= un 18 13:56:33 2011 (r223262) > >> @@ -45,6 +45,7 @@ > >> #include > >> #include > >> #include > >> +#include > >>=20 > >> #include > >>=20 > >> @@ -811,15 +812,14 @@ dt_basename(char *str) > >> ulong_t > >> dt_popc(ulong_t x) > >> { > >> -#ifdef _ILP32 > >> +#if defined(_ILP32) > >> x =3D x - ((x >> 1) & 0x55555555UL); > >> x =3D (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); > >> x =3D (x + (x >> 4)) & 0x0F0F0F0FUL; > >> x =3D x + (x >> 8); > >> x =3D x + (x >> 16); > >> return (x & 0x3F); > >> -#endif > >> -#ifdef _LP64 > >> +#elif defined(_LP64) > >> x =3D x - ((x >> 1) & 0x5555555555555555ULL); > >> x =3D (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL= ); > >> x =3D (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; > >> @@ -827,6 +827,8 @@ dt_popc(ulong_t x) > >> x =3D x + (x >> 16); > >> x =3D x + (x >> 32); > >> return (x & 0x7F); > >> +#else > >> +# warning need td_popc() implementation > >> #endif > >> } > >=20 > > This commit uncovers breakage that had been present for a while. If I > > compile this on stable/8 i386 for head i386, _ILP32 is not defined and > > the warning is hit, breaking the build. Apparently, the code had been > > broken for a while but I do not use dtrace so I would not have noticed. > > The tinderboxes have now also noticed the problem so it is not something > > weird about my system. >=20 > What would be the correct (at least temporary) fix? Replace the _ILP32 /= _LP64 checks with specific architecture checks ? >=20 > I can see that on i386 _ILP32 isn't actually defined - but on amd64 _LP6= 4 is... and it still breaks. >=20 > [simon@zaphod:~] ssh ref9-i386.freebsd.org 'cpp -dM < /dev/null | grep LP' > [simon@zaphod:~] ssh ref9-amd64.freebsd.org 'cpp -dM < /dev/null | grep L= P' > #define __LP64__ 1 > #define _LP64 1 > [simon@zaphod:~] ssh ref8-amd64.freebsd.org 'cpp -dM < /dev/null | grep L= P' > #define __LP64__ 1 > #define _LP64 1 >=20 > I must be missing something... It breaks on amd64 while building compat32 libraries. The build step uses i386-targeted compiler, which lacks the ILP32 definition. --Zk+PeIDuky64cHni Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk39uKcACgkQC3+MBN1Mb4j15ACgpgwXIiikRlK4oV9StwH/VS5w sCMAnRchEvb5XvEW9URHPCMBebXl+3Ch =ucLP -----END PGP SIGNATURE----- --Zk+PeIDuky64cHni-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 08:53:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2BBB106564A; Sun, 19 Jun 2011 08:53:16 +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 A290D8FC0C; Sun, 19 Jun 2011 08:53:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5J8rGsh085254; Sun, 19 Jun 2011 08:53:16 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J8rGm4085251; Sun, 19 Jun 2011 08:53:16 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201106190853.p5J8rGm4085251@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 19 Jun 2011 08:53: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: r223289 - head/contrib/dialog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 08:53:16 -0000 Author: jh Date: Sun Jun 19 08:53:16 2011 New Revision: 223289 URL: http://svn.freebsd.org/changeset/base/223289 Log: Don't #undef curses ERR in dialog.h. Otherwise, the macro will be unavailable if curses.h is included before dialog.h. PR: bin/156601 Obtained from: Thomas E. Dickey (upstream maintainer) Discussed with: nwhitehorn Modified: head/contrib/dialog/dialog.h Modified: head/contrib/dialog/dialog.h ============================================================================== --- head/contrib/dialog/dialog.h Sun Jun 19 08:34:10 2011 (r223288) +++ head/contrib/dialog/dialog.h Sun Jun 19 08:53:16 2011 (r223289) @@ -1,5 +1,5 @@ /* - * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $ + * $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $ * * dialog.h -- common declarations for all dialog modules * @@ -44,7 +44,10 @@ #include /* fork() etc. */ #include /* sqrt() */ -#undef ERR /* header conflict with Solaris xpg4 */ +/* header conflict with Solaris xpg4 versus */ +#if defined(ERR) && (ERR == 13) +#undef ERR +#endif #if defined(HAVE_NCURSESW_NCURSES_H) #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 11:26:46 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C47121065674; Sun, 19 Jun 2011 11:26:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCA08FC1D; Sun, 19 Jun 2011 11:26:45 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5JBQf11007476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jun 2011 21:26:42 +1000 Date: Sun, 19 Jun 2011 21:26:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: TAKAHASHI Yoshihiro In-Reply-To: <20110619.114704.59640143160110864.nyan@FreeBSD.org> Message-ID: <20110619193320.Y917@besplex.bde.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: benl@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 11:26:46 -0000 On Sun, 19 Jun 2011, TAKAHASHI Yoshihiro wrote: > In article <201106181356.p5IDuXhW044171@svn.freebsd.org> > Ben Laurie writes: >> >> Log: >> Fix clang warnings. >> >> Modified: head/sys/sys/diskpc98.h >> ============================================================================== >> --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -36,8 +36,11 @@ >> #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ >> +#undef DOSPARTOFF >> #define DOSPARTOFF 0 >> +#undef DOSPARTSIZE >> #define DOSPARTSIZE 32 >> +#undef NDOSPART >> #define NDOSPART 16 >> #define DOSMAGICOFFSET 510 >> #define DOSMAGIC 0xAA55 >> @@ -52,6 +55,7 @@ >> >> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >> +#undef DOSPTYP_386BSD >> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >> >> struct pc98_partition { >> > > I wonder why this is needed, and why only for diskpc98.h, not > diskmbr.h. This is needed to break the warning even more. There are are enormous number of layers of brokenness: o These header files unfortunately define some ioctls (just 1), so kdump/mkioctls generates an include of both in ioctl.c. This causes conflicts. The conflicts should cause errors (though the conflicting definitions aren't actually used in ioctl.c), but they only generates warnings. o If you compile ioctl.c standalone to test this, then it compiles with no warnings with both gcc and clang, since -Wno-system-headers is the default for gcc and apparently for clang too. However, for world builds there is magic that results in being $(realpath /usr/obj)/src/tmp/usr/include/sys instead of just /usr/include/sys. I'm not sure if clang only is confused by this so that -Wno-system-headers doesn't break the warnings for clang only, or if the warnings have always been happening and they are just more obvious with clang colorizing them. o The build system knows about -Wno-system-headers breaking warnings, so it puts -Wsystem-headers in CFLAGS to turn this off. But it only does this at WARNS >= 1, and kdump still uses WARNS = 0. o Poor structuring of the disk headers. I've always thought that diskmbr.h shouldn't exist. It doesn't describe "the" disk mbr structure, but only the "i386" one. It should have been named something like diski386.h. The current problem shows that these files should have been purely MD so that they can be kept separate. Their names should have been something like . Or for simplicity, keep all of their definitions with ifdefs in like they used to be as recently as FreeBSD-4. disklabel.h still has some ugly unsorted MD ifdefs (just 2, for LABELSECTOR and LABELOFFSET). Of course, definitions for MBRs should never have been in disklabel.h. For simplicity with fewer hacks, put all the MBR definitions with ifdefs in . The current problem shows that many ifdefs are needed with the current structuring anyway. We only escape having to ifdef everything in both of the files (or complications in mkioctls) because some names are different (e.g., struct pc98_partition instead of struct dos_partition, and more importantly, DIOCSPC98 instead of DIOCSMBR -- the latter allows both ioctls to be defined in ioctl.c, though only the pc98 is normally used on pc98. BTW, can pc98 handle i386-formatted disks? MacOS supports i386-mbr formatted USB drives better than WinXP does -- WinXP can only mount FAT32 partitions in MBR slot 1, though it can recognize them in any slot. Such support is easiest if all the mbr ioctls are available in all arches. But I now think that depending on any disk ioctl in an application like fdisk or newfs is a bug. Such applications should be able to work on any "direct addressable" file (including regular files and foreign disks). Some Linux disk applications now work better on FreeBSD than FreeBSD ones do, since they don't depend so much on ioctls :-(). This is only "needed" for diskpc98.h because 'm' is less than 'p', so diskmbr.h is always included before diskpc98.h. I thought at first that the order of the includes could not be depended on, because the find(1) in mkioctls produced output in (unsorted) tree traversal order. But the find is actually on "*" in each directory in the include path, so the shell will sort the includes alphabetically within each directory. I now remember that this is intentional, to get the same breakage as an application which complies with style(9) will get if there are any bogus ordering requirements for directories that are not accidentally satisified by keeping the includes sorted. See the /* XXX obnoxious prerequisites. */ section in mkioctls. This intentionally includes a few headers out of order, to work around cases where the normal order doesn't work. One of these headers is disklabel.h, which might not be needed there any more now that it has been cleaned up. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 11:42:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22DF8106564A; Sun, 19 Jun 2011 11:42:49 +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 128E68FC12; Sun, 19 Jun 2011 11:42:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JBgmsC092184; Sun, 19 Jun 2011 11:42:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JBgmaK092182; Sun, 19 Jun 2011 11:42:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106191142.p5JBgmaK092182@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 11: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: r223292 - head/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: Sun, 19 Jun 2011 11:42:49 -0000 Author: jilles Date: Sun Jun 19 11:42:48 2011 New Revision: 223292 URL: http://svn.freebsd.org/changeset/base/223292 Log: rc.subr: Eliminate a fork from check_kern_features, like r223227. MFC after: 2 weeks Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jun 19 11:14:02 2011 (r223291) +++ head/etc/rc.subr Sun Jun 19 11:42:48 2011 (r223292) @@ -1744,7 +1744,7 @@ check_kern_features() local _v [ -n "$1" ] || return 1; - _v=`eval echo "\\$_rc_cache_kern_features_$1"` + eval _v=\$_rc_cache_kern_features_$1 [ -n "$_v" ] && return "$_v"; if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 11:55:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F05881065672; Sun, 19 Jun 2011 11:55:22 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id A52DD8FC14; Sun, 19 Jun 2011 11:55:22 +0000 (UTC) Received: by pvg11 with SMTP id 11so1061030pvg.13 for ; Sun, 19 Jun 2011 04:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=YruydtxjfqY19tiXunjg9rJNl+80F2F/NqJZ6TlJ4+M=; b=dy5hLi82yxhrziadhydF6adv3XJ5waZQPAi5GcEFgIQU0C8S3wqax43Q9jmeSSHVOs oiD2F8dFizaWx3csdLo9p0raUKI2TCZoY79uSLGwCAM0XQpeFik7bOMq7oAJ5PDDDCIh cVBRY29mJBxRsqj+jqqKW7QXurPqiJaCIvcR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=rLe6nXLgSTHeZ3ZxH+eSTY/wQEDD36bavv8LDKwZBPzft3RPHxGGop6Y0k14aCytAs KHsZIZTebcLuqqdl+LYjMtu/xiCXXSx6RZF6MM/nb7ImOAseDtZxRtnrdN/QFoqv/I2c 5JCpiqEryjGrqvDbW86y2ofn6JcyDvpUxFAm0= Received: by 10.68.34.72 with SMTP id x8mr1624697pbi.312.1308484522168; Sun, 19 Jun 2011 04:55:22 -0700 (PDT) Received: from [192.168.20.56] (c-24-6-49-154.hsd1.ca.comcast.net [24.6.49.154]) by mx.google.com with ESMTPS id m9sm2588342pbd.39.2011.06.19.04.55.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2011 04:55:21 -0700 (PDT) References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> <20110619193320.Y917@besplex.bde.org> In-Reply-To: <20110619193320.Y917@besplex.bde.org> Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <2FF8921B-04E8-43CA-9140-1DEB0933C8E3@gmail.com> X-Mailer: iPhone Mail (8J2) From: Garrett Cooper Date: Sun, 19 Jun 2011 04:55:16 -0700 To: Bruce Evans Cc: "benl@FreeBSD.org" , "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , TAKAHASHI Yoshihiro Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 11:55:23 -0000 On Jun 19, 2011, at 4:26 AM, Bruce Evans wrote: > On Sun, 19 Jun 2011, TAKAHASHI Yoshihiro wrote: >=20 >> In article <201106181356.p5IDuXhW044171@svn.freebsd.org> >> Ben Laurie writes: >>>=20 >>> Log: >>> Fix clang warnings. >>>=20 >>> Modified: head/sys/sys/diskpc98.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >>> --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >>> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >>> @@ -36,8 +36,11 @@ >>> #include >>>=20 >>> #define DOSBBSECTOR 0 /* DOS boot block relative sector number *= / >>> +#undef DOSPARTOFF >>> #define DOSPARTOFF 0 >>> +#undef DOSPARTSIZE >>> #define DOSPARTSIZE 32 >>> +#undef NDOSPART >>> #define NDOSPART 16 >>> #define DOSMAGICOFFSET 510 >>> #define DOSMAGIC 0xAA55 >>> @@ -52,6 +55,7 @@ >>>=20 >>> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >>> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >>> +#undef DOSPTYP_386BSD >>> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >>>=20 >>> struct pc98_partition { >>>=20 >>=20 >> I wonder why this is needed, and why only for diskpc98.h, not >> diskmbr.h. >=20 > This is needed to break the warning even more. There are are enormous > number of layers of brokenness: >=20 > o These header files unfortunately define some ioctls (just 1), so > kdump/mkioctls generates an include of both in ioctl.c. This causes > conflicts. The conflicts should cause errors (though the conflicting > definitions aren't actually used in ioctl.c), but they only generates > warnings. >=20 > o If you compile ioctl.c standalone to test this, then it compiles with > no warnings with both gcc and clang, since -Wno-system-headers is the > default for gcc and apparently for clang too. However, for world builds > there is magic that results in being > $(realpath /usr/obj)/src/tmp/usr/include/sys instead of just > /usr/include/sys. I'm not sure if clang only is confused by this so > that -Wno-system-headers doesn't break the warnings for clang only, > or if the warnings have always been happening and they are just more > obvious with clang colorizing them. >=20 > o The build system knows about -Wno-system-headers breaking warnings, so > it puts -Wsystem-headers in CFLAGS to turn this off. But it only does > this at WARNS >=3D 1, and kdump still uses WARNS =3D 0. >=20 > o Poor structuring of the disk headers. I've always thought that > diskmbr.h shouldn't exist. It doesn't describe "the" disk mbr > structure, but only the "i386" one. It should have been named > something like diski386.h. The current problem shows that these > files should have been purely MD so that they can be kept separate. > Their names should have been something like . > Or for simplicity, keep all of their definitions with ifdefs in > like they used to be as recently as FreeBSD-4. > disklabel.h still has some ugly unsorted MD ifdefs (just 2, for > LABELSECTOR and LABELOFFSET). Of course, definitions for MBRs > should never have been in disklabel.h. For simplicity with fewer > hacks, put all the MBR definitions with ifdefs in . > The current problem shows that many ifdefs are needed with the > current structuring anyway. We only escape having to ifdef everything > in both of the files (or complications in mkioctls) because some names > are different (e.g., struct pc98_partition instead of struct > dos_partition, and more importantly, DIOCSPC98 instead of DIOCSMBR -- > the latter allows both ioctls to be defined in ioctl.c, though only > the pc98 is normally used on pc98. BTW, can pc98 handle i386-formatted > disks? MacOS supports i386-mbr formatted USB drives better than > WinXP does -- WinXP can only mount FAT32 partitions in MBR slot 1, > though it can recognize them in any slot. Such support is easiest > if all the mbr ioctls are available in all arches. But I now think > that depending on any disk ioctl in an application like fdisk or > newfs is a bug. Such applications should be able to work on any > "direct addressable" file (including regular files and foreign > disks). Some Linux disk applications now work better on FreeBSD than > FreeBSD ones do, since they don't depend so much on ioctls :-(). >=20 > This is only "needed" for diskpc98.h because 'm' is less than 'p', so > diskmbr.h is always included before diskpc98.h. I thought at first > that the order of the includes could not be depended on, because the > find(1) in mkioctls produced output in (unsorted) tree traversal order. > But the find is actually on "*" in each directory in the include path, > so the shell will sort the includes alphabetically within each directory. > I now remember that this is intentional, to get the same breakage as > an application which complies with style(9) will get if there are any > bogus ordering requirements for directories that are not accidentally > satisified by keeping the includes sorted. See the /* XXX obnoxious > prerequisites. */ section in mkioctls. This intentionally includes > a few headers out of order, to work around cases where the normal > order doesn't work. One of these headers is disklabel.h, which > might not be needed there any more now that it has been cleaned up. If my ktrace WARNS 0 -> 6 patch had been reviewed that I submitted some week= s ago, then this would be moot. It's not a perfect solution, but it worked. Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 12:12:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BC4106564A; Sun, 19 Jun 2011 12:12:17 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id AF6F38FC0C; Sun, 19 Jun 2011 12:12:16 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id 644FF33C1F; Sun, 19 Jun 2011 13:12:15 +0100 (BST) Message-ID: <4DFDE79F.6030803@links.org> Date: Sun, 19 Jun 2011 13:12:15 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> In-Reply-To: <20110619.114704.59640143160110864.nyan@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: benl@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 12:12:17 -0000 On 19/06/2011 03:47, TAKAHASHI Yoshihiro wrote: > In article <201106181356.p5IDuXhW044171@svn.freebsd.org> > Ben Laurie writes: > >> Author: benl >> Date: Sat Jun 18 13:56:33 2011 >> New Revision: 223262 >> URL: http://svn.freebsd.org/changeset/base/223262 >> >> Log: >> Fix clang warnings. >> >> Modified: head/sys/sys/diskpc98.h >> ============================================================================== >> --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -36,8 +36,11 @@ >> #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ >> +#undef DOSPARTOFF >> #define DOSPARTOFF 0 >> +#undef DOSPARTSIZE >> #define DOSPARTSIZE 32 >> +#undef NDOSPART >> #define NDOSPART 16 >> #define DOSMAGICOFFSET 510 >> #define DOSMAGIC 0xAA55 >> @@ -52,6 +55,7 @@ >> >> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >> +#undef DOSPTYP_386BSD >> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >> >> struct pc98_partition { >> > > I wonder why this is needed, and why only for diskpc98.h, not > diskmbr.h. It is needed because it is defined elsewhere, of course. I don't know why it isn't needed for diskmbr.h - perhaps that's the elsewhere? > > --- > TAKAHASHI Yoshihiro > > -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 12:15:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0209106564A; Sun, 19 Jun 2011 12:15:59 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB2A8FC0A; Sun, 19 Jun 2011 12:15:59 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id C5D0A33C21; Sun, 19 Jun 2011 13:15:58 +0100 (BST) Message-ID: <4DFDE87E.2050309@links.org> Date: Sun, 19 Jun 2011 13:15:58 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Kostik Belousov References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618174531.GW48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110618174531.GW48734@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 12:16:00 -0000 On 18/06/2011 18:45, Kostik Belousov wrote: >> Modified: head/sys/sys/param.h >> ============================================================================== >> --- head/sys/sys/param.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -319,4 +319,10 @@ __END_DECLS >> #define member2struct(s, m, x) \ >> ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) >> >> +/* >> + * Access a variable length array that has been declared as a fixed >> + * length array. >> + */ >> +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) >> + >> #endif /* _SYS_PARAM_H_ */ > > The "typeof" there should be "__typeof", most likely. Hmm. Clang's own headers use __typeof__, it seems. gcc's docs also use __typeof__. -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 12:21:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C3A9106566B; Sun, 19 Jun 2011 12:21:02 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id EFCD08FC0A; Sun, 19 Jun 2011 12:21:01 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id 0E3B833C22; Sun, 19 Jun 2011 13:21:01 +0100 (BST) Message-ID: <4DFDE9AC.1090000@links.org> Date: Sun, 19 Jun 2011 13:21:00 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ben Kaduk References: <201106181356.p5IDuXhW044171@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 12:21:02 -0000 On 18/06/2011 16:54, Ben Kaduk wrote: > On Sat, Jun 18, 2011 at 9:56 AM, Ben Laurie wrote: >> +# warning need td_popc() implementation > > We seem to still be in dt_popc(), here. Oops. -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 12:52:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE52106566C; Sun, 19 Jun 2011 12:52:51 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC908FC08; Sun, 19 Jun 2011 12:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JCqofk094260; Sun, 19 Jun 2011 12:52:50 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JCqo6K094258; Sun, 19 Jun 2011 12:52:50 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201106191252.p5JCqo6K094258@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 19 Jun 2011 12:52: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: r223293 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 12:52:51 -0000 Author: simon Date: Sun Jun 19 12:52:50 2011 New Revision: 223293 URL: http://svn.freebsd.org/changeset/base/223293 Log: Do not use #warning to warn about missing implementation of dt_popc(), but just have a comment that this is broken. This is just a bandaid until somebody can fix this correctly. The code is just a broken as it was before r223262 - now buildworld just doesn't fail. Tested by: i386 + amd64 buildworld With hat: benl co-mentor Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 11:42:48 2011 (r223292) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 12:52:50 2011 (r223293) @@ -828,7 +828,7 @@ dt_popc(ulong_t x) x = x + (x >> 32); return (x & 0x7F); #else -# warning need td_popc() implementation +/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */ #endif } From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 13:35:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61C7F106564A; Sun, 19 Jun 2011 13:35:36 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518278FC08; Sun, 19 Jun 2011 13:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JDZa0k095646; Sun, 19 Jun 2011 13:35:36 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZaa3095644; Sun, 19 Jun 2011 13:35:36 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZaa3095644@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223294 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 13:35:36 -0000 Author: kan Date: Sun Jun 19 13:35:36 2011 New Revision: 223294 URL: http://svn.freebsd.org/changeset/base/223294 Log: Do not set thread name to less than informative 'initial thread'. Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sun Jun 19 12:52:50 2011 (r223293) +++ head/lib/libthr/thread/thr_init.c Sun Jun 19 13:35:36 2011 (r223294) @@ -409,7 +409,6 @@ init_main_thread(struct pthread *thread) thread->cancel_enable = 1; thread->cancel_async = 0; - thr_set_name(thread->tid, "initial thread"); /* Initialize the mutex queue: */ TAILQ_INIT(&thread->mutexq); From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 13:35:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DBB2106574F; Sun, 19 Jun 2011 13:35:41 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B95DE8FC0A; Sun, 19 Jun 2011 13:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JDZfuB095681; Sun, 19 Jun 2011 13:35:41 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZfES095679; Sun, 19 Jun 2011 13:35:41 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZfES095679@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223295 - 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: Sun, 19 Jun 2011 13:35:42 -0000 Author: kan Date: Sun Jun 19 13:35:41 2011 New Revision: 223295 URL: http://svn.freebsd.org/changeset/base/223295 Log: Minimize backward seeks when trying to load ELF relocatable modules. Some of loader filesystems are very ill equipped to handle seeking backwards within the file. Namely, tftp requires trasfer to be restarted from the start of the file every time we go backwards. Modified: head/sys/boot/common/load_elf_obj.c Modified: head/sys/boot/common/load_elf_obj.c ============================================================================== --- head/sys/boot/common/load_elf_obj.c Sun Jun 19 13:35:36 2011 (r223294) +++ head/sys/boot/common/load_elf_obj.c Sun Jun 19 13:35:41 2011 (r223295) @@ -196,7 +196,7 @@ static int __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) { Elf_Ehdr *hdr; - Elf_Shdr *shdr; + Elf_Shdr *shdr, *cshdr, *lshdr; vm_offset_t firstaddr, lastaddr; int i, nsym, res, ret, shdrbytes, symstrindex; @@ -294,12 +294,35 @@ __elfN(obj_loadimage)(struct preloaded_f /* Clear the whole area, including bss regions. */ kern_bzero(firstaddr, lastaddr - firstaddr); - /* Now read it all in. */ - for (i = 0; i < hdr->e_shnum; i++) { - if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS) - continue; - if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr, - shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) { + /* Figure section with the lowest file offset we haven't loaded yet. */ + for (cshdr = NULL; /* none */; /* none */) + { + /* + * Find next section to load. The complexity of this loop is + * O(n^2), but with the number of sections being typically + * small, we do not care. + */ + lshdr = cshdr; + + for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_addr == 0 || + shdr[i].sh_type == SHT_NOBITS) + continue; + /* Skip sections that were loaded already. */ + if (lshdr != NULL && + lshdr->sh_offset >= shdr[i].sh_offset) + continue; + /* Find section with smallest offset. */ + if (cshdr == lshdr || + cshdr->sh_offset > shdr[i].sh_offset) + cshdr = &shdr[i]; + } + + if (cshdr == lshdr) + break; + + if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr, + cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) { printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadimage: read failed\n"); goto out; From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 13:35:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00C8106566B; Sun, 19 Jun 2011 13:35:46 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC2A8FC18; Sun, 19 Jun 2011 13:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JDZkx2095717; Sun, 19 Jun 2011 13:35:46 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZk11095714; Sun, 19 Jun 2011 13:35:46 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZk11095714@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35: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: r223296 - head/lib/libc/iconv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 13:35:46 -0000 Author: kan Date: Sun Jun 19 13:35:46 2011 New Revision: 223296 URL: http://svn.freebsd.org/changeset/base/223296 Log: Put a quick bandaid on internal citrus locking. The code is not quite right still, but it programs from deadlocking on themselves if one enables new citrus code by mistake. Modified: head/lib/libc/iconv/citrus_mapper.c head/lib/libc/iconv/iconv.c Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Sun Jun 19 13:35:41 2011 (r223295) +++ head/lib/libc/iconv/citrus_mapper.c Sun Jun 19 13:35:46 2011 (r223296) @@ -337,7 +337,9 @@ _citrus_mapper_open(struct _citrus_mappe goto quit; /* open mapper */ + UNLOCK; ret = mapper_open(ma, &cm, module, variable); + WLOCK; if (ret) goto quit; cm->cm_key = strdup(mapname); Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Sun Jun 19 13:35:41 2011 (r223295) +++ head/lib/libc/iconv/iconv.c Sun Jun 19 13:35:46 2011 (r223296) @@ -85,7 +85,7 @@ _iconv_open(const char *out, const char errno = ENOMEM; return ((iconv_t)-1); } - + p = out_truncated; while (*p != 0) { if (p[0] == '/' && p[1] == '/') { From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 15:17:49 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D0A106566C; Sun, 19 Jun 2011 15:17:49 +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 B0A838FC14; Sun, 19 Jun 2011 15:17:48 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5JFHjuG016001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 01:17:46 +1000 Date: Mon, 20 Jun 2011 01:17:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ben Laurie In-Reply-To: <4DFDE87E.2050309@links.org> Message-ID: <20110620010724.I1817@besplex.bde.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618174531.GW48734@deviant.kiev.zoral.com.ua> <4DFDE87E.2050309@links.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , Ben Laurie , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 15:17:49 -0000 On Sun, 19 Jun 2011, Ben Laurie wrote: > On 18/06/2011 18:45, Kostik Belousov wrote: >>> Modified: head/sys/sys/param.h >>> ============================================================================== >>> --- head/sys/sys/param.h Sat Jun 18 13:54:36 2011 (r223261) >>> +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) >>> @@ -319,4 +319,10 @@ __END_DECLS >>> #define member2struct(s, m, x) \ >>> ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) >>> >>> +/* >>> + * Access a variable length array that has been declared as a fixed >>> + * length array. >>> + */ >>> +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) >>> + >>> #endif /* _SYS_PARAM_H_ */ >> >> The "typeof" there should be "__typeof", most likely. > > Hmm. Clang's own headers use __typeof__, it seems. gcc's docs also use > __typeof__. gcc supports but __foo__ and __foo for most things. The excessive underscores in __foo are style bugs and are not used in FreeBSD if possible. (They are useless, unlike leading underscores which are used to put identifiers in reserved namespaces.) Unfortunately, gcc doesn't actually document the alternative __foo form, at least in gcc*.info, and it doesn't support the __foo form for a few identifiers (notably for attributes). typeof in the above is an error because it is in the application namespace. The above also has some style bugs. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 15:23:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A4B11065673; Sun, 19 Jun 2011 15:23:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5978FC1B; Sun, 19 Jun 2011 15:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JFNXWD099020; Sun, 19 Jun 2011 15:23:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JFNXaJ099018; Sun, 19 Jun 2011 15:23:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106191523.p5JFNXaJ099018@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 15:23: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: r223298 - head/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: Sun, 19 Jun 2011 15:23:33 -0000 Author: jilles Date: Sun Jun 19 15:23:32 2011 New Revision: 223298 URL: http://svn.freebsd.org/changeset/base/223298 Log: rc.subr: Make sure all functions are under if [ -z "${_rc_subr_loaded}" ]. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jun 19 14:22:35 2011 (r223297) +++ head/etc/rc.subr Sun Jun 19 15:23:32 2011 (r223298) @@ -1732,8 +1732,6 @@ check_required_after() return 0 } -fi - # check_kern_features mib # Return existence of kern.features.* sysctl MIB as true or # false. The result will be cached in $_rc_cache_kern_features_ @@ -1775,4 +1773,6 @@ _echoonce() esac } +fi # [ -z "${_rc_subr_loaded}" ] + _rc_subr_loaded=: From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 13:56:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00996106566B; Sun, 19 Jun 2011 13:56:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id C036E8FC12; Sun, 19 Jun 2011 13:56:50 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LN100000IQPTM00@smtpauth2.wiscmail.wisc.edu>; Sun, 19 Jun 2011 08:56:49 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-76-208-70-37.dsl.mdsnwi.sbcglobal.net [76.208.70.37]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LN100GZ9IQORB00@smtpauth2.wiscmail.wisc.edu>; Sun, 19 Jun 2011 08:56:49 -0500 (CDT) Date: Sun, 19 Jun 2011 08:56:48 -0500 From: Nathan Whitehorn In-reply-to: To: Adrian Chadd Message-id: <4DFE0020.9050301@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.70.37 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.19.135114, SenderIP=76.208.70.37 References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> <4DFD0BBA.1010502@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 X-Mailman-Approved-At: Sun, 19 Jun 2011 15:43:11 +0000 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 13:56:51 -0000 On 06/18/11 19:07, Adrian Chadd wrote: > On 19 June 2011 04:34, Nathan Whitehorn wrote: > >> Since all of our install CDs for 9.0 (even the boot-only ones!) will be live >> CDs, the full versions of everything in /rescue are on the CD in their usual >> locations in /bin, /sbin, etc. and these can be used just as well for fixing >> a system as the /rescue tools. >> -Nathan > Question - is sysinstall still installed on those? > > If so (it was installed on the USB -current image I used to install > from a month or so ago) it confused me as I ran sysinstall fine but I > couldn't install anything using it. Yes, it is. But it won't work for anything except system configuration. It would need to be updated to use the new distfile format, and that won't has not yet been done. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 17:02:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BADBF106566B; Sun, 19 Jun 2011 17:02:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9273A8FC0C; Sun, 19 Jun 2011 17:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JH2gDn002238; Sun, 19 Jun 2011 17:02:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JH2gHd002237; Sun, 19 Jun 2011 17:02:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191702.p5JH2gHd002237@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 17:02: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: r223301 - head/contrib/lukemftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 17:02:42 -0000 Author: gavin Date: Sun Jun 19 17:02:42 2011 New Revision: 223301 URL: http://svn.freebsd.org/changeset/base/223301 Log: Bootstrap mergeinfo Modified: Directory Properties: head/contrib/lukemftp/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 17:07:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DFE1065670; Sun, 19 Jun 2011 17:07:59 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37A3A8FC0A; Sun, 19 Jun 2011 17:07:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JH7xtt002423; Sun, 19 Jun 2011 17:07:59 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JH7xfO002422; Sun, 19 Jun 2011 17:07:59 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201106191707.p5JH7xfO002422@svn.freebsd.org> From: Steve Kargl Date: Sun, 19 Jun 2011 17:07: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: r223302 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 17:07:59 -0000 Author: kargl Date: Sun Jun 19 17:07:58 2011 New Revision: 223302 URL: http://svn.freebsd.org/changeset/base/223302 Log: In the libm access macros for the double type, z can sometimes be used uninitialized. This can lead to spurious exceptions and bit clobbering. Submitted by: bde Approved by: das (mentor) Modified: head/lib/msun/src/e_rem_pio2.c Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:02:42 2011 (r223301) +++ head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:07:58 2011 (r223302) @@ -171,9 +171,8 @@ medium: } /* set z = scalbn(|x|,ilogb(x)-23) */ GET_LOW_WORD(low,x); - SET_LOW_WORD(z,low); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ - SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20))); + INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low); for(i=0;i<2;i++) { tx[i] = (double)((int32_t)(z)); z = (z-tx[i])*two24; From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 18:09:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B261065670; Sun, 19 Jun 2011 18:09:45 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id CA6758FC14; Sun, 19 Jun 2011 18:09:44 +0000 (UTC) Received: by vws18 with SMTP id 18so481302vws.13 for ; Sun, 19 Jun 2011 11:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=Sgj7G3st4e0+ZeurWeU39BOrlnZ2APQh5fL0g55mPH8=; b=HNwbiUHE0GCaxrmYYJmukuhOfHZqhAJCHz5K2y/dOQWYeLbVD+cfq3+QWsLmgOmMjA s0DQe/3ehg6c3mfGupIl2CQSvmDBI4o7cfQhU0EAVFVv9XDA+y/Y8OmqY0V5TaLYwxtP JQVuPLL8t9y/cp8jjD8IjDSpLvgn5sASu4hW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=ZdwE/L0mJekHmfv1diiI+c3LyY7C9b83OWSQjUypxWRZLly+Hb0WBEArhh/dJfXwWU 4RR3aKNqbJOQ9XcaDwdoJNW6BZR3/MA5cHrJSP8ie7toWL4u4g2HT0Ea2q3YdNvnWm8N 6n3qCVt/GhEgJ8k56cKGsP4H8CDv8iG9rIcJM= Received: by 10.52.94.50 with SMTP id cz18mr2357033vdb.299.1308506983776; Sun, 19 Jun 2011 11:09:43 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id l31sm263957vbr.23.2011.06.19.11.09.41 (version=SSLv3 cipher=OTHER); Sun, 19 Jun 2011 11:09:42 -0700 (PDT) Date: Sun, 19 Jun 2011 14:09:34 -0400 From: Alexander Kabaev To: Craig Rodrigues Message-ID: <20110619140934.08375095@kan.dnsalias.net> In-Reply-To: <201106152213.p5FMDMWP000491@svn.freebsd.org> References: <201106152213.p5FMDMWP000491@svn.freebsd.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ilJimhLH9t.o+OsibXxI69z"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223124 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 18:09:45 -0000 --Sig_/ilJimhLH9t.o+OsibXxI69z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 15 Jun 2011 22:13:22 +0000 (UTC) Craig Rodrigues wrote: > Author: rodrigc > Date: Wed Jun 15 22:13:22 2011 > New Revision: 223124 > URL: http://svn.freebsd.org/changeset/base/223124 >=20 > Log: > (1) When sending the TFTP RRQ packet to read a file, > send along the "blksize" option specified in RFC2348, > and the "tsize" option specified in RFC2349. > =20 > Add code to parse the TFTP Option Acknowledgement (OACK) > packet as specified in RFC2347. > =20 > For TFTP servers which support the "blksize" option, we can > specify a TFTP Data block size larger than the default 512 > bytes specified in RFC1350. This offers greater read performance when > downloading files. > =20 > We request an initial size of 1428 bytes, which is less than > the Ethernet MTU of 1500 bytes. If the TFTP server sends back an OACK > packet, then use the block size specified in the OACK packet. > Most times it is usually the same value as what we request. > If the TFTP server supports RFC2348, we will see performance > improvements by transferring files over TFTP with larger block sizes. > =20 > If we do not get back an OACK packet, then we most likely we > are interoperating with a legacy TFTP server that does not > support TFTP extension options, so default to the block size of > 512 bytes. > =20 > (2) If the "tftp.blksize" environment variable is set, then > take that value and use it when sending the TFTP RRQ packet, > instead of 1428. This allows us to set different values of > "tftp.blksize" in the loader, so that we can test out different > TFTP block sizes at run time. > =20 > Obtained from: Juniper Networks > Fixed by: rodrigc >=20 Has this code been reviewed by anyone outside of Juniper? --=20 Alexander Kabaev --Sig_/ilJimhLH9t.o+OsibXxI69z Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFN/jtkQ6z1jMm+XZYRAkPjAJwNCaXWx//1zVtErp9TxMC7JsaReACgsWda YJc3I++q8CjXfupQNUTyVNc= =kwQG -----END PGP SIGNATURE----- --Sig_/ilJimhLH9t.o+OsibXxI69z-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 18:34:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7398106566B; Sun, 19 Jun 2011 18:34:49 +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 C5EA98FC13; Sun, 19 Jun 2011 18:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JIYn3I005145; Sun, 19 Jun 2011 18:34:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JIYnMh005137; Sun, 19 Jun 2011 18:34:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106191834.p5JIYnMh005137@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 19 Jun 2011 18:34: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: r223306 - in head/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 18:34:49 -0000 Author: marcel Date: Sun Jun 19 18:34:49 2011 New Revision: 223306 URL: http://svn.freebsd.org/changeset/base/223306 Log: Add support for using mtree(5) manifest files to define the image to be created. The support is based on mtree version 2.0, as used in libarchive, but adds new features on top of it. The current implementation is fully functional, but is envisioned to grow at least the following additional features over time: o Add support for the /include special command so that manifest files can be constructed using includable fragments. o Add support specifying a search path to locate content files. o Content file filters: commands that provide file contents on stdout. The manifest file eliminates the need to first construct a tree as root in order to create an image and allows images (releases) to be created directly from object trees and/or source trees. Reviewed by: deo Sponsored by: Juniper Networks, Inc Added: head/usr.sbin/makefs/mtree.c (contents, props changed) Modified: head/usr.sbin/makefs/Makefile head/usr.sbin/makefs/cd9660/cd9660_write.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/Makefile Sun Jun 19 18:34:49 2011 (r223306) @@ -7,6 +7,7 @@ CFLAGS+=-I${.CURDIR} SRCS= cd9660.c ffs.c \ getid.c \ makefs.c \ + mtree.c \ walk.c MAN= makefs.8 @@ -26,4 +27,7 @@ SRCS+= misc.c spec.c .PATH: ${.CURDIR}/../../sys/ufs/ffs SRCS+= ffs_tables.c +DPADD= ${LIBSBUF} +LDADD= -lsbuf + .include Modified: head/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_write.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/cd9660/cd9660_write.c Sun Jun 19 18:34:49 2011 (r223306) @@ -294,10 +294,12 @@ cd9660_write_file(FILE *fd, cd9660node * INODE_WARNX(("%s: writing inode %d blocks at %" PRIu32, __func__, (int)inode->st.st_ino, inode->ino)); inode->flags |= FI_WRITTEN; - cd9660_compute_full_filename(writenode, - temp_file_name, 0); + if (writenode->node->contents == NULL) + cd9660_compute_full_filename(writenode, + temp_file_name, 0); ret = cd9660_copy_file(fd, writenode->fileDataSector, - temp_file_name); + (writenode->node->contents != NULL) ? + writenode->node->contents : temp_file_name); if (ret == 0) goto out; } Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/ffs.c Sun Jun 19 18:34:49 2011 (r223306) @@ -776,9 +776,11 @@ ffs_populate_dir(const char *dir, fsnode continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; - if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) - >= sizeof(path)) - errx(1, "Pathname too long."); + if (cur->contents == NULL) { + if (snprintf(path, sizeof(path), "%s/%s", dir, + cur->name) >= sizeof(path)) + errx(1, "Pathname too long."); + } if (cur->child != NULL) continue; /* child creates own inode */ @@ -802,7 +804,8 @@ ffs_populate_dir(const char *dir, fsnode if (membuf != NULL) { ffs_write_file(&din, cur->inode->ino, membuf, fsopts); } else if (S_ISREG(cur->type)) { - ffs_write_file(&din, cur->inode->ino, path, fsopts); + ffs_write_file(&din, cur->inode->ino, + (cur->contents) ? cur->contents : path, fsopts); } else { assert (! S_ISDIR(cur->type)); ffs_write_inode(&din, cur->inode->ino, fsopts); Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.8 Sun Jun 19 18:34:49 2011 (r223306) @@ -40,7 +40,7 @@ .Os .Sh NAME .Nm makefs -.Nd create a file system image from a directory tree +.Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm .Op Fl x @@ -57,14 +57,16 @@ .Op Fl s Ar image-size .Op Fl t Ar fs-type .Ar image-file -.Ar directory +.Ar directory | manifest .Sh DESCRIPTION The utility .Nm creates a file system image into .Ar image-file from the directory tree -.Ar directory . +.Ar directory +or from the mtree manifest +.Ar manifest . No special devices or privileges are required to perform this task. .Pp The options are as follows: @@ -106,6 +108,8 @@ as an .Xr mtree 8 .Sq specfile specification. +This option has no effect when the image is created from a mtree manifest +rather than a directory. .Pp If a specfile entry exists in the underlying file system, its permissions and modification time will be used unless specifically @@ -330,6 +334,7 @@ Use RockRidge extensions (for longer fil Volume set identifier of the image. .El .Sh SEE ALSO +.Xr mtree 5 , .Xr mtree 8 , .Xr newfs 8 .Sh HISTORY Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.c Sun Jun 19 18:34:49 2011 (r223306) @@ -38,6 +38,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -80,11 +82,13 @@ int main(int, char *[]); int main(int argc, char *argv[]) { + struct stat sb; struct timeval start; fstype_t *fstype; fsinfo_t fsoptions; fsnode *root; int ch, len; + char *subtree; char *specfile; setprogname(argv[0]); @@ -244,26 +248,47 @@ main(int argc, char *argv[]) if (fsoptions.onlyspec != 0 && specfile == NULL) errx(1, "-x requires -F mtree-specfile."); - /* walk the tree */ - TIMER_START(start); - root = walk_dir(argv[1], NULL); - TIMER_RESULTS(start, "walk_dir"); + /* Accept '-' as meaning "read from standard input". */ + if (strcmp(argv[1], "-") == 0) + sb.st_mode = S_IFREG; + else { + if (stat(argv[1], &sb) == -1) + err(1, "Can't stat `%s'", argv[1]); + } + + switch (sb.st_mode & S_IFMT) { + case S_IFDIR: /* walk the tree */ + subtree = argv[1]; + TIMER_START(start); + root = walk_dir(subtree, NULL); + TIMER_RESULTS(start, "walk_dir"); + break; + case S_IFREG: /* read the manifest file */ + subtree = "."; + TIMER_START(start); + root = read_mtree(argv[1], NULL); + TIMER_RESULTS(start, "manifest"); + break; + default: + errx(1, "%s: not a file or directory", argv[1]); + /* NOTREACHED */ + } if (specfile) { /* apply a specfile */ TIMER_START(start); - apply_specfile(specfile, argv[1], root, fsoptions.onlyspec); + apply_specfile(specfile, subtree, root, fsoptions.onlyspec); TIMER_RESULTS(start, "apply_specfile"); } if (debug & DEBUG_DUMP_FSNODES) { - printf("\nparent: %s\n", argv[1]); + printf("\nparent: %s\n", subtree); dump_fsnodes(".", root); putchar('\n'); } /* build the file system */ TIMER_START(start); - fstype->make_fs(argv[0], argv[1], root, &fsoptions); + fstype->make_fs(argv[0], subtree, root, &fsoptions); TIMER_RESULTS(start, "make_fs"); free_fsnodes(root); @@ -311,7 +336,7 @@ usage(void) "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" -"\t[-N userdb-dir] image-file directory\n", +"\t[-N userdb-dir] image-file directory | manifest\n", prog); exit(1); } Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.h Sun Jun 19 18:34:49 2011 (r223306) @@ -93,11 +93,13 @@ typedef struct _fsnode { uint32_t type; /* type of entry */ fsinode *inode; /* actual inode data */ char *symlink; /* symlink target */ + char *contents; /* file to provide contents */ char *name; /* file name */ int flags; /* misc flags */ } fsnode; #define FSNODE_F_HASSPEC 0x01 /* fsnode has a spec entry */ +#define FSNODE_F_OPTIONAL 0x02 /* fsnode is optional */ /* * fsinfo_t - contains various settings and parameters pertaining to @@ -147,6 +149,7 @@ typedef struct { void apply_specfile(const char *, const char *, fsnode *, int); void dump_fsnodes(const char *, fsnode *); const char * inode_type(mode_t); +fsnode * read_mtree(const char *, fsnode *); int set_option(option_t *, const char *, const char *); fsnode * walk_dir(const char *, fsnode *); void free_fsnodes(fsnode *); Added: head/usr.sbin/makefs/mtree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/makefs/mtree.c Sun Jun 19 18:34:49 2011 (r223306) @@ -0,0 +1,1051 @@ +/*- + * Copyright (c) 2011 Marcel Moolenaar + * 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(S) ``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(S) 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 "makefs.h" + +#define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0') +#define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0') + +struct mtree_fileinfo { + SLIST_ENTRY(mtree_fileinfo) next; + FILE *fp; + const char *name; + u_int line; +}; + +/* Global state used while parsing. */ +static SLIST_HEAD(, mtree_fileinfo) mtree_fileinfo = + SLIST_HEAD_INITIALIZER(mtree_fileinfo); +static fsnode *mtree_root; +static fsnode *mtree_current; +static fsnode mtree_global; +static fsinode mtree_global_inode; +static u_int errors, warnings; + +static void mtree_error(const char *, ...) __printflike(1, 2); +static void mtree_warning(const char *, ...) __printflike(1, 2); + +static int +mtree_file_push(const char *name, FILE *fp) +{ + struct mtree_fileinfo *fi; + + fi = malloc(sizeof(*fi)); + if (fi == NULL) + return (ENOMEM); + + if (strcmp(name, "-") == 0) + fi->name = strdup("(stdin)"); + else + fi->name = strdup(name); + if (fi->name == NULL) { + free(fi); + return (ENOMEM); + } + + fi->fp = fp; + fi->line = 0; + + SLIST_INSERT_HEAD(&mtree_fileinfo, fi, next); + return (0); +} + +static void +mtree_print(const char *msgtype, const char *fmt, va_list ap) +{ + struct mtree_fileinfo *fi; + + if (msgtype != NULL) { + fi = SLIST_FIRST(&mtree_fileinfo); + if (fi != NULL) + fprintf(stderr, "%s:%u: ", fi->name, fi->line); + fprintf(stderr, "%s: ", msgtype); + } + vfprintf(stderr, fmt, ap); +} + +static void +mtree_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + mtree_print("error", fmt, ap); + va_end(ap); + + errors++; + fputc('\n', stderr); +} + +static void +mtree_warning(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + mtree_print("warning", fmt, ap); + va_end(ap); + + warnings++; + fputc('\n', stderr); +} + +/* mtree_resolve() sets errno to indicate why NULL was returned. */ +static char * +mtree_resolve(const char *spec, int *istemp) +{ + struct sbuf *sb; + char *res, *var; + const char *base, *p, *v; + size_t len; + int c, error, quoted, subst; + + len = strlen(spec); + if (len == 0) { + errno = EINVAL; + return (NULL); + } + + c = (len > 1) ? (spec[0] == spec[len - 1]) ? spec[0] : 0 : 0; + *istemp = (c == '`') ? 1 : 0; + subst = (c == '`' || c == '"') ? 1 : 0; + quoted = (subst || c == '\'') ? 1 : 0; + + if (!subst) { + res = strdup(spec + quoted); + if (res != NULL && quoted) + res[len - 2] = '\0'; + return (res); + } + + sb = sbuf_new_auto(); + if (sb == NULL) { + errno = ENOMEM; + return (NULL); + } + + base = spec + 1; + len -= 2; + error = 0; + while (len > 0) { + p = strchr(base, '$'); + if (p == NULL) { + sbuf_bcat(sb, base, len); + base += len; + len = 0; + continue; + } + /* The following is safe. spec always starts with a quote. */ + if (p[-1] == '\\') + p--; + if (base != p) { + sbuf_bcat(sb, base, p - base); + len -= p - base; + base = p; + } + if (*p == '\\') { + sbuf_putc(sb, '$'); + base += 2; + len -= 2; + continue; + } + /* Skip the '$'. */ + base++; + len--; + /* Handle ${X} vs $X. */ + v = base; + if (*base == '{') { + p = strchr(v, '}'); + if (p == NULL) + p = v; + } else + p = v; + len -= (p + 1) - base; + base = p + 1; + + if (v == p) { + sbuf_putc(sb, *v); + continue; + } + + error = ENOMEM; + var = calloc(p - v, 1); + if (var == NULL) + break; + + memcpy(var, v + 1, p - v - 1); + if (strcmp(var, ".CURDIR") == 0) { + res = getcwd(NULL, 0); + if (res == NULL) + break; + } else if (strcmp(var, ".PROG") == 0) { + res = strdup(getprogname()); + if (res == NULL) + break; + } else { + v = getenv(var); + if (v != NULL) { + res = strdup(v); + if (res == NULL) + break; + } else + res = NULL; + } + error = 0; + + if (res != NULL) { + sbuf_cat(sb, res); + free(res); + } + free(var); + } + + sbuf_finish(sb); + res = (error == 0) ? strdup(sbuf_data(sb)) : NULL; + sbuf_delete(sb); + if (res == NULL) + errno = ENOMEM; + return (res); +} + +static int +skip_over(FILE *fp, const char *cs) +{ + int c; + + c = getc(fp); + while (c != EOF && strchr(cs, c) != NULL) + c = getc(fp); + if (c != EOF) { + ungetc(c, fp); + return (0); + } + return (ferror(fp) ? errno : -1); +} + +static int +skip_to(FILE *fp, const char *cs) +{ + int c; + + c = getc(fp); + while (c != EOF && strchr(cs, c) == NULL) + c = getc(fp); + if (c != EOF) { + ungetc(c, fp); + return (0); + } + return (ferror(fp) ? errno : -1); +} + +static int +read_word(FILE *fp, char *buf, size_t bufsz) +{ + struct mtree_fileinfo *fi; + size_t idx, qidx; + int c, done, error, esc, qlvl; + + if (bufsz == 0) + return (EINVAL); + + done = 0; + esc = 0; + idx = 0; + qidx = -1; + qlvl = 0; + do { + c = getc(fp); + switch (c) { + case EOF: + buf[idx] = '\0'; + error = ferror(fp) ? errno : -1; + if (error == -1) + mtree_error("unexpected end of file"); + return (error); + case '\\': + esc++; + if (esc == 1) + continue; + break; + case '`': + case '\'': + case '"': + if (esc) + break; + if (qlvl == 0) { + qlvl++; + qidx = idx; + } else if (c == buf[qidx]) { + qlvl--; + if (qlvl > 0) { + do { + qidx--; + } while (buf[qidx] != '`' && + buf[qidx] != '\'' && + buf[qidx] != '"'); + } else + qidx = -1; + } else { + qlvl++; + qidx = idx; + } + break; + case ' ': + case '\t': + case '\n': + if (!esc && qlvl == 0) { + ungetc(c, fp); + c = '\0'; + done = 1; + break; + } + if (c == '\n') { + /* + * We going to eat the newline ourselves. + */ + if (qlvl > 0) + mtree_warning("quoted word straddles " + "onto next line."); + fi = SLIST_FIRST(&mtree_fileinfo); + fi->line++; + } + break; + case 'a': + if (esc) + c = '\a'; + break; + case 'b': + if (esc) + c = '\b'; + break; + case 'f': + if (esc) + c = '\f'; + break; + case 'n': + if (esc) + c = '\n'; + break; + case 'r': + if (esc) + c = '\r'; + break; + case 't': + if (esc) + c = '\t'; + break; + case 'v': + if (esc) + c = '\v'; + break; + } + buf[idx++] = c; + esc = 0; + } while (idx < bufsz && !done); + + if (idx >= bufsz) { + mtree_error("word too long to fit buffer (max %zu characters)", + bufsz); + skip_to(fp, " \t\n"); + } + return (0); +} + +static fsnode * +create_node(const char *name, u_int type, fsnode *parent, fsnode *global) +{ + fsnode *n; + + n = calloc(1, sizeof(*n)); + if (n == NULL) + return (NULL); + + n->name = strdup(name); + if (n->name == NULL) { + free(n); + return (NULL); + } + + n->type = (type == 0) ? global->type : type; + n->parent = parent; + + n->inode = calloc(1, sizeof(*n->inode)); + if (n->inode == NULL) { + free(n->name); + free(n); + return (NULL); + } + + /* Assign global options/defaults. */ + bcopy(global->inode, n->inode, sizeof(*n->inode)); + n->inode->st.st_mode = (n->inode->st.st_mode & ~S_IFMT) | n->type; + + if (n->type == S_IFLNK) + n->symlink = global->symlink; + else if (n->type == S_IFREG) + n->contents = global->contents; + + return (n); +} + +static void +destroy_node(fsnode *n) +{ + + assert(n != NULL); + assert(n->name != NULL); + assert(n->inode != NULL); + + free(n->inode); + free(n->name); + free(n); +} + +static int +read_number(const char *tok, u_int base, intmax_t *res, intmax_t min, + intmax_t max) +{ + char *end; + intmax_t val; + + val = strtoimax(tok, &end, base); + if (end == tok || end[0] != '\0') + return (EINVAL); + if (val < min || val > max) + return (EDOM); + *res = val; + return (0); +} + +static int +read_mtree_keywords(FILE *fp, fsnode *node) +{ + char keyword[PATH_MAX]; + char *name, *p, *value; + struct group *grent; + struct passwd *pwent; + struct stat *st, sb; + intmax_t num; + u_long flset, flclr; + int error, istemp, type; + + st = &node->inode->st; + do { + error = skip_over(fp, " \t"); + if (error) + break; + + error = read_word(fp, keyword, sizeof(keyword)); + if (error) + break; + + if (keyword[0] == '\0') + break; + + value = strchr(keyword, '='); + if (value != NULL) + *value++ = '\0'; + + /* + * We use EINVAL, ENOATTR, ENOSYS and ENXIO to signal + * certain conditions: + * EINVAL - Value provided for a keyword that does + * not take a value. The value is ignored. + * ENOATTR - Value missing for a keyword that needs + * a value. The keyword is ignored. + * ENOSYS - Unsupported keyword encountered. The + * keyword is ignored. + * ENXIO - Value provided for a keyword that does + * not take a value. The value is ignored. + */ + switch (keyword[0]) { + case 'c': + if (strcmp(keyword, "contents") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + node->contents = strdup(value); + } else + error = ENOSYS; + break; + case 'f': + if (strcmp(keyword, "flags") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + flset = flclr = 0; + if (!strtofflags(&value, &flset, &flclr)) { + st->st_flags &= ~flclr; + st->st_flags |= flset; + } else + error = errno; + } else + error = ENOSYS; + break; + case 'g': + if (strcmp(keyword, "gid") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, UINT_MAX); + if (!error) + st->st_gid = num; + } else if (strcmp(keyword, "gname") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + grent = getgrnam(value); + if (grent != NULL) + st->st_gid = grent->gr_gid; + else + error = errno; + } else + error = ENOSYS; + break; + case 'l': + if (strcmp(keyword, "link") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + node->symlink = strdup(value); + } else + error = ENOSYS; + break; + case 'm': + if (strcmp(keyword, "mode") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + if (value[0] >= '0' && value[0] <= '9') { + error = read_number(value, 8, &num, + 0, 07777); + if (!error) { + st->st_mode &= S_IFMT; + st->st_mode |= num; + } + } else { + /* Symbolic mode not supported. */ + error = EINVAL; + break; + } + } else + error = ENOSYS; + break; + case 'o': + if (strcmp(keyword, "optional") == 0) { + if (value != NULL) + error = ENXIO; + node->flags |= FSNODE_F_OPTIONAL; + } else + error = ENOSYS; + break; + case 's': + if (strcmp(keyword, "size") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, INTMAX_MAX); + if (!error) + st->st_size = num; + } else + error = ENOSYS; + break; + case 't': + if (strcmp(keyword, "time") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + p = strchr(value, '.'); + if (p != NULL) + *p++ = '\0'; + error = read_number(value, 10, &num, 0, + INTMAX_MAX); + if (error) + break; + st->st_atime = num; + st->st_ctime = num; + st->st_mtime = num; + error = read_number(p, 10, &num, 0, + INTMAX_MAX); + if (error) + break; + if (num != 0) + error = EINVAL; + } else if (strcmp(keyword, "type") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + if (strcmp(value, "dir") == 0) + node->type = S_IFDIR; + else if (strcmp(value, "file") == 0) + node->type = S_IFREG; + else if (strcmp(value, "link") == 0) + node->type = S_IFLNK; + else + error = EINVAL; + } else + error = ENOSYS; + break; + case 'u': + if (strcmp(keyword, "uid") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, UINT_MAX); + if (!error) + st->st_uid = num; + } else if (strcmp(keyword, "uname") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + pwent = getpwnam(value); + if (pwent != NULL) + st->st_uid = pwent->pw_uid; + else + error = errno; + } else + error = ENOSYS; + break; + default: + error = ENOSYS; + break; + } + + switch (error) { + case EINVAL: + mtree_error("%s: invalid value '%s'", keyword, value); + break; + case ENOATTR: + mtree_error("%s: keyword needs a value", keyword); + break; + case ENOSYS: + mtree_warning("%s: unsupported keyword", keyword); + break; + case ENXIO: + mtree_error("%s: keyword does not take a value", + keyword); + break; + } + } while (1); + + if (error) + return (error); + + st->st_mode = (st->st_mode & ~S_IFMT) | node->type; + + /* Nothing more to do for the global defaults. */ + if (node->name == NULL) + return (0); + + /* + * Be intelligent about the file type. + */ + if (node->contents != NULL) { + if (node->symlink != NULL) { + mtree_error("%s: both link and contents keywords " + "defined", node->name); + return (0); + } + type = S_IFREG; + } else + type = (node->symlink != NULL) ? S_IFLNK : S_IFDIR; + + if (node->type == 0) + node->type = type; + + if (node->type != type) { + mtree_error("%s: file type and defined keywords to not match", + node->name); + return (0); + } + + st->st_mode = (st->st_mode & ~S_IFMT) | node->type; + + if (node->contents == NULL) + return (0); + + name = mtree_resolve(node->contents, &istemp); + if (name == NULL) + return (errno); + + if (stat(name, &sb) != 0) { + mtree_error("%s: contents file '%s' not found", node->name, + name); + free(name); + return (0); + } + + free(node->contents); + node->contents = name; + st->st_size = sb.st_size; + return (0); +} + +static int +read_mtree_command(FILE *fp) +{ + char cmd[10]; + int error; + + error = read_word(fp, cmd, sizeof(cmd)); + if (error) + goto out; + + error = read_mtree_keywords(fp, &mtree_global); + + out: + skip_to(fp, "\n"); + (void)getc(fp); + return (error); +} + +static int +read_mtree_spec1(FILE *fp, bool def, const char *name) +{ + fsnode *last, *node, *parent; + u_int type; + int error; + + assert(name[0] != '\0'); + + /* + * Treat '..' specially, because it only changes our current + * directory. We don't create a node for it. We simply ignore + * any keywords that may appear on the line as well. + * Going up a directory is a little non-obvious. A directory *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 18:56:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23605106566C; Sun, 19 Jun 2011 18:56:42 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from fsm2.ukr.net (fsm2.ukr.net [195.214.192.121]) by mx1.freebsd.org (Postfix) with ESMTP id BF9CA8FC16; Sun, 19 Jun 2011 18:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:Mime-Version:Message-ID:Subject:To:From:Date; bh=P0MuhD4hFUHIYMMwPRyjc0gk4heMV0em9qrgPgEXHrw=; b=oJXIXUcUyj4ShOOWGX9CJTdt4qAkMUGqPxUZ5fVjLaoXOOGEKTSrDk4BWL9sULHmSbB/aadefDUuFCIHJoFjuU9IdtAJ7Z1eO02LfZQtLPjAxHhYNR9uQ/BdrbRn97ok8UteHgPkLqoiSFbSnLFPS+1439Kn6EaC42UfbNmj6K4=; Received: from [46.185.1.38] (helo=localhost) by fsm2.ukr.net with esmtps ID 1QYMsY-000PPB-UK ; Sun, 19 Jun 2011 21:37:50 +0300 Date: Sun, 19 Jun 2011 21:37:49 +0300 From: Ivan Klymenko To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Doug Barton Message-ID: <20110619213749.0cf6397c@ukr.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWpqak/Pz/i4uIfHx8GBwZwcHAQEBA6o92AAAACHElEQVQ4jWWUTY7bMAyF6QzUPSEoa8PFHEBgqwuM4bVVg7MvZOj+R+ijpMTpjIwgkT7z75EKrdfattpXERG6zqvUOtAr2LCRYfEKcB4l/Q+2cc6XjQH7hv+2YZYreIk5nevZEPvuzUzptizHLzgDMnC5Wpbl7ewJlOEqlQF+DlCjgVLki0WV6FMDMsBxjlJiQulIznwZ+DxHiQyDyIg0wN3Oo6o6ZQ5s5AIfar+W2Wlmz+kCcb8tg6j3voMEwNrBQk69dDBDqw/urpqJH+m+Q6u/4QnoAeYpnUXC/s1iup9rhCd6xMgAqdDyAyFegbKkVAHeLCcOulPLawaoUIDos4M88iLNrVkU7uu5ccTDO6naJzWLum51C6Yb7y4HKKbdArLWir0PBiS8glJRBZHeyHl7J9lENpAC6qT9NlNG4u5hsVYDyJP6mlJJtY3oVju4WSUzHal1sDU17NASoBWSk40J2eBLBJhYrVmzC5gVALGpNIAiQgN6eGstOp9Oa6zFbbLTISYi28BGZDRUJKWeroECkCEkzXjUtbmmaKMfAx2RfbT69/cO+tgHcmx6AfyZOmj3NDIah0F0GB66d4CrdIoplNFFGHSpSheRxbo0W4S8azNItEoMWbw3uXAeJgCrmX5joz7CGXqSg6PcryEhnFr/C1C2ntPxBOYbdwY+8dO3+wZJyFlbMX9s8zNnvp/tLwAv03NB4j3HVpn8Awwm+GrlP6MVAAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r223264 - in head: etc/defaults etc/rc.d 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: Sun, 19 Jun 2011 18:56:42 -0000 Hello! Thanks for commit. I have a question: If a lot of kernel modules, option kld_list = "" supports moving to a new line? For example: kld_list = " ....< moduleN>\ " Maybe specify its example of manual documentation page for rc.conf? Thank you! Sorry for my english. From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 19:13:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75EE51065670; Sun, 19 Jun 2011 19:13:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 666A18FC1A; Sun, 19 Jun 2011 19:13:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JJDOD6006276; Sun, 19 Jun 2011 19:13:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JJDOqJ006272; Sun, 19 Jun 2011 19:13:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106191913.p5JJDOqJ006272@svn.freebsd.org> From: Alan Cox Date: Sun, 19 Jun 2011 19: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: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 19:13:24 -0000 Author: alc Date: Sun Jun 19 19:13:24 2011 New Revision: 223307 URL: http://svn.freebsd.org/changeset/base/223307 Log: Precisely document the synchronization rules for the page's dirty field. (Saying that the lock on the object that the page belongs to must be held only represents one aspect of the rules.) Eliminate the use of the page queues lock for atomically performing read- modify-write operations on the dirty field when the underlying architecture supports atomic operations on char and short types. Document the fact that 32KB pages aren't really supported. Reviewed by: attilio, kib Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 (r223307) @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, * caller's changes may go unnoticed because they are * performed through an unmanaged mapping or by a DMA * operation. + * + * The object lock is not held here. Therefore, like + * a pmap operation, the page queues lock may be + * required in order to call vm_page_dirty(). See + * vm_page_clear_dirty_mask(). */ +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ + defined(__mips__) + vm_page_dirty(*mp); +#else vm_page_lock_queues(); vm_page_dirty(*mp); vm_page_unlock_queues(); +#endif } } if (pmap_failed) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 (r223307) @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m /* * vm_page_dirty: * - * make page all dirty + * Set all bits in the page's dirty field. + * + * The object containing the specified page must be locked if the call is + * made from the machine-independent layer. If, however, the call is + * made from the pmap layer, then the page queues lock may be required. + * See vm_page_clear_dirty_mask(). */ void vm_page_dirty(vm_page_t m) @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in /* * If the object is locked and the page is neither VPO_BUSY nor * PG_WRITEABLE, then the page's dirty field cannot possibly be - * modified by a concurrent pmap operation. + * set by a concurrent pmap operation. */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) m->dirty &= ~pagebits; else { +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ + defined(__mips__) + /* + * On the aforementioned architectures, the page queues lock + * is not required by the following read-modify-write + * operation. The combination of the object's lock and an + * atomic operation suffice. Moreover, the pmap layer on + * these architectures can call vm_page_dirty() without + * holding the page queues lock. + */ +#if PAGE_SIZE == 4096 + atomic_clear_char(&m->dirty, pagebits); +#elif PAGE_SIZE == 8192 + atomic_clear_short(&m->dirty, pagebits); +#elif PAGE_SIZE == 16384 + atomic_clear_int(&m->dirty, pagebits); +#else +#error "PAGE_SIZE is not supported." +#endif +#else + /* + * Otherwise, the page queues lock is required to ensure that + * a concurrent pmap operation does not set the page's dirty + * field during the following read-modify-write operation. + */ vm_page_lock_queues(); m->dirty &= ~pagebits; vm_page_unlock_queues(); +#endif } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 (r223307) @@ -89,10 +89,26 @@ * and offset to which this page belongs (for pageout), * and sundry status bits. * - * Fields in this structure are locked either by the lock on the - * object that the page belongs to (O), its corresponding page lock (P), - * or by the lock on the page queues (Q). - * + * In general, operations on this structure's mutable fields are + * synchronized using either one of or a combination of the lock on the + * object that the page belongs to (O), the pool lock for the page (P), + * or the lock for either the free or paging queues (Q). If a field is + * annotated below with two of these locks, then holding either lock is + * sufficient for read access, but both locks are required for write + * access. + * + * In contrast, the synchronization of accesses to the page's dirty field + * is machine dependent (M). In the machine-independent layer, the lock + * on the object that the page belongs to must be held in order to + * operate on the field. However, the pmap layer is permitted to set + * all bits within the field without holding that lock. Therefore, if + * the underlying architecture does not support atomic read-modify-write + * operations on the field's type, then the machine-independent layer + * must also hold the page queues lock when performing read-modify-write + * operations and the pmap layer must hold the page queues lock when + * setting the field. In the machine-independent layer, the + * implementation of read-modify-write operations on the field is + * encapsulated in vm_page_clear_dirty_mask(). */ TAILQ_HEAD(pglist, vm_page); @@ -120,18 +136,19 @@ struct vm_page { u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ + /* In reality, support for 32KB pages is not fully implemented. */ #if PAGE_SIZE == 4096 u_char valid; /* map of valid DEV_BSIZE chunks (O) */ - u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 8192 u_short valid; /* map of valid DEV_BSIZE chunks (O) */ - u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 16384 u_int valid; /* map of valid DEV_BSIZE chunks (O) */ - u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 32768 u_long valid; /* map of valid DEV_BSIZE chunks (O) */ - u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */ #endif }; From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 21:50:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9EB6106564A; Sun, 19 Jun 2011 21:50:38 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 817FE8FC13; Sun, 19 Jun 2011 21:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JLocBf010904; Sun, 19 Jun 2011 21:50:38 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JLocvT010903; Sun, 19 Jun 2011 21:50:38 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106192150.p5JLocvT010903@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 21:50: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: r223308 - head/contrib/tnftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 21:50:38 -0000 Author: gavin Date: Sun Jun 19 21:50:38 2011 New Revision: 223308 URL: http://svn.freebsd.org/changeset/base/223308 Log: Copy lukemftp to its new home, tnftp. I'm doing this in stages so as to not confuse the CVS exporter. Added: head/contrib/tnftp/ - copied from r223307, head/contrib/lukemftp/ From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 22:08:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12CEA106564A; Sun, 19 Jun 2011 22:08:56 +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 008E78FC0C; Sun, 19 Jun 2011 22:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JM8t6x011552; Sun, 19 Jun 2011 22:08:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JM8tXb011541; Sun, 19 Jun 2011 22:08:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106192208.p5JM8tXb011541@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 22:08: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: r223309 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver kgssapi modules modules/kgssapi_krb5 nfsclient nfsserver 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, 19 Jun 2011 22:08:56 -0000 Author: rmacklem Date: Sun Jun 19 22:08:55 2011 New Revision: 223309 URL: http://svn.freebsd.org/changeset/base/223309 Log: Fix the kgssapi so that it can be loaded as a module. Currently the NFS subsystems use five of the rpcsec_gss/kgssapi entry points, but since it was not obvious which others might be useful, all nineteen were included. Basically the nineteen entry points are set in a structure called rpc_gss_entries and inline functions defined in sys/rpc/rpcsec_gss.h check for the entry points being non-NULL and then call them. A default value is returned otherwise. Requested by rwatson. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/kgssapi/gss_impl.c head/sys/modules/Makefile head/sys/modules/kgssapi_krb5/Makefile head/sys/nfsclient/nfs_krpc.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/rpc/rpc_generic.c head/sys/rpc/rpcsec_gss.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -323,9 +323,7 @@ newnfs_disconnect(struct nfssockreq *nrp client = nrp->nr_client; nrp->nr_client = NULL; mtx_unlock(&nrp->nr_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else { @@ -337,21 +335,18 @@ static AUTH * nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal, char *srv_principal, gss_OID mech_oid, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; #ifdef notyet rpc_gss_options_req_t req_options; #endif -#endif switch (secflavour) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!mech_oid) { - if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid)) + if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid)) return (NULL); } if (secflavour == RPCSEC_GSS_KRB5) @@ -367,7 +362,7 @@ nfs_getauth(struct nfssockreq *nrp, int req_options.input_channel_bindings = NULL; req_options.enc_type = nfs_keytab_enctype; - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, clnt_principal, srv_principal, mech_oid, svc, &req_options); #else @@ -377,7 +372,7 @@ nfs_getauth(struct nfssockreq *nrp, int * principals. As such, that case cannot yet be handled. */ if (clnt_principal == NULL) - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, srv_principal, mech_oid, svc); else auth = NULL; @@ -385,7 +380,6 @@ nfs_getauth(struct nfssockreq *nrp, int if (auth != NULL) return (auth); /* fallthrough */ -#endif /* KGSSAPI */ case AUTH_SYS: default: return (authunix_create(cred)); Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -215,12 +215,9 @@ nfscbd_addsock(struct file *fp) int nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args != NULL) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -229,7 +226,6 @@ nfscbd_nfsd(struct thread *td, struct nf } else { principal[0] = '\0'; } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -244,20 +240,16 @@ nfscbd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI if (principal[0] != '\0') - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif nfscbd_pool->sp_minthreads = 4; nfscbd_pool->sp_maxthreads = 4; svc_run(nfscbd_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif + rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS); NFSD_LOCK(); nfs_numnfscbd--; Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -386,18 +386,14 @@ nfsrvd_addsock(struct file *fp) int nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args) { -#ifdef KGSSAPI char principal[MAXHOSTNAMELEN + 5]; int error; bool_t ret2, ret3, ret4; -#endif -#ifdef KGSSAPI error = copyinstr(args->principal, principal, sizeof (principal), NULL); if (error) return (error); -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -412,38 +408,29 @@ nfsrvd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI /* An empty string implies AUTH_SYS only. */ if (principal[0] != '\0') { - ret2 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - ret3 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); - ret4 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); - - if (!ret2 || !ret3 || !ret4) { - NFSD_LOCK(); - newnfs_numnfsd--; - nfsrvd_init(1); - NFSD_UNLOCK(); - return (EAUTH); - } + ret2 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); + ret3 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); + ret4 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); + + if (!ret2 || !ret3 || !ret4) + printf("nfsd: can't register svc name\n"); } -#endif nfsrvd_pool->sp_minthreads = args->minthreads; nfsrvd_pool->sp_maxthreads = args->maxthreads; svc_run(nfsrvd_pool); -#ifdef KGSSAPI if (principal[0] != '\0') { - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER4); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4); } -#endif NFSD_LOCK(); newnfs_numnfsd--; Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/kgssapi/gss_impl.c Sun Jun 19 22:08:55 2011 (r223309) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gssd.h" #include "kgss_if.h" @@ -253,8 +254,40 @@ kgss_copy_buffer(const gss_buffer_t from static int kgssapi_modevent(module_t mod, int type, void *data) { + int error = 0; - return (0); + switch (type) { + case MOD_LOAD: + rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; + rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; + rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate; + rpc_gss_entries.rpc_gss_set_defaults = rpc_gss_set_defaults; + rpc_gss_entries.rpc_gss_max_data_length = + rpc_gss_max_data_length; + rpc_gss_entries.rpc_gss_get_error = rpc_gss_get_error; + rpc_gss_entries.rpc_gss_mech_to_oid = rpc_gss_mech_to_oid; + rpc_gss_entries.rpc_gss_oid_to_mech = rpc_gss_oid_to_mech; + rpc_gss_entries.rpc_gss_qop_to_num = rpc_gss_qop_to_num; + rpc_gss_entries.rpc_gss_get_mechanisms = rpc_gss_get_mechanisms; + rpc_gss_entries.rpc_gss_get_versions = rpc_gss_get_versions; + rpc_gss_entries.rpc_gss_is_installed = rpc_gss_is_installed; + rpc_gss_entries.rpc_gss_set_svc_name = rpc_gss_set_svc_name; + rpc_gss_entries.rpc_gss_clear_svc_name = rpc_gss_clear_svc_name; + rpc_gss_entries.rpc_gss_getcred = rpc_gss_getcred; + rpc_gss_entries.rpc_gss_set_callback = rpc_gss_set_callback; + rpc_gss_entries.rpc_gss_clear_callback = rpc_gss_clear_callback; + rpc_gss_entries.rpc_gss_get_principal_name = + rpc_gss_get_principal_name; + rpc_gss_entries.rpc_gss_svc_max_data_length = + rpc_gss_svc_max_data_length; + break; + case MOD_UNLOAD: + /* Unloading of the kgssapi module isn't supported. */ + /* FALLTHROUGH */ + default: + error = EOPNOTSUPP; + }; + return (error); } static moduledata_t kgssapi_mod = { "kgssapi", Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/modules/Makefile Sun Jun 19 22:08:55 2011 (r223309) @@ -155,6 +155,8 @@ SUBDIR= ${_3dfx} \ jme \ joy \ kbdmux \ + kgssapi \ + kgssapi_krb5 \ khelp \ krpc \ ksyms \ Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/modules/kgssapi_krb5/Makefile Sun Jun 19 22:08:55 2011 (r223309) @@ -8,7 +8,8 @@ SRCS= krb5_mech.c \ kcrypto_des.c \ kcrypto_des3.c \ kcrypto_aes.c \ - kcrypto_arcfour.c + kcrypto_arcfour.c \ + opt_inet6.h SRCS+= kgss_if.h gssd.h MFILES= kgssapi/kgss_if.m Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/nfsclient/nfs_krpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -306,9 +306,7 @@ nfs_disconnect(struct nfsmount *nmp) client = nmp->nm_client; nmp->nm_client = NULL; mtx_unlock(&nmp->nm_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else @@ -325,18 +323,15 @@ nfs_safedisconnect(struct nfsmount *nmp) static AUTH * nfs_getauth(struct nfsmount *nmp, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; -#endif switch (nmp->nm_secflavor) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!nmp->nm_mech_oid) - if (!rpc_gss_mech_to_oid("kerberosv5", + if (!rpc_gss_mech_to_oid_call("kerberosv5", &nmp->nm_mech_oid)) return (NULL); if (nmp->nm_secflavor == RPCSEC_GSS_KRB5) @@ -345,12 +340,11 @@ nfs_getauth(struct nfsmount *nmp, struct svc = rpc_gss_svc_integrity; else svc = rpc_gss_svc_privacy; - auth = rpc_gss_secfind(nmp->nm_client, cred, + auth = rpc_gss_secfind_call(nmp->nm_client, cred, nmp->nm_principal, nmp->nm_mech_oid, svc); if (auth) return (auth); /* fallthrough */ -#endif case AUTH_SYS: default: return (authunix_create(cred)); Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/nfsserver/nfs_srvkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -418,12 +418,9 @@ nfssvc_addsock(struct file *fp, struct t static int nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -434,7 +431,6 @@ nfssvc_nfsd(struct thread *td, struct nf getcredhostname(td->td_ucred, principal + 4, sizeof(principal) - 4); } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -449,12 +445,10 @@ nfssvc_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); -#endif if (args) { nfsrv_pool->sp_minthreads = args->minthreads; @@ -466,10 +460,8 @@ nfssvc_nfsd(struct thread *td, struct nf svc_run(nfsrv_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3); -#endif + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); NFSD_LOCK(); nfsrv_numnfsd--; Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/rpc/rpc_generic.c Sun Jun 19 22:08:55 2011 (r223309) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -69,6 +70,9 @@ extern u_long sb_max_adj; /* not defined #define strrchr rindex #endif +/* Provide an entry point hook for the rpcsec_gss module. */ +struct rpc_gss_entries rpc_gss_entries; + struct handle { NCONF_HANDLE *nhandle; int nflag; /* Whether NETPATH or NETCONFIG */ Modified: head/sys/rpc/rpcsec_gss.h ============================================================================== --- head/sys/rpc/rpcsec_gss.h Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/rpc/rpcsec_gss.h Sun Jun 19 22:08:55 2011 (r223309) @@ -141,6 +141,271 @@ typedef struct { __BEGIN_DECLS #ifdef _KERNEL +/* + * Set up a structure of entry points for the kgssapi module and inline + * functions named rpc_gss_XXX_call() to use them, so that the kgssapi + * module doesn't need to be loaded for the NFS modules to work using + * AUTH_SYS. The kgssapi modules will be loaded by the gssd(8) daemon + * when it is started up and the entry points will then be filled in. + */ +typedef AUTH *rpc_gss_secfind_ftype(CLIENT *clnt, struct ucred *cred, + const char *principal, gss_OID mech_oid, + rpc_gss_service_t service); +typedef void rpc_gss_secpurge_ftype(CLIENT *clnt); +typedef AUTH *rpc_gss_seccreate_ftype(CLIENT *clnt, struct ucred *cred, + const char *principal, const char *mechanism, + rpc_gss_service_t service, const char *qop, + rpc_gss_options_req_t *options_req, + rpc_gss_options_ret_t *options_ret); +typedef bool_t rpc_gss_set_defaults_ftype(AUTH *auth, + rpc_gss_service_t service, const char *qop); +typedef int rpc_gss_max_data_length_ftype(AUTH *handle, + int max_tp_unit_len); +typedef void rpc_gss_get_error_ftype(rpc_gss_error_t *error); +typedef bool_t rpc_gss_mech_to_oid_ftype(const char *mech, gss_OID *oid_ret); +typedef bool_t rpc_gss_oid_to_mech_ftype(gss_OID oid, const char **mech_ret); +typedef bool_t rpc_gss_qop_to_num_ftype(const char *qop, const char *mech, + u_int *num_ret); +typedef const char **rpc_gss_get_mechanisms_ftype(void); +typedef bool_t rpc_gss_get_versions_ftype(u_int *vers_hi, u_int *vers_lo); +typedef bool_t rpc_gss_is_installed_ftype(const char *mech); +typedef bool_t rpc_gss_set_svc_name_ftype(const char *principal, + const char *mechanism, u_int req_time, u_int program, + u_int version); +typedef void rpc_gss_clear_svc_name_ftype(u_int program, u_int version); +typedef bool_t rpc_gss_getcred_ftype(struct svc_req *req, + rpc_gss_rawcred_t **rcred, + rpc_gss_ucred_t **ucred, void **cookie); +typedef bool_t rpc_gss_set_callback_ftype(rpc_gss_callback_t *cb); +typedef void rpc_gss_clear_callback_ftype(rpc_gss_callback_t *cb); +typedef bool_t rpc_gss_get_principal_name_ftype(rpc_gss_principal_t *principal, + const char *mech, const char *name, const char *node, + const char *domain); +typedef int rpc_gss_svc_max_data_length_ftype(struct svc_req *req, + int max_tp_unit_len); + +struct rpc_gss_entries { + rpc_gss_secfind_ftype *rpc_gss_secfind; + rpc_gss_secpurge_ftype *rpc_gss_secpurge; + rpc_gss_seccreate_ftype *rpc_gss_seccreate; + rpc_gss_set_defaults_ftype *rpc_gss_set_defaults; + rpc_gss_max_data_length_ftype *rpc_gss_max_data_length; + rpc_gss_get_error_ftype *rpc_gss_get_error; + rpc_gss_mech_to_oid_ftype *rpc_gss_mech_to_oid; + rpc_gss_oid_to_mech_ftype *rpc_gss_oid_to_mech; + rpc_gss_qop_to_num_ftype *rpc_gss_qop_to_num; + rpc_gss_get_mechanisms_ftype *rpc_gss_get_mechanisms; + rpc_gss_get_versions_ftype *rpc_gss_get_versions; + rpc_gss_is_installed_ftype *rpc_gss_is_installed; + rpc_gss_set_svc_name_ftype *rpc_gss_set_svc_name; + rpc_gss_clear_svc_name_ftype *rpc_gss_clear_svc_name; + rpc_gss_getcred_ftype *rpc_gss_getcred; + rpc_gss_set_callback_ftype *rpc_gss_set_callback; + rpc_gss_clear_callback_ftype *rpc_gss_clear_callback; + rpc_gss_get_principal_name_ftype *rpc_gss_get_principal_name; + rpc_gss_svc_max_data_length_ftype *rpc_gss_svc_max_data_length; +}; +extern struct rpc_gss_entries rpc_gss_entries; + +/* Functions to access the entry points. */ +static __inline AUTH * +rpc_gss_secfind_call(CLIENT *clnt, struct ucred *cred, const char *principal, + gss_OID mech_oid, rpc_gss_service_t service) +{ + AUTH *ret = NULL; + + if (rpc_gss_entries.rpc_gss_secfind != NULL) + ret = (*rpc_gss_entries.rpc_gss_secfind)(clnt, cred, principal, + mech_oid, service); + return (ret); +} + +static __inline void +rpc_gss_secpurge_call(CLIENT *clnt) +{ + + if (rpc_gss_entries.rpc_gss_secpurge != NULL) + (*rpc_gss_entries.rpc_gss_secpurge)(clnt); +} + +static __inline AUTH * +rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred, const char *principal, + const char *mechanism, rpc_gss_service_t service, const char *qop, + rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret) +{ + AUTH *ret = NULL; + + if (rpc_gss_entries.rpc_gss_seccreate != NULL) + ret = (*rpc_gss_entries.rpc_gss_seccreate)(clnt, cred, + principal, mechanism, service, qop, options_req, + options_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_set_defaults_call(AUTH *auth, rpc_gss_service_t service, + const char *qop) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_defaults != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_defaults)(auth, service, + qop); + return (ret); +} + +static __inline int +rpc_gss_max_data_length_call(AUTH *handle, int max_tp_unit_len) +{ + int ret = 0; + + if (rpc_gss_entries.rpc_gss_max_data_length != NULL) + ret = (*rpc_gss_entries.rpc_gss_max_data_length)(handle, + max_tp_unit_len); + return (ret); +} + +static __inline void +rpc_gss_get_error_call(rpc_gss_error_t *error) +{ + + if (rpc_gss_entries.rpc_gss_get_error != NULL) + (*rpc_gss_entries.rpc_gss_get_error)(error); +} + +static __inline bool_t +rpc_gss_mech_to_oid_call(const char *mech, gss_OID *oid_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_mech_to_oid != NULL) + ret = (*rpc_gss_entries.rpc_gss_mech_to_oid)(mech, oid_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_oid_to_mech_call(gss_OID oid, const char **mech_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_oid_to_mech != NULL) + ret = (*rpc_gss_entries.rpc_gss_oid_to_mech)(oid, mech_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_qop_to_num_call(const char *qop, const char *mech, u_int *num_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_qop_to_num != NULL) + ret = (*rpc_gss_entries.rpc_gss_qop_to_num)(qop, mech, num_ret); + return (ret); +} + +static __inline const char ** +rpc_gss_get_mechanisms_call(void) +{ + const char **ret = NULL; + + if (rpc_gss_entries.rpc_gss_get_mechanisms != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_mechanisms)(); + return (ret); +} + +static __inline bool_t +rpc_gss_get_versions_call(u_int *vers_hi, u_int *vers_lo) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_get_versions != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_versions)(vers_hi, vers_lo); + return (ret); +} + +static __inline bool_t +rpc_gss_is_installed_call(const char *mech) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_is_installed != NULL) + ret = (*rpc_gss_entries.rpc_gss_is_installed)(mech); + return (ret); +} + +static __inline bool_t +rpc_gss_set_svc_name_call(const char *principal, const char *mechanism, + u_int req_time, u_int program, u_int version) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_svc_name != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_svc_name)(principal, + mechanism, req_time, program, version); + return (ret); +} + +static __inline void +rpc_gss_clear_svc_name_call(u_int program, u_int version) +{ + + if (rpc_gss_entries.rpc_gss_clear_svc_name != NULL) + (*rpc_gss_entries.rpc_gss_clear_svc_name)(program, version); +} + +static __inline bool_t +rpc_gss_getcred_call(struct svc_req *req, rpc_gss_rawcred_t **rcred, + rpc_gss_ucred_t **ucred, void **cookie) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_getcred != NULL) + ret = (*rpc_gss_entries.rpc_gss_getcred)(req, rcred, ucred, + cookie); + return (ret); +} + +static __inline bool_t +rpc_gss_set_callback_call(rpc_gss_callback_t *cb) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_callback != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_callback)(cb); + return (ret); +} + +static __inline void +rpc_gss_clear_callback_call(rpc_gss_callback_t *cb) +{ + + if (rpc_gss_entries.rpc_gss_clear_callback != NULL) + (*rpc_gss_entries.rpc_gss_clear_callback)(cb); +} + +static __inline bool_t +rpc_gss_get_principal_name_call(rpc_gss_principal_t *principal, + const char *mech, const char *name, const char *node, const char *domain) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_get_principal_name != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_principal_name)(principal, + mech, name, node, domain); + return (ret); +} + +static __inline int +rpc_gss_svc_max_data_length_call(struct svc_req *req, int max_tp_unit_len) +{ + int ret = 0; + + if (rpc_gss_entries.rpc_gss_svc_max_data_length != NULL) + ret = (*rpc_gss_entries.rpc_gss_svc_max_data_length)(req, + max_tp_unit_len); + return (ret); +} + AUTH *rpc_gss_secfind(CLIENT *clnt, struct ucred *cred, const char *principal, gss_OID mech_oid, rpc_gss_service_t service); void rpc_gss_secpurge(CLIENT *clnt); From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 22:12:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CE4F1065672; Sun, 19 Jun 2011 22:12:49 +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 538218FC08; Sun, 19 Jun 2011 22:12:49 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id E74A214E585F; Sun, 19 Jun 2011 23:53:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JpFHDhGgKCDN; Sun, 19 Jun 2011 23:53:32 +0200 (CEST) Received: from [193.137.158.216] (unknown [193.137.158.216]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 4C3FA14E57CC; Sun, 19 Jun 2011 23:53:32 +0200 (CEST) Message-ID: <4DFE6FE2.5030407@FreeBSD.org> Date: Sun, 19 Jun 2011 22:53:38 +0100 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-PT; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexander Kabaev References: <201106191335.p5JDZk11095714@svn.freebsd.org> In-Reply-To: <201106191335.p5JDZk11095714@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: r223296 - head/lib/libc/iconv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2011 22:12:49 -0000 Em 19-06-2011 14:35, Alexander Kabaev escreveu: > Author: kan > Date: Sun Jun 19 13:35:46 2011 > New Revision: 223296 > URL: http://svn.freebsd.org/changeset/base/223296 > > Log: > Put a quick bandaid on internal citrus locking. > > The code is not quite right still, but it programs from deadlocking > on themselves if one enables new citrus code by mistake. Thanks, I still have this on my TODO list, I just haven't had time so far. Gabor From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 22:48:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1227B106564A; Sun, 19 Jun 2011 22:48:41 +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 019AC8FC12; Sun, 19 Jun 2011 22:48:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JMmel5012713; Sun, 19 Jun 2011 22:48:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JMmeKN012708; Sun, 19 Jun 2011 22:48:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106192248.p5JMmeKN012708@svn.freebsd.org> From: Doug Barton Date: Sun, 19 Jun 2011 22:48: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: r223310 - in head: etc/defaults etc/rc.d 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: Sun, 19 Jun 2011 22:48:41 -0000 Author: dougb Date: Sun Jun 19 22:48:40 2011 New Revision: 223310 URL: http://svn.freebsd.org/changeset/base/223310 Log: Add the netwait rc.d script. It waits for the specified period for the network to become active. PR: conf/151063 Submitted by: Jeremy Chadwick Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/mountcritremote head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/defaults/rc.conf Sun Jun 19 22:48:40 2011 (r223310) @@ -444,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB B #ubthidhci_addr="2" # Check usbconfig list to find the correct # numbers for your system. +### Network link/usability verification options +netwait_enable="NO" # Enable rc.d/netwait (or NO) +#netwait_ip="" # IP addresses to be pinged by netwait. +netwait_timeout="60" # Total number of seconds to perform pings. +#netwait_if="" # Interface name to watch link state on. +netwait_if_timeout="30" # Total number of seconds to monitor link state. + ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/rc.d/Makefile Sun Jun 19 22:48:40 2011 (r223310) @@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions \ + named natd netif netoptions netwait \ newsyslog nfsclient nfscbd nfsd \ nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ Modified: head/etc/rc.d/mountcritremote ============================================================================== --- head/etc/rc.d/mountcritremote Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/rc.d/mountcritremote Sun Jun 19 22:48:40 2011 (r223310) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritremote -# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec +# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait # KEYWORD: nojail . /etc/rc.subr Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Jun 19 22:08:55 2011 (r223309) +++ head/share/man/man5/rc.conf.5 Sun Jun 19 22:48:40 2011 (r223310) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2011 +.Dd June 19, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -4293,6 +4293,61 @@ Bus address of the USB Bluetooth control Check the output of .Xr usbconfig 8 on your system to find this information. +.It Va netwait_enable +.Pq Vt bool +If set to +.Dq Li YES , +delays the start of network-reliant services until +.Va netwait_if +is up and ICMP packets to a destination defined in +.Va netwait_ip +are flowing. +Link state is examined first, followed by +.Dq Li pinging +an IP address to verify network usability. +If no destination can be reached or timeouts are exceeded, +network services are started anyway with no guarantee that +the network is usable. +Use of this variable requires both +.Va netwait_ip +and +.Va netwait_if +to be set. +.It Va netwait_ip +.Pq Vt str +Empty by default. +This variable contains a space-delimited list of IP addresses to +.Xr ping 8 . +DNS hostnames should not be used as resolution is not guaranteed +to be functional at this point. +If multiple IP addresses are specified, +each will be tried until one is successful or the list is exhausted. +.It Va netwait_timeout +.Pq Vt int +Indicates the total number of seconds to perform a +.Dq Li ping +against each IP address in +.Va netwait_ip , +at a rate of one ping per second. +If any of the pings are successful, +full network connectivity is considered reliable. +The default is 60. +.It Va netwait_if +.Pq Vt str +Empty by default. +Defines the name of the network interface on which watch for link. +.Xr ifconfig 8 +is used to monitor the interface, looking for +.Dq Li status: no carrier . +Once gone, the link is considered up. +This can be a +.Xr vlan 4 +interface if desired. +.It Va netwait_if_timeout +.Pq Vt int +Defines the total number of seconds to wait for link to become usable, +polled at a 1-second interval. +The default is 30. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4364,6 +4419,7 @@ on your system to find this information. .Xr ntpdate 8 , .Xr pfctl 8 , .Xr pflogd 8 , +.Xr ping 8 , .Xr powerd 8 , .Xr quotacheck 8 , .Xr quotaon 8 , From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 22:59:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29DDD1065672; Sun, 19 Jun 2011 22:59:55 +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 00CBE8FC0A; Sun, 19 Jun 2011 22:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JMxsxd013081; Sun, 19 Jun 2011 22:59:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JMxsBS013080; Sun, 19 Jun 2011 22:59:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106192259.p5JMxsBS013080@svn.freebsd.org> From: Doug Barton Date: Sun, 19 Jun 2011 22: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: r223311 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 22:59:55 -0000 Author: dougb Date: Sun Jun 19 22:59:54 2011 New Revision: 223311 URL: http://svn.freebsd.org/changeset/base/223311 Log: Blah, forgot to svn add the actual script from r223310 Added: head/etc/rc.d/netwait (contents, props changed) Added: head/etc/rc.d/netwait ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/netwait Sun Jun 19 22:59:54 2011 (r223311) @@ -0,0 +1,97 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: netwait +# REQUIRE: NETWORKING +# KEYWORD: nojail +# +# The netwait script is intended to be used by systems which have +# statically-configured IP addresses in rc.conf(5). If your system +# uses DHCP, you should use synchronous_dhclient="YES" in your +# /etc/rc.conf instead of using netwait. + +. /etc/rc.subr + +name="netwait" +rc_var=`set_rcvar` +start_cmd="${name}_start" +stop_cmd=":" + +netwait_start() +{ + local ip rc count output link + + if [ -z "${netwait_ip}" ]; then + err 1 "You must define one or more IP addresses in netwait_ip" + fi + + if [ ${netwait_timeout} -lt 1 ]; then + err 1 "netwait_timeout must be >= 1" + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + if [ -n "${netwait_if}" ]; then + echo -n "Waiting for $netwait_if to have link" + + count=1 + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo '.' + break + fi + else + echo '' + err 1 "ifconfig ${netwait_if} failed" + fi + sleep 1 + count=$((count+1)) + done + if [ -n "${link}" ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '' + warn "Interface still has no link. Continuing with startup, but" + warn "be aware you may not have a fully functional networking" + warn "layer at this point." + return + fi + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '.' + return + fi + count=$((count+1)) + done + echo ': No response from host.' + done + + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Sun Jun 19 23:54:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC5FF106566B; Sun, 19 Jun 2011 23:54:01 +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 82B7E8FC0C; Sun, 19 Jun 2011 23:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JNs1ss014669; Sun, 19 Jun 2011 23:54:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JNs13p014667; Sun, 19 Jun 2011 23:54:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106192354.p5JNs13p014667@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 23:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223312 - head/sys/fs/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: Sun, 19 Jun 2011 23:54:01 -0000 Author: rmacklem Date: Sun Jun 19 23:54:01 2011 New Revision: 223312 URL: http://svn.freebsd.org/changeset/base/223312 Log: Fix a number of places where the new NFS server did not lock the mutex when manipulating rc_flag in the DRC cache. This is believed to fix a hung server that was reported to the freebsd-fs@ list on June 9 under the subject heading "New NFS server stress test hang", where all the threads were waiting for the RC_LOCKED flag to clear. Tested by: jwd at slowblink.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Sun Jun 19 22:59:54 2011 (r223311) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Sun Jun 19 23:54:01 2011 (r223312) @@ -405,6 +405,7 @@ nfsrvd_updatecache(struct nfsrv_descript { struct nfsrvcache *rp; struct nfsrvcache *retrp = NULL; + mbuf_t m; rp = nd->nd_rp; if (!rp) @@ -457,9 +458,9 @@ nfsrvd_updatecache(struct nfsrv_descript } if ((nd->nd_flag & ND_NFSV2) && nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) { - NFSUNLOCKCACHE(); rp->rc_status = nd->nd_repstat; rp->rc_flag |= RC_REPSTATUS; + NFSUNLOCKCACHE(); } else { if (!(rp->rc_flag & RC_UDP)) { nfsrc_tcpsavedreplies++; @@ -469,9 +470,11 @@ nfsrvd_updatecache(struct nfsrv_descript nfsrc_tcpsavedreplies; } NFSUNLOCKCACHE(); - rp->rc_reply = m_copym(nd->nd_mreq, 0, M_COPYALL, - M_WAIT); + m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT); + NFSLOCKCACHE(); + rp->rc_reply = m; rp->rc_flag |= RC_REPMBUF; + NFSUNLOCKCACHE(); } if (rp->rc_flag & RC_UDP) { rp->rc_timestamp = NFSD_MONOSEC + @@ -518,6 +521,7 @@ nfsrvd_delcache(struct nfsrvcache *rp) APPLESTATIC void nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err) { + tcp_seq tmp_seq; if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); @@ -526,8 +530,12 @@ nfsrvd_sentcache(struct nfsrvcache *rp, so->so_proto->pr_domain->dom_family != AF_INET6) || so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); - if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) + if (nfsrv_getsockseqnum(so, &tmp_seq)) { + NFSLOCKCACHE(); + rp->rc_tcpseq = tmp_seq; rp->rc_flag |= RC_TCPSEQ; + NFSUNLOCKCACHE(); + } } nfsrc_unlock(rp); } @@ -687,8 +695,11 @@ nfsrc_lock(struct nfsrvcache *rp) static void nfsrc_unlock(struct nfsrvcache *rp) { + + NFSLOCKCACHE(); rp->rc_flag &= ~RC_LOCKED; nfsrc_wanted(rp); + NFSUNLOCKCACHE(); } /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 00:17:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1A8106564A; Mon, 20 Jun 2011 00:17:44 +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 684C78FC19; Mon, 20 Jun 2011 00:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K0HiTf015460; Mon, 20 Jun 2011 00:17:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K0HiVo015455; Mon, 20 Jun 2011 00:17:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200017.p5K0HiVo015455@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 00:17: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: r223313 - in head/sys: conf powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 00:17:44 -0000 Author: nwhitehorn Date: Mon Jun 20 00:17:44 2011 New Revision: 223313 URL: http://svn.freebsd.org/changeset/base/223313 Log: Driver for PS3's internal hard disk. Hopefully this can be CAM-ified in the future, but presents a set of simple block devices for now. With (forthcoming) boot loader support or vfs.root.mountfrom, allows booting PS3s from disk. Submitted by: glevand Added: head/sys/powerpc/ps3/ps3disk.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/ps3/ps3bus.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/conf/files.powerpc Mon Jun 20 00:17:44 2011 (r223313) @@ -208,6 +208,7 @@ powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 powerpc/ps3/ps3ata.c optional ps3 ps3ata powerpc/ps3/ps3bus.c optional ps3 +powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 powerpc/ps3/ps3_syscons.c optional ps3 sc powerpc/ps3/ps3-hvcall.S optional ps3 sc Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/powerpc/ps3/ps3bus.c Mon Jun 20 00:17:44 2011 (r223313) @@ -1,5 +1,6 @@ /*- * Copyright (C) 2010 Nathan Whitehorn + * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,6 +74,8 @@ struct ps3bus_devinfo { int dev; uint64_t bustype; uint64_t devtype; + int busidx; + int devidx; struct resource_list resources; bus_dma_tag_t dma_tag; @@ -89,6 +92,11 @@ enum ps3bus_irq_type { EHCI_IRQ = 4, }; +enum ps3bus_reg_type { + OHCI_REG = 3, + EHCI_REG = 4, +}; + static device_method_t ps3bus_methods[] = { /* Device interface */ DEVMETHOD(device_identify, ps3bus_identify), @@ -235,6 +243,77 @@ ps3bus_resources_init(struct rman *rm, i } } +static void +ps3bus_resources_init_by_type(struct rman *rm, int bus_index, int dev_index, + uint64_t irq_type, uint64_t reg_type, struct ps3bus_devinfo *dinfo) +{ + uint64_t _irq_type, irq, outlet; + uint64_t _reg_type, paddr, len; + uint64_t ppe, junk; + int i, result; + int thread; + + resource_list_init(&dinfo->resources); + + lv1_get_logical_ppe_id(&ppe); + thread = 32 - fls(mfctrl()); + + /* Scan for interrupts */ + for (i = 0; i < 10; i++) { + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("intr") | i, 0, &_irq_type, &irq); + + if (result != 0) + break; + + if (_irq_type != irq_type) + continue; + + lv1_construct_io_irq_outlet(irq, &outlet); + lv1_connect_irq_plug_ext(ppe, thread, outlet, outlet, + 0); + resource_list_add(&dinfo->resources, SYS_RES_IRQ, i, + outlet, outlet, 1); + } + + /* Scan for registers */ + for (i = 0; i < 10; i++) { + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("reg") | i, + lv1_repository_string("type"), &_reg_type, &junk); + + if (result != 0) + break; + + if (_reg_type != reg_type) + continue; + + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("reg") | i, + lv1_repository_string("data"), &paddr, &len); + + result = lv1_map_device_mmio_region(dinfo->bus, dinfo->dev, + paddr, len, 12 /* log_2(4 KB) */, &paddr); + + if (result != 0) { + printf("Mapping registers failed for device " + "%d.%d (%ld.%ld): %d\n", dinfo->bus, dinfo->dev, + dinfo->bustype, dinfo->devtype, result); + break; + } + + rman_manage_region(rm, paddr, paddr + len - 1); + resource_list_add(&dinfo->resources, SYS_RES_MEMORY, i, + paddr, paddr + len, len); + } +} + static int ps3bus_attach(device_t self) { @@ -294,30 +373,93 @@ ps3bus_attach(device_t self) if (result != 0) continue; - dinfo = malloc(sizeof(*dinfo), M_PS3BUS, - M_WAITOK | M_ZERO); - - dinfo->bus = bus; - dinfo->dev = dev; - dinfo->bustype = bustype; - dinfo->devtype = devtype; + switch (devtype) { + case PS3_DEVTYPE_USB: + /* USB device has OHCI and EHCI USB host controllers */ - if (dinfo->bustype == PS3_BUSTYPE_SYSBUS) lv1_open_device(bus, dev, 0); - ps3bus_resources_init(&sc->sc_mem_rman, bus_index, - dev_index, dinfo); + /* OHCI host controller */ - cdev = device_add_child(self, NULL, -1); - if (cdev == NULL) { - device_printf(self, - "device_add_child failed\n"); - free(dinfo, M_PS3BUS); - continue; - } + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index, + dev_index, OHCI_IRQ, OHCI_REG, dinfo); + + cdev = device_add_child(self, "ohci", -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } + + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + + /* EHCI host controller */ + + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index, + dev_index, EHCI_IRQ, EHCI_REG, dinfo); + + cdev = device_add_child(self, "ehci", -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } + + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + break; + default: + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + if (dinfo->bustype == PS3_BUSTYPE_SYSBUS || + dinfo->bustype == PS3_BUSTYPE_STORAGE) + lv1_open_device(bus, dev, 0); + + ps3bus_resources_init(&sc->sc_mem_rman, bus_index, + dev_index, dinfo); + + cdev = device_add_child(self, NULL, -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } - mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); - device_set_ivars(cdev, dinfo); + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + } } } @@ -361,6 +503,12 @@ ps3bus_read_ivar(device_t bus, device_t case PS3BUS_IVAR_DEVTYPE: *result = dinfo->devtype; break; + case PS3BUS_IVAR_BUSIDX: + *result = dinfo->busidx; + break; + case PS3BUS_IVAR_DEVIDX: + *result = dinfo->devidx; + break; default: return (EINVAL); } @@ -483,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && + dinfo->bustype != PS3_BUSTYPE_STORAGE) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); Modified: head/sys/powerpc/ps3/ps3bus.h ============================================================================== --- head/sys/powerpc/ps3/ps3bus.h Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/powerpc/ps3/ps3bus.h Mon Jun 20 00:17:44 2011 (r223313) @@ -32,7 +32,9 @@ enum { PS3BUS_IVAR_BUS, PS3BUS_IVAR_DEVICE, PS3BUS_IVAR_BUSTYPE, - PS3BUS_IVAR_DEVTYPE + PS3BUS_IVAR_DEVTYPE, + PS3BUS_IVAR_BUSIDX, + PS3BUS_IVAR_DEVIDX, }; #define PS3BUS_ACCESSOR(A, B, T) \ @@ -42,6 +44,8 @@ PS3BUS_ACCESSOR(bus, BUS, int) PS3BUS_ACCESSOR(device, DEVICE, int) PS3BUS_ACCESSOR(bustype, BUSTYPE, uint64_t) PS3BUS_ACCESSOR(devtype, DEVTYPE, uint64_t) +PS3BUS_ACCESSOR(busidx, BUSIDX, int) +PS3BUS_ACCESSOR(devidx, DEVIDX, int) /* Bus types */ enum { Added: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 00:17:44 2011 (r223313) @@ -0,0 +1,893 @@ +/*- + * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ps3bus.h" +#include "ps3-hvcall.h" + +#define PS3DISK_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "ps3disk", MTX_DEF) +#define PS3DISK_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define PS3DISK_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define PS3DISK_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PS3DISK_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define PS3DISK_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +#define LV1_STORAGE_ATA_HDDOUT 0x23 + +SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD, 0, "PS3 Disk driver parameters"); + +#ifdef PS3DISK_DEBUG +static int ps3disk_debug = 0; +SYSCTL_INT(_hw_ps3disk, OID_AUTO, debug, CTLFLAG_RW, &ps3disk_debug, + 0, "control debugging printfs"); +TUNABLE_INT("hw.ps3disk.debug", &ps3disk_debug); +enum { + PS3DISK_DEBUG_INTR = 0x00000001, + PS3DISK_DEBUG_TASK = 0x00000002, + PS3DISK_DEBUG_READ = 0x00000004, + PS3DISK_DEBUG_WRITE = 0x00000008, + PS3DISK_DEBUG_FLUSH = 0x00000010, + PS3DISK_DEBUG_ANY = 0xffffffff +}; +#define DPRINTF(sc, m, fmt, ...) \ +do { \ + if (sc->sc_debug & (m)) \ + printf(fmt, __VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(sc, m, fmt, ...) +#endif + +struct ps3disk_region { + uint64_t r_id; + uint64_t r_start; + uint64_t r_size; + uint64_t r_flags; +}; + +struct ps3disk_softc { + device_t sc_dev; + + struct mtx sc_mtx; + + uint64_t sc_blksize; + uint64_t sc_nblocks; + + uint64_t sc_nregs; + struct ps3disk_region *sc_reg; + + int sc_irqid; + struct resource *sc_irq; + void *sc_irqctx; + + struct disk **sc_disk; + + struct bio_queue_head sc_bioq; + + struct proc *sc_task; + + int sc_bounce_maxblocks; + bus_dma_tag_t sc_bounce_dmatag; + bus_dmamap_t sc_bounce_dmamap; + bus_addr_t sc_bounce_dmaphys; + char *sc_bounce; + uint64_t sc_bounce_lpar; + int sc_bounce_busy; + uint64_t sc_bounce_tag; + uint64_t sc_bounce_status; + + int sc_running; + + int sc_debug; +}; + +static int ps3disk_open(struct disk *dp); +static int ps3disk_close(struct disk *dp); +static void ps3disk_strategy(struct bio *bp); +static void ps3disk_task(void *arg); + +static int ps3disk_intr_filter(void *arg); +static void ps3disk_intr(void *arg); +static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc); +static int ps3disk_enum_regions(struct ps3disk_softc *sc); +static int ps3disk_read(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data); +static int ps3disk_write(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data); +static int ps3disk_flush(struct ps3disk_softc *sc); + +static void ps3disk_sysctlattach(struct ps3disk_softc *sc); + +static MALLOC_DEFINE(M_PS3DISK, "ps3disk", "PS3 Disk"); + +static int +ps3disk_probe(device_t dev) +{ + if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_STORAGE || + ps3bus_get_devtype(dev) != PS3_DEVTYPE_DISK) + return (ENXIO); + + device_set_desc(dev, "Playstation 3 Disk"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +ps3disk_attach(device_t dev) +{ + struct ps3disk_softc *sc; + struct disk *d; + intmax_t mb; + char unit; + int i, err; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + PS3DISK_LOCK_INIT(sc); + + err = ps3disk_get_disk_geometry(sc); + if (err) { + device_printf(dev, "Could not get disk geometry\n"); + err = ENXIO; + goto fail_destroy_lock; + } + + device_printf(dev, "block size %lu total blocks %lu\n", + sc->sc_blksize, sc->sc_nblocks); + + err = ps3disk_enum_regions(sc); + if (err) { + device_printf(dev, "Could not enumerate disk regions\n"); + err = ENXIO; + goto fail_destroy_lock; + } + + device_printf(dev, "Found %lu regions\n", sc->sc_nregs); + + if (!sc->sc_nregs) { + err = ENXIO; + goto fail_destroy_lock; + } + + /* Setup interrupt handler */ + + sc->sc_irqid = 0; + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid, + RF_ACTIVE); + if (!sc->sc_irq) { + device_printf(dev, "Could not allocate IRQ\n"); + err = ENXIO; + goto fail_free_regions; + } + + err = bus_setup_intr(dev, sc->sc_irq, + INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, + ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx); + if (err) { + device_printf(dev, "Could not setup IRQ\n"); + err = ENXIO; + goto fail_release_intr; + } + + /* Setup DMA bounce buffer */ + + sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize; + + err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sc->sc_bounce_maxblocks * sc->sc_blksize, 1, + sc->sc_bounce_maxblocks * sc->sc_blksize, + 0, NULL, NULL, &sc->sc_bounce_dmatag); + if (err) { + device_printf(dev, "Could not create DMA tag for bounce buffer\n"); + err = ENXIO; + goto fail_teardown_intr; + } + + err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->sc_bounce_dmamap); + if (err) { + device_printf(dev, "Could not allocate DMA memory for bounce buffer\n"); + err = ENXIO; + goto fail_destroy_dmatag; + } + + err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, + sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize, + ps3disk_getphys, &sc->sc_bounce_dmaphys, 0); + if (err) { + device_printf(dev, "Could not load DMA map for bounce buffer\n"); + err = ENXIO; + goto fail_free_dmamem; + } + + sc->sc_bounce_lpar = vtophys(sc->sc_bounce); + + if (bootverbose) + device_printf(dev, "bounce buffer lpar address 0x%016lx\n", + sc->sc_bounce_lpar); + + /* Setup disks */ + + sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *), + M_PS3DISK, M_ZERO | M_WAITOK); + if (!sc->sc_disk) { + device_printf(dev, "Could not allocate disk(s)\n"); + err = ENOMEM; + goto fail_unload_dmamem; + } + + for (i = 0; i < sc->sc_nregs; i++) { + d = sc->sc_disk[i] = disk_alloc(); + d->d_open = ps3disk_open; + d->d_close = ps3disk_close; + d->d_strategy = ps3disk_strategy; + d->d_name = "ps3disk"; + d->d_drv1 = sc; + d->d_maxsize = DFLTPHYS; + d->d_sectorsize = sc->sc_blksize; + d->d_unit = i; + d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize; + d->d_flags |= DISKFLAG_CANFLUSHCACHE; + + mb = d->d_mediasize >> 20; + unit = 'M'; + if (mb >= 10240) { + unit = 'G'; + mb /= 1024; + } + + device_printf(dev, "region %d %ju%cB\n", i, mb, unit); + + disk_create(d, DISK_VERSION); + } + + bioq_init(&sc->sc_bioq); + + ps3disk_sysctlattach(sc); + + sc->sc_running = 1; + + kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk"); + + return (0); + +fail_unload_dmamem: + + bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); + +fail_free_dmamem: + + bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); + +fail_destroy_dmatag: + + bus_dma_tag_destroy(sc->sc_bounce_dmatag); + +fail_teardown_intr: + + bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); + +fail_release_intr: + + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); + +fail_free_regions: + + free(sc->sc_reg, M_PS3DISK); + +fail_destroy_lock: + + PS3DISK_LOCK_DESTROY(sc); + + return (err); +} + +static int +ps3disk_detach(device_t dev) +{ + struct ps3disk_softc *sc = device_get_softc(dev); + int i; + + PS3DISK_LOCK(sc); + sc->sc_running = 0; + wakeup(sc); + PS3DISK_UNLOCK(sc); + + PS3DISK_LOCK(sc); + while (sc->sc_running != -1) + msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0); + PS3DISK_UNLOCK(sc); + + for (i = 0; i < sc->sc_nregs; i++) + disk_destroy(sc->sc_disk[i]); + + bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); + bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); + bus_dma_tag_destroy(sc->sc_bounce_dmatag); + + bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); + + free(sc->sc_disk, M_PS3DISK); + + free(sc->sc_reg, M_PS3DISK); + + PS3DISK_LOCK_DESTROY(sc); + + return (0); +} + +static int +ps3disk_open(struct disk *dp) +{ + return (0); +} + +static int +ps3disk_close(struct disk *dp) +{ + return (0); +} + +static void +ps3disk_strategy(struct bio *bp) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1; + + if (!sc) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = EINVAL; + biodone(bp); + return; + } + + PS3DISK_LOCK(sc); + bioq_disksort(&sc->sc_bioq, bp); + if (!sc->sc_bounce_busy) + wakeup(sc); + PS3DISK_UNLOCK(sc); +} + +static void +ps3disk_task(void *arg) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; + struct bio *bp; + daddr_t block, end; + u_long nblocks; + char *data; + int err; + + while (sc->sc_running) { + PS3DISK_LOCK(sc); + do { + bp = bioq_first(&sc->sc_bioq); + if (bp == NULL) + msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); + } while (bp == NULL && sc->sc_running); + if (bp) + bioq_remove(&sc->sc_bioq, bp); + PS3DISK_UNLOCK(sc); + + if (!sc->sc_running) + break; + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", + __func__, bp->bio_cmd); + + if (bp->bio_cmd == BIO_FLUSH) { + err = ps3disk_flush(sc); + + if (err) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_flags |= BIO_DONE; + } + } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize); + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n", + __func__, bp->bio_pblkno, bp->bio_bcount); + + for (block = bp->bio_pblkno; block < end;) { + data = bp->bio_data + + (block - bp->bio_pblkno) * sc->sc_blksize; + + nblocks = end - block; + if (nblocks > sc->sc_bounce_maxblocks) + nblocks = sc->sc_bounce_maxblocks; + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n", + __func__, nblocks); + + if (bp->bio_cmd == BIO_READ) { + err = ps3disk_read(sc, bp->bio_disk->d_unit, + block, nblocks, data); + } else { + err = ps3disk_write(sc, bp->bio_disk->d_unit, + block, nblocks, data); + } + + if (err) + break; + + block += nblocks; + } + + bp->bio_resid = (end - block) * sc->sc_blksize; + if (bp->bio_resid) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_flags |= BIO_DONE; + } + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n", + __func__, bp->bio_resid); + } else { + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + } + + if (bp->bio_flags & BIO_ERROR) + disk_err(bp, "hard error", -1, 1); + + biodone(bp); + } + + PS3DISK_LOCK(sc); + sc->sc_running = -1; + wakeup(sc); + PS3DISK_UNLOCK(sc); + + kproc_exit(0); +} + +static int +ps3disk_intr_filter(void *arg) +{ + return (FILTER_SCHEDULE_THREAD); +} + +static void +ps3disk_intr(void *arg) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; + device_t dev = sc->sc_dev; + uint64_t devid = ps3bus_get_device(dev); + uint64_t tag, status; + int err; + + PS3DISK_LOCK(sc); + + err = lv1_storage_get_async_status(devid, &tag, &status); + + DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n", + __func__, err, tag, status); + + if (err) + goto out; + + if (!sc->sc_bounce_busy) { + device_printf(dev, "Got interrupt while no request pending\n"); + goto out; + } + + if (tag != sc->sc_bounce_tag) + device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n", + tag, sc->sc_bounce_tag); + + if (status) + device_printf(dev, "Request completed with status 0x%016lx\n", status); + + sc->sc_bounce_status = status; + sc->sc_bounce_busy = 0; + + wakeup(sc); + +out: + + PS3DISK_UNLOCK(sc); +} + +static void +ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + + *(bus_addr_t *) arg = segs[0].ds_addr; +} + +static int +ps3disk_get_disk_geometry(struct ps3disk_softc *sc) +{ + device_t dev = sc->sc_dev; + uint64_t bus_index = ps3bus_get_busidx(dev); + uint64_t dev_index = ps3bus_get_devidx(dev); + uint64_t junk; + int err; + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk); + if (err) { + device_printf(dev, "Could not get block size (0x%08x)\n", err); + err = ENXIO; + goto out; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk); + if (err) { + device_printf(dev, "Could not get total number of blocks (0x%08x)\n", + err); + err = ENXIO; + goto out; + } + + err = 0; + +out: + + return (err); +} + +static int +ps3disk_enum_regions(struct ps3disk_softc *sc) +{ + device_t dev = sc->sc_dev; + uint64_t bus_index = ps3bus_get_busidx(dev); + uint64_t dev_index = ps3bus_get_devidx(dev); + uint64_t junk; + int i, err; + + /* Read number of regions */ + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("n_regs"), 0, &sc->sc_nregs, &junk); + if (err) { + device_printf(dev, "Could not get number of regions (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + if (!sc->sc_nregs) + return 0; + + sc->sc_reg = malloc(sc->sc_nregs * sizeof(struct ps3disk_region), + M_PS3DISK, M_ZERO | M_WAITOK); + if (!sc->sc_reg) { + err = ENOMEM; + goto fail; + } + + /* Setup regions */ + + for (i = 0; i < sc->sc_nregs; i++) { + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("id"), &sc->sc_reg[i].r_id, &junk); + if (err) { + device_printf(dev, "Could not get region id (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk); + if (err) { + device_printf(dev, "Could not get region start (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk); + if (err) { + device_printf(dev, "Could not get region size (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + if (i == 0) + /* disables HV access control and grants access to whole disk */ + sc->sc_reg[i].r_flags = 0x2; + else + sc->sc_reg[i].r_flags = 0; + } + + return (0); + +fail: + + sc->sc_nregs = 0; + if (sc->sc_reg) + free(sc->sc_reg, M_PS3DISK); + + return (err); +} + +static int +ps3disk_read(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data) +{ + device_t dev = sc->sc_dev; + struct ps3disk_region *rp = &sc->sc_reg[regidx]; + uint64_t devid = ps3bus_get_device(dev); + int err; + + PS3DISK_LOCK(sc); + + if (sc->sc_bounce_busy) { + device_printf(dev, "busy\n"); + PS3DISK_UNLOCK(sc); + return EIO; + } + + sc->sc_bounce_busy = 1; + + err = lv1_storage_read(devid, rp->r_id, + start_sector, sector_count, rp->r_flags, + sc->sc_bounce_lpar, &sc->sc_bounce_tag); + if (err) { + device_printf(dev, "Could not read sectors (0x%08x)\n", err); + err = EIO; + goto out; + } + + DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", + __func__, sc->sc_bounce_tag); + + err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz); + if (err) { + device_printf(dev, "Read request timed out\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 00:46:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA8F106566B; Mon, 20 Jun 2011 00:46:07 +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 58F8F8FC13; Mon, 20 Jun 2011 00:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K0k7AG016282; Mon, 20 Jun 2011 00:46:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K0k7fk016279; Mon, 20 Jun 2011 00:46:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200046.p5K0k7fk016279@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 00:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223314 - in head/sys: conf powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 00:46:07 -0000 Author: nwhitehorn Date: Mon Jun 20 00:46:07 2011 New Revision: 223314 URL: http://svn.freebsd.org/changeset/base/223314 Log: Add an OHCI driver to complement the EHCI one. The infrastructure to attach both to the parent ps3bus was in r223313. This driver itself comes from the ps3 project branch. Added: head/sys/powerpc/ps3/ohci_ps3.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Jun 20 00:17:44 2011 (r223313) +++ head/sys/conf/files.powerpc Mon Jun 20 00:46:07 2011 (r223314) @@ -203,6 +203,7 @@ powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci +powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 Added: head/sys/powerpc/ps3/ohci_ps3.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ps3/ohci_ps3.c Mon Jun 20 00:46:07 2011 (r223314) @@ -0,0 +1,170 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "ps3bus.h" + +static int +ohci_ps3_probe(device_t dev) +{ + if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_SYSBUS || + ps3bus_get_devtype(dev) != PS3_DEVTYPE_USB) + return (ENXIO); + + device_set_desc(dev, "Playstation 3 USB 2.0 controller"); + return (BUS_PROBE_SPECIFIC); +} + +static int +ohci_ps3_attach(device_t dev) +{ + ohci_softc_t *sc = device_get_softc(dev); + int rid, err; + + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = OHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) + return (ENOMEM); + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + + if (!sc->sc_io_res) { + device_printf(dev, "Could not map memory\n"); + goto error; + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + + if (sc->sc_irq_res == NULL) { + device_printf(dev, "Could not allocate irq\n"); + return (ENXIO); + } + + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(dev, "Could not add USB device\n"); + return (ENXIO); + } + + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sprintf(sc->sc_vendor, "Sony"); + + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not setup error irq, %d\n", err); + goto error; + } + + //sc->sc_flags |= EHCI_SCFLG_BIGEMMIO; + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, + OHCI_CONTROL, 0); + err = ohci_init(sc); + if (err) { + device_printf(dev, "USB init failed err=%d\n", err); + goto error; + } + + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err == 0) + return (0); + +error: + return (ENXIO); +} + +static device_method_t ohci_ps3_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ohci_ps3_probe), + DEVMETHOD(device_attach, ohci_ps3_attach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + {0, 0} +}; + +static driver_t ohci_ps3_driver = { + "ohci", + ohci_ps3_methods, + sizeof(ohci_softc_t), +}; + +static devclass_t ohci_ps3_devclass; + +DRIVER_MODULE(ohci_ps3, ps3bus, ohci_ps3_driver, ohci_ps3_devclass, 0, 0); +MODULE_DEPEND(ohci_ps3, usb, 1, 1, 1); + From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 00:48:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A75EF1065670; Mon, 20 Jun 2011 00:48:07 +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 7CC0C8FC13; Mon, 20 Jun 2011 00:48:07 +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 1CF6C46B2C; Sun, 19 Jun 2011 20:48:07 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 87E6E8A027; Sun, 19 Jun 2011 20:48:06 -0400 (EDT) Message-ID: <4DFE98C6.4050102@FreeBSD.org> Date: Sun, 19 Jun 2011 20:48:06 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ivan Klymenko References: <20110619213749.0cf6397c@ukr.net> In-Reply-To: <20110619213749.0cf6397c@ukr.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sun, 19 Jun 2011 20:48:06 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Doug Barton Subject: Re: svn commit: r223264 - in head: etc/defaults etc/rc.d 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: Mon, 20 Jun 2011 00:48:07 -0000 On 6/19/11 2:37 PM, Ivan Klymenko wrote: > Hello! > Thanks for commit. > > I have a question: > If a lot of kernel modules, option kld_list = "" supports moving to a > new line? > For example: > kld_list = " ....< moduleN>\ > " > > Maybe specify its example of manual documentation page for rc.conf? > > Thank you! It's normal shell so you can always do this: kld_list="foo bar baz" kld_list="${kld_list} four five six" -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 00:48:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C9A106564A; Mon, 20 Jun 2011 00:48:46 +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 1A1C88FC18; Mon, 20 Jun 2011 00:48:46 +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 C5BA846B2E; Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 41E048A02A; Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Message-ID: <4DFE98ED.3090102@FreeBSD.org> Date: Sun, 19 Jun 2011 20:48:45 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexander Kabaev References: <201106191335.p5JDZaa3095644@svn.freebsd.org> In-Reply-To: <201106191335.p5JDZaa3095644@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223294 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 00:48:46 -0000 On 6/19/11 9:35 AM, Alexander Kabaev wrote: > Author: kan > Date: Sun Jun 19 13:35:36 2011 > New Revision: 223294 > URL: http://svn.freebsd.org/changeset/base/223294 > > Log: > Do not set thread name to less than informative 'initial thread'. > > Modified: > head/lib/libthr/thread/thr_init.c Thank you! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 01:43:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD001065670; Mon, 20 Jun 2011 01:43:19 +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 3C7338FC08; Mon, 20 Jun 2011 01:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K1hJtd018119; Mon, 20 Jun 2011 01:43:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1hJ0d018117; Mon, 20 Jun 2011 01:43:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200143.p5K1hJ0d018117@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 01:43: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: r223316 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 01:43:19 -0000 Author: nwhitehorn Date: Mon Jun 20 01:43:18 2011 New Revision: 223316 URL: http://svn.freebsd.org/changeset/base/223316 Log: Make this slightly less yelly about regions that the hypervisor protects from us by not registering them as disks. Modified: head/sys/powerpc/ps3/ps3disk.c Modified: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 01:43:14 2011 (r223315) +++ head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 01:43:18 2011 (r223316) @@ -274,6 +274,8 @@ ps3disk_attach(device_t dev) } for (i = 0; i < sc->sc_nregs; i++) { + struct ps3disk_region *rp = &sc->sc_reg[i]; + d = sc->sc_disk[i] = disk_alloc(); d->d_open = ps3disk_open; d->d_close = ps3disk_close; @@ -293,10 +295,16 @@ ps3disk_attach(device_t dev) mb /= 1024; } - device_printf(dev, "region %d %ju%cB\n", i, mb, unit); + /* Test to see if we can read this region */ + err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit, + 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag); + device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit, + (err == 0) ? "" : " (hypervisor protected)"); - disk_create(d, DISK_VERSION); + if (err == 0) + disk_create(d, DISK_VERSION); } + err = 0; bioq_init(&sc->sc_bioq); From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 02:17:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 867B1106567B; Mon, 20 Jun 2011 02:17:34 +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 75CC98FC15; Mon, 20 Jun 2011 02:17:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K2HYwG019741; Mon, 20 Jun 2011 02:17:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K2HYqo019739; Mon, 20 Jun 2011 02:17:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200217.p5K2HYqo019739@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 02:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223324 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 02:17:34 -0000 Author: nwhitehorn Date: Mon Jun 20 02:17:34 2011 New Revision: 223324 URL: http://svn.freebsd.org/changeset/base/223324 Log: Work/hack around some race conditions present in the hardware/HV interface. Partially inspired by a patch from glevand (geoffrey.levand@mail.ru). Modified: head/sys/powerpc/ps3/if_glc.c Modified: head/sys/powerpc/ps3/if_glc.c ============================================================================== --- head/sys/powerpc/ps3/if_glc.c Mon Jun 20 02:09:15 2011 (r223323) +++ head/sys/powerpc/ps3/if_glc.c Mon Jun 20 02:17:34 2011 (r223324) @@ -135,6 +135,7 @@ glc_attach(device_t dev) callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); sc->next_txdma_slot = 0; sc->bsy_txdma_slots = 0; + sc->sc_next_rxdma_slot = 0; sc->first_used_txdma_slot = -1; /* @@ -375,6 +376,14 @@ glc_tick(void *xsc) mtx_assert(&sc->sc_mtx, MA_OWNED); + /* + * XXX: Sometimes the RX queue gets stuck. Poke it periodically until + * we figure out why. This will fail harmlessly if the RX queue is + * already running. + */ + lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, + sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0); + if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) { callout_reset(&sc->sc_tick_ch, hz, glc_tick, sc); return; @@ -707,12 +716,19 @@ glc_rxintr(struct glc_softc *sc) struct ifnet *ifp = sc->sc_ifp; bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_POSTREAD); restart_rxdma = 0; while ((sc->sc_rxdmadesc[sc->sc_next_rxdma_slot].cmd_stat & GELIC_DESCR_OWNED) == 0) { i = sc->sc_next_rxdma_slot; + sc->sc_next_rxdma_slot++; + if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS) + sc->sc_next_rxdma_slot = 0; + + if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END) + restart_rxdma = 1; + if (sc->sc_rxdmadesc[i].rxerror & GELIC_RXERRORS) { ifp->if_ierrors++; goto requeue; @@ -738,9 +754,6 @@ glc_rxintr(struct glc_softc *sc) m->m_pkthdr.rcvif = ifp; m->m_len = sc->sc_rxdmadesc[i].valid_size; m->m_pkthdr.len = m->m_len; - sc->sc_next_rxdma_slot++; - if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS) - sc->sc_next_rxdma_slot = 0; if (sc->sc_rx_vlan >= 0) m_adj(m, 2); @@ -750,16 +763,18 @@ glc_rxintr(struct glc_softc *sc) mtx_lock(&sc->sc_mtx); requeue: - if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END) - restart_rxdma = 1; glc_add_rxbuf_dma(sc, i); - if (restart_rxdma) { - error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, - sc->sc_rxsoft[i].rxs_desc, 0); - if (error != 0) - device_printf(sc->sc_self, - "lv1_net_start_rx_dma error: %d\n", error); - } + } + + bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map, + BUS_DMASYNC_PREWRITE); + + if (restart_rxdma) { + error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, + sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0); + if (error != 0) + device_printf(sc->sc_self, + "lv1_net_start_rx_dma error: %d\n", error); } } @@ -770,6 +785,9 @@ glc_txintr(struct glc_softc *sc) struct glc_txsoft *txs; int progress = 0, kickstart = 0, error; + bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_txdmadesc_map, + BUS_DMASYNC_POSTREAD); + while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) { if (sc->sc_txdmadesc[txs->txs_lastdesc].cmd_stat & GELIC_DESCR_OWNED) @@ -805,7 +823,8 @@ glc_txintr(struct glc_softc *sc) else sc->first_used_txdma_slot = -1; - if (kickstart && txs != NULL) { + if (kickstart || txs != NULL) { + /* Speculatively (or necessarily) start the TX queue again */ error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev, sc->sc_txdmadesc_phys + txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0); From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 03:25:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E8C1065670; Mon, 20 Jun 2011 03:25:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8E3B8FC08; Mon, 20 Jun 2011 03:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K3P9vI021962; Mon, 20 Jun 2011 03:25:09 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K3P9ZA021958; Mon, 20 Jun 2011 03:25:09 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201106200325.p5K3P9ZA021958@svn.freebsd.org> From: Jeff Roberson Date: Mon, 20 Jun 2011 03:25: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: r223325 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 03:25:09 -0000 Author: jeff Date: Mon Jun 20 03:25:09 2011 New Revision: 223325 URL: http://svn.freebsd.org/changeset/base/223325 Log: - Fix directory count rollbacks by passing the mode to the journal dep earlier. - Add rollback/forward code for frag and cluster accounting. - Handle the FREEDEP case in softdep_sync_buf(). (submitted by pho) Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jun 20 03:25:09 2011 (r223325) @@ -1829,7 +1829,7 @@ gotit: } UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref); + softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref, mode); bdwrite(bp); if (ibp != NULL) bawrite(ibp); Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_extern.h Mon Jun 20 03:25:09 2011 (r223325) @@ -130,7 +130,7 @@ void softdep_freefile(struct vnode *, in int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); void softdep_setup_freeblocks(struct inode *, off_t, int); -void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t); +void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, int, int); void softdep_setup_allocdirect(struct inode *, ufs_lbn_t, ufs2_daddr_t, Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Jun 20 03:25:09 2011 (r223325) @@ -142,10 +142,11 @@ softdep_setup_sbupdate(ump, fs, bp) } void -softdep_setup_inomapdep(bp, ip, newinum) +softdep_setup_inomapdep(bp, ip, newinum, mode) struct buf *bp; struct inode *ip; ino_t newinum; + int mode; { panic("softdep_setup_inomapdep called"); @@ -789,6 +790,8 @@ static void diradd_inode_written(struct static int handle_written_indirdep(struct indirdep *, struct buf *, struct buf**); static int handle_written_inodeblock(struct inodedep *, struct buf *); +static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *, + uint8_t *); static int handle_written_bmsafemap(struct bmsafemap *, struct buf *); static void handle_written_jaddref(struct jaddref *); static void handle_written_jremref(struct jremref *); @@ -820,6 +823,8 @@ static void handle_allocindir_partdone(s static void initiate_write_filepage(struct pagedep *, struct buf *); static void initiate_write_indirdep(struct indirdep*, struct buf *); static void handle_written_mkdir(struct mkdir *, int); +static int jnewblk_rollback(struct jnewblk *, struct fs *, struct cg *, + uint8_t *); static void initiate_write_bmsafemap(struct bmsafemap *, struct buf *); static void initiate_write_inodeblock_ufs1(struct inodedep *, struct buf *); static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); @@ -935,6 +940,7 @@ static void wake_worklist(struct worklis static void wait_worklist(struct worklist *, char *); static void remove_from_worklist(struct worklist *); static void softdep_flush(void); +static void softdep_flushjournal(struct mount *); static int softdep_speedup(void); static void worklist_speedup(void); static int journal_mount(struct mount *, struct fs *, struct ucred *); @@ -3046,6 +3052,25 @@ jfsync_write(jfsync, jseg, data) rec->jt_extsize = jfsync->jfs_extsize; } +static void +softdep_flushjournal(mp) + struct mount *mp; +{ + struct jblocks *jblocks; + struct ufsmount *ump; + + if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) + return; + ump = VFSTOUFS(mp); + jblocks = ump->softdep_jblocks; + ACQUIRE_LOCK(&lk); + while (ump->softdep_on_journal) { + jblocks->jb_needseg = 1; + softdep_process_journal(mp, NULL, MNT_WAIT); + } + FREE_LOCK(&lk); +} + /* * Flush some journal records to disk. */ @@ -4310,7 +4335,6 @@ softdep_setup_create(dp, ip) inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, ("softdep_setup_create: No addref structure present.")); - jaddref->ja_mode = ip->i_mode; } softdep_prelink(dvp, NULL); FREE_LOCK(&lk); @@ -4417,7 +4441,6 @@ softdep_setup_mkdir(dp, ip) KASSERT(jaddref->ja_parent == dp->i_number, ("softdep_setup_mkdir: bad parent %d", jaddref->ja_parent)); - jaddref->ja_mode = ip->i_mode; TAILQ_INSERT_BEFORE(&jaddref->ja_ref, &dotaddref->ja_ref, if_deps); } @@ -4637,10 +4660,11 @@ softdep_revert_rmdir(dp, ip) * Called just after updating the cylinder group block to allocate an inode. */ void -softdep_setup_inomapdep(bp, ip, newinum) +softdep_setup_inomapdep(bp, ip, newinum, mode) struct buf *bp; /* buffer for cylgroup block with inode map */ struct inode *ip; /* inode related to allocation */ ino_t newinum; /* new inode number being allocated */ + int mode; { struct inodedep *inodedep; struct bmsafemap *bmsafemap; @@ -4657,7 +4681,7 @@ softdep_setup_inomapdep(bp, ip, newinum) * can be dependent on it. */ if (mp->mnt_kern_flag & MNTK_SUJ) { - jaddref = newjaddref(ip, newinum, 0, 0, 0); + jaddref = newjaddref(ip, newinum, 0, 0, mode); jaddref->ja_state |= NEWBLOCK; } @@ -5014,14 +5038,12 @@ jnewblk_merge(new, old, wkhd) if (jnewblk->jn_blkno != njnewblk->jn_blkno) panic("jnewblk_merge: Merging disparate blocks."); /* - * The record may be rolled back in the cg update bits - * appropriately. NEWBLOCK here alerts the cg rollback code - * that the frag bits have changed. + * The record may be rolled back in the cg. */ if (jnewblk->jn_state & UNDONE) { - njnewblk->jn_state |= UNDONE | NEWBLOCK; - njnewblk->jn_state &= ~ATTACHED; jnewblk->jn_state &= ~UNDONE; + njnewblk->jn_state |= UNDONE; + njnewblk->jn_state &= ~ATTACHED; } /* * We modify the newer addref and free the older so that if neither @@ -10233,6 +10255,70 @@ softdep_setup_blkfree(mp, bp, blkno, fra FREE_LOCK(&lk); } +/* + * Revert a block allocation when the journal record that describes it + * is not yet written. + */ +int +jnewblk_rollback(jnewblk, fs, cgp, blksfree) + struct jnewblk *jnewblk; + struct fs *fs; + struct cg *cgp; + uint8_t *blksfree; +{ + ufs1_daddr_t fragno; + long cgbno, bbase; + int frags, blk; + int i; + + frags = 0; + cgbno = dtogd(fs, jnewblk->jn_blkno); + /* + * We have to test which frags need to be rolled back. We may + * be operating on a stale copy when doing background writes. + */ + for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) + if (isclr(blksfree, cgbno + i)) + frags++; + if (frags == 0) + return (0); + /* + * This is mostly ffs_blkfree() sans some validation and + * superblock updates. + */ + if (frags == fs->fs_frag) { + fragno = fragstoblks(fs, cgbno); + ffs_setblock(fs, blksfree, fragno); + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + } else { + cgbno += jnewblk->jn_oldfrags; + bbase = cgbno - fragnum(fs, cgbno); + /* Decrement the old frags. */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, -1); + /* Deallocate the fragment */ + for (i = 0; i < frags; i++) + setbit(blksfree, cgbno + i); + cgp->cg_cs.cs_nffree += frags; + /* Add back in counts associated with the new frags */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, 1); + /* If a complete block has been reassembled, account for it. */ + fragno = fragstoblks(fs, bbase); + if (ffs_isblock(fs, blksfree, fragno)) { + cgp->cg_cs.cs_nffree -= fs->fs_frag; + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + } + } + stat_jnewblk++; + jnewblk->jn_state &= ~ATTACHED; + jnewblk->jn_state |= UNDONE; + + return (frags); +} + static void initiate_write_bmsafemap(bmsafemap, bp) struct bmsafemap *bmsafemap; @@ -10244,10 +10330,7 @@ initiate_write_bmsafemap(bmsafemap, bp) uint8_t *blksfree; struct cg *cgp; struct fs *fs; - int cleared; ino_t ino; - long bno; - int i; if (bmsafemap->sm_state & IOSTARTED) panic("initiate_write_bmsafemap: Already started\n"); @@ -10286,25 +10369,9 @@ initiate_write_bmsafemap(bmsafemap, bp) fs = VFSTOUFS(bmsafemap->sm_list.wk_mp)->um_fs; blksfree = cg_blksfree(cgp); LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) { - bno = dtogd(fs, jnewblk->jn_blkno); - cleared = 0; - for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; - i++) { - if (isclr(blksfree, bno + i)) { - cleared = 1; - setbit(blksfree, bno + i); - } - } - /* - * We may not clear the block if it's a background - * copy. In that case there is no reason to detach - * it. - */ - if (cleared) { - stat_jnewblk++; - jnewblk->jn_state &= ~ATTACHED; - jnewblk->jn_state |= UNDONE; - } else if ((bp->b_xflags & BX_BKGRDMARKER) == 0) + if (jnewblk_rollback(jnewblk, fs, cgp, blksfree)) + continue; + if ((bp->b_xflags & BX_BKGRDMARKER) == 0) panic("initiate_write_bmsafemap: block %jd " "marked free", jnewblk->jn_blkno); } @@ -10578,6 +10645,9 @@ handle_jwork(wkhd) case D_FREEDEP: free_freedep(WK_FREEDEP(wk)); continue; + case D_FREEFRAG: + rele_jseg(WK_JSEG(WK_FREEFRAG(wk)->ff_jdep)); + WORKITEM_FREE(wk, D_FREEFRAG); case D_FREEWORK: handle_written_freework(WK_FREEWORK(wk)); continue; @@ -11050,6 +11120,58 @@ bmsafemap_rollbacks(bmsafemap) } /* + * Re-apply an allocation when a cg write is complete. + */ +static int +jnewblk_rollforward(jnewblk, fs, cgp, blksfree) + struct jnewblk *jnewblk; + struct fs *fs; + struct cg *cgp; + uint8_t *blksfree; +{ + ufs1_daddr_t fragno; + ufs2_daddr_t blkno; + long cgbno, bbase; + int frags, blk; + int i; + + frags = 0; + cgbno = dtogd(fs, jnewblk->jn_blkno); + for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) { + if (isclr(blksfree, cgbno + i)) + panic("jnewblk_rollforward: re-allocated fragment"); + frags++; + } + if (frags == fs->fs_frag) { + blkno = fragstoblks(fs, cgbno); + ffs_clrblock(fs, blksfree, (long)blkno); + ffs_clusteracct(fs, cgp, blkno, -1); + cgp->cg_cs.cs_nbfree--; + } else { + bbase = cgbno - fragnum(fs, cgbno); + cgbno += jnewblk->jn_oldfrags; + /* If a complete block had been reassembled, account for it. */ + fragno = fragstoblks(fs, bbase); + if (ffs_isblock(fs, blksfree, fragno)) { + cgp->cg_cs.cs_nffree += fs->fs_frag; + ffs_clusteracct(fs, cgp, fragno, -1); + cgp->cg_cs.cs_nbfree--; + } + /* Decrement the old frags. */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, -1); + /* Allocate the fragment */ + for (i = 0; i < frags; i++) + clrbit(blksfree, cgbno + i); + cgp->cg_cs.cs_nffree -= frags; + /* Add back in counts associated with the new frags */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, 1); + } + return (frags); +} + +/* * Complete a write to a bmsafemap structure. Roll forward any bitmap * changes if it's not a background write. Set all written dependencies * to DEPCOMPLETE and free the structure if possible. @@ -11069,9 +11191,7 @@ handle_written_bmsafemap(bmsafemap, bp) struct cg *cgp; struct fs *fs; ino_t ino; - long bno; int chgs; - int i; if ((bmsafemap->sm_state & IOSTARTED) == 0) panic("initiate_write_bmsafemap: Not started\n"); @@ -11121,18 +11241,9 @@ handle_written_bmsafemap(bmsafemap, bp) jntmp) { if ((jnewblk->jn_state & UNDONE) == 0) continue; - bno = dtogd(fs, jnewblk->jn_blkno); - for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; - i++) { - if (bp->b_xflags & BX_BKGRDMARKER) - break; - if ((jnewblk->jn_state & NEWBLOCK) == 0 && - isclr(blksfree, bno + i)) - panic("handle_written_bmsafemap: " - "re-allocated fragment"); - clrbit(blksfree, bno + i); + if ((bp->b_xflags & BX_BKGRDMARKER) == 0 && + jnewblk_rollforward(jnewblk, fs, cgp, blksfree)) chgs = 1; - } jnewblk->jn_state &= ~(UNDONE | NEWBLOCK); jnewblk->jn_state |= ATTACHED; free_jnewblk(jnewblk); @@ -11826,6 +11937,11 @@ softdep_sync_metadata(struct vnode *vp) * truncations are started, and inode references are journaled. */ ACQUIRE_LOCK(&lk); + /* + * Write all journal records to prevent rollbacks on devvp. + */ + if (vp->v_type == VCHR) + softdep_flushjournal(vp->v_mount); error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number); /* * Ensure that all truncates are written so we won't find deps on From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 05:45:37 2011 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 34EA4106564A; Mon, 20 Jun 2011 05:45:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AFC7114F17E; Mon, 20 Jun 2011 05:45:34 +0000 (UTC) Message-ID: <4DFEDE7B.9070701@FreeBSD.org> Date: Sun, 19 Jun 2011 22:45:31 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ivan Klymenko References: <20110619213749.0cf6397c@ukr.net> In-Reply-To: <20110619213749.0cf6397c@ukr.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223264 - in head: etc/defaults etc/rc.d 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: Mon, 20 Jun 2011 05:45:38 -0000 On 06/19/2011 11:37, Ivan Klymenko wrote: > Hello! > Thanks for commit. > > I have a question: > If a lot of kernel modules, option kld_list = "" supports moving to a > new line? > For example: > kld_list = " ....< moduleN>\ > " Everything in rc.conf is sh-related, so yes. Although, it's not necessary unless you want it to look pretty. > Maybe specify its example of manual documentation page for rc.conf? I'm not sure that level of user education belongs in rc.conf.5. :) hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 06:42:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0356106566C; Mon, 20 Jun 2011 06:42:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 312548FC1A; Mon, 20 Jun 2011 06:42:50 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1FB8B25D388C; Mon, 20 Jun 2011 06:42:48 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B51A815A1371; Mon, 20 Jun 2011 06:42:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id taS2IMebzwM1; Mon, 20 Jun 2011 06:42:45 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 30A5215A1364; Mon, 20 Jun 2011 06:42:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106192259.p5JMxsBS013080@svn.freebsd.org> Date: Mon, 20 Jun 2011 06:42:43 +0000 Content-Transfer-Encoding: 7bit Message-Id: <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> References: <201106192259.p5JMxsBS013080@svn.freebsd.org> To: Doug Barton X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223311 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 06:42:50 -0000 On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > Author: dougb > Date: Sun Jun 19 22:59:54 2011 > New Revision: 223311 > URL: http://svn.freebsd.org/changeset/base/223311 > > Log: > Blah, forgot to svn add the actual script from r223310 > Now that it is generic, what about IPv6? > ... > + > + for ip in ${netwait_ip}; do > + echo -n "Waiting for ${ip} to respond to ICMP" > + > + count=1 > + while [ ${count} -le ${netwait_timeout} ]; do > + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 > + rc=$? -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 07:05:40 2011 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 0F0CB1065748; Mon, 20 Jun 2011 07:05:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AA643203405; Mon, 20 Jun 2011 07:05:39 +0000 (UTC) Message-ID: <4DFEF142.1080209@FreeBSD.org> Date: Mon, 20 Jun 2011 00:05:38 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201106192259.p5JMxsBS013080@svn.freebsd.org> <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> In-Reply-To: <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 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, Jeremy Chadwick Subject: Re: svn commit: r223311 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 07:05:40 -0000 On 06/19/2011 23:42, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > >> Author: dougb >> Date: Sun Jun 19 22:59:54 2011 >> New Revision: 223311 >> URL: http://svn.freebsd.org/changeset/base/223311 >> >> Log: >> Blah, forgot to svn add the actual script from r223310 >> > > Now that it is generic, what about IPv6? I have no intention of holding an exclusive lock on this script. If you and/or Jeremy work something out feel free to commit it. Just let me know so that when I MFC the original I can catch the update too. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 07:07:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D76491065670; Mon, 20 Jun 2011 07:07:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C34378FC12; Mon, 20 Jun 2011 07:07:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K77Iod028440; Mon, 20 Jun 2011 07:07:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K77Isx028438; Mon, 20 Jun 2011 07:07:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106200707.p5K77Isx028438@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 07:07: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: r223326 - 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, 20 Jun 2011 07:07:20 -0000 Author: bz Date: Mon Jun 20 07:07:18 2011 New Revision: 223326 URL: http://svn.freebsd.org/changeset/base/223326 Log: Fix a KASSERT from r212803 to check the correct length also in case of IPsec being compiled in and used. Improve reporting by adding the length fields to the panic message, so that we would have some immediate debugging hints. Discussed with: jhb Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jun 20 03:25:09 2011 (r223325) +++ head/sys/netinet/tcp_output.c Mon Jun 20 07:07:18 2011 (r223326) @@ -1102,8 +1102,15 @@ send: m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; } +#ifdef IPSEC + KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u", + __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); +#else KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected", __func__)); + ("%s: mbuf chain shorter than expected: %ld + %u + %u != %u", + __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); +#endif /* * In transmit state, time the transmission and arrange for From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 07:41:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD310106566C for ; Mon, 20 Jun 2011 07:41:14 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6AF8FC12 for ; Mon, 20 Jun 2011 07:41:14 +0000 (UTC) Received: from omta19.westchester.pa.mail.comcast.net ([76.96.62.98]) by qmta03.westchester.pa.mail.comcast.net with comcast id y7Tz1g00127AodY537TzVj; Mon, 20 Jun 2011 07:27:59 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta19.westchester.pa.mail.comcast.net with comcast id y7Tx1g0041t3BNj3f7TxRb; Mon, 20 Jun 2011 07:27:59 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 93CB1102C36; Mon, 20 Jun 2011 00:27:55 -0700 (PDT) Date: Mon, 20 Jun 2011 00:27:55 -0700 From: Jeremy Chadwick To: Doug Barton Message-ID: <20110620072755.GA65080@icarus.home.lan> References: <201106192259.p5JMxsBS013080@svn.freebsd.org> <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> <4DFEF142.1080209@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DFEF142.1080209@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223311 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 07:41:14 -0000 On Mon, Jun 20, 2011 at 12:05:38AM -0700, Doug Barton wrote: > On 06/19/2011 23:42, Bjoern A. Zeeb wrote: > >On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > > > >>Author: dougb > >>Date: Sun Jun 19 22:59:54 2011 > >>New Revision: 223311 > >>URL: http://svn.freebsd.org/changeset/base/223311 > >> > >>Log: > >> Blah, forgot to svn add the actual script from r223310 > >> > > > >Now that it is generic, what about IPv6? > > I have no intention of holding an exclusive lock on this script. If > you and/or Jeremy work something out feel free to commit it. Just > let me know so that when I MFC the original I can catch the update > too. Hmm... Well, my experience with IPv6 at this point is extremely limited (just because I have a bunch of books doesn't mean I've had the time to read them yet. :-) ) I imagine it wouldn't be too hard to add a netwait_ipv6 variable and use /sbin/ping6 instead, but I'm not sure what people would like in the case that someone defined both netwait_ip and netwait_ipv6. Ping them both I guess? It'd be easier for me if I had a good IPv6 environment to test in/with, rather than enhance the script and make guesses at whether or not it would work reliably. Meaning: I'd be happy to spend the time to write what's necessary, but it might be more effective for someone who already has a good IPv6 setup to work on it. Does that make sense? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 08:00:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44FE2106566B; Mon, 20 Jun 2011 08:00:33 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32ABE8FC1F; Mon, 20 Jun 2011 08:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K80XDb030163; Mon, 20 Jun 2011 08:00:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K80XLp030158; Mon, 20 Jun 2011 08:00:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106200800.p5K80XLp030158@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 20 Jun 2011 08:00: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: r223328 - in head: contrib/lukemftp contrib/tnftp contrib/tnftp/src usr.bin/ftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 08:00:33 -0000 Author: gavin Date: Mon Jun 20 08:00:32 2011 New Revision: 223328 URL: http://svn.freebsd.org/changeset/base/223328 Log: Merge tnftp-20100108 from the vendor branch into head. PR: bin/112288 bin/120256 bin/129014 bin/145528 MFC after: 1 month Added: head/contrib/tnftp/Makefile.am - copied unchanged from r223308, vendor/tnftp/dist/Makefile.am head/contrib/tnftp/src/Makefile.am - copied unchanged from r223308, vendor/tnftp/dist/src/Makefile.am head/contrib/tnftp/tnftp.h - copied unchanged from r223308, vendor/tnftp/dist/tnftp.h head/usr.bin/ftp/tnftp_config.h - copied, changed from r223307, head/usr.bin/ftp/config.h Deleted: head/contrib/lukemftp/ head/contrib/tnftp/FreeBSD-patchset head/contrib/tnftp/acconfig.h head/contrib/tnftp/aclocal.m4 head/contrib/tnftp/config.h.in head/contrib/tnftp/configure head/contrib/tnftp/configure.in head/contrib/tnftp/diffout head/contrib/tnftp/install-sh head/contrib/tnftp/lukemftp.h head/contrib/tnftp/src/Makefile head/usr.bin/ftp/config.h Modified: head/contrib/tnftp/COPYING (contents, props changed) head/contrib/tnftp/ChangeLog (contents, props changed) head/contrib/tnftp/INSTALL (contents, props changed) head/contrib/tnftp/Makefile.in (contents, props changed) head/contrib/tnftp/NEWS (contents, props changed) head/contrib/tnftp/README (contents, props changed) head/contrib/tnftp/THANKS (contents, props changed) head/contrib/tnftp/src/Makefile.in (contents, props changed) head/contrib/tnftp/src/cmds.c (contents, props changed) head/contrib/tnftp/src/cmdtab.c (contents, props changed) head/contrib/tnftp/src/complete.c (contents, props changed) head/contrib/tnftp/src/domacro.c (contents, props changed) head/contrib/tnftp/src/extern.h (contents, props changed) head/contrib/tnftp/src/fetch.c (contents, props changed) head/contrib/tnftp/src/ftp.1 (contents, props changed) head/contrib/tnftp/src/ftp.c (contents, props changed) head/contrib/tnftp/src/ftp_var.h (contents, props changed) head/contrib/tnftp/src/main.c (contents, props changed) head/contrib/tnftp/src/progressbar.c (contents, props changed) head/contrib/tnftp/src/progressbar.h (contents, props changed) head/contrib/tnftp/src/ruserpass.c (contents, props changed) head/contrib/tnftp/src/util.c (contents, props changed) head/contrib/tnftp/src/version.h (contents, props changed) head/contrib/tnftp/todo (contents, props changed) head/usr.bin/ftp/Makefile Directory Properties: head/contrib/tnftp/ (props changed) Modified: head/contrib/tnftp/COPYING ============================================================================== --- head/contrib/tnftp/COPYING Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/COPYING Mon Jun 20 08:00:32 2011 (r223328) @@ -1,4 +1,10 @@ -Copyright 1999, 2000 Luke Mewburn . All rights reserved. +$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $ + +Copyright (c) 2001-2010 The NetBSD Foundation, Inc. +All rights reserved. + +This code is derived from software contributed to The NetBSD Foundation +by Simon Burge, Luke Mewburn, and Christos Zoulas. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -10,20 +16,24 @@ are met: documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: - This product includes software developed by Luke Mewburn. -4. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + This product includes software developed by the NetBSD + Foundation, Inc. and its contributors. +4. Neither the name of The NetBSD Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + This product also contains software developed by other people, and you are advised to read the various source files to read the full details @@ -32,11 +42,13 @@ acknowledgements: This product includes software developed by the NetBSD Foundation, Inc. and its contributors. Those contributors include: + - Simon Burge - Jaromir Dolecek - Klaus Klein - Luke Mewburn - Jason R. Thorpe of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. + - Christos Zoulas This product includes software developed by the University of California, Berkeley and its contributors. Those contributors include: Modified: head/contrib/tnftp/ChangeLog ============================================================================== --- head/contrib/tnftp/ChangeLog Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/ChangeLog Mon Jun 20 08:00:32 2011 (r223328) @@ -1,3 +1,713 @@ +$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $ + +Tue Jan 12 06:58:15 UTC 2010 lukem + + * Release as "tnftp 20100108" + + * Rename onoff() argument "bool" to "val". + +Tue Jan 5 09:12:01 UTC 2010 lukem + + * If ARG_MAX isn't defined, use the result from sysconf(_SC_ARG_MAX). + Fixes build when using newer glibc. + + * Add libnetbsd.la to the LIBADD for libedit. + Fix provided by Adam Sampson. + +Mon Jan 4 06:28:07 UTC 2010 lukem + + * Distribute various files not shipped by default automake rules, + to use 'make dist' instead of 'cvs export'. + +Wed Dec 30 00:12:47 UTC 2009 lukem + + * Release as "tnftp 20091122" + +Sun Nov 15 10:14:44 UTC 2009 lukem + + * Merge NetBSD ftp from 20090520 to 20090915. Change: + - Rename internal getline() to get_line() to avoid + conflict with libc with former. + - Avoid a NULL dereference in an error message. + +Sat Nov 14 09:21:19 UTC 2009 lukem + + * Convert to automake & libtool. + +Sat Jun 6 07:17:38 UTC 2009 lukem + + * Release as "tnftp 20090606" + +Fri May 22 01:11:15 UTC 2009 lukem + + * configure fixes: + - Add the time.h headers to accheck_includes, for the strptime check. + - Remove the check for el_init in libedit; we're always replacing + the library and the presence of strvis() in some versions + confuses other checks. + +Wed May 20 13:47:43 UTC 2009 lukem + + * Release as "tnftp 20090520" + + * Merge NetBSD ftp from 20070722 to 20090520. Changes: + - Only attempt to el_parse() a command unknown by the default + parser if editing is enabled. + Fixes PR 38589. + - Turn off the alarmtimer before resetting the SIGALRM handler + back to SIG_DFL. + Fixes PR 35630. + - Add epsv6 and epsv to disable extended passive mode for ipv6 or + both ipv4 and ipv6 respectively. This hack is due to our + friends a Juniper Networks who break epsv in ipv6. + Should be fixed in ScreenOS 6.2.X. + - Improve parsing of chunked transfer chunks per RFC2616: + - more stringent chunk-size parsing + - ignore optional trailing ';chunk-ext' stuff, instead of barfing + - detect EOF before final \r\n. + - Use the service name to getaddrinfo() (along with the host + name), so that features such as DNS Service Discovery have a + better chance of working. + Display the service name in various status & error messages. + - Don't getservbyname() the :port component of a URL; RFC 3986 + says it's just an unsigned number, not a service name. + - Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare). + - Fix -Wshadow issues + - Update copyrights + - Remove clause 3 and 4 from TNF licenses + - Rename HAVE_STRUCT_SOCKADDR_SA_LEN to + HAVE_STRUCT_SOCKADDR_IN_SIN_LEN to accurately reflect the + structure member being used. + - Use AF_INET instead of AF_UNSPEC as the default family if + !defined(INET6). + + * configure improvements: + - Style tweaks. + - Use AC_LANG_PROGRAM() instead of AC_LANG_SOURCE() + - Add a check for strptime() requiring separators between + conversions, and use our replacement one if it does. + +Sat Dec 20 15:28:24 UTC 2008 lukem + + * configure improvements: + - Move IPv6 check from tnftp.h to configure.ac (as per tnftpd). + - Rework option descriptions. + - Highlight when tests are for a specific option. + - Move configuration results to the end of the file. + - Display $prefix in configure results. + +Fri Aug 15 03:03:36 UTC 2008 lukem + + * Add a "Configuration results" display at the end of configure. + Cosmetic tweaks. + +Fri Feb 29 09:45:56 UTC 2008 lukem + + * Support @EXEEXT@ for Cygwin (etc). + +Mon Aug 6 04:55:19 UTC 2007 lukem + + * Release as "tnftp 20070806" + + * Add a NEWS file. + + * Reduce differences between NetBSD-ftp and local copy. + + * Merge NetBSD ftp from 20070605 to 20070722. + Changes: + - Document about:ftp and about:version. + + * Add autoconf check for (Dante) SOCKS5. + (Needs run-time testing and more portability testing.) + +Mon Jul 23 11:44:42 UTC 2007 lukem + + * Don't use non-standard: u_char u_short u_int. + Use uint32_t instead of u_int32_t. + + * Consistently use AS_CASE() and AS_IF() in configure.ac. + + * Don't use defined() with HAVE_DECL_xxx. + Use `LL' instead of `L' suffix for fallback + defines of LLONG_MIN and LLONG_MAX. + +Sun Jul 22 12:00:17 UTC 2007 lukem + + * Include if available, and provide fallback #defines. + + * Sync with lib/libc/inet/inet_pton.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Fix some lint + + * Sync with lib/libc/inet/inet_ntop.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Use socklen_t instead of size_t + * Use snprintf() instead of SPRINTF() + * Improve detection of various boundary conditions + + * Sync to NetBSD glob.h 1.21, glob.c 1.16: + * Standards compliance fix + * De-lint + * Don't overflow when DEBUG is defined. + + * Sync fgetln.c to tools/compat/fgetln.c 1.7: + * Clause 3 removal. + + * Sync to config.guess 2007-07-22, config.sub 2007-06-28. + + * Consistency tweaks in configure help strings. + + * Add check for struct sockaddr.sa_len. + Change tests for HAVE_foo to defined(HAVE_foo). + Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN. + + * Remove pretence of supporting SOCKS for now; + no test system is available, and the old + autoconf 2.13 support wasn't upgraded to 2.61. + + * configure.ac style consistency tweaks. + Move autoconf aux files from ./ to build-aux/ + + * Remove duplicate HAVE_STRERROR replacement in tnftp.h. + +Thu Jun 7 04:47:47 UTC 2007 lukem + + * Merge NetBSD ftp from 20070510 to 20070605. Changes: + - Enforce restriction that (http) proxied URL fetchs don't + support being restarted at this time. + Addresses NetBSD Problem Report 28697. + - Display times in RFC2822 form rather than using ctime(3), + since the former is more explicit about the timezone offset. + - main: call tzset() to ensure TZ is setup for other + functions. + - remotemodtime(): use strptime() to parse the reply. + - fetch_url(): ensure struct tm is zeroed before calling + strptime(). + - Modify parse_url() to consistently strip the leading `/' + off ftp URLs. + Fixes NetBSD Problem Report 17617. + - Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be + consistent with the style in the RFC index. + - Refer to RFC3916 instead of 1738 or 2732. + - Expand the list of supported RFCs in ftp(1) to contain the + document name as well. + +Fri May 11 04:39:55 UTC 2007 lukem + + * Update INSTALL and COPYING. + + * Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only + require support for 'long long' in that check rather than + needing sizeof(off_t)>=8, as some systems have a separate + off64_t when Large File Support is enabled. + + * config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*' + +Thu May 10 15:23:33 UTC 2007 lukem + + * Remove checks for util.h and libutil.h, and replacement for + fparseln(), since fparseln() isn't used any more. + + * Merge NetBSD ftp from 20070418 to 20070510. Changes: + - Switch from fparseln() to the internal getline() when + parsing HTTP headers. Makes ftp a bit more portable + (not needing fparseln()) at the expense of not supporting + arbitrary long header lines, which I'm not concerned about + because we don't support header line continuation either... + - Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. + - Fix misplaced const. + - Implement copy_bytes() to copy bytes from one fd to another + via the provided buffer, with optional rate-limiting and + hash-mark printing, using one loop and handle short writes. + Refactor sendrequest() and recvrequest() to use copy_data(). + Addresses NetBSD Problem Report 15943. + +Wed May 9 05:24:55 UTC 2007 lukem + + * Fix typo in poll()-based implementation of usleep() replacement. + +Wed May 9 04:58:50 UTC 2007 lukem + + * Rename configure.in to configure.ac, as the latter is the + preferred name in autoconf 2.61. + + * Convert from autoconf 2.13 to 2.61: + * Use a consistent quoting mechanism. + * Use modern autoconf macros, #define names, etc. + * Search for more header files, and only #include if found. + * Remove old-style config.h.in generation. + This may fix various tests on platforms such as FreeBSD and OS X. + + * Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the + linker supports it. This is needed so we use our libedit + rather than the system one. + + XXX: SOCKS support is currently disabled until I update the + autoconf support. + +Mon Apr 23 06:04:26 UTC 2007 lukem + + * Merge NetBSD ftp from 20050610 to 20070418. Changes: + - Add '-s srcaddr'. + - Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of + 10^n "KB", "MB", ... + - Recognize 307 redirect code. + - Suppress printing non-COMPLETE reply strings when EPSV/EPRT + fails and we fall-back to PASV/PORT. Should fix a problem + with the emacs ftp wrapper. + - Fix display of 'Continue with ' messages. + - Prevent segfaults in .netrc parsing. + - Flush stdout before each command; ftp as slave process on + a pipe should work. + - getpass() can return NULL in some implementations; cope. + - Support '-q quittime' when waiting for server replies. + - Various spelling & grammatical fixes in the manual. + - Plug some memory leaks. + - If a file upload (via -u) fails, return an non-zero exit + value based on the index of the file that caused the + problem (a la auto-fetch retrieval). + - Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610 + - Don't remove trailing character during auth_url() + - Fix progressbar display on narrow terminals (<43 columns) + +Fri Mar 16 06:00:14 UTC 2007 lukem + + * Change the return value of the replacement gai_strerror() + from "char *" to "const char *", to match the current + standards. + Problem noted by Thomas Klausner. + +Thu Oct 26 07:24:22 UTC 2006 lukem + + * Correctly parse "AM" and "PM" in the replacement strptime(). + Problem noted by Kathryn Hogg. + +Sat Jun 25 06:27:00 UTC 2005 lukem + + * Release as "tnftp 20050625" + + * Simplify the detection & replacement of dirname() and fparseln() + and just use AC_REPLACE_FUNCS. + (We don't care if the vendor has a working version in -lgen or -lutil + instead of -lc; they'll get our replacement version in that case). + Fixes build issue on older Darwin where the previous autoconf check + wouldn't find dirname() in the default system libraries. + + * Only provide a prototype for dirname() if we can't find one in + + + * Search for NS_IN6ADDRSZ instead of IN6ADDRSZ, since we use the + former and not the latter and older Darwin has the former. + (This allows INET6 support to be enabled on Darwin 7.9.0) + +Mon Jun 13 09:22:13 UTC 2005 lukem + + * Tweak SOCKS5 support: + acconfig.h: + - fix a comment + - ensure close() is replaced + - list entries in the same order as aclocal.m4 + (and the SOCKS5 FAQ) + aclocal.m4: + - ensure getpeername() is replaced + - don't replace listen() twice + +Fri Jun 10 04:39:33 UTC 2005 lukem + + * Release as "tnftp 20050610" + + * Add dependencies on ${srcdir}/../tnftp.h and ../config.h + + * Merge NetBSD ftp from 20050609 to 20050610. Changes: + - Implement getline() to read a line into a buffer. + - Convert to use getline() instead of fgets() whenever reading + user input to ensure that an overly long input line doesn't + leave excess characters for the next input operation to + accidentally use as input. + - Zero out the password & account after we've finished with it. + - Consistently use getpass(3) (i.e, character echo suppressed) + when reading the account data. For some reason, historically + the "login" code suppressed echo for Account: yet the "user" + command did not! + - Display the hostname in the "getaddrinfo failed" warning. + - Appease some -Wcast-qual warnings. Fixing all of these + requires significant code refactoring. (mmm, legacy code). + +Thu Jun 9 16:49:05 UTC 2005 lukem + + * src, libnetbsd: Excise RCSID block, rather than using + #if 0 ... #endif. The point was to minimise RCSID + conflicts, and the latter isn't helping there. + + * Merge NetBSD ftp from 20050531 to 20050609. Changes: + - Only print the "Trying
..." message if verbose + and there's more than one struct addrinfo in the + getaddrinfo() result. + - Don't use non-standard "u_int". + +Wed Jun 1 15:08:01 UTC 2005 lukem + + * Look for dirname(3), which may be in -lgen on IRIX, and + replace it if not found.. + +Wed Jun 1 11:48:58 UTC 2005 lukem + + * libnetbsd: + - Don't use non-standard: u_char u_short u_int. + - Use uint32_t instead of u_int32_t. + - Don't use register. + + * libedit: Don't use non-standard uint or u_int. + +Tue May 31 02:23:08 UTC 2005 lukem + + * tnftp.h: need for dirname(3) + + * Merge ftp from 20050513 to 20050531. Changes: + - Helps if the definition of xconnect() matches its + declaration.... + - Fix some cast issues highlighted by Scott Reynolds using + gcc 4 on OSX.4 + - Use size_t instead of int where appropriate. + - Make this compile on sparc64 (size_t != int). + - Printf field widths and size_t don't always mix well, so + cast to int. Fixes build problem for alpha. + - Some const cleanups. + - tab cleanup + - Improve method used in fileindir() to determine if `file' + is in or under `dir': realpath(3) on non-NetBSD systems may + fail if the target filename doesn't exist, so instead use + realpath(3) on the parent directory of `file'. + Per discussion with Todd Eigenschink. + - formatbuf(): fix %m and %M to use the hostname, not the + username. + - fetch_ftp(): preserve 'anonftp' across a disconnect() so + that multiple ftp auto-fetches on the same command line + login automatically. + - auto_fetch(): use an initialized volatile int to appease + IRIX cc. + + * Merge libedit from NetBSD 20050105 to 20050531. Changes include: + - Rui Paulo: Incorrect tok_line and tok_str declarations. + - Remove clause 3 from the UCB license. + - Luke Mewburn: Don't abuse unconstify'ing a string + and writing to it, because you'll core dump. Also remove + extra const that gives pain to the irix compiler. + - Make sure we flush after we prepare when we are unbuffered + otherwise the prompt will not appear immediately. + - Terminate the arglist with a NULL instead of 0. + (Shuts up gcc4.x) + +Sat May 28 13:19:38 UTC 2005 lukem + + * libnetbsd/strvis.c: + - Sync to NetBSD's vis.c 1.33: + Use malloc(3) instead of alloca(3). + - Remove extraenous #endif + +Fri May 27 05:46:58 UTC 2005 lukem + + * libnetbsd/strvis.c: Sync to NetBSD's vis.c 1.30: + Use a more standard TNF license. + + * libedit/sig.c: Include "src/progressbar.h" for xsignal_restart() + prototype. + + * Ensure that fallback #define of __attribute__ is available. + Fixes build problem on HP-UX with cc. + +Thu May 26 14:21:08 UTC 2005 lukem + + * Extend xpoll()'s HAVE_SELECT implementation to support POLLRDNORM, + POLLWRNORM, and POLLRDBAND - the latter using exceptfds. + Per discussion with Christos Zoulas. + +Mon May 16 13:33:27 UTC 2005 lukem + + * Pull in or if they exist even if we're + not using poll, as struct pollfd might exist in those. + Fixes build problem on OSX.3. + + * Separate CPPFLAGS from CFLAGS. + + * Sync various files in libnetbsd with the original versions + in NetBSD. Notable changes + - Convert 4 clause UCB license to 3 clause. + - Use strlcpy instead of strcpy. + - Update ISC copyright. + - Use NS_INADDRSZ, NS_IN6ADDRSZ and NS_INT16SZ instead of + equivalents without NS_ prefix. + - Use socklen_t instead of size_t where appropriate. + - Improve bounds checking. + - Don't update the size of allocated storage until + realloc succeeds. + - Fix comment about return value. + - Reverse the order of two loop invariant to make + 'strlcat(0, "foo", 0)' not get a SEGV. + - Use Todd C. Miller's latest copyright notice (more loose). + - Use "long long" instead of "quad" in various + comments & constants. + - Support VIS_HTTPSTYLE. + - Implement svis(), strsvis(), strsvisx(), strunvisx(). + + * Prefer poll over select when implementing replacement usleep(). + +Sat May 14 04:44:35 UTC 2005 lukem + + * Release "tnftp 20050514" + + * Fail if we can't find a library with tgetent (needed for libedit). + NetBSD PR pkg/28925. + * Improve quoting when using various autoconf macros. + + * Merge NetBSD-ftp 20050513: + - Correct the "optlen" argument passed to getsockopt(3) and + setsockopt(3) in various places. Fixes a problem noted by + Allen Briggs. + - Improve warning printed when connect(2) for the data + channel fails. + +Wed May 11 04:19:43 UTC 2005 lukem + + * Release "tnftp 20050511" + +Wed May 11 04:10:01 UTC 2005 lukem + + * Update the THANKS file. + + * Only use poll() to implement xpoll() if it's available, + otherwise attempt to use select() if that's available, + otherwise #error. + + * Detect if struct pollfd is available in or . + Improve consistency in use of autoconf macros. + +Wed May 11 02:42:08 UTC 2005 lukem + + * Merge NetBSD-ftp 20050511: + - Use socklen_t instead of int as the 5th argument to + getsockopt(). Improve invocation of setsockopt() and + associated failure messages. + +Wed May 11 01:46:29 UTC 2005 lukem + + * Clean up RCSID usage in vendor-derived code, restoring original + IDs where possible. + +Wed May 11 00:08:16 UTC 2005 lukem + + * Merge NetBSD-ftp 20050510: + - Prevent an overly-long input line causing a core dump when + editing is enabled. + Issue noted by Ryoji Kanai in FreeBSD Problem Report # 77158. + - Implement a timeout on the accept(2) in dataconn() and the + connect(2) in xconnect() by temporarily setting O_NONBLOCK + on the socket and using xpoll() to wait for the operation + to succeed. The timeout used is the '-q quittime' argument + (defaults to 60s for accept(2), and the system default for + connect(2)). Idea inspired by discussion with Chuck Cranor. + This may (indirectly) fix various problems with timeouts in + active mode through broken firewalls. + - Implement xpoll() as a wrapper around poll(2), to make it + easier to replace on systems without a functional poll(2). + Unconditionally use xpoll() instead of conditionally using + select(2) or poll(2). + - In fetch_url(), don't call freeaddrinfo(res0) too early, as + we use pointers to its contents later in the function. + Problem found by Onno van der Linden. + - Fix ftp url reget when globs are being used. + Provided by Mathieu Arnold . + - Factor out common string processing code eliminating static + buffers, making functions that should be static be static, + and cleaning up const usage. Added a guard against buffer + overflow, but the domap function is a bit too complicated + to tackle right now. + - Clean up whitespace. + - Expand description of http_proxy by suggesting the use of + RFC 1738 '%xx' encoding for "unsafe URL" characters in + usernames and passwords. + +Wed Jan 5 05:53:59 UTC 2005 lukem + + * For now, assume libedit is not up-to-date and use our own version. + + * Merge libedit from NetBSD 20020605 to 20050105. Changes include: + - Improve vi-mode. + - Delete-previous-char and delete-next-char without an + argument are not supposed to modify the yank buffer in + emacs-mode. + - Improve incremental searching. + - Improve memory allocation & usage. + - Move UCB-licensed code from 4-clause to 3-clause. + - Make the tokenization functions publically available. + - Various tty access bug-fixes. + - Improve readline emulation. + +Tue Jan 4 13:33:40 UTC 2005 lukem + + * Unixware 7.1.1 implements RFC 2133 (Basic Socket Interface + Extensions for IPv6) but not the successor RFC 2553. The configure + script detects this and decides that tnftp needs to compile its own + version of getaddrinfo(). This produces the error message + /usr/include/netdb.h:248: `getaddrinfo' previously defined here + because Unixware provides an implementation of getaddrinfo() in + netdb.h instead of a prototype declaration :-/. Since netdb.h + cannot be omitted, we will always get this definition and tnftp's + version of getaddrinfo will always create a conflict. This ugly + preprocessor hack works around the problem. Hints for a better + solution welcome. Fix from pkgsrc/net/tnftp. + + * Workaround poll() being a compatibility function on Darwin 7 + (MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which + is defined in poll.h on some MacOSX 10.3 systems. Not all 10.3 + systems have poll.h, so only do the poll() test if at least one + of the header files is found. Fix from pkgsrc/net/tnftp. + + * Add a utimes() replacement (using utime()) for Interix. + From pkgsrc/net/tnftp. + +Mon Jan 3 10:21:57 UTC 2005 lukem + + * Release "tnftp 20050103" + + * Merge NetBSD-ftp 20050103: + - Forbid filenames returned from mget that aren't in (or below) + the current directory. The previous behaviour (of trusting + the remote server's response when retrieving the list of + files to mget with prompting disabled) has been in ftp + ~forever, and has been a "known issue" for a long time. + Recently an advisory was published by D.J. Bernstein on + behalf of Yosef Klein warning of the problems with the + previous behaviour, so to alleviate concern I've fixed + this with a sledgehammer. + - Remember the local cwd after any operation which may + change it. + - Use "remotecwd" instead of "remotepwd". + - Add (unsigned char) cast to ctype functions + - Ensure that "mname" is set in ls() and mls() so that an + aborted confirm() prints the correct name. + Problem highlighted & suggested fix from PR [bin/17766] + by Steve McClellan. + - If an ftp auto-fetch transfer is interrupted by SIGINT + (usually ^C), exit with 130 instead of 1 (or rarely, 0). + This allows an ftp auto-fetch in a shell loop to correctly + terminate the loop. + Should fix PR [pkg/26351], and possibly others. + - Save approximately 8K by not including http authentication, + extended status messages and help strings when the + appropriate options are set. + - Move UCB-licensed code from 4-clause to 3-clause licence. + Patches provided by Joel Baker in PR 22365, verified by + Alistair Crooks. + - Always decode %xx in a url's user & pass components. + - Only remember {WWW,Proxy}-Authenticate "Basic" challenges; no + point in tracking any others since ftp doesn't support them. + - Improve the parsing of HTTP responses. + - Don't base64 encode the trailing NUL in the HTTP basic auth + response. Problem noted by Eric Haszlakiewicz. + - Improve parsing of HTTP response headers to be more RFC2616 + compliant, and skip LWS (linear white space; CR, LF, space, + tab) and the end of lines and between the field name and + the field value. This still isn't 100% compliant, since we + don't support "multi line" responses at this time. + This should fix PR [bin/22611] from TAMURA Kent (although I + can't easily find a http server to reproduce the problem + against.) + - Fix a minor memory leak when parsing HTTP response headers. + - Don't unnecessarily display a 401/407 error when running + with -V. Fix from PR [bin/18535] by Jeremy Reed. + - Don't warn about "ignored setsockopt" failures unless + debugging is enabled. Suggested by Todd Vierling. + - Allow empty passwords in ftp://user:@host/file auto-fetch + URLs, per RFC 1738. Requested by Simon Poole. + - correct URL syntax in comment + - Note potentially surprising file-saving behaviour in case + of HTTP redirects + - -n is ignored for auto-fetch transfers + - If connect(2) in xconnect() fails with EINTR, call select(2) + on the socket until it's writable or it fails with something + other than EINTR. This matches the behaviour in SUSv3, and + prevents the problem when pressing ^T (SIGINFO, which is + marked as restartable) during connection setup would cause + ftp to fail with EADDRINUSE or EALREADY when the second + connect(2) was attempted on the same socket. Problem found + and solution provided by Maxime Henrion . + - Add -q to usage. From Kouichirou Hiratsuka in PR 26199. + - PR/25566: Anders Magnusson: ftp(1) do not like large TCP + windows. Limit it to 8M. + +Mon Oct 6 01:23:03 UTC 2003 lukem + + * configure.in improvements: + - When testing for IN6ADDRSZ in , pull in + first. From Stoned Elipot + - Whitespace cleanup + +Mon Aug 25 11:45:45 UTC 2003 lukem + + * Release "tnftp 20030825" + + * Add autoconf test for ; Cygwin needs it for ARG_MAX. + Per discussion with Eugene Kotlyarov . + +Thu Jul 31 07:30:00 UTC 2003 lukem + + * release "tnftp 20030731" + + * merge ftp from NetBSD 20030731 to 20030731b: + - Work around broken ftp servers (notably ProFTPd) that can't + even follow RFC 2389, and skip any amount of whitespace + before a FEATure response. The RFC says 'single space' yet + ProFTPd puts two. Noted by DervishD . + - Improve formatting of features[] debug dump. + - Invalidate remote directory completion cache if any command + which may change the remote contents completes successfully, + including: del, mdel, ren, mkdir, rmdir, quote, and all + upload commands. Patch from Yar Tikhiy . + + * merge ftp from NetBSD 20030228 to 20030731: + - $FTPUSERAGENT overrides the HTTP User-Agent header. + Based on patch from Douwe Kiela . + - Add about:tnftp + - Fix URL in about:netbsd + - netbsd.org->NetBSD.org + - strlcpy fix in fetch.c + - Uppercase "URL" + - fix a bogus error message when given a HTTP URL with a + trailing slash + - groff fixes in man page + - tweak progressbar.c copyright; the stuff jason did in util.c + wasn't migrated to this file + - Don't coredump when printing '%n' in the prompt if there's + no username yet. + Fix from Maxim Konovalov + + * Add test for HAVE_IN6ADDRSZ (which older Darwin is lacking), + and only enable INET6 if it exists. + Patch from Amitai Schlair . + + * Improve ipv6 check for older linux systems that don't provide + sin6_scope_id. + Patch from YAMANO Yuji . + +Fri Feb 28 10:57:30 UTC 2003 lukem + + * tagged as "tnftp 2.0 beta1" + +Fri Feb 28 10:07:07 UTC 2003 lukem + + * renamed to `tnftp' (from `lukemftp') + + * renamed `libukem' to `libnetbsd' + + +Mon Jun 17 06:50:13 UTC 2002 lukem + + * #if USE_GLOB_H, use instead of "ftpglob.h". + Requested by Mike Heffner + Mon Jun 10 08:12:35 UTC 2002 lukem * crank FTP_VERSION from 1.6-beta1 to 1.6-beta2 @@ -223,7 +933,7 @@ Tue Oct 3 10:22:36 EST 2000 lukem Mon Sep 25 21:52:12 EST 2000 lukem * crank to version 1.5 beta5 - + Sun Sep 24 13:31:19 EST 2000 lukem * merge ftp from NetBSD-current (20000924) @@ -243,7 +953,7 @@ Sun Sep 24 13:31:19 EST 2000 lukem - in progressmeter() perform the check for foregroundproc() a little earlier - removed unused variable `items' in list_vertical() - + Sat Sep 23 15:43:34 EST 2000 lukem * remove unused sverrno in warnx() and errx() @@ -406,7 +1116,7 @@ Wed Aug 2 23:43:50 EST 2000 lukem * update from NetBSD-current (20000802): - rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* (unsigned) equivalents. name change suggested by Klaus - Klein + Klein - change defined(BSD4_4) || HAVE_SIN_LEN tests into HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists @@ -451,7 +1161,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - add support for FEAT and OPTS commands with `features' and `opts'. (from RFC 2389). - add support for MLST & MLSD (machine parseble listings) - with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. + with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. (from draft-ietf-ftpext-mlst-11) - rename remotesyst() to getremoteinfo(), and modify to parse the result from FEAT (if supported), and take into account @@ -473,7 +1183,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - minor knf (indent goto labels by one space, etc). - simply various command usage handlers by assuming that argv != NULL except for quit() and disconnect(). - - errx?/warnx? audit. do not pass variable alone, use %s. + - errx?/warnx? audit. do not pass variable alone, use %s. * check for issetugid() and don't use in libedit if it doesn't exist. @@ -572,12 +1282,12 @@ Sun Jun 4 18:00:07 EST 2000 lukem - do not pass scoped IPv6 address notation on Host: directive, since scope identifier is local to the originating node. do not allow scoped IPv6 address notation in URL, if it is - via proxy. + via proxy. - fixes from cgd: * sanity check a length (otherwise certain bogus responses can crash ftp) * allow a transfer encoding type of `binary'; certain - firewall vendors return this bogus type... + firewall vendors return this bogus type... - make debugging output unambiguous on IPv6 numeric addrs (don't use host:port) - http://[::1]:8080/ is legal. @@ -705,7 +1415,7 @@ Sun Nov 28 18:20:41 EST 1999 lukem - implement xsl_init() and xsl_add(); error checking forms of sl_{init,add}() - fix bug where the second press of on an empty word (i.e, list - all options) may have resulted in an strncmp() against NULL. + all options) may have resulted in an strncmp() against NULL. (detected by _DIAGASSERT()) - in cleanuppeer(), reset username to NULL after free()ing it. fixes [bin/8870] by Wolfgang Rupprecht @@ -985,7 +1695,7 @@ Mon Oct 4 10:57:41 EST 1999 lukem * Add support for --{en,dis}able-editcomplete (defaults to enabled), which prevents libedit support from being compiled in. - From Chris G. Demetriou + From Chris G. Demetriou Sun Oct 3 16:49:01 EST 1999 lukem Modified: head/contrib/tnftp/INSTALL ============================================================================== --- head/contrib/tnftp/INSTALL Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/INSTALL Mon Jun 20 08:00:32 2011 (r223328) @@ -1,8 +1,7 @@ INSTALLATION INTRODUCTION ------------------------- -This file describes how to compile and install lukemftp on your -system. +This file describes how to compile and install tnftp on your system. ============================================ = = @@ -11,24 +10,20 @@ system. ============================================ -For most systems, execute the following to compile and install -lukemftp: +For most systems, execute the following to compile and install tnftp: ./configure make make install -A preformatted manual page (src/ftp.cat1) is also installed. If -you wish to install the source (src/ftp.1), ensure that your system -has up-to-date mandoc macros. groff ships with this macro suite, -but it has bugs. Try: - ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/tmac/ -for a more recent version. +A preformatted manual page (src/ftp.cat1) is also installed. +If you wish to install the source (src/ftp.1), ensure that your system +has up-to-date mandoc macros, such as those that are shipped with groff. CONFIGURATION OPTIONS --------------------- -lukemftp is configured using an `autoconf' generated `configure' +tnftp is configured using an `autoconf' generated `configure' script. `configure' supports the following options: * The standard `autoconf configure' options, including: @@ -41,14 +36,11 @@ script. `configure' supports the follow * Specific options: --enable-editcomplete Turn on command line editing and completion. - --disable-editcomplete Turn off command line editing and completion - [default: enabled]. - --enable-ipv6 Enable IPv6 support (if your OS supports it) - --disable-ipv6 Disable IPv6 support (even if your OS supports it.) - [default: enabled]. - --with-socks Compile with SOCKS firewall traversal support. - --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support. - --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support. + (default: enabled) + --enable-ipv6 Enable IPv6 support (if your OS supports it). + (default: enabled) + --disable-largefile omit support for large files + --with-socks enable support for (Dante) SOCKS5 proxy The following environment variables can be set to override various compiler related settings. @@ -66,146 +58,3 @@ This can be achieved with: = = ============================================ - -PLATFORM SPECIFIC NOTES ------------------------ - -The following platforms & compilers have been tested: - -- AIX 4.1.5: -- AIX 4.2.1: -- AIX 4.3.3: - - Compiler: xlc -qlanglvl=ansi - version: xlC 3.1.4.10 -- C for AIX Compiler - version: ibmcxx.cmp 3.6.6.6 -- IBM C and C++ Compilers - - Configure with: - env CC="xlc" CFLAGS="-qlanglvl=ansi" ./configure - -- BSD/OS 4.0.1 (x86) -- BSD/OS 4.1 (x86) -- BSD/OS 4.1 (sparc) -- BSD/OS 4.2 (x86) - - Compiler: /bin/cc - version: gcc 2.7.2.1 - version: gcc version 2.95.2 19991024 - -- Digital UNIX 4.0b -- Digital UNIX 4.0d -- Digital UNIX 4.0f - - Compiler: cc -std - version: DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) - version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229) - - Configure with - env CC="cc -std" ./configure - - - Compiler: gcc - version: 2.95.1 - -- Digital UNIX 5.0 - - Compiler: cc - version: Compaq C V6.1-011 on Digital UNIX V5.0 (Rev. 910) - -- FreeBSD 3.4 (i386): -- FreeBSD 3.5 (i386): -- FreeBSD 4.1 (i386): - - Compiler: cc - version: gcc version 2.7.2.3 - version: gcc version 2.95.2 19991024 - -- HP/UX 10.20: -- HP/UX 11.00: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.10.32.03 - - Configure with - env CC="cc -Ae" ./configure - - To generate code that will run on old architectures you - may need to add "+DAportable" to CC. - - -- IRIX 6.5.4 -- IRIX 6.5.8 - Compiler: /bin/cc - version: MIPSpro Compilers: Version 7.2.1 - Compiler: - version: gcc version 2.95.2 - -- HP/UX 11.00: -- HP/UX 11.00 64 bit: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.11.01.00 - - Configure with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 09:06:45 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316DD106564A; Mon, 20 Jun 2011 09:06:45 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id AC7DE8FC12; Mon, 20 Jun 2011 09:06:44 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5K96ft2030893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 19:06:42 +1000 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.4/8.14.4) with ESMTP id p5K96f6K065239; Mon, 20 Jun 2011 19:06:41 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p5K96eK4065238; Mon, 20 Jun 2011 19:06:40 +1000 (EST) (envelope-from peter) Date: Mon, 20 Jun 2011 19:06:40 +1000 From: Peter Jeremy To: Bruce Evans Message-ID: <20110620090640.GA64900@server.vk2pj.dyndns.org> References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110609055112.P2870@besplex.bde.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <20110618210815.W889@besplex.bde.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 09:06:45 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jun-18 22:05:06 +1000, Bruce Evans wrote: >My clock measurement program (mostly an old program by Wollman) shows >the following histogram of times for a non-invariant TSC timecounter >on a 2GHz UP system: > >% min 273, max 265102, mean 273.998217, std 79.069534 >% 1th: 273 (1727219 observations) >% 2th: 274 (265607 observations) >% 3th: 275 (6984 observations) >% 4th: 280 (11 observations) >% 5th: 290 (8 observations) > >The variance is small, and differences of a single nS can be seen clearly. Unfortunately, Intel broke this in their P-state invariant TSC implementation. Rather than incrementing the TSC by one at the CPU core frequency, they increment by the core multiplier at the FSB frequency. This gives a result like the following on my Atom N270: delta samples 24 49637124 36 50312540 48 44658 60 77 This makes it virtually impossible to measure short periods. Luckily, AMD seem to have gotten this right. --=20 Peter Jeremy --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk3/DaAACgkQ/opHv/APuIdI0wCgij6nEhp+ektNaMC7IsxhSFdI skwAoJPNjU5v015VsBvQx07kGtOnw9dI =Ehiz -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 11:46:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A185A106566B; Mon, 20 Jun 2011 11:46:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9196B8FC13; Mon, 20 Jun 2011 11:46:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KBk3nS048382; Mon, 20 Jun 2011 11:46:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KBk309048379; Mon, 20 Jun 2011 11:46:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106201146.p5KBk309048379@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Jun 2011 11:46: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: r223331 - 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, 20 Jun 2011 11:46:03 -0000 Author: adrian Date: Mon Jun 20 11:46:03 2011 New Revision: 223331 URL: http://svn.freebsd.org/changeset/base/223331 Log: Add a callback for ADDBA response timeouts. TX for the given TID needs to be paused during ADDBA requests (and unpaused once the session is established.) Since net80211 currently doesn't implement software aggregation, if this pause/unpause is done in the driver (as it is in my development branch) then it will need to be unpaused both on ADDBA response and on ADDBA timeout. This callback allows the driver to unpause TX for the relevant TID. Reviewed by: bschmidt Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Mon Jun 20 08:37:34 2011 (r223330) +++ head/sys/net80211/ieee80211_ht.c Mon Jun 20 11:46:03 2011 (r223331) @@ -217,6 +217,9 @@ static int ieee80211_addba_response(stru int code, int baparamset, int batimeout); static void ieee80211_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap); +static void null_addba_response_timeout(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap); + static void ieee80211_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status); static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap); @@ -234,6 +237,7 @@ ieee80211_ht_attach(struct ieee80211com ic->ic_ampdu_enable = ieee80211_ampdu_enable; ic->ic_addba_request = ieee80211_addba_request; ic->ic_addba_response = ieee80211_addba_response; + ic->ic_addba_response_timeout = null_addba_response_timeout; ic->ic_addba_stop = ieee80211_addba_stop; ic->ic_bar_response = ieee80211_bar_response; ic->ic_ampdu_rx_start = ampdu_rx_start; @@ -1691,14 +1695,23 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK); } +/* + * ADDBA response timeout. + * + * If software aggregation and per-TID queue management was done here, + * that queue would be unpaused after the ADDBA timeout occurs. + */ static void addba_timeout(void *arg) { struct ieee80211_tx_ampdu *tap = arg; + struct ieee80211_node *ni = tap->txa_ni; + struct ieee80211com *ic = ni->ni_ic; /* XXX ? */ tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND; tap->txa_attempts++; + ic->ic_addba_response_timeout(ni, tap); } static void @@ -1721,6 +1734,12 @@ addba_stop_timeout(struct ieee80211_tx_a } } +static void +null_addba_response_timeout(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap) +{ +} + /* * Default method for requesting A-MPDU tx aggregation. * We setup the specified state block and start a timer Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Jun 20 08:37:34 2011 (r223330) +++ head/sys/net80211/ieee80211_var.h Mon Jun 20 11:46:03 2011 (r223331) @@ -307,6 +307,8 @@ struct ieee80211com { int status, int baparamset, int batimeout); void (*ic_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *); + void (*ic_addba_response_timeout)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); /* BAR response received */ void (*ic_bar_response)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int status); From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 12:03:52 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9571065675; Mon, 20 Jun 2011 12:03:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id ADE6D8FC1D; Mon, 20 Jun 2011 12:03:51 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5KC3hvD007146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 22:03:44 +1000 Date: Mon, 20 Jun 2011 22:03:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Jeremy In-Reply-To: <20110620090640.GA64900@server.vk2pj.dyndns.org> Message-ID: <20110620213851.D1479@besplex.bde.org> References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110609055112.P2870@besplex.bde.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> <20110620090640.GA64900@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 12:03:52 -0000 On Mon, 20 Jun 2011, Peter Jeremy wrote: > On 2011-Jun-18 22:05:06 +1000, Bruce Evans wrote: >> My clock measurement program (mostly an old program by Wollman) shows >> the following histogram of times for a non-invariant TSC timecounter >> on a 2GHz UP system: >> >> % min 273, max 265102, mean 273.998217, std 79.069534 >> % 1th: 273 (1727219 observations) >> % 2th: 274 (265607 observations) >> % 3th: 275 (6984 observations) >> % 4th: 280 (11 observations) >> % 5th: 290 (8 observations) >> >> The variance is small, and differences of a single nS can be seen clearly. > > Unfortunately, Intel broke this in their P-state invariant TSC > implementation. Rather than incrementing the TSC by one at the > CPU core frequency, they increment by the core multiplier at the > FSB frequency. This gives a result like the following on my Atom > N270: > delta samples > 24 49637124 > 36 50312540 > 48 44658 > 60 77 > > This makes it virtually impossible to measure short periods. > > Luckily, AMD seem to have gotten this right. I tested a FreeBSD cluster machine in userland, since it doesn't have a usable TSC timecounter (iterating $(sysctl kern.timcounter...) is too slow. %%% #include #include #include static unsigned buf[17]; static volatile unsigned v; int main(void) { int i; for (i = 0; i < 17; i++) buf[i] = rdtsc(); for (i = 0; i < 16; i++) printf("%u\n", buf[i + 1] - buf[i]); buf[0] = rdtsc(); for (i = 0; i < 1000000; i++) v = rdtsc(); printf("%.1f\n", (v - buf[0]) / 1e6); return (0); } %%% Output: 77 63 63 70 63 63 63 70 63 63 70 63 63 63 70 63 65.2 %%% It seems to always give a multiple of 7, so that might be the multiplier. 63 is also a lot, and limits the resulotion to ~34 nS at 1.86GHz. On an original Athlon64: %%% 34 8 5 8 5 8 5 8 5 8 5 8 5 8 5 8 6.5 %%% Phenom specs say 42 instead of ~6.5 IIRC. Only slightly better than 63. This is execution latencu, but although rdtsc is non-serialzied, there is only 1 of it at least on old CPUs, so it can never deliver results faster than its latency, on average. The 5's in the above seem to be lower than the latency, due to the 8's being delivered late. I normally write tests like the above in asm to get more control over the loop overhead, but the above behaviour is interesting since it is what will happen for normal unsynchronized use of rdtsc. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 12:22:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA58E1065674; Mon, 20 Jun 2011 12:22:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAAE78FC0A; Mon, 20 Jun 2011 12:22:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KCMUQk049514; Mon, 20 Jun 2011 12:22:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCMUB7049512; Mon, 20 Jun 2011 12:22:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201222.p5KCMUB7049512@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 12:22: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: r223332 - 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: Mon, 20 Jun 2011 12:22:30 -0000 Author: ae Date: Mon Jun 20 12:22:30 2011 New Revision: 223332 URL: http://svn.freebsd.org/changeset/base/223332 Log: Change the way how we update bootcode for BSD scheme. Since the only parameter that we check is size of bootcode, then allow only two sizes: size of boot1 and size of /boot/boot. This partially protects users from losing ability to boot if incorrect bootcode is specified. Requested by: ru Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Mon Jun 20 11:46:03 2011 (r223331) +++ head/sys/geom/part/g_part_bsd.c Mon Jun 20 12:22:30 2011 (r223332) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include "g_part_if.h" +#define BOOT1_SIZE 512 +#define LABEL_SIZE 512 +#define BOOT2_OFF (BOOT1_SIZE + LABEL_SIZE) +#define BOOT2_SIZE (BBSIZE - BOOT2_OFF) + FEATURE(geom_part_bsd, "GEOM partitioning class for BSD disklabels"); struct g_part_bsd_table { @@ -170,22 +175,16 @@ g_part_bsd_bootcode(struct g_part_table { struct g_part_bsd_table *table; const u_char *codeptr; - size_t hdsz, tlsz; - size_t codesz, tlofs; - hdsz = 512; - tlofs = hdsz + 148 + basetable->gpt_entries * 16; - tlsz = BBSIZE - tlofs; + if (gpp->gpp_codesize != BOOT1_SIZE && gpp->gpp_codesize != BBSIZE) + return (ENODEV); + table = (struct g_part_bsd_table *)basetable; - bzero(table->bbarea, hdsz); - bzero(table->bbarea + tlofs, tlsz); codeptr = gpp->gpp_codeptr; - codesz = MIN(hdsz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(codeptr, table->bbarea, codesz); - codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); - if (codesz > 0) - bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + bcopy(codeptr, table->bbarea, BOOT1_SIZE); + if (gpp->gpp_codesize == BBSIZE) + bcopy(codeptr + BOOT2_OFF, table->bbarea + BOOT2_OFF, + BOOT2_SIZE); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 12:35:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97516106564A; Mon, 20 Jun 2011 12:35:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87DCF8FC12; Mon, 20 Jun 2011 12:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KCZCqk049993; Mon, 20 Jun 2011 12:35:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCZCMb049991; Mon, 20 Jun 2011 12:35:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106201235.p5KCZCMb049991@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 12:35: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: r223334 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 12:35:12 -0000 Author: bz Date: Mon Jun 20 12:35:12 2011 New Revision: 223334 URL: http://svn.freebsd.org/changeset/base/223334 Log: Leave an extra comment about flowtable and IPv6 support rectifying a previous comment. MFC after: 1 week Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 20 12:32:59 2011 (r223333) +++ head/sys/net/route.c Mon Jun 20 12:35:12 2011 (r223334) @@ -1189,6 +1189,7 @@ rtrequest1_fib(int req, struct rt_addrin rt0 = NULL; /* XXX * "flow-table" only support IPv4 at the moment. + * XXX-BZ as of r205066 it would support IPv6. */ #ifdef INET if (dst->sa_family == AF_INET) { From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 15:22:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 852ED106564A; Mon, 20 Jun 2011 15:22:47 +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 754768FC14; Mon, 20 Jun 2011 15:22:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KFMleV055317; Mon, 20 Jun 2011 15:22:47 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KFMl0F055315; Mon, 20 Jun 2011 15:22:47 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201106201522.p5KFMl0F055315@svn.freebsd.org> From: Jun Kuriyama Date: Mon, 20 Jun 2011 15:22: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: r223340 - head/usr.sbin/ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 15:22:47 -0000 Author: kuriyama Date: Mon Jun 20 15:22:47 2011 New Revision: 223340 URL: http://svn.freebsd.org/changeset/base/223340 Log: Add missing argument for -h in usage. Modified: head/usr.sbin/ypserv/yp_main.c Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Mon Jun 20 13:52:14 2011 (r223339) +++ head/usr.sbin/ypserv/yp_main.c Mon Jun 20 15:22:47 2011 (r223340) @@ -216,7 +216,7 @@ reaper(int sig) static void usage(void) { - fprintf(stderr, "usage: ypserv [-h] [-d] [-n] [-p path] [-P port]\n"); + fprintf(stderr, "usage: ypserv [-h addr] [-d] [-n] [-p path] [-P port]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 16:42:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2F011065673; Mon, 20 Jun 2011 16:42:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92FE28FC0A; Mon, 20 Jun 2011 16:42:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KGgKgV057618; Mon, 20 Jun 2011 16:42:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KGgKww057616; Mon, 20 Jun 2011 16:42:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106201642.p5KGgKww057616@svn.freebsd.org> From: Xin LI Date: Mon, 20 Jun 2011 16:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223341 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 16:42:20 -0000 Author: delphij Date: Mon Jun 20 16:42:20 2011 New Revision: 223341 URL: http://svn.freebsd.org/changeset/base/223341 Log: Correct a typo. Submitted by: Fabian Keil MFC after: 3 days Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Jun 20 15:22:47 2011 (r223340) +++ head/sys/dev/atkbdc/atkbd.c Mon Jun 20 16:42:20 2011 (r223341) @@ -1100,7 +1100,7 @@ get_typematic(keyboard_t *kbd) /* * Traditional entry points of int 0x15 and 0x16 are fixed * and later BIOSes follow them. (U)EFI CSM specification - * also mandate these fixed entry points. + * also mandates these fixed entry points. * * Validate the entry points here before we proceed further. * It's known that some recent laptops does not have the From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 16:48:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF624106564A; Mon, 20 Jun 2011 16:48:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3E88FC1A; Mon, 20 Jun 2011 16:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KGm0Zh057856; Mon, 20 Jun 2011 16:48:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KGm0fp057853; Mon, 20 Jun 2011 16:48:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106201648.p5KGm0fp057853@svn.freebsd.org> From: Xin LI Date: Mon, 20 Jun 2011 16:48: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: r223342 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 16:48:00 -0000 Author: delphij Date: Mon Jun 20 16:48:00 2011 New Revision: 223342 URL: http://svn.freebsd.org/changeset/base/223342 Log: Revert r214857 pursudant to 9.0-RELEASE cycle. Requested by: jh Modified: head/contrib/top/display.c head/contrib/top/top.h Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Mon Jun 20 16:42:20 2011 (r223341) +++ head/contrib/top/display.c Mon Jun 20 16:48:00 2011 (r223342) @@ -698,7 +698,7 @@ char *text; int width; s = NULL; - width = screen_width; + width = display_width; header_length = strlen(text); if (header_length >= width) { s = malloc((width + 1) * sizeof(char)); @@ -706,14 +706,6 @@ char *text; return (NULL); strncpy(s, text, width); s[width] = '\0'; - } else { - s = malloc((width + 1) * sizeof(char)); - if (s == NULL) - return (NULL); - strncpy(s, text, width); - while (screen_width > header_length) - s[header_length++] = ' '; - s[width] = '\0'; } return (s); } @@ -738,7 +730,7 @@ char *text; if (header_status == ON) { putchar('\n'); - standout(text, stdout); + fputs(text, stdout); lastline++; } else if (header_status == ERASE) Modified: head/contrib/top/top.h ============================================================================== --- head/contrib/top/top.h Mon Jun 20 16:42:20 2011 (r223341) +++ head/contrib/top/top.h Mon Jun 20 16:48:00 2011 (r223342) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 512 +#define MAX_COLS 128 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 19:07:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53E0C1065674; Mon, 20 Jun 2011 19:07:20 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC0F8FC19; Mon, 20 Jun 2011 19:07:19 +0000 (UTC) Received: by pzk27 with SMTP id 27so5091420pzk.13 for ; Mon, 20 Jun 2011 12:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=asMHKwnzeWAqkv7wsmBIB6qQ1aIJ91+wMQyi+NPZnaU=; b=CGReixrJdnzGyel73I6dMaXp5zQg82kNaypfz/VKuAZ6vWtS2fO963nvYpwhFOQz1w 2TJg6jYaRrm9lw0qsGx3ENENmpXjadGDFieoIEhRg4BPrCCXxE/qXLSt/VRNvnfoIAGZ fc1ecyR64MqHUfN/JPDy6z56LUB5rUS6FtPxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=QI/87y5CKfH/ecx5r4ENTwx5TXSDHKeNzXyViTRmkdoT/e8rRIxfDzLAGSD9BX+Hgj WFPt4kkILk/ToGz+qk6hk64FEPQJ2eGaQbP+8oswLW2aKDvslpARcMUSDO66F9RHXq+G gL7n8AZDM50s4H5prnxybpijo1yOXynR5pO64= Received: by 10.142.3.27 with SMTP id 27mr743455wfc.173.1308596837287; Mon, 20 Jun 2011 12:07:17 -0700 (PDT) Received: from localhost (saeed.torservers.net [72.46.129.45]) by mx.google.com with ESMTPS id n8sm422185pbh.73.2011.06.20.12.07.09 (version=SSLv3 cipher=OTHER); Mon, 20 Jun 2011 12:07:13 -0700 (PDT) From: Pan Tsu To: Xin LI References: <201106201648.p5KGm0fp057853__48193.742396734$1308588512$gmane$org@svn.freebsd.org> Date: Mon, 20 Jun 2011 23:07:01 +0400 In-Reply-To: <201106201648.p5KGm0fp057853__48193.742396734$1308588512$gmane$org@svn.freebsd.org> (Xin LI's message of "Mon, 20 Jun 2011 16:48:00 +0000 (UTC)") Message-ID: <86k4cgz5ii.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223342 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 19:07:20 -0000 Xin LI writes: > Author: delphij > Date: Mon Jun 20 16:48:00 2011 > New Revision: 223342 > URL: http://svn.freebsd.org/changeset/base/223342 > > Log: > Revert r214857 pursudant to 9.0-RELEASE cycle. > > Requested by: jh What about closing bin/153235 ? From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 21:28:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FF39106564A; Mon, 20 Jun 2011 21:28:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB188FC0C; Mon, 20 Jun 2011 21:28:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLSooe066382; Mon, 20 Jun 2011 21:28:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLSo2C066374; Mon, 20 Jun 2011 21:28:50 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106202128.p5KLSo2C066374@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 21:28: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: r223345 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 21:28:50 -0000 Author: bz Date: Mon Jun 20 21:28:50 2011 New Revision: 223345 URL: http://svn.freebsd.org/changeset/base/223345 Log: Add global -d and -e options to either print device numbers (usually default) or enclosure:slot information as (Exx:Sxx) or both. Discussed with: jhb Reviewed by: jhb Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_config.c head/usr.sbin/mfiutil/mfi_drive.c head/usr.sbin/mfiutil/mfi_patrol.c head/usr.sbin/mfiutil/mfi_show.c head/usr.sbin/mfiutil/mfiutil.8 head/usr.sbin/mfiutil/mfiutil.c head/usr.sbin/mfiutil/mfiutil.h Modified: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_config.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_config.c Mon Jun 20 21:28:50 2011 (r223345) @@ -419,8 +419,10 @@ build_array(int fd, char *arrayp, struct ar->array_ref = find_next_array(state); for (i = 0; i < array_info->drive_count; i++) { if (verbose) - printf("Adding drive %u to array %u\n", + printf("Adding drive %s to array %u\n", + mfi_drive_name(NULL, array_info->drives[i].ref.v.device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS), ar->array_ref); if (ar->size > array_info->drives[i].coerced_size) ar->size = array_info->drives[i].coerced_size; Modified: head/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_drive.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_drive.c Mon Jun 20 21:28:50 2011 (r223345) @@ -45,6 +45,87 @@ MFI_TABLE(top, drive); +/* + * Print the name of a drive either by drive number as %2u or by enclosure:slot + * as Exx:Sxx (or both). Use default unless command line options override it + * and the command allows this (which we usually do unless we already print + * both). We prefer pinfo if given, otherwise try to look it up by device_id. + */ +const char * +mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) +{ + struct mfi_pd_info info; + static char buf[16]; + char *p; + int error, fd, len; + + if ((def & MFI_DNAME_HONOR_OPTS) != 0 && + (mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) != 0) + def = mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID); + + buf[0] = '\0'; + if (pinfo == NULL && def & MFI_DNAME_ES) { + /* Fallback in case of error, just ignore flags. */ + if (device_id == 0xffff) + snprintf(buf, sizeof(buf), "MISSING"); + else + snprintf(buf, sizeof(buf), "%2u", device_id); + + fd = mfi_open(mfi_unit); + if (fd < 0) { + warn("mfi_open"); + return (buf); + } + + /* Get the info for this drive. */ + if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + warn("Failed to fetch info for drive %2u", device_id); + close(fd); + return (buf); + } + + close(fd); + pinfo = &info; + } + + p = buf; + len = sizeof(buf); + if (def & MFI_DNAME_DEVICE_ID) { + if (device_id == 0xffff) + error = snprintf(p, len, "MISSING"); + else + error = snprintf(p, len, "%2u", device_id); + if (error >= 0) { + p += error; + len -= error; + } + } + if ((def & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) == + (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID) && len >= 2) { + *p++ = ' '; + len--; + *p = '\0'; + len--; + } + if (def & MFI_DNAME_ES) { + if (pinfo->encl_device_id == 0xffff) + error = snprintf(p, len, "S%u", + pinfo->slot_number); + else if (pinfo->encl_device_id == pinfo->ref.v.device_id) + error = snprintf(p, len, "E%u", + pinfo->encl_index); + else + error = snprintf(p, len, "E%u:S%u", + pinfo->encl_index, pinfo->slot_number); + if (error >= 0) { + p += error; + len -= error; + } + } + + return (buf); +} + const char * mfi_pdstate(enum mfi_pd_state state) { @@ -547,7 +628,9 @@ drive_progress(int ac, char **av) mfi_display_progress("Clear", &info.prog_info.clear); if ((info.prog_info.active & (MFI_PD_PROGRESS_REBUILD | MFI_PD_PROGRESS_PATROL | MFI_PD_PROGRESS_CLEAR)) == 0) - printf("No activity in progress for drive %u.\n", device_id); + printf("No activity in progress for drive %s.\n", + mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); return (0); } Modified: head/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_patrol.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_patrol.c Mon Jun 20 21:28:50 2011 (r223345) @@ -80,7 +80,7 @@ show_patrol(int ac, char **av) struct mfi_pr_status status; struct mfi_pd_list *list; struct mfi_pd_info info; - char label[16]; + char label[24]; time_t now; uint32_t at; int error, fd; @@ -174,8 +174,10 @@ show_patrol(int ac, char **av) return (error); } if (info.prog_info.active & MFI_PD_PROGRESS_PATROL) { - snprintf(label, sizeof(label), " Drive %u", - list->addr[i].device_id); + snprintf(label, sizeof(label), " Drive %s", + mfi_drive_name(NULL, + list->addr[i].device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress(label, &info.prog_info.patrol); } Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_show.c Mon Jun 20 21:28:50 2011 (r223345) @@ -258,7 +258,7 @@ print_ld(struct mfi_ld_info *info, int s } static void -print_pd(struct mfi_pd_info *info, int state_len, int location) +print_pd(struct mfi_pd_info *info, int state_len) { const char *s; char buf[6]; @@ -273,15 +273,6 @@ print_pd(struct mfi_pd_info *info, int s s = mfi_pd_inq_string(info); if (s != NULL) printf(" %s", s); - if (!location) - return; - if (info->encl_device_id == 0xffff) - printf(" slot %d", info->slot_number); - else if (info->encl_device_id == info->ref.v.device_id) - printf(" enclosure %d", info->encl_index); - else - printf(" enclosure %d, slot %d", info->encl_index, - info->slot_number); } static int @@ -329,16 +320,16 @@ show_config(int ac, char **av) ar->num_drives); for (j = 0; j < ar->num_drives; j++) { device_id = ar->pd[j].ref.v.device_id; - if (device_id == 0xffff) - printf(" drive MISSING\n"); - else { - printf(" drive %u ", device_id); + printf(" drive %s ", mfi_drive_name(NULL, + device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); + if (device_id != 0xffff) { if (mfi_pd_get_info(fd, device_id, &pinfo, NULL) < 0) printf("%s", mfi_pdstate(ar->pd[j].fw_state)); else - print_pd(&pinfo, -1, 1); + print_pd(&pinfo, -1); printf("\n"); } } @@ -367,13 +358,14 @@ show_config(int ac, char **av) for (i = 0; i < config->spares_count; i++) { sp = (struct mfi_spare *)p; - printf(" %s spare %u ", + printf(" %s spare %s ", sp->spare_type & MFI_SPARE_DEDICATED ? "dedicated" : - "global", sp->ref.v.device_id); + "global", mfi_drive_name(NULL, sp->ref.v.device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); if (mfi_pd_get_info(fd, sp->ref.v.device_id, &pinfo, NULL) < 0) printf("%s", mfi_pdstate(MFI_PD_STATE_HOT_SPARE)); else - print_pd(&pinfo, -1, 1); + print_pd(&pinfo, -1); if (sp->spare_type & MFI_SPARE_DEDICATED) { printf(" backs:\n"); for (j = 0; j < sp->array_count; j++) @@ -534,7 +526,11 @@ show_drives(int ac, char **av) goto error; } - print_pd(&info, state_len, 1); + printf("%s ", mfi_drive_name(&info, list->addr[i].device_id, + MFI_DNAME_DEVICE_ID)); + print_pd(&info, state_len); + printf(" %s", mfi_drive_name(&info, list->addr[i].device_id, + MFI_DNAME_ES)); printf("\n"); } error: @@ -719,18 +715,21 @@ show_progress(int ac, char **av) } if (pinfo.prog_info.active & MFI_PD_PROGRESS_REBUILD) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Rebuild", &pinfo.prog_info.rbld); busy = 1; } if (pinfo.prog_info.active & MFI_PD_PROGRESS_PATROL) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Patrol Read", &pinfo.prog_info.patrol); busy = 1; } if (pinfo.prog_info.active & MFI_PD_PROGRESS_CLEAR) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Clear", &pinfo.prog_info.clear); busy = 1; } Modified: head/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.8 Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.8 Mon Jun 20 21:28:50 2011 (r223345) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2011 +.Dd June 20, 2011 .Dt MFIUTIL 8 .Os .Sh NAME @@ -43,6 +43,8 @@ .Op Fl u Ar unit .Cm show battery .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show config .Nm @@ -63,9 +65,13 @@ .Op Fl u Ar unit .Cm show logstate .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show patrol .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show progress .Nm @@ -155,15 +161,19 @@ If no unit is specified, then unit 0 is used. .El .Pp -Volumes may be specified in two forms. -First, -a volume may be identified by its target ID. -Second, -on the volume may be specified by the corresponding -.Em mfidX -device, -such as -.Em mfid0 . +Various commands accept either or both of the two options: +.Bl -tag -width indent +.It Fl d +Print numeric device IDs as drive identifier. +This is the default. +Useful in combination with +.Fl e +to print both, numeric device IDs and enclosure:slot information. +.It Fl e +Print drive identifiers in enclosure:slot form. +See next paragraph on format details in context of input rather than +output. +.El .Pp Drives may be specified in two forms. First, @@ -184,6 +194,16 @@ and is the slot for each drive as displayed in .Cm show drives . .Pp +Volumes may be specified in two forms. +First, +a volume may be identified by its target ID. +Second, +on the volume may be specified by the corresponding +.Em mfidX +device, +such as +.Em mfid0 . +.Pp The .Nm utility supports several different groups of commands. Modified: head/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.c Mon Jun 20 21:28:50 2011 (r223345) @@ -45,11 +45,13 @@ MFI_TABLE(top, abort); int mfi_unit; +u_int mfi_opts; + static void usage(void) { - fprintf(stderr, "usage: mfiutil [-u unit] ...\n\n"); + fprintf(stderr, "usage: mfiutil [-de] [-u unit] ...\n\n"); fprintf(stderr, "Commands include:\n"); fprintf(stderr, " version\n"); fprintf(stderr, " show adapter - display controller information\n"); @@ -108,8 +110,14 @@ main(int ac, char **av) struct mfiutil_command **cmd; int ch; - while ((ch = getopt(ac, av, "u:")) != -1) { + while ((ch = getopt(ac, av, "deu:")) != -1) { switch (ch) { + case 'd': + mfi_opts |= MFI_DNAME_DEVICE_ID; + break; + case 'e': + mfi_opts |= MFI_DNAME_ES; + break; case 'u': mfi_unit = atoi(optarg); break; Modified: head/usr.sbin/mfiutil/mfiutil.h ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.h Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.h Mon Jun 20 21:28:50 2011 (r223345) @@ -115,7 +115,13 @@ struct mfiutil_command { } \ MFI_COMMAND(set, name, mfiutil_ ## name ## _table_handler) +/* Drive name printing options */ +#define MFI_DNAME_ES 0x0001 /* E%u:S%u */ +#define MFI_DNAME_DEVICE_ID 0x0002 /* %u */ +#define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */ + extern int mfi_unit; +extern u_int mfi_opts; void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref); void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref); @@ -143,5 +149,7 @@ int mfi_pd_get_info(int fd, uint16_t dev int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp); int mfi_reconfig_supported(void); const char *mfi_status(u_int status_code); +const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, + uint32_t def); #endif /* !__MFIUTIL_H__ */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 21:31:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85BF61065675; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0188FC21; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLV1Sj066511; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLV1TG066507; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106202131.p5KLV1TG066507@svn.freebsd.org> From: Marius Strobl Date: Mon, 20 Jun 2011 21:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223346 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 21:31:01 -0000 Author: marius Date: Mon Jun 20 21:31:01 2011 New Revision: 223346 URL: http://svn.freebsd.org/changeset/base/223346 Log: - Remove MD usage of pc_cpumask and pc_other_cpus. [1] - Remove CTASSERTs which no longer need to hold since r222813. Submitted by: attilio [1] Modified: head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tlb.c Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:31:01 2011 (r223346) @@ -140,8 +140,6 @@ static cpu_ipi_single_t spitfire_ipi_sin SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS); -CTASSERT(MAXCPU <= sizeof(u_int) * NBBY); -CTASSERT(MAXCPU <= sizeof(int) * NBBY); void mp_init(u_int cpu_impl) @@ -491,13 +489,14 @@ cpu_mp_shutdown(void) int i; critical_enter(); - shutdown_cpus = PCPU_GET(other_cpus); + shutdown_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &shutdown_cpus); cpus = shutdown_cpus; /* XXX: Stop all the CPUs which aren't already. */ if (CPU_CMP(&stopped_cpus, &cpus)) { - /* pc_other_cpus is just a flat "on" mask without curcpu. */ + /* cpus is just a flat "on" mask without curcpu. */ CPU_NAND(&cpus, &stopped_cpus); stop_cpus(cpus); } @@ -520,23 +519,23 @@ cpu_ipi_ast(struct trapframe *tf) static void cpu_ipi_stop(struct trapframe *tf) { - cpuset_t tcmask; + u_int cpuid; CTR2(KTR_SMP, "%s: stopped %d", __func__, curcpu); sched_pin(); savectx(&stoppcbs[curcpu]); - tcmask = PCPU_GET(cpumask); - CPU_OR_ATOMIC(&stopped_cpus, &tcmask); - while (!CPU_OVERLAP(&started_cpus, &tcmask)) { - if (CPU_OVERLAP(&shutdown_cpus, &tcmask)) { - CPU_NAND_ATOMIC(&shutdown_cpus, &tcmask); + cpuid = PCPU_GET(cpuid); + CPU_SET_ATOMIC(cpuid, &stopped_cpus); + while (!CPU_ISSET(cpuid, &started_cpus)) { + if (CPU_ISSET(cpuid, &shutdown_cpus)) { + CPU_CLR_ATOMIC(cpuid, &shutdown_cpus); (void)intr_disable(); for (;;) ; } } - CPU_NAND_ATOMIC(&started_cpus, &tcmask); - CPU_NAND_ATOMIC(&stopped_cpus, &tcmask); + CPU_CLR_ATOMIC(cpuid, &started_cpus); + CPU_CLR_ATOMIC(cpuid, &stopped_cpus); sched_unpin(); CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu); } Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:31:01 2011 (r223346) @@ -2230,7 +2230,7 @@ pmap_activate(struct thread *td) PCPU_SET(tlb_ctx, context + 1); pm->pm_context[curcpu] = context; - CPU_OR(&pm->pm_active, PCPU_PTR(cpumask)); + CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); Modified: head/sys/sparc64/sparc64/tlb.c ============================================================================== --- head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:31:01 2011 (r223346) @@ -80,7 +80,7 @@ tlb_context_demap(struct pmap *pm) PMAP_STATS_INC(tlb_ncontext_demap); cookie = ipi_tlb_context_demap(pm); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_context_demap: inactive pmap?")); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); @@ -101,7 +101,7 @@ tlb_page_demap(struct pmap *pm, vm_offse PMAP_STATS_INC(tlb_npage_demap); cookie = ipi_tlb_page_demap(pm, va); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_page_demap: inactive pmap?")); if (pm == kernel_pmap) @@ -128,7 +128,7 @@ tlb_range_demap(struct pmap *pm, vm_offs PMAP_STATS_INC(tlb_nrange_demap); cookie = ipi_tlb_range_demap(pm, start, end); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_range_demap: inactive pmap?")); if (pm == kernel_pmap) From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 21:36:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01F16106566B; Mon, 20 Jun 2011 21:36:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60F08FC08; Mon, 20 Jun 2011 21:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLarSY066782; Mon, 20 Jun 2011 21:36:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLaroc066780; Mon, 20 Jun 2011 21:36:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106202136.p5KLaroc066780@svn.freebsd.org> From: Marius Strobl Date: Mon, 20 Jun 2011 21:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223347 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 21:36:54 -0000 Author: marius Date: Mon Jun 20 21:36:53 2011 New Revision: 223347 URL: http://svn.freebsd.org/changeset/base/223347 Log: As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:31:01 2011 (r223346) +++ head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:36:53 2011 (r223347) @@ -2217,11 +2217,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2229,17 +2228,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } void From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 21:57:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35571106564A; Mon, 20 Jun 2011 21:57:27 +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 258D88FC15; Mon, 20 Jun 2011 21:57:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLvRo4067417; Mon, 20 Jun 2011 21:57:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLvRU0067415; Mon, 20 Jun 2011 21:57:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106202157.p5KLvRU0067415@svn.freebsd.org> From: Rick Macklem Date: Mon, 20 Jun 2011 21:57: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: r223348 - head/sys/fs/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: Mon, 20 Jun 2011 21:57:27 -0000 Author: rmacklem Date: Mon Jun 20 21:57:26 2011 New Revision: 223348 URL: http://svn.freebsd.org/changeset/base/223348 Log: Fix the new NFSv4 server so that it allows Access and Readlink operations while traversing non-exported file systems. This is required for some non-FreeBSD clients to do NFSv4 mounts. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jun 20 21:36:53 2011 (r223347) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jun 20 21:57:26 2011 (r223348) @@ -786,6 +786,8 @@ nfsrvd_compound(struct nfsrv_descript *n op != NFSV4OP_LOOKUP && op != NFSV4OP_GETATTR && op != NFSV4OP_GETFH && + op != NFSV4OP_ACCESS && + op != NFSV4OP_READLINK && op != NFSV4OP_SECINFO) nd->nd_repstat = NFSERR_NOFILEHANDLE; else if (nfsvno_testexp(nd, &vpnes) && From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 22:02:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E945D1065674; Mon, 20 Jun 2011 22:02:01 +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 D97048FC24; Mon, 20 Jun 2011 22:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KM21jF067600; Mon, 20 Jun 2011 22:02:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KM21ou067598; Mon, 20 Jun 2011 22:02:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106202202.p5KM21ou067598@svn.freebsd.org> From: Rick Macklem Date: Mon, 20 Jun 2011 22:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223349 - head/sys/fs/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: Mon, 20 Jun 2011 22:02:02 -0000 Author: rmacklem Date: Mon Jun 20 22:02:01 2011 New Revision: 223349 URL: http://svn.freebsd.org/changeset/base/223349 Log: Fix the new NFSv4 server so that it only allows Lookup of directories and symbolic links when traversing non-exported file systems. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 20 21:57:26 2011 (r223348) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 20 22:02:01 2011 (r223349) @@ -454,7 +454,7 @@ nfsmout: APPLESTATIC int nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - __unused struct nfsexstuff *exp) + struct nfsexstuff *exp) { struct nameidata named; vnode_t vp, dirp = NULL; @@ -508,7 +508,15 @@ nfsrvd_lookup(struct nfsrv_descript *nd, vrele(named.ni_startdir); nfsvno_relpathbuf(&named); vp = named.ni_vp; - nd->nd_repstat = nfsvno_getfh(vp, fhp, p); + if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) && + vp->v_type != VDIR && vp->v_type != VLNK) + /* + * Only allow lookup of VDIR and VLNK for traversal of + * non-exported volumes during NFSv4 mounting. + */ + nd->nd_repstat = ENOENT; + if (nd->nd_repstat == 0) + nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (vpp != NULL && nd->nd_repstat == 0) From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 22:59:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E6D21065670; Mon, 20 Jun 2011 22:59:29 +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 5E5588FC15; Mon, 20 Jun 2011 22:59:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KMxTHo069300; Mon, 20 Jun 2011 22:59:29 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KMxT1h069297; Mon, 20 Jun 2011 22:59:29 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201106202259.p5KMxT1h069297@svn.freebsd.org> From: Jack F Vogel Date: Mon, 20 Jun 2011 22:59: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: r223350 - 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: Mon, 20 Jun 2011 22:59:29 -0000 Author: jfv Date: Mon Jun 20 22:59:29 2011 New Revision: 223350 URL: http://svn.freebsd.org/changeset/base/223350 Log: Eliminate some global tuneables in favor of adapter-specific, particular flow control and dma coalesce. Also improve the sysctl operation on those too. Add IPv6 detection in the ioctl code, this was done for ixgbe first, carrying that over. Add resource ability to disable particular adapter. Add HW TSO capability so vlans can make use of TSO Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Jun 20 22:02:01 2011 (r223349) +++ head/sys/dev/e1000/if_igb.c Mon Jun 20 22:59:29 2011 (r223350) @@ -36,6 +36,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_altq.h" #endif @@ -99,7 +100,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.2.3"; +char igb_driver_version[] = "version - 2.2.5"; /********************************************************************* @@ -265,6 +266,7 @@ static void igb_handle_link(void *contex static void igb_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); #ifdef DEVICE_POLLING static poll_handler_t igb_poll; @@ -344,25 +346,6 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); -/* How many packets rxeof tries to clean at a time */ -static int igb_rx_process_limit = 100; -TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); - -/* Flow control setting - default to FULL */ -static int igb_fc_setting = e1000_fc_full; -TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting); - -/* Energy Efficient Ethernet - default to off */ -static int igb_eee_disabled = TRUE; -TUNABLE_INT("hw.igb.eee_disabled", &igb_eee_disabled); - -/* -** DMA Coalescing, only for i350 - default to off, -** this feature is for power savings -*/ -static int igb_dma_coalesce = FALSE; -TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce); - /********************************************************************* * Device identification routine * @@ -433,6 +416,11 @@ igb_attach(device_t dev) INIT_DEBUGOUT("igb_attach: begin"); + if (resource_disabled("igb", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); @@ -450,7 +438,7 @@ igb_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "fc", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, igb_set_flowcntl, "I", "Flow Control"); callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -476,8 +464,8 @@ igb_attach(device_t dev) /* Sysctl for limiting the amount of work done in the taskqueue */ igb_set_sysctl_value(adapter, "rx_processing_limit", - "max number of rx packets to process", &adapter->rx_process_limit, - igb_rx_process_limit); + "max number of rx packets to process", + &adapter->rx_process_limit, 100); /* * Validate number of transmit and receive descriptors. It @@ -552,13 +540,14 @@ igb_attach(device_t dev) /* Some adapter-specific advanced features */ if (adapter->hw.mac.type >= e1000_i350) { - igb_set_sysctl_value(adapter, "dma_coalesce", - "configure dma coalesce", - &adapter->dma_coalesce, igb_dma_coalesce); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW, + adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce"); igb_set_sysctl_value(adapter, "eee_disabled", "enable Energy Efficient Ethernet", &adapter->hw.dev_spec._82575.eee_disable, - igb_eee_disabled); + TRUE); e1000_set_eee_i350(&adapter->hw); } @@ -658,6 +647,7 @@ igb_attach(device_t dev) return (0); err_late: + igb_detach(dev); igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); igb_release_hw_control(adapter); @@ -736,7 +726,8 @@ igb_detach(device_t dev) igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); - free(adapter->mta, M_DEVBUF); + if (adapter->mta != NULL) + free(adapter->mta, M_DEVBUF); IGB_CORE_LOCK_DESTROY(adapter); @@ -1025,11 +1016,12 @@ static int igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *)data; +#if defined(INET) || defined(INET6) + struct ifaddr *ifa = (struct ifaddr *)data; + bool avoid_reset = FALSE; #endif - int error = 0; + int error = 0; if (adapter->in_detach) return (error); @@ -1037,20 +1029,22 @@ igb_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFADDR: #ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - /* - * XXX - * Since resetting hardware takes a very long time - * and results in link renegotiation we only - * initialize the hardware only when it is absolutely - * required. - */ + if (ifa->ifa_addr->sa_family == AF_INET) + avoid_reset = TRUE; +#endif +#ifdef INET6 + if (ifa->ifa_addr->sa_family == AF_INET6) + avoid_reset = TRUE; +#endif +#if defined(INET) || defined(INET6) + /* + ** Calling init results in link renegotiation, + ** so we avoid doing it when possible. + */ + if (avoid_reset) { ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IGB_CORE_LOCK(adapter); - igb_init_locked(adapter); - IGB_CORE_UNLOCK(adapter); - } + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + igb_init(adapter); if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); } else @@ -1175,6 +1169,10 @@ igb_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; reinit = 1; } + if (mask & IFCAP_VLAN_HWTSO) { + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + reinit = 1; + } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; reinit = 1; @@ -2721,6 +2719,12 @@ igb_reset(struct adapter *adapter) fc->pause_time = IGB_FC_PAUSE_TIME; fc->send_xon = TRUE; + if (fc->requested_mode) + fc->current_mode = fc->requested_mode; + else + fc->current_mode = e1000_fc_full; + + adapter->fc = fc->current_mode; /* Issue a global reset */ e1000_reset_hw(hw); @@ -2730,9 +2734,13 @@ igb_reset(struct adapter *adapter) device_printf(dev, "Hardware Initialization Failed\n"); /* Setup DMA Coalescing */ - if ((hw->mac.type == e1000_i350) && - (adapter->dma_coalesce == TRUE)) { - u32 reg; + if (hw->mac.type == e1000_i350) { + u32 reg = ~E1000_DMACR_DMAC_EN; + + if (adapter->dmac == 0) { /* Disabling it */ + E1000_WRITE_REG(hw, E1000_DMACR, reg); + goto reset_out; + } hwm = (pba - 4) << 10; reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT) @@ -2741,8 +2749,8 @@ igb_reset(struct adapter *adapter) /* transition to L0x or L1 if available..*/ reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK); - /* timer = +-1000 usec in 32usec intervals */ - reg |= (1000 >> 5); + /* timer = value in adapter->dmac in 32usec intervals */ + reg |= (adapter->dmac >> 5); E1000_WRITE_REG(hw, E1000_DMACR, reg); /* No lower threshold */ @@ -2767,6 +2775,7 @@ igb_reset(struct adapter *adapter) device_printf(dev, "DMA Coalescing enabled\n"); } +reset_out: E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); e1000_get_phy_info(hw); e1000_check_for_link(hw); @@ -2827,15 +2836,19 @@ igb_setup_interface(device_t dev, struct * support full VLAN capability. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; + ifp->if_capenable |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; /* - ** Dont turn this on by default, if vlans are + ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) ** then vlan events are not passed thru, breaking ** operation, but with HW FILTER off it works. If - ** using vlans directly on the em driver you can + ** using vlans directly on the igb driver you can ** enable this and get full hardware tag filtering. */ ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; @@ -5595,19 +5608,18 @@ static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; - struct adapter *adapter; + struct adapter *adapter = (struct adapter *) arg1; - error = sysctl_handle_int(oidp, &igb_fc_setting, 0, req); + error = sysctl_handle_int(oidp, &adapter->fc, 0, req); - if (error) + if ((error) || (req->newptr == NULL)) return (error); - adapter = (struct adapter *) arg1; - switch (igb_fc_setting) { + switch (adapter->fc) { case e1000_fc_rx_pause: case e1000_fc_tx_pause: case e1000_fc_full: - adapter->hw.fc.requested_mode = igb_fc_setting; + adapter->hw.fc.requested_mode = adapter->fc; break; case e1000_fc_none: default: @@ -5616,5 +5628,54 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS) adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode; e1000_force_mac_fc(&adapter->hw); - return error; + return (error); +} + +/* +** Manage DMA Coalesce: +** Control values: +** 0/1 - off/on +** Legal timer values are: +** 250,500,1000-10000 in thousands +*/ +static int +igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + int error; + + error = sysctl_handle_int(oidp, &adapter->dmac, 0, req); + + if ((error) || (req->newptr == NULL)) + return (error); + + switch (adapter->dmac) { + case 0: + /*Disabling */ + break; + case 1: /* Just enable and use default */ + adapter->dmac = 1000; + break; + case 250: + case 500: + case 1000: + case 2000: + case 3000: + case 4000: + case 5000: + case 6000: + case 7000: + case 8000: + case 9000: + case 10000: + /* Legal values - allow */ + break; + default: + /* Do nothing, illegal value */ + adapter->dmac = 0; + return (error); + } + /* Reinit the interface */ + igb_init(adapter); + return (error); } Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Mon Jun 20 22:02:01 2011 (r223349) +++ head/sys/dev/e1000/if_igb.h Mon Jun 20 22:59:29 2011 (r223350) @@ -396,11 +396,12 @@ struct adapter { u32 shadow_vfta[IGB_VFTA_SIZE]; /* Info about the interface */ - u8 link_active; + u16 link_active; + u16 fc; u16 link_speed; u16 link_duplex; u32 smartspeed; - u32 dma_coalesce; + u32 dmac; /* Interface queues */ struct igb_queue *queues; From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 23:41:09 2011 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 E7828106564A; Mon, 20 Jun 2011 23:41:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Mon, 20 Jun 2011 19:40:53 -0400 User-Agent: KMail/1.6.2 References: <201106172141.p5HLf6Rx009154@svn.freebsd.org> <20110618195655.M889@besplex.bde.org> In-Reply-To: <20110618195655.M889@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106201940.56104.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223211 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 23:41:09 -0000 On Saturday 18 June 2011 07:08 am, Bruce Evans wrote: > On Fri, 17 Jun 2011, Jung-uk Kim wrote: > > Log: > > Teach the compiler how to shift TSC value efficiently. As noted > > in r220631, some times compiler inserts redundant instructions to > > preserve unused upper 32 bits even when it is casted to a 32-bit > > value. Unfortunately, it seems the problem becomes more serious > > when it is shifted, especially on amd64. > > Er, I tried to point out how to optimize this code before (but > didn't reply to your reply), and it's not by using more asm. > > > Modified: head/sys/x86/x86/tsc.c > > ================================================================= > >============= --- head/sys/x86/x86/tsc.c Fri Jun 17 21:31:13 > > 2011 (r223210) +++ head/sys/x86/x86/tsc.c Fri Jun 17 21:41:06 > > 2011 (r223211) @@ -461,7 +461,7 @@ init_TSC_tc(void) > > tsc_timecounter.tc_quality = 1000; > > > > init: > > - for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; > > shift++) + for (shift = 0; shift < 31 && (tsc_freq >> shift) > > > max_freq; shift++) ; > > if (shift > 0) { > > tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; > > shift == 32 (or even shift == 31) is unreachable. A shift of 31 > will shift 2GHz down to 1 Hz, or support physically impossible > frequencies like 2**33 GHz. OTOH, shifts of up to 63 are supported > by the slow gcc code. It is unreachable but it is a safety belt. Please see below. > > @@ -579,6 +579,9 @@ tsc_get_timecount(struct timecounter *tc > > static u_int > > tsc_get_timecount_low(struct timecounter *tc) > > { > > + uint32_t rv; > > > > - return (rdtsc() >> (int)(intptr_t)tc->tc_priv); > > + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > > Lexical style bug (indentation of second line of the asm). I followed sys/amd64/include/atomic.h style. OTOH, sys/amd64/include/cpufunc.h has little different style. I wasn't sure what's correct because style(9) does not mention anything specific to inline assembly. :-( > > + return (rv); > > } > > Just return the shift of the low 32 bits (and change > tc_counter_mask to match) like I said. This loses only the > accidental ability for the timecounter to work for more than a few > seconds when interrupts are stopped by something like ddb, since > any shift count that loses too many of the low 32 bits will not > work for other reasons. For example, suppose that the TSC > frequency is 8G-1Hz, which is unavailable except possible in > research labs. This must be shifted by 1 to fit in 32 bits. If we > use only the low 32 bits, then we end up with only 31 significant > bits and tsc_get_timecount_low() wraps after ~2 seconds instead of > after the best possible for this shift of ~4 seconds. If we shift > by 7 more, as we do in the SMP case, then if we start with 32 bits > then we end up with 24 bits, but the wrap still takes 2 seconds; if > we start with 64 bits then we end up with 32 bits and the wrap > takes 4*2**7 = 512 seconds. But wrap times longer than 1/HZ times > a few are not needed. 2 seconds is already at least 100 or 1000 > times longer than needed, depending on HZ. The case where the > unscaled frequency is 4G-1Hz and !SMP gives a shift count of 0 and > a wrap time of ~4 seconds. Whatever is done to make that case work > (say, not allowing a fully tickless kernel with HZ = 0), works > almost as well up to an unscaled frequency of 8GHz which is still > far off. > > No one will notice these micro-optimizations, but I agree that the > redundant instructions are ugly. I get the following on i386 for > the original version with an old source tree: > > % #APP > % rdtsc > % #NO_APP > % movl 8(%ebp), %ecx > % movl 28(%ecx), %ecx > % shrdl %edx, %eax > % shrl %cl, %edx > % testb $32, %cl > % je .L3 > % movl %edx, %eax > % xorl %edx, %edx > % .L3: > > The last 4 instructions are not redundant, but are needed to > support shifts of up to 63 (maybe 64). They are not redundant but I wanted to get rid of the check entirely. That's why 32 -> 31 change was made in the first place. FYI, with amd64, we get this from the old code: rdtsc movzbl 48(%rdi), %ecx salq $32, %rdx mov %eax, %eax orq %rax, %rdx shrq %cl, %rdx movl %edx, %eax ret This is slightly better than i386 version, i.e., no conditional jump, but it is still ugly, however. > I tried masking the shift count with 0x1f so that the shift count > is known to be < 32, this just gave an extra instruction for the > masking. Yup. > It's even worse with rdtsc() converted to u_int first like I want: > > % movl %ebx, (%esp) > % movl %esi, 4(%esp) > % #APP > % rdtsc > % #NO_APP > % movl %eax, %ebx > % movl 8(%ebp), %eax > % movl 4(%esp), %esi > % movl 28(%eax), %ecx > % movl %ebx, %eax > % movl (%esp), %ebx > % # some frame pointer epilogue reordered here > % shrl %cl, %eax > > The second case may be what you already fixed on amd64 (only?) -- > use rdtsc32() instead of (u_int)rdtsc(). > > I've always thought that the dynamic shift is overengineered, and > now like it even less. The following is efficent and works well > enough in all currently physically possible cases: > > % /* > % * Don't really need a separate one for `low', but now it costs > less % * (1 shift instruction at runtime and some space). Must > change % * tc_counter_mask to match. > % */ > % u_int > % tsc_get_timecount_low(struct timecounter *tc) > % { > % #ifdef SMP > % /* > % * Works up to 1024 GHz, assuming that nontemporalness scales > with % * freq. I think 8 is too many. But now do extra for SMP > indep. % * of freq. > % */ > % return (((u_int)rdtsc()) >> 8); /* gens rdtsc; shrl $8,%eax */ > % #else > % /* Works up to 8 GHz. */ > % return (((u_int)rdtsc()) >> 1); /* gens rdtsc; shrl %eax */ > % #endif > % } Dynamic shift may be overengineered but it is useful. For example, r223211 give us fairly good optimization on amd64: movq 48(%rdi), %rcx rdtsc shrd %cl, %edx, %eax ret i386 isn't too impressive, though: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movl 28(%eax), %ecx rdtsc shrd %cl, %edx, %eax popl %ebp ret I just couldn't convince GCC to generate code like this without inline asm, unfortunately. :-( Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Jun 20 23:41:16 2011 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 1B36710658AF; Mon, 20 Jun 2011 23:41:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Mon, 20 Jun 2011 19:41:00 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> In-Reply-To: <20110618210815.W889@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106201941.03393.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jun 2011 23:41:16 -0000 On Saturday 18 June 2011 08:05 am, Bruce Evans wrote: > Long ago, On Wed, 8 Jun 2011, Jung-uk Kim wrote: > > On Wednesday 08 June 2011 04:55 pm, Bruce Evans wrote: > >> On Wed, 8 Jun 2011, Jung-uk Kim wrote: > >>> Log: > >>> Introduce low-resolution TSC timecounter "TSC-low". It > >>> replaces the normal TSC timecounter if TSC frequency is higher > >>> than ~4.29 MHz (or 2^32-1 Hz) or > >> > >> It should be a separate timecounter so that the user can choose > >> it independently, at least in the SMP case where it is very low > >> (at most ~4.29 GHz >> 8 ~= 17 MHz). > > > > As I noted in the log, it is still higher than the previous > > default ACPI-fast, which is ~3.68 MHz and I've never heard of any > > complaint about ACPI-fast being too low. ;-) > > That's because it is too low to measure itself being low :-). > > > Nothing prevents us from making a separate timecounter, though. > > In fact, we can do the same for ACPI-fast/ACPI-safe. However, > > that'll only confuse users, IMHO. > > TSC/TSC-low sort of corresponds to ACPI-fast/ACPI-safe. Users can > switch between the latter. How do we do that? if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; acpi_timer_timecounter.tc_quality = 850; } We didn't have any code to influence this selection as far as I can remember. > What they can't do is run both concurrently, either to compare them > or use the best one that works in the current context. That would > be more developers and is not implemented mainly because it has more > complexity (only a tiny amount of extra overhead I think, provided > you don't try to keep the 2 times coherent -- just an extra windup > for each active timecounter). > > >>> static void tsc_levels_changed(void *arg, int unit); > >>> > >>> static struct timecounter tsc_timecounter = { > >>> @@ -392,11 +393,19 @@ test_smp_tsc(void) > >>> static void > >>> init_TSC_tc(void) > >> > >> This seems to only be called once at boot time. So the lowness > >> may be much lower than necessary if the levels are reduced > >> significantly later. > > > > It'll only happen when the CPU is started at the highest > > frequency and TSC is not invariant. In this case, its quality > > will be set to 800 and HPET or ACPI timecounter will be selected > > by default. I don't see much problem with the default choice > > here. > > Can the CPU be started at a low frequency and throttled up later? Yes, Intel mobile parts may do that. > I agree that the non-invariant case is not very important. Exactly. > >>> { > >>> + uint64_t max_freq; > >>> + int shift; > >>> > >>> if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) > >>> return; > >>> > >>> /* > >>> + * Limit timecounter frequency to fit in an int and prevent > >>> it from + * overflowing too fast. > >>> + */ > >>> + max_freq = UINT_MAX; > >>> + > >>> + /* > >>> * We can not use the TSC if we support APM. Precise > >>> timekeeping * on an APM'ed machine is at best a fools pursuit, > >>> since * any and all of the time spent in various SMM code can't > >>> @@ -418,13 +427,27 @@ init_TSC_tc(void) > >>> * We can not use the TSC in SMP mode unless the TSCs on all > >>> CPUs are * synchronized. If the user is sure that the system > >>> has synchronized * TSCs, set kern.timecounter.smp_tsc tunable > >>> to a non-zero value. + * We also limit the frequency even > >>> lower to avoid "temporal anomalies" + * as much as possible. > >>> */ > >>> - if (smp_cpus > 1) > >>> + if (smp_cpus > 1) { > >>> tsc_timecounter.tc_quality = test_smp_tsc(); > >>> + max_freq >>= 8; > >>> + } > >> > >> This gives especially low lowness if the levels are reduced > >> significantly. Maybe as low as 100 MHz >> 8 = ~390 KHz = lower > >> than an i8254. > > > > I don't remember any SMP-capable x86 ever running at 100 MHz > > unless it is seriously under-clocked. Even if it existed, it > > won't be available today. :-P > > Doesn't throttling give underclocking? T-state *usually* does not change CPU frequency itself. Only P-state can change TSC frequency. However, some broken implementation *may* just stop incrementing TSC in very low T-state (or C-state). AMD does not have this problem for invariant TSCs. It seems Intel also fixed it for recent processors. Nehalem or Sandy Bridge, I am not sure, though. > Maybe not as low as 100 MHz, but quite low. Only a possible problem > for the non-invariant case anyway. Agreed. > >> OTOH, maybe the temporal anomalies scale with the TSC frequency, > >> so you need to right shift by a few irrespective of the TSC > >> frequency. A shift count of 8 seems too much, but if the initial > >> TSC frequency is already < 2**32 shifted by 8, then the final > >> shift is 0. > > This is my main point. How can it be right to reduce the extra > shift for SMP (if this shift is needed at all) just because the > initial TSC frequency is low? All instructions are clocked, so > non-temporalness within a core scales with the current frequency. > Oops, this leads back to my previous point that the scaling should > depend on the current frequency and not just on the initial > frequency. Across cores, it isn't so clear what the > non-temporalness scales with. The non-temporalness is FUD so its > scaling could be anything :-). My questions to you: a) Why do we care TSC timecounter when it is not invariant where we *know* it is unusable and set to negative quality? b) Why do we complicate code when invariant frequency == current frequency == initial frequency? > >> ... > >> Perhaps the levels can also be increased significantly later. > >> Then the timecounter frequency may exceed 4.29 GHz despite its > >> scaling. > > > > Again, it can only happen when the CPU was started at low > > frequency and the TSC is not invariant. For that case, TSC won't > > be selected by default unless both HPET and ACPI timers are > > disabled/unavailable. > > But users can select it, and since user's can't control the scaling > or even select between TSC/TSC-low, TSC-low must be scaled properly > initially to have the best chance of working later. Maybe we should not allow users to select negative-quality timecounter in the first place. Or maybe we should print scary warning messages if they try foot-shooting. Sigh... > >>> @@ -520,8 +545,15 @@ SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq > >>> 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter > >>> frequency"); > >>> > >>> static u_int > >>> -tsc_get_timecount(struct timecounter *tc) > >>> +tsc_get_timecount(struct timecounter *tc __unused) > >>> { > >>> > >>> return (rdtsc32()); > >>> } > >>> + > >>> +static u_int > >>> +tsc_get_timecount_lowres(struct timecounter *tc) > >>> +{ > >>> + > >>> + return (rdtsc() >> (int)(intptr_t)tc->tc_priv); > >> > >> This forces a slow 64-bit shift (shrdl; shrl) in all cases. > > > > Yes, it does, unfortunately. > > > > I have no clue why AMD didn't implement native 64-bit RDTSC (and > > RDMSR/WRMSR) in the first place. :-( > > I didn't notice before that it still goes to a register pair on > amd64. > > >> rdtsc32() with a scaled tc_counter_mask should work OK > >> (essentially the same as the non-low timecounter except for > >> reduced accuracy; the only loss is an decrease in the time until > >> counter overflow to the same as for the non-low timecounter). > > > > I thought about that but I didn't like that idea, i.e., losing > > resolution and accuracy at the same time. > > But it doesn't lose any more resolution or accuracy than any shift > necessarily uses. It only loses wrap time, which is of no interest > for a small reduction. See another reply. > > The shift of 8 for SMP still seems far too much. clock_gettime() > with a TSC timecounter on an old 2GHz system takes about 250 nS. I > hope it takes only 1/2 that on a newer system. nanouptime() in the > kernel takes more like 30 nS on the old system. It should at least > try to have enough resulution for sequential calls to it to never > return the same time (even ACPI-fast has this property -- about > 1000 nS per call and a resolution of about 250 nS). rdtsc on old > Athlons takes only 12 (9?) cycles so you could almost use it to > time individual instructions (modulo out of order execution). THe > invariant versions have to be much slower for synchronization :-(. > They take at least 42 cycles AFAIR. A shift count of 5 would lose > less resolution than an invariant TSC really has so it would be > good if it is enough to hide the nontemporalness. A shift count of > 6 would be OK too. But a shift count of 8 lets you execute about 4 > nanouptime()'s for every change in the time returned. OTOH, 256 > cycles at 4 GHz is about 64 uS and clock_gettime() unfortunately > takes longer (except on Linux? :-(), so a shift count of 8 is OK > for it. > > My clock measurement program (mostly an old program by Wollman) > shows the following histogram of times for a non-invariant TSC > timecounter on a 2GHz UP system: > > % min 273, max 265102, mean 273.998217, std 79.069534 > % 1th: 273 (1727219 observations) > % 2th: 274 (265607 observations) > % 3th: 275 (6984 observations) > % 4th: 280 (11 observations) > % 5th: 290 (8 observations) > > The variance is small, and differences of a single nS can be seen > clearly. With the SMP shift of 8 on a 4GHz system, the minimum > difference would be 64 nS so it would be impossible to see the > details of the distribution about the mean of 273.998 nS. Thanks for the info, Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 03:05:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118FC1065672; Tue, 21 Jun 2011 03:05:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01C018FC08; Tue, 21 Jun 2011 03:05:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L35HhV076654; Tue, 21 Jun 2011 03:05:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L35HOS076652; Tue, 21 Jun 2011 03:05:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106210305.p5L35HOS076652@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 03:05: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: r223352 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 03:05:18 -0000 Author: imp Date: Tue Jun 21 03:05:17 2011 New Revision: 223352 URL: http://svn.freebsd.org/changeset/base/223352 Log: Mark the card as bad on shutdown. This means that bus_child_present will return false on shutdown and massive spewage from usb disappears for usb cardbus adapters. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon Jun 20 23:04:13 2011 (r223351) +++ head/sys/dev/pccbb/pccbb_pci.c Tue Jun 21 03:05:17 2011 (r223352) @@ -658,6 +658,12 @@ cbb_pci_shutdown(device_t brdev) struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); /* + * We're about to pull the rug out from the card, so mark it as + * gone to prevent harm. + */ + sc->cardok = 0; + + /* * Place the cards in reset, turn off the interrupts and power * down the socket. */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 03:08:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F48106566C; Tue, 21 Jun 2011 03:08:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1649F8FC18; Tue, 21 Jun 2011 03:08:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L37x7q076765; Tue, 21 Jun 2011 03:07:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L37xG9076762; Tue, 21 Jun 2011 03:07:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106210307.p5L37xG9076762@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 03:07: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: r223353 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 03:08:00 -0000 Author: imp Date: Tue Jun 21 03:07:59 2011 New Revision: 223353 URL: http://svn.freebsd.org/changeset/base/223353 Log: When we see an interrupt status of 0xffffffff, check to see if the child is still present. If not, return 'handled' and don't print anything (this is expected behavior). We expect an interrupt on eject, power-down and/or shutdown. Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Tue Jun 21 03:05:17 2011 (r223352) +++ head/sys/dev/firewire/fwohci.c Tue Jun 21 03:07:59 2011 (r223353) @@ -2072,8 +2072,9 @@ fwohci_check_stat(struct fwohci_softc *s FW_GLOCK_ASSERT(&sc->fc); stat = OREAD(sc, FWOHCI_INTSTAT); if (stat == 0xffffffff) { - device_printf(sc->fc.dev, - "device physically ejected?\n"); + if (!bus_child_present(sc->fc.dev)) + return (FILTER_HANDLED); + device_printf(sc->fc.dev, "device physically ejected?\n"); return (FILTER_STRAY); } if (stat) From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 04:06:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0A4106566B; Tue, 21 Jun 2011 04:06:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEDF58FC08; Tue, 21 Jun 2011 04:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L46dwv078837; Tue, 21 Jun 2011 04:06:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L46do9078835; Tue, 21 Jun 2011 04:06:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106210406.p5L46do9078835@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 04:06: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: r223355 - head/sbin/geom/class/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: Tue, 21 Jun 2011 04:06:39 -0000 Author: ae Date: Tue Jun 21 04:06:39 2011 New Revision: 223355 URL: http://svn.freebsd.org/changeset/base/223355 Log: The "size" param needs no adjusting to stripeoffset. Reported by: Kris Moore Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 03:42:00 2011 (r223354) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) @@ -499,8 +499,8 @@ gpart_autofill(struct gctl_req *req) /* Adjust parameters to stripeoffset */ offset = pp->lg_stripeoffset / pp->lg_sectorsize; start = ALIGNUP(start + offset, alignment); - if (size + offset > alignment) - size = ALIGNDOWN(size + offset, alignment); + if (size > alignment) + size = ALIGNDOWN(size, alignment); first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 04:46:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4C31065672; Tue, 21 Jun 2011 04:46:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E02C8FC0A; Tue, 21 Jun 2011 04:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L4k0QA080004; Tue, 21 Jun 2011 04:46:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L4k0IZ080002; Tue, 21 Jun 2011 04:46:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106210446.p5L4k0IZ080002@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 04:46: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: r223356 - head/sbin/geom/class/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: Tue, 21 Jun 2011 04:46:00 -0000 Author: delphij Date: Tue Jun 21 04:46:00 2011 New Revision: 223356 URL: http://svn.freebsd.org/changeset/base/223356 Log: Mod the offset padding by alignment. Without this change we may pad too much when underlying GEOM object have a zero stripesize. MFC after: 1 month Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r223356) @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r goto done; } - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) alignment = len; /* Adjust parameters to stripeoffset */ - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; start = ALIGNUP(start + offset, alignment); if (size > alignment) size = ALIGNDOWN(size, alignment); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 05:20:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA79106566C; Tue, 21 Jun 2011 05:20:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward4.mail.yandex.net (forward4.mail.yandex.net [77.88.46.9]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6648FC1A; Tue, 21 Jun 2011 05:20:19 +0000 (UTC) Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward4.mail.yandex.net (Yandex) with ESMTP id F10F65025F2; Tue, 21 Jun 2011 09:04:07 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1308632648; bh=XUmg0IgO5MSwO6uKx2prFEEQYz/c7moqcWFIaefP9OA=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=aMUd6o3aSts0xmDxkUbpZX+cHJ1+OnDcbNFKLj5qwfcuVO7uKLMKNX4AHzHQfzqRn unCRS4N0FfE8R6lVQOj6FKwlw2nduaOUN0gvnKOkhVg5lESWuFpHT10DFyKzp+XNqT +lrGBjlJP2bgG7O3h7suQ6/x8u0oGdU7kvyUDg/Y= Received: from [127.0.0.1] (proxy.kirov.so-cdu.ru [77.72.136.146]) by smtp4.mail.yandex.net (Yandex) with ESMTPSA id 9016D64980AF; Tue, 21 Jun 2011 09:04:07 +0400 (MSD) Message-ID: <4E00263C.4040802@yandex.ru> Date: Tue, 21 Jun 2011 09:03:56 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Xin LI References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> In-Reply-To: <201106210446.p5L4k0IZ080002@svn.freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4B5615A34375DA2D5C465728" X-Yandex-Spam: 1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223356 - head/sbin/geom/class/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: Tue, 21 Jun 2011 05:20:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4B5615A34375DA2D5C465728 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 21.06.2011 8:46, Xin LI wrote: > Author: delphij > Date: Tue Jun 21 04:46:00 2011 > New Revision: 223356 > URL: http://svn.freebsd.org/changeset/base/223356 >=20 > Log: > Mod the offset padding by alignment. Without this change we may > pad too much when underlying GEOM object have a zero stripesize. No. In any way offset value could not be greater than mediasize. And it do nothing when alignment value is 1. > MFC after: 1 month I did not MFC'd these changes yet. > Modified: > head/sbin/geom/class/part/geom_part.c >=20 > Modified: head/sbin/geom/class/part/geom_part.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/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r22= 3355) > +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r22= 3356) > @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r > goto done; > } > =20 > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > last =3D (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); > LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { > s =3D find_provcfg(pp, "index"); > @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) > alignment =3D len; > =20 > /* Adjust parameters to stripeoffset */ > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > start =3D ALIGNUP(start + offset, alignment); > if (size > alignment) > size =3D ALIGNDOWN(size, alignment); >=20 >=20 --=20 WBR, Andrey V. Elsukov --------------enig4B5615A34375DA2D5C465728 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOACZCAAoJEAHF6gQQyKF6594IAI1jKu3de1KWJHx6gKrqpbUi ErKG+TdXURy+tonSC+tMkwnP7EYLWzM4xax+/wHQFh9vK6BwcTWWsYZcuEpt6Pee KmanfrEjNtpcq14ypOP6RytElEa1lDyQy96Vam+q1jLLVhTRYkuI3xpY6uk/1I4J lDty1lyomM2PqRpEOsMn0wtdKO71qllmyk2TWySF/uafihV18nHs+w3aSLreGN1w SZC0xTFFEtbvIOt4WwVusb8ZjAbSBDiUk57QJoQLGIEmBP3sBIPVcFhiRnrIdP0V Agi5hqbdQQTE3BJDi57GebaEGCGYqnGMdqOsjNdJ5y2yPUXGwI4JEd4InOvYq1g= =Lf+i -----END PGP SIGNATURE----- --------------enig4B5615A34375DA2D5C465728-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 06:04:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BB711065672; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE768FC12; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id C517AF2E3; Mon, 20 Jun 2011 23:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308636284; bh=rcnkCBwzhzBvLbW17NFRxX2Z0ilQnN1j4gHV2kP9Aq8=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=AWYOIbjhEVsYNQmRqHRkQDAGAawtMz48tLDEiyT3GNB1X4qvMvbQA8SRb9boXkmMf 6ZTkBbZ8E9xc18Jnt/hx1OTidjFgH7nNqu31dR7+Ci1bfHIl8n02Fvbe3MrlHm+aq6 Td0ocPnXPfXcbsfv1I8oF0sLRC5fWO/n3NT+TVsM= Message-ID: <4E00347B.7060708@delphij.net> Date: Mon, 20 Jun 2011 23:04:43 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> In-Reply-To: <4E00263C.4040802@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc 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, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part 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: Tue, 21 Jun 2011 06:04:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 22:03, Andrey V. Elsukov wrote: I don't think this changeset do anything with mediasize? No, an alignment value of 1 makes offset = 0, which is the intended behavior. Or did I misunderstood the code? Thanks in advance! - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOADR5AAoJEATO+BI/yjfB0OAIAJyN4zlzEfqkQG3umeho6lqY xdPl7/+7iJGFHQABeSnZ2dCUJTl8TpVRA51Ag6070h39YP5oNiJUcPhPy3OQnBXE lpYW/YGMg0uiXt3/sGvzVvMboUUeiH3TBgj2qD8DOHYF3Jr5c/zX/Tn5WCCE5aAu rLgPWw1bD9jnZkedL2fC/QY9jHtTN6BHZhD0o4bpB2IhY7I2xCe1Z25IZ7sbMEEH O8CqrRud+r1VQTXIrnFBrXd/Str98GCN3nnyke8pm23XeuLtu4BDzYbqAACGVwIs MOth1JfgqVcmo9Vch4zxT2652jLxQjxEwJOtqLzXe2DJ1V9iuafVPBENlAE8IG0= =O+OI -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 06:04:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8077C106564A; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 2AFAD8FC13; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id D14AEF2E4; Mon, 20 Jun 2011 23:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308636285; bh=qUyT6GK/QBoxk9q3wl9v1gpVh8j/16mBRAKz9CfN/KI=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NfL5o4iPTD3wQjlNFztP0onIbld4tZQWUBFbj6fdGpQfeMBxr8fvj7japZL747eJj HJ11RM8PYhT4Kv3oscKtJYbEcUpND5UNfrGMD/FhRtywOI5VDH8tyLJ2NkM9RqnknK PihlmtFuP43XqNrwTD9YZzx2VORWeoXxMyJcVDcI= Message-ID: <4E00347A.80407@delphij.net> Date: Mon, 20 Jun 2011 23:04:42 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> In-Reply-To: <4E00263C.4040802@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc 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, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part 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: Tue, 21 Jun 2011 06:04:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 22:03, Andrey V. Elsukov wrote: > On 21.06.2011 8:46, Xin LI wrote: >> Author: delphij >> Date: Tue Jun 21 04:46:00 2011 >> New Revision: 223356 >> URL: http://svn.freebsd.org/changeset/base/223356 >> >> Log: >> Mod the offset padding by alignment. Without this change we may >> pad too much when underlying GEOM object have a zero stripesize. > > No. In any way offset value could not be greater than mediasize. I don't think this changeset do anything with mediasize? > And it do nothing when alignment value is 1. No, an alignment value of 1 makes offset = 0, which is the intended behavior. Or did I misunderstood the code? Thanks in advance! >> MFC after: 1 month > > I did not MFC'd these changes yet. > >> Modified: >> head/sbin/geom/class/part/geom_part.c >> >> Modified: head/sbin/geom/class/part/geom_part.c >> ============================================================================== >> --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) >> +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r223356) >> @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r >> goto done; >> } >> >> - offset = pp->lg_stripeoffset / pp->lg_sectorsize; >> + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; >> last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); >> LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { >> s = find_provcfg(pp, "index"); >> @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) >> alignment = len; >> >> /* Adjust parameters to stripeoffset */ >> - offset = pp->lg_stripeoffset / pp->lg_sectorsize; >> + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; >> start = ALIGNUP(start + offset, alignment); >> if (size > alignment) >> size = ALIGNDOWN(size, alignment); >> >> > > - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOADR6AAoJEATO+BI/yjfBG5gH/2AFDv/cyvUXM16C5GBKjj8m XOqqRziAPz8VsICXjFLBdx0wxguYAB7Dr4U8krUgH0rOMIUXuew6lNmjQxfW2TQd 66o8XMTe9WdV28SZcJDJWpU5vAD2lQcGs88AjJt4fbtndHte3XN1kjBdZ6DpmMLw gdbn1iU836DFTE4kMdOhNb+h4RRbGNNx8QJ0jJO0RNrIUMy+w/dbgGUTqjYm6hTj vbZlA41QxSEx/cTDH7puje3/E9j9cIaOo3sCNpk1YrnVF7Syzn7arBruCmpDEVsN NIGVbD+WMvS4VxLK1Vwb6C1G6nYmf74fHDmkcwV4sg5iUw8V2SS6AO73ml9I/7U= =nfFW -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 06:06:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BFB2106566B; Tue, 21 Jun 2011 06:06:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC008FC14; Tue, 21 Jun 2011 06:06:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L66lqN082667; Tue, 21 Jun 2011 06:06:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L66lZ3082664; Tue, 21 Jun 2011 06:06:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106210606.p5L66lZ3082664@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 06:06: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: r223358 - 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: Tue, 21 Jun 2011 06:06:47 -0000 Author: ae Date: Tue Jun 21 06:06:47 2011 New Revision: 223358 URL: http://svn.freebsd.org/changeset/base/223358 Log: Do not use SET_HOST_IPLEN() macro for IPv6 packets. PR: kern/157239 MFC after: 2 weeks Modified: head/sys/netinet/ipfw/ip_dn_io.c head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netinet/ipfw/ip_dn_io.c Tue Jun 21 05:27:49 2011 (r223357) +++ head/sys/netinet/ipfw/ip_dn_io.c Tue Jun 21 06:06:47 2011 (r223358) @@ -668,7 +668,6 @@ dummynet_send(struct mbuf *m) break; case DIR_OUT | PROTO_IPV6: - SET_HOST_IPLEN(mtod(m, struct ip *)); ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); break; #endif Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jun 21 05:27:49 2011 (r223357) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jun 21 06:06:47 2011 (r223358) @@ -127,8 +127,9 @@ again: args.rule = *((struct ipfw_rule_ref *)(tag+1)); m_tag_delete(*m0, tag); if (args.rule.info & IPFW_ONEPASS) { - SET_HOST_IPLEN(mtod(*m0, struct ip *)); - return 0; + if (mtod(*m0, struct ip *)->ip_v == 4) + SET_HOST_IPLEN(mtod(*m0, struct ip *)); + return (0); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 06:23:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B15106566C; Tue, 21 Jun 2011 06:23:51 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3.mail.yandex.net (forward3.mail.yandex.net [77.88.46.8]) by mx1.freebsd.org (Postfix) with ESMTP id 529728FC08; Tue, 21 Jun 2011 06:23:51 +0000 (UTC) Received: from smtp3.mail.yandex.net (smtp3.mail.yandex.net [77.88.46.103]) by forward3.mail.yandex.net (Yandex) with ESMTP id 719E6B42AD2; Tue, 21 Jun 2011 10:23:49 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1308637429; bh=yAEV++ke3o74DxMqamOTMEi14BpQpTaHT8PkbZGGjaY=; h=Message-ID:Date:From:MIME-Version:CC:Subject:References: In-Reply-To:Content-Type; b=KIsx8/wLyoL3fX0m7s+TwqU5dHV0t7RMsLEmISVcVaKbYjUvIFVARb6IbMa5LgPaU A7beiGAlAdFgFEoiaOLNYzo2RP9aR5JmCbUkHn74fAGbo3BFmsWT5Xgph2Dg9lDFbJ Nkws6dVMP15GFkmws5XMxXvF8AbpWwfgOoIHxXEI= Received: from [127.0.0.1] (proxy.kirov.so-cdu.ru [77.72.136.146]) by smtp3.mail.yandex.net (Yandex) with ESMTPSA id 0ECD569800BC; Tue, 21 Jun 2011 10:23:49 +0400 (MSD) Message-ID: <4E0038F1.3050906@yandex.ru> Date: Tue, 21 Jun 2011 10:23:45 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> <4E00347A.80407@delphij.net> In-Reply-To: <4E00347A.80407@delphij.net> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5AC99A39D77D396F3B80E683" X-Yandex-Spam: 1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/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: Tue, 21 Jun 2011 06:23:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5AC99A39D77D396F3B80E683 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 21.06.2011 10:04, Xin LI wrote: >>> Mod the offset padding by alignment. Without this change we may >>> pad too much when underlying GEOM object have a zero stripesize. >=20 >> No. In any way offset value could not be greater than mediasize. > I don't think this changeset do anything with mediasize? I did mean that it could not pad too much. When stripesize is zero the stripeoffset points to real offset from the beginning of device. In case when we have nested partitioning schemes like MBR + BSD, stripeoffset of BSD slice could help align partition to the device. >> And it do nothing when alignment value is 1. >=20 > No, an alignment value of 1 makes offset =3D 0, which is the intended > behavior. >=20 > Or did I misunderstood the code? The problem that Kris reported was not here. I think this change is just for the reassurance. --=20 WBR, Andrey V. Elsukov --------------enig5AC99A39D77D396F3B80E683 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOADj0AAoJEAHF6gQQyKF6xysH/3W+oFrP14nosy1ZzXXnSSvy BJdoetMW7prInPGczw7Xi65fzBBLN8Y793IbG0jObJrkRHxUoEUnb0TzIvhTnh4b cSLuQLcN6g8FZ4gdwBja9W7k5Kx00b0zRyaz+dMkRqDDumBFole4R8tS3dG7z6o1 nsmFadpuq9wajyk3rTQNmG+fPGAy0K4E689nYcy+5JoxA2/FIvuW2K+LVEZ+Es6E rFjHtusW4yejfIWKTXhSXyLdhi+KA+j/Di5znui6YpWzBwygpcTmdRzbJOfsi9ks WWDFJAc14kPLVdg6SWa01fFSkFciC+VfImRxH9k3f1v3vzfnwenbYLE+JzyMvz0= =w1w+ -----END PGP SIGNATURE----- --------------enig5AC99A39D77D396F3B80E683-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 07:19:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CCDA106566C; Tue, 21 Jun 2011 07:19:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC798FC08; Tue, 21 Jun 2011 07:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L7J3LY085713; Tue, 21 Jun 2011 07:19:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L7J3A4085710; Tue, 21 Jun 2011 07:19:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106210719.p5L7J3A4085710@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 21 Jun 2011 07:19: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: r223359 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 07:19:04 -0000 Author: bz Date: Tue Jun 21 07:19:03 2011 New Revision: 223359 URL: http://svn.freebsd.org/changeset/base/223359 Log: Garbage collect never used global, sysctl, externs. MFC after: 1 week Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jun 21 06:06:47 2011 (r223358) +++ head/sys/net/route.c Tue Jun 21 07:19:03 2011 (r223359) @@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) -#if 0 -/* default fib for tunnels to use */ -u_int tunnel_fib = 0; -SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); -#endif - /* * handler for net.my_fibnum */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Jun 21 06:06:47 2011 (r223358) +++ head/sys/net/route.h Tue Jun 21 07:19:03 2011 (r223359) @@ -108,8 +108,6 @@ struct rt_metrics { #endif extern u_int rt_numfibs; /* number fo usable routing tables */ -extern u_int tunnel_fib; /* tunnels use these */ -extern u_int fwd_fib; /* packets being forwarded use these routes */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 08:31:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAEB41065673; Tue, 21 Jun 2011 08:31:29 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id CDDDC8FC08; Tue, 21 Jun 2011 08:31:29 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 3249EF836; Tue, 21 Jun 2011 01:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308645089; bh=fHsY/k/qwc1MxLiRTDUIUmnc+lHwADCUcVRB+u3XdSw=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=GxGWppQ6a5C38pDOADR3Fg4GkqTO+4asaKuWkF7T5POHRBlyQ8PGk2l8OVmtEVEEg 3E58SSk+T9jFDJCsfbFnYiOLXVmedXpAMfBDxzhxuhbE4d7bxgYep8l8+FOo3uY1XN 619oT6I/de9BcRShY6YZXjXQg6f1ekWVACXsaAtQ= Message-ID: <4E0056E0.2030104@delphij.net> Date: Tue, 21 Jun 2011 01:31:28 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> <4E00347A.80407@delphij.net> <4E0038F1.3050906@yandex.ru> In-Reply-To: <4E0038F1.3050906@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc 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, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part 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: Tue, 21 Jun 2011 08:31:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 23:23, Andrey V. Elsukov wrote: > On 21.06.2011 10:04, Xin LI wrote: >>>> Mod the offset padding by alignment. Without this change we may >>>> pad too much when underlying GEOM object have a zero stripesize. >> >>> No. In any way offset value could not be greater than mediasize. >> I don't think this changeset do anything with mediasize? > > I did mean that it could not pad too much. When stripesize is zero the > stripeoffset points to real offset from the beginning of device. > In case when we have nested partitioning schemes like MBR + BSD, > stripeoffset of BSD slice could help align partition to the device. Yes agreed. >>> And it do nothing when alignment value is 1. >> >> No, an alignment value of 1 makes offset = 0, which is the intended >> behavior. >> >> Or did I misunderstood the code? > > The problem that Kris reported was not here. > I think this change is just for the reassurance. Well, I think semantically the offset variable expects a value that represents in-stripe offset rather than the real (against the media) offset that GEOM returns. I'll defer the merge until your change have been merged. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOAFbgAAoJEATO+BI/yjfBNPkH/1HEUxWDuUFoO+4r8FGuTyek 8oFYip67HztN5l8CWiOP61utGPyMLcyk5hS6CwkvAiHaChQeGp75Sp/16D0xkyiT qcJOZIUjtTRvkABrLD/M5vLM5nU3cg80quhPmAjXuPytJFBsy7QdP1cjXK7ql0sB bCXMhqWR8oAbQ5rch8BkFlmRQmHEWFVlR2puxUoBi+YrUEKAiv83ghC9UE4H6NT8 trA+UYr+px2AC+opU0yijdscevdVPdJi6mo08EFqbC6ABzIwTR2Ky2LLhdGrmuk+ impuJz4r44LsKvAxOqFn9bZoBLRTxHMkSju4R8kaAfxT3dehTOK2RViI3FaH7Ko= =jRrp -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 10:35:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8901065677; Tue, 21 Jun 2011 10:35:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFFD8FC4B; Tue, 21 Jun 2011 10:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LAZKUk091943; Tue, 21 Jun 2011 10:35:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LAZKGq091941; Tue, 21 Jun 2011 10:35:20 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106211035.p5LAZKGq091941@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 10:35: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: r223364 - head/sbin/geom/class/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: Tue, 21 Jun 2011 10:35:20 -0000 Author: ae Date: Tue Jun 21 10:35:20 2011 New Revision: 223364 URL: http://svn.freebsd.org/changeset/base/223364 Log: When user specifies the bootcode with size smaller than VTOC_BOOTCODE, gpart_write_partcode_vtoc8 does access out of range of allocated memory. Check size of bootcode before writing it. Pointed out by: ru MFC after: 1 week Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 09:19:38 2011 (r223363) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 10:35:20 2011 (r223364) @@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns if (idx == 0) errx(EXIT_FAILURE, "missing -i option"); gpart_write_partcode(gp, idx, partcode, partsize); - } else + } else { + if (partsize != VTOC_BOOTSIZE) + errx(EXIT_FAILURE, "invalid bootcode"); gpart_write_partcode_vtoc8(gp, idx, partcode); + } } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 12:38:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D501D1065672; Tue, 21 Jun 2011 12:38:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C525E8FC16; Tue, 21 Jun 2011 12:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LCce8O001410; Tue, 21 Jun 2011 12:38:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LCceJV001408; Tue, 21 Jun 2011 12:38:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106211238.p5LCceJV001408@svn.freebsd.org> From: Alan Cox Date: Tue, 21 Jun 2011 12:38: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: r223365 - head/sys/ia64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 12:38:40 -0000 Author: alc Date: Tue Jun 21 12:38:40 2011 New Revision: 223365 URL: http://svn.freebsd.org/changeset/base/223365 Log: Use a non-standard page size that is supported. Modified: head/sys/ia64/conf/NOTES Modified: head/sys/ia64/conf/NOTES ============================================================================== --- head/sys/ia64/conf/NOTES Tue Jun 21 10:35:20 2011 (r223364) +++ head/sys/ia64/conf/NOTES Tue Jun 21 12:38:40 2011 (r223365) @@ -25,7 +25,7 @@ options LOG2_ID_PAGE_SIZE=27 # 128M # option: LOG2_PAGE_SIZE # Specify the log2 size of the page to be used for virtual memory management. # The page size being equal to 1< Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD02106566C; Tue, 21 Jun 2011 13:07:20 +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 D59FB8FC12; Tue, 21 Jun 2011 13:07:19 +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 8C95F46B06; Tue, 21 Jun 2011 09:07:19 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1EFAA8A01F; Tue, 21 Jun 2011 09:07:19 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Tue, 21 Jun 2011 09:07:17 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106202259.p5KMxT1h069297@svn.freebsd.org> In-Reply-To: <201106202259.p5KMxT1h069297@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106210907.18414.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 09:07:19 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 13:07:20 -0000 On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > Author: jfv > Date: Mon Jun 20 22:59:29 2011 > New Revision: 223350 > URL: http://svn.freebsd.org/changeset/base/223350 > > Log: > Eliminate some global tuneables in favor of adapter-specific, > particular flow control and dma coalesce. Also improve the > sysctl operation on those too. > > Add IPv6 detection in the ioctl code, this was done for > ixgbe first, carrying that over. > > Add resource ability to disable particular adapter. > > Add HW TSO capability so vlans can make use of TSO The tunables are useful for setting defaults for all interfaces. :( I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can ensure that all igb interfaces in a given system have that setting. This is more scalable than having to set the right number of entries in /etc/sysctl.conf.local on different machines, etc, without spamming the console during boot with warnings about tweaking non-existing sysctls, etc. Please consider keeping the tunables where the tunables are used to set default settings for all adapters from the loader but per-device sysctls are used post-boot to provide runtime, per-device settings. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 13:31:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57DCD106566B; Tue, 21 Jun 2011 13:31:43 +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 2DCBE8FC15; Tue, 21 Jun 2011 13:31:43 +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 D5E9C46B23; Tue, 21 Jun 2011 09:31:42 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 718038A01F; Tue, 21 Jun 2011 09:31:42 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 21 Jun 2011 09:10:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110618210815.W889@besplex.bde.org> <201106201941.03393.jkim@FreeBSD.org> In-Reply-To: <201106201941.03393.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106210910.25697.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 09:31:42 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 13:31:43 -0000 On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > My questions to you: > > a) Why do we care TSC timecounter when it is not invariant where we > *know* it is unusable and set to negative quality? What if the user knows they will not enable CPU throttling so for them the TSC is safe? In that case, TSC is a more efficient timecounter and if the user constrains the system to make the TSC safe we should let them use it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 14:40:12 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE9661065674; Tue, 21 Jun 2011 14:40:12 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id 6F99A8FC16; Tue, 21 Jun 2011 14:40:12 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LEDqOS044711; Tue, 21 Jun 2011 09:13:52 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LEDjCw032591 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 09:13:46 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LEDjCw032591 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308665627; bh=QReqI2toiDtyqfrWzJ1Xa76muHycMexXERopW+Q6Apk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=VlVng96NdbBo0e2Zv1ZPDFrRqx1RNe9kdCmQdXORAeZ+od2BaMgQWhRQ9ecMVjTh5 IeWP9ViutKIXrcHDGPzDT/cIUck41pEaz7klIeKMrU92EdmO/tl3jkxbXwFJwsM8UQ z1N3YK9hJgRZ4ON6Geqo7VG0qiVC5yBCAqUzLfm0= Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <201106210907.18414.jhb@freebsd.org> Date: Tue, 21 Jun 2011 09:13:45 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <5DCAB741-793C-4595-A83D-CC89D9D14A13@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 09:13:47 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LEDjCw032591 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: Jack F Vogel , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 14:40:12 -0000 On Jun 21, 2011, at 8:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> Author: jfv >> Date: Mon Jun 20 22:59:29 2011 >> New Revision: 223350 >> URL: http://svn.freebsd.org/changeset/base/223350 >>=20 >> Log: >> Eliminate some global tuneables in favor of adapter-specific, >> particular flow control and dma coalesce. Also improve the >> sysctl operation on those too. >>=20 >> Add IPv6 detection in the ioctl code, this was done for >> ixgbe first, carrying that over. >>=20 >> Add resource ability to disable particular adapter. >>=20 >> Add HW TSO capability so vlans can make use of TSO >=20 > The tunables are useful for setting defaults for all interfaces. :( >=20 > I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can=20 > ensure that all igb interfaces in a given system have that setting. = This is=20 > more scalable than having to set the right number of entries in=20 > /etc/sysctl.conf.local on different machines, etc, without spamming = the=20 > console during boot with warnings about tweaking non-existing sysctls, = etc. >=20 > Please consider keeping the tunables where the tunables are used to = set > default settings for all adapters from the loader but per-device = sysctls are > used post-boot to provide runtime, per-device settings. I agree. Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 15:49:15 2011 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 E4FF8106564A; Tue, 21 Jun 2011 15:49:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 21 Jun 2011 11:48:55 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106201941.03393.jkim@FreeBSD.org> <201106210910.25697.jhb@freebsd.org> In-Reply-To: <201106210910.25697.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211149.02280.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 15:49:15 -0000 On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > My questions to you: > > > > a) Why do we care TSC timecounter when it is not invariant where > > we *know* it is unusable and set to negative quality? > > What if the user knows they will not enable CPU throttling so for > them the TSC is safe? In that case, TSC is a more efficient > timecounter and if the user constrains the system to make the TSC > safe we should let them use it. In that case, it must be a UP system, the quality is still 800, and TSC value won't be shifted. My question was specific to SMP cases. Sorry, I didn't make that clear. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 15:57:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 854551065672; Tue, 21 Jun 2011 15:57:26 +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 59A9F8FC17; Tue, 21 Jun 2011 15:57:26 +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 076E946B03; Tue, 21 Jun 2011 11:57:26 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 87E218A01F; Tue, 21 Jun 2011 11:57:25 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 21 Jun 2011 11:56:38 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106210910.25697.jhb@freebsd.org> <201106211149.02280.jkim@FreeBSD.org> In-Reply-To: <201106211149.02280.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211156.38396.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 11:57:25 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 15:57:26 -0000 On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote: > On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > > My questions to you: > > > > > > a) Why do we care TSC timecounter when it is not invariant where > > > we *know* it is unusable and set to negative quality? > > > > What if the user knows they will not enable CPU throttling so for > > them the TSC is safe? In that case, TSC is a more efficient > > timecounter and if the user constrains the system to make the TSC > > safe we should let them use it. > > In that case, it must be a UP system, the quality is still 800, and > TSC value won't be shifted. > > My question was specific to SMP cases. Sorry, I didn't make that > clear. What if the user has an SMP system where the TSCs are in sync but it's older so it doesn't set the TSC invariant bit set in cpuid. Are we now forbidding that user from using the TSC? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 16:07:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AB41065672; Tue, 21 Jun 2011 16:07:25 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 956FC8FC13; Tue, 21 Jun 2011 16:07:24 +0000 (UTC) Received: by vws18 with SMTP id 18so2343895vws.13 for ; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mCaN4XP7X/wzi2TdNzoY2SDzy2UIXBQzy9kPMDYwKFQ=; b=BsAsw5cWBdWqJf4OkOoL/B4QBoJXAxXWy3FEkd61xljTUEBIue4Ts7JOX0P86wfjcF +liMeIkoyyeeM3oleL9xKuM9UkN1UEDZUr5RQShRDE26GSXJNz/8ei7mvRM6ey5SKcFu 159pNc3jt/s9d7oU/snA8599vrv2t8d3FSjEQ= 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; b=C+RvUCg5nWf2diIp21Lja8lwmMuZQYHl2kIhjNp34nkqDIw/2Yo9QV0EJus3GC0XJD i1e06ogvasOvhvRiWrt0RVmzPF+SNZ5vm7lzUiP3hx2kN8bdYkeUu8vGimNZpCK38g8G EbgLKAF3UEusFpzZ3tZWTau+KT7IrBWxSFLNU= MIME-Version: 1.0 Received: by 10.52.98.34 with SMTP id ef2mr5540910vdb.293.1308672443711; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) Received: by 10.52.114.99 with HTTP; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) In-Reply-To: <201106210907.18414.jhb@freebsd.org> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> Date: Tue, 21 Jun 2011 09:07:23 -0700 Message-ID: From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 16:07:25 -0000 LOL, the old adage is true, you just can't please all the people... :) The way the code now is it assigns a default, but you could still have a loader entry that would change it for all adapters if you wanted to, but ok, if you prefer the older for this. What other globals do you think should be retained? Jack On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Jun 20 22:59:29 2011 > > New Revision: 223350 > > URL: http://svn.freebsd.org/changeset/base/223350 > > > > Log: > > Eliminate some global tuneables in favor of adapter-specific, > > particular flow control and dma coalesce. Also improve the > > sysctl operation on those too. > > > > Add IPv6 detection in the ioctl code, this was done for > > ixgbe first, carrying that over. > > > > Add resource ability to disable particular adapter. > > > > Add HW TSO capability so vlans can make use of TSO > > The tunables are useful for setting defaults for all interfaces. :( > > I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can > ensure that all igb interfaces in a given system have that setting. This > is > more scalable than having to set the right number of entries in > /etc/sysctl.conf.local on different machines, etc, without spamming the > console during boot with warnings about tweaking non-existing sysctls, etc. > > Please consider keeping the tunables where the tunables are used to set > default settings for all adapters from the loader but per-device sysctls > are > used post-boot to provide runtime, per-device settings. > > -- > John Baldwin > From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 16:12:14 2011 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 C4B88106564A; Tue, 21 Jun 2011 16:12:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 21 Jun 2011 12:11:58 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106211149.02280.jkim@FreeBSD.org> <201106211156.38396.jhb@freebsd.org> In-Reply-To: <201106211156.38396.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211212.03140.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 16:12:14 -0000 On Tuesday 21 June 2011 11:56 am, John Baldwin wrote: > On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote: > > On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > > > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > > > My questions to you: > > > > > > > > a) Why do we care TSC timecounter when it is not invariant > > > > where we *know* it is unusable and set to negative quality? > > > > > > What if the user knows they will not enable CPU throttling so > > > for them the TSC is safe? In that case, TSC is a more > > > efficient timecounter and if the user constrains the system to > > > make the TSC safe we should let them use it. > > > > In that case, it must be a UP system, the quality is still 800, > > and TSC value won't be shifted. > > > > My question was specific to SMP cases. Sorry, I didn't make that > > clear. > > What if the user has an SMP system where the TSCs are in sync but > it's older so it doesn't set the TSC invariant bit set in cpuid. > Are we now forbidding that user from using the TSC? We do not forbid it but we cannot increase the quality because we don't compensate drift. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 16:18:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F3AC1065672; Tue, 21 Jun 2011 16:18:10 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id EF7318FC16; Tue, 21 Jun 2011 16:18:09 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LGHrOh050082; Tue, 21 Jun 2011 11:17:53 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LGHhCN036265 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 11:17:44 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LGHhCN036265 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308673065; bh=EoL280FRHu8JSFiaa5OWWFzVaM89NSbjTapQ52jk808=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=mL57pDsn0kwXANNb9TNWSUrdxvvgUyWz1lNYPfD5KSSUkxp1i9YwvLBbjjifCeNF8 O0pejRGZOfOhHH+/Tlz+k/cTDgc5SGTMZG4i7vdyFrYjEKmiI2cdTtlXDSOG4hNAph sLxQ5TnbVWUHZxPZf9ca8ikw1btefS4A30Ez7zNU= Mime-Version: 1.0 (Apple Message framework v1084) From: Guy Helmer In-Reply-To: Date: Tue, 21 Jun 2011 11:17:43 -0500 Message-Id: <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> To: Jack Vogel X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 11:17:45 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LGHhCN036265 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.899, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 16:18:10 -0000 On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: > LOL, the old adage is true, you just can't please all the people... :)=20= >=20 > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you=20 > think should be retained? >=20 I'd like to be able to set the global default for flow control. I'd = also appreciate a global default for disabling TCP checksum offload, but = that's above and beyond what we had before :-) > Jack >=20 >=20 > On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Jun 20 22:59:29 2011 > > New Revision: 223350 > > URL: http://svn.freebsd.org/changeset/base/223350 > > > > Log: > > Eliminate some global tuneables in favor of adapter-specific, > > particular flow control and dma coalesce. Also improve the > > sysctl operation on those too. > > > > Add IPv6 detection in the ioctl code, this was done for > > ixgbe first, carrying that over. > > > > Add resource ability to disable particular adapter. > > > > Add HW TSO capability so vlans can make use of TSO >=20 > The tunables are useful for setting defaults for all interfaces. :( >=20 > I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can > ensure that all igb interfaces in a given system have that setting. = This is > more scalable than having to set the right number of entries in > /etc/sysctl.conf.local on different machines, etc, without spamming = the > console during boot with warnings about tweaking non-existing sysctls, = etc. >=20 > Please consider keeping the tunables where the tunables are used to = set > default settings for all adapters from the loader but per-device = sysctls are > used post-boot to provide runtime, per-device settings. >=20 > -- > John Baldwin >=20 --------=0AThis message has been scanned by ComplianceSafe, powered by Palisade's PacketSure.=0A From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 16:34:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C248C106566B; Tue, 21 Jun 2011 16:34:07 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2BDD88FC16; Tue, 21 Jun 2011 16:34:06 +0000 (UTC) Received: by vws18 with SMTP id 18so2374483vws.13 for ; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fACssCU+1efZmGJOKOTvNCIwtpQjEMTBYYjx98eI7XA=; b=ZZ+TzMPblZ9+axXAupcol6O+nYrbfG/hd3iTZ1tJhhKlxJSIU10jO4imrDRLXCdmco dd4KbB1mJcyUwh3FweRhJCvhL1uGgr/0Pb6uikHho8nAvzBPF2NZqikSt/ElWdShVVXg 3+3pF22b9nGdn1g6IOjDzYU9bK+l7r0ekCxbE= 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; b=kBgpC7QkB1N7DBWbahc/+8nLpfGgioUzZfjFWjSdfHb9EOdfToX+mn4sywe+8qK+kr ktzJoBOozzvCpKqOwpuJG8bjSO5Emw520v4/ex+BGXoUcyGuayBaUrPspBp3dnZyC5dn P+VVHK5JFxhI7zE/VnITRnfBCkcB8pH1aa18I= MIME-Version: 1.0 Received: by 10.52.71.176 with SMTP id w16mr6255525vdu.133.1308674046050; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) Received: by 10.52.114.99 with HTTP; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) In-Reply-To: <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> Date: Tue, 21 Jun 2011 09:34:06 -0700 Message-ID: From: Jack Vogel To: Guy Helmer Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 16:34:07 -0000 There IS a global default for flow control, its just hardcoded.. :) Flow control was something my validation group specifically ragged on me about... and was the reason I changed to a per-adapter setting. Let me think about it. Jack On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer wrote: > On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: > > LOL, the old adage is true, you just can't please all the people... :) > > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you > think should be retained? > > > I'd like to be able to set the global default for flow control. I'd also > appreciate a global default for disabling TCP checksum offload, but that's > above and beyond what we had before :-) > > Jack > > > On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > >> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> > Author: jfv >> > Date: Mon Jun 20 22:59:29 2011 >> > New Revision: 223350 >> > URL: http://svn.freebsd.org/changeset/base/223350 >> > >> > Log: >> > Eliminate some global tuneables in favor of adapter-specific, >> > particular flow control and dma coalesce. Also improve the >> > sysctl operation on those too. >> > >> > Add IPv6 detection in the ioctl code, this was done for >> > ixgbe first, carrying that over. >> > >> > Add resource ability to disable particular adapter. >> > >> > Add HW TSO capability so vlans can make use of TSO >> >> The tunables are useful for setting defaults for all interfaces. :( >> >> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can >> ensure that all igb interfaces in a given system have that setting. This >> is >> more scalable than having to set the right number of entries in >> /etc/sysctl.conf.local on different machines, etc, without spamming the >> console during boot with warnings about tweaking non-existing sysctls, >> etc. >> >> Please consider keeping the tunables where the tunables are used to set >> default settings for all adapters from the loader but per-device sysctls >> are >> used post-boot to provide runtime, per-device settings. >> >> -- >> John Baldwin >> > > > > > > ------------------------------ > *This message has been scanned by ComplianceSafe, powered by Palisade's > PacketSure.* > From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 16:40:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBCC61065672; Tue, 21 Jun 2011 16:40:11 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id 76D5F8FC0A; Tue, 21 Jun 2011 16:40:11 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LGeAJh051062; Tue, 21 Jun 2011 11:40:10 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LGe4Iq037001 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 11:40:05 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LGe4Iq037001 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308674405; bh=U9Ie/T1VDtzlujMARog6Ujou1SkZDTucv9262zgUDCU=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=S9Xtn8QonYj2gImg3DpUZbN3ZXa/2lFWMneZWYs1bMe9K9PZFKg2nBjjxkerryKYC vOe2+iRQg3iF9xVaBIyCu1D8gdQ1TF160D25EpsQ5qtr554Gd5OSwyuHyB6zut09XK rmGS7B0bg9TnQqtrj/kQEyb1oLYDEUYLcdxQY1Ek= Mime-Version: 1.0 (Apple Message framework v1084) From: Guy Helmer In-Reply-To: Date: Tue, 21 Jun 2011 11:40:04 -0500 Message-Id: References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> To: Jack Vogel X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 11:40:05 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LGe4Iq037001 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.899, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 16:40:11 -0000 Ahh, I meant to say "global tunables". It is nice to have flow control as a per-interface setting also - didn't = have that back in FreeBSD 8.1. Thanks, Guy On Jun 21, 2011, at 11:34 AM, Jack Vogel wrote: > There IS a global default for flow control, its just hardcoded.. :) >=20 > Flow control was something my validation group specifically ragged on = me=20 > about... and was the reason I changed to a per-adapter setting. >=20 > Let me think about it. >=20 > Jack >=20 >=20 > On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer = wrote: > On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: >=20 >> LOL, the old adage is true, you just can't please all the people... = :)=20 >>=20 >> The way the code now is it assigns a default, but you could still = have >> a loader entry that would change it for all adapters if you wanted = to, >> but ok, if you prefer the older for this. What other globals do you=20= >> think should be retained? >>=20 >=20 > I'd like to be able to set the global default for flow control. I'd = also appreciate a global default for disabling TCP checksum offload, but = that's above and beyond what we had before :-) >=20 >> Jack >>=20 >>=20 >> On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin = wrote: >> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> > Author: jfv >> > Date: Mon Jun 20 22:59:29 2011 >> > New Revision: 223350 >> > URL: http://svn.freebsd.org/changeset/base/223350 >> > >> > Log: >> > Eliminate some global tuneables in favor of adapter-specific, >> > particular flow control and dma coalesce. Also improve the >> > sysctl operation on those too. >> > >> > Add IPv6 detection in the ioctl code, this was done for >> > ixgbe first, carrying that over. >> > >> > Add resource ability to disable particular adapter. >> > >> > Add HW TSO capability so vlans can make use of TSO >>=20 >> The tunables are useful for setting defaults for all interfaces. :( >>=20 >> I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can >> ensure that all igb interfaces in a given system have that setting. = This is >> more scalable than having to set the right number of entries in >> /etc/sysctl.conf.local on different machines, etc, without spamming = the >> console during boot with warnings about tweaking non-existing = sysctls, etc. >>=20 >> Please consider keeping the tunables where the tunables are used to = set >> default settings for all adapters from the loader but per-device = sysctls are >> used post-boot to provide runtime, per-device settings. >>=20 >> -- >> John Baldwin >>=20 >=20 >=20 >=20 --------=0AThis message has been scanned by ComplianceSafe, powered by Palisade's PacketSure.=0A From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 17:24:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6828D1065670; Tue, 21 Jun 2011 17:24:57 +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 3D00C8FC17; Tue, 21 Jun 2011 17:24:57 +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 AA13846B23; Tue, 21 Jun 2011 13:24:56 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 491258A027; Tue, 21 Jun 2011 13:24:56 -0400 (EDT) From: John Baldwin To: Jack Vogel Date: Tue, 21 Jun 2011 13:24:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201106211324.41214.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 13:24:56 -0400 (EDT) Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - 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: Tue, 21 Jun 2011 17:24:57 -0000 On Tuesday, June 21, 2011 12:07:23 pm Jack Vogel wrote: > LOL, the old adage is true, you just can't please all the people... :) > > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you > think should be retained? I mostly care about the 'rxd', 'txd', 'rx_processing_limit', 'enable_aim', and 'num_queues'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 17:59:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9CDA1065693; Tue, 21 Jun 2011 17:59:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C200D8FC1D; Tue, 21 Jun 2011 17:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LHxptB010734; Tue, 21 Jun 2011 17:59:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LHxpIm010731; Tue, 21 Jun 2011 17:59:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106211759.p5LHxpIm010731@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 Jun 2011 17:59: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: r223367 - head/libexec/ulog-helper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 17:59:52 -0000 Author: ed Date: Tue Jun 21 17:59:51 2011 New Revision: 223367 URL: http://svn.freebsd.org/changeset/base/223367 Log: Minor cleanups to ulog-helper: - Remove unneeded linking against libmd. libulog depends on this library, but the ulog-helper tool itself does not. - Change the comment at the top to mention utmpx instead of utmp, wtmp and lastlog. - Simply use user_from_uid() to translate to a username string. - Put variable declarations together. Modified: head/libexec/ulog-helper/Makefile head/libexec/ulog-helper/ulog-helper.c Modified: head/libexec/ulog-helper/Makefile ============================================================================== --- head/libexec/ulog-helper/Makefile Tue Jun 21 14:31:36 2011 (r223366) +++ head/libexec/ulog-helper/Makefile Tue Jun 21 17:59:51 2011 (r223367) @@ -5,7 +5,7 @@ BINOWN= root BINMODE=4555 NO_MAN= -DPADD= ${LIBULOG} ${LIBMD} -LDADD= -lulog -lmd +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: head/libexec/ulog-helper/ulog-helper.c ============================================================================== --- head/libexec/ulog-helper/ulog-helper.c Tue Jun 21 14:31:36 2011 (r223366) +++ head/libexec/ulog-helper/ulog-helper.c Tue Jun 21 17:59:51 2011 (r223367) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); /* * This setuid helper utility writes user login records to disk. - * Unprivileged processes are not capable of writing records to utmp, - * wtmp and lastlog, but we do want to allow this for pseudo-terminals. - * Because a file descriptor to a pseudo-terminal master device can only - * be obtained by processes using the pseudo-terminal, we expect such a - * descriptor on stdin. + * Unprivileged processes are not capable of writing records to utmpx, + * but we do want to allow this for pseudo-terminals. Because a file + * descriptor to a pseudo-terminal master device can only be obtained by + * processes using the pseudo-terminal, we expect such a descriptor on + * stdin. * * It uses the real user ID of the calling process to determine the * username. It does allow users to log arbitrary hostnames. @@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - const char *line; + const char *line, *user, *host; /* Device line name. */ if ((line = ptsname(STDIN_FILENO)) == NULL) return (EX_USAGE); if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) { - struct passwd *pwd; - const char *host = NULL; - /* Username. */ - pwd = getpwuid(getuid()); - if (pwd == NULL) + user = user_from_uid(getuid(), 1); + if (user == NULL) return (EX_OSERR); /* Hostname. */ - if (argc == 3) - host = argv[2]; + host = argc == 3 ? argv[2] : NULL; - ulog_login(line, pwd->pw_name, host); + ulog_login(line, user, host); return (EX_OK); } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { ulog_logout(line); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 19:15:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BF0E10656D0; Tue, 21 Jun 2011 19:15:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9B88FC0C; Tue, 21 Jun 2011 19:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJFOQ8013118; Tue, 21 Jun 2011 19:15:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJFOFN013116; Tue, 21 Jun 2011 19:15:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106211915.p5LJFOFN013116@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 19:15: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: r223369 - 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: Tue, 21 Jun 2011 19:15:24 -0000 Author: marius Date: Tue Jun 21 19:15:23 2011 New Revision: 223369 URL: http://svn.freebsd.org/changeset/base/223369 Log: Change sparc64 to use the initial exec TLS model, too. This avoids random assertion failures in _malloc_thread_cleanup(). Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Tue Jun 21 19:13:48 2011 (r223368) +++ head/lib/libc/stdlib/malloc.c Tue Jun 21 19:15:23 2011 (r223369) @@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$"); #ifdef __sparc64__ # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 -# define TLS_MODEL /* default */ +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ # define LG_QUANTUM 4 From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 19:29:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4B910656EF; Tue, 21 Jun 2011 19:29:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE1E58FC1D; Tue, 21 Jun 2011 19:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJTRUt013592; Tue, 21 Jun 2011 19:29:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJTRA5013589; Tue, 21 Jun 2011 19:29:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106211929.p5LJTRA5013589@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 19:29: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: r223370 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 19:29:28 -0000 Author: jhb Date: Tue Jun 21 19:29:27 2011 New Revision: 223370 URL: http://svn.freebsd.org/changeset/base/223370 Log: Use AcpiWalkResources() to parse the resource list from _CRS rather than using a home-rolled loop. While here, add support for 64-bit address range resources. Silence on: acpi@ (older version) Modified: head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:15:23 2011 (r223369) +++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:29:27 2011 (r223370) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,6 +140,248 @@ acpi_config_intr(device_t dev, ACPI_RESO INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +struct acpi_resource_context { + struct acpi_parse_resource_set *set; + device_t dev; + void *context; +}; + +#ifdef ACPI_DEBUG_OUTPUT +static const char * +acpi_address_range_name(UINT8 ResourceType) +{ + static char buf[16]; + + switch (ResourceType) { + case ACPI_MEMORY_RANGE: + return ("Memory"); + case ACPI_IO_RANGE: + return ("IO"); + case ACPI_BUS_NUMBER_RANGE: + return ("Bus Number"); + default: + snprintf(buf, sizeof(buf), "type %u", ResourceType); + return (buf); + } +} +#endif + +static ACPI_STATUS +acpi_parse_resource(ACPI_RESOURCE *res, void *context) +{ + struct acpi_parse_resource_set *set; + struct acpi_resource_context *arc; + UINT64 min, max, length, gran; + const char *name; + device_t dev; + + arc = context; + dev = arc->dev; + set = arc->set; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_END_TAG: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); + break; + case ACPI_RESOURCE_TYPE_FIXED_IO: + if (res->Data.FixedIo.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", + res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, + res->Data.FixedIo.AddressLength); + break; + case ACPI_RESOURCE_TYPE_IO: + if (res->Data.Io.AddressLength <= 0) + break; + if (res->Data.Io.Minimum == res->Data.Io.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.Maximum, + res->Data.Io.AddressLength)); + set->set_iorange(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.Maximum, res->Data.Io.AddressLength, + res->Data.Io.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + if (res->Data.FixedMemory32.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", + res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength); + break; + case ACPI_RESOURCE_TYPE_MEMORY32: + if (res->Data.Memory32.AddressLength <= 0) + break; + if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, + res->Data.Memory32.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, + res->Data.Memory32.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_MEMORY24: + if (res->Data.Memory24.AddressLength <= 0) + break; + if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.Maximum, + res->Data.Memory24.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength, + res->Data.Memory24.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_IRQ: + /* + * from 1.0b 6.4.2 + * "This structure is repeated for each separate interrupt + * required" + */ + set->set_irq(dev, arc->context, res->Data.Irq.Interrupts, + res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, + res->Data.Irq.Polarity); + break; + case ACPI_RESOURCE_TYPE_DMA: + /* + * from 1.0b 6.4.3 + * "This structure is repeated for each separate DMA channel + * required" + */ + set->set_drq(dev, arc->context, res->Data.Dma.Channels, + res->Data.Dma.ChannelCount); + break; + case ACPI_RESOURCE_TYPE_START_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n")); + set->set_start_dependent(dev, arc->context, + res->Data.StartDpf.CompatibilityPriority); + break; + case ACPI_RESOURCE_TYPE_END_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n")); + set->set_end_dependent(dev, arc->context); + break; + case ACPI_RESOURCE_TYPE_ADDRESS16: + case ACPI_RESOURCE_TYPE_ADDRESS32: + case ACPI_RESOURCE_TYPE_ADDRESS64: + case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS16: + gran = res->Data.Address16.Granularity; + min = res->Data.Address16.Minimum; + max = res->Data.Address16.Maximum; + length = res->Data.Address16.AddressLength; + name = "Address16"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS32: + gran = res->Data.Address32.Granularity; + min = res->Data.Address32.Minimum; + max = res->Data.Address32.Maximum; + length = res->Data.Address32.AddressLength; + name = "Address32"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS64: + gran = res->Data.Address64.Granularity; + min = res->Data.Address64.Minimum; + max = res->Data.Address64.Maximum; + length = res->Data.Address64.AddressLength; + name = "Address64"; + break; + default: + KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, + ("should never happen")); + gran = res->Data.ExtAddress64.Granularity; + min = res->Data.ExtAddress64.Minimum; + max = res->Data.ExtAddress64.Maximum; + length = res->Data.ExtAddress64.AddressLength; + name = "ExtAddress64"; + break; + } + if (length <= 0) + break; + if (res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s %s producer\n", name, + acpi_address_range_name(res->Data.Address.ResourceType))); + break; + } + if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE && + res->Data.Address.ResourceType != ACPI_IO_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s for non-memory, non-I/O\n", name)); + break; + } + +#ifdef __i386__ + if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max > + ULONG_MAX)) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s above 4G\n", + name)); + break; + } + if (max > ULONG_MAX) + max = ULONG_MAX; +#endif + if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && + res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", + name, min, length)); + set->set_memory(dev, arc->context, min, length); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, + min, length)); + set->set_ioport(dev, arc->context, min, length); + } + } else { + if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", + name, min, max, length)); + set->set_memoryrange(dev, arc->context, min, max, length, gran); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", + name, min, max, length)); + set->set_iorange(dev, arc->context, min, max, length, gran); + } + } + break; + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: + if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored ExtIRQ producer\n")); + break; + } + set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts, + res->Data.ExtendedIrq.InterruptCount, + res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity); + break; + case ACPI_RESOURCE_TYPE_VENDOR: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "unimplemented VendorSpecific resource\n")); + break; + default: + break; + } + return (AE_OK); +} + /* * Fetch a device's resources and associate them with the device. * @@ -153,318 +396,21 @@ ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg) { - ACPI_BUFFER buf; - ACPI_RESOURCE *res; - char *curr, *last; + struct acpi_resource_context arc; ACPI_STATUS status; - void *context; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - /* - * Special-case some devices that abuse _PRS/_CRS to mean - * something other than "I consume this resource". - * - * XXX do we really need this? It's only relevant once - * we start always-allocating these resources, and even - * then, the only special-cased device is likely to be - * the PCI interrupt link. - */ - - /* Fetch the device's current resources. */ - buf.Length = ACPI_ALLOCATE_BUFFER; - if (ACPI_FAILURE((status = AcpiGetCurrentResources(handle, &buf)))) { - if (status != AE_NOT_FOUND && status != AE_TYPE) - printf("can't fetch resources for %s - %s\n", - acpi_name(handle), AcpiFormatException(status)); + set->set_init(dev, arg, &arc.context); + arc.set = set; + arc.dev = dev; + status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + printf("can't fetch resources for %s - %s\n", + acpi_name(handle), AcpiFormatException(status)); return_ACPI_STATUS (status); } - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s - got %ld bytes of resources\n", - acpi_name(handle), (long)buf.Length)); - set->set_init(dev, arg, &context); - - /* Iterate through the resources */ - curr = buf.Pointer; - last = (char *)buf.Pointer + buf.Length; - while (curr < last) { - res = (ACPI_RESOURCE *)curr; - curr += res->Length; - - /* Handle the individual resource types */ - switch(res->Type) { - case ACPI_RESOURCE_TYPE_END_TAG: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); - curr = last; - break; - case ACPI_RESOURCE_TYPE_FIXED_IO: - if (res->Data.FixedIo.AddressLength <= 0) - break; - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", - res->Data.FixedIo.Address, - res->Data.FixedIo.AddressLength)); - set->set_ioport(dev, context, - res->Data.FixedIo.Address, - res->Data.FixedIo.AddressLength); - break; - case ACPI_RESOURCE_TYPE_IO: - if (res->Data.Io.AddressLength <= 0) - break; - if (res->Data.Io.Minimum == res->Data.Io.Maximum) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", - res->Data.Io.Minimum, - res->Data.Io.AddressLength)); - set->set_ioport(dev, context, - res->Data.Io.Minimum, - res->Data.Io.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", - res->Data.Io.Minimum, - res->Data.Io.Maximum, - res->Data.Io.AddressLength)); - set->set_iorange(dev, context, - res->Data.Io.Minimum, - res->Data.Io.Maximum, - res->Data.Io.AddressLength, - res->Data.Io.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: - if (res->Data.FixedMemory32.AddressLength <= 0) - break; - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", - res->Data.FixedMemory32.Address, - res->Data.FixedMemory32.AddressLength)); - set->set_memory(dev, context, - res->Data.FixedMemory32.Address, - res->Data.FixedMemory32.AddressLength); - break; - case ACPI_RESOURCE_TYPE_MEMORY32: - if (res->Data.Memory32.AddressLength <= 0) - break; - if (res->Data.Memory32.Minimum == - res->Data.Memory32.Maximum) { - - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", - res->Data.Memory32.Minimum, - res->Data.Memory32.AddressLength)); - set->set_memory(dev, context, - res->Data.Memory32.Minimum, - res->Data.Memory32.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", - res->Data.Memory32.Minimum, - res->Data.Memory32.Maximum, - res->Data.Memory32.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Memory32.Minimum, - res->Data.Memory32.Maximum, - res->Data.Memory32.AddressLength, - res->Data.Memory32.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_MEMORY24: - if (res->Data.Memory24.AddressLength <= 0) - break; - if (res->Data.Memory24.Minimum == - res->Data.Memory24.Maximum) { - - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", - res->Data.Memory24.Minimum, - res->Data.Memory24.AddressLength)); - set->set_memory(dev, context, res->Data.Memory24.Minimum, - res->Data.Memory24.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", - res->Data.Memory24.Minimum, - res->Data.Memory24.Maximum, - res->Data.Memory24.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Memory24.Minimum, - res->Data.Memory24.Maximum, - res->Data.Memory24.AddressLength, - res->Data.Memory24.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_IRQ: - /* - * from 1.0b 6.4.2 - * "This structure is repeated for each separate interrupt - * required" - */ - set->set_irq(dev, context, res->Data.Irq.Interrupts, - res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, - res->Data.Irq.Polarity); - break; - case ACPI_RESOURCE_TYPE_DMA: - /* - * from 1.0b 6.4.3 - * "This structure is repeated for each separate dma channel - * required" - */ - set->set_drq(dev, context, res->Data.Dma.Channels, - res->Data.Dma.ChannelCount); - break; - case ACPI_RESOURCE_TYPE_START_DEPENDENT: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n")); - set->set_start_dependent(dev, context, - res->Data.StartDpf.CompatibilityPriority); - break; - case ACPI_RESOURCE_TYPE_END_DEPENDENT: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n")); - set->set_end_dependent(dev, context); - break; - case ACPI_RESOURCE_TYPE_ADDRESS32: - if (res->Data.Address32.AddressLength <= 0) - break; - if (res->Data.Address32.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address32 %s producer\n", - res->Data.Address32.ResourceType == ACPI_IO_RANGE ? - "IO" : "Memory")); - break; - } - if (res->Data.Address32.ResourceType != ACPI_MEMORY_RANGE && - res->Data.Address32.ResourceType != ACPI_IO_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address32 for non-memory, non-I/O\n")); - break; - } - - if (res->Data.Address32.MinAddressFixed == ACPI_ADDRESS_FIXED && - res->Data.Address32.MaxAddressFixed == ACPI_ADDRESS_FIXED) { - - if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/Memory 0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength)); - set->set_memory(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/IO 0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength)); - set->set_ioport(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength); - } - } else { - if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/Memory 0x%x-0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength, - res->Data.Address32.Granularity); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/IO 0x%x-0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength)); - set->set_iorange(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength, - res->Data.Address32.Granularity); - } - } - break; - case ACPI_RESOURCE_TYPE_ADDRESS16: - if (res->Data.Address16.AddressLength <= 0) - break; - if (res->Data.Address16.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address16 %s producer\n", - res->Data.Address16.ResourceType == ACPI_IO_RANGE ? - "IO" : "Memory")); - break; - } - if (res->Data.Address16.ResourceType != ACPI_MEMORY_RANGE && - res->Data.Address16.ResourceType != ACPI_IO_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address16 for non-memory, non-I/O\n")); - break; - } - - if (res->Data.Address16.MinAddressFixed == ACPI_ADDRESS_FIXED && - res->Data.Address16.MaxAddressFixed == ACPI_ADDRESS_FIXED) { - - if (res->Data.Address16.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/Memory 0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength)); - set->set_memory(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/IO 0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength)); - set->set_ioport(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength); - } - } else { - if (res->Data.Address16.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/Memory 0x%x-0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength, - res->Data.Address16.Granularity); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/IO 0x%x-0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength)); - set->set_iorange(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength, - res->Data.Address16.Granularity); - } - } - break; - case ACPI_RESOURCE_TYPE_ADDRESS64: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "unimplemented Address64 resource\n")); - break; - case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored ExtIRQ producer\n")); - break; - } - set->set_ext_irq(dev, context, res->Data.ExtendedIrq.Interrupts, - res->Data.ExtendedIrq.InterruptCount, - res->Data.ExtendedIrq.Triggering, - res->Data.ExtendedIrq.Polarity); - break; - case ACPI_RESOURCE_TYPE_VENDOR: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "unimplemented VendorSpecific resource\n")); - break; - default: - break; - } - } - - AcpiOsFree(buf.Pointer); - set->set_done(dev, context); + set->set_done(dev, arc.context); return_ACPI_STATUS (AE_OK); } @@ -475,20 +421,20 @@ acpi_parse_resources(device_t dev, ACPI_ static void acpi_res_set_init(device_t dev, void *arg, void **context); static void acpi_res_set_done(device_t dev, void *context); static void acpi_res_set_ioport(device_t dev, void *context, - u_int32_t base, u_int32_t length); + uint64_t base, uint64_t length); static void acpi_res_set_iorange(device_t dev, void *context, - u_int32_t low, u_int32_t high, - u_int32_t length, u_int32_t align); + uint64_t low, uint64_t high, + uint64_t length, uint64_t align); static void acpi_res_set_memory(device_t dev, void *context, - u_int32_t base, u_int32_t length); + uint64_t base, uint64_t length); static void acpi_res_set_memoryrange(device_t dev, void *context, - u_int32_t low, u_int32_t high, - u_int32_t length, u_int32_t align); -static void acpi_res_set_irq(device_t dev, void *context, u_int8_t *irq, + uint64_t low, uint64_t high, + uint64_t length, uint64_t align); +static void acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol); static void acpi_res_set_ext_irq(device_t dev, void *context, - u_int32_t *irq, int count, int trig, int pol); -static void acpi_res_set_drq(device_t dev, void *context, u_int8_t *drq, + uint32_t *irq, int count, int trig, int pol); +static void acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count); static void acpi_res_set_start_dependent(device_t dev, void *context, int preference); @@ -539,8 +485,8 @@ acpi_res_set_done(device_t dev, void *co } static void -acpi_res_set_ioport(device_t dev, void *context, u_int32_t base, - u_int32_t length) +acpi_res_set_ioport(device_t dev, void *context, uint64_t base, + uint64_t length) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -550,8 +496,8 @@ acpi_res_set_ioport(device_t dev, void * } static void -acpi_res_set_iorange(device_t dev, void *context, u_int32_t low, - u_int32_t high, u_int32_t length, u_int32_t align) +acpi_res_set_iorange(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -561,8 +507,8 @@ acpi_res_set_iorange(device_t dev, void } static void -acpi_res_set_memory(device_t dev, void *context, u_int32_t base, - u_int32_t length) +acpi_res_set_memory(device_t dev, void *context, uint64_t base, + uint64_t length) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -573,8 +519,8 @@ acpi_res_set_memory(device_t dev, void * } static void -acpi_res_set_memoryrange(device_t dev, void *context, u_int32_t low, - u_int32_t high, u_int32_t length, u_int32_t align) +acpi_res_set_memoryrange(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -584,7 +530,7 @@ acpi_res_set_memoryrange(device_t dev, v } static void -acpi_res_set_irq(device_t dev, void *context, u_int8_t *irq, int count, +acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -600,7 +546,7 @@ acpi_res_set_irq(device_t dev, void *con } static void -acpi_res_set_ext_irq(device_t dev, void *context, u_int32_t *irq, int count, +acpi_res_set_ext_irq(device_t dev, void *context, uint32_t *irq, int count, int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -616,7 +562,7 @@ acpi_res_set_ext_irq(device_t dev, void } static void -acpi_res_set_drq(device_t dev, void *context, u_int8_t *drq, int count) +acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count) { struct acpi_res_context *cp = (struct acpi_res_context *)context; Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Tue Jun 21 19:15:23 2011 (r223369) +++ head/sys/dev/acpica/acpivar.h Tue Jun 21 19:29:27 2011 (r223370) @@ -355,19 +355,19 @@ BOOLEAN acpi_MatchHid(ACPI_HANDLE h, co struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); void (*set_done)(device_t dev, void *context); - void (*set_ioport)(device_t dev, void *context, uint32_t base, - uint32_t length); - void (*set_iorange)(device_t dev, void *context, uint32_t low, - uint32_t high, uint32_t length, uint32_t align); - void (*set_memory)(device_t dev, void *context, uint32_t base, - uint32_t length); - void (*set_memoryrange)(device_t dev, void *context, uint32_t low, - uint32_t high, uint32_t length, uint32_t align); - void (*set_irq)(device_t dev, void *context, u_int8_t *irq, + void (*set_ioport)(device_t dev, void *context, uint64_t base, + uint64_t length); + void (*set_iorange)(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align); + void (*set_memory)(device_t dev, void *context, uint64_t base, + uint64_t length); + void (*set_memoryrange)(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align); + void (*set_irq)(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol); - void (*set_ext_irq)(device_t dev, void *context, u_int32_t *irq, + void (*set_ext_irq)(device_t dev, void *context, uint32_t *irq, int count, int trig, int pol); - void (*set_drq)(device_t dev, void *context, u_int8_t *drq, + void (*set_drq)(device_t dev, void *context, uint8_t *drq, int count); void (*set_start_dependent)(device_t dev, void *context, int preference); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 19:31:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0061D10656A9; Tue, 21 Jun 2011 19:31:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52E38FC14; Tue, 21 Jun 2011 19:31:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJVVei013695; Tue, 21 Jun 2011 19:31:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJVVI5013693; Tue, 21 Jun 2011 19:31:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106211931.p5LJVVI5013693@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 19:31: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: r223371 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 19:31:32 -0000 Author: jhb Date: Tue Jun 21 19:31:31 2011 New Revision: 223371 URL: http://svn.freebsd.org/changeset/base/223371 Log: Minor whitespace and style fixes. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jun 21 19:29:27 2011 (r223370) +++ head/sys/dev/pci/pci.c Tue Jun 21 19:31:31 2011 (r223371) @@ -297,7 +297,7 @@ static int pci_usb_takeover = 1; static int pci_usb_takeover = 0; #endif TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover); -SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN, +SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); @@ -2482,7 +2482,8 @@ pci_write_bar(device_t dev, struct pci_m pci_write_config(dev, pm->pm_reg + 4, base >> 32, 4); pm->pm_value = pci_read_config(dev, pm->pm_reg, 4); if (ln2range == 64) - pm->pm_value |= (pci_addr_t)pci_read_config(dev, pm->pm_reg + 4, 4) << 32; + pm->pm_value |= (pci_addr_t)pci_read_config(dev, + pm->pm_reg + 4, 4) << 32; } struct pci_map * @@ -2680,7 +2681,7 @@ pci_add_map(device_t bus, device_t dev, count = (pci_addr_t)1 << mapsize; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ - end = ~0ULL; + end = ~0ul; } else { start = base; end = base + count - 1; From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 19:34:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8329D106566C; Tue, 21 Jun 2011 19:34:57 +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 5A5FE8FC0C; Tue, 21 Jun 2011 19:34:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJYvoB013840; Tue, 21 Jun 2011 19:34:57 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJYvsP013837; Tue, 21 Jun 2011 19:34:57 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201106211934.p5LJYvsP013837@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 21 Jun 2011 19:34: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: r223372 - head/bin/realpath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 19:34:57 -0000 Author: ru Date: Tue Jun 21 19:34:57 2011 New Revision: 223372 URL: http://svn.freebsd.org/changeset/base/223372 Log: Make ``realpath'' behave like ``realpath .''. Modified: head/bin/realpath/realpath.1 head/bin/realpath/realpath.c Modified: head/bin/realpath/realpath.1 ============================================================================== --- head/bin/realpath/realpath.1 Tue Jun 21 19:31:31 2011 (r223371) +++ head/bin/realpath/realpath.1 Tue Jun 21 19:34:57 2011 (r223372) @@ -33,7 +33,7 @@ .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp .\" $FreeBSD$ .\" -.Dd November 24, 2000 +.Dd June 21, 2011 .Dt REALPATH 1 .Os .Sh NAME @@ -42,8 +42,7 @@ .Sh SYNOPSIS .Nm .Op Fl q -.Ar path -.Op Ar ... +.Op Ar path ... .Sh DESCRIPTION The .Nm @@ -57,6 +56,11 @@ and .Pa /../ in .Ar path . +If +.Ar path +is absent, the current working directory +.Pq Sq Pa .\& +is assumed. .Pp If .Fl q Modified: head/bin/realpath/realpath.c ============================================================================== --- head/bin/realpath/realpath.c Tue Jun 21 19:31:31 2011 (r223371) +++ head/bin/realpath/realpath.c Tue Jun 21 19:34:57 2011 (r223372) @@ -44,7 +44,8 @@ main(int argc, char *argv[]) { char buf[PATH_MAX]; char *p; - int ch, i, qflag, rval; + const char *path; + int ch, qflag, rval; qflag = 0; while ((ch = getopt(argc, argv, "q")) != -1) { @@ -59,17 +60,16 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 1) - usage(); + path = *argv != NULL ? *argv++ : "."; rval = 0; - for (i = 0; i < argc; i++) { - if ((p = realpath(argv[i], buf)) == NULL) { + do { + if ((p = realpath(path, buf)) == NULL) { if (!qflag) - warn("%s", argv[i]); + warn("%s", path); rval = 1; } else (void)printf("%s\n", p); - } + } while ((path = *argv++) != NULL); exit(rval); } @@ -77,6 +77,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: realpath [-q] path [...]\n"); + (void)fprintf(stderr, "usage: realpath [-q] [path ...]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 19:58:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2042D106568A; Tue, 21 Jun 2011 19:58:30 +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 108F98FC1B; Tue, 21 Jun 2011 19:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJwTLZ014585; Tue, 21 Jun 2011 19:58:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJwTlM014583; Tue, 21 Jun 2011 19:58:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106211958.p5LJwTlM014583@svn.freebsd.org> From: Rick Macklem Date: Tue, 21 Jun 2011 19:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223373 - head/sys/fs/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: Tue, 21 Jun 2011 19:58:30 -0000 Author: rmacklem Date: Tue Jun 21 19:58:29 2011 New Revision: 223373 URL: http://svn.freebsd.org/changeset/base/223373 Log: Fix the new NFSv4 server so that it checks for VREAD_ACL when a client does a Getattr for an ACL and not VREAD_ATTRIBUTES. This was found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 19:34:57 2011 (r223372) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 19:58:29 2011 (r223373) @@ -172,11 +172,12 @@ nfsrvd_getattr(struct nfsrv_descript *nd fhandle_t fh; int at_root = 0, error = 0, supports_nfsv4acls; struct nfsreferral *refp; - nfsattrbit_t attrbits; + nfsattrbit_t attrbits, tmpbits; struct mount *mp; struct vnode *tvp = NULL; struct vattr va; uint64_t mounted_on_fileno = 0; + accmode_t accmode; if (nd->nd_repstat) return (0); @@ -197,11 +198,20 @@ nfsrvd_getattr(struct nfsrv_descript *nd vput(vp); return (0); } - if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, - VREAD_ATTRIBUTES, - nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, - NFSACCCHK_VPISLOCKED, NULL); + if (nd->nd_repstat == 0) { + accmode = 0; + NFSSET_ATTRBIT(&tmpbits, &attrbits); + if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_ACL)) { + NFSCLRBIT_ATTRBIT(&tmpbits, NFSATTRBIT_ACL); + accmode |= VREAD_ACL; + } + if (NFSNONZERO_ATTRBIT(&tmpbits)) + accmode |= VREAD_ATTRIBUTES; + if (accmode != 0) + nd->nd_repstat = nfsvno_accchk(vp, accmode, + nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, + NFSACCCHK_VPISLOCKED, NULL); + } } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:28:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B40F11065690; Tue, 21 Jun 2011 20:28:04 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 549D38FC12; Tue, 21 Jun 2011 20:28:04 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 287A4359388; Tue, 21 Jun 2011 22:28:03 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 1F01F17443; Tue, 21 Jun 2011 22:28:03 +0200 (CEST) Date: Tue, 21 Jun 2011 22:28:03 +0200 From: Jilles Tjoelker To: Ruslan Ermilov Message-ID: <20110621202802.GA28834@stack.nl> References: <201106211934.p5LJYvsP013837@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106211934.p5LJYvsP013837@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223372 - head/bin/realpath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:28:04 -0000 On Tue, Jun 21, 2011 at 07:34:57PM +0000, Ruslan Ermilov wrote: > Author: ru > Date: Tue Jun 21 19:34:57 2011 > New Revision: 223372 > URL: http://svn.freebsd.org/changeset/base/223372 > Log: > Make ``realpath'' behave like ``realpath .''. Is this being added for compatibility with something? If not, why do we need this non-standard extension if the shorter and standard pwd -P already fulfills this function? -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:30:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F388B10656ED; Tue, 21 Jun 2011 20:30:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9408FC16; Tue, 21 Jun 2011 20:30:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E64A625D386D; Tue, 21 Jun 2011 20:30:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3280515A2310; Tue, 21 Jun 2011 20:30:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id e5Yt7OjTz20U; Tue, 21 Jun 2011 20:30:40 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 435A715A230E; Tue, 21 Jun 2011 20:30:40 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106191913.p5JJDOqJ006272@svn.freebsd.org> Date: Tue, 21 Jun 2011 20:30:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> To: Alan Cox X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:30:46 -0000 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: Hi Alan, > Author: alc > Date: Sun Jun 19 19:13:24 2011 > New Revision: 223307 > URL: http://svn.freebsd.org/changeset/base/223307 >=20 > Log: > Precisely document the synchronization rules for the page's dirty = field. > (Saying that the lock on the object that the page belongs to must be = held > only represents one aspect of the rules.) >=20 > Eliminate the use of the page queues lock for atomically performing = read- > modify-write operations on the dirty field when the underlying = architecture > supports atomic operations on char and short types. >=20 > Document the fact that 32KB pages aren't really supported. >=20 contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. Could = you please check and see if you can fix it? The errors I get are: vm_page.o: In function `vm_page_clear_dirty': /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 = against `atomic_clear_8' vm_page.o: In function `vm_page_set_validclean': /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 = against `atomic_clear_8' Thanks a lot! /bz > Reviewed by: attilio, kib >=20 > Modified: > head/sys/vm/vm_fault.c > head/sys/vm/vm_page.c > head/sys/vm/vm_page.h >=20 > Modified: head/sys/vm/vm_fault.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/vm/vm_fault.c Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 = (r223307) > @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,=20 > * caller's changes may go unnoticed because = they are > * performed through an unmanaged mapping or by = a DMA > * operation. > + * > + * The object lock is not held here. Therefore, = like > + * a pmap operation, the page queues lock may be > + * required in order to call vm_page_dirty(). = See > + * vm_page_clear_dirty_mask(). > */ > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + defined(__mips__) > + vm_page_dirty(*mp); > +#else > vm_page_lock_queues(); > vm_page_dirty(*mp); > vm_page_unlock_queues(); > +#endif > } > } > if (pmap_failed) { >=20 > Modified: head/sys/vm/vm_page.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/vm/vm_page.c Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 = (r223307) > @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m > /* > * vm_page_dirty: > * > - * make page all dirty > + * Set all bits in the page's dirty field. > + * > + * The object containing the specified page must be locked if the = call is > + * made from the machine-independent layer. If, however, the call = is > + * made from the pmap layer, then the page queues lock may be = required. > + * See vm_page_clear_dirty_mask(). > */ > void > vm_page_dirty(vm_page_t m) > @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in > /* > * If the object is locked and the page is neither VPO_BUSY nor > * PG_WRITEABLE, then the page's dirty field cannot possibly be > - * modified by a concurrent pmap operation.=20 > + * set by a concurrent pmap operation.=20 > */ > VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); > if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRITEABLE) = =3D=3D 0) > m->dirty &=3D ~pagebits; > else { > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + defined(__mips__) > + /* > + * On the aforementioned architectures, the page queues = lock > + * is not required by the following read-modify-write > + * operation. The combination of the object's lock and = an > + * atomic operation suffice. Moreover, the pmap layer = on > + * these architectures can call vm_page_dirty() without > + * holding the page queues lock. > + */ > +#if PAGE_SIZE =3D=3D 4096 > + atomic_clear_char(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 8192 > + atomic_clear_short(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 16384 > + atomic_clear_int(&m->dirty, pagebits); > +#else > +#error "PAGE_SIZE is not supported." > +#endif > +#else > + /* > + * Otherwise, the page queues lock is required to ensure = that > + * a concurrent pmap operation does not set the page's = dirty > + * field during the following read-modify-write = operation. > + */ > vm_page_lock_queues(); > m->dirty &=3D ~pagebits; > vm_page_unlock_queues(); > +#endif > } > } >=20 >=20 > Modified: head/sys/vm/vm_page.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/vm/vm_page.h Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 = (r223307) > @@ -89,10 +89,26 @@ > * and offset to which this page belongs (for pageout), > * and sundry status bits. > * > - * Fields in this structure are locked either by the lock on the > - * object that the page belongs to (O), its corresponding page lock = (P), > - * or by the lock on the page queues (Q). > - *=09 > + * In general, operations on this structure's mutable fields are > + * synchronized using either one of or a combination of the lock on = the > + * object that the page belongs to (O), the pool lock for the page = (P), > + * or the lock for either the free or paging queues (Q). If a = field is > + * annotated below with two of these locks, then holding either = lock is > + * sufficient for read access, but both locks are required for = write=20 > + * access. > + * > + * In contrast, the synchronization of accesses to the page's dirty = field > + * is machine dependent (M). In the machine-independent layer, the = lock > + * on the object that the page belongs to must be held in order to > + * operate on the field. However, the pmap layer is permitted to = set > + * all bits within the field without holding that lock. Therefore, = if > + * the underlying architecture does not support atomic = read-modify-write > + * operations on the field's type, then the machine-independent = layer > + * must also hold the page queues lock when performing = read-modify-write > + * operations and the pmap layer must hold the page queues lock = when > + * setting the field. In the machine-independent layer, the > + * implementation of read-modify-write operations on the field is > + * encapsulated in vm_page_clear_dirty_mask(). > */ >=20 > TAILQ_HEAD(pglist, vm_page); > @@ -120,18 +136,19 @@ struct vm_page { > u_char busy; /* page busy count (O) */ > /* NOTE that these must support one bit per DEV_BSIZE in a = page!!! */ > /* so, on normal X86 kernels, they must be at least 8 bits wide = */ > + /* In reality, support for 32KB pages is not fully implemented. = */ > #if PAGE_SIZE =3D=3D 4096 > u_char valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_char dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_char dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 8192 > u_short valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_short dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_short dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 16384 > u_int valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_int dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_int dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 32768 > u_long valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_long dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_long dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #endif > }; >=20 --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:33:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4C910656F8; Tue, 21 Jun 2011 20:33:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CE4D8FC12; Tue, 21 Jun 2011 20:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKXt9U015729; Tue, 21 Jun 2011 20:33:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKXtng015727; Tue, 21 Jun 2011 20:33:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212033.p5LKXtng015727@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:33: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: r223374 - head/usr.bin/finger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:33:55 -0000 Author: delphij Date: Tue Jun 21 20:33:55 2011 New Revision: 223374 URL: http://svn.freebsd.org/changeset/base/223374 Log: Staticify cleanup() which is not referenced in other places. MFC after: 2 weeks Modified: head/usr.bin/finger/net.c Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Tue Jun 21 19:58:29 2011 (r223373) +++ head/usr.bin/finger/net.c Tue Jun 21 20:33:55 2011 (r223374) @@ -226,7 +226,7 @@ trying(const struct addrinfo *ai) printf("Trying %s...\n", buf); } -void +static void cleanup(int sig __unused) { #define ERRSTR "Timed out.\n" From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:36:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2516B10656D6; Tue, 21 Jun 2011 20:36:11 +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 15D738FC19; Tue, 21 Jun 2011 20:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKaA4b015827; Tue, 21 Jun 2011 20:36:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKaAeF015824; Tue, 21 Jun 2011 20:36:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212036.p5LKaAeF015824@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:36: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: r223375 - head/usr.bin/lastcomm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:36:11 -0000 Author: delphij Date: Tue Jun 21 20:36:10 2011 New Revision: 223375 URL: http://svn.freebsd.org/changeset/base/223375 Log: Remove unneeded headers. MFC after: 2 weeks Modified: head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/readrec.c Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Tue Jun 21 20:33:55 2011 (r223374) +++ head/usr.bin/lastcomm/lastcomm.c Tue Jun 21 20:36:10 2011 (r223375) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include Modified: head/usr.bin/lastcomm/readrec.c ============================================================================== --- head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:33:55 2011 (r223374) +++ head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:36:10 2011 (r223375) @@ -33,13 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include #include #include -#include #include int readrec_forward(FILE *f, struct acctv2 *av2); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:44:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24B5D10656A8; Tue, 21 Jun 2011 20:44:07 +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 1548F8FC14; Tue, 21 Jun 2011 20:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKi6vW016091; Tue, 21 Jun 2011 20:44:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKi6ep016088; Tue, 21 Jun 2011 20:44:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212044.p5LKi6ep016088@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:44: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: r223376 - head/usr.bin/cmp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:44:07 -0000 Author: delphij Date: Tue Jun 21 20:44:06 2011 New Revision: 223376 URL: http://svn.freebsd.org/changeset/base/223376 Log: Eliminate unneeded headers. Modified: head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Tue Jun 21 20:36:10 2011 (r223375) +++ head/usr.bin/cmp/regular.c Tue Jun 21 20:44:06 2011 (r223376) @@ -41,12 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include "extern.h" Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Tue Jun 21 20:36:10 2011 (r223375) +++ head/usr.bin/cmp/special.c Tue Jun 21 20:44:06 2011 (r223376) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "extern.h" From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:44:35 2011 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 CE02F1065689; Tue, 21 Jun 2011 20:44:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 21 Jun 2011 16:44:18 -0400 User-Agent: KMail/1.6.2 References: <201106211929.p5LJTRA5013589@svn.freebsd.org> In-Reply-To: <201106211929.p5LJTRA5013589@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_lKQAOuKuA7Ph73B" Message-Id: <201106211644.21026.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r223370 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:44:35 -0000 --Boundary-00=_lKQAOuKuA7Ph73B Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 21 June 2011 03:29 pm, John Baldwin wrote: > Author: jhb > Date: Tue Jun 21 19:29:27 2011 > New Revision: 223370 > URL: http://svn.freebsd.org/changeset/base/223370 > > Log: > Use AcpiWalkResources() to parse the resource list from _CRS > rather than using a home-rolled loop. While here, add support for > 64-bit address range resources. This broke build with ACPI_DEBUG. The attached patch should fix it. > Silence on: acpi@ (older version) Sorry, I am quite busy at $work recently. :-( Jung-uk Kim --Boundary-00=_lKQAOuKuA7Ph73B Content-Type: text/plain; charset="iso-8859-1"; name="acpi_resource.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="acpi_resource.diff" Index: sys/dev/acpica/acpi_resource.c =================================================================== --- sys/dev/acpica/acpi_resource.c (revision 223372) +++ sys/dev/acpica/acpi_resource.c (working copy) @@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *cont if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", - name, min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)length)); set->set_memory(dev, arc->context, min, length); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, - min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name, + (uintmax_t)min, (uintmax_t)length)); set->set_ioport(dev, arc->context, min, length); } } else { if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, + (uintmax_t)max, (uintmax_t)length)); set->set_memoryrange(dev, arc->context, min, max, length, gran); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length)); set->set_iorange(dev, arc->context, min, max, length, gran); } } --Boundary-00=_lKQAOuKuA7Ph73B-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:47:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32978106572F; Tue, 21 Jun 2011 20:47:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22A878FC29; Tue, 21 Jun 2011 20:47:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKl4eb016224; Tue, 21 Jun 2011 20:47:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKl4jK016221; Tue, 21 Jun 2011 20:47:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212047.p5LKl4jK016221@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:47: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: r223377 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:47:04 -0000 Author: marius Date: Tue Jun 21 20:47:03 2011 New Revision: 223377 URL: http://svn.freebsd.org/changeset/base/223377 Log: On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space increase the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:44:06 2011 (r223376) +++ head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:47:03 2011 (r223377) @@ -384,11 +384,12 @@ pmap_bootstrap(u_int cpu_impl) * public documentation is available for these, the latter just might * not support it, yet. */ - virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) + cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) { tsb_kernel_ldd_phys = 1; - else { + virtsz = roundup(5 / 3 * physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); + } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { data = dtlb_get_data(i); @@ -401,6 +402,8 @@ pmap_bootstrap(u_int cpu_impl) if (cpu_impl >= CPU_IMPL_ULTRASPARCI && cpu_impl < CPU_IMPL_ULTRASPARCIII) dtlb_slots_avail /= 2; + virtsz = roundup(physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:48:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD151065696; Tue, 21 Jun 2011 20:48:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5858FC21; Tue, 21 Jun 2011 20:48:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKmEMR016293; Tue, 21 Jun 2011 20:48:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKmE3h016290; Tue, 21 Jun 2011 20:48:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212048.p5LKmE3h016290@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:48: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: r223378 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:48:14 -0000 Author: marius Date: Tue Jun 21 20:48:14 2011 New Revision: 223378 URL: http://svn.freebsd.org/changeset/base/223378 Log: On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Modified: head/sys/sparc64/include/tsb.h head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/tsb.h ============================================================================== --- head/sys/sparc64/include/tsb.h Tue Jun 21 20:47:03 2011 (r223377) +++ head/sys/sparc64/include/tsb.h Tue Jun 21 20:48:14 2011 (r223378) @@ -50,7 +50,6 @@ extern struct tte *tsb_kernel; extern vm_size_t tsb_kernel_mask; extern vm_size_t tsb_kernel_size; extern vm_paddr_t tsb_kernel_phys; -extern u_int tsb_kernel_ldd_phys; static __inline struct tte * tsb_vpntobucket(pmap_t pm, vm_offset_t vpn) Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Jun 21 20:47:03 2011 (r223377) +++ head/sys/sparc64/include/vmparam.h Tue Jun 21 20:48:14 2011 (r223378) @@ -218,7 +218,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) #endif /* @@ -238,6 +238,7 @@ #define UMA_MD_SMALL_ALLOC +extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:50:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92AD1065689; Tue, 21 Jun 2011 20:50:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B99868FC1F; Tue, 21 Jun 2011 20:50:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKotR5016411; Tue, 21 Jun 2011 20:50:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKot08016409; Tue, 21 Jun 2011 20:50:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212050.p5LKot08016409@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:50: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: r223379 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:50:55 -0000 Author: marius Date: Tue Jun 21 20:50:55 2011 New Revision: 223379 URL: http://svn.freebsd.org/changeset/base/223379 Log: Fix whitespace Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Jun 21 20:48:14 2011 (r223378) +++ head/sys/sparc64/include/vmparam.h Tue Jun 21 20:50:55 2011 (r223379) @@ -70,7 +70,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -136,13 +136,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:51:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03D2A1065692; Tue, 21 Jun 2011 20:51:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E89A78FC0C; Tue, 21 Jun 2011 20:51:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKp9A0016462; Tue, 21 Jun 2011 20:51:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKp9xX016460; Tue, 21 Jun 2011 20:51:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212051.p5LKp9xX016460@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 20:51: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: r223380 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:51:10 -0000 Author: imp Date: Tue Jun 21 20:51:09 2011 New Revision: 223380 URL: http://svn.freebsd.org/changeset/base/223380 Log: Supress warning that command didn't complete when the parent bus thinks the card is gone. Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 20:50:55 2011 (r223379) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 20:51:09 2011 (r223380) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. + * to make it a function. Spress warning when card gone. */ static void xl_wait(struct xl_softc *sc) @@ -346,7 +346,7 @@ xl_wait(struct xl_softc *sc) break; } - if (i == XL_TIMEOUT) + if (i == XL_TIMEOUT && bus_child_present(sc->xl_dev)) device_printf(sc->xl_dev, "command never completed!\n"); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:52:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9225510656D8; Tue, 21 Jun 2011 20:52:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82E4A8FC1E; Tue, 21 Jun 2011 20:52:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LKqtGB016553; Tue, 21 Jun 2011 20:52:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKqtEF016551; Tue, 21 Jun 2011 20:52:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212052.p5LKqtEF016551@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 20:52: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: r223381 - head/sys/dev/dc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:52:55 -0000 Author: imp Date: Tue Jun 21 20:52:55 2011 New Revision: 223381 URL: http://svn.freebsd.org/changeset/base/223381 Log: Supress command completion failure warning when the card isn't present. Only call the bus to check if we actually do timeout so we don't affect the normal case (since this case needn't be optimized and this guards against all races). Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Tue Jun 21 20:51:09 2011 (r223380) +++ head/sys/dev/dc/if_dc.c Tue Jun 21 20:52:55 2011 (r223381) @@ -1385,7 +1385,7 @@ dc_netcfg_wait(struct dc_softc *sc) break; DELAY(10); } - if (i == DC_TIMEOUT) { + if (i == DC_TIMEOUT && bus_child_present(sc->dc_dev)) { if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc)) device_printf(sc->dc_dev, "%s: failed to force tx to idle state\n", __func__); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:54:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F7E106566C; Tue, 21 Jun 2011 20:54:26 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id DF4468FC1F; Tue, 21 Jun 2011 20:54:25 +0000 (UTC) Received: by yic13 with SMTP id 13so98629yic.13 for ; Tue, 21 Jun 2011 13:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+CEzp/x7ZaBWGZ09K2qD+B8vr5VFEcAT4e3qVHSuhmA=; b=rQeVwbZg3Bukvu599oVHHm1FhtL+lxboJEHoN9W6wiU4B4+f5huzF1A9KCJP4EFe+l +vKwnecT5uLmU7ZKPucID15fgKYn1bhhB/oZtzJ4qn4xmbX9/i3M54H2ud/KbJreheEM UvaJDUHYFveruKZQy7kRp88aclbKyChh3wvUM= 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=lUrE6iLPbL3K2v6Ws5a/SJbuGHe9iFVSENsJzqjMxtOEu6IufHotE1F0gALz5aSRtj KFIblNJHabNgfmyYIDM4/9LhCr2C+kOgKYYEoSv8YfAbusqkJ4b6SFaY8jOJAQpwmRI+ AomNs+E31yO6xSeZRusnDQgpHUxbLNhXtKiq0= MIME-Version: 1.0 Received: by 10.236.153.34 with SMTP id e22mr6434574yhk.31.1308689665040; Tue, 21 Jun 2011 13:54:25 -0700 (PDT) Received: by 10.236.108.1 with HTTP; Tue, 21 Jun 2011 13:54:24 -0700 (PDT) In-Reply-To: <201106212051.p5LKp9xX016460@svn.freebsd.org> References: <201106212051.p5LKp9xX016460@svn.freebsd.org> Date: Tue, 21 Jun 2011 16:54:24 -0400 Message-ID: From: Ben Kaduk To: Warner Losh 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: r223380 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 20:54:26 -0000 On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh wrote: > Author: imp > Date: Tue Jun 21 20:51:09 2011 > New Revision: 223380 > URL: http://svn.freebsd.org/changeset/base/223380 > > --- head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:50:55 2011 =A0 =A0 =A0 = =A0(r223379) > +++ head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:51:09 2011 =A0 =A0 =A0 = =A0(r223380) > @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme > =A0* only a finite amount of time to avoid getting caught in an > =A0* infinite loop. Normally this delay routine would be a macro, > =A0* but it isn't called during normal operation so we can afford > - * to make it a function. > + * to make it a function. =A0Spress warning when card gone. ^^^u -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 20:58:15 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A6B10656B2; Tue, 21 Jun 2011 20:58:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6198FC08; Tue, 21 Jun 2011 20:58:14 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LKwBT2009775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 06:58:12 +1000 Date: Wed, 22 Jun 2011 06:58:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" In-Reply-To: Message-ID: <20110622063258.D2275@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 20:58:15 -0000 On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > Hi Alan, > >> Author: alc >> Date: Sun Jun 19 19:13:24 2011 >> New Revision: 223307 >> URL: http://svn.freebsd.org/changeset/base/223307 >> >> Log: >> Precisely document the synchronization rules for the page's dirty field. >> (Saying that the lock on the object that the page belongs to must be held >> only represents one aspect of the rules.) >> >> Eliminate the use of the page queues lock for atomically performing read- >> modify-write operations on the dirty field when the underlying architecture >> supports atomic operations on char and short types. >> >> Document the fact that 32KB pages aren't really supported. > > contrary to the tinderbox I'd like to point out that all mips kernels built by universe are broken with a SVN HEAD from earlier today. Could you please check and see if you can fix it? The errors I get are: > > vm_page.o: In function `vm_page_clear_dirty': > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > vm_page.o: In function `vm_page_set_validclean': > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' Atomic types shorter than int cannot be used in MI code, since they might not exist. Apparently they don't exist on mips. jake@ fixed all their old uses for sparc4 in ~Y2K. >> Modified: head/sys/vm/vm_fault.c >> ============================================================================== >> --- head/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 (r223307) >> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, >> * caller's changes may go unnoticed because they are >> * performed through an unmanaged mapping or by a DMA >> * operation. >> + * >> + * The object lock is not held here. Therefore, like >> + * a pmap operation, the page queues lock may be >> + * required in order to call vm_page_dirty(). See >> + * vm_page_clear_dirty_mask(). >> */ >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ >> + defined(__mips__) >> + vm_page_dirty(*mp); >> +#else >> vm_page_lock_queues(); >> vm_page_dirty(*mp); >> vm_page_unlock_queues(); >> +#endif Apparently, it used to work by using a global lock, so it didn't need to use atomic ops that don't exist because the data sizes are too small. >> Modified: head/sys/vm/vm_page.c >> ============================================================================== >> --- head/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 (r223307) >> ... >> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in >> /* >> * If the object is locked and the page is neither VPO_BUSY nor >> * PG_WRITEABLE, then the page's dirty field cannot possibly be >> - * modified by a concurrent pmap operation. >> + * set by a concurrent pmap operation. >> */ >> VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); >> if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) >> m->dirty &= ~pagebits; >> else { >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ >> + defined(__mips__) >> + /* >> + * On the aforementioned architectures, the page queues lock >> + * is not required by the following read-modify-write >> + * operation. The combination of the object's lock and an >> + * atomic operation suffice. Moreover, the pmap layer on >> + * these architectures can call vm_page_dirty() without >> + * holding the page queues lock. >> + */ >> +#if PAGE_SIZE == 4096 >> + atomic_clear_char(&m->dirty, pagebits); Cannot do that in MI code, though it might work accidentally because all archies with PAGE_SIZE == 4096 might support it. >> +#elif PAGE_SIZE == 8192 >> + atomic_clear_short(&m->dirty, pagebits); Cannot do that... >> +#elif PAGE_SIZE == 16384 >> + atomic_clear_int(&m->dirty, pagebits); >> +#else >> +#error "PAGE_SIZE is not supported." >> +#endif >> +#else >> + /* >> + * Otherwise, the page queues lock is required to ensure that >> + * a concurrent pmap operation does not set the page's dirty >> + * field during the following read-modify-write operation. >> + */ >> vm_page_lock_queues(); >> m->dirty &= ~pagebits; >> vm_page_unlock_queues(); >> +#endif >> } >> } >> >> >> Modified: head/sys/vm/vm_page.h >> ============================================================================== >> --- head/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 (r223307) >> @@ -120,18 +136,19 @@ struct vm_page { >> u_char busy; /* page busy count (O) */ >> /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ >> /* so, on normal X86 kernels, they must be at least 8 bits wide */ >> + /* In reality, support for 32KB pages is not fully implemented. */ >> #if PAGE_SIZE == 4096 >> u_char valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */ A small size may be good for space efficiency, but the struct is not very well packed, so perhaps the size can be increased without further loss. Must be >= 8 bits, and u_char guarantees this. u_char might be larger than 8 bits anyway, but POSIX requires 8-bit chars. >> #elif PAGE_SIZE == 8192 >> u_short valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 16 bits. I'm not sure if POSIX requires exactly 16. >> #elif PAGE_SIZE == 16384 >> u_int valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 32 bits. POSIX requires >= 32, but C doesn't. I'm not sure if POSIX requires exactly 16. >> #elif PAGE_SIZE == 32768 >> u_long valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 64 bits. u_long certainly doesn't guarantees this, but does in practice on all arches that support this page size, since no arches support this page size :-). Should use uintN_t for this if not the others. uintN_t is more clearly unportable. It only exists for all the usual N because arches are not very variant, and then even then only for non-atomic ops. >> #endif >> }; Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 21:07:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E2D1065672; Tue, 21 Jun 2011 21:07:33 +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 4E8318FC13; Tue, 21 Jun 2011 21:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LL7XI9017054; Tue, 21 Jun 2011 21:07:33 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LL7X07017052; Tue, 21 Jun 2011 21:07:33 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106212107.p5LL7X07017052@svn.freebsd.org> From: Rick Macklem Date: Tue, 21 Jun 2011 21: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: r223382 - head/usr.sbin/nfsuserd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 21:07:33 -0000 Author: rmacklem Date: Tue Jun 21 21:07:33 2011 New Revision: 223382 URL: http://svn.freebsd.org/changeset/base/223382 Log: Change the NFSv4 nfsuserd(8) daemon so that it doesn't preload the uid<->username mapping cache with an entry when another entry for that uid is already loaded. This fixes a case where the mapping of "toor" would replace "root" when the daemon was started, resulting in no mapping for "root" until the cache entry for "toor" timed out. The algorithm is inefficient, but since it is only done once when the daemon is started up, I don't think that's an issue. MFC after: 2 weeks Modified: head/usr.sbin/nfsuserd/nfsuserd.c Modified: head/usr.sbin/nfsuserd/nfsuserd.c ============================================================================== --- head/usr.sbin/nfsuserd/nfsuserd.c Tue Jun 21 20:52:55 2011 (r223381) +++ head/usr.sbin/nfsuserd/nfsuserd.c Tue Jun 21 21:07:33 2011 (r223382) @@ -76,6 +76,8 @@ static bool_t xdr_retval(XDR *, caddr_t) #define MAXNAME 1024 #define MAXNFSUSERD 20 #define DEFNFSUSERD 4 +#define MAXUSERMAX 100000 +#define MINUSERMAX 10 #define DEFUSERMAX 200 #define DEFUSERTIMEOUT (1 * 60) struct info { @@ -96,8 +98,8 @@ pid_t slaves[MAXNFSUSERD]; int main(int argc, char *argv[]) { - int i; - int error, len, mustfreeai = 0; + int i, j; + int error, fnd_dup, len, mustfreeai = 0, start_uidpos; struct nfsd_idargs nid; struct passwd *pwd; struct group *grp; @@ -107,6 +109,7 @@ main(int argc, char *argv[]) sigset_t signew; char hostname[MAXHOSTNAMELEN + 1], *cp; struct addrinfo *aip, hints; + static uid_t check_dups[MAXUSERMAX]; if (modfind("nfscommon") < 0) { /* Not present in kernel, try loading it */ @@ -163,9 +166,10 @@ main(int argc, char *argv[]) argc--; argv++; i = atoi(*argv); - if (i < 10 || i > 100000) { + if (i < MINUSERMAX || i > MAXUSERMAX) { fprintf(stderr, - "usermax %d out of range 10<->100000\n", i); + "usermax %d out of range %d<->%d\n", i, + MINUSERMAX, MAXUSERMAX); usage(); } nid.nid_usermax = i; @@ -326,8 +330,25 @@ main(int argc, char *argv[]) /* * Loop around adding all users. */ + start_uidpos = i; setpwent(); while (i < nid.nid_usermax && (pwd = getpwent())) { + fnd_dup = 0; + /* + * Yes, this is inefficient, but it is only done once when + * the daemon is started and will run in a fraction of a second + * for nid_usermax at 10000. If nid_usermax is cranked up to + * 100000, it will take several seconds, depending on the CPU. + */ + for (j = 0; j < (i - start_uidpos); j++) + if (check_dups[j] == pwd->pw_uid) { + /* Found another entry for uid, so skip it */ + fnd_dup = 1; + break; + } + if (fnd_dup != 0) + continue; + check_dups[i - start_uidpos] = pwd->pw_uid; nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; nid.nid_namelen = strlen(pwd->pw_name); From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 21:09:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CE871065709; Tue, 21 Jun 2011 21:09:25 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id AA7DE8FC15; Tue, 21 Jun 2011 21:09:24 +0000 (UTC) Received: by yxl31 with SMTP id 31so107101yxl.13 for ; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0kcvhWknFn0WxyXfOUCTQ6nG5oMS47tgU93xI2Ph5nE=; b=GMdPhfYQBYgNyjTwE8Hw8A5HZ6er3SFC/qmV91eiEVoW19FDD8RpyWP2OHDB9vfFQp HCCbx74Xgaq05MH2xrcr2+JFLtXFqEeETh+yDxuL72ezO0/NQFhVNYBYGiYeTmlJYUbC Uv709I5uoGJCADH59S+jxtit4dtcj8RXV914g= 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=MZ55XIAtVn11UWMd1HeQuIML7LdJpoobExz8UOMPOpOpwtS+16jAbhLMyZk1QKY/nx pd6fK++cNqvQRaZtUexVKOTDmKbtOmyn27b+9yCGRQQrRvQJ1AgTSBDEJe/4GfHB7mTW RcKtweIXk7KBaI+PfpoNRXi9K8JObbggg/kdc= MIME-Version: 1.0 Received: by 10.236.111.20 with SMTP id v20mr11180680yhg.423.1308690563598; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) In-Reply-To: <20110622063258.D2275@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> Date: Tue, 21 Jun 2011 23:09:23 +0200 X-Google-Sender-Auth: zT2j_G6cUneQ3G84ny8EQ_6mKHc Message-ID: From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 21:09:25 -0000 2011/6/21 Bruce Evans : > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > >> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >> >> Hi Alan, >> >>> Author: alc >>> Date: Sun Jun 19 19:13:24 2011 >>> New Revision: 223307 >>> URL: http://svn.freebsd.org/changeset/base/223307 >>> >>> Log: >>> =C2=A0Precisely document the synchronization rules for the page's dirty= field. >>> =C2=A0(Saying that the lock on the object that the page belongs to must= be >>> held >>> =C2=A0only represents one aspect of the rules.) >>> >>> =C2=A0Eliminate the use of the page queues lock for atomically performi= ng >>> read- >>> =C2=A0modify-write operations on the dirty field when the underlying >>> architecture >>> =C2=A0supports atomic operations on char and short types. >>> >>> =C2=A0Document the fact that 32KB pages aren't really supported. >> >> contrary to the tinderbox I'd like to point out that all mips kernels >> built by universe are broken with a SVN HEAD from earlier today. =C2=A0C= ould you >> please check and see if you can fix it? =C2=A0The errors I get are: >> >> vm_page.o: In function `vm_page_clear_dirty': >> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8= ' >> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >> against `atomic_clear_8' >> vm_page.o: In function `vm_page_set_validclean': >> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8= ' >> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >> against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed a= ll their > old uses for sparc4 in ~Y2K. I'm sure they do, they exist in support.S though and may not have the _8 form (they may just have the _char version). I may look at the code again to be sure. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 21:14:30 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF4E1065680; Tue, 21 Jun 2011 21:14:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 30C1E8FC17; Tue, 21 Jun 2011 21:14:29 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LLEPvv019219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 07:14:28 +1000 Date: Wed, 22 Jun 2011 07:14:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ben Kaduk In-Reply-To: Message-ID: <20110622071154.H2398@besplex.bde.org> References: <201106212051.p5LKp9xX016460@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1948960399-1308690865=:2398" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh Subject: Re: svn commit: r223380 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 21:14:30 -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-1948960399-1308690865=:2398 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 21 Jun 2011, Ben Kaduk wrote: > On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh wrote: >> Author: imp >> Date: Tue Jun 21 20:51:09 2011 >> New Revision: 223380 >> URL: http://svn.freebsd.org/changeset/base/223380 >> >> --- head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:50:55 2011 =A0 =A0 =A0= =A0(r223379) >> +++ head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:51:09 2011 =A0 =A0 =A0= =A0(r223380) >> @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme >> =A0* only a finite amount of time to avoid getting caught in an >> =A0* infinite loop. Normally this delay routine would be a macro, >> =A0* but it isn't called during normal operation so we can afford >> - * to make it a function. >> + * to make it a function. =A0Spress warning when card gone. > ^^^u Still a srrising selling :-). Bruce --0-1948960399-1308690865=:2398-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 21:30:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64362106568B; Tue, 21 Jun 2011 21:30:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 547438FC14; Tue, 21 Jun 2011 21:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LLULaf017819; Tue, 21 Jun 2011 21:30:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LLULgS017817; Tue, 21 Jun 2011 21:30:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106212130.p5LLULgS017817@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 21:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223383 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 21:30:21 -0000 Author: jhb Date: Tue Jun 21 21:30:20 2011 New Revision: 223383 URL: http://svn.freebsd.org/changeset/base/223383 Log: Fix build with ACPI_DEBUG defined. Submitted by: jkim Pointy hat to: jhb Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:07:33 2011 (r223382) +++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:30:20 2011 (r223383) @@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", - name, min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)length)); set->set_memory(dev, arc->context, min, length); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, - min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name, + (uintmax_t)min, (uintmax_t)length)); set->set_ioport(dev, arc->context, min, length); } } else { if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, + (uintmax_t)max, (uintmax_t)length)); set->set_memoryrange(dev, arc->context, min, max, length, gran); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length)); set->set_iorange(dev, arc->context, min, max, length, gran); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 22:16:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC89310656EC; Tue, 21 Jun 2011 22:16:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D14E8FC19; Tue, 21 Jun 2011 22:16:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LMG40Y019255; Tue, 21 Jun 2011 22:16:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMG4wF019253; Tue, 21 Jun 2011 22:16:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212216.p5LMG4wF019253@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22:16: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: r223384 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 22:16:04 -0000 Author: imp Date: Tue Jun 21 22:16:04 2011 New Revision: 223384 URL: http://svn.freebsd.org/changeset/base/223384 Log: My broken 'u' key scks! Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 21:30:20 2011 (r223383) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011 (r223384) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. Spress warning when card gone. + * to make it a function. Supress warning when card gone. */ static void xl_wait(struct xl_softc *sc) From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 22:17:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B60DA106567B; Tue, 21 Jun 2011 22:17:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6C0D8FC15; Tue, 21 Jun 2011 22:17:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LMHS2w019342; Tue, 21 Jun 2011 22:17:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMHSL4019340; Tue, 21 Jun 2011 22:17:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212217.p5LMHSL4019340@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22:17: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: r223385 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 22:17:28 -0000 Author: imp Date: Tue Jun 21 22:17:28 2011 New Revision: 223385 URL: http://svn.freebsd.org/changeset/base/223385 Log: Really spell suppress the right way Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011 (r223384) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:17:28 2011 (r223385) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. Supress warning when card gone. + * to make it a function. Suppress warning when card gone. */ static void xl_wait(struct xl_softc *sc) From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 22:19:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84664106566B; Tue, 21 Jun 2011 22:19: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 176788FC1C; Tue, 21 Jun 2011 22:19:36 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5LMC1MQ082589 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 16:12:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 21 Jun 2011 16:11:52 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4A0467C1-258F-4D8D-91E0-9CD1795A49B6@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 16:12:03 -0600 (MDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 22:19:36 -0000 On Jun 21, 2011, at 2:30 PM, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >=20 > Hi Alan, >=20 >> Author: alc >> Date: Sun Jun 19 19:13:24 2011 >> New Revision: 223307 >> URL: http://svn.freebsd.org/changeset/base/223307 >>=20 >> Log: >> Precisely document the synchronization rules for the page's dirty = field. >> (Saying that the lock on the object that the page belongs to must be = held >> only represents one aspect of the rules.) >>=20 >> Eliminate the use of the page queues lock for atomically performing = read- >> modify-write operations on the dirty field when the underlying = architecture >> supports atomic operations on char and short types. >>=20 >> Document the fact that 32KB pages aren't really supported. >>=20 >=20 > contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. Could = you please check and see if you can fix it? The errors I get are: >=20 > vm_page.o: In function `vm_page_clear_dirty': > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 against `atomic_clear_8' > vm_page.o: In function `vm_page_set_validclean': > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 against `atomic_clear_8' atomic_clear_8???? I only see atomic_clear_int, which should be = atomic_clear_4 in the mips impl. Warner > Thanks a lot! > /bz >=20 >=20 >> Reviewed by: attilio, kib >>=20 >> Modified: >> head/sys/vm/vm_fault.c >> head/sys/vm/vm_page.c >> head/sys/vm/vm_page.h >>=20 >> Modified: head/sys/vm/vm_fault.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/vm/vm_fault.c Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,=20 >> * caller's changes may go unnoticed because = they are >> * performed through an unmanaged mapping or by = a DMA >> * operation. >> + * >> + * The object lock is not held here. Therefore, = like >> + * a pmap operation, the page queues lock may be >> + * required in order to call vm_page_dirty(). = See >> + * vm_page_clear_dirty_mask(). >> */ >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || = \ >> + defined(__mips__) >> + vm_page_dirty(*mp); >> +#else >> vm_page_lock_queues(); >> vm_page_dirty(*mp); >> vm_page_unlock_queues(); >> +#endif >> } >> } >> if (pmap_failed) { >>=20 >> Modified: head/sys/vm/vm_page.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/vm/vm_page.c Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m >> /* >> * vm_page_dirty: >> * >> - * make page all dirty >> + * Set all bits in the page's dirty field. >> + * >> + * The object containing the specified page must be locked if the = call is >> + * made from the machine-independent layer. If, however, the call = is >> + * made from the pmap layer, then the page queues lock may be = required. >> + * See vm_page_clear_dirty_mask(). >> */ >> void >> vm_page_dirty(vm_page_t m) >> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in >> /* >> * If the object is locked and the page is neither VPO_BUSY nor >> * PG_WRITEABLE, then the page's dirty field cannot possibly be >> - * modified by a concurrent pmap operation.=20 >> + * set by a concurrent pmap operation.=20 >> */ >> VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); >> if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRITEABLE) = =3D=3D 0) >> m->dirty &=3D ~pagebits; >> else { >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || = \ >> + defined(__mips__) >> + /* >> + * On the aforementioned architectures, the page queues = lock >> + * is not required by the following read-modify-write >> + * operation. The combination of the object's lock and = an >> + * atomic operation suffice. Moreover, the pmap layer = on >> + * these architectures can call vm_page_dirty() without >> + * holding the page queues lock. >> + */ >> +#if PAGE_SIZE =3D=3D 4096 >> + atomic_clear_char(&m->dirty, pagebits); >> +#elif PAGE_SIZE =3D=3D 8192 >> + atomic_clear_short(&m->dirty, pagebits); >> +#elif PAGE_SIZE =3D=3D 16384 >> + atomic_clear_int(&m->dirty, pagebits); >> +#else >> +#error "PAGE_SIZE is not supported." >> +#endif >> +#else >> + /* >> + * Otherwise, the page queues lock is required to ensure = that >> + * a concurrent pmap operation does not set the page's = dirty >> + * field during the following read-modify-write = operation. >> + */ >> vm_page_lock_queues(); >> m->dirty &=3D ~pagebits; >> vm_page_unlock_queues(); >> +#endif >> } >> } >>=20 >>=20 >> Modified: head/sys/vm/vm_page.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/vm/vm_page.h Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -89,10 +89,26 @@ >> * and offset to which this page belongs (for pageout), >> * and sundry status bits. >> * >> - * Fields in this structure are locked either by the lock on the >> - * object that the page belongs to (O), its corresponding page lock = (P), >> - * or by the lock on the page queues (Q). >> - *=09 >> + * In general, operations on this structure's mutable fields are >> + * synchronized using either one of or a combination of the lock on = the >> + * object that the page belongs to (O), the pool lock for the page = (P), >> + * or the lock for either the free or paging queues (Q). If a = field is >> + * annotated below with two of these locks, then holding either = lock is >> + * sufficient for read access, but both locks are required for = write=20 >> + * access. >> + * >> + * In contrast, the synchronization of accesses to the page's dirty = field >> + * is machine dependent (M). In the machine-independent layer, the = lock >> + * on the object that the page belongs to must be held in order to >> + * operate on the field. However, the pmap layer is permitted to = set >> + * all bits within the field without holding that lock. Therefore, = if >> + * the underlying architecture does not support atomic = read-modify-write >> + * operations on the field's type, then the machine-independent = layer >> + * must also hold the page queues lock when performing = read-modify-write >> + * operations and the pmap layer must hold the page queues lock = when >> + * setting the field. In the machine-independent layer, the >> + * implementation of read-modify-write operations on the field is >> + * encapsulated in vm_page_clear_dirty_mask(). >> */ >>=20 >> TAILQ_HEAD(pglist, vm_page); >> @@ -120,18 +136,19 @@ struct vm_page { >> u_char busy; /* page busy count (O) */ >> /* NOTE that these must support one bit per DEV_BSIZE in a = page!!! */ >> /* so, on normal X86 kernels, they must be at least 8 bits wide = */ >> + /* In reality, support for 32KB pages is not fully implemented. = */ >> #if PAGE_SIZE =3D=3D 4096 >> u_char valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_char dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_char dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 8192 >> u_short valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_short dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_short dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 16384 >> u_int valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_int dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_int dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 32768 >> u_long valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_long dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_long dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #endif >> }; >>=20 >=20 > --=20 > Bjoern A. Zeeb You have to have = visions! > Stop bit received. Insert coin for new address family. >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 22:45:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A718810656E2; Tue, 21 Jun 2011 22:45:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF208FC1A; Tue, 21 Jun 2011 22:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LMjV2q020256; Tue, 21 Jun 2011 22:45:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMjVwT020254; Tue, 21 Jun 2011 22:45:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212245.p5LMjVwT020254@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22:45: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: r223386 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jun 2011 22:45:31 -0000 Author: imp Date: Tue Jun 21 22:45:31 2011 New Revision: 223386 URL: http://svn.freebsd.org/changeset/base/223386 Log: Minor cleanup: o Consider No CIS a normal event and stop whining about it so much (too many cards are like this, espeically usb/firewire cards). o Add comments to the cis reading code. o Made the read from config space a smidge easier to read and eliminate a loop that can be done mathematically. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Tue Jun 21 22:17:28 2011 (r223385) +++ head/sys/dev/cardbus/cardbus_cis.c Tue Jun 21 22:45:31 2011 (r223386) @@ -369,6 +369,14 @@ decode_tuple_end(device_t cbdev, device_ * Functions to read the a tuple from the card */ +/* + * Read CIS bytes out of the config space. We have to read it 4 bytes at a + * time and do the usual mask and shift to return the bytes. The standard + * defines the byte order to be little endian. pci_read_config converts it to + * host byte order. This is why we have no endian conversion functions: the + * shifts wind up being endian neutral. This is also why we avoid the obvious + * memcpy optimization. + */ static int cardbus_read_tuple_conf(device_t cbdev, device_t child, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) @@ -379,12 +387,11 @@ cardbus_read_tuple_conf(device_t cbdev, loc = start + *off; - e = pci_read_config(child, loc - loc % 4, 4); - for (j = loc % 4; j > 0; j--) - e >>= 8; + e = pci_read_config(child, loc & ~0x3, 4); + e >>= 8 * (loc & 0x3); *len = 0; for (i = loc, j = -2; j < *len; j++, i++) { - if (i % 4 == 0) + if ((i & 0x3) == 0) e = pci_read_config(child, i, 4); if (j == -2) *tupleid = 0xff & e; @@ -398,6 +405,10 @@ cardbus_read_tuple_conf(device_t cbdev, return (0); } +/* + * Read the CIS data out of memroy. We indirect through the bus space + * routines to ensure proper byte ordering conversions when necessary. + */ static int cardbus_read_tuple_mem(device_t cbdev, struct resource *res, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) @@ -580,7 +591,7 @@ cardbus_parse_cis(device_t cbdev, device expect_linktarget = TRUE; if ((start = pci_read_config(child, PCIR_CIS, 4)) == 0) { DEVPRINTF((cbdev, "Warning: CIS pointer is 0: (no CIS)\n")); - return (ENXIO); + return (0); } DEVPRINTF((cbdev, "CIS pointer is %#x\n", start)); off = 0; From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 23:29:36 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF74106567D; Tue, 21 Jun 2011 23:29:36 +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 988088FC0C; Tue, 21 Jun 2011 23:29:35 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LNTW7j026859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 09:29:33 +1000 Date: Wed, 22 Jun 2011 09:29:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao In-Reply-To: Message-ID: <20110622090856.A2727@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1048822986-1308698972=:2727" Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 23:29:36 -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-1048822986-1308698972=:2727 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 21 Jun 2011, Attilio Rao wrote: > 2011/6/21 Bruce Evans : >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_= 8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_2= 6 >>> against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_= 8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_2= 6 >>> against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they migh= t >> not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed = all their >> old uses for sparc4 in ~Y2K. > > I'm sure they do, they exist in support.S though and may not have the > _8 form (they may just have the _char version). I may look at the code > again to be sure. Perhaps more like the reverse. They are correctly spelled with _char form in the C code. This is needed to match the declarations of the variables literally. They are translated to the _8 form by but the _8 form doesn't exist. I think the acq and rel forms exist in . mips/support.S only has a limited set of atomics, including clear_16 but not including clear_8. Anyway, they shouldn't be used in either form. They certainly don't exist on sparc64, but sparc64 compiles because it is on the other half of the ifdef. sparc64 atomic support is actually 4 times smaller than mips atomic support, not just 2.5 times, since it doesn't have extras in support.S. Bruce --0-1048822986-1308698972=:2727-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 21 23:47:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC57E1065692; Tue, 21 Jun 2011 23:47:42 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 93CA68FC17; Tue, 21 Jun 2011 23:47:42 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id CF92F2904BA; Tue, 21 Jun 2011 18:28:01 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id cN7jVm+5OI7v; Tue, 21 Jun 2011 18:28:01 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id E09552904B6; Tue, 21 Jun 2011 18:28:00 -0500 (CDT) Message-ID: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 18:27:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Attilio Rao References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 23:47:43 -0000 On 06/21/2011 16:09, Attilio Rao wrote: > 2011/6/21 Bruce Evans: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >> >>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>> >>> Hi Alan, >>> >>>> Author: alc >>>> Date: Sun Jun 19 19:13:24 2011 >>>> New Revision: 223307 >>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>> >>>> Log: >>>> Precisely document the synchronization rules for the page's dirty field. >>>> (Saying that the lock on the object that the page belongs to must be >>>> held >>>> only represents one aspect of the rules.) >>>> >>>> Eliminate the use of the page queues lock for atomically performing >>>> read- >>>> modify-write operations on the dirty field when the underlying >>>> architecture >>>> supports atomic operations on char and short types. >>>> >>>> Document the fact that 32KB pages aren't really supported. >>> contrary to the tinderbox I'd like to point out that all mips kernels >>> built by universe are broken with a SVN HEAD from earlier today. Could you >>> please check and see if you can fix it? The errors I get are: >>> >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >>> against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >>> against `atomic_clear_8' >> Atomic types shorter than int cannot be used in MI code, since they might >> not exist. Apparently they don't exist on mips. jake@ fixed all their >> old uses for sparc4 in ~Y2K. > I'm sure they do, they exist in support.S though and may not have the > _8 form (they may just have the _char version). I may look at the code > again to be sure. > It appears that while mips/include/atomic.h declares the existence of atomic_clear_8, mips/mips/support.S doesn't implement it. In other words, only support for int's and short's is currently implemented, not char's: # grep atomic_clear mips/mips/support.S * atomic_clear_32(u_int32_t *a, u_int32_t b) LEAF(atomic_clear_32) END(atomic_clear_32) * atomic_clear_16(u_int16_t *a, u_int16_t b) LEAF(atomic_clear_16) END(atomic_clear_16) From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:09:51 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA14106578C; Wed, 22 Jun 2011 02:09:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DCA118FC0C; Wed, 22 Jun 2011 02:09:50 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M234Z7084313 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:03:04 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: Warner Losh In-Reply-To: <20110622090856.A2727@besplex.bde.org> Date: Tue, 21 Jun 2011 20:02:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <5AD3FA55-7A8D-49A2-9A49-A0D9EDF41DCF@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <20110622090856.A2727@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:03:04 -0600 (MDT) Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 02:09:51 -0000 On Jun 21, 2011, at 5:29 PM, Bruce Evans wrote: > On Tue, 21 Jun 2011, Attilio Rao wrote: >=20 >> 2011/6/21 Bruce Evans : >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>=20 >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. =C2 Apparently they don't exist on mips. =C2 jake@ fixed = all their >>> old uses for sparc4 in ~Y2K. >>=20 >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >=20 > Perhaps more like the reverse. They are correctly spelled with _char > form in the C code. This is needed to match the declarations of the > variables literally. They are translated to the _8 form by > but the _8 form doesn't exist. I think the acq and > rel forms exist in . mips/support.S only has a = limited > set of atomics, including clear_16 but not including clear_8. Yup. > Anyway, they shouldn't be used in either form. They certainly don't > exist on sparc64, but sparc64 compiles because it is on the other half > of the ifdef. sparc64 atomic support is actually 4 times smaller than > mips atomic support, not just 2.5 times, since it doesn't have extras > in support.S. I'm not sure what you are saying... Warner From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:10:14 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04A1B1065672; Wed, 22 Jun 2011 02:10:13 +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 8CA4C8FC0C; Wed, 22 Jun 2011 02:10:13 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M21hbL084287 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:01:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 20:01:38 -0600 Message-Id: <37980F43-13C5-4C0E-8DB6-9871FD95598C@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:01:44 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 02:10:14 -0000 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > On 06/21/2011 16:09, Attilio Rao wrote: >> 2011/6/21 Bruce Evans: >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>=20 >>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>=20 >>>> Hi Alan, >>>>=20 >>>>> Author: alc >>>>> Date: Sun Jun 19 19:13:24 2011 >>>>> New Revision: 223307 >>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>=20 >>>>> Log: >>>>> Precisely document the synchronization rules for the page's dirty = field. >>>>> (Saying that the lock on the object that the page belongs to must = be >>>>> held >>>>> only represents one aspect of the rules.) >>>>>=20 >>>>> Eliminate the use of the page queues lock for atomically = performing >>>>> read- >>>>> modify-write operations on the dirty field when the underlying >>>>> architecture >>>>> supports atomic operations on char and short types. >>>>>=20 >>>>> Document the fact that 32KB pages aren't really supported. >>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>> please check and see if you can fix it? The errors I get are: >>>>=20 >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>> old uses for sparc4 in ~Y2K. >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >>=20 >=20 > It appears that while mips/include/atomic.h declares the existence of = atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >=20 > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16 Doh! I was confused. I thought _8 was '64 bits' given the bus_space = convention. I'll look at implementing the _8 version tonight. Warner From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:11:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C940210657A5; Wed, 22 Jun 2011 02:11:42 +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 BA2C18FC08; Wed, 22 Jun 2011 02:11:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M2BgnI027358; Wed, 22 Jun 2011 02:11:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2BgXn027356; Wed, 22 Jun 2011 02:11:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106220211.p5M2BgXn027356@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 22 Jun 2011 02:11: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: r223404 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 02:11:42 -0000 Author: nwhitehorn Date: Wed Jun 22 02:11:42 2011 New Revision: 223404 URL: http://svn.freebsd.org/changeset/base/223404 Log: The IOMMU is not involved for the storage bus. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 01:57:45 2011 (r223403) +++ head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:11:42 2011 (r223404) @@ -631,8 +631,7 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && - dinfo->bustype != PS3_BUSTYPE_STORAGE) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:18:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1741065772; Wed, 22 Jun 2011 02:18:46 +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 3DC688FC1B; Wed, 22 Jun 2011 02:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M2IkrG027582; Wed, 22 Jun 2011 02:18:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2IkHa027579; Wed, 22 Jun 2011 02:18:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220218.p5M2IkHa027579@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 02:18: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: r223405 - head/sys/dev/vr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 02:18:46 -0000 Author: yongari Date: Wed Jun 22 02:18:45 2011 New Revision: 223405 URL: http://svn.freebsd.org/changeset/base/223405 Log: Remove link state change callback handler. There is no need to register both status change and link state change callbacks. Implement checking valid link in state change callback and poll active link state in vr_tick(). This allows immediate detection of lost link as well as protecting driver from frequent link flips during link renegotiation. taskq implementation was removed because driver now needs to poll link state in vr_tick(). While I'm here do not report current link state if interface is not running. Tested by: n_hibma MFC after: 1 week Modified: head/sys/dev/vr/if_vr.c head/sys/dev/vr/if_vrreg.h Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Wed Jun 22 02:11:42 2011 (r223404) +++ head/sys/dev/vr/if_vr.c Wed Jun 22 02:18:45 2011 (r223405) @@ -185,7 +185,6 @@ static int vr_miibus_readreg(device_t, i static int vr_miibus_writereg(device_t, int, int, int); static void vr_miibus_statchg(device_t); -static void vr_link_task(void *, int); static void vr_cam_mask(struct vr_softc *, uint32_t, int); static int vr_cam_data(struct vr_softc *, int, int, uint8_t *); static void vr_set_filter(struct vr_softc *); @@ -226,7 +225,6 @@ static device_method_t vr_methods[] = { DEVMETHOD(miibus_readreg, vr_miibus_readreg), DEVMETHOD(miibus_writereg, vr_miibus_writereg), DEVMETHOD(miibus_statchg, vr_miibus_statchg), - DEVMETHOD(miibus_linkchg, vr_miibus_statchg), { NULL, NULL } }; @@ -290,22 +288,13 @@ vr_miibus_writereg(device_t dev, int phy return (0); } -static void -vr_miibus_statchg(device_t dev) -{ - struct vr_softc *sc; - - sc = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc->vr_link_task); -} - /* * In order to fiddle with the * 'full-duplex' and '100Mbps' bits in the netconfig register, we * first have to put the transmit and/or receive logic in the idle state. */ static void -vr_link_task(void *arg, int pending) +vr_miibus_statchg(device_t dev) { struct vr_softc *sc; struct mii_data *mii; @@ -313,22 +302,25 @@ vr_link_task(void *arg, int pending) int lfdx, mfdx; uint8_t cr0, cr1, fc; - sc = (struct vr_softc *)arg; - - VR_LOCK(sc); + sc = device_get_softc(dev); mii = device_get_softc(sc->vr_miibus); ifp = sc->vr_ifp; if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - VR_UNLOCK(sc); + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - } - if (mii->mii_media_status & IFM_ACTIVE) { - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) + sc->vr_link = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: sc->vr_link = 1; - } else - sc->vr_link = 0; + break; + default: + break; + } + } if (sc->vr_link != 0) { cr0 = CSR_READ_1(sc, VR_CR0); @@ -384,11 +376,8 @@ vr_link_task(void *arg, int pending) "%s: Tx/Rx shutdown error -- resetting\n", __func__); sc->vr_flags |= VR_F_RESTART; - VR_UNLOCK(sc); - return; } } - VR_UNLOCK(sc); } @@ -621,7 +610,6 @@ vr_attach(device_t dev) mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->vr_stat_callout, &sc->vr_mtx, 0); - TASK_INIT(&sc->vr_link_task, 0, vr_link_task, sc); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, @@ -841,7 +829,6 @@ vr_detach(device_t dev) vr_stop(sc); VR_UNLOCK(sc); callout_drain(&sc->vr_stat_callout); - taskqueue_drain(taskqueue_swi, &sc->vr_link_task); ether_ifdetach(ifp); } if (sc->vr_miibus) @@ -1559,6 +1546,8 @@ vr_tick(void *xsc) mii = device_get_softc(sc->vr_miibus); mii_tick(mii); + if (sc->vr_link == 0) + vr_miibus_statchg(sc->vr_dev); vr_watchdog(sc); callout_reset(&sc->vr_stat_callout, hz, vr_tick, sc); } @@ -2161,6 +2150,10 @@ vr_ifmedia_sts(struct ifnet *ifp, struct sc = ifp->if_softc; mii = device_get_softc(sc->vr_miibus); VR_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VR_UNLOCK(sc); + return; + } mii_pollstat(mii); VR_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; Modified: head/sys/dev/vr/if_vrreg.h ============================================================================== --- head/sys/dev/vr/if_vrreg.h Wed Jun 22 02:11:42 2011 (r223404) +++ head/sys/dev/vr/if_vrreg.h Wed Jun 22 02:18:45 2011 (r223405) @@ -723,7 +723,6 @@ struct vr_softc { uint8_t vr_flags; /* See VR_F_* below */ #define VR_F_RESTART 0x01 /* Restart unit on next tick */ int vr_if_flags; - struct task vr_link_task; struct vr_chain_data vr_cdata; struct vr_ring_data vr_rdata; struct vr_statistics vr_stat; From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:23:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F32551065679; Wed, 22 Jun 2011 02:23:18 +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 E41BC8FC0C; Wed, 22 Jun 2011 02:23:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M2NI7S027756; Wed, 22 Jun 2011 02:23:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2NI11027754; Wed, 22 Jun 2011 02:23:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106220223.p5M2NI11027754@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 22 Jun 2011 02:23: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: r223406 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 02:23:19 -0000 Author: nwhitehorn Date: Wed Jun 22 02:23:18 2011 New Revision: 223406 URL: http://svn.freebsd.org/changeset/base/223406 Log: This is more complicated than I expected. Storage devices need the IOMMU set up, but must not use it. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:18:45 2011 (r223405) +++ head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:23:18 2011 (r223406) @@ -631,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && + dinfo->bustype != PS3_BUSTYPE_STORAGE) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); @@ -671,7 +672,15 @@ ps3bus_get_dma_tag(device_t dev, device_ NULL, NULL, BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE, 0, NULL, NULL, &dinfo->dma_tag); - bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); + /* + * Note: storage devices have IOMMU mappings set up by the hypervisor, + * but use physical, non-translated addresses. The above IOMMU + * initialization is necessary for the hypervisor to be able to set up + * the mappings, but actual DMA mappings should not use the IOMMU + * routines. + */ + if (dinfo->bustype != PS3_BUSTYPE_STORAGE) + bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); fail: mtx_unlock(&dinfo->iommu_mtx); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:30:08 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6183010656B2; Wed, 22 Jun 2011 02:30: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 48EC48FC08; Wed, 22 Jun 2011 02:30:05 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M2RGIj084486 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:27:21 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 20:27:03 -0600 Message-Id: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:27:21 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 02:30:08 -0000 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > On 06/21/2011 16:09, Attilio Rao wrote: >> 2011/6/21 Bruce Evans: >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>=20 >>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>=20 >>>> Hi Alan, >>>>=20 >>>>> Author: alc >>>>> Date: Sun Jun 19 19:13:24 2011 >>>>> New Revision: 223307 >>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>=20 >>>>> Log: >>>>> Precisely document the synchronization rules for the page's dirty = field. >>>>> (Saying that the lock on the object that the page belongs to must = be >>>>> held >>>>> only represents one aspect of the rules.) >>>>>=20 >>>>> Eliminate the use of the page queues lock for atomically = performing >>>>> read- >>>>> modify-write operations on the dirty field when the underlying >>>>> architecture >>>>> supports atomic operations on char and short types. >>>>>=20 >>>>> Document the fact that 32KB pages aren't really supported. >>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>> please check and see if you can fix it? The errors I get are: >>>>=20 >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>> old uses for sparc4 in ~Y2K. >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >>=20 >=20 > It appears that while mips/include/atomic.h declares the existence of = atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >=20 > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16) The current crop of atomic*16 and atomic*8 functions have the = restriction that the address must be 32-bit aligned (and it forces this = by aligning to 32-bits silently and then operates on the low 8 or 16 = bits in that word!) I'm guessing that this is likely just wrong. Comments? Warner From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 02:41:18 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC02310657C3; Wed, 22 Jun 2011 02:41:18 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC2D8FC18; Wed, 22 Jun 2011 02:41:18 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 98BC82904C1; Tue, 21 Jun 2011 21:41:17 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id kwz8tdPEGGuM; Tue, 21 Jun 2011 21:41:17 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id 6232C2904A6; Tue, 21 Jun 2011 21:41:16 -0500 (CDT) Message-ID: <4E01564B.70507@rice.edu> Date: Tue, 21 Jun 2011 21:41:15 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Warner Losh References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 02:41:18 -0000 On 06/21/2011 21:27, Warner Losh wrote: > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > >> On 06/21/2011 16:09, Attilio Rao wrote: >>> 2011/6/21 Bruce Evans>> >: >>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>> >>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>> >>>>> Hi Alan, >>>>> >>>>>> Author: alc >>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>> New Revision: 223307 >>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>> >>>>>> Log: >>>>>> Precisely document the synchronization rules for the page's >>>>>> dirty field. >>>>>> (Saying that the lock on the object that the page belongs to must be >>>>>> held >>>>>> only represents one aspect of the rules.) >>>>>> >>>>>> Eliminate the use of the page queues lock for atomically performing >>>>>> read- >>>>>> modify-write operations on the dirty field when the underlying >>>>>> architecture >>>>>> supports atomic operations on char and short types. >>>>>> >>>>>> Document the fact that 32KB pages aren't really supported. >>>>> contrary to the tinderbox I'd like to point out that all mips kernels >>>>> built by universe are broken with a SVN HEAD from earlier today. >>>>> Could you >>>>> please check and see if you can fix it? The errors I get are: >>>>> >>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>>> vm_page.o: In function `vm_page_set_validclean': >>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>> Atomic types shorter than int cannot be used in MI code, since they >>>> might >>>> not exist. Apparently they don't exist on mips. jake@ fixed all their >>>> old uses for sparc4 in ~Y2K. >>> I'm sure they do, they exist in support.S though and may not have the >>> _8 form (they may just have the _char version). I may look at the code >>> again to be sure. >>> >> >> It appears that while mips/include/atomic.h declares the existence of >> atomic_clear_8, mips/mips/support.S doesn't implement it. In other >> words, only support for int's and short's is currently implemented, >> not char's: >> >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the > restriction that the address must be 32-bit aligned (and it forces > this by aligning to 32-bits silently and then operates on the low 8 or > 16 bits in that word!) > > I'm guessing that this is likely just wrong. Comments? Yes, that would be wrong. Alan From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 03:27:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6B511065679; Wed, 22 Jun 2011 03:27:53 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 9040D8FC26; Wed, 22 Jun 2011 03:27:53 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p5M3RW1L020349 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 21 Jun 2011 20:27:34 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E01612F.4080007@freebsd.org> Date: Tue, 21 Jun 2011 20:27:43 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Warner Losh References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 03:27:53 -0000 On 6/21/11 7:27 PM, Warner Losh wrote: > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > >> On 06/21/2011 16:09, Attilio Rao wrote: >>> 2011/6/21 Bruce Evans>> >: >>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>> >>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>> >>>>> Hi Alan, >>>>> >>>>>> Author: alc >>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>> New Revision: 223307 >>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>> >>>>>> Log: >>>>>> Precisely document the synchronization rules for the page's >>>>>> dirty field. >>>>>> (Saying that the lock on the object that the page belongs to >>>>>> must be >>>>>> held >>>>>> only represents one aspect of the rules.) >>>>>> >>>>>> Eliminate the use of the page queues lock for atomically >>>>>> performing >>>>>> read- >>>>>> modify-write operations on the dirty field when the underlying >>>>>> architecture >>>>>> supports atomic operations on char and short types. >>>>>> >>>>>> Document the fact that 32KB pages aren't really supported. >>>>> contrary to the tinderbox I'd like to point out that all mips >>>>> kernels >>>>> built by universe are broken with a SVN HEAD from earlier today. >>>>> Could you >>>>> please check and see if you can fix it? The errors I get are: >>>>> >>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>>> vm_page.o: In function `vm_page_set_validclean': >>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>> Atomic types shorter than int cannot be used in MI code, since >>>> they might >>>> not exist. Apparently they don't exist on mips. jake@ fixed all >>>> their >>>> old uses for sparc4 in ~Y2K. >>> I'm sure they do, they exist in support.S though and may not have the >>> _8 form (they may just have the _char version). I may look at the code >>> again to be sure. >>> >> >> It appears that while mips/include/atomic.h declares the existence >> of atomic_clear_8, mips/mips/support.S doesn't implement it. In >> other words, only support for int's and short's is currently >> implemented, not char's: >> >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the > restriction that the address must be 32-bit aligned (and it forces > this by aligning to 32-bits silently and then operates on the low 8 > or 16 bits in that word!) > > I'm guessing that this is likely just wrong. Comments? I'm guessing it depends on whether the hardware supports atomic sub-wordline accesses. (mind you it's getting really hard to work out what a wordline means these days) > > Warner > From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 03:48:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B19B610657A0; Wed, 22 Jun 2011 03:48:39 +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 143B68FC0A; Wed, 22 Jun 2011 03:48:38 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M3kYRq085097 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 21:46:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E01612F.4080007@freebsd.org> Date: Tue, 21 Jun 2011 21:46:30 -0600 Message-Id: <3B90907F-0CC4-4C2F-9386-6BF12E750F6C@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> <4E01612F.4080007@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 21:46:34 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 03:48:39 -0000 On Jun 21, 2011, at 9:27 PM, Julian Elischer wrote: > On 6/21/11 7:27 PM, Warner Losh wrote: >>=20 >>=20 >> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>=20 >>> On 06/21/2011 16:09, Attilio Rao wrote: >>>> 2011/6/21 Bruce Evans: >>>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>>>=20 >>>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>>>=20 >>>>>> Hi Alan, >>>>>>=20 >>>>>>> Author: alc >>>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>>> New Revision: 223307 >>>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>>>=20 >>>>>>> Log: >>>>>>> Precisely document the synchronization rules for the page's = dirty field. >>>>>>> (Saying that the lock on the object that the page belongs to = must be >>>>>>> held >>>>>>> only represents one aspect of the rules.) >>>>>>>=20 >>>>>>> Eliminate the use of the page queues lock for atomically = performing >>>>>>> read- >>>>>>> modify-write operations on the dirty field when the underlying >>>>>>> architecture >>>>>>> supports atomic operations on char and short types. >>>>>>>=20 >>>>>>> Document the fact that 32KB pages aren't really supported. >>>>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>>>> please check and see if you can fix it? The errors I get are: >>>>>>=20 >>>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>>>> against `atomic_clear_8' >>>>>> vm_page.o: In function `vm_page_set_validclean': >>>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>>>> against `atomic_clear_8' >>>>> Atomic types shorter than int cannot be used in MI code, since = they might >>>>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>>>> old uses for sparc4 in ~Y2K. >>>> I'm sure they do, they exist in support.S though and may not have = the >>>> _8 form (they may just have the _char version). I may look at the = code >>>> again to be sure. >>>>=20 >>>=20 >>> It appears that while mips/include/atomic.h declares the existence = of atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >>>=20 >>> # grep atomic_clear mips/mips/support.S >>> * atomic_clear_32(u_int32_t *a, u_int32_t b) >>> LEAF(atomic_clear_32) >>> END(atomic_clear_32) >>> * atomic_clear_16(u_int16_t *a, u_int16_t b) >>> LEAF(atomic_clear_16) >>> END(atomic_clear_16) >>=20 >> The current crop of atomic*16 and atomic*8 functions have the = restriction that the address must be 32-bit aligned (and it forces this = by aligning to 32-bits silently and then operates on the low 8 or 16 = bits in that word!) >>=20 >> I'm guessing that this is likely just wrong. Comments? >=20 > I'm guessing it depends on whether the hardware supports atomic = sub-wordline accesses. > (mind you it's getting really hard to work out what a wordline means = these days) Generally, they don't. ll and lld are for 4 and 8 byte values. You're = supposed to load the word or doubleword with the instruction, mask off = the byte you want to change, change it, and then write it back with the = sc or scd insturction. That will only succeed of none of the bytes in = that word could have changed (yes, weasel words usually meaning anything = in the cache line, but really can mean anything). I know that some cores do support special instructions to do this, but = they are with extensions to the ISA... Warner= From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 06:27:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC901065751; Wed, 22 Jun 2011 06:27:33 +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 03B1B8FC0A; Wed, 22 Jun 2011 06:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M6RWxl035315; Wed, 22 Jun 2011 06:27:32 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M6RWZM035313; Wed, 22 Jun 2011 06:27:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106220627.p5M6RWZM035313@svn.freebsd.org> From: Doug Barton Date: Wed, 22 Jun 2011 06:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223408 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 06:27:33 -0000 Author: dougb Date: Wed Jun 22 06:27:32 2011 New Revision: 223408 URL: http://svn.freebsd.org/changeset/base/223408 Log: I knew there was something funny about this line Modified: head/etc/rc.d/netwait Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Wed Jun 22 04:11:27 2011 (r223407) +++ head/etc/rc.d/netwait Wed Jun 22 06:27:32 2011 (r223408) @@ -14,7 +14,8 @@ . /etc/rc.subr name="netwait" -rc_var=`set_rcvar` +rcvar=`set_rcvar` + start_cmd="${name}_start" stop_cmd=":" From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 07:53:27 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id 4BE5C1065691; Wed, 22 Jun 2011 07:53:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Wed, 22 Jun 2011 07:56:04 +0000 From: Ruslan Ermilov To: Jilles Tjoelker Message-ID: <20110622075603.GA70438@lo0.su> References: <201106211934.p5LJYvsP013837@svn.freebsd.org> <20110621202802.GA28834@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110621202802.GA28834@stack.nl> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223372 - head/bin/realpath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 07:53:27 -0000 On Tue, Jun 21, 2011 at 10:28:03PM +0200, Jilles Tjoelker wrote: > On Tue, Jun 21, 2011 at 07:34:57PM +0000, Ruslan Ermilov wrote: > > Author: ru > > Date: Tue Jun 21 19:34:57 2011 > > New Revision: 223372 > > URL: http://svn.freebsd.org/changeset/base/223372 > > > Log: > > Make ``realpath'' behave like ``realpath .''. > > Is this being added for compatibility with something? > > If not, why do we need this non-standard extension if the shorter and > standard pwd -P already fulfills this function? I treat it as a convenient addition to a non-standard utility. realpath(1) was first added in FreeBSD in year 2000 by phk@, as a convenience utility. In r90523 the ability to call "realpath" without arguments (with a similar behavior but different implementation) was added by mike@. Ten months later, this syntax was removed by johan@ in r108034. I'm not aware of any standard and/or another non-FreeBSD based OS that also have this utility (only saw a mention of a patch that adds an utility of the same name into GNU shell-utils, but it seems to have never happened). We could emphasize this: Index: realpath.1 =================================================================== --- realpath.1 (revision 223372) +++ realpath.1 (working copy) @@ -69,6 +69,10 @@ fails. .Sh EXIT STATUS .Ex -std +.Sh COMPATIBILITY +The +.Nm +utility is non-standard and should not be used in portable scripts. .Sh SEE ALSO .Xr realpath 3 .Sh HISTORY Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 08:20:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3676810656AD; Wed, 22 Jun 2011 08:20:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B04A8FC13; Wed, 22 Jun 2011 08:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M8K1Df039225; Wed, 22 Jun 2011 08:20:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M8K10v039224; Wed, 22 Jun 2011 08:20:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106220820.p5M8K10v039224@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 22 Jun 2011 08:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223416 - head/sbin/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: Wed, 22 Jun 2011 08:20:02 -0000 Author: glebius Date: Wed Jun 22 08:20:01 2011 New Revision: 223416 URL: http://svn.freebsd.org/changeset/base/223416 Log: One more braino from me. Pointy hat to: glebius Submitted by: Alexander V. Chernikov Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Wed Jun 22 08:09:50 2011 (r223415) +++ head/sbin/ipfw/nat.c Wed Jun 22 08:20:01 2011 (r223416) @@ -785,8 +785,9 @@ ipfw_config_nat(int ac, char **av) len += estimate_redir_port(&ac1, &av1); av1 += 2; ac1 -= 2; /* Skip optional remoteIP/port */ - if (ac1 != 0 && isdigit(**av1)) + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; + } break; case TOK_REDIR_PROTO: if (ac1 < 2) @@ -795,10 +796,12 @@ ipfw_config_nat(int ac, char **av) len += sizeof(struct cfg_redir); av1 += 2; ac1 -= 2; /* Skip optional remoteIP/port */ - if (ac1 != 0 && isdigit(**av1)) + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; - if (ac1 != 0 && isdigit(**av1)) + } + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; + } break; default: errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 09:26:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7788C10656B1; Wed, 22 Jun 2011 09:26:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id D63B48FC14; Wed, 22 Jun 2011 09:26:32 +0000 (UTC) Received: by yic13 with SMTP id 13so328921yic.13 for ; Wed, 22 Jun 2011 02:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bhOb7Nxr/QRKmFz2Viv/4izarL7aaeAcEYCcSixx6Ow=; b=wNYd9C2yfvbS6jxgxkgN9TTQR6+i58h+DuR9B8tkaV94NfcACGl2bYPzkgpz3xPAp1 w0uolxd84/MzUTvHGQj7kkHRGI/NCEfSkvyj8vVssbyOFBWGdFMz0YisNrz1wFvJncWb RC19mS8neTOPyscJC1JZtmOQe1z1hr2F63ILw= 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=NqYIrQWv2Pnj659FUvyZ+hIZN1R2AK+SOCBHlvSg7gQNhFbdAslHuM8NMftDwY35Px zr6eQBicbi7NdNEhSvyv+z4kjaRSR0czEt3MamlMVfeKMxeSujTlmjET2l4crpTd/YwK n5ZqzGWIKOjVaNl4xIjg9RtJW+hmYpmAXfm30= MIME-Version: 1.0 Received: by 10.236.109.19 with SMTP id r19mr680405yhg.289.1308734791880; Wed, 22 Jun 2011 02:26:31 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Wed, 22 Jun 2011 02:26:31 -0700 (PDT) In-Reply-To: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> Date: Wed, 22 Jun 2011 11:26:31 +0200 X-Google-Sender-Auth: C32054n8MIHgdI9fKYrAh-1-tHU Message-ID: From: Attilio Rao To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 09:26:33 -0000 2011/6/22 Warner Losh : > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > > On 06/21/2011 16:09, Attilio Rao wrote: > > 2011/6/21 Bruce Evans: > > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > Hi Alan, > > Author: alc > > Date: Sun Jun 19 19:13:24 2011 > > New Revision: 223307 > > URL: http://svn.freebsd.org/changeset/base/223307 > > Log: > > =C2=A0Precisely document the synchronization rules for the page's dirty f= ield. > > =C2=A0(Saying that the lock on the object that the page belongs to must b= e > > held > > =C2=A0only represents one aspect of the rules.) > > =C2=A0Eliminate the use of the page queues lock for atomically performing > > read- > > =C2=A0modify-write operations on the dirty field when the underlying > > architecture > > =C2=A0supports atomic operations on char and short types. > > =C2=A0Document the fact that 32KB pages aren't really supported. > > contrary to the tinderbox I'd like to point out that all mips kernels > > built by universe are broken with a SVN HEAD from earlier today. =C2=A0Co= uld you > > please check and see if you can fix it? =C2=A0The errors I get are: > > vm_page.o: In function `vm_page_clear_dirty': > > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 > > against `atomic_clear_8' > > vm_page.o: In function `vm_page_set_validclean': > > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 > > against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > > not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed a= ll their > > old uses for sparc4 in ~Y2K. > > I'm sure they do, they exist in support.S though and may not have the > > _8 form (they may just have the _char version). I may look at the code > > again to be sure. > > > It appears that while mips/include/atomic.h declares the existence of > atomic_clear_8, mips/mips/support.S doesn't implement it. =C2=A0In other = words, > only support for int's and short's is currently implemented, not char's: > > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the restriction > that the address must be 32-bit aligned (and it forces this by aligning t= o > 32-bits silently and then operates on the low 8 or 16 bits in that word!) > I'm guessing that this is likely just wrong. =C2=A0Comments? > Warner That is wrong, of course, and my personal opinion is that one should not implement atomic operations if they cannot be done efficiently (example: if you need to disable interrupts or similar expensive operation just to assure atomicity of operation, just don't support it) as long as not having _8/_char is perfectly fine. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 09:55:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2178E1065672; Wed, 22 Jun 2011 09:55:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11ACC8FC1D; Wed, 22 Jun 2011 09:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M9tSNC042378; Wed, 22 Jun 2011 09:55:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M9tSdj042376; Wed, 22 Jun 2011 09:55:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106220955.p5M9tSdj042376@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 22 Jun 2011 09:55: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: r223421 - head/sys/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: Wed, 22 Jun 2011 09:55:29 -0000 Author: ae Date: Wed Jun 22 09:55:28 2011 New Revision: 223421 URL: http://svn.freebsd.org/changeset/base/223421 Log: Document PKT_ALIAS_SKIP_GLOBAL option. Submitted by: Alexander V. Chernikov Modified: head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Wed Jun 22 09:16:32 2011 (r223420) +++ head/sys/netinet/libalias/libalias.3 Wed Jun 22 09:55:28 2011 (r223421) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd June 22, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -257,6 +257,16 @@ Normal packet aliasing is not performed. See .Fn LibAliasProxyRule below for details. +.It Dv PKT_ALIAS_SKIP_GLOBAL +This option is used by +.Pa ipfw_nat +only. Specifying it as a flag to +.Fn LibAliasSetMode +has no effect. See section +.Sx NETWORK ADDRESS TRANSLATION +in +.Xr ipfw 8 +for more details. .El .Ed .Pp From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 13:41:51 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00C37106566B; Wed, 22 Jun 2011 13:41:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 988588FC15; Wed, 22 Jun 2011 13:41:49 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA09947; Wed, 22 Jun 2011 16:41:48 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E01F11B.3070602@FreeBSD.org> Date: Wed, 22 Jun 2011 16:41:47 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Justin T. Gibbs" References: <201106102010.p5AKAV8G041541@svn.freebsd.org> In-Reply-To: <201106102010.p5AKAV8G041541@svn.freebsd.org> X-Enigmail-Version: 1.1.2 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: r222950 - in head: cddl/compat/opensolaris/include sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs/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, 22 Jun 2011 13:41:51 -0000 on 10/06/2011 23:10 Justin T. Gibbs said the following: > Author: gibbs > Date: Fri Jun 10 20:10:30 2011 > New Revision: 222950 > URL: http://svn.freebsd.org/changeset/base/222950 > > Log: > Remove C constructs that are incompatible with C++ from various > OpenSolaris and ZFS header files. These changes are sufficient > to allow a C++ program to use the libzfs library. Is this going to affect any possible (but improbable?) merges from upstream? And/or from other ZFS/OpenSolaris forks (which should be more likely)? > Note: The majority of these files already included 'extern "C"' > declarations, so the intention of providing C++ compatibility > already existed even if it wasn't provided. > > cddl/compat/opensolaris/include/assert.h: > Wrap our compatibility assert implementation in > 'extern "C"'. Since this is a compatibility header > I matched the Solaris style of doing this explicitly > rather than rely on FreeBSD's __BEGIN/END_DECLS macro. > > sys/cddl/compat/opensolaris/sys/kstat.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: > Rename parameters in function declarations that conflict > with C++ keywords. This was the solution preferred by > members of the Illumos community. > > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: > In C, nested structures are visible in the global namespace, > but in C++, they take on the namespace of the structure in > which they are contained. Flatten nested structure > definitions within struct zfs_cmd so these structures are > visible in the global namespace when compiled in both > languages. > > Sponsored by: Spectra Logic Corporation > > Modified: > head/cddl/compat/opensolaris/include/assert.h > head/sys/cddl/compat/opensolaris/sys/kstat.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 13:48:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F116F1065676; Wed, 22 Jun 2011 13:48:03 +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 C3E218FC14; Wed, 22 Jun 2011 13:48:03 +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 5DF1D46B0D; Wed, 22 Jun 2011 09:48:03 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED5F48A027; Wed, 22 Jun 2011 09:48:02 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Wed, 22 Jun 2011 09:48:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> In-Reply-To: <20110622063258.D2275@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106220948.02421.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 22 Jun 2011 09:48:03 -0400 (EDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 13:48:04 -0000 On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > > > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > > > Hi Alan, > > > >> Author: alc > >> Date: Sun Jun 19 19:13:24 2011 > >> New Revision: 223307 > >> URL: http://svn.freebsd.org/changeset/base/223307 > >> > >> Log: > >> Precisely document the synchronization rules for the page's dirty field. > >> (Saying that the lock on the object that the page belongs to must be held > >> only represents one aspect of the rules.) > >> > >> Eliminate the use of the page queues lock for atomically performing read- > >> modify-write operations on the dirty field when the underlying architecture > >> supports atomic operations on char and short types. > >> > >> Document the fact that 32KB pages aren't really supported. > > > > contrary to the tinderbox I'd like to point out that all mips kernels built by universe are broken with a SVN HEAD from earlier today. Could you please check and see if you can fix it? The errors I get are: > > > > vm_page.o: In function `vm_page_clear_dirty': > > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > > vm_page.o: In function `vm_page_set_validclean': > > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > not exist. Apparently they don't exist on mips. jake@ fixed all their > old uses for sparc4 in ~Y2K. I agree. Is there any harm in having the 'dirty' and 'valid' fields in vm_page always be at least of size 'int'? In the case of amd64, vm_page would change from a size of 120 bytes to 128. On i386 I think you'd end up changing the size from 68 to 76. (Using an int results in alignment padding after 'busy'.) Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of RAM, so around 0.18% of RAM would be used on both platforms (presumably the usage would be similar on other platforms as well). At 24 GB of RAM, the extra space is just under 0.20% of RAM (48M). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 13:53:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2641D106566C; Wed, 22 Jun 2011 13:53:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE9F8FC1A; Wed, 22 Jun 2011 13:53:11 +0000 (UTC) Received: by gxk19 with SMTP id 19so854338gxk.17 for ; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7T9ZxVhZrKhXcUzceRQk8X3lNvbf9FLNLqrqlTQ36Xs=; b=JwMtRqzbcKVuMTd61s7PsuU6F3l2XSwFzgaSyac2M70Jkn5OoL3Nd7weVZ3rpN2Jan VUGNtbByh5WH8h40wSxsFYZ+3R2N8/hI0z9j7jMkX+8UcLTvfcmqB+Uk+71pwuFYjuAa Yv5kX+xGiPV6n1F0OWheaKfMjLDPJrPfMfpHM= 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=aNNiALRGHJZrs1u//ZJ09//jWNzToLZL654AF00SfSzm9vdsbabSRDJ6yn01i8adkX o/TTJGUfkDVhy1Mj8nBlkBY0x2FkFqWzEyJ5TZlnt/M4J4TvGuCYDrc39cpoI6Mro4Ni STI1RaXBo5WP8SFsGKoNsImAP2ISq7yRz+hTg= MIME-Version: 1.0 Received: by 10.236.111.20 with SMTP id v20mr1189923yhg.423.1308750790550; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) In-Reply-To: <201106220948.02421.jhb@freebsd.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <201106220948.02421.jhb@freebsd.org> Date: Wed, 22 Jun 2011 15:53:10 +0200 X-Google-Sender-Auth: oXsgX_O3FNx9NMzsRaHEeE3iCbA Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 13:53:12 -0000 2011/6/22 John Baldwin : > On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >> >> > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >> > >> > Hi Alan, >> > >> >> Author: alc >> >> Date: Sun Jun 19 19:13:24 2011 >> >> New Revision: 223307 >> >> URL: http://svn.freebsd.org/changeset/base/223307 >> >> >> >> Log: >> >> =C2=A0Precisely document the synchronization rules for the page's dir= ty field. >> >> =C2=A0(Saying that the lock on the object that the page belongs to mu= st be held >> >> =C2=A0only represents one aspect of the rules.) >> >> >> >> =C2=A0Eliminate the use of the page queues lock for atomically perfor= ming read- >> >> =C2=A0modify-write operations on the dirty field when the underlying = architecture >> >> =C2=A0supports atomic operations on char and short types. >> >> >> >> =C2=A0Document the fact that 32KB pages aren't really supported. >> > >> > contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. =C2=A0Coul= d > you please check and see if you can fix it? =C2=A0The errors I get are: >> > >> > vm_page.o: In function `vm_page_clear_dirty': >> > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear= _8' >> > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_= 26 against `atomic_clear_8' >> > vm_page.o: In function `vm_page_set_validclean': >> > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear= _8' >> > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_= 26 against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they migh= t >> not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed = all their >> old uses for sparc4 in ~Y2K. > > I agree. =C2=A0Is there any harm in having the 'dirty' and 'valid' fields= in > vm_page always be at least of size 'int'? > > In the case of amd64, vm_page would change from a size of 120 bytes to 12= 8. > > On i386 I think you'd end up changing the size from 68 to 76. > > (Using an int results in alignment padding after 'busy'.) > > Hmm, that's around 120k of extra vm_page_t space for a machine with 64M o= f > RAM, so around 0.18% of RAM would be used on both platforms (presumably t= he > usage would be similar on other platforms as well). =C2=A0At 24 GB of RAM= , the > extra space is just under 0.20% of RAM (48M). I think that there is a bit of misunderstanding here. The idea here is to use just the atomic 8bits for the architectures that support it and otherwise use the vm_page_queue_lock. Anyway, as not all the architectures have this implementation, rather than replicate a lot of MD code to be used in MI, Alan just went with an explicit stub, where necessary. The real bug I see here is that we thought mips was supporting _8 atomic ops while it doesn't seem to be the case (sorry for being lazy on checking, but I nearly have 0 time). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 15:45:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4D3106564A; Wed, 22 Jun 2011 15:45:38 +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 977048FC17; Wed, 22 Jun 2011 15:45:38 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5MFgFMM092998 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 09:42:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 22 Jun 2011 09:42:06 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Attilio Rao X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 22 Jun 2011 09:42:17 -0600 (MDT) Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 15:45:39 -0000 On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote: > 2011/6/22 Warner Losh : >>=20 >> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>=20 >> On 06/21/2011 16:09, Attilio Rao wrote: >>=20 >> 2011/6/21 Bruce Evans: >>=20 >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>=20 >> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>=20 >> Hi Alan, >>=20 >> Author: alc >>=20 >> Date: Sun Jun 19 19:13:24 2011 >>=20 >> New Revision: 223307 >>=20 >> URL: http://svn.freebsd.org/changeset/base/223307 >>=20 >> Log: >>=20 >> Precisely document the synchronization rules for the page's dirty = field. >>=20 >> (Saying that the lock on the object that the page belongs to must be >>=20 >> held >>=20 >> only represents one aspect of the rules.) >>=20 >> Eliminate the use of the page queues lock for atomically performing >>=20 >> read- >>=20 >> modify-write operations on the dirty field when the underlying >>=20 >> architecture >>=20 >> supports atomic operations on char and short types. >>=20 >> Document the fact that 32KB pages aren't really supported. >>=20 >> contrary to the tinderbox I'd like to point out that all mips kernels >>=20 >> built by universe are broken with a SVN HEAD from earlier today. = Could you >>=20 >> please check and see if you can fix it? The errors I get are: >>=20 >> vm_page.o: In function `vm_page_clear_dirty': >>=20 >> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>=20 >> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>=20 >> against `atomic_clear_8' >>=20 >> vm_page.o: In function `vm_page_set_validclean': >>=20 >> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>=20 >> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>=20 >> against `atomic_clear_8' >>=20 >> Atomic types shorter than int cannot be used in MI code, since they = might >>=20 >> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>=20 >> old uses for sparc4 in ~Y2K. >>=20 >> I'm sure they do, they exist in support.S though and may not have the >>=20 >> _8 form (they may just have the _char version). I may look at the = code >>=20 >> again to be sure. >>=20 >>=20 >> It appears that while mips/include/atomic.h declares the existence of >> atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, >> only support for int's and short's is currently implemented, not = char's: >>=20 >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) >>=20 >> The current crop of atomic*16 and atomic*8 functions have the = restriction >> that the address must be 32-bit aligned (and it forces this by = aligning to >> 32-bits silently and then operates on the low 8 or 16 bits in that = word!) >> I'm guessing that this is likely just wrong. Comments? >> Warner >=20 > That is wrong, of course, and my personal opinion is that one should > not implement atomic operations if they cannot be done efficiently > (example: if you need to disable interrupts or similar expensive > operation just to assure atomicity of operation, just don't support > it) as long as not having _8/_char is perfectly fine. I think it can be efficient, for some reasonable definition of = efficient. The masking and shifting operations aren't that onerous to = write and the instructions cycles would be dwarfed by the ll/sc pair, = which are required to implement atomic. The issue is that the code today is clearly wrong and needs to be fixed. Warner= From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 16:15:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B35110656F2; Wed, 22 Jun 2011 16:15:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19BC78FC17; Wed, 22 Jun 2011 16:15:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MGFFR1056372; Wed, 22 Jun 2011 16:15:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MGFFLF056368; Wed, 22 Jun 2011 16:15:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221615.p5MGFFLF056368@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 16:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223424 - in head/sys: amd64/pci dev/acpica i386/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 16:15:16 -0000 Author: jhb Date: Wed Jun 22 16:15:15 2011 New Revision: 223424 URL: http://svn.freebsd.org/changeset/base/223424 Log: Add a helper routine to conditionally modify the start address of a resource allocation from an x86 Host-PCI bridge driver so that it can be reused by the ACPI Host-PCI bridge driver (and eventually the MPTable Host-PCI bridge driver) instead of duplicating the same logic. Note that this means that hw.acpi.host_mem_start is now replaced with the hw.pci.host_mem_start tunable that was already used in the non-ACPI case. This also removes hw.acpi.host_mem_start on ia64 where it was not applicable (the implementation was very x86-specific). While here, adjust the logic to apply the new start address on any "wildcard" allocation even if that allocation comes from a subset of the allowable address range. Reviewed by: imp (1) Modified: head/sys/amd64/pci/pci_bus.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/amd64/pci/pci_bus.c Wed Jun 22 16:15:15 2011 (r223424) @@ -302,35 +302,45 @@ legacy_pcib_write_ivar(device_t dev, dev return ENOENT; } +/* + * Helper routine for x86 Host-PCI bridge driver resource allocation. + * This is used to adjust the start address of wildcard allocation + * requests to avoid low addresses that are known to be problematic. + * + * If no memory preference is given, use upper 32MB slot most BIOSes + * use for their memory window. This is typically only used on older + * laptops that don't have PCI busses behind a PCI bridge, so assuming + * > 32MB is likely OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. + */ SYSCTL_DECL(_hw_pci); -static unsigned long legacy_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start); -SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, - &legacy_host_mem_start, 0x80000000, - "Limit the host bridge memory to being above this address. Must be\n\ -set at boot via a tunable."); +static unsigned long host_mem_start = 0x80000000; +TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); +SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, + 0, "Limit the host bridge memory to being above this address."); + +u_long +hostb_alloc_start(int type, u_long start, u_long end, u_long count) +{ + + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < host_mem_start) + start = host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } + return (start); +} struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. - * - * However, this can cause problems for other chipsets, so we make - * this tunable by hw.pci.host_mem_start. - */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = legacy_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) - start = 0x1000; + + start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 16:15:15 2011 (r223424) @@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); } -static u_long acpi_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); - struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is likely OK. - * - * PCI-PCI bridges may allocate smaller ranges for their windows, - * but the heuristics here should apply to those, so we allow - * several different end addresses. - */ - if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || - end == 0xffffffff)) - start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || - end == 0xffff || end == 0xffffffff)) - start = 0x1000; + +#if defined(__i386__) || defined(__amd64__) + start = hostb_alloc_start(type, start, end, count); +#endif return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/i386/pci/pci_bus.c Wed Jun 22 16:15:15 2011 (r223424) @@ -519,35 +519,45 @@ legacy_pcib_write_ivar(device_t dev, dev return ENOENT; } +/* + * Helper routine for x86 Host-PCI bridge driver resource allocation. + * This is used to adjust the start address of wildcard allocation + * requests to avoid low addresses that are known to be problematic. + * + * If no memory preference is given, use upper 32MB slot most BIOSes + * use for their memory window. This is typically only used on older + * laptops that don't have PCI busses behind a PCI bridge, so assuming + * > 32MB is likely OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. + */ SYSCTL_DECL(_hw_pci); -static unsigned long legacy_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start); -SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, - &legacy_host_mem_start, 0x80000000, - "Limit the host bridge memory to being above this address. Must be\n\ -set at boot via a tunable."); +static unsigned long host_mem_start = 0x80000000; +TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); +SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, + 0, "Limit the host bridge memory to being above this address."); + +u_long +hostb_alloc_start(int type, u_long start, u_long end, u_long count) +{ + + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < host_mem_start) + start = host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } + return (start); +} struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. - * - * However, this can cause problems for other chipsets, so we make - * this tunable by hw.pci.host_mem_start. - */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = legacy_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) - start = 0x1000; + + start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 16:40:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AFCF106566B; Wed, 22 Jun 2011 16:40:46 +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 09FE68FC24; Wed, 22 Jun 2011 16:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MGejZi057169; Wed, 22 Jun 2011 16:40:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MGejHY057164; Wed, 22 Jun 2011 16:40:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106221640.p5MGejHY057164@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Jun 2011 16:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 16:40:46 -0000 Author: jkim Date: Wed Jun 22 16:40:45 2011 New Revision: 223426 URL: http://svn.freebsd.org/changeset/base/223426 Log: Set negative quality to TSC timecounter when C3 state is enabled for Intel processors unless the invariant TSC bit of CPUID is set. Intel processors may stop incrementing TSC when DPSLP# pin is asserted, according to Intel processor manuals, i. e., TSC timecounter is useless if the processor can enter deep sleep state (C3/C4). This problem was accidentally uncovered by r222869, which increased timecounter quality of P-state invariant TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c). Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) Ian FREISLICH (ianf at clue dot co dot za) Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) - Core2 Duo T5870 (C3 state available/enabled) jkim - Xeon X5150 (C3 state unavailable) Modified: head/sys/dev/acpica/acpi_cpu.c head/sys/kern/kern_clocksource.c head/sys/sys/systm.h head/sys/x86/x86/tsc.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:40:45 2011 (r223426) @@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; + else + cpu_can_deep_sleep = 1; } sbuf_trim(&sb); sbuf_finish(&sb); Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/kern/kern_clocksource.c Wed Jun 22 16:40:45 2011 (r223426) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); cyclic_clock_func_t cyclic_clock_func = NULL; #endif +int cpu_can_deep_sleep = 0; /* C3 state is available. */ int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ static void setuptimer(void); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/sys/systm.h Wed Jun 22 16:40:45 2011 (r223426) @@ -253,6 +253,7 @@ void cpu_startprofclock(void); void cpu_stopprofclock(void); void cpu_idleclock(void); void cpu_activeclock(void); +extern int cpu_can_deep_sleep; extern int cpu_disable_deep_sleep; int cr_cansee(struct ucred *u1, struct ucred *u2); Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/x86/x86/tsc.c Wed Jun 22 16:40:45 2011 (r223426) @@ -444,6 +444,19 @@ init_TSC_tc(void) goto init; } + /* + * We cannot use the TSC if it stops incrementing in deep sleep. + * Currently only Intel CPUs are known for this problem unless + * the invariant TSC bit is set. + */ + if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && + (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { + tsc_timecounter.tc_quality = -1000; + if (bootverbose) + printf("TSC timecounter disabled: C3 enabled.\n"); + goto init; + } + #ifdef SMP /* * We can not use the TSC in SMP mode unless the TSCs on all CPUs are From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 16:47:14 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1A5106566C; Wed, 22 Jun 2011 16:47:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 530D58FC1A; Wed, 22 Jun 2011 16:47:12 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12636; Wed, 22 Jun 2011 19:47:11 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E021C8E.8010904@FreeBSD.org> Date: Wed, 22 Jun 2011 19:47:10 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201106221640.p5MGejHY057164@svn.freebsd.org> In-Reply-To: <201106221640.p5MGejHY057164@svn.freebsd.org> X-Enigmail-Version: 1.1.2 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: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 16:47:14 -0000 on 22/06/2011 19:40 Jung-uk Kim said the following: > Author: jkim > Date: Wed Jun 22 16:40:45 2011 > New Revision: 223426 > URL: http://svn.freebsd.org/changeset/base/223426 > > Log: > Set negative quality to TSC timecounter when C3 state is enabled for Intel > processors unless the invariant TSC bit of CPUID is set. Intel processors > may stop incrementing TSC when DPSLP# pin is asserted, according to Intel > processor manuals, i. e., TSC timecounter is useless if the processor can > enter deep sleep state (C3/C4). This problem was accidentally uncovered by > r222869, which increased timecounter quality of P-state invariant TSC, e.g., > for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c). > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > Ian FREISLICH (ianf at clue dot co dot za) > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > - Core2 Duo T5870 (C3 state available/enabled) > jkim - Xeon X5150 (C3 state unavailable) I think that this change should have a counterpart similar to what was done for event timers. That is, if a user forces use of TSC as a timecounter vis sysctl and it is known that TSC stops in the deep C-state, then the deep C-states should not be entered. This is what cpu_disable_deep_sleep does for LAPIC timers. > Modified: > head/sys/dev/acpica/acpi_cpu.c > head/sys/kern/kern_clocksource.c > head/sys/sys/systm.h > head/sys/x86/x86/tsc.c > > Modified: head/sys/dev/acpica/acpi_cpu.c > ============================================================================== > --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * > sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); > if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) > sc->cpu_non_c3 = i; > + else > + cpu_can_deep_sleep = 1; > } > sbuf_trim(&sb); > sbuf_finish(&sb); > > Modified: head/sys/kern/kern_clocksource.c > ============================================================================== > --- head/sys/kern/kern_clocksource.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/kern/kern_clocksource.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); > cyclic_clock_func_t cyclic_clock_func = NULL; > #endif > > +int cpu_can_deep_sleep = 0; /* C3 state is available. */ > int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ > > static void setuptimer(void); > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/sys/systm.h Wed Jun 22 16:40:45 2011 (r223426) > @@ -253,6 +253,7 @@ void cpu_startprofclock(void); > void cpu_stopprofclock(void); > void cpu_idleclock(void); > void cpu_activeclock(void); > +extern int cpu_can_deep_sleep; > extern int cpu_disable_deep_sleep; > > int cr_cansee(struct ucred *u1, struct ucred *u2); > > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/x86/x86/tsc.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -444,6 +444,19 @@ init_TSC_tc(void) > goto init; > } > > + /* > + * We cannot use the TSC if it stops incrementing in deep sleep. > + * Currently only Intel CPUs are known for this problem unless > + * the invariant TSC bit is set. > + */ > + if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && > + (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { > + tsc_timecounter.tc_quality = -1000; > + if (bootverbose) > + printf("TSC timecounter disabled: C3 enabled.\n"); > + goto init; > + } > + > #ifdef SMP > /* > * We can not use the TSC in SMP mode unless the TSCs on all CPUs are -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 17:02:31 2011 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 34F7A106564A; Wed, 22 Jun 2011 17:02:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 13:02:20 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> In-Reply-To: <4E021C8E.8010904@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106221302.23375.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 17:02:31 -0000 On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > on 22/06/2011 19:40 Jung-uk Kim said the following: > > Author: jkim > > Date: Wed Jun 22 16:40:45 2011 > > New Revision: 223426 > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > Log: > > Set negative quality to TSC timecounter when C3 state is > > enabled for Intel processors unless the invariant TSC bit of > > CPUID is set. Intel processors may stop incrementing TSC when > > DPSLP# pin is asserted, according to Intel processor manuals, i. > > e., TSC timecounter is useless if the processor can enter deep > > sleep state (C3/C4). This problem was accidentally uncovered by > > r222869, which increased timecounter quality of P-state invariant > > TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 > > (Family 6, Model 1c). > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > Ian FREISLICH (ianf at clue dot co dot za) > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > - Core2 Duo T5870 (C3 state available/enabled) > > jkim - Xeon X5150 (C3 state unavailable) > > I think that this change should have a counterpart similar to what > was done for event timers. That is, if a user forces use of TSC as > a timecounter vis sysctl and it is known that TSC stops in the deep > C-state, then the deep C-states should not be entered. This is > what cpu_disable_deep_sleep does for LAPIC timers. Yes. We have to teach tc_windup() to increase/decrease cpu_disable_deep_sleep. Currently, the user must disable C3 and force TSC timecounter manually if power consumption is not important, e.g., /etc/rc.conf: economy_cx_lowest="C2" /etc/sysctl.conf: kern.timecounter.hardware=TSC Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 17:55:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D263106566B; Wed, 22 Jun 2011 17:55:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4102F8FC08; Wed, 22 Jun 2011 17:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MHtHIg060108; Wed, 22 Jun 2011 17:55:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MHtHvC060105; Wed, 22 Jun 2011 17:55:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221755.p5MHtHvC060105@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 17:55: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: r223428 - in head/sys: amd64/pci i386/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 17:55:17 -0000 Author: jhb Date: Wed Jun 22 17:55:16 2011 New Revision: 223428 URL: http://svn.freebsd.org/changeset/base/223428 Log: Use uintXX_t instead of u_intXX_t. Modified: head/sys/amd64/pci/pci_bus.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Wed Jun 22 17:31:50 2011 (r223427) +++ head/sys/amd64/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428) @@ -135,7 +135,7 @@ static void legacy_pcib_identify(driver_t *driver, device_t parent) { int bus, slot, func; - u_int8_t hdrtype; + uint8_t hdrtype; int found = 0; int pcifunchigh; int found824xx = 0; @@ -178,8 +178,8 @@ legacy_pcib_identify(driver_t *driver, d /* * Read the IDs and class from the device. */ - u_int32_t id; - u_int8_t class, subclass, busnum; + uint32_t id; + uint8_t class, subclass, busnum; const char *s; device_t *devs; int ndevs, i; Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 17:31:50 2011 (r223427) +++ head/sys/i386/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428) @@ -62,7 +62,7 @@ legacy_pcib_maxslots(device_t dev) /* read configuration space register */ -u_int32_t +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) { @@ -73,7 +73,7 @@ legacy_pcib_read_config(device_t dev, u_ void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, - u_int reg, u_int32_t data, int bytes) + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } @@ -342,7 +342,7 @@ static void legacy_pcib_identify(driver_t *driver, device_t parent) { int bus, slot, func; - u_int8_t hdrtype; + uint8_t hdrtype; int found = 0; int pcifunchigh; int found824xx = 0; @@ -385,8 +385,8 @@ legacy_pcib_identify(driver_t *driver, d /* * Read the IDs and class from the device. */ - u_int32_t id; - u_int8_t class, subclass, busnum; + uint32_t id; + uint8_t class, subclass, busnum; const char *s; device_t *devs; int ndevs, i; From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 17:59:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15C681065673; Wed, 22 Jun 2011 17:59:54 +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 049C38FC19; Wed, 22 Jun 2011 17:59:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MHxr3Q060651; Wed, 22 Jun 2011 17:59:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MHxrDx060648; Wed, 22 Jun 2011 17:59:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221759.p5MHxrDx060648@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 17:59: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: r223429 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 17:59:54 -0000 Author: trasz Date: Wed Jun 22 17:59:53 2011 New Revision: 223429 URL: http://svn.freebsd.org/changeset/base/223429 Log: Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent from messages. Modified: head/sbin/growfs/growfs.8 head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Wed Jun 22 17:55:16 2011 (r223428) +++ head/sbin/growfs/growfs.8 Wed Jun 22 17:59:53 2011 (r223429) @@ -37,12 +37,12 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt GROWFS 8 .Os .Sh NAME .Nm growfs -.Nd grow size of an existing UFS file system +.Nd expand an existing UFS filesystem .Sh SYNOPSIS .Nm .Op Fl Ny @@ -58,26 +58,26 @@ Before starting .Nm the disk must be labeled to a bigger size using .Xr bsdlabel 8 . -If you wish to grow a file system beyond the boundary of -the slice it resides in, you must re-size the slice using -.Xr fdisk 8 +If you wish to grow a filesystem beyond the boundary of +the slice it resides in, you must resize the slice using +.Xr gpart 8 before running .Nm . If you are using volumes you must enlarge them by using -.Xr vinum 8 . +.Xr gvinum 8 . The .Nm -utility extends the size of the file system on the specified special file. +utility extends the size of the filesystem on the specified special file. Currently .Nm -can only enlarge unmounted file systems. -Do not try enlarging a mounted file system, your system may panic and you will -not be able to use the file system any longer. +can only enlarge unmounted filesystems. +Do not try enlarging a mounted filesystem, your system may panic and you will +not be able to use the filesystem any longer. Most of the .Xr newfs 8 options cannot be changed by .Nm . -In fact, you can only increase the size of the file system. +In fact, you can only increase the size of the filesystem. Use .Xr tunefs 8 for other changes. @@ -86,8 +86,8 @@ The following options are available: .Bl -tag -width indent .It Fl N .Dq Test mode . -Causes the new file system parameters to be printed out without actually -enlarging the file system. +Causes the new filesystem parameters to be printed out without actually +enlarging the filesystem. .It Fl y .Dq Expert mode . Usually @@ -102,12 +102,12 @@ So use this option with great care! .It Fl s Ar size Determines the .Ar size -of the file system after enlarging in sectors. +of the filesystem after enlarging in sectors. This value defaults to the size of the raw partition specified in .Ar special (in other words, .Nm -will enlarge the file system to the size of the entire partition). +will enlarge the filesystem to the size of the entire partition). .El .Sh EXAMPLES .Dl growfs -s 4194304 /dev/vinum/testvol @@ -119,12 +119,12 @@ up to 2GB if there is enough space in .Sh SEE ALSO .Xr bsdlabel 8 , .Xr dumpfs 8 , -.Xr fdisk 8 , .Xr ffsinfo 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 , -.Xr vinum 8 +.Xr gvinum 8 .Sh HISTORY The .Nm @@ -144,12 +144,12 @@ There may be cases on .Fx 3.x only, when .Nm -does not recognize properly whether or not the file system is mounted and +does not recognize properly whether or not the filesystem is mounted and exits with an error message. Then please use .Nm .Fl y -if you are sure that the file system is not mounted. +if you are sure that the filesystem is not mounted. It is also recommended to always use .Xr fsck 8 after enlarging (just to be on the safe side). @@ -183,8 +183,8 @@ on the first cylinder group to verify th in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP .Em cgr0 has enough blocks. -As a rule of thumb for default file system parameters one block is needed for -every 2 GB of total file system size. +As a rule of thumb for default filesystem parameters one block is needed for +every 2 GB of total filesystem size. .Pp Normally .Nm Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Wed Jun 22 17:55:16 2011 (r223428) +++ head/sbin/growfs/growfs.c Wed Jun 22 17:59:53 2011 (r223429) @@ -160,7 +160,7 @@ static void get_dev_size(int, int *); /* ************************************************************ growfs ***** */ /* - * Here we actually start growing the file system. We basically read the + * Here we actually start growing the filesystem. We basically read the * cylinder summary from the first cylinder group as we want to update * this on the fly during our various operations. First we handle the * changes in the former last cylinder group. Afterwards we create all new @@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag); /* - * Dump out summary information about file system. + * Dump out summary information about filesystem. */ # define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", @@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { /* * This should never happen as we would have had that panic - * already on file system creation + * already on filesystem creation */ errx(37, "panic: cylinder group too big"); } @@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs acg.cg_cs.cs_nifree--; } /* - * For the old file system, we have to initialize all the inodes. + * For the old filesystem, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); @@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct /* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be - * changed in any case, even if the file system ended exactly on the end of + * changed in any case, even if the filesystem ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number * of cylinders in the cylinder group. We start again by reading the cylinder * group from disk. If the last block was not fully available, we first handle @@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs * the rotational layout tables and the cluster summary. This is * also done per fragment for the first new block if the old file * system end was not on a block boundary, per fragment for the new - * last block if the new file system end is not on a block boundary, + * last block if the new filesystem end is not on a block boundary, * and per block for all space in between. * * Handle the first new block here if it was partially available @@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs /* * Check if the fragment just created could join an * already existing fragment at the former end of the - * file system. + * filesystem. */ if(isblock(&sblock, cg_blksfree(&acg), ((osblock.fs_size - cgbase(&sblock, cylno))/ @@ -931,7 +931,7 @@ updjcg(int cylno, time_t modtime, int fs * Option (1) is considered to be less intrusive to the structure of the file- * system. So we try to stick to that whenever possible. If there is not enough * space in the cylinder group containing the cylinder summary we have to use - * method (2). In case of active snapshots in the file system we probably can + * method (2). In case of active snapshots in the filesystem we probably can * completely avoid implementing copy on write if we stick to method (2) only. */ static void @@ -1287,7 +1287,7 @@ updcsloc(time_t modtime, int fsi, int fs /* * No cluster handling is needed here, as there was at least * one fragment in use by the cylinder summary in the old - * file system. + * filesystem. * No block-free counter handling here as this block was not * a free block. */ @@ -1597,7 +1597,7 @@ wtfs(ufs2_daddr_t bno, size_t size, void /* * Here we allocate a free block in the current cylinder group. It is assumed, * that acg contains the current cylinder group. As we may take a block from - * somewhere in the file system we have to handle cluster summary here. + * somewhere in the filesystem we have to handle cluster summary here. */ static ufs2_daddr_t alloc(void) @@ -1939,9 +1939,9 @@ get_dev_size(int fd, int *size) /* ************************************************************** main ***** */ /* * growfs(8) is a utility which allows to increase the size of an existing - * ufs file system. Currently this can only be done on unmounted file system. + * ufs filesystem. Currently this can only be done on unmounted filesystem. * It recognizes some command line options to specify the new desired size, - * and it does some basic checkings. The old file system size is determined + * and it does some basic checkings. The old filesystem size is determined * and after some more checks like we can really access the new last block * on the disk etc. we calculate the new parameters for the superblock. After * having done this we just call growfs() which will do the work. Before @@ -1953,11 +1953,11 @@ get_dev_size(int fd, int *size) * are lucky, then we only have to handle our blocks to be relocated in that * way. * Also we have to consider in what order we actually update the critical - * data structures of the file system to make sure, that in case of a disaster + * data structures of the filesystem to make sure, that in case of a disaster * fsck(8) is still able to restore any lost data. * The foreseen last step then will be to provide for growing even mounted - * file systems. There we have to extend the mount() system call to provide - * userland access to the file system locking facility. + * filesystems. There we have to extend the mount() system call to provide + * userland access to the filesystem locking facility. */ int main(int argc, char **argv) @@ -2088,7 +2088,7 @@ main(int argc, char **argv) } /* - * Check if that partition is suitable for growing a file system. + * Check if that partition is suitable for growing a filesystem. */ if (p_size < 1) { errx(1, "partition is unavailable"); @@ -2146,8 +2146,8 @@ main(int argc, char **argv) if(ExpertFlag == 0) { for(j=0; j Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BEAE106566B; Wed, 22 Jun 2011 18:02:28 +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 5BEB48FC0C; Wed, 22 Jun 2011 18:02:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MI2SRv060799; Wed, 22 Jun 2011 18:02:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MI2S2e060796; Wed, 22 Jun 2011 18:02:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221802.p5MI2S2e060796@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 18:02: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: r223430 - in head/sbin: newfs tunefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 18:02:28 -0000 Author: trasz Date: Wed Jun 22 18:02:28 2011 New Revision: 223430 URL: http://svn.freebsd.org/changeset/base/223430 Log: Advertise growfs(8) a little better. Modified: head/sbin/newfs/newfs.8 head/sbin/tunefs/tunefs.8 Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Wed Jun 22 17:59:53 2011 (r223429) +++ head/sbin/newfs/newfs.8 Wed Jun 22 18:02:28 2011 (r223430) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 25, 2011 +.Dd June 22, 2011 .Dt NEWFS 8 .Os .Sh NAME @@ -297,6 +297,7 @@ on file systems that contain many small .Xr dumpfs 8 , .Xr fsck 8 , .Xr gjournal 8 , +.Xr growfs 8 , .Xr makefs 8 , .Xr mount 8 , .Xr tunefs 8 , Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Wed Jun 22 17:59:53 2011 (r223429) +++ head/sbin/tunefs/tunefs.8 Wed Jun 22 18:02:28 2011 (r223430) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt TUNEFS 8 .Os .Sh NAME @@ -165,6 +165,7 @@ specified mount point. .Xr fs 5 , .Xr dumpfs 8 , .Xr gjournal 8 , +.Xr growfs 8 , .Xr newfs 8 .Rs .%A M. McKusick From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 18:48:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB31106566C; Wed, 22 Jun 2011 18:48:07 +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 6AC9C8FC16; Wed, 22 Jun 2011 18:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MIm7LD062289; Wed, 22 Jun 2011 18:48:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MIm7O4062286; Wed, 22 Jun 2011 18:48:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221848.p5MIm7O4062286@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 18:48: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: r223433 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 18:48:07 -0000 Author: jhb Date: Wed Jun 22 18:48:07 2011 New Revision: 223433 URL: http://svn.freebsd.org/changeset/base/223433 Log: Oops, missed these in 223424. Reported by: jkim Modified: head/sys/amd64/include/pci_cfgreg.h head/sys/i386/include/pci_cfgreg.h Modified: head/sys/amd64/include/pci_cfgreg.h ============================================================================== --- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:22:53 2011 (r223432) +++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433) @@ -37,6 +37,7 @@ #define CONF1_ENABLE_MSK1 0x80000001ul #define CONF1_ENABLE_RES1 0x80000000ul +u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); Modified: head/sys/i386/include/pci_cfgreg.h ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:22:53 2011 (r223432) +++ head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433) @@ -43,6 +43,7 @@ #define CONF2_ENABLE_CHK 0x0e #define CONF2_ENABLE_RES 0x0e +u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 18:55:19 2011 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 2D1251065670; Wed, 22 Jun 2011 18:55:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 14:55:05 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> In-Reply-To: <4E021C8E.8010904@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_LqjAOQlSv1JdSAI" Message-Id: <201106221455.07540.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 18:55:19 -0000 --Boundary-00=_LqjAOQlSv1JdSAI Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > on 22/06/2011 19:40 Jung-uk Kim said the following: > > Author: jkim > > Date: Wed Jun 22 16:40:45 2011 > > New Revision: 223426 > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > Log: > > Set negative quality to TSC timecounter when C3 state is > > enabled for Intel processors unless the invariant TSC bit of > > CPUID is set. Intel processors may stop incrementing TSC when > > DPSLP# pin is asserted, according to Intel processor manuals, i. > > e., TSC timecounter is useless if the processor can enter deep > > sleep state (C3/C4). This problem was accidentally uncovered by > > r222869, which increased timecounter quality of P-state invariant > > TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 > > (Family 6, Model 1c). > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > Ian FREISLICH (ianf at clue dot co dot za) > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > - Core2 Duo T5870 (C3 state available/enabled) > > jkim - Xeon X5150 (C3 state unavailable) > > I think that this change should have a counterpart similar to what > was done for event timers. That is, if a user forces use of TSC as > a timecounter vis sysctl and it is known that TSC stops in the deep > C-state, then the deep C-states should not be entered. This is > what cpu_disable_deep_sleep does for LAPIC timers. Can you please review/test the attached patch? Also available from here: http://people.freebsd.org/~jkim/tc_c3stop.diff Thanks! Jung-uk Kim --Boundary-00=_LqjAOQlSv1JdSAI Content-Type: text/plain; charset="iso-8859-1"; name="tc_c3stop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_c3stop.diff" Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c (revision 223426) +++ sys/kern/kern_tc.c (working copy) @@ -492,6 +492,10 @@ tc_windup(void) /* Now is a good time to change timecounters. */ if (th->th_counter != timecounter) { + if ((timecounter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep++; + if ((th->th_counter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep--; th->th_counter = timecounter; th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / Index: sys/sparc64/sparc64/counter.c =================================================================== --- sys/sparc64/sparc64/counter.c (revision 223426) +++ sys/sparc64/sparc64/counter.c (working copy) @@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; + tc->tc_flags = 0; tc_init(tc); } Index: sys/sys/timetc.h =================================================================== --- sys/sys/timetc.h (revision 223426) +++ sys/sys/timetc.h (working copy) @@ -57,6 +57,8 @@ struct timecounter { * another timecounter higher means better. Negative * means "only use at explicit request". */ + u_int tc_flags; +#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */ void *tc_priv; /* Pointer to the timecounter's private parts. */ Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 223426) +++ sys/x86/x86/tsc.c (working copy) @@ -451,6 +451,7 @@ init_TSC_tc(void) */ if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { + tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP; tsc_timecounter.tc_quality = -1000; if (bootverbose) printf("TSC timecounter disabled: C3 enabled.\n"); --Boundary-00=_LqjAOQlSv1JdSAI-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 18:58:46 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96142106566B; Wed, 22 Jun 2011 18:58:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 2DB168FC16; Wed, 22 Jun 2011 18:58:45 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MIwhI4017074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 04:58:44 +1000 Date: Thu, 23 Jun 2011 04:58:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201106220948.02421.jhb@freebsd.org> Message-ID: <20110623045454.U1550@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <201106220948.02421.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 18:58:46 -0000 On Wed, 22 Jun 2011, John Baldwin wrote: > On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>> ... >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they might >> not exist. Apparently they don't exist on mips. jake@ fixed all their >> old uses for sparc4 in ~Y2K. > > I agree. Is there any harm in having the 'dirty' and 'valid' fields in > vm_page always be at least of size 'int'? > > In the case of amd64, vm_page would change from a size of 120 bytes to 128. > > On i386 I think you'd end up changing the size from 68 to 76. > > (Using an int results in alignment padding after 'busy'.) That is quite a bit. Perhaps the struct should be packed better so that each char -> int expansion takes <= 3 bytes instead of >= 4. The expansion might even be negative. It is only moderately well packed now. > Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of > RAM, so around 0.18% of RAM would be used on both platforms (presumably the > usage would be similar on other platforms as well). At 24 GB of RAM, the > extra space is just under 0.20% of RAM (48M). Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 19:14:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C1D51065672; Wed, 22 Jun 2011 19:14:50 +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 3BF548FC0C; Wed, 22 Jun 2011 19:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MJEoEr063113; Wed, 22 Jun 2011 19:14:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MJEoLq063111; Wed, 22 Jun 2011 19:14:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221914.p5MJEoLq063111@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 19:14: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: r223434 - head/libexec/ftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 19:14:50 -0000 Author: trasz Date: Wed Jun 22 19:14:49 2011 New Revision: 223434 URL: http://svn.freebsd.org/changeset/base/223434 Log: Add LOGIN_SETCPUMASK and LOGIN_SETLOGINCLASS to the setusercontext(3) calls in ftpd(8). Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Wed Jun 22 18:48:07 2011 (r223433) +++ head/libexec/ftpd/ftpd.c Wed Jun 22 19:14:49 2011 (r223434) @@ -1191,9 +1191,9 @@ end_login(void) ftpd_logwtmp(wtmpid, NULL, NULL); pw = NULL; #ifdef LOGIN_CAP - setusercontext(NULL, getpwuid(0), 0, - LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK| - LOGIN_SETMAC); + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); #endif #ifdef USE_PAM if (pamh) { @@ -1465,9 +1465,8 @@ skip: return; } } - setusercontext(lc, pw, 0, - LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY| - LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC); + setusercontext(lc, pw, 0, LOGIN_SETALL & + ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 19:31:36 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 802FB106566B; Wed, 22 Jun 2011 19:31:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 137F48FC19; Wed, 22 Jun 2011 19:31:35 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MJVPgO031151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 05:31:26 +1000 Date: Thu, 23 Jun 2011 05:31:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> Message-ID: <20110623050025.O1587@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Alan Cox , Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 19:31:36 -0000 On Wed, 22 Jun 2011, Warner Losh wrote: > On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote: > >> 2011/6/22 Warner Losh : >>> >>> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>> >>> On 06/21/2011 16:09, Attilio Rao wrote: >>> >>> 2011/6/21 Bruce Evans: >>> >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>> >>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>> >>> Hi Alan, >>> >>> Author: alc >>> >>> Date: Sun Jun 19 19:13:24 2011 >>> >>> New Revision: 223307 >>> >>> URL: http://svn.freebsd.org/changeset/base/223307 >>> >>> Log: >>> >>> Precisely document the synchronization rules for the page's dirty field. >>> >>> (Saying that the lock on the object that the page belongs to must be >>> >>> held >>> >>> only represents one aspect of the rules.) >>> >>> Eliminate the use of the page queues lock for atomically performing >>> >>> read- >>> >>> modify-write operations on the dirty field when the underlying >>> >>> architecture >>> >>> supports atomic operations on char and short types. >>> >>> Document the fact that 32KB pages aren't really supported. >>> >>> contrary to the tinderbox I'd like to point out that all mips kernels >>> >>> built by universe are broken with a SVN HEAD from earlier today. Could you >>> >>> please check and see if you can fix it? The errors I get are: >>> >>> vm_page.o: In function `vm_page_clear_dirty': >>> >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >>> >>> against `atomic_clear_8' >>> >>> vm_page.o: In function `vm_page_set_validclean': >>> >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >>> >>> against `atomic_clear_8' >>> >>> Atomic types shorter than int cannot be used in MI code, since they might >>> >>> not exist. Apparently they don't exist on mips. jake@ fixed all their >>> >>> old uses for sparc4 in ~Y2K. >>> >>> I'm sure they do, they exist in support.S though and may not have the >>> >>> _8 form (they may just have the _char version). I may look at the code >>> >>> again to be sure. >>> >>> >>> It appears that while mips/include/atomic.h declares the existence of >>> atomic_clear_8, mips/mips/support.S doesn't implement it. In other words, >>> only support for int's and short's is currently implemented, not char's: >>> >>> # grep atomic_clear mips/mips/support.S >>> * atomic_clear_32(u_int32_t *a, u_int32_t b) >>> LEAF(atomic_clear_32) >>> END(atomic_clear_32) >>> * atomic_clear_16(u_int16_t *a, u_int16_t b) >>> LEAF(atomic_clear_16) >>> END(atomic_clear_16) >>> >>> The current crop of atomic*16 and atomic*8 functions have the restriction >>> that the address must be 32-bit aligned (and it forces this by aligning to >>> 32-bits silently and then operates on the low 8 or 16 bits in that word!) >>> I'm guessing that this is likely just wrong. Comments? >>> Warner >> >> That is wrong, of course, and my personal opinion is that one should >> not implement atomic operations if they cannot be done efficiently >> (example: if you need to disable interrupts or similar expensive >> operation just to assure atomicity of operation, just don't support >> it) as long as not having _8/_char is perfectly fine. > > I think it can be efficient, for some reasonable definition of efficient. The masking and shifting operations aren't that onerous to write and the instructions cycles would be dwarfed by the ll/sc pair, which are required to implement atomic. > > The issue is that the code today is clearly wrong and needs to be fixed. I think it is still good to discourage use of non-bus-width atomic ops by not supporting at the MI level them for any arch. Suppose only bus-width accesses are atomic, as seems to be the case on mips. Then you can still do atomic accesses on bytes by doing an atomic op on the neigbouring 3 or 7 bytes. But this may increase memory contention by a factor of 3 or 7. The contention can be reduced either by putting only rarely-accessed bytes near the bytes that need the atomic ops, or by putting unused padding there, or by not using byte-sized objects to begin with (this gives the same effect and even the same memory accesses as unused padding bytes -- there are unused bits in the objects instead of external unused bytes). The former can be arranged easily enough in the vm_page struct. But MI code shouldn't know about this. Suppose byte accesses are atomic at the instruction level. Then the hardware probably still needs to expand to the bus width. Depending on how well it virtualizes this, there may be the same factor of 3, 7 or more in memory contention. The relevant bus width may be the cache line size which on modern CPUs is much more than 4 bytes and probably more like 32. So the CPU must already being doing good virtualization to make 4-byte atomic accesses not too slow (non-atomic accesses are already virtualized by the caches). For efficiency, we really should pay more attention to packing related int variables into cache lines (either the same line to increase cache hits or separate lines, to reduce contention), but the best way to do this is very MD and unclear. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 19:47:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D308A106566C; Wed, 22 Jun 2011 19:47:45 +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 C391F8FC12; Wed, 22 Jun 2011 19:47:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MJljQo064177; Wed, 22 Jun 2011 19:47:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MJljhJ064175; Wed, 22 Jun 2011 19:47:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106221947.p5MJljhJ064175@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jun 2011 19:47: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: r223436 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 19:47:45 -0000 Author: rmacklem Date: Wed Jun 22 19:47:45 2011 New Revision: 223436 URL: http://svn.freebsd.org/changeset/base/223436 Log: Fix the new NFSv4 client so that it uses the same uid as was used for doing a mount when performing system operations on AUTH_SYS mounts. This resolved an issue when mounting a Linux server. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 19:42:32 2011 (r223435) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 19:47:45 2011 (r223436) @@ -526,6 +526,20 @@ newnfs_request(struct nfsrv_descript *nd else secflavour = RPCSEC_GSS_KRB5; srv_principal = NFSMNT_SRVKRBNAME(nmp); + } else if (nmp != NULL && !NFSHASKERB(nmp) && + nd->nd_procnum != NFSPROC_NULL && + (nd->nd_flag & ND_USEGSSNAME) != 0) { + /* + * Use the uid that did the mount when the RPC is doing + * NFSv4 system operations, as indicated by the + * ND_USEGSSNAME flag, for the AUTH_SYS case. + */ + saved_uid = cred->cr_uid; + if (nmp->nm_uid != (uid_t)-1) + cred->cr_uid = nmp->nm_uid; + else + cred->cr_uid = 0; + set_uid = 1; } if (nmp != NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 19:55:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E33106566C; Wed, 22 Jun 2011 19:55:22 +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 4ABF38FC14; Wed, 22 Jun 2011 19:55:21 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MJtJDV030637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 05:55:20 +1000 Date: Thu, 23 Jun 2011 05:55:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala In-Reply-To: <201106221759.p5MHxrDx060648@svn.freebsd.org> Message-ID: <20110623054328.V1770@besplex.bde.org> References: <201106221759.p5MHxrDx060648@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223429 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 19:55:22 -0000 On Wed, 22 Jun 2011, Edward Tomasz Napierala wrote: > Log: > Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent > from messages. The first part seems backwards. It undoes the 2002 change that does s/filesystem/file system/g, except the 2002 change was not restricted to growfs. 'file system' seems best English in most contexts, but not all, so such changes should not be done mechanically. 'filesystem' might be best German or Danish. I like to use 'file system' for individual file systems, but `filesystem' for things like the handler of a file system. But I don't like renaming things and wouldn't touch this :-). > Modified: head/sbin/growfs/growfs.8 > ============================================================================== > --- head/sbin/growfs/growfs.8 Wed Jun 22 17:55:16 2011 (r223428) > +++ head/sbin/growfs/growfs.8 Wed Jun 22 17:59:53 2011 (r223429) > @@ -37,12 +37,12 @@ > .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ > .\" $FreeBSD$ > .\" > -.Dd May 8, 2011 > +.Dd June 22, 2011 > .Dt GROWFS 8 > .Os > .Sh NAME > .Nm growfs > -.Nd grow size of an existing UFS file system > +.Nd expand an existing UFS filesystem Also, UFS doesn't exist. See ffs(7), the fastfs paper in /usr/share/doc, and ufs(nonexistent). I would use 'file system' here since it is an individual file system being expanded, and 'filesystem' for the ffs filesystem implementation. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 20:00:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3DC1065672; Wed, 22 Jun 2011 20:00:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D85F8FC0C; Wed, 22 Jun 2011 20:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MK0SGW064664; Wed, 22 Jun 2011 20:00:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MK0STg064659; Wed, 22 Jun 2011 20:00:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106222000.p5MK0STg064659@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 22 Jun 2011 20:00: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: r223437 - head/sys/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: Wed, 22 Jun 2011 20:00:28 -0000 Author: ae Date: Wed Jun 22 20:00:27 2011 New Revision: 223437 URL: http://svn.freebsd.org/changeset/base/223437 Log: Export AddLink() function from libalias. It can be used when custom alias address needs to be specified. Add inbound handler to the alias_ftp module. It helps handle active FTP transfer mode for the case with external clients and FTP server behind NAT. Fix passive FTP transfer case for server behind NAT using redirect with external IP address different from NAT ip address. PR: kern/157957 Submitted by: Alexander V. Chernikov Modified: head/sys/netinet/libalias/alias_db.c head/sys/netinet/libalias/alias_ftp.c head/sys/netinet/libalias/alias_local.h head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_db.c Wed Jun 22 20:00:27 2011 (r223437) @@ -552,10 +552,6 @@ static void IncrementalCleanup(struct li static void DeleteLink(struct alias_link *); static struct alias_link * -AddLink(struct libalias *, struct in_addr, struct in_addr, struct in_addr, - u_short, u_short, int, int); - -static struct alias_link * ReLink(struct alias_link *, struct in_addr, struct in_addr, struct in_addr, u_short, u_short, int, int); @@ -572,9 +568,6 @@ static struct alias_link * #define ALIAS_PORT_MASK_EVEN 0x07ffe #define GET_NEW_PORT_MAX_ATTEMPTS 20 -#define GET_ALIAS_PORT -1 -#define GET_ALIAS_ID GET_ALIAS_PORT - #define FIND_EVEN_ALIAS_BASE 1 /* GetNewPort() allocates port numbers. Note that if a port number @@ -937,17 +930,12 @@ DeleteLink(struct alias_link *lnk) } -static struct alias_link * -AddLink(struct libalias *la, struct in_addr src_addr, - struct in_addr dst_addr, - struct in_addr alias_addr, - u_short src_port, - u_short dst_port, - int alias_port_param, /* if less than zero, alias */ - int link_type) -{ /* port will be automatically *//* chosen. - * If greater than */ - u_int start_point; /* zero, equal to alias port */ +struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_port_param, int link_type) +{ + u_int start_point; struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_ftp.c Wed Jun 22 20:00:27 2011 (r223437) @@ -100,38 +100,68 @@ __FBSDID("$FreeBSD$"); #define FTP_CONTROL_PORT_NUMBER 21 static void -AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, - int maxpacketsize); +AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, + int maxpacketsize); +static void +AliasHandleFtpIn(struct libalias *, struct ip *, struct alias_link *); -static int -fingerprint(struct libalias *la, struct alias_data *ah) +static int +fingerprint_out(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || - ah->maxpktsize == 0) + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + ah->maxpktsize == 0) return (-1); - if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER - || ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) return (0); return (-1); } -static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +static int +fingerprint_in(struct libalias *la, struct alias_data *ah) +{ + + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) + return (-1); + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + return (0); + return (-1); +} + +static int +protohandler_out(struct libalias *la, struct ip *pip, struct alias_data *ah) { - + AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); } + +static int +protohandler_in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ + + AliasHandleFtpIn(la, pip, ah->lnk); + return (0); +} + struct proto_handler handlers[] = { - { - .pri = 80, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, - .protohandler = &protohandler - }, + { + .pri = 80, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint_out, + .protohandler = &protohandler_out + }, + { + .pri = 80, + .dir = IN, + .proto = TCP, + .fingerprint = &fingerprint_in, + .protohandler = &protohandler_in + }, { EOH } }; @@ -256,6 +286,57 @@ AliasHandleFtpOut( } } +static void +AliasHandleFtpIn(struct libalias *la, + struct ip *pip, /* IP packet to examine/patch */ + struct alias_link *lnk) /* The link to go through (aliased port) */ +{ + int hlen, tlen, dlen, pflags; + char *sptr; + struct tcphdr *tc; + + /* Calculate data length of TCP packet */ + tc = (struct tcphdr *)ip_next(pip); + hlen = (pip->ip_hl + tc->th_off) << 2; + tlen = ntohs(pip->ip_len); + dlen = tlen - hlen; + + /* Place string pointer and beginning of data */ + sptr = (char *)pip; + sptr += hlen; + + /* + * Check that data length is not too long and previous message was + * properly terminated with CRLF. + */ + pflags = GetProtocolFlags(lnk); + if (dlen <= MAX_MESSAGE_SIZE && (pflags & WAIT_CRLF) == 0 && + ntohs(tc->th_dport) == FTP_CONTROL_PORT_NUMBER && + (ParseFtpPortCommand(la, sptr, dlen) != 0 || + ParseFtpEprtCommand(la, sptr, dlen) != 0)) { + /* + * Alias active mode client requesting data from server + * behind NAT. We need to alias server->client connection + * to external address client is connecting to. + */ + AddLink(la, GetOriginalAddress(lnk), la->true_addr, + GetAliasAddress(lnk), htons(FTP_CONTROL_PORT_NUMBER - 1), + htons(la->true_port), GET_ALIAS_PORT, IPPROTO_TCP); + } + /* Track the msgs which are CRLF term'd for PORT/PASV FW breach */ + if (dlen) { + sptr = (char *)pip; /* start over at beginning */ + tlen = ntohs(pip->ip_len); /* recalc tlen, pkt may + * have grown. + */ + if (sptr[tlen - 2] == '\r' && sptr[tlen - 1] == '\n') + pflags &= ~WAIT_CRLF; + else + pflags |= WAIT_CRLF; + SetProtocolFlags(lnk, pflags); + } +} + static int ParseFtpPortCommand(struct libalias *la, char *sptr, int dlen) { @@ -576,9 +657,10 @@ NewFtpMessage(struct libalias *la, struc if (la->true_port < IPPORT_RESERVED) return; -/* Establish link to address and port found in FTP control message. */ - ftp_lnk = FindUdpTcpOut(la, la->true_addr, GetDestAddress(lnk), - htons(la->true_port), 0, IPPROTO_TCP, 1); + /* Establish link to address and port found in FTP control message. */ + ftp_lnk = AddLink(la, la->true_addr, GetDestAddress(lnk), + GetAliasAddress(lnk), htons(la->true_port), 0, GET_ALIAS_PORT, + IPPROTO_TCP); if (ftp_lnk != NULL) { int slen, hlen, tlen, dlen; Modified: head/sys/netinet/libalias/alias_local.h ============================================================================== --- head/sys/netinet/libalias/alias_local.h Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_local.h Wed Jun 22 20:00:27 2011 (r223437) @@ -67,6 +67,9 @@ #define LINK_TABLE_OUT_SIZE 4001 #define LINK_TABLE_IN_SIZE 4001 +#define GET_ALIAS_PORT -1 +#define GET_ALIAS_ID GET_ALIAS_PORT + struct proxy_entry; struct libalias { @@ -249,6 +252,10 @@ DifferentialChecksum(u_short * _cksum, v /* Internal data access */ struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_param, int link_type); +struct alias_link * FindIcmpIn(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, u_short _id_alias, int _create); struct alias_link * Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/libalias.3 Wed Jun 22 20:00:27 2011 (r223437) @@ -824,6 +824,17 @@ argument is the pointer to a header frag is the pointer to the packet to be de-aliased. .Ed .Sh MISCELLANEOUS FUNCTIONS +.Ft struct alias_link * +.Fn AddLink "struct libalias *" "struct in_addr src_addr" "struct in_addr dst_addr" \ +"struct in_addr alias_addr" "u_short src_port" "u_short dst_port" \ +"int alias_param" "int link_type" +.Bd -ragged -offset indent +This function adds new state to instance hash table. +Zero can be specified instead of dst_address and/or dst port. +This makes link partially specified dynamic. +However due to hashing method such links can be resolved on inbound (ext -> int) only. +.Ed +.Pp .Ft void .Fn LibAliasSetTarget "struct libalias *" "struct in_addr addr" .Bd -ragged -offset indent From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 21:04:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B968106566B; Wed, 22 Jun 2011 21:04:14 +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 4DDAA8FC18; Wed, 22 Jun 2011 21:04:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ML4EYN068576; Wed, 22 Jun 2011 21:04:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ML4Ef7068567; Wed, 22 Jun 2011 21:04:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106222104.p5ML4Ef7068567@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 21:04: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: r223440 - in head/sys: amd64/include amd64/pci conf i386/include i386/pci x86/include x86/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 21:04:14 -0000 Author: jhb Date: Wed Jun 22 21:04:13 2011 New Revision: 223440 URL: http://svn.freebsd.org/changeset/base/223440 Log: Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to the x86 tree. The $PIR code is still only enabled on i386 and not amd64. While here, make the qpi(4) driver on conditional on 'device pci'. Added: head/sys/x86/include/pci_cfgreg.h - copied, changed from r223433, head/sys/i386/include/pci_cfgreg.h head/sys/x86/pci/pci_bus.c - copied, changed from r223428, head/sys/i386/pci/pci_bus.c Deleted: head/sys/amd64/pci/pci_bus.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/include/pci_cfgreg.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/include/param.h head/sys/i386/include/pci_cfgreg.h Modified: head/sys/amd64/include/pci_cfgreg.h ============================================================================== --- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -1,44 +1,6 @@ /*- - * Copyright (c) 1997, Stefan Esser - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * + * This file is in the public domain. */ +/* $FreeBSD$ */ -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc - -#define CONF1_ENABLE 0x80000000ul -#define CONF1_ENABLE_CHK 0x80000000ul -#define CONF1_ENABLE_MSK 0x7f000000ul -#define CONF1_ENABLE_CHK1 0xff000001ul -#define CONF1_ENABLE_MSK1 0x80000001ul -#define CONF1_ENABLE_RES1 0x80000000ul - -u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); -int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); -int pci_cfgregopen(void); -u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#include Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.amd64 Wed Jun 22 21:04:13 2011 (r223440) @@ -128,7 +128,6 @@ amd64/amd64/trap.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard -amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/aesni/aesencdec_amd64.S optional aesni crypto/aesni/aeskeys_amd64.S optional aesni @@ -315,7 +314,8 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.i386 Wed Jun 22 21:04:13 2011 (r223440) @@ -352,7 +352,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -405,7 +404,8 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.pc98 Wed Jun 22 21:04:13 2011 (r223440) @@ -199,7 +199,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -249,6 +248,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/pci/pci_bus.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/i386/include/param.h Wed Jun 22 21:04:13 2011 (r223440) @@ -56,6 +56,7 @@ #define __HAVE_ACPI +#define __HAVE_PIR #define __PCI_REROUTE_INTERRUPT #ifndef MACHINE Modified: head/sys/i386/include/pci_cfgreg.h ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/i386/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -1,53 +1,6 @@ /*- - * Copyright (c) 1997, Stefan Esser - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * + * This file is in the public domain. */ +/* $FreeBSD$ */ -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc - -#define CONF1_ENABLE 0x80000000ul -#define CONF1_ENABLE_CHK 0x80000000ul -#define CONF1_ENABLE_MSK 0x7f000000ul -#define CONF1_ENABLE_CHK1 0xff000001ul -#define CONF1_ENABLE_MSK1 0x80000001ul -#define CONF1_ENABLE_RES1 0x80000000ul - -#define CONF2_ENABLE_PORT 0x0cf8 -#define CONF2_FORWARD_PORT 0x0cfa - -#define CONF2_ENABLE_CHK 0x0e -#define CONF2_ENABLE_RES 0x0e - -u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); -int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); -int pci_cfgregopen(void); -u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); -void pci_pir_open(void); -int pci_pir_probe(int bus, int require_parse); -int pci_pir_route_interrupt(int bus, int device, int func, int pin); +#include Copied and modified: head/sys/x86/include/pci_cfgreg.h (from r223433, head/sys/i386/include/pci_cfgreg.h) ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433, copy source) +++ head/sys/x86/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -27,6 +27,9 @@ * */ +#ifndef __X86_PCI_CFGREG_H__ +#define __X86_PCI_CFGREG_H__ + #define CONF1_ADDR_PORT 0x0cf8 #define CONF1_DATA_PORT 0x0cfc @@ -48,6 +51,10 @@ int pcie_cfgregopen(uint64_t base, uint int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#ifdef __HAVE_PIR void pci_pir_open(void); int pci_pir_probe(int bus, int require_parse); int pci_pir_route_interrupt(int bus, int device, int func, int pin); +#endif + +#endif /* !__X86_PCI_CFGREG_H__ */ Copied and modified: head/sys/x86/pci/pci_bus.c (from r223428, head/sys/i386/pci/pci_bus.c) ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428, copy source) +++ head/sys/x86/pci/pci_bus.c Wed Jun 22 21:04:13 2011 (r223440) @@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" -static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, - int pin); - int legacy_pcib_maxslots(device_t dev) { @@ -78,6 +75,21 @@ legacy_pcib_write_config(device_t dev, u pci_cfgregwrite(bus, slot, func, reg, data, bytes); } +/* route interrupt */ + +static int +legacy_pcib_route_interrupt(device_t pcib, device_t dev, int pin) +{ + +#ifdef __HAVE_PIR + return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev), pin)); +#else + /* No routing possible */ + return (PCI_INVALID_IRQ); +#endif +} + /* Pass MSI requests up to the nexus. */ static int @@ -115,6 +127,7 @@ legacy_pcib_is_host_bridge(int bus, int uint32_t id, uint8_t class, uint8_t subclass, uint8_t *busnum) { +#ifdef __i386__ const char *s = NULL; static uint8_t pxb[4]; /* hack for 450nx */ @@ -332,6 +345,14 @@ legacy_pcib_is_host_bridge(int bus, int } return s; +#else + const char *s = NULL; + + *busnum = 0; + if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST) + s = "Host to PCI bridge"; + return s; +#endif } /* @@ -471,19 +492,23 @@ legacy_pcib_probe(device_t dev) static int legacy_pcib_attach(device_t dev) { +#ifdef __HAVE_PIR device_t pir; +#endif int bus; + bus = pcib_get_bus(dev); +#ifdef __HAVE_PIR /* * Look for a PCI BIOS interrupt routing table as that will be * our method of routing interrupts if we have one. */ - bus = pcib_get_bus(dev); if (pci_pir_probe(bus, 0)) { pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0); if (pir != NULL) device_probe_and_attach(pir); } +#endif device_add_child(dev, "pci", bus); return bus_generic_attach(dev); } @@ -587,7 +612,7 @@ static device_method_t legacy_pcib_metho DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), DEVMETHOD(pcib_read_config, legacy_pcib_read_config), DEVMETHOD(pcib_write_config, legacy_pcib_write_config), - DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt), + DEVMETHOD(pcib_route_interrupt, legacy_pcib_route_interrupt), DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi), DEVMETHOD(pcib_release_msi, pcib_release_msi), DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix), @@ -651,7 +676,7 @@ static devclass_t pcibus_pnp_devclass; DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1); DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0); - +#ifdef __HAVE_PIR /* * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges * that appear in the PCIBIOS Interrupt Routing Table to use the routing @@ -664,7 +689,7 @@ static device_method_t pcibios_pcib_pci_ DEVMETHOD(device_probe, pcibios_pcib_probe), /* pcib interface */ - DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt), + DEVMETHOD(pcib_route_interrupt, legacy_pcib_route_interrupt), {0, 0} }; @@ -691,10 +716,4 @@ pcibios_pcib_probe(device_t dev) device_set_desc(dev, "PCIBIOS PCI-PCI bridge"); return (-2000); } - -static int -pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin) -{ - return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev), pin)); -} +#endif From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 21:10:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD7241065679; Wed, 22 Jun 2011 21:10:12 +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 A9C208FC08; Wed, 22 Jun 2011 21:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MLACEs068781; Wed, 22 Jun 2011 21:10:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLACwx068779; Wed, 22 Jun 2011 21:10:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106222110.p5MLACwx068779@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jun 2011 21:10: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: r223441 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 21:10:12 -0000 Author: rmacklem Date: Wed Jun 22 21:10:12 2011 New Revision: 223441 URL: http://svn.freebsd.org/changeset/base/223441 Log: Plug an mbuf leak in the new NFS client that occurred when a server replied NFS3ERR_JUKEBOX/NFS4ERR_DELAY to an rpc. This affected both NFSv3 and NFSv4. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 21:04:13 2011 (r223440) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 21:10:12 2011 (r223441) @@ -733,6 +733,8 @@ tryagain: while (NFSD_MONOSEC < waituntil) (void) nfs_catnap(PZERO, 0, "nfstry"); trylater_delay *= 2; + m_freem(nd->nd_mrep); + nd->nd_mrep = NULL; goto tryagain; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 21:43:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82CF71065672; Wed, 22 Jun 2011 21:43:10 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 733528FC0C; Wed, 22 Jun 2011 21:43:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MLhAqn069840; Wed, 22 Jun 2011 21:43:10 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLhAiF069838; Wed, 22 Jun 2011 21:43:10 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201106222143.p5MLhAiF069838@svn.freebsd.org> From: Will Andrews Date: Wed, 22 Jun 2011 21:43: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: r223443 - 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: Wed, 22 Jun 2011 21:43:10 -0000 Author: will Date: Wed Jun 22 21:43:10 2011 New Revision: 223443 URL: http://svn.freebsd.org/changeset/base/223443 Log: Plumb support for the device advanced information CCB in the ATA XPT. This was previously done only for SCSI XPT in r223081, on which the change in r223089 depended in order to respond to serial number requests. As a result of r223089, da(4) and ada(4) devices register a d_getattr for geom to use to obtain the information. Reported by: ache Reviewed by: ken Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jun 22 21:18:37 2011 (r223442) +++ head/sys/cam/ata/ata_xpt.c Wed Jun 22 21:43:10 2011 (r223443) @@ -1601,6 +1601,34 @@ ata_device_transport(struct cam_path *pa } static void +ata_dev_advinfo(union ccb *start_ccb) +{ + struct cam_ed *device; + struct ccb_dev_advinfo *cdai; + off_t amt; + + start_ccb->ccb_h.status = CAM_REQ_INVALID; + device = start_ccb->ccb_h.path->device; + cdai = &start_ccb->cdai; + switch(cdai->buftype) { + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + break; + start_ccb->ccb_h.status = CAM_REQ_CMP; + cdai->provsiz = device->serial_num_len; + if (device->serial_num_len == 0) + break; + amt = device->serial_num_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->serial_num, amt); + break; + default: + break; + } +} + +static void ata_action(union ccb *start_ccb) { @@ -1652,6 +1680,11 @@ ata_action(union ccb *start_ccb) } /* FALLTHROUGH */ } + case XPT_DEV_ADVINFO: + { + ata_dev_advinfo(start_ccb); + break; + } default: xpt_action_default(start_ccb); break; From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 21:53:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7C0106566B; Wed, 22 Jun 2011 21:53:45 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD188FC12; Wed, 22 Jun 2011 21:53:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MLrjLf070191; Wed, 22 Jun 2011 21:53:45 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLrjfi070189; Wed, 22 Jun 2011 21:53:45 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222153.p5MLrjfi070189@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 21:53: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: r223444 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 21:53:45 -0000 Author: rodrigc Date: Wed Jun 22 21:53:45 2011 New Revision: 223444 URL: http://svn.freebsd.org/changeset/base/223444 Log: Clarify tftpd's -d flag in the new TFTP implementation. Bump date. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 21:43:10 2011 (r223443) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 21:53:45 2011 (r223444) @@ -32,7 +32,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 14, 2000 +.Dd June 22, 2011 .Dt TFTPD 8 .Os .Sh NAME @@ -150,9 +150,27 @@ compatible format string for the creatio .Fl W is specified. By default the string "%Y%m%d" is used. -.It Fl d +.It Fl d, d Ar [value] Enables debug output. -If specified twice, it will log DATA and ACK packets too. +If +.Ar value +is not specified, then the debug level is increased by one +for each instance of +.Fl d +which is specified. +.Pp +If +.Ar value +is specified, then the debug level is set to +.Ar value . +The debug level is a bitmask implemented in +.Pa src/libexec/tftpd/tftp-utils.h . +Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE), +4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS). Multiple debug values can be combined +in the bitmask by logically OR'ing the values. For example, specifying +.Fl d +.Ar 15 +will enable all the debug values. .It Fl l Log all requests using .Xr syslog 3 From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 22:05:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 718B31065674; Wed, 22 Jun 2011 22:05:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FCC8FC13; Wed, 22 Jun 2011 22:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MM5bFm070595; Wed, 22 Jun 2011 22:05:37 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MM5btL070593; Wed, 22 Jun 2011 22:05:37 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222205.p5MM5btL070593@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 22:05: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: r223445 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 22:05:37 -0000 Author: rodrigc Date: Wed Jun 22 22:05:37 2011 New Revision: 223445 URL: http://svn.freebsd.org/changeset/base/223445 Log: Fix typo. Reported by: Nick Mann Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 21:53:45 2011 (r223444) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 22:05:37 2011 (r223445) @@ -273,7 +273,7 @@ was introduced in .Fx 7.4 . .Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting the the TFTP blocksize option (RFC2348), +without client and server supporting the TFTP blocksize option (RFC2348), or the non-standard TFTP rollover option. .Pp Many tftp clients will not transfer files over 16744448 octets (32767 blocks). From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 22:08:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ADE9106566C; Wed, 22 Jun 2011 22:08:56 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B4918FC15; Wed, 22 Jun 2011 22:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MM8u6U070720; Wed, 22 Jun 2011 22:08:56 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MM8uE1070718; Wed, 22 Jun 2011 22:08:56 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106222208.p5MM8uE1070718@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 22 Jun 2011 22:08: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: r223446 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 22:08:56 -0000 Author: gavin Date: Wed Jun 22 22:08:55 2011 New Revision: 223446 URL: http://svn.freebsd.org/changeset/base/223446 Log: Use USB_VENDOR_OVISLINK define rather than the vendor ID. PR: usb/158142 Submitted by: Robert Millan MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:05:37 2011 (r223445) +++ head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:08:55 2011 (r223446) @@ -115,7 +115,7 @@ static const struct usb_device_id urtw_d URTW_DEV_L(REALTEK, RTL8187), URTW_DEV_L(SITECOMEU, WL168V1), URTW_DEV_L(SURECOM, EP9001G2A), - { USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) }, + { USB_VPI(USB_VENDOR_OVISLINK, 0x8187, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) }, From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 22:55:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1F7B106566C; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A86C68FC12; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MMtpNn072149; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMtp1a072147; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222255.p5MMtp1a072147@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 22:55: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: r223447 - head/usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 22:55:51 -0000 Author: rodrigc Date: Wed Jun 22 22:55:51 2011 New Revision: 223447 URL: http://svn.freebsd.org/changeset/base/223447 Log: Bump date. Document the following commands which were added in the new TFTP implementation: blocksize, blocksize2, packetdrop, options, rollover Modified: head/usr.bin/tftp/tftp.1 Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Wed Jun 22 22:08:55 2011 (r223446) +++ head/usr.bin/tftp/tftp.1 Wed Jun 22 22:55:51 2011 (r223447) @@ -28,7 +28,7 @@ .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2003 +.Dd June 22, 2011 .Dt TFTP 1 .Os .Sh NAME @@ -70,6 +70,21 @@ Shorthand for "mode ascii" .It Cm binary Shorthand for "mode binary" .Pp +.It Cm blocksize Ar [size] +Sets the TFTP blksize option in TFTP Read Request or Write Request packets +to +.Ar [size] +as specified in RFC 2348. Valid values are between 8 and 65464. +If no blocksize is specified, then by default a blocksize of 512 bytes +will be used. +.Pp +.It Cm blocksize2 Ar [size] +Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets +to +.Ar [size] . +Values are restricted to powers of 2 between 8 and 32768. This is a +non-standard TFTP option. +.Pp .It Cm connect Ar host Op Ar port Set the .Ar host @@ -93,6 +108,14 @@ or .Cm put commands. .Pp +.It Cm debug Ar level +Enable or disable debugging levels during verbose output. The value of +.Ar level +can be one of +.Cm packet, simple, options, +or +.Cm access. +.Pp .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname .It Cm get Xo .Oo Ar host1 : Oc Ns Ar file1 @@ -130,6 +153,11 @@ or The default is .Em ascii . .Pp +.It Cm packetdrop [arg] +Randomly drop +.Ar arg +out of 100 packets during a transfer. This is a debugging feature. +.Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory Put a file or set of files to the remote host. @@ -149,6 +177,17 @@ see the example under the .Cm get command. .Pp +.It Cm options Ar [arg] +Enable or disable support for TFTP options. The valid values of +.Ar arg +are +.Cm on +(enable RFC 2347 options), +.Cm off +(disable RFC 2347 options), and +.Cm extra +(toggle support for non-RFC defined options). +.Pp .It Cm quit Exit .Nm . @@ -157,6 +196,15 @@ An end of file also exits. .It Cm rexmt Ar retransmission-timeout Set the per-packet retransmission timeout, in seconds. .Pp +.It Cm rollover [arg] +Specify the rollover option in TFTP Read Request or Write +Request packets. After 65535 packets have been transmitted, set the block +counter to +.Ar arg . +Valid values of +.Ar arg +are 0 and 1. This is a non-standard TFTP option. +.Pp .It Cm status Show current status. .Pp From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 22:55:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F22491065670; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E296C8FC13; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MMtpr1072163; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMtpUD072161; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201106222255.p5MMtpUD072161@svn.freebsd.org> From: Will Andrews Date: Wed, 22 Jun 2011 22:55: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: r223448 - 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: Wed, 22 Jun 2011 22:55:52 -0000 Author: will Date: Wed Jun 22 22:55:51 2011 New Revision: 223448 URL: http://svn.freebsd.org/changeset/base/223448 Log: Return CAM_REQ_INVALID if the SCSI XPT receives an unsupported operation via the XPT_DEV_ADVINFO CCB. Reviewed by: ken Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed Jun 22 22:55:51 2011 (r223447) +++ head/sys/cam/scsi/scsi_xpt.c Wed Jun 22 22:55:51 2011 (r223448) @@ -2440,12 +2440,13 @@ scsi_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->device_id_len; if (device->device_id_len == 0) break; @@ -2456,7 +2457,7 @@ scsi_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_SERIAL_NUM: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -2490,7 +2491,7 @@ scsi_dev_advinfo(union ccb *start_ccb) } break; default: - break; + return; } start_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 22:56:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53227106566C; Wed, 22 Jun 2011 22:56:43 +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 43A648FC22; Wed, 22 Jun 2011 22:56:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MMuhHD072229; Wed, 22 Jun 2011 22:56:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMuhmr072227; Wed, 22 Jun 2011 22:56:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106222256.p5MMuhmr072227@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Jun 2011 22:56: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: r223449 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 22:56:43 -0000 Author: jkim Date: Wed Jun 22 22:56:42 2011 New Revision: 223449 URL: http://svn.freebsd.org/changeset/base/223449 Log: Fix build on ia64 after r223426. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 22:55:51 2011 (r223448) +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 22:56:42 2011 (r223449) @@ -856,8 +856,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; +#ifndef __ia64__ else cpu_can_deep_sleep = 1; +#endif } sbuf_trim(&sb); sbuf_finish(&sb); From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 23:25:01 2011 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 53D76106564A; Wed, 22 Jun 2011 23:25:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 19:24:42 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> In-Reply-To: <201106221455.07540.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_CnnAOthSUkiyZLi" Message-Id: <201106221924.50458.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 23:25:02 -0000 --Boundary-00=_CnnAOthSUkiyZLi Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 22 June 2011 02:55 pm, Jung-uk Kim wrote: > On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > > on 22/06/2011 19:40 Jung-uk Kim said the following: > > > Author: jkim > > > Date: Wed Jun 22 16:40:45 2011 > > > New Revision: 223426 > > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > > > Log: > > > Set negative quality to TSC timecounter when C3 state is > > > enabled for Intel processors unless the invariant TSC bit of > > > CPUID is set. Intel processors may stop incrementing TSC when > > > DPSLP# pin is asserted, according to Intel processor manuals, > > > i. e., TSC timecounter is useless if the processor can enter > > > deep sleep state (C3/C4). This problem was accidentally > > > uncovered by r222869, which increased timecounter quality of > > > P-state invariant TSC, e.g., for Core2 Duo T5870 (Family 6, > > > Model f) and Atom N270 (Family 6, Model 1c). > > > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot > > > de) Ian FREISLICH (ianf at clue dot co dot za) > > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > > - Core2 Duo T5870 (C3 state available/enabled) > > > jkim - Xeon X5150 (C3 state unavailable) > > > > I think that this change should have a counterpart similar to > > what was done for event timers. That is, if a user forces use of > > TSC as a timecounter vis sysctl and it is known that TSC stops in > > the deep C-state, then the deep C-states should not be entered. > > This is what cpu_disable_deep_sleep does for LAPIC timers. > > Can you please review/test the attached patch? Also available from > here: > > http://people.freebsd.org/~jkim/tc_c3stop.diff I just realized kern_clocksource.c was excluded for arm and ia64. Here is updated patch. Please ignore the previous one. Thanks, Jung-uk Kim --Boundary-00=_CnnAOthSUkiyZLi Content-Type: text/plain; charset="iso-8859-1"; name="tc_c3stop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_c3stop.diff" Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c (revision 223446) +++ sys/kern/kern_tc.c (working copy) @@ -492,6 +492,12 @@ tc_windup(void) /* Now is a good time to change timecounters. */ if (th->th_counter != timecounter) { +#if !defined(__arm__) && !defined(__ia64__) + if ((timecounter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep++; + if ((th->th_counter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep--; +#endif th->th_counter = timecounter; th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / Index: sys/sparc64/sparc64/counter.c =================================================================== --- sys/sparc64/sparc64/counter.c (revision 223446) +++ sys/sparc64/sparc64/counter.c (working copy) @@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; + tc->tc_flags = 0; tc_init(tc); } Index: sys/sys/timetc.h =================================================================== --- sys/sys/timetc.h (revision 223446) +++ sys/sys/timetc.h (working copy) @@ -57,6 +57,8 @@ struct timecounter { * another timecounter higher means better. Negative * means "only use at explicit request". */ + u_int tc_flags; +#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */ void *tc_priv; /* Pointer to the timecounter's private parts. */ Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 223446) +++ sys/x86/x86/tsc.c (working copy) @@ -452,6 +452,7 @@ init_TSC_tc(void) if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { tsc_timecounter.tc_quality = -1000; + tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP; if (bootverbose) printf("TSC timecounter disabled: C3 enabled.\n"); goto init; --Boundary-00=_CnnAOthSUkiyZLi-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 23:25:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA8991065689; Wed, 22 Jun 2011 23:25:24 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAA728FC12; Wed, 22 Jun 2011 23:25:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MNPOCD073156; Wed, 22 Jun 2011 23:25:24 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MNPOTe073154; Wed, 22 Jun 2011 23:25:24 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222325.p5MNPOTe073154@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 23:25: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: r223450 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 23:25:25 -0000 Author: rodrigc Date: Wed Jun 22 23:25:24 2011 New Revision: 223450 URL: http://svn.freebsd.org/changeset/base/223450 Log: Update references to RFC's that the newer TFTP implementation supports. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 22:56:42 2011 (r223449) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 23:25:24 2011 (r223450) @@ -235,12 +235,34 @@ option. .Xr services 5 , .Xr syslog.conf 5 , .Xr inetd 8 +.Pp +The following RFC's are supported: .Rs -.%A K. R. Sollins +RFC 1350 .%T The TFTP Protocol (Revision 2) -.%D July 1992 -.%O RFC 1350, STD 33 .Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Wed Jun 22 23:26:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FDA31065670; Wed, 22 Jun 2011 23:26:04 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7005F8FC12; Wed, 22 Jun 2011 23:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MNQ4GD073218; Wed, 22 Jun 2011 23:26:04 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MNQ4SG073216; Wed, 22 Jun 2011 23:26:04 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222326.p5MNQ4SG073216@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 23:26: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: r223451 - head/usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jun 2011 23:26:04 -0000 Author: rodrigc Date: Wed Jun 22 23:26:04 2011 New Revision: 223451 URL: http://svn.freebsd.org/changeset/base/223451 Log: Update references to RFC's that the newer TFTP implementation supports. Modified: head/usr.bin/tftp/tftp.1 Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Wed Jun 22 23:25:24 2011 (r223450) +++ head/usr.bin/tftp/tftp.1 Wed Jun 22 23:26:04 2011 (r223451) @@ -217,6 +217,40 @@ Toggle packet tracing. .It Cm verbose Toggle verbose mode. .El +.Sh SEE ALSO +.Xr tftp 1 +.Pp +The following RFC's are supported: +.Rs +RFC 1350 +.%T The TFTP Protocol (Revision 2) +.Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Rs +RFC 3617 +.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 00:20:58 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CE1106566B; Thu, 23 Jun 2011 00:20:58 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id CB31A8FC08; Thu, 23 Jun 2011 00:20:57 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5N0Ktww070092 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 17:20:58 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201106221924.50458.jkim@FreeBSD.org> Date: Wed, 22 Jun 2011 17:20:48 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andriy Gapon Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 00:20:58 -0000 On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: > > I just realized kern_clocksource.c was excluded for arm and ia64. > Here is updated patch. Please ignore the previous one. Any reason why we're not adding kern_clocksource.c for them? -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 00:31:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E830A106566C; Thu, 23 Jun 2011 00:31:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BCD698FC18; Thu, 23 Jun 2011 00:31:31 +0000 (UTC) Received: by fxm11 with SMTP id 11so1465979fxm.13 for ; Wed, 22 Jun 2011 17:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature: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=qllRUKndC4zhcaVEfpL9gXKN6m+RAqmvqMIrZsXCSog=; b=wA/axO5VTarN9ZPKT7yTaeDtipLtmvgm/CgjwjShIcbirmVgvDPfY693+cl21a40u6 I2g3pFzQRz+2XKTkZsIAOC2hRhaEwDiGyViE4R4R3J0aT5gyTtySOMcsKAOZAnGyFcLT EZBJh6ISKZWz2/JWHltvegiAAUTpbmxdecwRM= 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=QxZlqXHrzi2l8nG/uOTkPUHxjnZV47lQy40L5c5KSLncJbg9SqE8WwQQUbLT2Q1VvI 9fgEXXNH5pmnWmxre4s/jMyzxj7mWaJ3POugn6wELTIYdcMjwqnkSAPGWN89Pg2TQrqd /Gh8n45kAaHbVCqASqOQND72QsUiolcy1WxhM= Received: by 10.223.7.8 with SMTP id b8mr1759169fab.19.1308789090579; Wed, 22 Jun 2011 17:31:30 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id p3sm25718fan.21.2011.06.22.17.31.28 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 17:31:29 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E028921.2040805@FreeBSD.org> Date: Thu, 23 Jun 2011 03:30:25 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> In-Reply-To: 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, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 00:31:33 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >> I just realized kern_clocksource.c was excluded for arm and ia64. >> Here is updated patch. Please ignore the previous one. > > Any reason why we're not adding kern_clocksource.c for them? Their event timers code still waits for refactoring. I have neither documentation nor hardware for them. Help would be appreciated. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 00:58:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B62106564A; Thu, 23 Jun 2011 00:58:42 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 403E38FC0C; Thu, 23 Jun 2011 00:58:41 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5N0waqb070236 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 17:58:42 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E028921.2040805@FreeBSD.org> Date: Wed, 22 Jun 2011 17:58:30 -0700 Content-Transfer-Encoding: 7bit Message-Id: <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 00:58:42 -0000 On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: > Marcel Moolenaar wrote: >> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>> I just realized kern_clocksource.c was excluded for arm and ia64. >>> Here is updated patch. Please ignore the previous one. >> >> Any reason why we're not adding kern_clocksource.c for them? > > Their event timers code still waits for refactoring. I have neither > documentation nor hardware for them. Help would be appreciated. Can you give me a pointer to a document orpage that describes what is being refactored, why and how? Thanks, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 01:16:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 2CEAF1065670; Thu, 23 Jun 2011 01:16:33 +0000 (UTC) Date: Thu, 23 Jun 2011 01:16:33 +0000 From: Alexander Best To: Xin LI Message-ID: <20110623011633.GA8035@freebsd.org> References: <201106201648.p5KGm0fp057853@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106201648.p5KGm0fp057853@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223342 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 01:16:33 -0000 On Mon Jun 20 11, Xin LI wrote: > Author: delphij > Date: Mon Jun 20 16:48:00 2011 > New Revision: 223342 > URL: http://svn.freebsd.org/changeset/base/223342 > > Log: > Revert r214857 pursudant to 9.0-RELEASE cycle. why does top(1) have so much problems with finding the applicable number of available columns? ps(1) works great regarding this matter. for me it works without the need for the -w or -ww switch under the console and under X and always makes perfect use of the available columns. i've never been able to make `top -a` display complete commands, although there defenately are enough columns available. cheers. alex > > Requested by: jh > > Modified: > head/contrib/top/display.c > head/contrib/top/top.h > > Modified: head/contrib/top/display.c > ============================================================================== > --- head/contrib/top/display.c Mon Jun 20 16:42:20 2011 (r223341) > +++ head/contrib/top/display.c Mon Jun 20 16:48:00 2011 (r223342) > @@ -698,7 +698,7 @@ char *text; > int width; > > s = NULL; > - width = screen_width; > + width = display_width; > header_length = strlen(text); > if (header_length >= width) { > s = malloc((width + 1) * sizeof(char)); > @@ -706,14 +706,6 @@ char *text; > return (NULL); > strncpy(s, text, width); > s[width] = '\0'; > - } else { > - s = malloc((width + 1) * sizeof(char)); > - if (s == NULL) > - return (NULL); > - strncpy(s, text, width); > - while (screen_width > header_length) > - s[header_length++] = ' '; > - s[width] = '\0'; > } > return (s); > } > @@ -738,7 +730,7 @@ char *text; > if (header_status == ON) > { > putchar('\n'); > - standout(text, stdout); > + fputs(text, stdout); > lastline++; > } > else if (header_status == ERASE) > > Modified: head/contrib/top/top.h > ============================================================================== > --- head/contrib/top/top.h Mon Jun 20 16:42:20 2011 (r223341) > +++ head/contrib/top/top.h Mon Jun 20 16:48:00 2011 (r223342) > @@ -14,7 +14,7 @@ > extern int Header_lines; /* 7 */ > > /* Maximum number of columns allowed for display */ > -#define MAX_COLS 512 > +#define MAX_COLS 128 > > /* Log base 2 of 1024 is 10 (2^10 == 1024) */ > #define LOG1024 10 From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 01:37:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05027106566B; Thu, 23 Jun 2011 01:37:39 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D89D48FC08; Thu, 23 Jun 2011 01:37:37 +0000 (UTC) Received: by fxm11 with SMTP id 11so1493982fxm.13 for ; Wed, 22 Jun 2011 18:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature: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=vEvvDw6MgQlEfTWLVFDXk0NOyv7lzkNgXmW4n1j13Is=; b=LW17x2KEP7TbxAM7qBbERE3stPPjMxB6Pg+kobvuCyQEWaInsNSqCv6AcW3ohpq30l BRTpbWZ4Xo3iFnOKXJHJ/JlqA+O0x7mke+UgZiwD0Jz8FI9PPamdpjYPJ8HAje3+Qnsf g/IHzgXKyslxpRmfTfcoAu58wVJUoJ1zeXezM= 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=xYRrfNSjKQ72xYI4YDDMb8MYSOxOaTjbVfKUwsIrWmFCn4IJyds6gVLvlnR8myvcob 4tdh7kQDLAkZzbDkALjSl6C687JHrwmSD2H92HvBMBGU0CjgwMY1gYEIvqqBeF2zlNgg jzbA80BECu3uJVwS3VTaMXqH7vqbcMHmrQ35A= Received: by 10.223.98.5 with SMTP id o5mr1810887fan.33.1308793056841; Wed, 22 Jun 2011 18:37:36 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n15sm663289fag.42.2011.06.22.18.37.34 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 18:37:35 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E02989F.6040703@FreeBSD.org> Date: Thu, 23 Jun 2011 04:36:31 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> In-Reply-To: <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> 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, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 01:37:39 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >> Marcel Moolenaar wrote: >>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>> I just realized kern_clocksource.c was excluded for arm and ia64. >>>> Here is updated patch. Please ignore the previous one. >>> Any reason why we're not adding kern_clocksource.c for them? >> Their event timers code still waits for refactoring. I have neither >> documentation nor hardware for them. Help would be appreciated. > > Can you give me a pointer to a document orpage that describes > what is being refactored, why and how? In short, timer management code was unified and formalized. Instead of direct programming periodic timers from MD code and calling hard-/ stat-/ profclock() from there, timer hardware should be exposed to the MI kernel using sys/timeet.h API to allow kern_clocksource.c manage it. Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() callbacks from MD initialization code, and cpu_idleclock() and cpu_activeclock() from MD cpu_idle(). Here is some references: man 4 eventtimers http://wiki.freebsd.org/201010DevSummit?action=AttachFile&do=view&target=timers.pdf http://svnweb.freebsd.org/base?view=revision&revision=209371 http://svnweb.freebsd.org/base?view=revision&revision=212541 All architectures except ia64 and non-Marvell arm are already done, so you may took any of them as reference. Ask me if you have any questions. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 02:35:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F342E106564A; Thu, 23 Jun 2011 02:35:55 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E33A88FC0A; Thu, 23 Jun 2011 02:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N2ZtGk079159; Thu, 23 Jun 2011 02:35:55 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2ZtMV079157; Thu, 23 Jun 2011 02:35:55 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106230235.p5N2ZtMV079157@svn.freebsd.org> From: Hiroki Sato Date: Thu, 23 Jun 2011 02:35: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: r223457 - head/release/doc/en_US.ISO8859-1/readme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 02:35:56 -0000 Author: hrs Date: Thu Jun 23 02:35:55 2011 New Revision: 223457 URL: http://svn.freebsd.org/changeset/base/223457 Log: Remove links to mirrorlist.FreeBSD.org. Submitted by: ryusuke Reported by: gavin, brucec Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/readme/article.sgml Thu Jun 23 00:36:49 2011 (r223456) +++ head/release/doc/en_US.ISO8859-1/readme/article.sgml Thu Jun 23 02:35:55 2011 (r223457) @@ -184,8 +184,7 @@ Lists of locations that mirror &os; can be found in the FTP - Sites section of the Handbook, or on the Web pages. + Sites section of the Handbook. Finding a close (in networking terms) mirror from which to download the distribution is highly recommended. From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 02:36:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D096C10656F4; Thu, 23 Jun 2011 02:36:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4BEC48FC12; Thu, 23 Jun 2011 02:36:08 +0000 (UTC) Received: by gwb15 with SMTP id 15so754554gwb.13 for ; Wed, 22 Jun 2011 19:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=La4YNxGzvvIOAwBorC6hqaSTBuXHlWan1heeEaumuyw=; b=H9K/SDoA4wpjQTKKSCT4716iDoNnh4GrRlJpjl0oPo6HN28t8NyVNew8k6nsqpmsGU 8XoFffThEXvHbgS9IF0alN0nx/3m41WlukeshiqNWO0k+r9LtiuvqfQbSkLj2ATwd3po b3VWCAUIvnvG5V8plYrNLKJO/DE2lRLXhdo/A= 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=i2h/Mkf8rzZtVXf8aFiuJ3EOgxLdAD91IkWwupEd0D5DhOk3QVZJ9MOodafwgbpcvo n1MTdmpZ36LBS2n3zpIt/4rLDZn4QqblvzpPy7L3TfhFmjjcSgw7/Y/omdeKR8BOxYAp I60avgGFEPwfeLJJMG838r4tjf7DxvpIqlA0w= MIME-Version: 1.0 Received: by 10.150.193.12 with SMTP id q12mr1655142ybf.9.1308796566697; Wed, 22 Jun 2011 19:36:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.146.13 with HTTP; Wed, 22 Jun 2011 19:36:06 -0700 (PDT) In-Reply-To: <201106191913.p5JJDOqJ006272@svn.freebsd.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> Date: Thu, 23 Jun 2011 10:36:06 +0800 X-Google-Sender-Auth: mtYCobb0R7g5VS_C3JuVqwMfNQk Message-ID: From: Adrian Chadd To: Alan Cox 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: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 02:36:10 -0000 Can this commit please be reverted whilst the kinks are worked out for MIPS= ? I'm currently knee deep in MIPS related hackery and I'd rather stay on an unpatched -HEAD so dogfood can be properly self-consumed. Thanks, Adrian On 20 June 2011 03:13, Alan Cox wrote: > Author: alc > Date: Sun Jun 19 19:13:24 2011 > New Revision: 223307 > URL: http://svn.freebsd.org/changeset/base/223307 > > Log: > =A0Precisely document the synchronization rules for the page's dirty fiel= d. > =A0(Saying that the lock on the object that the page belongs to must be h= eld > =A0only represents one aspect of the rules.) > > =A0Eliminate the use of the page queues lock for atomically performing re= ad- > =A0modify-write operations on the dirty field when the underlying archite= cture > =A0supports atomic operations on char and short types. > > =A0Document the fact that 32KB pages aren't really supported. > > =A0Reviewed by: =A0attilio, kib > > Modified: > =A0head/sys/vm/vm_fault.c > =A0head/sys/vm/vm_page.c > =A0head/sys/vm/vm_page.h > > Modified: head/sys/vm/vm_fault.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/vm/vm_fault.c =A0 =A0 =A0Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_fault.c =A0 =A0 =A0Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * caller's changes may go= unnoticed because they are > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * performed through an un= managed mapping or by a DMA > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * operation. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* The object lock is not= held here. =A0Therefore, like > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* a pmap operation, the = page queues lock may be > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* required in order to c= all vm_page_dirty(). =A0See > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* vm_page_clear_dirty_ma= sk(). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + =A0 =A0defined(__mips__) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 vm_page_dirty(*mp); > +#else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_lock_queues(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_dirty(*mp); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_unlock_queues(); > +#endif > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (pmap_failed) { > > Modified: head/sys/vm/vm_page.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/vm/vm_page.c =A0 =A0 =A0 Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_page.c =A0 =A0 =A0 Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m > =A0/* > =A0* =A0 =A0 vm_page_dirty: > =A0* > - * =A0 =A0 make page all dirty > + * =A0 =A0 Set all bits in the page's dirty field. > + * > + * =A0 =A0 The object containing the specified page must be locked if th= e call is > + * =A0 =A0 made from the machine-independent layer. =A0If, however, the = call is > + * =A0 =A0 made from the pmap layer, then the page queues lock may be re= quired. > + * =A0 =A0 See vm_page_clear_dirty_mask(). > =A0*/ > =A0void > =A0vm_page_dirty(vm_page_t m) > @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * If the object is locked and the page is neither VPO_BUS= Y nor > =A0 =A0 =A0 =A0 * PG_WRITEABLE, then the page's dirty field cannot possib= ly be > - =A0 =A0 =A0 =A0* modified by a concurrent pmap operation. > + =A0 =A0 =A0 =A0* set by a concurrent pmap operation. > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); > =A0 =A0 =A0 =A0if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRIT= EABLE) =3D=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m->dirty &=3D ~pagebits; > =A0 =A0 =A0 =A0else { > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + =A0 =A0defined(__mips__) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* On the aforementioned architectures, t= he page queues lock > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* is not required by the following read-= modify-write > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* operation. =A0The combination of the o= bject's lock and an > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* atomic operation suffice. =A0Moreover,= the pmap layer on > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* these architectures can call vm_page_d= irty() without > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* holding the page queues lock. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > +#if PAGE_SIZE =3D=3D 4096 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_char(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 8192 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_short(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 16384 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_int(&m->dirty, pagebits); > +#else > +#error "PAGE_SIZE is not supported." > +#endif > +#else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Otherwise, the page queues lock is req= uired to ensure that > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* a concurrent pmap operation does not s= et the page's dirty > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* field during the following read-modify= -write operation. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_lock_queues(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m->dirty &=3D ~pagebits; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_unlock_queues(); > +#endif > =A0 =A0 =A0 =A0} > =A0} > > > Modified: head/sys/vm/vm_page.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/vm/vm_page.h =A0 =A0 =A0 Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_page.h =A0 =A0 =A0 Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -89,10 +89,26 @@ > =A0* =A0 =A0 and offset to which this page belongs (for pageout), > =A0* =A0 =A0 and sundry status bits. > =A0* > - * =A0 =A0 Fields in this structure are locked either by the lock on the > - * =A0 =A0 object that the page belongs to (O), its corresponding page l= ock (P), > - * =A0 =A0 or by the lock on the page queues (Q). > - * > + * =A0 =A0 In general, operations on this structure's mutable fields are > + * =A0 =A0 synchronized using either one of or a combination of the lock= on the > + * =A0 =A0 object that the page belongs to (O), the pool lock for the pa= ge (P), > + * =A0 =A0 or the lock for either the free or paging queues (Q). =A0If a= field is > + * =A0 =A0 annotated below with two of these locks, then holding either = lock is > + * =A0 =A0 sufficient for read access, but both locks are required for w= rite > + * =A0 =A0 access. > + * > + * =A0 =A0 In contrast, the synchronization of accesses to the page's di= rty field > + * =A0 =A0 is machine dependent (M). =A0In the machine-independent layer= , the lock > + * =A0 =A0 on the object that the page belongs to must be held in order = to > + * =A0 =A0 operate on the field. =A0However, the pmap layer is permitted= to set > + * =A0 =A0 all bits within the field without holding that lock. =A0There= fore, if > + * =A0 =A0 the underlying architecture does not support atomic read-modi= fy-write > + * =A0 =A0 operations on the field's type, then the machine-independent = layer > + * =A0 =A0 must also hold the page queues lock when performing read-modi= fy-write > + * =A0 =A0 operations and the pmap layer must hold the page queues lock = when > + * =A0 =A0 setting the field. =A0In the machine-independent layer, the > + * =A0 =A0 implementation of read-modify-write operations on the field i= s > + * =A0 =A0 encapsulated in vm_page_clear_dirty_mask(). > =A0*/ > > =A0TAILQ_HEAD(pglist, vm_page); > @@ -120,18 +136,19 @@ struct vm_page { > =A0 =A0 =A0 =A0u_char =A0busy; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* pag= e busy count (O) */ > =A0 =A0 =A0 =A0/* NOTE that these must support one bit per DEV_BSIZE in a= page!!! */ > =A0 =A0 =A0 =A0/* so, on normal X86 kernels, they must be at least 8 bits= wide */ > + =A0 =A0 =A0 /* In reality, support for 32KB pages is not fully implemen= ted. */ > =A0#if PAGE_SIZE =3D=3D 4096 > =A0 =A0 =A0 =A0u_char =A0valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map= of valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_char =A0dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_char =A0dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 8192 > =A0 =A0 =A0 =A0u_short valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map o= f valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_short dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map of= dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_short dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map of= dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 16384 > =A0 =A0 =A0 =A0u_int valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map= of valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_int dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_int dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 32768 > =A0 =A0 =A0 =A0u_long valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map o= f valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_long dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map of= dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_long dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map of= dirty DEV_BSIZE chunks (M) */ > =A0#endif > =A0}; > > From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 02:38:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD5D5106566C; Thu, 23 Jun 2011 02:38:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D9748FC15; Thu, 23 Jun 2011 02:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N2c6RE079259; Thu, 23 Jun 2011 02:38:06 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2c6ac079257; Thu, 23 Jun 2011 02:38:06 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106230238.p5N2c6ac079257@svn.freebsd.org> From: Hiroki Sato Date: Thu, 23 Jun 2011 02:38: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: r223458 - head/release/doc/share/sgml X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 02:38:06 -0000 Author: hrs Date: Thu Jun 23 02:38:06 2011 New Revision: 223458 URL: http://svn.freebsd.org/changeset/base/223458 Log: Bump &release.manpath.*;. Modified: head/release/doc/share/sgml/release.ent Modified: head/release/doc/share/sgml/release.ent ============================================================================== --- head/release/doc/share/sgml/release.ent Thu Jun 23 02:35:55 2011 (r223457) +++ head/release/doc/share/sgml/release.ent Thu Jun 23 02:38:06 2011 (r223458) @@ -36,8 +36,8 @@ - - + + From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 02:38:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 480261065670; Thu, 23 Jun 2011 02:38:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35ED88FC0A; Thu, 23 Jun 2011 02:38:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N2cbgO079322; Thu, 23 Jun 2011 02:38:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2cajT079306; Thu, 23 Jun 2011 02:38:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230238.p5N2cajT079306@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 02:38: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: r223459 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 02:38:37 -0000 Author: adrian Date: Thu Jun 23 02:38:36 2011 New Revision: 223459 URL: http://svn.freebsd.org/changeset/base/223459 Log: Break out most of the HAL related tweaks into a per-HAL instance, rather than global variables. This specifically allows for debugging to be enabled per-NIC, rather than globally. Since the ath driver doesn't know about AH_DEBUG, and to keep the ABI consistent regardless of whether AH_DEBUG is enabled or not, enable the debug parameter always but only conditionally compile in the debug methods if needed. The ALQ support is currently still global pending some brainstorming. Submitted by: ssgriffonuser@gmail.com Reviewed by: adrian, bschmidt Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_sysctl.h Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:36 2011 (r223459) @@ -76,33 +76,6 @@ extern void DO_HALDEBUG(struct ath_hal * /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); - -#ifdef AH_DEBUG -int ath_hal_debug = 0; -SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, - 0, "Atheros HAL debugging printfs"); -TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); -#endif /* AH_DEBUG */ - -int ath_hal_ar5416_biasadj = 0; -SYSCTL_INT(_hw_ath_hal, OID_AUTO, ar5416_biasadj, CTLFLAG_RW, - &ath_hal_ar5416_biasadj, 0, "Enable 2ghz AR5416 direction sensitivity" - " bias adjust"); - -/* NB: these are deprecated; they exist for now for compatibility */ -int ath_hal_dma_beacon_response_time = 2; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, dma_brt, CTLFLAG_RW, - &ath_hal_dma_beacon_response_time, 0, - "Atheros HAL DMA beacon response time"); -int ath_hal_sw_beacon_response_time = 10; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, sw_brt, CTLFLAG_RW, - &ath_hal_sw_beacon_response_time, 0, - "Atheros HAL software beacon response time"); -int ath_hal_additional_swba_backoff = 0; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, swba_backoff, CTLFLAG_RW, - &ath_hal_additional_swba_backoff, 0, - "Atheros HAL additional SWBA backoff time"); MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); @@ -146,7 +119,7 @@ ath_hal_ether_sprintf(const u_int8_t *ma void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { - if ((mask == HAL_DEBUG_UNMASKABLE) || (ath_hal_debug & mask)) { + if ((mask == HAL_DEBUG_UNMASKABLE) || (ah->ah_config.ah_debug & mask)) { __va_list ap; va_start(ap, fmt); ath_hal_vprintf(ah, fmt, ap); @@ -174,6 +147,8 @@ DO_HALDEBUG(struct ath_hal *ah, u_int ma #include #include +SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); + static struct alq *ath_hal_alq; static int ath_hal_alq_emitdev; /* need to emit DEVICE record */ static u_int ath_hal_alq_lost; /* count of lost records */ Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jun 23 02:38:36 2011 (r223459) @@ -756,6 +756,17 @@ struct dfs_event { }; typedef struct dfs_event HAL_DFS_EVENT; +typedef struct +{ + int ah_debug; /* only used if AH_DEBUG is defined */ + int ah_ar5416_biasadj; /* enable AR2133 radio specific bias fiddling */ + + /* NB: these are deprecated; they exist for now for compatibility */ + int ah_dma_beacon_response_time;/* in TU's */ + int ah_sw_beacon_response_time; /* in TU's */ + int ah_additional_swba_backoff; /* in TU's */ +}HAL_OPS_CONFIG; + /* * Hardware Access Layer (HAL) API. * @@ -784,6 +795,7 @@ struct ath_hal { uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ + HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); void __ahdecl(*ah_detach)(struct ath_hal*); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 02:38:36 2011 (r223459) @@ -475,12 +475,6 @@ isBigEndian(void) #define OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \ do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) -/* system-configurable parameters */ -extern int ath_hal_dma_beacon_response_time; /* in TU's */ -extern int ath_hal_sw_beacon_response_time; /* in TU's */ -extern int ath_hal_additional_swba_backoff; /* in TU's */ -extern int ath_hal_ar5416_biasadj; /* 1 or 0 */ - /* wait for the register contents to have the specified value */ extern HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg, uint32_t mask, uint32_t val); @@ -504,11 +498,10 @@ extern void ath_hal_free(void *); /* common debugging interfaces */ #ifdef AH_DEBUG #include "ah_debug.h" -extern int ath_hal_debug; #define HALDEBUG(_ah, __m, ...) \ do { \ if ((__m) == HAL_DEBUG_UNMASKABLE || \ - (ath_hal_debug & (__m))) { \ + ((_ah != AH_NULL) && (((struct ath_hal*)_ah)->ah_config.ah_debug & (__m)))) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -56,9 +56,9 @@ ar5210BeaconInit(struct ath_hal *ah, if (AH_PRIVATE(ah)->ah_opmode != HAL_M_STA) { bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ /* * The SWBA interrupt is not used for beacons in ad hoc mode * as we don't yet support ATIMs. So since the beacon never Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -71,9 +71,9 @@ ar5211BeaconInit(struct ath_hal *ah, case HAL_M_IBSS: case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -345,8 +345,9 @@ ar5211ResetTxQueue(struct ath_hal *ah, u | AR_Q_MISC_CBR_INCR_DIS0 | AR_Q_MISC_RDYTIME_EXP_POLICY); value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time + - ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_EN); /* Configure DCU for CAB */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -84,9 +84,9 @@ ar5212BeaconInit(struct ath_hal *ah, case HAL_M_HOSTAP: case HAL_M_IBSS: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -416,9 +416,9 @@ ar5212ResetTxQueue(struct ath_hal *ah, u * here solely for backwards compatibility. */ value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time - + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Thu Jun 23 02:38:36 2011 (r223459) @@ -185,7 +185,7 @@ ar2133SetChannel(struct ath_hal *ah, con } /* Workaround for hw bug - AR5416 specific */ - if (AR_SREV_OWL(ah) && ath_hal_ar5416_biasadj) + if (AR_SREV_OWL(ah) && ah->ah_config.ah_ar5416_biasadj) ar2133ForceBias(ah, freq); reg32 = (channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) | Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -93,9 +93,9 @@ ar5416BeaconInit(struct ath_hal *ah, /* fall thru... */ case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_flags |= AR_TIMER_MODE_TBTT | AR_TIMER_MODE_DBA | AR_TIMER_MODE_SWBA; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jun 23 02:38:36 2011 (r223459) @@ -288,7 +288,7 @@ ar5416SetQuiet(struct ath_hal *ah, uint3 nextStart_us += OS_REG_READ(ah, AR_TSF_L32); } if (flag & HAL_QUIET_ADD_SWBA_RESP_TIME) { - nextStart_us += ath_hal_sw_beacon_response_time; + nextStart_us += ah->ah_config.ah_sw_beacon_response_time; } OS_REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); OS_REG_WRITE(ah, AR_QUIET2, SM(duration, AR_QUIET2_QUIET_DUR)); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -1035,9 +1035,9 @@ ar5416ResetTxQueue(struct ath_hal *ah, u * here solely for backwards compatibility. */ value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time - + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath.c Thu Jun 23 02:38:36 2011 (r223459) @@ -738,6 +738,7 @@ ath_attach(u_int16_t devid, struct ath_s */ ath_sysctlattach(sc); ath_sysctl_stats_attach(sc); + ath_sysctl_hal_attach(sc); if (bootverbose) ieee80211_announce(ic); Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Jun 23 02:38:36 2011 (r223459) @@ -719,3 +719,43 @@ ath_sysctl_stats_attach(struct ath_softc /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); } + +/* + * This doesn't necessarily belong here (because it's HAL related, not + * driver related). + */ +void +ath_sysctl_hal_attach(struct ath_softc *sc) +{ + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hal", CTLFLAG_RD, + NULL, "Atheros HAL parameters"); + child = SYSCTL_CHILDREN(tree); + + sc->sc_ah->ah_config.ah_debug = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "debug", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_debug, 0, "Atheros HAL debugging printfs"); + + sc->sc_ah->ah_config.ah_ar5416_biasadj = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "ar5416_biasadj", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_ar5416_biasadj, 0, + "Enable 2ghz AR5416 direction sensitivity bias adjust"); + + sc->sc_ah->ah_config.ah_dma_beacon_response_time = 2; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "dma_brt", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_dma_beacon_response_time, 0, + "Atheros HAL DMA beacon response time"); + + sc->sc_ah->ah_config.ah_sw_beacon_response_time = 10; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sw_brt", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_sw_beacon_response_time, 0, + "Atheros HAL software beacon response time"); + + sc->sc_ah->ah_config.ah_additional_swba_backoff = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "swba_backoff", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_additional_swba_backoff, 0, + "Atheros HAL additional SWBA backoff time"); +} Modified: head/sys/dev/ath/if_ath_sysctl.h ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath_sysctl.h Thu Jun 23 02:38:36 2011 (r223459) @@ -34,5 +34,5 @@ extern void ath_sysctlattach(struct ath_softc *); extern void ath_sysctl_stats_attach(struct ath_softc *sc); - +extern void ath_sysctl_hal_attach(struct ath_softc *sc); #endif From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 03:20:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BC7F1065673; Thu, 23 Jun 2011 03:20:12 +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 2289C8FC14; Thu, 23 Jun 2011 03:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N3KCnn080814; Thu, 23 Jun 2011 03:20:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N3KCGn080811; Thu, 23 Jun 2011 03:20:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230320.p5N3KCGn080811@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 03:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223460 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 03:20:12 -0000 Author: nwhitehorn Date: Thu Jun 23 03:20:11 2011 New Revision: 223460 URL: http://svn.freebsd.org/changeset/base/223460 Log: Add hypervisor call error codes. Modified: head/sys/powerpc/ps3/ps3-hvcall.h head/sys/powerpc/ps3/ps3-hvcall.master Modified: head/sys/powerpc/ps3/ps3-hvcall.h ============================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.h Thu Jun 23 02:38:36 2011 (r223459) +++ head/sys/powerpc/ps3/ps3-hvcall.h Thu Jun 23 03:20:11 2011 (r223460) @@ -11,6 +11,34 @@ enum lpar_id { PS3_LPAR_ID_PME = 0x01, }; +/* Return codes from hypercalls */ +#define LV1_SUCCESS 0 +#define LV1_RESOURCE_SHORTAGE -2 +#define LV1_NO_PRIVILEGE -3 +#define LV1_DENIED_BY_POLICY -4 +#define LV1_ACCESS_VIOLATION -5 +#define LV1_NO_ENTRY -6 +#define LV1_DUPLICATE_ENTRY -7 +#define LV1_TYPE_MISMATCH -8 +#define LV1_BUSY -9 +#define LV1_EMPTY -10 +#define LV1_WRONG_STATE -11 +#define LV1_NO_MATCH -13 +#define LV1_ALREADY_CONNECTED -14 +#define LV1_UNSUPPORTED_PARAMETER_VALUE -15 +#define LV1_CONDITION_NOT_SATISFIED -16 +#define LV1_ILLEGAL_PARAMETER_VALUE -17 +#define LV1_BAD_OPTION -18 +#define LV1_IMPLEMENTATION_LIMITATION -19 +#define LV1_NOT_IMPLEMENTED -20 +#define LV1_INVALID_CLASS_ID -21 +#define LV1_CONSTRAINT_NOT_SATISFIED -22 +#define LV1_ALIGNMENT_ERROR -23 +#define LV1_HARDWARE_ERROR -24 +#define LV1_INVALID_DATA_FORMAT -25 +#define LV1_INVALID_OPERATION -26 +#define LV1_INTERNAL_ERROR -32768 + static inline uint64_t lv1_repository_string(const char *str) { Modified: head/sys/powerpc/ps3/ps3-hvcall.master ============================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.master Thu Jun 23 02:38:36 2011 (r223459) +++ head/sys/powerpc/ps3/ps3-hvcall.master Thu Jun 23 03:20:11 2011 (r223460) @@ -11,6 +11,34 @@ enum lpar_id { PS3_LPAR_ID_PME = 0x01, }; +/* Return codes from hypercalls */ +#define LV1_SUCCESS 0 +#define LV1_RESOURCE_SHORTAGE -2 +#define LV1_NO_PRIVILEGE -3 +#define LV1_DENIED_BY_POLICY -4 +#define LV1_ACCESS_VIOLATION -5 +#define LV1_NO_ENTRY -6 +#define LV1_DUPLICATE_ENTRY -7 +#define LV1_TYPE_MISMATCH -8 +#define LV1_BUSY -9 +#define LV1_EMPTY -10 +#define LV1_WRONG_STATE -11 +#define LV1_NO_MATCH -13 +#define LV1_ALREADY_CONNECTED -14 +#define LV1_UNSUPPORTED_PARAMETER_VALUE -15 +#define LV1_CONDITION_NOT_SATISFIED -16 +#define LV1_ILLEGAL_PARAMETER_VALUE -17 +#define LV1_BAD_OPTION -18 +#define LV1_IMPLEMENTATION_LIMITATION -19 +#define LV1_NOT_IMPLEMENTED -20 +#define LV1_INVALID_CLASS_ID -21 +#define LV1_CONSTRAINT_NOT_SATISFIED -22 +#define LV1_ALIGNMENT_ERROR -23 +#define LV1_HARDWARE_ERROR -24 +#define LV1_INVALID_DATA_FORMAT -25 +#define LV1_INVALID_OPERATION -26 +#define LV1_INTERNAL_ERROR -32768 + static inline uint64_t lv1_repository_string(const char *str) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 03:37:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96F66106564A; Thu, 23 Jun 2011 03:37:25 +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 85D628FC0A; Thu, 23 Jun 2011 03:37:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N3bPif081340; Thu, 23 Jun 2011 03:37:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N3bP17081338; Thu, 23 Jun 2011 03:37:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230337.p5N3bP17081338@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 03: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: r223461 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 03:37:25 -0000 Author: nwhitehorn Date: Thu Jun 23 03:37:25 2011 New Revision: 223461 URL: http://svn.freebsd.org/changeset/base/223461 Log: Rework the PS3 disk driver to support NCQ and do its DMA a little differently. Modified: head/sys/powerpc/ps3/ps3disk.c Modified: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/powerpc/ps3/ps3disk.c Thu Jun 23 03:20:11 2011 (r223460) +++ head/sys/powerpc/ps3/ps3disk.c Thu Jun 23 03:37:25 2011 (r223461) @@ -116,39 +116,25 @@ struct ps3disk_softc { struct disk **sc_disk; struct bio_queue_head sc_bioq; + struct bio_queue_head sc_deferredq; + struct proc *sc_task; - struct proc *sc_task; - - int sc_bounce_maxblocks; - bus_dma_tag_t sc_bounce_dmatag; - bus_dmamap_t sc_bounce_dmamap; - bus_addr_t sc_bounce_dmaphys; - char *sc_bounce; - uint64_t sc_bounce_lpar; - int sc_bounce_busy; - uint64_t sc_bounce_tag; - uint64_t sc_bounce_status; + bus_dma_tag_t sc_dmatag; int sc_running; - int sc_debug; }; static int ps3disk_open(struct disk *dp); static int ps3disk_close(struct disk *dp); static void ps3disk_strategy(struct bio *bp); -static void ps3disk_task(void *arg); -static int ps3disk_intr_filter(void *arg); +static void ps3disk_task(void *arg); static void ps3disk_intr(void *arg); -static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc); static int ps3disk_enum_regions(struct ps3disk_softc *sc); -static int ps3disk_read(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data); -static int ps3disk_write(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data); -static int ps3disk_flush(struct ps3disk_softc *sc); +static void ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, + int error); static void ps3disk_sysctlattach(struct ps3disk_softc *sc); @@ -172,6 +158,7 @@ ps3disk_attach(device_t dev) struct ps3disk_softc *sc; struct disk *d; intmax_t mb; + uint64_t junk; char unit; int i, err; @@ -205,7 +192,6 @@ ps3disk_attach(device_t dev) } /* Setup interrupt handler */ - sc->sc_irqid = 0; sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid, RF_ACTIVE); @@ -217,52 +203,24 @@ ps3disk_attach(device_t dev) err = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, - ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx); + NULL, ps3disk_intr, sc, &sc->sc_irqctx); if (err) { device_printf(dev, "Could not setup IRQ\n"); err = ENXIO; goto fail_release_intr; } - /* Setup DMA bounce buffer */ - - sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize; - + /* Setup DMA */ err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - sc->sc_bounce_maxblocks * sc->sc_blksize, 1, - sc->sc_bounce_maxblocks * sc->sc_blksize, - 0, NULL, NULL, &sc->sc_bounce_dmatag); + BUS_SPACE_UNRESTRICTED, 1, PAGE_SIZE, 0, + busdma_lock_mutex, &sc->sc_mtx, &sc->sc_dmatag); if (err) { - device_printf(dev, "Could not create DMA tag for bounce buffer\n"); + device_printf(dev, "Could not create DMA tag\n"); err = ENXIO; goto fail_teardown_intr; } - err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc->sc_bounce_dmamap); - if (err) { - device_printf(dev, "Could not allocate DMA memory for bounce buffer\n"); - err = ENXIO; - goto fail_destroy_dmatag; - } - - err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize, - ps3disk_getphys, &sc->sc_bounce_dmaphys, 0); - if (err) { - device_printf(dev, "Could not load DMA map for bounce buffer\n"); - err = ENXIO; - goto fail_free_dmamem; - } - - sc->sc_bounce_lpar = vtophys(sc->sc_bounce); - - if (bootverbose) - device_printf(dev, "bounce buffer lpar address 0x%016lx\n", - sc->sc_bounce_lpar); - /* Setup disks */ sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *), @@ -270,7 +228,7 @@ ps3disk_attach(device_t dev) if (!sc->sc_disk) { device_printf(dev, "Could not allocate disk(s)\n"); err = ENOMEM; - goto fail_unload_dmamem; + goto fail_teardown_intr; } for (i = 0; i < sc->sc_nregs; i++) { @@ -282,7 +240,7 @@ ps3disk_attach(device_t dev) d->d_strategy = ps3disk_strategy; d->d_name = "ps3disk"; d->d_drv1 = sc; - d->d_maxsize = DFLTPHYS; + d->d_maxsize = PAGE_SIZE; d->d_sectorsize = sc->sc_blksize; d->d_unit = i; d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize; @@ -297,53 +255,32 @@ ps3disk_attach(device_t dev) /* Test to see if we can read this region */ err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit, - 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag); + 0, 0, rp->r_flags, 0, &junk); device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit, - (err == 0) ? "" : " (hypervisor protected)"); + (err == LV1_DENIED_BY_POLICY) ? " (hypervisor protected)" + : ""); - if (err == 0) + if (err != LV1_DENIED_BY_POLICY) disk_create(d, DISK_VERSION); } err = 0; bioq_init(&sc->sc_bioq); + bioq_init(&sc->sc_deferredq); + kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "ps3disk"); ps3disk_sysctlattach(sc); - sc->sc_running = 1; - - kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk"); - return (0); -fail_unload_dmamem: - - bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); - -fail_free_dmamem: - - bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); - -fail_destroy_dmatag: - - bus_dma_tag_destroy(sc->sc_bounce_dmatag); - fail_teardown_intr: - bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); - fail_release_intr: - bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); - fail_free_regions: - free(sc->sc_reg, M_PS3DISK); - fail_destroy_lock: - PS3DISK_LOCK_DESTROY(sc); - return (err); } @@ -353,28 +290,15 @@ ps3disk_detach(device_t dev) struct ps3disk_softc *sc = device_get_softc(dev); int i; - PS3DISK_LOCK(sc); - sc->sc_running = 0; - wakeup(sc); - PS3DISK_UNLOCK(sc); - - PS3DISK_LOCK(sc); - while (sc->sc_running != -1) - msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0); - PS3DISK_UNLOCK(sc); - for (i = 0; i < sc->sc_nregs; i++) disk_destroy(sc->sc_disk[i]); - bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); - bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); - bus_dma_tag_destroy(sc->sc_bounce_dmatag); + bus_dma_tag_destroy(sc->sc_dmatag); bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); free(sc->sc_disk, M_PS3DISK); - free(sc->sc_reg, M_PS3DISK); PS3DISK_LOCK_DESTROY(sc); @@ -394,127 +318,94 @@ ps3disk_close(struct disk *dp) return (0); } -static void -ps3disk_strategy(struct bio *bp) -{ - struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1; - - if (!sc) { - bp->bio_flags |= BIO_ERROR; - bp->bio_error = EINVAL; - biodone(bp); - return; - } - - PS3DISK_LOCK(sc); - bioq_disksort(&sc->sc_bioq, bp); - if (!sc->sc_bounce_busy) - wakeup(sc); - PS3DISK_UNLOCK(sc); -} - +/* Process deferred blocks */ static void ps3disk_task(void *arg) { struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; struct bio *bp; - daddr_t block, end; - u_long nblocks; - char *data; - int err; - while (sc->sc_running) { + + while (1) { + kproc_suspend_check(sc->sc_task); + tsleep(&sc->sc_deferredq, PRIBIO, "ps3disk", 10); + PS3DISK_LOCK(sc); - do { - bp = bioq_first(&sc->sc_bioq); - if (bp == NULL) - msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); - } while (bp == NULL && sc->sc_running); - if (bp) - bioq_remove(&sc->sc_bioq, bp); + bp = bioq_takefirst(&sc->sc_deferredq); PS3DISK_UNLOCK(sc); - if (!sc->sc_running) - break; + if (bp == NULL) + continue; - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", - __func__, bp->bio_cmd); + if (bp->bio_driver1 != NULL) { + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + } - if (bp->bio_cmd == BIO_FLUSH) { - err = ps3disk_flush(sc); + ps3disk_strategy(bp); + } - if (err) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_error = 0; - bp->bio_flags |= BIO_DONE; - } - } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize); + kproc_exit(0); +} - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n", - __func__, bp->bio_pblkno, bp->bio_bcount); +static void +ps3disk_strategy(struct bio *bp) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *)bp->bio_disk->d_drv1; + int err; - for (block = bp->bio_pblkno; block < end;) { - data = bp->bio_data + - (block - bp->bio_pblkno) * sc->sc_blksize; - - nblocks = end - block; - if (nblocks > sc->sc_bounce_maxblocks) - nblocks = sc->sc_bounce_maxblocks; - - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n", - __func__, nblocks); - - if (bp->bio_cmd == BIO_READ) { - err = ps3disk_read(sc, bp->bio_disk->d_unit, - block, nblocks, data); - } else { - err = ps3disk_write(sc, bp->bio_disk->d_unit, - block, nblocks, data); - } - - if (err) - break; + if (sc == NULL) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = EINVAL; + biodone(bp); + return; + } - block += nblocks; - } + PS3DISK_LOCK(sc); + bp->bio_resid = bp->bio_bcount; + bioq_insert_tail(&sc->sc_bioq, bp); - bp->bio_resid = (end - block) * sc->sc_blksize; - if (bp->bio_resid) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_error = 0; - bp->bio_flags |= BIO_DONE; - } + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", + __func__, bp->bio_cmd); - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n", - __func__, bp->bio_resid); + err = 0; + if (bp->bio_cmd == BIO_FLUSH) { + bp->bio_driver1 = 0; + err = lv1_storage_send_device_command( + ps3bus_get_device(sc->sc_dev), LV1_STORAGE_ATA_HDDOUT, + 0, 0, 0, 0, (uint64_t *)&bp->bio_driver2); + if (err == LV1_BUSY) + err = EAGAIN; + } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + if (bp->bio_bcount % sc->sc_blksize != 0) { + err = EINVAL; } else { - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; + bus_dmamap_create(sc->sc_dmatag, BUS_DMA_COHERENT, + (bus_dmamap_t *)(&bp->bio_driver1)); + err = bus_dmamap_load(sc->sc_dmatag, + (bus_dmamap_t)(bp->bio_driver1), bp->bio_data, + bp->bio_bcount, ps3disk_transfer, bp, 0); + if (err == EINPROGRESS) + err = 0; } + } else { + err = EINVAL; + } - if (bp->bio_flags & BIO_ERROR) - disk_err(bp, "hard error", -1, 1); - + if (err == EAGAIN) { + bioq_remove(&sc->sc_bioq, bp); + bioq_insert_tail(&sc->sc_deferredq, bp); + } else if (err != 0) { + bp->bio_error = err; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + disk_err(bp, "hard error", -1, 1); biodone(bp); } - PS3DISK_LOCK(sc); - sc->sc_running = -1; - wakeup(sc); PS3DISK_UNLOCK(sc); - - kproc_exit(0); -} - -static int -ps3disk_intr_filter(void *arg) -{ - return (FILTER_SCHEDULE_THREAD); } static void @@ -523,50 +414,55 @@ ps3disk_intr(void *arg) struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; device_t dev = sc->sc_dev; uint64_t devid = ps3bus_get_device(dev); + struct bio *bp; uint64_t tag, status; - int err; + if (lv1_storage_get_async_status(devid, &tag, &status) != 0) + return; + PS3DISK_LOCK(sc); - err = lv1_storage_get_async_status(devid, &tag, &status); + DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: tag 0x%016lx " + "status 0x%016lx\n", __func__, tag, status); - DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n", - __func__, err, tag, status); + /* Locate the matching request */ + TAILQ_FOREACH(bp, &sc->sc_bioq.queue, bio_queue) { + if ((uint64_t)bp->bio_driver2 != tag) + continue; + + if (status != 0) { + device_printf(sc->sc_dev, "%s error (%#lx)\n", + (bp->bio_cmd == BIO_READ) ? "Read" : "Write", + status); + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_resid = 0; + bp->bio_flags |= BIO_DONE; + } - if (err) - goto out; + if (bp->bio_driver1 != NULL) { + if (bp->bio_cmd == BIO_READ) + bus_dmamap_sync(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + } - if (!sc->sc_bounce_busy) { - device_printf(dev, "Got interrupt while no request pending\n"); - goto out; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + break; } - if (tag != sc->sc_bounce_tag) - device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n", - tag, sc->sc_bounce_tag); - - if (status) - device_printf(dev, "Request completed with status 0x%016lx\n", status); - - sc->sc_bounce_status = status; - sc->sc_bounce_busy = 0; - - wakeup(sc); - -out: + if (bioq_first(&sc->sc_deferredq) != NULL) + wakeup(&sc->sc_deferredq); PS3DISK_UNLOCK(sc); } -static void -ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - - *(bus_addr_t *) arg = segs[0].ds_addr; -} - static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc) { @@ -582,8 +478,7 @@ ps3disk_get_disk_geometry(struct ps3disk lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk); if (err) { device_printf(dev, "Could not get block size (0x%08x)\n", err); - err = ENXIO; - goto out; + return (ENXIO); } err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, @@ -591,16 +486,11 @@ ps3disk_get_disk_geometry(struct ps3disk lv1_repository_string("dev") | dev_index, lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk); if (err) { - device_printf(dev, "Could not get total number of blocks (0x%08x)\n", - err); + device_printf(dev, "Could not get total number of blocks " + "(0x%08x)\n", err); err = ENXIO; - goto out; } - err = 0; - -out: - return (err); } @@ -655,10 +545,11 @@ ps3disk_enum_regions(struct ps3disk_soft (lv1_repository_string("bus") >> 32) | bus_index, lv1_repository_string("dev") | dev_index, lv1_repository_string("region") | i, - lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk); + lv1_repository_string("start"), &sc->sc_reg[i].r_start, + &junk); if (err) { - device_printf(dev, "Could not get region start (0x%08x)\n", - err); + device_printf(dev, "Could not get region start " + "(0x%08x)\n", err); err = ENXIO; goto fail; } @@ -667,16 +558,16 @@ ps3disk_enum_regions(struct ps3disk_soft (lv1_repository_string("bus") >> 32) | bus_index, lv1_repository_string("dev") | dev_index, lv1_repository_string("region") | i, - lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk); + lv1_repository_string("size"), &sc->sc_reg[i].r_size, + &junk); if (err) { - device_printf(dev, "Could not get region size (0x%08x)\n", - err); + device_printf(dev, "Could not get region size " + "(0x%08x)\n", err); err = ENXIO; goto fail; } if (i == 0) - /* disables HV access control and grants access to whole disk */ sc->sc_reg[i].r_flags = 0x2; else sc->sc_reg[i].r_flags = 0; @@ -693,160 +584,70 @@ fail: return (err); } -static int -ps3disk_read(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data) -{ - device_t dev = sc->sc_dev; - struct ps3disk_region *rp = &sc->sc_reg[regidx]; - uint64_t devid = ps3bus_get_device(dev); - int err; - - PS3DISK_LOCK(sc); - - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; - } - - sc->sc_bounce_busy = 1; - - err = lv1_storage_read(devid, rp->r_id, - start_sector, sector_count, rp->r_flags, - sc->sc_bounce_lpar, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not read sectors (0x%08x)\n", err); - err = EIO; - goto out; - } - - DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); - - err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz); - if (err) { - device_printf(dev, "Read request timed out\n"); - err = EIO; - goto out; - } - - if (sc->sc_bounce_busy || sc->sc_bounce_status) { - err = EIO; - } else { - bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - BUS_DMASYNC_POSTREAD); - memcpy(data, sc->sc_bounce, sector_count * sc->sc_blksize); - err = 0; - } - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); -} - -static int -ps3disk_write(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data) -{ - device_t dev = sc->sc_dev; - struct ps3disk_region *rp = &sc->sc_reg[regidx]; - uint64_t devid = ps3bus_get_device(dev); - int err; - - PS3DISK_LOCK(sc); - - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; - } - - memcpy(sc->sc_bounce, data, sector_count * sc->sc_blksize); - - bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - BUS_DMASYNC_PREWRITE); - - sc->sc_bounce_busy = 1; - - err = lv1_storage_write(devid, rp->r_id, - start_sector, sector_count, rp->r_flags, - sc->sc_bounce_lpar, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not write sectors (0x%08x)\n", err); - err = EIO; - goto out; - } - - DPRINTF(sc, PS3DISK_DEBUG_WRITE, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); - - err = msleep(sc, &sc->sc_mtx, PRIBIO, "write", hz); - if (err) { - device_printf(dev, "Write request timed out\n"); - err = EIO; - goto out; - } - - err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0; - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); -} - -static int -ps3disk_flush(struct ps3disk_softc *sc) +static void +ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - device_t dev = sc->sc_dev; - uint64_t devid = ps3bus_get_device(dev); - int err; + struct bio *bp = (struct bio *)(arg); + struct ps3disk_softc *sc = (struct ps3disk_softc *)bp->bio_disk->d_drv1; + struct ps3disk_region *rp = &sc->sc_reg[bp->bio_disk->d_unit]; + uint64_t devid = ps3bus_get_device(sc->sc_dev); + uint64_t block; + int i, err; - PS3DISK_LOCK(sc); + /* Locks already held by busdma */ + PS3DISK_ASSERT_LOCKED(sc); - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; + if (error) { + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + return; } - sc->sc_bounce_busy = 1; + block = bp->bio_pblkno; + for (i = 0; i < nsegs; i++) { + KASSERT((segs[i].ds_len % sc->sc_blksize) == 0, + ("DMA fragments not blocksize multiples")); + + if (bp->bio_cmd == BIO_READ) { + err = lv1_storage_read(devid, rp->r_id, + block, segs[i].ds_len/sc->sc_blksize, + rp->r_flags, segs[i].ds_addr, + (uint64_t *)&bp->bio_driver2); + } else { + bus_dmamap_sync(sc->sc_dmatag, + (bus_dmamap_t)bp->bio_driver1, + BUS_DMASYNC_PREWRITE); + err = lv1_storage_write(devid, rp->r_id, + block, segs[i].ds_len/sc->sc_blksize, + rp->r_flags, segs[i].ds_addr, + (uint64_t *)&bp->bio_driver2); + } - err = lv1_storage_send_device_command(devid, LV1_STORAGE_ATA_HDDOUT, - 0, 0, 0, 0, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not flush (0x%08x)\n", err); - err = EIO; - goto out; - } + if (err) { + if (err == LV1_BUSY) { + bioq_remove(&sc->sc_bioq, bp); + bioq_insert_tail(&sc->sc_deferredq, bp); + } else { + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + device_printf(sc->sc_dev, "Could not read " + "sectors (0x%08x)\n", err); + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + } - DPRINTF(sc, PS3DISK_DEBUG_FLUSH, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); + break; + } - err = msleep(sc, &sc->sc_mtx, PRIBIO, "flush", hz); - if (err) { - device_printf(dev, "Flush request timed out\n"); - err = EIO; - goto out; + DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", + __func__, sc->sc_bounce_tag); } - - err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0; - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); } #ifdef PS3DISK_DEBUG From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 04:06:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21821065672; Thu, 23 Jun 2011 04:06:33 +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 594588FC18; Thu, 23 Jun 2011 04:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N46Xm8082196; Thu, 23 Jun 2011 04:06:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N46XFC082194; Thu, 23 Jun 2011 04:06:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230406.p5N46XFC082194@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 04: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: r223462 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 04:06:33 -0000 Author: nwhitehorn Date: Thu Jun 23 04:06:33 2011 New Revision: 223462 URL: http://svn.freebsd.org/changeset/base/223462 Log: Use 4 KB pages for storage bus devices, which seems to be what the HV uses internally. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Thu Jun 23 03:37:25 2011 (r223461) +++ head/sys/powerpc/ps3/ps3bus.c Thu Jun 23 04:06:33 2011 (r223462) @@ -629,7 +629,7 @@ ps3bus_get_dma_tag(device_t dev, device_ { struct ps3bus_devinfo *dinfo = device_get_ivars(child); struct ps3bus_softc *sc = device_get_softc(dev); - int i, err, flags; + int i, err, flags, pagesize; if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && dinfo->bustype != PS3_BUSTYPE_STORAGE) @@ -646,9 +646,13 @@ ps3bus_get_dma_tag(device_t dev, device_ dinfo->devtype == PS3_DEVTYPE_USB) flags = 2; /* 8-bit mode */ + pagesize = 24; /* log_2(16 MB) */ + if (dinfo->bustype == PS3_BUSTYPE_STORAGE) + pagesize = 12; /* 4 KB */ + for (i = 0; i < sc->rcount; i++) { err = lv1_allocate_device_dma_region(dinfo->bus, dinfo->dev, - sc->regions[i].mr_size, 24 /* log_2(16 MB) */, flags, + sc->regions[i].mr_size, pagesize, flags, &dinfo->dma_base[i]); if (err != 0) { device_printf(child, From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 04:35:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88276106564A; Thu, 23 Jun 2011 04:35:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 785668FC16; Thu, 23 Jun 2011 04:35:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N4ZjoY083099; Thu, 23 Jun 2011 04:35:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N4Zj6G083097; Thu, 23 Jun 2011 04:35:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230435.p5N4Zj6G083097@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 04:35: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: r223463 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 04:35:45 -0000 Author: nwhitehorn Date: Thu Jun 23 04:35:45 2011 New Revision: 223463 URL: http://svn.freebsd.org/changeset/base/223463 Log: Use atomic operations to mask and unmask IRQs. This prevents a problem (obvious in retrospect) in which interrupts on one CPU that are temporarily masked can end up permanently masked when a handler on another CPU clobbers the interrupt mask register with an old copy. Modified: head/sys/powerpc/ps3/ps3pic.c Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Thu Jun 23 04:06:33 2011 (r223462) +++ head/sys/powerpc/ps3/ps3pic.c Thu Jun 23 04:35:45 2011 (r223463) @@ -56,10 +56,10 @@ static void ps3pic_mask(device_t, u_int) static void ps3pic_unmask(device_t, u_int); struct ps3pic_softc { - uint64_t *bitmap_thread0; - uint64_t *mask_thread0; - uint64_t *bitmap_thread1; - uint64_t *mask_thread1; + volatile uint64_t *bitmap_thread0; + volatile uint64_t *mask_thread0; + volatile uint64_t *bitmap_thread1; + volatile uint64_t *mask_thread1; uint64_t sc_ipi_outlet[2]; int sc_vector[64]; @@ -219,8 +219,8 @@ ps3pic_mask(device_t dev, u_int irq) if (irq == sc->sc_ipi_outlet[0]) return; - sc->mask_thread0[0] &= ~(1UL << (63 - irq)); - sc->mask_thread1[0] &= ~(1UL << (63 - irq)); + atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq)); + atomic_clear_64(&sc->mask_thread1[0], 1UL << (63 - irq)); lv1_get_logical_ppe_id(&ppe); lv1_did_update_interrupt_mask(ppe, 0); @@ -234,8 +234,8 @@ ps3pic_unmask(device_t dev, u_int irq) uint64_t ppe; sc = device_get_softc(dev); - sc->mask_thread0[0] |= (1UL << (63 - irq)); - sc->mask_thread1[0] |= (1UL << (63 - irq)); + atomic_set_64(&sc->mask_thread0[0], 1UL << (63 - irq)); + atomic_set_64(&sc->mask_thread1[0], 1UL << (63 - irq)); lv1_get_logical_ppe_id(&ppe); lv1_did_update_interrupt_mask(ppe, 0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 05:24:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E9AC1065676; Thu, 23 Jun 2011 05:24:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FAE28FC13; Thu, 23 Jun 2011 05:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N5O0fp084551; Thu, 23 Jun 2011 05:24:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N5O0Rs084548; Thu, 23 Jun 2011 05:24:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106230524.p5N5O0Rs084548@svn.freebsd.org> From: Alan Cox Date: Thu, 23 Jun 2011 05:24: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: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 05:24:00 -0000 Author: alc Date: Thu Jun 23 05:23:59 2011 New Revision: 223464 URL: http://svn.freebsd.org/changeset/base/223464 Log: Revert to using the page queues lock in vm_page_clear_dirty_mask() on MIPS. (At present, although atomic_clear_char() is defined by atomic.h on MIPS, it is not actually implemented by support.S.) Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jun 23 04:35:45 2011 (r223463) +++ head/sys/vm/vm_fault.c Thu Jun 23 05:23:59 2011 (r223464) @@ -1095,8 +1095,7 @@ vm_fault_quick_hold_pages(vm_map_t map, * required in order to call vm_page_dirty(). See * vm_page_clear_dirty_mask(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ - defined(__mips__) +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) vm_page_dirty(*mp); #else vm_page_lock_queues(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 23 04:35:45 2011 (r223463) +++ head/sys/vm/vm_page.c Thu Jun 23 05:23:59 2011 (r223464) @@ -2336,8 +2336,7 @@ vm_page_clear_dirty_mask(vm_page_t m, in if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) m->dirty &= ~pagebits; else { -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ - defined(__mips__) +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) /* * On the aforementioned architectures, the page queues lock * is not required by the following read-modify-write From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 05:28:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A83421065774; Thu, 23 Jun 2011 05:28:31 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 71D838FC12; Thu, 23 Jun 2011 05:28:31 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id B5770290A3B; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id jCQ+ZP9Gc8lf; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 28707290A3A; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) Message-ID: <4E02CEFD.1020606@rice.edu> Date: Thu, 23 Jun 2011 00:28:29 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Adrian Chadd References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 05:28:31 -0000 On 06/22/2011 21:36, Adrian Chadd wrote: > Can this commit please be reverted whilst the kinks are worked out for MIPS? I've reverted the MIPS-specific code. Alan From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 06:27:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DE1106566B; Thu, 23 Jun 2011 06:27:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 25D7C8FC13; Thu, 23 Jun 2011 06:27:24 +0000 (UTC) Received: by ywf7 with SMTP id 7so820020ywf.13 for ; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=7DsBXRPuiWj/KZOZOxJhmFxLprjZlsNDR+YpoZB1gPA=; b=pM7Lam5nlRxSfKk+qfHO4kEZVK9MJ5CM2sAcYppht03c0UyCn5x+zu5VJiyeBw5ATw xwj87gp6ObPQ3/ZlmPT5FwHlp96lGjtYnb3nyQYJm+VI9rceLS4s2z6F5cKnI98QrQMB 5Iim6a2VgWBokCidxw0wcQNF9gQjYvYo8Io2Q= 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=exn/s4CDZNG9wzjuyX7+H1jdqdGeAdy0Z0+6exlZoD6CTXCYDFkI3gvd1R+jGXEbEf bGZx5Ayi1TTjA7YCNUsJUespMaWmWv4PckQ0qo110qq7SU+l2TBabRw8PIeKPx180qIB wRk7xq2fe2U+60iRW20FYccWmd8qekDPR6Ir8= MIME-Version: 1.0 Received: by 10.151.40.16 with SMTP id s16mr1863446ybj.123.1308810444343; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.146.13 with HTTP; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) In-Reply-To: <4E02CEFD.1020606@rice.edu> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <4E02CEFD.1020606@rice.edu> Date: Thu, 23 Jun 2011 14:27:24 +0800 X-Google-Sender-Auth: wYLvVnI6dqHyycUz836HPG5aliY Message-ID: From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 06:27:25 -0000 On 23 June 2011 13:28, Alan Cox wrote: > On 06/22/2011 21:36, Adrian Chadd wrote: >> >> Can this commit please be reverted whilst the kinks are worked out for >> MIPS? > > I've reverted the MIPS-specific code. Thanks! Adrian From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 06:53:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E0A6106566B; Thu, 23 Jun 2011 06:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBC68FC18; Thu, 23 Jun 2011 06:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N6rDEw087090; Thu, 23 Jun 2011 06:53:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N6rDiK087087; Thu, 23 Jun 2011 06:53:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230653.p5N6rDiK087087@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 06:53: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: r223465 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 06:53:13 -0000 Author: adrian Date: Thu Jun 23 06:53:13 2011 New Revision: 223465 URL: http://svn.freebsd.org/changeset/base/223465 Log: Fix indenting issues introduced by the previous commit. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 05:23:59 2011 (r223464) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 06:53:13 2011 (r223465) @@ -84,9 +84,9 @@ ar5212BeaconInit(struct ath_hal *ah, case HAL_M_HOSTAP: case HAL_M_IBSS: bt.bt_nextdba = (next_beacon - - ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 05:23:59 2011 (r223464) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 06:53:13 2011 (r223465) @@ -93,9 +93,9 @@ ar5416BeaconInit(struct ath_hal *ah, /* fall thru... */ case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_flags |= AR_TIMER_MODE_TBTT | AR_TIMER_MODE_DBA | AR_TIMER_MODE_SWBA; From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 06:55:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E2C106566B; Thu, 23 Jun 2011 06:55:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 806C48FC13; Thu, 23 Jun 2011 06:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N6tT76087203; Thu, 23 Jun 2011 06:55:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N6tTr6087189; Thu, 23 Jun 2011 06:55:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230655.p5N6tTr6087189@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 06:55: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: r223466 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 ar9001 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 06:55:29 -0000 Author: adrian Date: Thu Jun 23 06:55:29 2011 New Revision: 223466 URL: http://svn.freebsd.org/changeset/base/223466 Log: Re-introduce a global ath_hal_debug again for now, whilst I figure out what to do about the few cases where the HAL state isn't available (regdomain) or isn't yet setup (probe/attach.) The global ath_hal_debug now affects all instances of the HAL. This also restores the ability for probe/attach debugging to work; as the sysctl tree may not be attached at that point. Users can just set the global "hw.ath.hal.debug" to a suitable value to enable probe/attach related debugging. Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5112.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 06:55:29 2011 (r223466) @@ -498,10 +498,29 @@ extern void ath_hal_free(void *); /* common debugging interfaces */ #ifdef AH_DEBUG #include "ah_debug.h" +extern int ath_hal_debug; /* Global debug flags */ + +/* + * This is used for global debugging, when ahp doesn't yet have the + * related debugging state. For example, during probe/attach. + */ +#define HALDEBUG_G(_ah, __m, ...) \ + do { \ + if ((__m) == HAL_DEBUG_UNMASKABLE || \ + ath_hal_debug & (__m)) { \ + DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ + } \ + } while (0); + +/* + * This is used for local debugging, when ahp isn't NULL and + * thus may have debug flags set. + */ #define HALDEBUG(_ah, __m, ...) \ do { \ if ((__m) == HAL_DEBUG_UNMASKABLE || \ - ((_ah != AH_NULL) && (((struct ath_hal*)_ah)->ah_config.ah_debug & (__m)))) { \ + ath_hal_debug & (__m) || \ + (_ah)->ah_config.ah_debug & (__m)) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jun 23 06:55:29 2011 (r223466) @@ -167,7 +167,7 @@ isEepromValid(struct ath_hal *ah) if (regDomainPairs[i].regDmnEnum == rd) return AH_TRUE; } - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + HALDEBUG_G(ah, HAL_DEBUG_REGDOMAIN, "%s: invalid regulatory domain/country code 0x%x\n", __func__, rd); return AH_FALSE; } @@ -609,7 +609,7 @@ ath_hal_mapgsm(int sku, int freq) return 1544 + freq; if (sku == SKU_SR9) return 3344 - freq; - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot map freq %u unknown gsm sku %u\n", __func__, freq, sku); return freq; Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -181,14 +181,14 @@ ar5210Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; int i; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: devid 0x%x sc %p st %p sh %p\n", __func__, devid, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5210)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: no memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -200,13 +200,13 @@ ar5211Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5211)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5112.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5112.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5212/ar5112.c Thu Jun 23 06:55:29 2011 (r223466) @@ -611,7 +611,7 @@ getFullPwrTable(uint16_t numPcdacs, uint uint16_t idxR = 1; if (numPcdacs < 2) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: at least 2 pcdac values needed [%d]\n", __func__, numPcdacs); return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -317,13 +317,13 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -71,13 +71,13 @@ ar5312Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -241,7 +241,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ @@ -250,7 +250,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s sizeof(ar5416Addac) ); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -78,13 +78,13 @@ ar9130Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -101,13 +101,13 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -120,13 +120,13 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s int8_t pwr_table_offset; uint8_t pwr; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9280 = ath_hal_malloc(sizeof (struct ath_hal_9280)); if (ahp9280 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -118,13 +118,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9285 = ath_hal_malloc(sizeof (struct ath_hal_9285)); if (ahp9285 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -119,13 +119,13 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s HAL_BOOL rfStatus; int8_t pwr_table_offset; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9287 = ath_hal_malloc(sizeof (struct ath_hal_9287)); if (ahp9287 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 07:54:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B4371065672; Thu, 23 Jun 2011 07:54:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598698FC0C; Thu, 23 Jun 2011 07:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N7s3qv088942; Thu, 23 Jun 2011 07:54:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N7s3AJ088933; Thu, 23 Jun 2011 07:54:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106230754.p5N7s3AJ088933@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Jun 2011 07: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: r223467 - in head/sys: conf dev/usb dev/usb/template modules/usb/template X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 07:54:03 -0000 Author: hselasky Date: Thu Jun 23 07:54:03 2011 New Revision: 223467 URL: http://svn.freebsd.org/changeset/base/223467 Log: - Add more USB templates for various USB device classes - Add basic template support for USB 3.0 - Export definition of template sysctl numbers through usb_ioctl.h MFC after: 7 days Added: head/sys/dev/usb/template/usb_template_audio.c (contents, props changed) head/sys/dev/usb/template/usb_template_kbd.c (contents, props changed) head/sys/dev/usb/template/usb_template_modem.c (contents, props changed) head/sys/dev/usb/template/usb_template_mouse.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/template/usb_template.c (contents, props changed) head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/template/usb_template_cdce.c (contents, props changed) head/sys/dev/usb/template/usb_template_msc.c (contents, props changed) head/sys/dev/usb/template/usb_template_mtp.c (contents, props changed) head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/template/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/conf/files Thu Jun 23 07:54:03 2011 (r223467) @@ -1991,8 +1991,12 @@ dev/usb/quirk/usb_quirk.c optional usb # # USB templates # -dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template_audio.c optional usb_template dev/usb/template/usb_template_cdce.c optional usb_template +dev/usb/template/usb_template_kbd.c optional usb_template +dev/usb/template/usb_template_modem.c optional usb_template +dev/usb/template/usb_template_mouse.c optional usb_template dev/usb/template/usb_template_msc.c optional usb_template dev/usb/template/usb_template_mtp.c optional usb_template # Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template.c Thu Jun 23 07:54:03 2011 (r223467) @@ -49,6 +49,7 @@ #include #include +#include #include #include #include "usbdevs.h" @@ -141,6 +142,31 @@ usb_make_raw_desc(struct usb_temp_setup ud->bSlaveInterface[0] += temp->bInterfaceNumber; } + + /* check if we have got an interface association descriptor */ + + if ((raw[0] >= sizeof(struct usb_interface_assoc_descriptor)) && + (raw[1] == UDESC_IFACE_ASSOC)) { + struct usb_interface_assoc_descriptor *iad = (void *)dst; + + /* update the interface number */ + + iad->bFirstInterface += + temp->bInterfaceNumber; + } + + /* check if we have got a call management descriptor */ + + if ((raw[0] >= sizeof(struct usb_cdc_cm_descriptor)) && + (raw[1] == UDESC_CS_INTERFACE) && + (raw[2] == UDESCSUB_CDC_CM)) { + struct usb_cdc_cm_descriptor *ccd = (void *)dst; + + /* update the interface number */ + + ccd->bDataInterface += + temp->bInterfaceNumber; + } } temp->size += len; } @@ -476,6 +502,10 @@ usb_make_device_desc(struct usb_temp_set USETW(utd->udd.bcdUSB, 0x0250); utd->udd.bMaxPacketSize = 255; /* 512 bytes */ break; + case USB_SPEED_SUPER: + USETW(utd->udd.bcdUSB, 0x0300); + utd->udd.bMaxPacketSize = 9; /* 2**9 = 512 bytes */ + break; default: temp->err = USB_ERR_INVAL; break; @@ -1303,15 +1333,27 @@ usb_temp_setup_by_index(struct usb_devic usb_error_t err; switch (index) { - case 0: + case USB_TEMP_MSC: err = usb_temp_setup(udev, &usb_template_msc); break; - case 1: + case USB_TEMP_CDCE: err = usb_temp_setup(udev, &usb_template_cdce); break; - case 2: + case USB_TEMP_MTP: err = usb_temp_setup(udev, &usb_template_mtp); break; + case USB_TEMP_MODEM: + err = usb_temp_setup(udev, &usb_template_modem); + break; + case USB_TEMP_AUDIO: + err = usb_temp_setup(udev, &usb_template_audio); + break; + case USB_TEMP_KBD: + err = usb_temp_setup(udev, &usb_template_kbd); + break; + case USB_TEMP_MOUSE: + err = usb_temp_setup(udev, &usb_template_mouse); + break; default: return (USB_ERR_INVAL); } Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template.h Thu Jun 23 07:54:03 2011 (r223467) @@ -30,6 +30,10 @@ #ifndef _USB_TEMPLATE_H_ #define _USB_TEMPLATE_H_ +#ifndef USB_TEMPLATE_VENDOR +#define USB_TEMPLATE_VENDOR 0x0001 +#endif + typedef const void *(usb_temp_get_string_desc_t)(uint16_t lang_id, uint8_t string_index); typedef const void *(usb_temp_get_vendor_desc_t)(const struct usb_device_request *req, uint16_t *plen); @@ -94,10 +98,14 @@ struct usb_temp_data { /* prototypes */ +extern const struct usb_temp_device_desc usb_template_audio; extern const struct usb_temp_device_desc usb_template_cdce; -extern const struct usb_temp_device_desc usb_template_msc; /* Mass Storage Class */ -extern const struct usb_temp_device_desc usb_template_mtp; /* Message Transfer - * Protocol */ +extern const struct usb_temp_device_desc usb_template_kbd; +extern const struct usb_temp_device_desc usb_template_modem; +extern const struct usb_temp_device_desc usb_template_mouse; +extern const struct usb_temp_device_desc usb_template_msc; +extern const struct usb_temp_device_desc usb_template_mtp; + usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); void usb_temp_unsetup(struct usb_device *); Added: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,400 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Audio Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_AUDIO_LANG, + INDEX_AUDIO_MIXER, + INDEX_AUDIO_RECORD, + INDEX_AUDIO_PLAYBACK, + INDEX_AUDIO_PRODUCT, + INDEX_AUDIO_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_AUDIO_PRODUCT \ + 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_AUDIO_MIXER \ + 'M', 0, 'i', 0, 'x', 0, 'e', 0, 'r', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +#define STRING_AUDIO_RECORD \ + 'R', 0, 'e', 0, 'c', 0, 'o', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +#define STRING_AUDIO_PLAYBACK \ + 'P', 0, 'l', 0, 'a', 0, 'y', 0, 'b', 0, 'a', 0, 'c', 0, 'k', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_AUDIO_MIXER, string_audio_mixer); +USB_MAKE_STRING_DESC(STRING_AUDIO_RECORD, string_audio_record); +USB_MAKE_STRING_DESC(STRING_AUDIO_PLAYBACK, string_audio_playback); +USB_MAKE_STRING_DESC(STRING_AUDIO_PRODUCT, string_audio_product); + +/* prototypes */ + +/* Audio Mixer description structures */ + +static const uint8_t audio_raw_desc_0[] = { + 0x0a, 0x24, 0x01, 0x00, 0x01, 0xa9, 0x00, 0x02, + 0x01, 0x02 +}; + +static const uint8_t audio_raw_desc_1[] = { + 0x0c, 0x24, 0x02, 0x01, 0x01, 0x01, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_2[] = { + 0x0c, 0x24, 0x02, 0x02, 0x01, 0x02, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_3[] = { + 0x0c, 0x24, 0x02, 0x03, 0x03, 0x06, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_4[] = { + 0x0c, 0x24, 0x02, 0x04, 0x05, 0x06, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_5[] = { + 0x09, 0x24, 0x03, 0x05, 0x05, 0x06, 0x00, 0x01, + 0x00 +}; + +static const uint8_t audio_raw_desc_6[] = { + 0x09, 0x24, 0x03, 0x06, 0x01, 0x03, 0x00, 0x09, + 0x00 +}; + +static const uint8_t audio_raw_desc_7[] = { + 0x09, 0x24, 0x03, 0x07, 0x01, 0x01, 0x00, 0x08, + 0x00 +}; + +static const uint8_t audio_raw_desc_8[] = { + 0x09, 0x24, 0x05, 0x08, 0x03, 0x0a, 0x0b, 0x0c, + 0x00 +}; + +static const uint8_t audio_raw_desc_9[] = { + 0x0a, 0x24, 0x06, 0x09, 0x0f, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_10[] = { + 0x0a, 0x24, 0x06, 0x0a, 0x02, 0x01, 0x43, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_11[] = { + 0x0a, 0x24, 0x06, 0x0b, 0x03, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_12[] = { + 0x0a, 0x24, 0x06, 0x0c, 0x04, 0x01, 0x01, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_13[] = { + 0x0a, 0x24, 0x06, 0x0d, 0x02, 0x01, 0x03, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_14[] = { + 0x0a, 0x24, 0x06, 0x0e, 0x03, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_15[] = { + 0x0f, 0x24, 0x04, 0x0f, 0x03, 0x01, 0x0d, 0x0e, + 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *audio_raw_iface_0_desc[] = { + audio_raw_desc_0, + audio_raw_desc_1, + audio_raw_desc_2, + audio_raw_desc_3, + audio_raw_desc_4, + audio_raw_desc_5, + audio_raw_desc_6, + audio_raw_desc_7, + audio_raw_desc_8, + audio_raw_desc_9, + audio_raw_desc_10, + audio_raw_desc_11, + audio_raw_desc_12, + audio_raw_desc_13, + audio_raw_desc_14, + audio_raw_desc_15, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = audio_raw_iface_0_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_MIXER, +}; + +static const uint8_t audio_raw_desc_20[] = { + 0x07, 0x24, 0x01, 0x01, 0x03, 0x01, 0x00 + +}; + +static const uint8_t audio_raw_desc_21[] = { + 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01, + /* 48kHz */ + 0x80, 0xbb, 0x00 +}; + +static const uint8_t audio_raw_desc_22[] = { + 0x07, 0x25, 0x01, 0x00, 0x01, 0x04, 0x00 +}; + +static const void *audio_raw_iface_1_desc[] = { + audio_raw_desc_20, + audio_raw_desc_21, + NULL, +}; + +static const void *audio_raw_ep_1_desc[] = { + audio_raw_desc_22, + NULL, +}; + +static const struct usb_temp_packet_size audio_isoc_mps = { + .mps[USB_SPEED_FULL] = 0xC8, + .mps[USB_SPEED_HIGH] = 0xC8, +}; + +static const struct usb_temp_interval audio_isoc_interval = { + .bInterval[USB_SPEED_FULL] = 1, /* 1:1 */ + .bInterval[USB_SPEED_HIGH] = 4, /* 1:8 */ +}; + +static const struct usb_temp_endpoint_desc audio_isoc_out_ep = { + .ppRawDesc = audio_raw_ep_1_desc, + .pPacketSize = &audio_isoc_mps, + .pIntervals = &audio_isoc_interval, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_ISOCHRONOUS | UE_ISO_ADAPT, +}; + +static const struct usb_temp_endpoint_desc *audio_iface_1_ep[] = { + &audio_isoc_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_1_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_PLAYBACK, +}; + +static const struct usb_temp_interface_desc audio_iface_1_alt_1 = { + .ppEndpoints = audio_iface_1_ep, + .ppRawDesc = audio_raw_iface_1_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_PLAYBACK, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t audio_raw_desc_30[] = { + 0x07, 0x24, 0x01, 0x07, 0x01, 0x01, 0x00 + +}; + +static const uint8_t audio_raw_desc_31[] = { + 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01, + /* 48kHz */ + 0x80, 0xbb, 0x00 +}; + +static const uint8_t audio_raw_desc_32[] = { + 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00 +}; + +static const void *audio_raw_iface_2_desc[] = { + audio_raw_desc_30, + audio_raw_desc_31, + NULL, +}; + +static const void *audio_raw_ep_2_desc[] = { + audio_raw_desc_32, + NULL, +}; + +static const struct usb_temp_endpoint_desc audio_isoc_in_ep = { + .ppRawDesc = audio_raw_ep_2_desc, + .pPacketSize = &audio_isoc_mps, + .pIntervals = &audio_isoc_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_ISOCHRONOUS | UE_ISO_ADAPT, +}; + +static const struct usb_temp_endpoint_desc *audio_iface_2_ep[] = { + &audio_isoc_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_2_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_RECORD, +}; + +static const struct usb_temp_interface_desc audio_iface_2_alt_1 = { + .ppEndpoints = audio_iface_2_ep, + .ppRawDesc = audio_raw_iface_2_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_RECORD, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const struct usb_temp_interface_desc *audio_interfaces[] = { + &audio_iface_0, + &audio_iface_1_alt_0, + &audio_iface_1_alt_1, + &audio_iface_2_alt_0, + &audio_iface_2_alt_1, + NULL, +}; + +static const struct usb_temp_config_desc audio_config_desc = { + .ppIfaceDesc = audio_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_AUDIO_PRODUCT, +}; + +static const struct usb_temp_config_desc *audio_configs[] = { + &audio_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t audio_get_string_desc; + +const struct usb_temp_device_desc usb_template_audio = { + .getStringDesc = &audio_get_string_desc, + .ppConfigDesc = audio_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x000A, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_AUDIO_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * audio_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +audio_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_AUDIO_MAX] = { + [INDEX_AUDIO_LANG] = &string_lang, + [INDEX_AUDIO_MIXER] = &string_audio_mixer, + [INDEX_AUDIO_RECORD] = &string_audio_record, + [INDEX_AUDIO_PLAYBACK] = &string_audio_playback, + [INDEX_AUDIO_PRODUCT] = &string_audio_product, + }; + + if (string_index == 0) { + return (&string_lang); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_AUDIO_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template_cdce.c Thu Jun 23 07:54:03 2011 (r223467) @@ -264,7 +264,7 @@ static const struct usb_temp_config_desc const struct usb_temp_device_desc usb_template_cdce = { .getStringDesc = ð_get_string_desc, .ppConfigDesc = eth_configs, - .idVendor = 0x0001, + .idVendor = USB_TEMPLATE_VENDOR, .idProduct = 0x0001, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, Added: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,222 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Keyboard Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_LANG, + INDEX_KEYBOARD, + INDEX_PRODUCT, + INDEX_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_PRODUCT \ + 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_KEYBOARD \ + 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_KEYBOARD, string_keyboard); +USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); + +/* prototypes */ + +static const struct usb_temp_packet_size keyboard_intr_mps = { + .mps[USB_SPEED_LOW] = 16, + .mps[USB_SPEED_FULL] = 16, + .mps[USB_SPEED_HIGH] = 16, +}; + +static const struct usb_temp_interval keyboard_intr_interval = { + .bInterval[USB_SPEED_LOW] = 2, /* ms */ + .bInterval[USB_SPEED_FULL] = 2, + .bInterval[USB_SPEED_HIGH] = 2 * 8, +}; + +static uint8_t keyboard_hid_descriptor[] = { + 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, + 0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, + 0x75, 0x08, 0x81, 0x01, 0x95, 0x03, 0x75, 0x01, + 0x05, 0x08, 0x19, 0x01, 0x29, 0x03, 0x91, 0x02, + 0x95, 0x05, 0x75, 0x01, 0x91, 0x01, 0x95, 0x06, + 0x75, 0x08, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05, + 0x07, 0x19, 0x00, 0x2a, 0xff, 0x00, 0x81, 0x00, + 0xc0 +}; + +static const struct usb_temp_endpoint_desc keyboard_ep_0 = { + .ppRawDesc = NULL, /* no raw descriptors */ + .pPacketSize = &keyboard_intr_mps, + .pIntervals = &keyboard_intr_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc *keyboard_endpoints[] = { + &keyboard_ep_0, + NULL, +}; + +static const uint8_t keyboard_raw_desc[] = { + 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, sizeof(keyboard_hid_descriptor), + 0x00 +}; + +static const void *keyboard_iface_0_desc[] = { + keyboard_raw_desc, + NULL, +}; + +static const struct usb_temp_interface_desc keyboard_iface_0 = { + .ppRawDesc = keyboard_iface_0_desc, + .ppEndpoints = keyboard_endpoints, + .bInterfaceClass = 3, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 1, + .iInterface = INDEX_KEYBOARD, +}; + +static const struct usb_temp_interface_desc *keyboard_interfaces[] = { + &keyboard_iface_0, + NULL, +}; + +static const struct usb_temp_config_desc keyboard_config_desc = { + .ppIfaceDesc = keyboard_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PRODUCT, +}; + +static const struct usb_temp_config_desc *keyboard_configs[] = { + &keyboard_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t keyboard_get_string_desc; +static usb_temp_get_vendor_desc_t keyboard_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_kbd = { + .getStringDesc = &keyboard_get_string_desc, + .getVendorDesc = &keyboard_get_vendor_desc, + .ppConfigDesc = keyboard_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x00CB, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * keyboard_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +keyboard_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + if ((req->bmRequestType == 0x81) && (req->bRequest == 0x06) && + (req->wValue[0] == 0x00) && (req->wValue[1] == 0x22) && + (req->wIndex[1] == 0) && (req->wIndex[0] == 0)) { + + *plen = sizeof(keyboard_hid_descriptor); + return (keyboard_hid_descriptor); + } + return (NULL); +} + +/*------------------------------------------------------------------------* + * keyboard_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +keyboard_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_MAX] = { + [INDEX_LANG] = &string_lang, + [INDEX_KEYBOARD] = &string_keyboard, + [INDEX_PRODUCT] = &string_product, + }; + + if (string_index == 0) { + return (&string_lang); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Added: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_modem.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,252 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Modem Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_LANG, + INDEX_MODEM, + INDEX_PRODUCT, + INDEX_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_PRODUCT \ + 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_MODEM \ + 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_MODEM, string_modem); +USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); + +#define MODEM_IFACE_0 0 +#define MODEM_IFACE_1 1 + +/* prototypes */ + +static const struct usb_temp_packet_size modem_bulk_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const struct usb_temp_packet_size modem_intr_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 8, + .mps[USB_SPEED_HIGH] = 8, +}; + +static const struct usb_temp_interval modem_intr_interval = { + .bInterval[USB_SPEED_LOW] = 10, + .bInterval[USB_SPEED_FULL] = 10, + .bInterval[USB_SPEED_HIGH] = 10 * 8, +}; + +static const struct usb_temp_endpoint_desc modem_ep_0 = { + .pPacketSize = &modem_intr_mps, + .pIntervals = &modem_intr_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc modem_ep_1 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc modem_ep_2 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_0_ep[] = { + &modem_ep_0, + NULL, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_1_ep[] = { + &modem_ep_1, + &modem_ep_2, + NULL, +}; + +static const uint8_t modem_raw_desc_0[] = { + 0x05, 0x24, 0x00, 0x10, 0x01 +}; + +static const uint8_t modem_raw_desc_1[] = { + 0x05, 0x24, 0x06, MODEM_IFACE_0, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_2[] = { + 0x05, 0x24, 0x01, 0x03, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_3[] = { + 0x04, 0x24, 0x02, 0x07 +}; + +static const void *modem_iface_0_desc[] = { + &modem_raw_desc_0, + &modem_raw_desc_1, + &modem_raw_desc_2, + &modem_raw_desc_3, + NULL, +}; + +static const struct usb_temp_interface_desc modem_iface_0 = { + .ppRawDesc = modem_iface_0_desc, + .ppEndpoints = modem_iface_0_ep, + .bInterfaceClass = 2, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 1, + .iInterface = INDEX_MODEM, +}; + +static const struct usb_temp_interface_desc modem_iface_1 = { + .ppEndpoints = modem_iface_1_ep, + .bInterfaceClass = 10, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0, + .iInterface = INDEX_MODEM, +}; + +static const struct usb_temp_interface_desc *modem_interfaces[] = { + &modem_iface_0, + &modem_iface_1, + NULL, +}; + +static const struct usb_temp_config_desc modem_config_desc = { + .ppIfaceDesc = modem_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PRODUCT, +}; + +static const struct usb_temp_config_desc *modem_configs[] = { + &modem_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t modem_get_string_desc; +static usb_temp_get_vendor_desc_t modem_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_modem = { + .getStringDesc = &modem_get_string_desc, + .getVendorDesc = &modem_get_vendor_desc, + .ppConfigDesc = modem_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x000E, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * modem_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +modem_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + return (NULL); +} + +/*------------------------------------------------------------------------* + * modem_get_string_desc *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 08:33:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07A5A106566B; Thu, 23 Jun 2011 08:33:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id A970C8FC15; Thu, 23 Jun 2011 08:33:47 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8595425D389C; Thu, 23 Jun 2011 08:17:11 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B151215A2484; Thu, 23 Jun 2011 08:17:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id OcnUYerx838h; Thu, 23 Jun 2011 08:17:09 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9E85615A2475; Thu, 23 Jun 2011 08:17:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106230524.p5N5O0Rs084548@svn.freebsd.org> Date: Thu, 23 Jun 2011 08:17:08 +0000 Content-Transfer-Encoding: 7bit Message-Id: <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> To: Alan Cox X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 08:33:48 -0000 On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: > Author: alc > Date: Thu Jun 23 05:23:59 2011 > New Revision: 223464 > URL: http://svn.freebsd.org/changeset/base/223464 > > Log: > Revert to using the page queues lock in vm_page_clear_dirty_mask() on > MIPS. (At present, although atomic_clear_char() is defined by atomic.h > on MIPS, it is not actually implemented by support.S.) Thanks, and good catch on the atomics even if not planned, just in time for 9.0:) /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 09:42:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57EB3106564A; Thu, 23 Jun 2011 09:42:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 486C68FC13; Thu, 23 Jun 2011 09:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N9ggfU092199; Thu, 23 Jun 2011 09:42:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9ggYc092197; Thu, 23 Jun 2011 09:42:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106230942.p5N9ggYc092197@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 23 Jun 2011 09:42: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: r223469 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 09:42:42 -0000 Author: glebius Date: Thu Jun 23 09:42:41 2011 New Revision: 223469 URL: http://svn.freebsd.org/changeset/base/223469 Log: Be consistent with r160968: keep autoSrcAddr flag untouched when node receives NGM_SHUTDOWN. Submitted by: pluknet Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Thu Jun 23 09:40:46 2011 (r223468) +++ head/sys/netgraph/ng_ether.c Thu Jun 23 09:42:41 2011 (r223469) @@ -718,7 +718,6 @@ ng_ether_shutdown(node_p node) (void)ifpromisc(priv->ifp, 0); priv->promisc = 0; } - priv->autoSrcAddr = 1; /* reset auto-src-addr flag */ NG_NODE_REVIVE(node); /* Signal ng_rmnode we are persisant */ return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 09:43:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080031065670; Thu, 23 Jun 2011 09:43:54 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id EC72D8FC13; Thu, 23 Jun 2011 09:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N9hrrh092268; Thu, 23 Jun 2011 09:43:53 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9hrvA092266; Thu, 23 Jun 2011 09:43:53 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106230943.p5N9hrvA092266@svn.freebsd.org> From: Andreas Tobler Date: Thu, 23 Jun 2011 09:43: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: r223470 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 09:43:54 -0000 Author: andreast Date: Thu Jun 23 09:43:53 2011 New Revision: 223470 URL: http://svn.freebsd.org/changeset/base/223470 Log: Add leading zeros when printing the stackframe on __powerpc64__. Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Thu Jun 23 09:42:41 2011 (r223469) +++ head/sys/powerpc/powerpc/db_trace.c Thu Jun 23 09:43:53 2011 (r223470) @@ -200,7 +200,7 @@ db_backtrace(struct thread *td, db_addr_ } #ifdef __powerpc64__ - db_printf("0x%16lx: ", stackframe); + db_printf("0x%016lx: ", stackframe); #else db_printf("0x%08x: ", stackframe); #endif From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 09:46:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B28D106564A; Thu, 23 Jun 2011 09:46:12 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB7E8FC1E; Thu, 23 Jun 2011 09:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N9kCWA092390; Thu, 23 Jun 2011 09:46:12 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9kC4H092388; Thu, 23 Jun 2011 09:46:12 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106230946.p5N9kC4H092388@svn.freebsd.org> From: Andreas Tobler Date: Thu, 23 Jun 2011 09:46: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: r223471 - 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, 23 Jun 2011 09:46:12 -0000 Author: andreast Date: Thu Jun 23 09:46:12 2011 New Revision: 223471 URL: http://svn.freebsd.org/changeset/base/223471 Log: Fix merge typo. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jun 23 09:43:53 2011 (r223470) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jun 23 09:46:12 2011 (r223471) @@ -1715,7 +1715,7 @@ moea64_kextract(mmu_t mmu, vm_offset_t v pvo = moea64_pvo_find_va(kernel_pmap, va); KASSERT(pvo != NULL, ("moea64_kextract: no addr found for %#" PRIxPTR, va)); - pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) + (va - PVO_VADDR(pvo)); + pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); PMAP_UNLOCK(kernel_pmap); return (pa); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 10:35:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889131065673; Thu, 23 Jun 2011 10:35:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 787ED8FC12; Thu, 23 Jun 2011 10:35:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NAZjYJ093859; Thu, 23 Jun 2011 10:35:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NAZjEH093855; Thu, 23 Jun 2011 10:35:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106231035.p5NAZjEH093855@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Jun 2011 10:35: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: r223472 - head/sys/dev/usb/template X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 10:35:45 -0000 Author: hselasky Date: Thu Jun 23 10:35:45 2011 New Revision: 223472 URL: http://svn.freebsd.org/changeset/base/223472 Log: - Add some comments about the origin of some USB descriptors. MFC after: 7 days Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_mouse.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 10:35:45 2011 (r223472) @@ -95,7 +95,12 @@ USB_MAKE_STRING_DESC(STRING_AUDIO_PRODUC /* prototypes */ -/* Audio Mixer description structures */ +/* + * Audio Mixer description structures + * + * Some of the audio descriptors were dumped + * from a Creative Labs USB audio device. + */ static const uint8_t audio_raw_desc_0[] = { 0x0a, 0x24, 0x01, 0x00, 0x01, 0xa9, 0x00, 0x02, Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 10:35:45 2011 (r223472) @@ -94,6 +94,8 @@ static const struct usb_temp_interval ke .bInterval[USB_SPEED_HIGH] = 2 * 8, }; +/* The following HID descriptor was dumped from a HP keyboard. */ + static uint8_t keyboard_hid_descriptor[] = { 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01, Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_mouse.c Thu Jun 23 10:35:45 2011 (r223472) @@ -82,6 +82,8 @@ USB_MAKE_STRING_DESC(STRING_PRODUCT, str /* prototypes */ +/* The following HID descriptor was dumped from a HP mouse. */ + static uint8_t mouse_hid_descriptor[] = { 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03, From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 10:43:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A17106566B; Thu, 23 Jun 2011 10:43:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E1F1F8FC17; Thu, 23 Jun 2011 10:43:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NAhaFO094823; Thu, 23 Jun 2011 10:43:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NAha34094821; Thu, 23 Jun 2011 10:43:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106231043.p5NAha34094821@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 23 Jun 2011 10:43: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: r223473 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 10:43:37 -0000 Author: glebius Date: Thu Jun 23 10:43:36 2011 New Revision: 223473 URL: http://svn.freebsd.org/changeset/base/223473 Log: Document that autoSrcAddr isn't re-enabled on NGM_SHUTDOWN. Submitted by: Vadim Goncharov Modified: head/share/man/man4/ng_ether.4 Modified: head/share/man/man4/ng_ether.4 ============================================================================== --- head/share/man/man4/ng_ether.4 Thu Jun 23 10:35:45 2011 (r223472) +++ head/share/man/man4/ng_ether.4 Thu Jun 23 10:43:36 2011 (r223473) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2006 +.Dd June 23, 2011 .Dt NG_ETHER 4 .Os .Sh NAME @@ -183,7 +183,6 @@ Detach from underlying Ethernet interfac Upon receipt of the .Dv NGM_SHUTDOWN control message, all hooks are disconnected, promiscuous mode is disabled, -and the source address override flag is re-enabled, but the node is not removed. Node can be shut down only using .Dv NGM_ETHER_DETACH From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 12:11:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 554901065670; Thu, 23 Jun 2011 12:11:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 457F48FC0C; Thu, 23 Jun 2011 12:11:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NCBiQf099141; Thu, 23 Jun 2011 12:11:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NCBiQ3099139; Thu, 23 Jun 2011 12:11:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106231211.p5NCBiQ3099139@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 12:11: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: r223474 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 12:11:44 -0000 Author: adrian Date: Thu Jun 23 12:11:43 2011 New Revision: 223474 URL: http://svn.freebsd.org/changeset/base/223474 Log: add missing #define for the non-debug case. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 10:43:36 2011 (r223473) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 12:11:43 2011 (r223474) @@ -529,6 +529,7 @@ extern void DO_HALDEBUG(struct ath_hal * __printflike(3,4); #else #define HALDEBUG(_ah, __m, _fmt, ...) +#define HALDEBUG_G(_ah, __m, _fmt, ...) #endif /* AH_DEBUG */ /* From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 15:10:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F88106566C; Thu, 23 Jun 2011 15:10:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D635A8FC17; Thu, 23 Jun 2011 15:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NFAiP5004457; Thu, 23 Jun 2011 15:10:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NFAixO004455; Thu, 23 Jun 2011 15:10:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106231510.p5NFAixO004455@svn.freebsd.org> From: Alexander Motin Date: Thu, 23 Jun 2011 15:10: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: r223475 - 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: Thu, 23 Jun 2011 15:10:45 -0000 Author: mav Date: Thu Jun 23 15:10:44 2011 New Revision: 223475 URL: http://svn.freebsd.org/changeset/base/223475 Log: Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI device to never complete, that caused probe process (system boot) stuck. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Jun 23 12:11:43 2011 (r223474) +++ head/sys/cam/ata/ata_xpt.c Thu Jun 23 15:10:44 2011 (r223475) @@ -1678,7 +1678,8 @@ ata_action(union ccb *start_ccb) xpt_done(start_ccb); break; } - /* FALLTHROUGH */ + xpt_action_default(start_ccb); + break; } case XPT_DEV_ADVINFO: { From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 15:26:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D457106566C; Thu, 23 Jun 2011 15:26:02 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id CA1788FC16; Thu, 23 Jun 2011 15:26:01 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5NFPvIZ073373 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 08:26:01 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E02989F.6040703@FreeBSD.org> Date: Thu, 23 Jun 2011 08:25:51 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> <4E02989F.6040703@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 15:26:02 -0000 On Jun 22, 2011, at 6:36 PM, Alexander Motin wrote: > Marcel Moolenaar wrote: >> On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >>> Marcel Moolenaar wrote: >>>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>>> I just realized kern_clocksource.c was excluded for arm and ia64. =20= >>>>> Here is updated patch. Please ignore the previous one. >>>> Any reason why we're not adding kern_clocksource.c for them? >>> Their event timers code still waits for refactoring. I have neither >>> documentation nor hardware for them. Help would be appreciated. >>=20 >> Can you give me a pointer to a document orpage that describes >> what is being refactored, why and how? >=20 > In short, timer management code was unified and formalized. Instead of > direct programming periodic timers from MD code and calling hard-/ > stat-/ profclock() from there, timer hardware should be exposed to the > MI kernel using sys/timeet.h API to allow kern_clocksource.c manage = it. > Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() > callbacks from MD initialization code, and cpu_idleclock() and > cpu_activeclock() from MD cpu_idle(). >=20 > Here is some references: > man 4 eventtimers > = http://wiki.freebsd.org/201010DevSummit?action=3DAttachFile&do=3Dview&targ= et=3Dtimers.pdf > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D209371 > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D212541 >=20 > All architectures except ia64 and non-Marvell arm are already done, so > you may took any of them as reference. Ask me if you have any = questions. Can you give a quick outline of how all the various clock related initializations and support code relate, interact or even conflict? It's getting rather convoluted and want to make sure I get the ordering and timing right. Also: The ITC on ia64 is a per-CPU, one short and periodic timer that has a fixed frequency. Though the architecture does not guarantee that counters are synchronized, nor that all CPUs in a system run at the same frequency which means that the ITCs may not all run at the same frequency. Does the et code work with that or do I need to impose a restriction on what hardware configurations to support and/or revert to having the ITC be a global timer and run only on the BSP? Thanks, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 15:53:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC059106566B; Thu, 23 Jun 2011 15:53:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id DB3288FC12; Thu, 23 Jun 2011 15:53:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NFrHht005778; Thu, 23 Jun 2011 15:53:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NFrHuC005776; Thu, 23 Jun 2011 15:53:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106231553.p5NFrHuC005776@svn.freebsd.org> From: John Baldwin Date: Thu, 23 Jun 2011 15:53: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: r223477 - head/sys/boot/i386/zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 15:53:18 -0000 Author: jhb Date: Thu Jun 23 15:53:17 2011 New Revision: 223477 URL: http://svn.freebsd.org/changeset/base/223477 Log: The recent change to increase the zfsboot size to 64k made a few BIOSes unhappy (probably they don't handle crossing the 64k boundary, etc.). Fix this by changing zfsldr to use a loop reading from the disk one sector at a time. To avoid trashing the saved copy of the MBR which is used for disk I/O, read zfsboot2 at address 0x9000. This has the advantage that BTX no longer needs to be relocated as it is read into the correct location. However, the loop to relocate zfsboot2.bin can now cross a 64k boundary, so change it to use relative segments instead. (This will need further work if zfsboot2.bin ever exceeds 64k.) While here, stop storing a relocated copy of zfsldr at 0x700. This was only used by the xread hack which has recently been removed (and even that use was dubious). Also, include the BIOS error code as hex when reporting read errors to aid in debugging. Much thanks to Henri Hennebert for patiently testing various iterations of the patch as well as fixing the zfsboot2.bin relocation to use relative segments. MFC after: 1 week Modified: head/sys/boot/i386/zfsboot/zfsldr.S Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Thu Jun 23 15:28:54 2011 (r223476) +++ head/sys/boot/i386/zfsboot/zfsldr.S Thu Jun 23 15:53:17 2011 (r223477) @@ -16,7 +16,6 @@ */ /* Memory Locations */ - .set MEM_REL,0x700 # Relocation address .set MEM_ARG,0x900 # Arguments .set MEM_ORG,0x7c00 # Origin .set MEM_BUF,0x8000 # Load area @@ -91,26 +90,18 @@ main: cld # String ops inc mov %cx,%ss # Set up mov $start,%sp # stack /* - * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets - * %cx == 0x100. - */ - mov %sp,%si # Source - mov $MEM_REL,%di # Destination - incb %ch # Word count - rep # Copy - movsw # code -/* * If we are on a hard drive, then load the MBR and look for the first * FreeBSD slice. We use the fake partition entry below that points to * the MBR when we call nread. The first pass looks for the first active * FreeBSD slice. The second pass looks for the first non-active FreeBSD * slice if the first one fails. */ - mov $part4,%si # Partition + mov $part4,%si # Dummy partition cmpb $0x80,%dl # Hard drive? jb main.4 # No - movb $0x1,%dh # Block count - callw nread # Read MBR + xor %eax,%eax # Read MBR + movl $MEM_BUF,%ebx # from first + callw nread # sector mov $0x1,%cx # Two passes main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table movb $0x1,%dh # Partition @@ -139,52 +130,51 @@ main.4: xor %dx,%dx # Partition:drive /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 64 sectors starting at sector 1024 + * for, so go ahead and load up the 128 sectors starting at sector 1024 * (i.e. after the two vdev labels). We don't have do anything fancy * here to allow for an extra copy of boot1 and a partition table * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x8000. The first part of boot2 is BTX, which wants to run + * all at 0x9000. The first part of boot2 is BTX, which wants to run * at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the - * binary to 0xc000. After we have moved the client, we relocate BTX - * itself to 0x9000 - doing it in this order means that none of the - * memcpy regions overlap which would corrupt the copy. Normally, BTX - * clients start at MEM_USR, or 0xa000, but when we use btxld to - * create zfsboot2, we use an entry point of 0x2000. That entry point is - * relative to MEM_USR; thus boot2.bin starts at 0xc000. + * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, + * but when we use btxld to create zfsboot2, we use an entry point of + * 0x2000. That entry point is relative to MEM_USR; thus boot2.bin + * starts at 0xc000. * * The load area and the target area for the client overlap so we have * to use a decrementing string move. We also play segment register * games with the destination address for the move so that the client * can be larger than 16k (which would overflow the zero segment since - * the client starts at 0xc000). Relocating BTX is easy since the load - * area and target area do not overlap. + * the client starts at 0xc000). */ main.5: mov %dx,MEM_ARG # Save args - movb $NSECT,%dh # Sector count + mov $NSECT,%cx # Sector count movl $1024,%eax # Offset to boot2 - callw nread.1 # Read disk -main.6: mov $MEM_BUF,%si # BTX (before reloc) - mov 0xa(%si),%bx # Get BTX length and set + mov $MEM_BTX,%ebx # Destination buffer +main.6: pushal # Save params + callw nread # Read disk + popal # Restore + incl %eax # Advance to + add $SIZ_SEC,%ebx # next sector + loop main.6 # If not last, read another + mov MEM_BTX+0xa,%bx # Get BTX length mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load - add $MEM_BUF,%si # area + mov %di,%si # End of load area, 0x9000 rel sub %bx,%di # End of client, 0xc000 rel mov %di,%cx # Size of inc %cx # client + mov $(MEM_BTX)>>4,%dx # Segment + mov %dx,%ds # addressing 0x9000 mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment mov %dx,%es # addressing 0xc000 std # Move with decrement rep # Relocate movsb # client - mov %ds,%dx # Back to - mov %dx,%es # zero segment - mov $MEM_BUF,%si # BTX (before reloc) - mov $MEM_BTX,%di # BTX - mov %bx,%cx # Get BTX length - cld # Increment this time - rep # Relocate - movsb # BTX + cld # Back to increment + xor %dx,%dx # Back + mov %ds,%dx # to zero + mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. @@ -211,32 +201,35 @@ seta20.3: sti # Enable interrupts /* * Trampoline used to call read from within zfsldr. Sets up an EDD - * packet on the stack and passes it to read. + * packet on the stack and passes it to read. We assume that the + * destination address is always segment-aligned. * * %eax - int - LBA to read in relative to partition start + * %ebx - ptr - destination address * %dl - byte - drive to read from - * %dh - byte - num sectors to read * %si - ptr - MBR partition entry */ -nread: xor %eax,%eax # Sector offset in partition -nread.1: xor %ecx,%ecx # Get +nread: xor %ecx,%ecx # Get addl 0x8(%si),%eax # LBA adc $0,%ecx pushl %ecx # Starting absolute block pushl %eax # block number - push %es # Address of - push $MEM_BUF # transfer buffer - xor %ax,%ax # Number of - movb %dh,%al # blocks to - push %ax # transfer + shr $4,%ebx # Convert to segment + push %bx # Address of + push $0 # transfer buffer + push $0x1 # Read 1 sector push $0x10 # Size of packet mov %sp,%bp # Packet pointer callw read # Read from disk + jc nread.1 # If error, fail lea 0x10(%bp),%sp # Clear stack - jnc return # If success, return - mov $msg_read,%si # Otherwise, set the error - # message and fall through to - # the error routine + ret # If success, return +nread.1: mov %ah,%al # Format + mov $read_err,%di # error + call hex8 # code + mov $msg_read,%si # Set the error message and + # fall through to the error + # routine /* * Print out the error message pointed to by %ds:(%si) followed * by a prompt, wait for a keypress, and then reboot the machine. @@ -259,14 +252,6 @@ putstr: lodsb # Get char jne putstr.0 # No /* - * Overused return code. ereturn is used to return an error from the - * read function. Since we assume putstr succeeds, we (ab)use the - * same code when we return from putstr. - */ -ereturn: movb $0x1,%ah # Invalid - stc # argument -return: retw # To caller -/* * Reads sectors from the disk. If EDD is enabled, then check if it is * installed and use it if it is. If it is not installed or not enabled, then * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to @@ -294,14 +279,30 @@ read: cmpb $0x80,%dl # Hard drive? retw # To caller read.1: mov $msg_chs,%si jmp error -msg_chs: .asciz "CHS not supported" + +/* + * AL to hex, saving the result to [EDI]. + */ +hex8: push %ax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + pop %ax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) /* Messages */ -msg_read: .asciz "Read" -msg_part: .asciz "Boot" +msg_chs: .asciz "CHS not supported" +msg_read: .ascii "Read error: " +read_err: .asciz "XX" +msg_part: .asciz "Boot error" -prompt: .asciz " error\r\n" +prompt: .asciz "\r\n" .org PRT_OFF,0x90 From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 16:11:27 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55780106566B; Thu, 23 Jun 2011 16:11:27 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id C6F078FC14; Thu, 23 Jun 2011 16:11:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NG0ApD047404; Thu, 23 Jun 2011 20:00:10 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NG0A9i047403; Thu, 23 Jun 2011 20:00:10 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 20:00:10 +0400 From: Andrey Chernov To: Alexander Motin Message-ID: <20110623160010.GA47278@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106231510.p5NFAixO004455@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r223475 - 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: Thu, 23 Jun 2011 16:11:27 -0000 On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Jun 23 15:10:44 2011 > New Revision: 223475 > URL: http://svn.freebsd.org/changeset/base/223475 > > Log: > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > device to never complete, that caused probe process (system boot) stuck. With that commit I have no more those "run_interrupt_driven_hooks:..." messages, but still have hang at boot related to DVD (no hang if DVDs are physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no locks are shown by 'show lock'. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 16:21:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E39B106566B; Thu, 23 Jun 2011 16:21:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5E71C8FC21; Thu, 23 Jun 2011 16:21:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NGLhbI006637; Thu, 23 Jun 2011 16:21:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NGLhF2006635; Thu, 23 Jun 2011 16:21:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106231621.p5NGLhF2006635@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 Jun 2011 16:21: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: r223478 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 16:21:43 -0000 Author: marcel Date: Thu Jun 23 16:21:43 2011 New Revision: 223478 URL: http://svn.freebsd.org/changeset/base/223478 Log: Unblock the outgoing thread after we performed pmap_switch() to switch the region registers. pmap_switch() returns the pmap for which the region register are currently programmed, which needs to be re-programmed on the CPU the ougoing thread gets switched in. This change does not noticibly change anything or fix known bugs, but does give me a warm fuzzy feeling by being more correct. Modified: head/sys/ia64/ia64/machdep.c Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Thu Jun 23 15:53:17 2011 (r223477) +++ head/sys/ia64/ia64/machdep.c Thu Jun 23 16:21:43 2011 (r223478) @@ -470,12 +470,12 @@ cpu_switch(struct thread *old, struct th if (PCPU_GET(fpcurthread) == old) old->td_frame->tf_special.psr |= IA64_PSR_DFH; if (!savectx(oldpcb)) { - atomic_store_rel_ptr(&old->td_lock, mtx); - newpcb = new->td_pcb; oldpcb->pcb_current_pmap = pmap_switch(newpcb->pcb_current_pmap); + atomic_store_rel_ptr(&old->td_lock, mtx); + #if defined(SCHED_ULE) && defined(SMP) while (atomic_load_acq_ptr(&new->td_lock) == &blocked_lock) cpu_spinwait(); From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 16:25:00 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD7561065670; Thu, 23 Jun 2011 16:25:00 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6B18FC1B; Thu, 23 Jun 2011 16:24:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NGOwde047698; Thu, 23 Jun 2011 20:24:58 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NGOw9F047697; Thu, 23 Jun 2011 20:24:58 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 20:24:58 +0400 From: Andrey Chernov To: Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20110623162458.GA47670@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> <20110623160010.GA47278@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110623160010.GA47278@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r223475 - 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: Thu, 23 Jun 2011 16:25:00 -0000 On Thu, Jun 23, 2011 at 08:00:10PM +0400, Andrey Chernov wrote: > On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > > Author: mav > > Date: Thu Jun 23 15:10:44 2011 > > New Revision: 223475 > > URL: http://svn.freebsd.org/changeset/base/223475 > > > > Log: > > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > > device to never complete, that caused probe process (system boot) stuck. > > With that commit I have no more those "run_interrupt_driven_hooks:..." > messages, but still have hang at boot related to DVD (no hang if DVDs are > physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs > detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in > the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no > locks are shown by 'show lock'. More about "caplck": it was cdopen() who calls cam_periph_hold() and sleeps there forever. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 16:34:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A3FD106564A; Thu, 23 Jun 2011 16:34:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 39FCB8FC16; Thu, 23 Jun 2011 16:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NGYgEn007390; Thu, 23 Jun 2011 16:34:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NGYgTV007387; Thu, 23 Jun 2011 16:34:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106231634.p5NGYgTV007387@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 16:34: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: r223479 - 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, 23 Jun 2011 16:34:42 -0000 Author: nwhitehorn Date: Thu Jun 23 16:34:41 2011 New Revision: 223479 URL: http://svn.freebsd.org/changeset/base/223479 Log: Clear any outstanding atomic reservations when traps are taken. This fixes some interesting bugs (mostly on SMP systems) with atomic operations silently failing in interrupt heavy situations, especially when using overflow pages. Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 16:21:43 2011 (r223478) +++ head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 16:34:41 2011 (r223479) @@ -748,6 +748,8 @@ k_trap: /* Call C interrupt dispatcher: */ trapagain: addi %r3,%r1,8 + addi %r4,%r1,-4 /* Clear any existing reservations */ + stwcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) .globl CNAME(trapexit) /* backtrace code sentinel */ CNAME(trapexit): Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 16:21:43 2011 (r223478) +++ head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 16:34:41 2011 (r223479) @@ -508,6 +508,8 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 + addi %r4,%r1,-8 /* Clear any existing reservations */ + stdcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) nop From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 16:57:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390261065670; Thu, 23 Jun 2011 16:57:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 63ADD8FC12; Thu, 23 Jun 2011 16:57:04 +0000 (UTC) Received: by fxm11 with SMTP id 11so2082315fxm.13 for ; Thu, 23 Jun 2011 09:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature: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=rx55yDT4P9+naxxIwJxoIEE70mjnuQlYeSCr6rnlCp8=; b=lODCAODRjDd9dOJbscfskZEUlPju9DCjRxU+EkFmQ6t9PPEtSj9lG9joiNV1AKdXFR B0Ae5be9KetoqE4I8DUOJMiq+N01pq3HSslAHSzAdTTHToHhKH5Es5JYeUG83ptFM2ur Nb1jLrKYtPCgOe+w8o9muRcE++k9khE9MFZqo= 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=BzmPn5ubwlsu5gTv8WegbDGyZeTszFPjsPEkorGeVElkMnstwB92TZKlGayLIK5UlU bRGsHBSrnx4ha5dSLmM6RRGAbLUJoB8mzzQ9MesZkB0EkzOVK0rirphpcRqEPk4IyVX9 TWIAfi5CJHRyLahfRju4Ku8SXbPZJc2XK3Ntk= Received: by 10.223.5.212 with SMTP id 20mr2969573faw.40.1308848223345; Thu, 23 Jun 2011 09:57:03 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id q14sm1104011faa.3.2011.06.23.09.57.00 (version=SSLv3 cipher=OTHER); Thu, 23 Jun 2011 09:57:01 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E03701B.8090103@FreeBSD.org> Date: Thu, 23 Jun 2011 19:55:55 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> <4E02989F.6040703@FreeBSD.org> <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> In-Reply-To: <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> 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: r223426 - in head/sys: dev/acpica kern sys x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 16:57:05 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 6:36 PM, Alexander Motin wrote: >> Marcel Moolenaar wrote: >>> On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >>>> Marcel Moolenaar wrote: >>>>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>>>> I just realized kern_clocksource.c was excluded for arm and ia64. >>>>>> Here is updated patch. Please ignore the previous one. >>>>> Any reason why we're not adding kern_clocksource.c for them? >>>> Their event timers code still waits for refactoring. I have neither >>>> documentation nor hardware for them. Help would be appreciated. >>> Can you give me a pointer to a document orpage that describes >>> what is being refactored, why and how? >> In short, timer management code was unified and formalized. Instead of >> direct programming periodic timers from MD code and calling hard-/ >> stat-/ profclock() from there, timer hardware should be exposed to the >> MI kernel using sys/timeet.h API to allow kern_clocksource.c manage it. >> Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() >> callbacks from MD initialization code, and cpu_idleclock() and >> cpu_activeclock() from MD cpu_idle(). >> >> Here is some references: >> man 4 eventtimers >> http://wiki.freebsd.org/201010DevSummit?action=AttachFile&do=view&target=timers.pdf >> http://svnweb.freebsd.org/base?view=revision&revision=209371 >> http://svnweb.freebsd.org/base?view=revision&revision=212541 >> >> All architectures except ia64 and non-Marvell arm are already done, so >> you may took any of them as reference. Ask me if you have any questions. > > Can you give a quick outline of how all the various clock > related initializations and support code relate, interact > or even conflict? It's getting rather convoluted and want > to make sure I get the ordering and timing right. During probe, every event timer driver initializes hardware and calls et_register(). After probe done, on SI_SUB_CLOCKS SYSINIT stage MI cpu_initclocks_bsp() called from MD cpu_initclocks() chooses the best timer, chooses best hz, stathz and profhz values according to timer capabilities and starts timer. If timer is per-CPU, it starts only BSP one. Later, on SMP APs startup, when each CPU launched, cpu_initclocks_ap() is called to start per-CPU timers there. MI code no longer calls hard-/stat-/profclock(). Instead it calls registered callback function. Callback function expects to be called in hardware interrupt context: td_intr_nesting_level should be incremented and td_intr_frame should contain interrupt trapframe pointer. You may see lapic_handle_timer() in x86/x86/local_apic.c as workaround example, if needed. cpu_startprofclock() and cpu_stopprofclock() are MI now and should be removed from MD code. MI cpu_idleclock() and cpu_activeclock() should be called from MD cpu_idle() on per-CPU basis to reprogram timer when CPU enters/exits sleep state. They should be called within critical section to delay context switch on wakeup until all skipped during sleep time events are handled (by the cpu_activeclock()). Timer calls are serialized by caller by holding spin lock (per-CPU locks for per-CPU timers). Due to disabled interrupts, you are not allowed to sleep, wait for IPIs delivery or do anything else, that may cause deadlock with other CPUs. Depending on hardware implementation, you may need to take care to not loose events on short time intervals. It is especially important in one-shot mode, as timer won't be reloaded in that case. > Also: The ITC on ia64 is a per-CPU, one short and periodic > timer that has a fixed frequency. Though the architecture > does not guarantee that counters are synchronized, nor > that all CPUs in a system run at the same frequency which > means that the ITCs may not all run at the same frequency. > Does the et code work with that or do I need to impose a > restriction on what hardware configurations to support > and/or revert to having the ITC be a global timer and run > only on the BSP? Event timer API operates in terms of bintime time intervals. It doesn't depend on timer base frequency. kern_clocksource.c uses that frequency only to calculate more suitable hz/stathz/profhz values. It will survive wrong value there, or even zero, if frequency is unknown. If base frequency differs between CPUs, event timer driver should just properly handle requested bintime value, using proper base frequency when programming timer. In one-shot mode kern_clocksource.c doesn't depend on timer precision. In periodic mode it does, but some drift between CPUs is acceptable. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 17:21:49 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C676106566C; Thu, 23 Jun 2011 17:21:49 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 9FAE38FC08; Thu, 23 Jun 2011 17:21:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NHLlbE048183; Thu, 23 Jun 2011 21:21:47 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NHLkYI048182; Thu, 23 Jun 2011 21:21:46 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 21:21:46 +0400 From: Andrey Chernov To: Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20110623172146.GA48158@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> <20110623160010.GA47278@vniz.net> <20110623162458.GA47670@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110623162458.GA47670@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r223475 - 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: Thu, 23 Jun 2011 17:21:49 -0000 Here is old cd0 probe message with old kernel when it was probed, just in case it helps (nothing unusual with it, and it still works under Win7): cd0 at ata2 bus 0 scbus2 target 0 lun 0 cd0: Removable CD-ROM SCSI-0 device cd0: 100.000MB/s transfers (UDMA5, ATAPI 12bytes, PIO 65534bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed On Thu, Jun 23, 2011 at 08:24:58PM +0400, Andrey Chernov wrote: > On Thu, Jun 23, 2011 at 08:00:10PM +0400, Andrey Chernov wrote: > > On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > > > Author: mav > > > Date: Thu Jun 23 15:10:44 2011 > > > New Revision: 223475 > > > URL: http://svn.freebsd.org/changeset/base/223475 > > > > > > Log: > > > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > > > device to never complete, that caused probe process (system boot) stuck. > > > > With that commit I have no more those "run_interrupt_driven_hooks:..." > > messages, but still have hang at boot related to DVD (no hang if DVDs are > > physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs > > detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in > > the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no > > locks are shown by 'show lock'. > > More about "caplck": it was cdopen() who calls cam_periph_hold() and > sleeps there forever. > > -- > http://ache.vniz.net/ -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 17:42:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E165106566B; Thu, 23 Jun 2011 17:42:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1FD8FC13; Thu, 23 Jun 2011 17:42:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NHgRtp010609; Thu, 23 Jun 2011 17:42:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NHgREN010607; Thu, 23 Jun 2011 17:42:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201106231742.p5NHgREN010607@svn.freebsd.org> From: Jack F Vogel Date: Thu, 23 Jun 2011 17:42: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: r223482 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 17:42:27 -0000 Author: jfv Date: Thu Jun 23 17:42:27 2011 New Revision: 223482 URL: http://svn.freebsd.org/changeset/base/223482 Log: Put back the global for rx processing due to popular demand. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Jun 23 17:30:34 2011 (r223481) +++ head/sys/dev/e1000/if_igb.c Thu Jun 23 17:42:27 2011 (r223482) @@ -346,6 +346,10 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); +/* How many packets rxeof tries to clean at a time */ +static int igb_rx_process_limit = 100; +TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); + /********************************************************************* * Device identification routine * @@ -465,7 +469,7 @@ igb_attach(device_t dev) /* Sysctl for limiting the amount of work done in the taskqueue */ igb_set_sysctl_value(adapter, "rx_processing_limit", "max number of rx packets to process", - &adapter->rx_process_limit, 100); + &adapter->rx_process_limit, igb_rx_process_limit); /* * Validate number of transmit and receive descriptors. It From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 18:41:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970E51065673; Thu, 23 Jun 2011 18:41:29 +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 506FA8FC1B; Thu, 23 Jun 2011 18:41:29 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5NIVa0p009926 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 12:31:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> Date: Thu, 23 Jun 2011 12:30:45 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 23 Jun 2011 12:31:38 -0600 (MDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 18:41:29 -0000 On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >=20 > On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >=20 >> Author: alc >> Date: Thu Jun 23 05:23:59 2011 >> New Revision: 223464 >> URL: http://svn.freebsd.org/changeset/base/223464 >>=20 >> Log: >> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >> MIPS. (At present, although atomic_clear_char() is defined by = atomic.h >> on MIPS, it is not actually implemented by support.S.) >=20 > Thanks, > and good catch on the atomics even if not planned, just in time for = 9.0:) Yea, there's some work there to fix them... Not sure we can even fix = some of them atomically... Warner= From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 20:03:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B1FC1065670; Thu, 23 Jun 2011 20:03:29 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mx1.freebsd.org (Postfix) with ESMTP id 2297D8FC15; Thu, 23 Jun 2011 20:03:29 +0000 (UTC) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 7E41829011B; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh5.mail.rice.edu, auth channel Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id pmwLqZW9DZc1; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) Received: from [10.74.20.46] (staff-74-dun20-046.rice.edu [10.74.20.46]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh5.mail.rice.edu (Postfix) with ESMTPSA id 3CDC429011A; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) Message-ID: <4E039C0F.10505@rice.edu> Date: Thu, 23 Jun 2011 15:03:27 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Warner Losh References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 20:03:29 -0000 On 6/23/2011 1:30 PM, Warner Losh wrote: > On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: > >> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >> >>> Author: alc >>> Date: Thu Jun 23 05:23:59 2011 >>> New Revision: 223464 >>> URL: http://svn.freebsd.org/changeset/base/223464 >>> >>> Log: >>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>> MIPS. (At present, although atomic_clear_char() is defined by atomic.h >>> on MIPS, it is not actually implemented by support.S.) >> Thanks, >> and good catch on the atomics even if not planned, just in time for 9.0:) > Yea, there's some work there to fix them... Not sure we can even fix some of them atomically... > I'm not sure that I understand what you mean by the second statement. Can you elaborate? The 8- and 16-bit operations should be no less "atomic" than the 32- and 64-bit operations. In general, regardless of the size of the operation, the "sc" instruction may fail and the whole operation has to be restarted if another processor (or I/O device) performs a concurrent, cache coherent store to the same location (or even cache line) as the "ll" and "sc" instructions are operating on. On the other hand, if the "sc" instruction succeeds, whether you used it to change all of the 32 bits or just 8 of the 32 bits, it should appear as an atomic change to any other processor. Alan > Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 20:31:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 313341065670; Thu, 23 Jun 2011 20:31:53 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC6F8FC14; Thu, 23 Jun 2011 20:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NKVrSp015460; Thu, 23 Jun 2011 20:31:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NKVqCd015456; Thu, 23 Jun 2011 20:31:52 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201106232031.p5NKVqCd015456@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 23 Jun 2011 20:31: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: r223483 - in head/sys/modules: cxgbe/if_cxgbe nfscl nfscommon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Jun 2011 20:31:53 -0000 Author: uqs Date: Thu Jun 23 20:31:52 2011 New Revision: 223483 URL: http://svn.freebsd.org/changeset/base/223483 Log: Fix make buildworld -DMODULES_WITH_WORLD Sort opt_ srcs Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile head/sys/modules/nfscl/Makefile head/sys/modules/nfscommon/Makefile Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -10,6 +10,7 @@ SRCS = t4_main.c t4_sge.c t4_l2t.c SRCS+= t4_hw.c SRCS+= device_if.h bus_if.h pci_if.h SRCS+= opt_inet.h +SRCS+= opt_ofed.h CFLAGS+= -I${CXGBE} Modified: head/sys/modules/nfscl/Makefile ============================================================================== --- head/sys/modules/nfscl/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/nfscl/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -14,13 +14,14 @@ SRCS= vnode_if.h \ nfs_clsubs.c \ nfs_clvfsops.c \ nfs_clvnops.c \ + opt_bootp.h \ opt_inet.h \ opt_inet6.h \ - opt_bootp.h \ - opt_nfsroot.h \ + opt_kdtrace.h \ + opt_kgssapi.h \ opt_nfs.h \ - opt_ufs.h \ - opt_kgssapi.h + opt_nfsroot.h \ + opt_ufs.h .if !defined(KERNBUILDDIR) NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel Modified: head/sys/modules/nfscommon/Makefile ============================================================================== --- head/sys/modules/nfscommon/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/nfscommon/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -7,9 +7,10 @@ SRCS= vnode_if.h \ nfs_commonkrpc.c \ nfs_commonport.c \ nfs_commonsubs.c \ - opt_kgssapi.h \ - opt_ufs.h \ opt_inet6.h \ - opt_nfs.h + opt_kdtrace.h \ + opt_kgssapi.h \ + opt_nfs.h \ + opt_ufs.h .include From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 20:54:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4FF106564A; Thu, 23 Jun 2011 20:54:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5D16D8FC1A; Thu, 23 Jun 2011 20:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NKsiIc016108; Thu, 23 Jun 2011 20:54:44 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NKsiZo016106; Thu, 23 Jun 2011 20:54:44 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106232054.p5NKsiZo016106@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Jun 2011 20:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223484 - head/contrib/binutils/gas/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 20:54:44 -0000 Author: dim Date: Thu Jun 23 20:54:44 2011 New Revision: 223484 URL: http://svn.freebsd.org/changeset/base/223484 Log: Make GNU as recognize the ARM 'rrx' mnemonic, which can be generated by clang for certain expressions. Code taken from Apple cctools (GPLv2). Submitted by: damjan.marion@gmail.com Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Thu Jun 23 20:31:52 2011 (r223483) +++ head/contrib/binutils/gas/config/tc-arm.c Thu Jun 23 20:54:44 2011 (r223484) @@ -9974,6 +9974,13 @@ do_t_rbit (void) } static void +do_t_rd_rm (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg; +} + +static void do_t_rev (void) { if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7 @@ -14901,6 +14908,9 @@ static const struct asm_opcode insns[] = TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + TCE(rrx, 1a00060, ea4f0030, 2, (RR, RR), rd_rm, t_rd_rm), + TCE(rrxs, 1b00060, ea5f0030, 2, (RR, RR), rd_rm, t_rd_rm), + #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6 TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 21:18:36 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE8E6106564A; Thu, 23 Jun 2011 21:18: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 869528FC15; Thu, 23 Jun 2011 21:18:36 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5NLG8Nh011366 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 15:16:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <4E039C0F.10505@rice.edu> Date: Thu, 23 Jun 2011 15:15:26 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <80DB2C1D-8C66-440D-ADF3-1FBD24D4D116@bsdimp.com> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 23 Jun 2011 15:16:10 -0600 (MDT) Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 21:18:36 -0000 On Jun 23, 2011, at 2:03 PM, Alan Cox wrote: > On 6/23/2011 1:30 PM, Warner Losh wrote: >> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >>=20 >>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>>=20 >>>> Author: alc >>>> Date: Thu Jun 23 05:23:59 2011 >>>> New Revision: 223464 >>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>>=20 >>>> Log: >>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() = on >>>> MIPS. (At present, although atomic_clear_char() is defined by = atomic.h >>>> on MIPS, it is not actually implemented by support.S.) >>> Thanks, >>> and good catch on the atomics even if not planned, just in time for = 9.0:) >> Yea, there's some work there to fix them... Not sure we can even fix = some of them atomically... >>=20 >=20 > I'm not sure that I understand what you mean by the second statement. = Can you elaborate? The 8- and 16-bit operations should be no less = "atomic" than the 32- and 64-bit operations. In general, regardless of = the size of the operation, the "sc" instruction may fail and the whole = operation has to be restarted if another processor (or I/O device) = performs a concurrent, cache coherent store to the same location (or = even cache line) as the "ll" and "sc" instructions are operating on. On = the other hand, if the "sc" instruction succeeds, whether you used it to = change all of the 32 bits or just 8 of the 32 bits, it should appear as = an atomic change to any other processor. I was thinking of the unaligned 16-bit case. Properly aligned I suppose = is a requirement, so I retract my statement: those are easy to = implement. Warner= From owner-svn-src-head@FreeBSD.ORG Thu Jun 23 22:21:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7B21065672; Thu, 23 Jun 2011 22:21:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9D38FC17; Thu, 23 Jun 2011 22:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NMLTwT019059; Thu, 23 Jun 2011 22:21:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NMLSFj019042; Thu, 23 Jun 2011 22:21:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106232221.p5NMLSFj019042@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 22:21: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: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 22:21:29 -0000 Author: nwhitehorn Date: Thu Jun 23 22:21:28 2011 New Revision: 223485 URL: http://svn.freebsd.org/changeset/base/223485 Log: Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64) instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks Modified: head/sys/powerpc/aim/copyinout.c head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/aim/swtch32.S head/sys/powerpc/aim/swtch64.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/copyinout.c head/sys/powerpc/booke/interrupt.c head/sys/powerpc/booke/trap.c head/sys/powerpc/include/pcpu.h head/sys/powerpc/ofw/ofwcall32.S head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/copyinout.c Thu Jun 23 22:21:28 2011 (r223485) @@ -142,7 +142,7 @@ copyout(const void *kaddr, void *udaddr, char *up, *p; size_t l; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -183,7 +183,7 @@ copyin(const void *udaddr, void *kaddr, char *kp, *p; size_t l; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -225,7 +225,7 @@ copyinstr(const void *udaddr, void *kadd size_t l; int rv, c; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -267,7 +267,7 @@ subyte(void *addr, int byte) faultbuf env; char *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (char *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -293,7 +293,7 @@ suword32(void *addr, int word) faultbuf env; int *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (int *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -319,7 +319,7 @@ suword(void *addr, long word) faultbuf env; long *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -359,7 +359,7 @@ fubyte(const void *addr) u_char *p; int val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (u_char *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -385,7 +385,7 @@ fuword32(const void *addr) faultbuf env; int32_t *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (int32_t *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -411,7 +411,7 @@ fuword(const void *addr) faultbuf env; long *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -444,7 +444,7 @@ casuword32(volatile uint32_t *addr, uint faultbuf env; uint32_t *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (uint32_t *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -489,7 +489,7 @@ casuword(volatile u_long *addr, u_long o faultbuf env; u_long *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (u_long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/locore32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -181,8 +181,7 @@ setfault: mflr 0 mfcr 12 mfsprg 4,0 - lwz 4,PC_CURTHREAD(4) - lwz 4,TD_PCB(4) + lwz 4,TD_PCB(2) /* curthread = r2 */ stw 3,PCB_ONFAULT(4) stw 0,0(3) stw 1,4(3) Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/locore64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -203,8 +203,7 @@ ASENTRY(setfault) mflr 0 mfcr 12 mfsprg 4,0 - ld 4,PC_CURTHREAD(4) - ld 4,TD_PCB(4) + ld 4,TD_PCB(13) /* curthread = r13 */ std 3,PCB_ONFAULT(4) std 0,0(3) std 1,8(3) Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/machdep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -303,7 +303,7 @@ powerpc_init(vm_offset_t startkernel, vm */ pc = __pcpu; pcpu_init(pc, 0, sizeof(struct pcpu)); - pc->pc_curthread = &thread0; + curthread_reg = pc->pc_curthread = &thread0; pc->pc_cpuid = 0; __asm __volatile("mtsprg 0, %0" :: "r"(pc)); @@ -745,7 +745,7 @@ kcopy(const void *src, void *dst, size_t faultbuf env, *oldfault; int rv; - td = PCPU_GET(curthread); + td = curthread; oldfault = td->td_pcb->pcb_onfault; if ((rv = setfault(env)) != 0) { td->td_pcb->pcb_onfault = oldfault; Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/mp_cpudep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -88,7 +88,7 @@ cpudep_ap_bootstrap(void) msr = PSL_KERNSET & ~PSL_EE; mtmsr(msr); - pcpup->pc_curthread = pcpup->pc_idlethread; + curthread_reg = pcpup->pc_curthread = pcpup->pc_idlethread; pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; sp = pcpup->pc_curpcb->pcb_sp; Modified: head/sys/powerpc/aim/swtch32.S ============================================================================== --- head/sys/powerpc/aim/swtch32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/swtch32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -69,7 +69,7 @@ * void cpu_throw(struct thread *old, struct thread *new) */ ENTRY(cpu_throw) - mr %r15, %r4 + mr %r2, %r4 b cpu_switchin /* @@ -89,10 +89,9 @@ ENTRY(cpu_switch) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) stw %r1,PCB_SP(%r6) /* Save the stack pointer */ - stw %r2,PCB_TOC(%r6) /* Save the TOC pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ - mr %r15,%r4 /* and the new thread ptr in scratch */ + mr %r2,%r4 /* and the new thread ptr in curthread */ mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ @@ -122,24 +121,24 @@ cpu_switchin: lis %r6,blocked_lock@ha addi %r6,%r6,blocked_lock@l blocked_loop: - lwz %r7,TD_LOCK(%r15) + lwz %r7,TD_LOCK(%r2) cmpw %r6,%r7 beq blocked_loop #endif mfsprg %r7,0 /* Get the pcpu pointer */ - stw %r15,PC_CURTHREAD(%r7) /* Store new current thread */ - lwz %r17,TD_PCB(%r15) /* Store new current PCB */ + stw %r2,PC_CURTHREAD(%r7) /* Store new current thread */ + lwz %r17,TD_PCB(%r2) /* Store new current PCB */ stw %r17,PC_CURPCB(%r7) - mr %r3,%r15 /* Get new thread ptr */ + mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU beq .L3 - mr %r3,%r15 /* Pass curthread to enable_fpu */ + mr %r3,%r2 /* Pass curthread to enable_fpu */ bl enable_fpu .L3: @@ -147,7 +146,7 @@ blocked_loop: /* Restore Altivec context if needed */ andi. %r6, %r6, PCB_VEC beq .L4 - mr %r3,%r15 /* Pass curthread to enable_vec */ + mr %r3,%r2 /* Pass curthread to enable_vec */ bl enable_vec /* thread to restore is in r3 */ @@ -163,7 +162,6 @@ blocked_loop: mtsr USER_SR,%r5 isync lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ - lwz %r2,PCB_TOC(%r3) /* Load the TOC pointer */ /* * Perform a dummy stwcx. to clear any reservations we may have * inherited from the previous thread. It doesn't matter if the Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/swtch64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -69,7 +69,7 @@ * void cpu_throw(struct thread *old, struct thread *new) */ ENTRY(cpu_throw) - mr %r15, %r4 + mr %r13, %r4 b cpu_switchin /* @@ -83,7 +83,6 @@ ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ - std %r13,PCB_CONTEXT+1*8(%r6) std %r14,PCB_CONTEXT+2*8(%r6) std %r15,PCB_CONTEXT+3*8(%r6) std %r16,PCB_CONTEXT+4*8(%r6) @@ -111,7 +110,7 @@ ENTRY(cpu_switch) std %r2,PCB_TOC(%r6) /* Save the TOC pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ - mr %r15,%r4 /* and the new thread ptr in scratch */ + mr %r13,%r4 /* and the new thread ptr in curthread*/ mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ @@ -148,19 +147,19 @@ cpu_switchin: lis %r6,blocked_lock@ha addi %r6,%r6,blocked_lock@l blocked_loop: - ld %r7,TD_LOCK(%r15) + ld %r7,TD_LOCK(%r13) cmpd %r6,%r7 beq blocked_loop #endif mfsprg %r7,0 /* Get the pcpu pointer */ - std %r15,PC_CURTHREAD(%r7) /* Store new current thread */ - ld %r17,TD_PCB(%r15) /* Store new current PCB */ + std %r13,PC_CURTHREAD(%r7) /* Store new current thread */ + ld %r17,TD_PCB(%r13) /* Store new current PCB */ std %r17,PC_CURPCB(%r7) stdu %r1,-48(%r1) - mr %r3,%r15 /* Get new thread ptr */ + mr %r3,%r13 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ nop @@ -168,7 +167,7 @@ blocked_loop: /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU beq .L3 - mr %r3,%r15 /* Pass curthread to enable_fpu */ + mr %r3,%r13 /* Pass curthread to enable_fpu */ bl enable_fpu nop @@ -177,7 +176,7 @@ blocked_loop: /* Restore Altivec context if needed */ andi. %r6, %r6, PCB_VEC beq .L4 - mr %r3,%r15 /* Pass curthread to enable_vec */ + mr %r3,%r13 /* Pass curthread to enable_vec */ bl enable_vec nop @@ -186,7 +185,6 @@ blocked_loop: addi %r1,%r1,48 mr %r3,%r17 /* Recover PCB ptr */ ld %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs. */ - ld %r13,PCB_CONTEXT+1*8(%r3) ld %r14,PCB_CONTEXT+2*8(%r3) ld %r15,PCB_CONTEXT+3*8(%r3) ld %r16,PCB_CONTEXT+4*8(%r3) Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap.c Thu Jun 23 22:21:28 2011 (r223485) @@ -149,7 +149,7 @@ trap(struct trapframe *frame) PCPU_INC(cnt.v_trap); - td = PCPU_GET(curthread); + td = curthread; p = td->td_proc; type = ucode = frame->exc; @@ -452,7 +452,7 @@ syscall(struct trapframe *frame) struct syscall_args sa; int error; - td = PCPU_GET(curthread); + td = curthread; td->td_frame = frame; #ifdef __powerpc64__ @@ -600,7 +600,7 @@ badaddr_read(void *addr, size_t size, in /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = 0; Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -155,9 +155,15 @@ stw %r28,FRAME_AIM_DAR+8(1); \ stw %r29,FRAME_AIM_DSISR+8(1); /* save dsisr/srr0/srr1 */ \ stw %r30,FRAME_SRR0+8(1); \ - stw %r31,FRAME_SRR1+8(1) + stw %r31,FRAME_SRR1+8(1); \ + lwz %r2,PC_CURTHREAD(%r2) /* set curthread pointer */ #define FRAME_LEAVE(savearea) \ +/* Disable exceptions: */ \ + mfmsr %r2; \ + andi. %r2,%r2,~PSL_EE@l; \ + mtmsr %r2; \ + isync; \ /* Now restore regs: */ \ lwz %r2,FRAME_SRR0+8(%r1); \ lwz %r3,FRAME_SRR1+8(%r1); \ @@ -209,7 +215,7 @@ mtsprg3 %r3; \ /* Disable translation, machine check and recoverability: */ \ mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ + andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ mtmsr %r2; \ isync; \ /* Decide whether we return to user mode: */ \ @@ -764,8 +770,8 @@ CNAME(trapexit): bf 17,1f /* branch if PSL_PR is false */ GET_CPUINFO(%r3) /* get per-CPU pointer */ - lwz %r4, PC_CURTHREAD(%r3) /* deref to get curthread */ - lwz %r4, TD_FLAGS(%r4) /* get thread flags value */ + lwz %r4, TD_FLAGS(%r2) /* get thread flags value + * (r2 is curthread) */ lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l and. %r4,%r4,%r5 Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -179,9 +179,15 @@ restore_kernsrs: std %r28,FRAME_AIM_DAR+48(1); \ std %r29,FRAME_AIM_DSISR+48(1); /* save dsisr/srr0/srr1 */ \ std %r30,FRAME_SRR0+48(1); \ - std %r31,FRAME_SRR1+48(1) + std %r31,FRAME_SRR1+48(1); \ + ld %r13,PC_CURTHREAD(%r2) /* set kernel curthread */ #define FRAME_LEAVE(savearea) \ +/* Disable exceptions: */ \ + mfmsr %r2; \ + andi. %r2,%r2,~PSL_EE@l; \ + mtmsr %r2; \ + isync; \ /* Now restore regs: */ \ ld %r2,FRAME_SRR0+48(%r1); \ ld %r3,FRAME_SRR1+48(%r1); \ @@ -233,7 +239,7 @@ restore_kernsrs: mtsprg3 %r3; \ /* Disable translation, machine check and recoverability: */ \ mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ + andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ mtmsr %r2; \ isync; \ /* Decide whether we return to user mode: */ \ @@ -526,8 +532,7 @@ CNAME(trapexit): bf 17,1f /* branch if PSL_PR is false */ GET_CPUINFO(%r3) /* get per-CPU pointer */ - ld %r4, PC_CURTHREAD(%r3) /* deref to get curthread */ - lwz %r4, TD_FLAGS(%r4) /* get thread flags value */ + lwz %r4, TD_FLAGS(%r13) /* get thread flags value */ lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l and. %r4,%r4,%r5 Modified: head/sys/powerpc/booke/copyinout.c ============================================================================== --- head/sys/powerpc/booke/copyinout.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/copyinout.c Thu Jun 23 22:21:28 2011 (r223485) @@ -87,7 +87,7 @@ copyout(const void *kaddr, void *udaddr, if (!is_uaddr(udaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -109,7 +109,7 @@ copyin(const void *udaddr, void *kaddr, if (!is_uaddr(udaddr) || is_uaddr(kaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -135,7 +135,7 @@ copyinstr(const void *udaddr, void *kadd if (!is_uaddr(udaddr) || is_uaddr(kaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -175,7 +175,7 @@ subyte(void *addr, int byte) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -197,7 +197,7 @@ suword(void *addr, long word) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -228,7 +228,7 @@ fubyte(const void *addr) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -251,7 +251,7 @@ fuword(const void *addr) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -288,7 +288,7 @@ casuword(volatile u_long *addr, u_long o if (!((vm_offset_t)addr <= VM_MAXUSER_ADDRESS)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; Modified: head/sys/powerpc/booke/interrupt.c ============================================================================== --- head/sys/powerpc/booke/interrupt.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/interrupt.c Thu Jun 23 22:21:28 2011 (r223485) @@ -118,7 +118,7 @@ powerpc_decr_interrupt(struct trapframe struct thread *td; struct trapframe *oldframe; - td = PCPU_GET(curthread); + td = curthread; critical_enter(); atomic_add_int(&td->td_intr_nesting_level, 1); oldframe = td->td_intr_frame; Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/trap.c Thu Jun 23 22:21:28 2011 (r223485) @@ -145,7 +145,7 @@ trap(struct trapframe *frame) PCPU_INC(cnt.v_trap); - td = PCPU_GET(curthread); + td = curthread; p = td->td_proc; type = frame->exc; @@ -382,7 +382,7 @@ syscall(struct trapframe *frame) struct syscall_args sa; int error; - td = PCPU_GET(curthread); + td = curthread; td->td_frame = frame; error = syscallenter(td, &sa); @@ -480,7 +480,7 @@ badaddr_read(void *addr, size_t size, in /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = 0; Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/include/pcpu.h Thu Jun 23 22:21:28 2011 (r223485) @@ -135,6 +135,14 @@ struct pmap; #ifdef _KERNEL #define pcpup ((struct pcpu *) powerpc_get_pcpup()) +#ifdef __powerpc64__ +register struct thread *curthread_reg __asm("%r13"); +#else +register struct thread *curthread_reg __asm("%r2"); +#endif +#ifdef AIM /* Book-E not yet adapted */ +#define curthread curthread_reg +#endif #define PCPU_GET(member) (pcpup->pc_ ## member) Modified: head/sys/powerpc/ofw/ofwcall32.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/ofw/ofwcall32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -87,10 +87,11 @@ ASENTRY(ofwcall) * later. */ mr %r5,%r1 - lis %r1,(ofwstk+OFWSTKSZ-16)@ha - addi %r1,%r1,(ofwstk+OFWSTKSZ-16)@l - stw %r5,8(%r1) /* Save real stack pointer */ - stw %r6,12(%r1) /* Save old MSR */ + lis %r1,(ofwstk+OFWSTKSZ-32)@ha + addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l + stw %r5,20(%r1) /* Save real stack pointer */ + stw %r2,24(%r1) /* Save curthread */ + stw %r6,28(%r1) /* Save old MSR */ li %r5,0 stw %r5,4(%r1) stw %r5,0(%r1) @@ -100,8 +101,9 @@ ASENTRY(ofwcall) bctrl /* Reload stack pointer and MSR from the OFW stack */ - lwz %r6,12(%r1) - lwz %r1,8(%r1) + lwz %r6,28(%r1) + lwz %r2,24(%r1) + lwz %r1,20(%r1) /* Now set the real MSR */ mtmsr %r6 Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/powerpc/mp_machdep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -96,10 +96,6 @@ machdep_ap_bootstrap(void) printf("SMP: AP CPU #%d launched\n", PCPU_GET(cpuid)); mtx_unlock_spin(&ap_boot_mtx); - /* Initialize curthread */ - PCPU_SET(curthread, PCPU_GET(idlethread)); - PCPU_SET(curpcb, curthread->td_pcb); - /* Start per-CPU event timers. */ cpu_initclocks_ap(); From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 02:30:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249FB106564A; Fri, 24 Jun 2011 02:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 08FE08FC0A; Fri, 24 Jun 2011 02:30:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O2U2fv026334; Fri, 24 Jun 2011 02:30:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O2U2Qf026289; Fri, 24 Jun 2011 02:30:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240230.p5O2U2Qf026289@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 02:30: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: r223486 - in head: sys/dev/sound/usb sys/dev/usb sys/dev/usb/input sys/dev/usb/net sys/dev/usb/serial sys/dev/usb/storage sys/dev/usb/wlan sys/netgraph/bluetooth/drivers/ubt sys/netgrap... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 02:30:03 -0000 Author: hselasky Date: Fri Jun 24 02:30:02 2011 New Revision: 223486 URL: http://svn.freebsd.org/changeset/base/223486 Log: - Move all USB device ID arrays into so-called sections, sorted according to the mode which they support: host, device or dual mode - Add generic tool to extract these data: tools/bus_autoconf Discussed with: imp Suggested by: Robert Millan PR: misc/157903 MFC after: 14 days Added: head/tools/tools/bus_autoconf/ head/tools/tools/bus_autoconf/Makefile (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.c (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.h (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.sh (contents, props changed) Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/input/atp.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usbdi.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/sound/usb/uaudio.c Fri Jun 24 02:30:02 2011 (r223486) @@ -531,6 +531,15 @@ static driver_t uaudio_driver = { .size = sizeof(struct uaudio_softc), }; +static const STRUCT_USB_HOST_ID __used uaudio_devs[] = { + /* Generic USB audio class match */ + {USB_IFACE_CLASS(UICLASS_AUDIO), + USB_IFACE_SUBCLASS(UISUBCLASS_AUDIOCONTROL),}, + /* Generic USB MIDI class match */ + {USB_IFACE_CLASS(UICLASS_AUDIO), + USB_IFACE_SUBCLASS(UISUBCLASS_MIDISTREAM),}, +}; + static int uaudio_probe(device_t dev) { Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/input/atp.c Fri Jun 24 02:30:02 2011 (r223486) @@ -240,7 +240,7 @@ struct atp_dev_params { }, }; -static const struct usb_device_id atp_devs[] = { +static const STRUCT_USB_HOST_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) }, Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/input/uhid.c Fri Jun 24 02:30:02 2011 (r223486) @@ -607,29 +607,33 @@ uhid_ioctl(struct usb_fifo *fifo, u_long return (error); } +static const STRUCT_USB_HOST_ID uhid_devs[] = { + /* generic HID class */ + {USB_IFACE_CLASS(UICLASS_HID),}, + /* the Xbox 360 gamepad doesn't use the HID class */ + {USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(UISUBCLASS_XBOX360_CONTROLLER), + USB_IFACE_PROTOCOL(UIPROTO_XBOX360_GAMEPAD),}, +}; + static int uhid_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bInterfaceClass != UICLASS_HID) { - /* the Xbox 360 gamepad doesn't use the HID class */ + error = usbd_lookup_id_by_uaa(uhid_devs, sizeof(uhid_devs), uaa); + if (error) + return (error); - if ((uaa->info.bInterfaceClass != UICLASS_VENDOR) || - (uaa->info.bInterfaceSubClass != UISUBCLASS_XBOX360_CONTROLLER) || - (uaa->info.bInterfaceProtocol != UIPROTO_XBOX360_GAMEPAD)) { - return (ENXIO); - } - } - if (usb_test_quirk(uaa, UQ_HID_IGNORE)) { + if (usb_test_quirk(uaa, UQ_HID_IGNORE)) return (ENXIO); - } + return (BUS_PROBE_GENERIC); } Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_aue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -110,7 +110,7 @@ SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, /* * Various supported device vendors/products. */ -static const struct usb_device_id aue_devs[] = { +static const STRUCT_USB_HOST_ID aue_devs[] = { #define AUE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } AUE_DEV(3COM, 3C460B, AUE_FLAG_PII), AUE_DEV(ABOCOM, DSB650TX_PNA, 0), Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_axe.c Fri Jun 24 02:30:02 2011 (r223486) @@ -133,7 +133,7 @@ SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, /* * Various supported device vendors/products. */ -static const struct usb_device_id axe_devs[] = { +static const STRUCT_USB_HOST_ID axe_devs[] = { #define AXE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } AXE_DEV(ABOCOM, UF200, 0), AXE_DEV(ACERCM, EP1427X2, 0), Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_cdce.c Fri Jun 24 02:30:02 2011 (r223486) @@ -263,7 +263,7 @@ static const struct usb_ether_methods cd .ue_setpromisc = cdce_setpromisc, }; -static const struct usb_device_id cdce_devs[] = { +static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_ACERLABS, USB_PRODUCT_ACERLABS_M5632, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_AMBIT, USB_PRODUCT_AMBIT_NTL_250, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQLINUX, CDCE_FLAG_NO_UNION)}, @@ -277,7 +277,9 @@ static const struct usb_device_id cdce_d {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLA300, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC700, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, +}; +static const STRUCT_USB_DUAL_ID cdce_dual_devs[] = { {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, 0)}, {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_MOBILE_DIRECT_LINE_MODEL, 0)}, {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_NETWORK_CONTROL_MODEL, 0)}, @@ -472,8 +474,12 @@ static int cdce_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; - return (usbd_lookup_id_by_uaa(cdce_devs, sizeof(cdce_devs), uaa)); + error = usbd_lookup_id_by_uaa(cdce_host_devs, sizeof(cdce_host_devs), uaa); + if (error) + error = usbd_lookup_id_by_uaa(cdce_dual_devs, sizeof(cdce_dual_devs), uaa); + return (error); } static void Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_cue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); /* Belkin F5U111 adapter covered by NETMATE entry */ -static const struct usb_device_id cue_devs[] = { +static const STRUCT_USB_HOST_ID cue_devs[] = { #define CUE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } CUE_DEV(CATC, NETMATE), CUE_DEV(CATC, NETMATE2), Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_ipheth.c Fri Jun 24 02:30:02 2011 (r223486) @@ -148,7 +148,7 @@ static const struct usb_ether_methods ip USB_IFACE_CLASS(c), USB_IFACE_SUBCLASS(sc), \ USB_IFACE_PROTOCOL(pt) -static const struct usb_device_id ipheth_devs[] = { +static const STRUCT_USB_HOST_ID ipheth_devs[] = { {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_kue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/products. */ -static const struct usb_device_id kue_devs[] = { +static const STRUCT_USB_HOST_ID kue_devs[] = { #define KUE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } KUE_DEV(3COM, 3C19250), KUE_DEV(3COM, 3C460), Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_mos.c Fri Jun 24 02:30:02 2011 (r223486) @@ -146,7 +146,7 @@ SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, /* Various supported device vendors/products. */ -static const struct usb_device_id mos_devs[] = { +static const STRUCT_USB_HOST_ID mos_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7730, MCS7730)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7830, MCS7830)}, {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_LN030, MCS7830)}, Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_rue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -108,7 +108,7 @@ SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, * Various supported device vendors/products. */ -static const struct usb_device_id rue_devs[] = { +static const STRUCT_USB_HOST_ID rue_devs[] = { {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUAKTX, 0)}, {USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_USBKR100, 0)}, {USB_VPI(USB_VENDOR_OQO, USB_PRODUCT_OQO_ETHER01, 0)}, Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_udav.c Fri Jun 24 02:30:02 2011 (r223486) @@ -199,7 +199,7 @@ SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug #define UDAV_CLRBIT(sc, reg, x) \ udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) & ~(x)) -static const struct usb_device_id udav_devs[] = { +static const STRUCT_USB_HOST_ID udav_devs[] = { /* ShanTou DM9601 USB NIC */ {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, 0)}, /* ShanTou ST268 USB NIC */ Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/uhso.c Fri Jun 24 02:30:02 2011 (r223486) @@ -247,7 +247,7 @@ static char *uhso_port_type_sysctl[] = { /* ifnet device unit allocations */ static struct unrhdr *uhso_ifnet_unit = NULL; -static const struct usb_device_id uhso_devs[] = { +static const STRUCT_USB_HOST_ID uhso_devs[] = { #define UHSO_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } /* Option GlobeSurfer iCON 7.2 */ UHSO_DEV(OPTION, GSICON72, UHSO_STATIC_IFACE), Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/u3g.c Fri Jun 24 02:30:02 2011 (r223486) @@ -182,7 +182,7 @@ MODULE_DEPEND(u3g, ucom, 1, 1, 1); MODULE_DEPEND(u3g, usb, 1, 1, 1); MODULE_VERSION(u3g, 1); -static const struct usb_device_id u3g_devs[] = { +static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uark.c Fri Jun 24 02:30:02 2011 (r223486) @@ -170,7 +170,7 @@ MODULE_DEPEND(uark, ucom, 1, 1, 1); MODULE_DEPEND(uark, usb, 1, 1, 1); MODULE_VERSION(uark, 1); -static const struct usb_device_id uark_devs[] = { +static const STRUCT_USB_HOST_ID uark_devs[] = { {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, }; Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ubsa.c Fri Jun 24 02:30:02 2011 (r223486) @@ -239,7 +239,7 @@ static const struct ucom_callback ubsa_c .ucom_poll = &ubsa_poll, }; -static const struct usb_device_id ubsa_devs[] = { +static const STRUCT_USB_HOST_ID ubsa_devs[] = { /* AnyData ADU-500A */ {USB_VPI(USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_500A, 0)}, /* AnyData ADU-E100A/H */ Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uchcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -204,7 +204,7 @@ static const struct uchcom_divider_recor #define NUM_DIVIDERS (sizeof (dividers) / sizeof (dividers[0])) -static const struct usb_device_id uchcom_devs[] = { +static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, }; Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ucycom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -180,7 +180,7 @@ MODULE_VERSION(ucycom, 1); /* * Supported devices */ -static const struct usb_device_id ucycom_devs[] = { +static const STRUCT_USB_HOST_ID ucycom_devs[] = { {USB_VPI(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, MODEL_CY7C64013)}, }; Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uftdi.c Fri Jun 24 02:30:02 2011 (r223486) @@ -206,7 +206,7 @@ MODULE_DEPEND(uftdi, ucom, 1, 1, 1); MODULE_DEPEND(uftdi, usb, 1, 1, 1); MODULE_VERSION(uftdi, 1); -static struct usb_device_id uftdi_devs[] = { +static STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v,p,t) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, UFTDI_TYPE_##t) } UFTDI_DEV(ATMEL, STK541, 8U232AM), Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ugensa.c Fri Jun 24 02:30:02 2011 (r223486) @@ -154,7 +154,7 @@ MODULE_DEPEND(ugensa, ucom, 1, 1, 1); MODULE_DEPEND(ugensa, usb, 1, 1, 1); MODULE_VERSION(ugensa, 1); -static const struct usb_device_id ugensa_devs[] = { +static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)}, {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)}, {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)}, Modified: head/sys/dev/usb/serial/uipaq.c ============================================================================== --- head/sys/dev/usb/serial/uipaq.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uipaq.c Fri Jun 24 02:30:02 2011 (r223486) @@ -153,7 +153,7 @@ static const struct ucom_callback uipaq_ * support the same hardware. Numeric values are used where no usbdevs * entries exist. */ -static const struct usb_device_id uipaq_devs[] = { +static const STRUCT_USB_HOST_ID uipaq_devs[] = { /* Socket USB Sync */ {USB_VPI(0x0104, 0x00be, 0)}, /* USB Sync 0301 */ Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ulpt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -483,24 +483,39 @@ ulpt_ioctl(struct usb_fifo *fifo, u_long return (ENODEV); } +static const STRUCT_USB_HOST_ID ulpt_devs[] = { + /* Uni-directional USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_UNI)}, + + /* Bi-directional USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)}, + + /* 1284 USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_1284)}, +}; + static int ulpt_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((uaa->info.bInterfaceClass == UICLASS_PRINTER) && - (uaa->info.bInterfaceSubClass == UISUBCLASS_PRINTER) && - ((uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_UNI) || - (uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_BI) || - (uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_1284))) { - return (0); - } - return (ENXIO); + + error = usbd_lookup_id_by_uaa(ulpt_devs, sizeof(ulpt_devs), uaa); + if (error) + return (error); + + return (BUS_PROBE_GENERIC); } static int Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umcs.c Fri Jun 24 02:30:02 2011 (r223486) @@ -253,7 +253,7 @@ static struct ucom_callback umcs7840_cal .ucom_poll = &umcs7840_poll, }; -static const struct usb_device_id umcs7840_devs[] = { +static const STRUCT_USB_HOST_ID umcs7840_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7820, 0)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7840, 0)}, }; Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umct.c Fri Jun 24 02:30:02 2011 (r223486) @@ -192,7 +192,7 @@ static const struct ucom_callback umct_c .ucom_poll = &umct_poll, }; -static const struct usb_device_id umct_devs[] = { +static const STRUCT_USB_HOST_ID umct_devs[] = { {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, 0)}, {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_SITECOM_USB232, 0)}, {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_DU_H3SP_USB232, 0)}, Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umodem.c Fri Jun 24 02:30:02 2011 (r223486) @@ -123,7 +123,7 @@ SYSCTL_INT(_hw_usb_umodem, OID_AUTO, deb &umodem_debug, 0, "Debug level"); #endif -static const struct usb_device_id umodem_devs[] = { +static const STRUCT_USB_HOST_ID umodem_devs[] = { /* Generic Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), Modified: head/sys/dev/usb/serial/umoscom.c ============================================================================== --- head/sys/dev/usb/serial/umoscom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umoscom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -280,7 +280,7 @@ MODULE_DEPEND(umoscom, ucom, 1, 1, 1); MODULE_DEPEND(umoscom, usb, 1, 1, 1); MODULE_VERSION(umoscom, 1); -static const struct usb_device_id umoscom_devs[] = { +static const STRUCT_USB_HOST_ID umoscom_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)} }; Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uplcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -247,7 +247,7 @@ static struct ucom_callback uplcom_callb #define UPLCOM_DEV(v,p) \ { USB_VENDOR(USB_VENDOR_##v), USB_PRODUCT(USB_PRODUCT_##v##_##p) } -static const struct usb_device_id uplcom_devs[] = { +static const STRUCT_USB_HOST_ID uplcom_devs[] = { UPLCOM_DEV(ACERP, S81), /* BenQ S81 phone */ UPLCOM_DEV(ADLINK, ND6530), /* ADLINK ND-6530 USB-Serial */ UPLCOM_DEV(ALCATEL, OT535), /* Alcatel One Touch 535/735 */ Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uslcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -173,7 +173,7 @@ static struct ucom_callback uslcom_callb .ucom_poll = &uslcom_poll, }; -static const struct usb_device_id uslcom_devs[] = { +static const STRUCT_USB_HOST_ID uslcom_devs[] = { #define USLCOM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } USLCOM_DEV(BALTECH, CARDREADER), USLCOM_DEV(CLIPSAL, 5500PCU), Modified: head/sys/dev/usb/serial/uvisor.c ============================================================================== --- head/sys/dev/usb/serial/uvisor.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uvisor.c Fri Jun 24 02:30:02 2011 (r223486) @@ -253,7 +253,7 @@ MODULE_DEPEND(uvisor, ucom, 1, 1, 1); MODULE_DEPEND(uvisor, usb, 1, 1, 1); MODULE_VERSION(uvisor, 1); -static const struct usb_device_id uvisor_devs[] = { +static const STRUCT_USB_HOST_ID uvisor_devs[] = { #define UVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4), UVISOR_DEV(ALPHASMART, DANA_SYNC, UVISOR_FLAG_PALM4), Modified: head/sys/dev/usb/serial/uvscom.c ============================================================================== --- head/sys/dev/usb/serial/uvscom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uvscom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -233,7 +233,7 @@ static const struct ucom_callback uvscom .ucom_poll = &uvscom_poll, }; -static const struct usb_device_id uvscom_devs[] = { +static const STRUCT_USB_HOST_ID uvscom_devs[] = { /* SUNTAC U-Cable type A4 */ {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS144L4, 0)}, /* SUNTAC U-Cable type D2 */ Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/storage/umass.c Fri Jun 24 02:30:02 2011 (r223486) @@ -721,6 +721,11 @@ MODULE_VERSION(umass, 1); * USB device probe/attach/detach */ +static const STRUCT_USB_HOST_ID __used umass_devs[] = { + /* generic mass storage class */ + {USB_IFACE_CLASS(UICLASS_MASS),}, +}; + static uint16_t umass_get_proto(struct usb_interface *iface) { Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/usbdi.h Fri Jun 24 02:30:02 2011 (r223486) @@ -228,6 +228,18 @@ struct usb_config { }; /* + * Use these macro when defining USB device ID arrays if you want to + * have your driver module automatically loaded in host, device or + * both modes respectivly: + */ +#define STRUCT_USB_HOST_ID \ + struct usb_device_id __section("usb_host_id") +#define STRUCT_USB_DEVICE_ID \ + struct usb_device_id __section("usb_device_id") +#define STRUCT_USB_DUAL_ID \ + struct usb_device_id __section("usb_dual_id") + +/* * The following structure is used when looking up an USB driver for * an USB device. It is inspired by the Linux structure called * "usb_device_id". Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_rum.c Fri Jun 24 02:30:02 2011 (r223486) @@ -85,7 +85,7 @@ SYSCTL_INT(_hw_usb_rum, OID_AUTO, debug, "Debug level"); #endif -static const struct usb_device_id rum_devs[] = { +static const STRUCT_USB_HOST_ID rum_devs[] = { #define RUM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUM_DEV(ABOCOM, HWU54DM), RUM_DEV(ABOCOM, RT2573_2), Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_run.c Fri Jun 24 02:30:02 2011 (r223486) @@ -96,7 +96,7 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, */ #define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) -static const struct usb_device_id run_devs[] = { +static const STRUCT_USB_HOST_ID run_devs[] = { #define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_uath.c Fri Jun 24 02:30:02 2011 (r223486) @@ -167,7 +167,7 @@ enum { (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) /* recognized device vendors/products */ -static const struct usb_device_id uath_devs[] = { +static const STRUCT_USB_HOST_ID uath_devs[] = { #define UATH_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } UATH_DEV(ACCTON, SMCWUSBG), UATH_DEV(ACCTON, SMCWUSBTG2), Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -170,7 +170,7 @@ static int upgt_tx_start(struct upgt_sof static const char *upgt_fwname = "upgt-gw3887"; -static const struct usb_device_id upgt_devs_2[] = { +static const STRUCT_USB_HOST_ID upgt_devs[] = { #define UPGT_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } /* version 2 devices */ UPGT_DEV(ACCTON, PRISM_GT), @@ -236,7 +236,7 @@ upgt_match(device_t dev) if (uaa->info.bIfaceIndex != UPGT_IFACE_INDEX) return (ENXIO); - return (usbd_lookup_id_by_uaa(upgt_devs_2, sizeof(upgt_devs_2), uaa)); + return (usbd_lookup_id_by_uaa(upgt_devs, sizeof(upgt_devs), uaa)); } static int Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_ural.c Fri Jun 24 02:30:02 2011 (r223486) @@ -91,7 +91,7 @@ SYSCTL_INT(_hw_usb_ural, OID_AUTO, debug ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) /* various supported device vendors/products */ -static const struct usb_device_id ural_devs[] = { +static const STRUCT_USB_HOST_ID ural_devs[] = { #define URAL_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } URAL_DEV(ASUS, WL167G), URAL_DEV(ASUS, RT2570), Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Jun 24 02:30:02 2011 (r223486) @@ -102,7 +102,7 @@ TUNABLE_INT("hw.usb.urtw.preamble_mode", { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, URTW_REV_RTL8187L) } #define URTW_REV_RTL8187B 0 #define URTW_REV_RTL8187L 1 -static const struct usb_device_id urtw_devs[] = { +static const STRUCT_USB_HOST_ID urtw_devs[] = { URTW_DEV_B(NETGEAR, WG111V3), URTW_DEV_B(REALTEK, RTL8187B_0), URTW_DEV_B(REALTEK, RTL8187B_1), Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Jun 24 02:30:02 2011 (r223486) @@ -200,7 +200,7 @@ static const struct zyd_phy_pair zyd_def { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) } #define ZYD_ZD1211B_DEV(v,p) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) } -static const struct usb_device_id zyd_devs[] = { +static const STRUCT_USB_HOST_ID zyd_devs[] = { /* ZYD_ZD1211 */ ZYD_ZD1211_DEV(3COM2, 3CRUSB10075), ZYD_ZD1211_DEV(ABOCOM, WL54), Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -382,14 +382,14 @@ static const struct usb_config ubt_conf * where VENDOR_ID and PRODUCT_ID are hex numbers. */ -static const struct usb_device_id ubt_ignore_devs[] = +static const STRUCT_USB_HOST_ID ubt_ignore_devs[] = { /* AVM USB Bluetooth-Adapter BlueFritz! v1.0 */ { USB_VPI(USB_VENDOR_AVM, 0x2200, 0) }, }; /* List of supported bluetooth devices */ -static const struct usb_device_id ubt_devs[] = +static const STRUCT_USB_HOST_ID ubt_devs[] = { /* Generic Bluetooth class devices */ { USB_IFACE_CLASS(UDCLASS_WIRELESS), Modified: head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Fri Jun 24 02:30:02 2011 (r223486) @@ -180,7 +180,7 @@ MODULE_DEPEND(ubtbcmfw, usb, 1, 1, 1); static int ubtbcmfw_probe(device_t dev) { - const struct usb_device_id devs[] = { + static const STRUCT_USB_HOST_ID devs[] = { /* Broadcom BCM2033 devices only */ { USB_VPI(USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033, 0) }, }; Added: head/tools/tools/bus_autoconf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/Makefile Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,43 @@ +# $FreeBSD$ +# +# Copyright (c) 2011 Hans Petter Selasky. 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. +# + +# +# Example on how to use: +# +# make clean all install +# +# ./bus_autoconf.sh /boot/kernel/*.ko | less +# + +PROG= bus_autoconf +MAN= +BINDIR?= /usr/local/bin + +SRCS= bus_autoconf.c + +WARNS= 6 + +.include Added: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,321 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. 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. + */ + +/* + * Disclaimer: This utility and format is subject to change and not a + * comitted interface. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bus_autoconf.h" + +static char *type; +static char *file_name; +static char *module; +static const char *mode; + +static int +usb_compare(const void *_a, const void *_b) +{ + const struct usb_device_id *a = _a; + const struct usb_device_id *b = _b; + + if (a->idVendor > b->idVendor) + return (1); + if (a->idVendor < b->idVendor) + return (-1); + if (a->idProduct > b->idProduct) + return (1); + if (a->idProduct < b->idProduct) + return (-1); + if (a->bDeviceClass > b->bDeviceClass) + return (1); + if (a->bDeviceClass < b->bDeviceClass) + return (-1); + if (a->bDeviceSubClass > b->bDeviceSubClass) + return (1); + if (a->bDeviceSubClass < b->bDeviceSubClass) + return (-1); + if (a->bDeviceProtocol > b->bDeviceProtocol) + return (1); + if (a->bDeviceProtocol < b->bDeviceProtocol) + return (-1); + if (a->bInterfaceClass > b->bInterfaceClass) + return (1); + if (a->bInterfaceClass < b->bInterfaceClass) + return (-1); + if (a->bInterfaceSubClass > b->bInterfaceSubClass) + return (1); + if (a->bInterfaceSubClass < b->bInterfaceSubClass) + return (-1); + if (a->bInterfaceProtocol > b->bInterfaceProtocol) + return (1); + if (a->bInterfaceProtocol < b->bInterfaceProtocol) + return (-1); + + return (0); +} + +static void +usb_sort(struct usb_device_id *id, uint32_t nid) +{ + qsort(id, nid, sizeof(*id), &usb_compare); +} + +struct usb_info { + uint8_t is_iface; + uint8_t is_any; + uint8_t is_vp; + uint8_t is_dev; +}; + +static void +usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) +{ +#if USB_HAVE_COMPAT_LINUX + if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) + id->match_flag_vendor = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) + id->match_flag_product = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) + id->match_flag_dev_lo = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) + id->match_flag_dev_hi = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) + id->match_flag_dev_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) + id->match_flag_dev_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) + id->match_flag_dev_protocol = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) + id->match_flag_int_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) + id->match_flag_int_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) + id->match_flag_int_protocol = 1; +#endif + + pinfo->is_iface = id->match_flag_int_class | + id->match_flag_int_protocol | + id->match_flag_int_subclass; + + pinfo->is_dev = id->match_flag_dev_class | + id->match_flag_dev_subclass; + + pinfo->is_vp = id->match_flag_vendor | + id->match_flag_product; + + pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; +} + +static uint32_t +usb_dump(struct usb_device_id *id, uint32_t nid) +{ + uint32_t n = 1; + struct usb_info info; + + usb_dump_sub(id, &info); + + if (info.is_iface) { + printf("nomatch 10 {\n" + " match \"system\" \"USB\";\n" + " match \"subsystem\" \"INTERFACE\";\n" + " match \"mode\" \"%s\";\n", mode); + } else if (info.is_any) { + printf("nomatch 10 {\n" + " match \"system\" \"USB\";\n" + " match \"subsystem\" \"DEVICE\";\n" + " match \"mode\" \"%s\";\n", mode); + } else { + return (n); + } + + if (id->match_flag_vendor) { + printf(" match \"vendor\" \"0x%04x\";\n", + id->idVendor); + } + if (id->match_flag_product) { + uint32_t x; + + if (info.is_any == 1 && info.is_vp == 1) { + /* try to join similar entries */ + while (n < nid) { + usb_dump_sub(id + n, &info); + + if (info.is_any != 1 || info.is_vp != 1) + break; + if (id[n].idVendor != id[0].idVendor) + break; + n++; + } + /* restore infos */ + usb_dump_sub(id, &info); + } + if (n == 1) { + printf(" match \"product\" \"0x%04x\";\n", + id->idProduct); + } else { + printf(" match \"product\" \"("); + + for (x = 0; x != n; x++) { + printf("0x%04x%s", id[x].idProduct, + (x == (n - 1)) ? "" : "|"); + } + + printf(")\";\n"); + } + } + if (id->match_flag_dev_class) { + printf(" match \"devclass\" \"0x%02x\";\n", + id->bDeviceClass); + } + if (id->match_flag_dev_subclass) { + printf(" match \"devsubclass\" \"0x%02x\";\n", + id->bDeviceSubClass); + } + if (id->match_flag_int_class) { + printf(" match \"intclass\" \"0x%02x\";\n", + id->bInterfaceClass); + } + if (id->match_flag_int_subclass) { + printf(" match \"intsubclass\" \"0x%02x\";\n", + id->bInterfaceSubClass); + } + if (id->match_flag_int_protocol) { + printf(" match \"intprotocol\" \"0x%02x\";\n", + id->bInterfaceProtocol); + } + printf(" action \"kldload %s\";\n" + "};\n\n", module); + + return (n); +} + +static void +usb_parse_and_dump(int f, off_t size) +{ + struct usb_device_id *id; + uint32_t nid; + uint32_t x; + + if (size % sizeof(struct usb_device_id)) { + errx(EX_NOINPUT, "Size is not divisible by %d", + (int)sizeof(struct usb_device_id)); + } + lseek(f, 0, SEEK_SET); + + id = malloc(size); + if (id == NULL) { + errx(EX_SOFTWARE, "Out of memory"); + } + if (read(f, id, size) != size) { + err(EX_NOINPUT, "Cannot read all data"); + } + nid = size / sizeof(*id); + + usb_sort(id, nid); + + for (x = 0; x != nid;) + x += usb_dump(id + x, nid - x); + + free(id); +} + +static void +usage(void) +{ + fprintf(stderr, + "bus_autoconf - devd config file generator\n" + " -i \n" + " -m \n" + " -t \n" + " -h show usage\n" + ); + exit(EX_USAGE); +} + +int +main(int argc, char **argv) +{ + const char *params = "i:m:ht:"; + int c; + int f; + off_t off; + + while ((c = getopt(argc, argv, params)) != -1) { + switch (c) { + case 'i': + file_name = optarg; + break; + case 't': + type = optarg; + break; + case 'm': + module = optarg; + break; + default: + usage(); + break; + } + } + + if (type == NULL || module == NULL || file_name == NULL) + usage(); + + f = open(file_name, O_RDONLY); + if (f < 0) + err(EX_NOINPUT, "Cannot open file '%s'", file_name); + + off = lseek(f, 0, SEEK_END); + if (off <= 0) + err(EX_NOINPUT, "Cannot seek to end of file"); + + if (strcmp(type, "usb_host") == 0) { + mode = "host"; + usb_parse_and_dump(f, off); + } else if (strcmp(type, "usb_device") == 0) { + mode = "device"; + usb_parse_and_dump(f, off); + } else if (strcmp(type, "usb_dual") == 0) { + mode = "(host|device)"; + usb_parse_and_dump(f, off); + } else { + err(EX_USAGE, "Unsupported structure type: %s", type); + } + + close(f); + + return (0); +} Added: head/tools/tools/bus_autoconf/bus_autoconf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_autoconf.h Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,83 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BUS_AUTOCONF_H_ +#define _BUS_AUTOCONF_H_ + +/* Make sure we get the have compat linux definition. */ +#include + +struct usb_device_id { + + /* Hook for driver specific information */ + unsigned long driver_info; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 02:56:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2050D106564A; Fri, 24 Jun 2011 02:56:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0EF998FC13; Fri, 24 Jun 2011 02:56:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O2uO12027096; Fri, 24 Jun 2011 02:56:24 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O2uOpW027094; Fri, 24 Jun 2011 02:56:24 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240256.p5O2uOpW027094@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 02:56: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: r223487 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 02:56:25 -0000 Author: rodrigc Date: Fri Jun 24 02:56:24 2011 New Revision: 223487 URL: http://svn.freebsd.org/changeset/base/223487 Log: Bring back synchnet() implementation from older tftp implementation. The synchnet() function was converted to a no-op when the new TFTP implementation was committed to FreeBSD. However, this function, as it was in the older code, is needed in order to synchronize between the tftpd server and tftp clients, which may be buggy. Specifically, we had a buggy TFTP client which would send TFTP ACK packets for non-TFTP packets, which would cause the count of packets to get out of whack, causing transfers to fail with the new TFTPD implementation. Obtained from: Juniper Networks Submitted by: Santhanakrishnan Balraj Modified: head/libexec/tftpd/tftp-file.c Modified: head/libexec/tftpd/tftp-file.c ============================================================================== --- head/libexec/tftpd/tftp-file.c Fri Jun 24 02:30:02 2011 (r223486) +++ head/libexec/tftpd/tftp-file.c Fri Jun 24 02:56:24 2011 (r223487) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -249,9 +251,34 @@ read_close(void) } +/* When an error has occurred, it is possible that the two sides + * are out of synch. Ie: that what I think is the other side's + * response to packet N is really their response to packet N-1. + * + * So, to try to prevent that, we flush all the input queued up + * for us on the network connection on our host. + * + * We return the number of packets we flushed (mostly for reporting + * when trace is active). + */ + int -synchnet(int peer __unused) +synchnet(int peer) /* socket to flush */ { - - return 0; + int i, j = 0; + char rbuf[MAXPKTSIZE]; + struct sockaddr_storage from; + socklen_t fromlen; + + while (1) { + (void) ioctl(peer, FIONREAD, &i); + if (i) { + j++; + fromlen = sizeof from; + (void) recvfrom(peer, rbuf, sizeof (rbuf), 0, + (struct sockaddr *)&from, &fromlen); + } else { + return(j); + } + } } From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 03:31:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BED41106564A; Fri, 24 Jun 2011 03:31:40 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 99A038FC13; Fri, 24 Jun 2011 03:31:39 +0000 (UTC) Received: by wwe6 with SMTP id 6so2337520wwe.31 for ; Thu, 23 Jun 2011 20:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=do5RqvBDQw9GB9Q2JhbOs2FAoI9AbgMvtrcnRXGIclw=; b=mm8XmdY9go+WXAU3hxrYSb9vVwGnuCBzs+LaclGL4xs0B7colfPyZlcyq86CV3WGri Pe219AF7m26N/8JgtNIo14XuBj5IvmPZF2rtMCzyCEMvjsZRqnL2I6vfdIYO6aaZxId7 7kVunW+yJA0pAQEYrh/iahcSCuZeXC8temaWo= 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=H1PcGOSWuBEViee/LRXhP3Rht6V5l0PqpqC0hZAANYBzh2StDmntxWswCFOx5GE0FZ xJlbYfLh37JTl7rI3fqgRsqPMH1eubteuGqskCMgpqwG1rKUbJ7XEXWNVIypu3i9fFEF QNDL1QPVcTM5JbHBEVpqIJNx/PyptW3CBJvs0= MIME-Version: 1.0 Received: by 10.216.68.6 with SMTP id k6mr6237wed.85.1308884697347; Thu, 23 Jun 2011 20:04:57 -0700 (PDT) Received: by 10.216.166.195 with HTTP; Thu, 23 Jun 2011 20:04:57 -0700 (PDT) In-Reply-To: <4E039C0F.10505@rice.edu> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> Date: Fri, 24 Jun 2011 08:34:57 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 03:31:40 -0000 On Fri, Jun 24, 2011 at 1:33 AM, Alan Cox wrote: > On 6/23/2011 1:30 PM, Warner Losh wrote: >> >> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >> >>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>> >>>> Author: alc >>>> Date: Thu Jun 23 05:23:59 2011 >>>> New Revision: 223464 >>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>> >>>> Log: >>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>>> MIPS. =A0(At present, although atomic_clear_char() is defined by atomi= c.h >>>> on MIPS, it is not actually implemented by support.S.) >>> >>> Thanks, >>> and good catch on the atomics even if not planned, just in time for 9.0= :) >> >> Yea, there's some work there to fix them... =A0Not sure we can even fix = some >> of them atomically... >> > > I'm not sure that I understand what you mean by the second statement. =A0= Can > you elaborate? =A0The 8- and 16-bit operations should be no less "atomic"= than > the 32- and 64-bit operations. =A0In general, regardless of the size of t= he > operation, the "sc" instruction may fail and the whole operation has to b= e > restarted if another processor (or I/O device) performs a concurrent, cac= he > coherent store to the same location (or even cache line) as the "ll" and > "sc" instructions are operating on. =A0On the other hand, if the "sc" > instruction succeeds, whether you used it to change all of the 32 bits or > just 8 of the 32 bits, it should appear as an atomic change to any other > processor. I will try out an implementation and see if this works on XLR, if so this is something we can add to support.S JC. From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 03:50:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8681F106564A; Fri, 24 Jun 2011 03:50:55 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 73BC58FC18; Fri, 24 Jun 2011 03:50:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O3otop028957; Fri, 24 Jun 2011 03:50:55 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O3otfc028955; Fri, 24 Jun 2011 03:50:55 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240350.p5O3otfc028955@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 03:50: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: r223488 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 03:50:55 -0000 Author: rodrigc Date: Fri Jun 24 03:50:54 2011 New Revision: 223488 URL: http://svn.freebsd.org/changeset/base/223488 Log: Fixes to newer tftp code in libstand: (1) Coding style changes. (2) If the server does not acknowledge any blocksize option, revert to the default blocksize of 512 bytes. (3) Send ACK if the first packet happens to be the last packet. (4) Do not accept blocksize greater than what was requested. (5) Drop any unwanted OACK received if a tftp transfer is already in progress. (6) Terminate incomplete transfers with a special no-error ERROR packet. Otherwise we rely on the tftp server to time out, which it does eventually, after re-sending the last packet several times and spamming the system log about it every time. This idea is borrowed from the PXE client, which does exactly that. Submitted by: Alexander Kabaev Reviewed and Tested by: Santhanakrishnan Balraj Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Fri Jun 24 02:56:24 2011 (r223487) +++ head/lib/libstand/tftp.c Fri Jun 24 03:50:54 2011 (r223488) @@ -64,13 +64,13 @@ struct tftp_handle; static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); -static void tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(struct tftp_handle *h, +static ssize_t sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *h, void *, ssize_t, time_t, unsigned short *), @@ -93,7 +93,7 @@ static int tftpport = 2000; static int is_open = 0; /* - * The legacy TFTP_BLKSIZE value was 512. + * The legacy TFTP_BLKSIZE value was SEGSIZE(512). * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ @@ -102,7 +102,7 @@ static int is_open = 0; /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. - */ + */ #define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { @@ -113,7 +113,7 @@ struct tftp_handle { int off; char *path; /* saved for re-requests */ unsigned int tftp_blksize; - unsigned long tftp_tsize; + unsigned long tftp_tsize; struct { u_char header[HEADER_SIZE]; struct tftphdr t; @@ -121,7 +121,8 @@ struct tftp_handle { } __packed __aligned(4) lastdata; }; -static const int tftperrors[8] = { +#define TFTP_MAX_ERRCODE EOPTNEG +static const int tftperrors[TFTP_MAX_ERRCODE + 1] = { 0, /* ??? */ ENOENT, EPERM, @@ -129,10 +130,57 @@ static const int tftperrors[8] = { EINVAL, /* ??? */ EINVAL, /* ??? */ EEXIST, - EINVAL /* ??? */ + EINVAL, /* ??? */ + EINVAL, /* Option negotiation failed. */ }; -static ssize_t +static int tftp_getnextblock(struct tftp_handle *h); + +/* send error message back. */ +static void +tftp_senderr(struct tftp_handle *h, u_short errcode, const char *msg) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + u_char space[63]; /* +1 from t */ + } __packed __aligned(4) wbuf; + char *wtail; + int len; + + len = strlen(msg); + if (len > sizeof(wbuf.space)) + len = sizeof(wbuf.space); + + wbuf.t.th_opcode = htons((u_short) ERROR); + wbuf.t.th_code = htons(errcode); + + wtail = wbuf.t.th_msg; + bcopy(msg, wtail, len); + wtail[len] = '\0'; + wtail += len + 1; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static void +tftp_sendack(struct tftp_handle *h) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + } __packed __aligned(4) wbuf; + char *wtail; + + wbuf.t.th_opcode = htons((u_short) ACK); + wtail = (char *) &wbuf.t.th_block; + wbuf.t.th_block = htons((u_short) h->currblock); + wtail += 2; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static ssize_t recvtftp(struct tftp_handle *h, void *pkt, ssize_t len, time_t tleft, unsigned short *rtype) { @@ -170,7 +218,7 @@ recvtftp(struct tftp_handle *h, void *pk return got; } case ERROR: - if ((unsigned) ntohs(t->th_code) >= 8) { + if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -182,14 +230,30 @@ recvtftp(struct tftp_handle *h, void *pk return (-1); case OACK: { struct udphdr *uh; - int tftp_oack_len = len - sizeof(t->th_opcode); - tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len); + int tftp_oack_len; + + /* + * Unexpected OACK. TFTP transfer already in progress. + * Drop the pkt. + */ + if (d->xid != 1) { + return (-1); + } + /* - * Remember which port this OACK came from, - * because we need to send the ACK back to it. + * Remember which port this OACK came from, because we need + * to send the ACK or errors back to it. */ uh = (struct udphdr *) pkt - 1; d->destport = uh->uh_sport; + + /* Parse options ACK-ed by the server. */ + tftp_oack_len = len - sizeof(t->th_opcode); + if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { + tftp_senderr(h, EOPTNEG, "Malformed OACK"); + errno = EIO; + return (-1); + } return (0); } default: @@ -201,7 +265,7 @@ recvtftp(struct tftp_handle *h, void *pk } /* send request, expect first block (or error) */ -static int +static int tftp_makereq(struct tftp_handle *h) { struct { @@ -250,26 +314,28 @@ tftp_makereq(struct tftp_handle *h) h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ + h->currblock = 0; + h->islastblock = 0; + h->validsize = 0; + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - if (rtype == OACK) { - wbuf.t.th_opcode = htons((u_short)ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons(0); - wtail += 2; - rtype = 0; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - } + if (rtype == OACK) + return (tftp_getnextblock(h)); + + /* Server ignored our blksize request, revert to TFTP default. */ + h->tftp_blksize = SEGSIZE; switch (rtype) { case DATA: { h->currblock = 1; h->validsize = res; h->islastblock = 0; - if (res < h->tftp_blksize) + if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ + tftp_sendack(h); + } return (0); } case ERROR: @@ -320,7 +386,7 @@ tftp_getnextblock(struct tftp_handle *h) return (0); } -static int +static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; @@ -365,7 +431,7 @@ tftp_open(const char *path, struct open_ return (0); } -static int +static int tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid /* out */) { @@ -381,9 +447,11 @@ tftp_read(struct open_file *f, void *add needblock = tftpfile->off / tftpfile->tftp_blksize + 1; - if (tftpfile->currblock > needblock) /* seek backwards */ + if (tftpfile->currblock > needblock) { /* seek backwards */ + tftp_senderr(tftpfile, 0, "No error: read aborted"); tftp_makereq(tftpfile); /* no error check, it worked * for open */ + } while (tftpfile->currblock < needblock) { int res; @@ -452,7 +520,7 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, size_t *resid __unused /* out */) { @@ -473,7 +541,7 @@ tftp_stat(struct open_file *f, struct st return (0); } -static off_t +static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; @@ -494,7 +562,7 @@ tftp_seek(struct open_file *f, off_t off } static ssize_t -sendrecv_tftp(struct tftp_handle *h, +sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *, void *, ssize_t, time_t, unsigned short *), @@ -562,9 +630,9 @@ tftp_set_blksize(struct tftp_handle *h, /* * Only accept blksize value if it is numeric. - * RFC2348 specifies that acceptable valuesare 8-65464 - * 8-65464 . Let's choose a limit less than MAXRSPACE - */ + * RFC2348 specifies that acceptable values are 8-65464. + * Let's choose a limit less than MAXRSPACE. + */ if (*endptr == '\0' && new_blksize >= 8 && new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; @@ -597,13 +665,12 @@ tftp_set_blksize(struct tftp_handle *h, * optN, valueN * The final option/value acknowledgment pair. */ -static void +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { /* * We parse the OACK strings into an array * of name-value pairs. - * */ char *tftp_options[128] = { 0 }; char *val = buf; @@ -612,18 +679,22 @@ tftp_parse_oack(struct tftp_handle *h, c int blksize_is_set = 0; int tsize = 0; - - while ( option_idx < 128 && i < len ) { - if (buf[i] == '\0') { - if (&buf[i] > val) { - tftp_options[option_idx] = val; - val = &buf[i] + 1; - ++option_idx; - } - } - ++i; + unsigned int orig_blksize; + + while (option_idx < 128 && i < len) { + if (buf[i] == '\0') { + if (&buf[i] > val) { + tftp_options[option_idx] = val; + val = &buf[i] + 1; + ++option_idx; + } + } + ++i; } + /* Save the block size we requested for sanity check later. */ + orig_blksize = h->tftp_blksize; + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. @@ -631,27 +702,37 @@ tftp_parse_oack(struct tftp_handle *h, c */ for (i = 0; i < option_idx; i += 2) { if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) blksize_is_set = tftp_set_blksize(h, tftp_options[i + 1]); - } } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - } + } else { + /* Do not allow any options we did not expect to be ACKed. */ + printf("unexpected tftp option '%s'\n", tftp_options[i]); + return (-1); } } if (!blksize_is_set) { /* * If TFTP blksize was not set, try defaulting - * to the legacy TFTP blksize of 512 + * to the legacy TFTP blksize of SEGSIZE(512) */ - h->tftp_blksize = 512; + h->tftp_blksize = SEGSIZE; + } else if (h->tftp_blksize > orig_blksize) { + /* + * Server should not be proposing block sizes that + * exceed what we said we can handle. + */ + printf("unexpected blksize %u\n", h->tftp_blksize); + return (-1); } #ifdef TFTP_DEBUG printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif + return 0; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 04:16:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1D5106564A; Fri, 24 Jun 2011 04:16:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 28BEF8FC14; Fri, 24 Jun 2011 04:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O4G7Z6029748; Fri, 24 Jun 2011 04:16:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O4G7kB029743; Fri, 24 Jun 2011 04:16:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240416.p5O4G7kB029743@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 04:16: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: r223489 - in head: sys/dev/usb tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 04:16:07 -0000 Author: hselasky Date: Fri Jun 24 04:16:06 2011 New Revision: 223489 URL: http://svn.freebsd.org/changeset/base/223489 Log: - Add additional information to the PnP info of USB HUBs children which is now required by bus_autoconf. - Allow interface class matching even if device class is vendor specific. - Update bus_autoconf tool to not generate system and subsystem match lines for the nomatch event. PR: misc/157903 MFC after: 14 days Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_lookup.c head/tools/tools/bus_autoconf/bus_autoconf.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/sys/dev/usb/usb_hub.c Fri Jun 24 04:16:06 2011 (r223489) @@ -1334,15 +1334,19 @@ uhub_child_pnpinfo_string(device_t paren "devclass=0x%02x devsubclass=0x%02x " "sernum=\"%s\" " "release=0x%04x " - "intclass=0x%02x intsubclass=0x%02x" "%s%s", + "mode=%s " + "intclass=0x%02x intsubclass=0x%02x " + "intprotocol=0x%02x " "%s%s", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, res.udev->ddesc.bDeviceSubClass, usb_get_serial(res.udev), UGETW(res.udev->ddesc.bcdDevice), + (res.udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", iface->idesc->bInterfaceClass, iface->idesc->bInterfaceSubClass, + iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); } else { Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/sys/dev/usb/usb_lookup.c Fri Jun 24 04:16:06 2011 (r223489) @@ -105,13 +105,6 @@ usbd_lookup_id_by_info(const struct usb_ (id->bDeviceProtocol != info->bDeviceProtocol)) { continue; } - if ((info->bDeviceClass == 0xFF) && - (!(id->match_flag_vendor)) && - ((id->match_flag_int_class) || - (id->match_flag_int_subclass) || - (id->match_flag_int_protocol))) { - continue; - } if ((id->match_flag_int_class) && (id->bInterfaceClass != info->bInterfaceClass)) { continue; Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:16:06 2011 (r223489) @@ -148,15 +148,8 @@ usb_dump(struct usb_device_id *id, uint3 usb_dump_sub(id, &info); - if (info.is_iface) { + if (info.is_any) { printf("nomatch 10 {\n" - " match \"system\" \"USB\";\n" - " match \"subsystem\" \"INTERFACE\";\n" - " match \"mode\" \"%s\";\n", mode); - } else if (info.is_any) { - printf("nomatch 10 {\n" - " match \"system\" \"USB\";\n" - " match \"subsystem\" \"DEVICE\";\n" " match \"mode\" \"%s\";\n", mode); } else { return (n); From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 04:35:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFCA106564A; Fri, 24 Jun 2011 04:35:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6B39E8FC13; Fri, 24 Jun 2011 04:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O4ZwB8030338; Fri, 24 Jun 2011 04:35:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O4Zwdh030336; Fri, 24 Jun 2011 04:35:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240435.p5O4Zwdh030336@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 04:35: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: r223490 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 04:35:58 -0000 Author: hselasky Date: Fri Jun 24 04:35:58 2011 New Revision: 223490 URL: http://svn.freebsd.org/changeset/base/223490 Log: - Make sure we don't match the wrong device by adding a match for the bus the device belongs to. PR: misc/157903 MFC after: 14 days Modified: head/tools/tools/bus_autoconf/bus_autoconf.c Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:16:06 2011 (r223489) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:35:58 2011 (r223490) @@ -150,6 +150,7 @@ usb_dump(struct usb_device_id *id, uint3 if (info.is_any) { printf("nomatch 10 {\n" + " match \"bus\" \"uhub[0-9]+\";\n" " match \"mode\" \"%s\";\n", mode); } else { return (n); From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 05:41:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8819106564A; Fri, 24 Jun 2011 05:41:38 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C74428FC08; Fri, 24 Jun 2011 05:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O5fcfP032150; Fri, 24 Jun 2011 05:41:38 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O5fcMA032147; Fri, 24 Jun 2011 05:41:38 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240541.p5O5fcMA032147@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 05:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223491 - in head: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 05:41:38 -0000 Author: rodrigc Date: Fri Jun 24 05:41:38 2011 New Revision: 223491 URL: http://svn.freebsd.org/changeset/base/223491 Log: Acknowledge Edwin Groothuis for the major rewrite he did of the tftpd and tftp code to support TFTP blocksize. Modified: head/libexec/tftpd/tftpd.8 head/usr.bin/tftp/tftp.1 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Fri Jun 24 04:35:58 2011 (r223490) +++ head/libexec/tftpd/tftpd.8 Fri Jun 24 05:41:38 2011 (r223491) @@ -293,6 +293,12 @@ was introduced in support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in .Fx 7.4 . +.Pp +Edwin Groothuis performed a major rewrite of the +.Nm +and +.Xr tftp 1 +code to support RFC2348. .Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred without client and server supporting the TFTP blocksize option (RFC2348), Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Fri Jun 24 04:35:58 2011 (r223490) +++ head/usr.bin/tftp/tftp.1 Fri Jun 24 05:41:38 2011 (r223491) @@ -218,7 +218,7 @@ Toggle packet tracing. Toggle verbose mode. .El .Sh SEE ALSO -.Xr tftp 1 +.Xr tftpd 8 .Pp The following RFC's are supported: .Rs @@ -256,6 +256,12 @@ The .Nm command appeared in .Bx 4.3 . +.Pp +Edwin Groothuis performed a major rewrite of the +.Xr tftpd 8 +and +.Nm +code to support RFC2348. .Sh NOTES Because there is no user-login or validation within the From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 07:05:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B38F1065675; Fri, 24 Jun 2011 07:05:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1866C8FC14; Fri, 24 Jun 2011 07:05:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O75KGw034559; Fri, 24 Jun 2011 07:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O75Kpf034546; Fri, 24 Jun 2011 07:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240705.p5O75Kpf034546@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223492 - in head/usr.sbin: ancontrol ifmcstat nfsd pmcstat ppp rpc.yppasswdd rpc.ypupdated sysinstall wpa/ndis_events wpa/wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 07:05:21 -0000 Author: kevlo Date: Fri Jun 24 07:05:20 2011 New Revision: 223492 URL: http://svn.freebsd.org/changeset/base/223492 Log: Remove duplicated header files Modified: head/usr.sbin/ancontrol/ancontrol.c head/usr.sbin/ifmcstat/ifmcstat.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/ppp/nat_cmd.c head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c head/usr.sbin/rpc.ypupdated/update.c head/usr.sbin/rpc.ypupdated/ypupdated_main.c head/usr.sbin/rpc.ypupdated/ypupdated_server.c head/usr.sbin/sysinstall/modules.c head/usr.sbin/wpa/ndis_events/ndis_events.c head/usr.sbin/wpa/wpa_supplicant/Packet32.c Modified: head/usr.sbin/ancontrol/ancontrol.c ============================================================================== --- head/usr.sbin/ancontrol/ancontrol.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ancontrol/ancontrol.c Fri Jun 24 07:05:20 2011 (r223492) @@ -40,7 +40,6 @@ static const char copyright[] = "@(#) Co __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 24 07:05:20 2011 (r223492) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/nfsd/nfsd.c Fri Jun 24 07:05:20 2011 (r223492) @@ -71,7 +71,6 @@ static const char rcsid[] = #include #include #include -#include /* Global defs */ #ifdef DEBUG Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Fri Jun 24 07:05:20 2011 (r223492) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.sbin/ppp/nat_cmd.c ============================================================================== --- head/usr.sbin/ppp/nat_cmd.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ppp/nat_cmd.c Fri Jun 24 07:05:20 2011 (r223492) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Fri Jun 24 07:05:20 2011 (r223492) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include /* getenv, exit */ -#include #include /* strcmp */ #include #include Modified: head/usr.sbin/rpc.ypupdated/update.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/update.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/update.c Fri Jun 24 07:05:20 2011 (r223492) @@ -57,7 +57,6 @@ static const char rcsid[] = #include #include #include -#include #include "ypupdated_extern.h" #ifdef YP Modified: head/usr.sbin/rpc.ypupdated/ypupdated_main.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/ypupdated_main.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/ypupdated_main.c Fri Jun 24 07:05:20 2011 (r223492) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "ypupdated_extern.h" #include "yp_extern.h" Modified: head/usr.sbin/rpc.ypupdated/ypupdated_server.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/ypupdated_server.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/ypupdated_server.c Fri Jun 24 07:05:20 2011 (r223492) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "ypupdate_prot.h" #include "ypupdated_extern.h" Modified: head/usr.sbin/sysinstall/modules.c ============================================================================== --- head/usr.sbin/sysinstall/modules.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/sysinstall/modules.c Fri Jun 24 07:05:20 2011 (r223492) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include Modified: head/usr.sbin/wpa/ndis_events/ndis_events.c ============================================================================== --- head/usr.sbin/wpa/ndis_events/ndis_events.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/wpa/ndis_events/ndis_events.c Fri Jun 24 07:05:20 2011 (r223492) @@ -42,11 +42,9 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include #include #include -#include #include #include #include Modified: head/usr.sbin/wpa/wpa_supplicant/Packet32.c ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/Packet32.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/wpa/wpa_supplicant/Packet32.c Fri Jun 24 07:05:20 2011 (r223492) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 07:18:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A68106566B; Fri, 24 Jun 2011 07:18:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E25FA8FC0A; Fri, 24 Jun 2011 07:18:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O7IiQ6034972; Fri, 24 Jun 2011 07:18:44 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O7IiZ2034966; Fri, 24 Jun 2011 07:18:44 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240718.p5O7IiZ2034966@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:18: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: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 07:18:45 -0000 Author: kevlo Date: Fri Jun 24 07:18:44 2011 New Revision: 223493 URL: http://svn.freebsd.org/changeset/base/223493 Log: Remove duplicated header files Modified: head/usr.bin/ktrace/ktrace.c head/usr.bin/ncplogin/ncplogin.c head/usr.bin/systat/netstat.c head/usr.bin/tftp/main.c head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/ktrace/ktrace.c ============================================================================== --- head/usr.bin/ktrace/ktrace.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/ktrace/ktrace.c Fri Jun 24 07:18:44 2011 (r223493) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/ncplogin/ncplogin.c ============================================================================== --- head/usr.bin/ncplogin/ncplogin.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/ncplogin/ncplogin.c Fri Jun 24 07:18:44 2011 (r223493) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/systat/netstat.c Fri Jun 24 07:18:44 2011 (r223493) @@ -63,7 +63,6 @@ static const char sccsid[] = "@(#)netsta #define TCPSTATES #include #include -#include #include #include #include Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/tftp/main.c Fri Jun 24 07:18:44 2011 (r223493) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/vmstat/vmstat.c Fri Jun 24 07:18:44 2011 (r223493) @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)vmstat.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 07:27:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D87106566B; Fri, 24 Jun 2011 07:27:12 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 830078FC14; Fri, 24 Jun 2011 07:27:12 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 2A5D17F398D; Fri, 24 Jun 2011 09:21:13 +0200 (CEST) Date: Fri, 24 Jun 2011 09:21:13 +0200 From: Roman Divacky To: Kevin Lo Message-ID: <20110624072113.GA52982@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106240718.p5O7IiZ2034966@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 07:27:12 -0000 On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Fri Jun 24 07:18:44 2011 > New Revision: 223493 > URL: http://svn.freebsd.org/changeset/base/223493 > > Log: > Remove duplicated header files You may be interested in this tool: http://code.google.com/p/include-what-you-use/ From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 07:29:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB99106566C; Fri, 24 Jun 2011 07:29:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A9FD48FC17; Fri, 24 Jun 2011 07:29:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5O7T4YN035301; Fri, 24 Jun 2011 07:29:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O7T4jn035297; Fri, 24 Jun 2011 07:29:04 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240729.p5O7T4jn035297@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:29: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: r223494 - in head: bin/rcp bin/sh sbin/savecore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 07:29:04 -0000 Author: kevlo Date: Fri Jun 24 07:29:04 2011 New Revision: 223494 URL: http://svn.freebsd.org/changeset/base/223494 Log: Remove duplicated header files Modified: head/bin/rcp/rcp.c head/bin/sh/mkinit.c head/sbin/savecore/savecore.c Modified: head/bin/rcp/rcp.c ============================================================================== --- head/bin/rcp/rcp.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/bin/rcp/rcp.c Fri Jun 24 07:29:04 2011 (r223494) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "extern.h" Modified: head/bin/sh/mkinit.c ============================================================================== --- head/bin/sh/mkinit.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/bin/sh/mkinit.c Fri Jun 24 07:29:04 2011 (r223494) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); */ -#include #include #include #include Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/sbin/savecore/savecore.c Fri Jun 24 07:29:04 2011 (r223494) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 08:05:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A876E1065672; Fri, 24 Jun 2011 08:05:48 +0000 (UTC) Date: Fri, 24 Jun 2011 08:05:48 +0000 From: Alexander Best To: Roman Divacky Message-ID: <20110624080548.GA60075@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> <20110624072113.GA52982@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110624072113.GA52982@freebsd.org> Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 08:05:48 -0000 On Fri Jun 24 11, Roman Divacky wrote: > On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Jun 24 07:18:44 2011 > > New Revision: 223493 > > URL: http://svn.freebsd.org/changeset/base/223493 > > > > Log: > > Remove duplicated header files > > You may be interested in this tool: > > http://code.google.com/p/include-what-you-use/ did they add C support since the last time i tested it? back then it only worked with CPP code, iirc. it was possible to thorw it at C code, but it returned pretty useless results. cheers. alex From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 08:10:30 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1F8106566B; Fri, 24 Jun 2011 08:10:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 358EB8FC0C; Fri, 24 Jun 2011 08:10:29 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p5O7dkio015175; Fri, 24 Jun 2011 15:39:46 +0800 (CST) From: Kevin Lo To: Roman Divacky In-Reply-To: <20110624072113.GA52982@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> <20110624072113.GA52982@freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 24 Jun 2011 15:39:31 +0800 Message-ID: <1308901171.2301.1.camel@nsl> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 08:10:30 -0000 On 五, 2011-06-24 at 09:21 +0200, Roman Divacky wrote: > On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Jun 24 07:18:44 2011 > > New Revision: 223493 > > URL: http://svn.freebsd.org/changeset/base/223493 > > > > Log: > > Remove duplicated header files > > You may be interested in this tool: > > http://code.google.com/p/include-what-you-use/ Hi Roman, Cool! Thanks for that info, I'll give it a try. Kevin From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 11:14:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C249106566C; Fri, 24 Jun 2011 11:14:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5208FC12; Fri, 24 Jun 2011 11:14:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OBEA9N051874; Fri, 24 Jun 2011 11:14:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OBEAV6051869; Fri, 24 Jun 2011 11:14:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241114.p5OBEAV6051869@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 11:14: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: r223495 - 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: Fri, 24 Jun 2011 11:14:10 -0000 Author: hselasky Date: Fri Jun 24 11:14:09 2011 New Revision: 223495 URL: http://svn.freebsd.org/changeset/base/223495 Log: - Add two new API's to libusb20 which can be used to retrive information about the parent USB device: - libusb20_dev_get_parent_address - libusb20_dev_get_parent_port - Rename libusb20_compat01.c into libusb01.c MFC after: 3 days Added: head/lib/libusb/libusb01.c - copied unchanged from r216431, head/lib/libusb/libusb20_compat01.c Deleted: head/lib/libusb/libusb20_compat01.c Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Fri Jun 24 07:29:04 2011 (r223494) +++ head/lib/libusb/Makefile Fri Jun 24 11:14:09 2011 (r223495) @@ -22,7 +22,7 @@ MLINKS+= libusb.3 usb.3 # libusb 0.1 compat INCS+= usb.h -SRCS+= libusb20_compat01.c +SRCS+= libusb01.c # libusb 1.0 compat INCS+= libusb.h @@ -184,6 +184,8 @@ MLINKS += libusb20.3 libusb20_dev_get_de MLINKS += libusb20.3 libusb20_dev_alloc_config.3 MLINKS += libusb20.3 libusb20_dev_alloc.3 MLINKS += libusb20.3 libusb20_dev_get_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_port.3 MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 MLINKS += libusb20.3 libusb20_dev_get_mode.3 MLINKS += libusb20.3 libusb20_dev_get_speed.3 Copied: head/lib/libusb/libusb01.c (from r216431, head/lib/libusb/libusb20_compat01.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb01.c Fri Jun 24 11:14:09 2011 (r223495, copy of r216431, head/lib/libusb/libusb20_compat01.c) @@ -0,0 +1,945 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2008 Hans Petter Selasky. 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. + */ + +/* + * This file contains the emulation layer for LibUSB v0.1 from sourceforge. + */ + +#include + +#include +#include +#include + +#include "libusb20.h" +#include "libusb20_desc.h" +#include "libusb20_int.h" +#include "usb.h" + +/* + * The two following macros were taken from the original LibUSB v0.1 + * for sake of compatibility: + */ +#define LIST_ADD(begin, ent) \ + do { \ + if (begin) { \ + ent->next = begin; \ + ent->next->prev = ent; \ + } else { \ + ent->next = NULL; \ + } \ + ent->prev = NULL; \ + begin = ent; \ + } while(0) + +#define LIST_DEL(begin, ent) \ + do { \ + if (ent->prev) { \ + ent->prev->next = ent->next; \ + } else { \ + begin = ent->next; \ + } \ + if (ent->next) { \ + ent->next->prev = ent->prev; \ + } \ + ent->prev = NULL; \ + ent->next = NULL; \ + } while (0) + +struct usb_bus *usb_busses = NULL; + +static struct usb_bus usb_global_bus = { + .dirname = {"/dev/usb"}, + .root_dev = NULL, + .devices = NULL, +}; + +static struct libusb20_backend *usb_backend = NULL; + +struct usb_parse_state { + + struct { + struct libusb20_endpoint *currep; + struct libusb20_interface *currifc; + struct libusb20_config *currcfg; + struct libusb20_me_struct *currextra; + } a; + + struct { + struct usb_config_descriptor *currcfg; + struct usb_interface_descriptor *currifc; + struct usb_endpoint_descriptor *currep; + struct usb_interface *currifcw; + uint8_t *currextra; + } b; + + uint8_t preparse; +}; + +static struct libusb20_transfer * +usb_get_transfer_by_ep_no(usb_dev_handle * dev, uint8_t ep_no) +{ + struct libusb20_device *pdev = (void *)dev; + struct libusb20_transfer *xfer; + int err; + uint32_t bufsize; + uint8_t x; + uint8_t speed; + + x = (ep_no & LIBUSB20_ENDPOINT_ADDRESS_MASK) * 2; + + if (ep_no & LIBUSB20_ENDPOINT_DIR_MASK) { + /* this is an IN endpoint */ + x |= 1; + } + speed = libusb20_dev_get_speed(pdev); + + /* select a sensible buffer size */ + if (speed == LIBUSB20_SPEED_LOW) { + bufsize = 256; + } else if (speed == LIBUSB20_SPEED_FULL) { + bufsize = 4096; + } else { + bufsize = 16384; + } + + xfer = libusb20_tr_get_pointer(pdev, x); + + if (xfer == NULL) + return (xfer); + + err = libusb20_tr_open(xfer, bufsize, 1, ep_no); + if (err == LIBUSB20_ERROR_BUSY) { + /* already opened */ + return (xfer); + } else if (err) { + return (NULL); + } + /* success */ + return (xfer); +} + +usb_dev_handle * +usb_open(struct usb_device *dev) +{ + int err; + + err = libusb20_dev_open(dev->dev, 16 * 2); + if (err == LIBUSB20_ERROR_BUSY) { + /* + * Workaround buggy USB applications which open the USB + * device multiple times: + */ + return (dev->dev); + } + if (err) + return (NULL); + + /* + * Dequeue USB device from backend queue so that it does not get + * freed when the backend is re-scanned: + */ + libusb20_be_dequeue_device(usb_backend, dev->dev); + + return (dev->dev); +} + +int +usb_close(usb_dev_handle * udev) +{ + struct usb_device *dev; + int err; + + err = libusb20_dev_close((void *)udev); + + if (err) + return (-1); + + if (usb_backend != NULL) { + /* + * Enqueue USB device to backend queue so that it gets freed + * when the backend is re-scanned: + */ + libusb20_be_enqueue_device(usb_backend, (void *)udev); + } else { + /* + * The backend is gone. Free device data so that we + * don't start leaking memory! + */ + dev = usb_device(udev); + libusb20_dev_free((void *)udev); + LIST_DEL(usb_global_bus.devices, dev); + free(dev); + } + return (0); +} + +int +usb_get_string(usb_dev_handle * dev, int strindex, + int langid, char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_sync((void *)dev, + strindex, langid, buf, buflen); + + if (err) + return (-1); + + return (0); +} + +int +usb_get_string_simple(usb_dev_handle * dev, int strindex, + char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_simple_sync((void *)dev, + strindex, buf, buflen); + + if (err) + return (-1); + + return (strlen(buf)); +} + +int +usb_get_descriptor_by_endpoint(usb_dev_handle * udev, int ep, uint8_t type, + uint8_t ep_index, void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, ep | USB_ENDPOINT_IN, + USB_REQ_GET_DESCRIPTOR, (type << 8) + ep_index, 0, + buf, size, 1000)); +} + +int +usb_get_descriptor(usb_dev_handle * udev, uint8_t type, uint8_t desc_index, + void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (type << 8) + desc_index, 0, buf, size, 1000)); +} + +int +usb_parse_descriptor(uint8_t *source, char *description, void *dest) +{ + uint8_t *sp = source; + uint8_t *dp = dest; + uint16_t w; + uint32_t d; + char *cp; + + for (cp = description; *cp; cp++) { + switch (*cp) { + case 'b': /* 8-bit byte */ + *dp++ = *sp++; + break; + /* + * 16-bit word, convert from little endian to CPU + */ + case 'w': + w = (sp[1] << 8) | sp[0]; + sp += 2; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + *((uint16_t *)dp) = w; + dp += 2; + break; + /* + * 32-bit dword, convert from little endian to CPU + */ + case 'd': + d = (sp[3] << 24) | (sp[2] << 16) | + (sp[1] << 8) | sp[0]; + sp += 4; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + /* Align to double word boundary */ + dp += ((dp - (uint8_t *)0) & 2); + *((uint32_t *)dp) = d; + dp += 4; + break; + } + } + return (sp - source); +} + +static void +usb_parse_extra(struct usb_parse_state *ps, uint8_t **pptr, int *plen) +{ + void *ptr; + uint16_t len; + + ptr = ps->a.currextra->ptr; + len = ps->a.currextra->len; + + if (ps->preparse == 0) { + memcpy(ps->b.currextra, ptr, len); + *pptr = ps->b.currextra; + *plen = len; + } + ps->b.currextra += len; + return; +} + +static void +usb_parse_endpoint(struct usb_parse_state *ps) +{ + struct usb_endpoint_descriptor *bep; + struct libusb20_endpoint *aep; + + aep = ps->a.currep; + bep = ps->b.currep++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bep->bLength = aep->desc.bLength; + bep->bDescriptorType = aep->desc.bDescriptorType; + bep->bEndpointAddress = aep->desc.bEndpointAddress; + bep->bmAttributes = aep->desc.bmAttributes; + bep->wMaxPacketSize = aep->desc.wMaxPacketSize; + bep->bInterval = aep->desc.bInterval; + bep->bRefresh = aep->desc.bRefresh; + bep->bSynchAddress = aep->desc.bSynchAddress; + } + ps->a.currextra = &aep->extra; + usb_parse_extra(ps, &bep->extra, &bep->extralen); + return; +} + +static void +usb_parse_iface_sub(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface_descriptor *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifc++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bifc->bLength = aifc->desc.bLength; + bifc->bDescriptorType = aifc->desc.bDescriptorType; + bifc->bInterfaceNumber = aifc->desc.bInterfaceNumber; + bifc->bAlternateSetting = aifc->desc.bAlternateSetting; + bifc->bNumEndpoints = aifc->num_endpoints; + bifc->bInterfaceClass = aifc->desc.bInterfaceClass; + bifc->bInterfaceSubClass = aifc->desc.bInterfaceSubClass; + bifc->bInterfaceProtocol = aifc->desc.bInterfaceProtocol; + bifc->iInterface = aifc->desc.iInterface; + bifc->endpoint = ps->b.currep; + } + for (x = 0; x != aifc->num_endpoints; x++) { + ps->a.currep = aifc->endpoints + x; + usb_parse_endpoint(ps); + } + + ps->a.currextra = &aifc->extra; + usb_parse_extra(ps, &bifc->extra, &bifc->extralen); + return; +} + +static void +usb_parse_iface(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifcw++; + + if (ps->preparse == 0) { + /* initialise interface wrapper */ + bifc->altsetting = ps->b.currifc; + bifc->num_altsetting = aifc->num_altsetting + 1; + } + usb_parse_iface_sub(ps); + + for (x = 0; x != aifc->num_altsetting; x++) { + ps->a.currifc = aifc->altsetting + x; + usb_parse_iface_sub(ps); + } + return; +} + +static void +usb_parse_config(struct usb_parse_state *ps) +{ + struct libusb20_config *acfg; + struct usb_config_descriptor *bcfg; + uint8_t x; + + acfg = ps->a.currcfg; + bcfg = ps->b.currcfg; + + if (ps->preparse == 0) { + /* initialise config wrapper */ + bcfg->bLength = acfg->desc.bLength; + bcfg->bDescriptorType = acfg->desc.bDescriptorType; + bcfg->wTotalLength = acfg->desc.wTotalLength; + bcfg->bNumInterfaces = acfg->num_interface; + bcfg->bConfigurationValue = acfg->desc.bConfigurationValue; + bcfg->iConfiguration = acfg->desc.iConfiguration; + bcfg->bmAttributes = acfg->desc.bmAttributes; + bcfg->MaxPower = acfg->desc.bMaxPower; + bcfg->interface = ps->b.currifcw; + } + for (x = 0; x != acfg->num_interface; x++) { + ps->a.currifc = acfg->interface + x; + usb_parse_iface(ps); + } + + ps->a.currextra = &acfg->extra; + usb_parse_extra(ps, &bcfg->extra, &bcfg->extralen); + return; +} + +int +usb_parse_configuration(struct usb_config_descriptor *config, + uint8_t *buffer) +{ + struct usb_parse_state ps; + uint8_t *ptr; + uint32_t a; + uint32_t b; + uint32_t c; + uint32_t d; + + if ((buffer == NULL) || (config == NULL)) { + return (-1); + } + memset(&ps, 0, sizeof(ps)); + + ps.a.currcfg = libusb20_parse_config_desc(buffer); + ps.b.currcfg = config; + if (ps.a.currcfg == NULL) { + /* could not parse config or out of memory */ + return (-1); + } + /* do the pre-parse */ + ps.preparse = 1; + usb_parse_config(&ps); + + a = ((uint8_t *)(ps.b.currifcw) - ((uint8_t *)0)); + b = ((uint8_t *)(ps.b.currifc) - ((uint8_t *)0)); + c = ((uint8_t *)(ps.b.currep) - ((uint8_t *)0)); + d = ((uint8_t *)(ps.b.currextra) - ((uint8_t *)0)); + + /* allocate memory for our configuration */ + ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } + + /* "currifcw" must be first, hence this pointer is freed */ + ps.b.currifcw = (void *)(ptr); + ps.b.currifc = (void *)(ptr + a); + ps.b.currep = (void *)(ptr + a + b); + ps.b.currextra = (void *)(ptr + a + b + c); + + /* generate a libusb v0.1 compatible structure */ + ps.preparse = 0; + usb_parse_config(&ps); + + /* free config structure */ + free(ps.a.currcfg); + + return (0); /* success */ +} + +void +usb_destroy_configuration(struct usb_device *dev) +{ + uint8_t c; + + if (dev->config == NULL) { + return; + } + for (c = 0; c != dev->descriptor.bNumConfigurations; c++) { + struct usb_config_descriptor *cf = &dev->config[c]; + + if (cf->interface != NULL) { + free(cf->interface); + cf->interface = NULL; + } + } + + free(dev->config); + dev->config = NULL; + return; +} + +void +usb_fetch_and_parse_descriptors(usb_dev_handle * udev) +{ + struct usb_device *dev; + struct libusb20_device *pdev; + uint8_t *ptr; + int error; + uint32_t size; + uint16_t len; + uint8_t x; + + if (udev == NULL) { + /* be NULL safe */ + return; + } + dev = usb_device(udev); + pdev = (void *)udev; + + if (dev->descriptor.bNumConfigurations == 0) { + /* invalid device */ + return; + } + size = dev->descriptor.bNumConfigurations * + sizeof(struct usb_config_descriptor); + + dev->config = malloc(size); + if (dev->config == NULL) { + /* out of memory */ + return; + } + memset(dev->config, 0, size); + + for (x = 0; x != dev->descriptor.bNumConfigurations; x++) { + + error = (pdev->methods->get_config_desc_full) ( + pdev, &ptr, &len, x); + + if (error) { + usb_destroy_configuration(dev); + return; + } + usb_parse_configuration(dev->config + x, ptr); + + /* free config buffer */ + free(ptr); + } + return; +} + +static int +usb_std_io(usb_dev_handle * dev, int ep, char *bytes, int size, + int timeout, int is_intr) +{ + struct libusb20_transfer *xfer; + uint32_t temp; + uint32_t maxsize; + uint32_t actlen; + char *oldbytes; + + xfer = usb_get_transfer_by_ep_no(dev, ep); + if (xfer == NULL) + return (-1); + + if (libusb20_tr_pending(xfer)) { + /* there is already a transfer ongoing */ + return (-1); + } + maxsize = libusb20_tr_get_max_total_length(xfer); + oldbytes = bytes; + + /* + * We allow transferring zero bytes which is the same + * equivalent to a zero length USB packet. + */ + do { + + temp = size; + if (temp > maxsize) { + /* find maximum possible length */ + temp = maxsize; + } + if (is_intr) + libusb20_tr_setup_intr(xfer, bytes, temp, timeout); + else + libusb20_tr_setup_bulk(xfer, bytes, temp, timeout); + + libusb20_tr_start(xfer); + + while (1) { + + if (libusb20_dev_process((void *)dev) != 0) { + /* device detached */ + return (-1); + } + if (libusb20_tr_pending(xfer) == 0) { + /* transfer complete */ + break; + } + /* wait for USB event from kernel */ + libusb20_dev_wait_process((void *)dev, -1); + } + + switch (libusb20_tr_get_status(xfer)) { + case 0: + /* success */ + break; + case LIBUSB20_TRANSFER_TIMED_OUT: + /* transfer timeout */ + return (-ETIMEDOUT); + default: + /* other transfer error */ + return (-ENXIO); + } + actlen = libusb20_tr_get_actual_length(xfer); + + bytes += actlen; + size -= actlen; + + if (actlen != temp) { + /* short transfer */ + break; + } + } while (size > 0); + + return (bytes - oldbytes); +} + +int +usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep & ~USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 0)); +} + +int +usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep | USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 0)); +} + +int +usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep & ~USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 1)); +} + +int +usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep | USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 1)); +} + +int +usb_control_msg(usb_dev_handle * dev, int requesttype, int request, + int value, int wIndex, char *bytes, int size, int timeout) +{ + struct LIBUSB20_CONTROL_SETUP_DECODED req; + int err; + uint16_t actlen; + + LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &req); + + req.bmRequestType = requesttype; + req.bRequest = request; + req.wValue = value; + req.wIndex = wIndex; + req.wLength = size; + + err = libusb20_dev_request_sync((void *)dev, &req, bytes, + &actlen, timeout, 0); + + if (err) + return (-1); + + return (actlen); +} + +int +usb_set_configuration(usb_dev_handle * udev, int bConfigurationValue) +{ + struct usb_device *dev; + int err; + uint8_t i; + + /* + * Need to translate from "bConfigurationValue" to + * configuration index: + */ + + if (bConfigurationValue == 0) { + /* unconfigure */ + i = 255; + } else { + /* lookup configuration index */ + dev = usb_device(udev); + + /* check if the configuration array is not there */ + if (dev->config == NULL) { + return (-1); + } + for (i = 0;; i++) { + if (i == dev->descriptor.bNumConfigurations) { + /* "bConfigurationValue" not found */ + return (-1); + } + if ((dev->config + i)->bConfigurationValue == + bConfigurationValue) { + break; + } + } + } + + err = libusb20_dev_set_config_index((void *)udev, i); + + if (err) + return (-1); + + return (0); +} + +int +usb_claim_interface(usb_dev_handle * dev, int interface) +{ + struct libusb20_device *pdev = (void *)dev; + + pdev->claimed_interface = interface; + + return (0); +} + +int +usb_release_interface(usb_dev_handle * dev, int interface) +{ + /* do nothing */ + return (0); +} + +int +usb_set_altinterface(usb_dev_handle * dev, int alternate) +{ + struct libusb20_device *pdev = (void *)dev; + int err; + uint8_t iface; + + iface = pdev->claimed_interface; + + err = libusb20_dev_set_alt_index((void *)dev, iface, alternate); + + if (err) + return (-1); + + return (0); +} + +int +usb_resetep(usb_dev_handle * dev, unsigned int ep) +{ + /* emulate an endpoint reset through clear-STALL */ + return (usb_clear_halt(dev, ep)); +} + +int +usb_clear_halt(usb_dev_handle * dev, unsigned int ep) +{ + struct libusb20_transfer *xfer; + + xfer = usb_get_transfer_by_ep_no(dev, ep); + if (xfer == NULL) + return (-1); + + libusb20_tr_clear_stall_sync(xfer); + + return (0); +} + +int +usb_reset(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_reset((void *)dev); + + if (err) + return (-1); + + /* + * Be compatible with LibUSB from sourceforge and close the + * handle after reset! + */ + return (usb_close(dev)); +} + +int +usb_check_connected(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_check_connected((void *)dev); + + if (err) + return (-1); + + return (0); +} + +const char * +usb_strerror(void) +{ + /* TODO */ + return ("Unknown error"); +} + +void +usb_init(void) +{ + /* nothing to do */ + return; +} + +void +usb_set_debug(int level) +{ + /* use kernel UGEN debugging if you need to see what is going on */ + return; +} + +int +usb_find_busses(void) +{ + usb_busses = &usb_global_bus; + return (1); +} + +int +usb_find_devices(void) +{ + struct libusb20_device *pdev; + struct usb_device *udev; + struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + int devnum; + int err; + + /* cleanup after last device search */ + /* close all opened devices, if any */ + + while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) { + udev = pdev->privLuData; + libusb20_be_dequeue_device(usb_backend, pdev); + libusb20_dev_free(pdev); + if (udev != NULL) { + LIST_DEL(usb_global_bus.devices, udev); + free(udev); + } + } + + /* free old USB backend, if any */ + + libusb20_be_free(usb_backend); + + /* do a new backend device search */ + usb_backend = libusb20_be_alloc_default(); + if (usb_backend == NULL) { + return (-1); + } + /* iterate all devices */ + + devnum = 1; + pdev = NULL; + while ((pdev = libusb20_be_device_foreach(usb_backend, pdev))) { + udev = malloc(sizeof(*udev)); + if (udev == NULL) + break; + + memset(udev, 0, sizeof(*udev)); + + udev->bus = &usb_global_bus; + + snprintf(udev->filename, sizeof(udev->filename), + "/dev/ugen%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + + ddesc = libusb20_dev_get_device_desc(pdev); + + udev->descriptor.bLength = sizeof(udev->descriptor); + udev->descriptor.bDescriptorType = ddesc->bDescriptorType; + udev->descriptor.bcdUSB = ddesc->bcdUSB; + udev->descriptor.bDeviceClass = ddesc->bDeviceClass; + udev->descriptor.bDeviceSubClass = ddesc->bDeviceSubClass; + udev->descriptor.bDeviceProtocol = ddesc->bDeviceProtocol; + udev->descriptor.bMaxPacketSize0 = ddesc->bMaxPacketSize0; + udev->descriptor.idVendor = ddesc->idVendor; + udev->descriptor.idProduct = ddesc->idProduct; + udev->descriptor.bcdDevice = ddesc->bcdDevice; + udev->descriptor.iManufacturer = ddesc->iManufacturer; + udev->descriptor.iProduct = ddesc->iProduct; + udev->descriptor.iSerialNumber = ddesc->iSerialNumber; + udev->descriptor.bNumConfigurations = + ddesc->bNumConfigurations; + if (udev->descriptor.bNumConfigurations > USB_MAXCONFIG) { + /* truncate number of configurations */ + udev->descriptor.bNumConfigurations = USB_MAXCONFIG; + } + udev->devnum = devnum++; + /* link together the two structures */ + udev->dev = pdev; + pdev->privLuData = udev; + + err = libusb20_dev_open(pdev, 0); + if (err == 0) { + /* XXX get all config descriptors by default */ + usb_fetch_and_parse_descriptors((void *)pdev); + libusb20_dev_close(pdev); + } + LIST_ADD(usb_global_bus.devices, udev); + } + + return (devnum - 1); /* success */ +} + +struct usb_device * +usb_device(usb_dev_handle * dev) +{ + struct libusb20_device *pdev; + + pdev = (void *)dev; + + return (pdev->privLuData); +} + +struct usb_bus * +usb_get_busses(void) +{ + return (usb_busses); +} Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Fri Jun 24 07:29:04 2011 (r223494) +++ head/lib/libusb/libusb20.3 Fri Jun 24 11:14:09 2011 (r223495) @@ -159,6 +159,10 @@ USB access library (libusb -lusb) .Ft uint8_t .Fn libusb20_dev_get_address "struct libusb20_device *pdev" .Ft uint8_t +.Fn libusb20_dev_get_parent_address "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_parent_port "struct libusb20_device *pdev" +.Ft uint8_t .Fn libusb20_dev_get_bus_number "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_mode "struct libusb20_device *pdev" @@ -756,12 +760,31 @@ is an internal function to allocate a ne .Fn libusb20_dev_get_address returns the internal and not necessarily the real hardware address of the given USB device. +Valid addresses start at one. +. +.Pp +. +.Fn libusb20_dev_get_parent_address +returns the internal and not necessarily the real hardware address of +the given parent USB HUB device. +This value is zero for the root HUB which usually has a device address +equal to one. +Valid addresses start at one. +. +.Pp +. +.Fn libusb20_dev_get_parent_port +returns the port number on the parent USB HUB device. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 11:39:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0F31065670; Fri, 24 Jun 2011 11:39:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C5398FC18; Fri, 24 Jun 2011 11:39:33 +0000 (UTC) Received: by gxk28 with SMTP id 28so1437208gxk.13 for ; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FfiIKhI1itQWoBkAADFYsVCwDaOxgSoytgKFUHT19/Y=; b=xaLJMJzwRPWRJiW7VA/FkRqpAIjqnuZuIazA7QSY5dqot5zL5PJa6siIrymtfn3v6z 0STGxgEKH7ADb3+FjlBcNcXIt6eCLhdcdSN2u33a9enkKuDR686WnwW6z2A5QhueNnj/ Llu4bM2uToFlqXy6iC9+CCEbPxeM6yhRk99YM= 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=NLeNIOBAvqXaH408rq8f6j+MtD9eqQeR1IZPtbKQQL8Kff9pIvTkeh6RFT6ScZNDfk F87SUhvrCjLWiCamO4YUIy9DPoRvd1+cOU67TUs2KVEaugHdx89Eaai0PGSn5HMZNCf+ H+Qcho/a+gd95N2o7snQ4B27zDMtmSDUWFW0A= MIME-Version: 1.0 Received: by 10.236.133.39 with SMTP id p27mr2605789yhi.135.1308915572662; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) In-Reply-To: References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> Date: Fri, 24 Jun 2011 13:39:32 +0200 X-Google-Sender-Auth: bthJlVBxI4tt7v_1xn1B1fepZaU Message-ID: From: Attilio Rao To: "Jayachandran C." Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r223464 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 11:39:34 -0000 2011/6/24 Jayachandran C. : > On Fri, Jun 24, 2011 at 1:33 AM, Alan Cox wrote: >> On 6/23/2011 1:30 PM, Warner Losh wrote: >>> >>> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >>> >>>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>>> >>>>> Author: alc >>>>> Date: Thu Jun 23 05:23:59 2011 >>>>> New Revision: 223464 >>>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>>> >>>>> Log: >>>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>>>> MIPS. =C2=A0(At present, although atomic_clear_char() is defined by a= tomic.h >>>>> on MIPS, it is not actually implemented by support.S.) >>>> >>>> Thanks, >>>> and good catch on the atomics even if not planned, just in time for 9.= 0:) >>> >>> Yea, there's some work there to fix them... =C2=A0Not sure we can even = fix some >>> of them atomically... >>> >> >> I'm not sure that I understand what you mean by the second statement. = =C2=A0Can >> you elaborate? =C2=A0The 8- and 16-bit operations should be no less "ato= mic" than >> the 32- and 64-bit operations. =C2=A0In general, regardless of the size = of the >> operation, the "sc" instruction may fail and the whole operation has to = be >> restarted if another processor (or I/O device) performs a concurrent, ca= che >> coherent store to the same location (or even cache line) as the "ll" and >> "sc" instructions are operating on. =C2=A0On the other hand, if the "sc" >> instruction succeeds, whether you used it to change all of the 32 bits o= r >> just 8 of the 32 bits, it should appear as an atomic change to any other >> processor. > > I will try out an implementation and see if this works on XLR, if so > this is something we can add to support.S There is a chance we can leave all the atomic support inlined in atomic.h? When I looked into it, my opinion is that support.S part is just in the wrong place (and Warner didn't have a good explanation for it, so I don't see a problem about moving anything to atomic.h). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 12:30:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FA9E106566B; Fri, 24 Jun 2011 12:30:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 80A018FC08; Fri, 24 Jun 2011 12:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OCUh1j054011; Fri, 24 Jun 2011 12:30:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCUhSB054009; Fri, 24 Jun 2011 12:30:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241230.p5OCUhSB054009@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:30: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: r223496 - head/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, 24 Jun 2011 12:30:43 -0000 Author: adrian Date: Fri Jun 24 12:30:43 2011 New Revision: 223496 URL: http://svn.freebsd.org/changeset/base/223496 Log: Import one of the two missing US FCC DFS bands to FCC3. The FCC opened up this band sometime in 2009 (and ath was updated); but regdomain.xml wasn't updated. Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 11:14:09 2011 (r223495) +++ head/etc/regdomain.xml Fri Jun 24 12:30:43 2011 (r223496) @@ -138,6 +138,12 @@ 17 + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_PASSIVE @@ -176,6 +182,20 @@ IEEE80211_CHAN_HT40 + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_HT20 From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 12:31:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A93B01065670; Fri, 24 Jun 2011 12:31:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5728FC26; Fri, 24 Jun 2011 12:31:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OCVaZM054074; Fri, 24 Jun 2011 12:31:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCVaVr054072; Fri, 24 Jun 2011 12:31:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241231.p5OCVaVr054072@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:31: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: r223497 - head/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, 24 Jun 2011 12:31:36 -0000 Author: adrian Date: Fri Jun 24 12:31:36 2011 New Revision: 223497 URL: http://svn.freebsd.org/changeset/base/223497 Log: Fix an incorrect frequency band for HT/40 in the FCC SKU. Noticed by: bschmidt@ Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 12:30:43 2011 (r223496) +++ head/etc/regdomain.xml Fri Jun 24 12:31:36 2011 (r223497) @@ -83,7 +83,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 12:50:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833171065670; Fri, 24 Jun 2011 12:50:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 744ED8FC12; Fri, 24 Jun 2011 12:50:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OCoIRQ054614; Fri, 24 Jun 2011 12:50:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCoIuN054612; Fri, 24 Jun 2011 12:50:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241250.p5OCoIuN054612@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:50: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: r223498 - head/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, 24 Jun 2011 12:50:18 -0000 Author: adrian Date: Fri Jun 24 12:50:18 2011 New Revision: 223498 URL: http://svn.freebsd.org/changeset/base/223498 Log: More incorrect HT/40 setups in FCC. Noticed-by: bschmidt@ Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 12:31:36 2011 (r223497) +++ head/etc/regdomain.xml Fri Jun 24 12:50:18 2011 (r223498) @@ -96,7 +96,7 @@ IEEE80211_CHAN_HT20 - + 17 IEEE80211_CHAN_HT40 @@ -106,7 +106,7 @@ IEEE80211_CHAN_HT20 - + 23 IEEE80211_CHAN_HT40 From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 12:55:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32C26106564A; Fri, 24 Jun 2011 12:55:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2337F8FC0C; Fri, 24 Jun 2011 12:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OCtHLu054852; Fri, 24 Jun 2011 12:55:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCtHmU054850; Fri, 24 Jun 2011 12:55:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106241255.p5OCtHmU054850@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 24 Jun 2011 12:55: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: r223499 - head/sbin/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: Fri, 24 Jun 2011 12:55:17 -0000 Author: glebius Date: Fri Jun 24 12:55:16 2011 New Revision: 223499 URL: http://svn.freebsd.org/changeset/base/223499 Log: Actually, if code had followed style(9), there would be less stupid errors like the one fixed in r223416. Noticed by: julian Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Fri Jun 24 12:50:18 2011 (r223498) +++ head/sbin/ipfw/nat.c Fri Jun 24 12:55:16 2011 (r223499) @@ -738,7 +738,8 @@ ipfw_config_nat(int ac, char **av) char *id, *buf, **av1, *end; size_t len; - av++; ac--; + av++; + ac--; /* Nat id. */ if (ac == 0) errx(EX_DATAERR, "missing nat id"); @@ -746,7 +747,8 @@ ipfw_config_nat(int ac, char **av) i = (int)strtol(id, &end, 0); if (i <= 0 || *end != '\0') errx(EX_DATAERR, "illegal nat id: %s", id); - av++; ac--; + av++; + ac--; if (ac == 0) errx(EX_DATAERR, "missing option"); @@ -755,11 +757,13 @@ ipfw_config_nat(int ac, char **av) av1 = av; while (ac1 > 0) { tok = match_token(nat_params, *av1); - ac1--; av1++; + ac1--; + av1++; switch (tok) { case TOK_IP: case TOK_IF: - ac1--; av1++; + ac1--; + av1++; break; case TOK_ALOG: case TOK_DENY_INC: @@ -775,18 +779,22 @@ ipfw_config_nat(int ac, char **av) errx(EX_DATAERR, "redirect_addr: " "not enough arguments"); len += estimate_redir_addr(&ac1, &av1); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; break; case TOK_REDIR_PORT: if (ac1 < 3) errx(EX_DATAERR, "redirect_port: " "not enough arguments"); - av1++; ac1--; + av1++; + ac1--; len += estimate_redir_port(&ac1, &av1); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; /* Skip optional remoteIP/port */ if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } break; case TOK_REDIR_PROTO: @@ -794,13 +802,16 @@ ipfw_config_nat(int ac, char **av) errx(EX_DATAERR, "redirect_proto: " "not enough arguments"); len += sizeof(struct cfg_redir); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; /* Skip optional remoteIP/port */ if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } break; default: @@ -819,7 +830,8 @@ ipfw_config_nat(int ac, char **av) while (ac > 0) { tok = match_token(nat_params, *av); - ac--; av++; + ac--; + av++; switch (tok) { case TOK_IP: if (ac == 0) @@ -827,13 +839,15 @@ ipfw_config_nat(int ac, char **av) if (!inet_aton(av[0], &(n->ip))) errx(EX_DATAERR, "bad ip address ``%s''", av[0]); - ac--; av++; + ac--; + av++; break; case TOK_IF: if (ac == 0) errx(EX_DATAERR, "missing option"); set_addr_dynamic(av[0], n); - ac--; av++; + ac--; + av++; break; case TOK_ALOG: n->mode |= PKT_ALIAS_LOG; @@ -912,7 +926,8 @@ ipfw_show_nat(int ac, char **av) data = NULL; frule = 0; lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ - ac--; av++; + ac--; + av++; if (co.test_only) return; From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 13:58:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4E4B1065675; Fri, 24 Jun 2011 13:58:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D5DE68FC19; Fri, 24 Jun 2011 13:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ODwumc056895; Fri, 24 Jun 2011 13:58:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ODwute056893; Fri, 24 Jun 2011 13:58:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241358.p5ODwute056893@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 13:58: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: r223502 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 13:58:57 -0000 Author: jhb Date: Fri Jun 24 13:58:56 2011 New Revision: 223502 URL: http://svn.freebsd.org/changeset/base/223502 Log: Typo. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Jun 24 13:45:14 2011 (r223501) +++ head/sys/dev/acpica/acpi.c Fri Jun 24 13:58:56 2011 (r223502) @@ -1244,7 +1244,7 @@ acpi_alloc_resource(device_t bus, device /* * First attempt at allocating the resource. For direct children, * use resource_list_alloc() to handle reserved resources. For - * other dveices, pass the request up to our parent. + * other devices, pass the request up to our parent. */ if (bus == device_get_parent(child)) { ad = device_get_ivars(child); From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 14:31:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD67106566B; Fri, 24 Jun 2011 14:31:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 985198FC14; Fri, 24 Jun 2011 14:31:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OEVUxq058021; Fri, 24 Jun 2011 14:31:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEVUI8058019; Fri, 24 Jun 2011 14:31:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241431.p5OEVUI8058019@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 14:31: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: r223504 - head/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, 24 Jun 2011 14:31:31 -0000 Author: adrian Date: Fri Jun 24 14:31:30 2011 New Revision: 223504 URL: http://svn.freebsd.org/changeset/base/223504 Log: Fix another broken HT40 channel band reference. Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 14:03:10 2011 (r223503) +++ head/etc/regdomain.xml Fri Jun 24 14:31:30 2011 (r223504) @@ -251,7 +251,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 14:40:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D690106564A; Fri, 24 Jun 2011 14:40:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2428FC12; Fri, 24 Jun 2011 14:40:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OEeMIP058309; Fri, 24 Jun 2011 14:40:22 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEeMER058307; Fri, 24 Jun 2011 14:40:22 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201106241440.p5OEeMER058307@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 24 Jun 2011 14:40: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: r223505 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 14:40:22 -0000 Author: jonathan Date: Fri Jun 24 14:40:22 2011 New Revision: 223505 URL: http://svn.freebsd.org/changeset/base/223505 Log: Tidy up a capabilities-related comment. This comment refers to an #ifdef that hasn't been merged [yet?]; remove it. Approved by: rwatson Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 24 14:31:30 2011 (r223504) +++ head/sys/kern/vfs_subr.c Fri Jun 24 14:40:22 2011 (r223505) @@ -3590,9 +3590,6 @@ vn_isdisk(struct vnode *vp, int *errp) * and optional call-by-reference privused argument allowing vaccess() * to indicate to the caller whether privilege was used to satisfy the * request (obsoleted). Returns 0 on success, or an errno on failure. - * - * The ifdef'd CAPABILITIES version is here for reference, but is not - * actually used. */ int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 14:56:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A19B51065676; Fri, 24 Jun 2011 14:56:38 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 925EB8FC13; Fri, 24 Jun 2011 14:56:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OEucd2058784; Fri, 24 Jun 2011 14:56:38 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEucwo058782; Fri, 24 Jun 2011 14:56:38 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201106241456.p5OEucwo058782@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 24 Jun 2011 14:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223506 - head/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, 24 Jun 2011 14:56:38 -0000 Author: pluknet Date: Fri Jun 24 14:56:38 2011 New Revision: 223506 URL: http://svn.freebsd.org/changeset/base/223506 Log: Add support for string values with white spaces for ifconfig(8) parameters accepting them (such as description, group). Changes discussed on freebsd-rc. PR: conf/156675 Reported by: "Alexander V. Chernikov" Suggested by: hrs Analyzed with: Alexander V. Chernikov via IRC MFC after: 2 weeks Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Jun 24 14:40:22 2011 (r223505) +++ head/etc/network.subr Fri Jun 24 14:56:38 2011 (r223506) @@ -94,7 +94,7 @@ ifconfig_up() # ifconfig_IF ifconfig_args=`ifconfig_getargs $1` if [ -n "${ifconfig_args}" ]; then - ifconfig $1 ${ifconfig_args} + eval ifconfig $1 ${ifconfig_args} _cfg=0 fi From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 15:37:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915E31065670; Fri, 24 Jun 2011 15:37:04 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 06E888FC1A; Fri, 24 Jun 2011 15:37:03 +0000 (UTC) Received: by qyk30 with SMTP id 30so412848qyk.13 for ; Fri, 24 Jun 2011 08:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pMgsRMs8x4OzC2iji0oqvDkbIsLBYlEXDJdv9R2TlZM=; b=um37ibaQKQ571z+ZhaTn5itD4nPn6Ft/TFNQdaAF6HxFM3W77DgfeCuLNdgh15p+Wn W3prU3mWGxcPGX2tqQx1LUfM3RVkx0uSdLQnN1Y/iYLJ+IlvfOTR+4VX8yfmuG1x7FMN t3Pwg2wGU3Yo6NcZZGXq7rEzDFPjW/e9ulXAk= MIME-Version: 1.0 Received: by 10.229.118.69 with SMTP id u5mr2583752qcq.122.1308929823029; Fri, 24 Jun 2011 08:37:03 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.229.227.130 with HTTP; Fri, 24 Jun 2011 08:37:02 -0700 (PDT) In-Reply-To: <201106241440.p5OEeMER058307@svn.freebsd.org> References: <201106241440.p5OEeMER058307@svn.freebsd.org> Date: Fri, 24 Jun 2011 19:37:02 +0400 X-Google-Sender-Auth: QdfSJ7u6BmoPRlFnYfQrTX5jJqQ Message-ID: From: Sergey Kandaurov To: Jonathan Anderson 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: r223505 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 15:37:04 -0000 On 24 June 2011 18:40, Jonathan Anderson wrote: > Author: jonathan > Date: Fri Jun 24 14:40:22 2011 > New Revision: 223505 > URL: http://svn.freebsd.org/changeset/base/223505 > > Log: > =A0Tidy up a capabilities-related comment. > > =A0This comment refers to an #ifdef that hasn't been merged [yet?]; remov= e it. > > =A0Approved by: rwatson Thanks! Can you close PR kern/148801 as well? This comment was mistakenly left after "Sweep kernel replacing suser(9) cal= ls with priv(9) calls" (svn r164033 by rwatson@) in which the exp. CAPABILITIE= S facility transformed to currently operating priv(9). After that the comment has lost its relevance. May be applied down to 7.x. > > Modified: > =A0head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_subr.c =A0 =A0Fri Jun 24 14:31:30 2011 =A0 =A0 =A0 = =A0(r223504) > +++ head/sys/kern/vfs_subr.c =A0 =A0Fri Jun 24 14:40:22 2011 =A0 =A0 =A0 = =A0(r223505) > @@ -3590,9 +3590,6 @@ vn_isdisk(struct vnode *vp, int *errp) > =A0* and optional call-by-reference privused argument allowing vaccess() > =A0* to indicate to the caller whether privilege was used to satisfy the > =A0* request (obsoleted). =A0Returns 0 on success, or an errno on failure= . > - * > - * The ifdef'd CAPABILITIES version is here for reference, but is not > - * actually used. > =A0*/ > =A0int > =A0vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_= gid, > --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 15:48:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D882D106566C; Fri, 24 Jun 2011 15:48:06 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5355F8FC14; Fri, 24 Jun 2011 15:48:06 +0000 (UTC) Received: by qwc9 with SMTP id 9so1976303qwc.13 for ; Fri, 24 Jun 2011 08:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=Cb3Ho0hC+pxSlDQxHoqqWYPQ+OSZaP60+xXAeZ+u0So=; b=FRZV6DfO7ikkUN4O79cz4w3swUo5JZw72Mt7VAetXWwNqStkSDmbV2yT4sC4VsgAUN +usq0tBIYQ/LdaIx9hJjC6bHPWPmREXGBdvwgn1DPvwW6rm+evehOWbMFah97YFFxm3F wBnuzlgYLuU1KHogB4HSkOdWmwc1CUf69hX/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=WUehBjyz5DSV/WgVHAIyUmSdHWXUhZlZeMNcs+XUFgolkq84H1sLlcJ9n+QfqzuQrS cGXQraaqmHxTgaRnvmw+lGmmYFz5v7bb2lF0YZEVfikCAlHezIxRGieFcBQaYWaanBeE SISLRSOUhQxmbCg8htN8+IaAH6iqTLEXxeVZY= Received: by 10.229.136.208 with SMTP id s16mr2642331qct.134.1308930485450; Fri, 24 Jun 2011 08:48:05 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id e18sm2034872qcs.41.2011.06.24.08.48.02 (version=SSLv3 cipher=OTHER); Fri, 24 Jun 2011 08:48:03 -0700 (PDT) Date: Fri, 24 Jun 2011 11:47:56 -0400 From: Alexander Kabaev To: Craig Rodrigues Message-ID: <20110624114756.534b333d@kan.dnsalias.net> In-Reply-To: <201106240350.p5O3otfc028955@svn.freebsd.org> References: <201106240350.p5O3otfc028955@svn.freebsd.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/P6s3h.qyAvJ9TIu4VyWd=no"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223488 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 15:48:06 -0000 --Sig_/P6s3h.qyAvJ9TIu4VyWd=no Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 24 Jun 2011 03:50:55 +0000 (UTC) Craig Rodrigues wrote: Hi, > + if (d->xid !=3D 1) { > + return (-1); > + } this is distinctly NOT what I sent to you and would rather not take credit for consequences. What you are doing here is not dropping the packet, you are returning error from read and with errno in unknown state on top of that. Why did this have to change and why there is no mention of that in the commit message? --=20 Alexander Kabaev --Sig_/P6s3h.qyAvJ9TIu4VyWd=no Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOBLGxQ6z1jMm+XZYRAtd6AJ9e3t7N3KaVLpHeDsmJRudG8iHoLACeLIuH 4+aeSV34KqOm/Lam/B+ubsA= =WP1T -----END PGP SIGNATURE----- --Sig_/P6s3h.qyAvJ9TIu4VyWd=no-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 16:11:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CDB1065670; Fri, 24 Jun 2011 16:11:22 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 453FB8FC20; Fri, 24 Jun 2011 16:11:21 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5OGBGDw079902 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 24 Jun 2011 09:11:22 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201106232221.p5NMLSFj019042@svn.freebsd.org> Date: Fri, 24 Jun 2011 09:11:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> References: <201106232221.p5NMLSFj019042@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 16:11:22 -0000 On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Jun 23 22:21:28 2011 > New Revision: 223485 > URL: http://svn.freebsd.org/changeset/base/223485 >=20 > Log: > Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for = ppc64) > instead of a PCPU field for curthread. This averts a race on SMP = systems > with a high interrupt rate where the thread looking up the value of > curthread could be preempted and migrated between obtaining the PCPU > pointer and reading the value of pc_curthread, resulting in curthread = being > observed to be the current thread on the thread's original CPU. This = played > merry havoc with the system, in particular with mutexes. Many thanks = to > jhb for helping me work this one out. Nice catch! Another approach would be to have r2/r13 hold the address of the PCPU structure and simply do a load from that address to get curthread. The difference between the approaches is the need to to a memory load or not for curthread. But with r2/r13 pointing to the PCPU, you may be faster to get other PCPU fields if reading from the a SPR adds to the overhead. Plus, it's easier to be atomic if you don't have to read the SPR first and then do a load. Is curthread the only field that needs to be atomically accessed or are other fields in the PCPU susceptible to race conditions? --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 16:18:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71E8106566B; Fri, 24 Jun 2011 16:18: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 793EA8FC12; Fri, 24 Jun 2011 16:18:38 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 167995824F; Fri, 24 Jun 2011 11:18:37 -0500 (CDT) 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 81N7zttvvAgH; Fri, 24 Jun 2011 11:18:36 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-119.icecube.wisc.edu [172.16.223.119]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 92BDB58141; Fri, 24 Jun 2011 11:18:36 -0500 (CDT) Message-ID: <4E04B8DC.1020600@freebsd.org> Date: Fri, 24 Jun 2011 11:18:36 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Marcel Moolenaar References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> In-Reply-To: <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 16:18:38 -0000 On 06/24/11 11:11, Marcel Moolenaar wrote: > > On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Thu Jun 23 22:21:28 2011 >> New Revision: 223485 >> URL: http://svn.freebsd.org/changeset/base/223485 >> >> Log: >> Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64) >> instead of a PCPU field for curthread. This averts a race on SMP systems >> with a high interrupt rate where the thread looking up the value of >> curthread could be preempted and migrated between obtaining the PCPU >> pointer and reading the value of pc_curthread, resulting in curthread being >> observed to be the current thread on the thread's original CPU. This played >> merry havoc with the system, in particular with mutexes. Many thanks to >> jhb for helping me work this one out. > > Nice catch! > > Another approach would be to have r2/r13 hold the address of the PCPU > structure and simply do a load from that address to get curthread. > The difference between the approaches is the need to to a memory load > or not for curthread. But with r2/r13 pointing to the PCPU, you may > be faster to get other PCPU fields if reading from the a SPR adds to > the overhead. Plus, it's easier to be atomic if you don't have to > read the SPR first and then do a load. The trouble with this approach is that r2/r13 would need to be updated on every CPU switch with the new PCPU pointer, so I just put curthread in there due to laziness, which is of course constant for a given thread. Another consideration is that we'd have to additionally maintain SPRG0 as the PCPU pointer anyway, since we need a PCPU area that userland can't change (r2/r13 is set from PCPU data when traps are taken now). > Is curthread the only field that needs to be atomically accessed or > are other fields in the PCPU susceptible to race conditions? In my discussion with John yesterday, he said he thought it was the only one susceptible to races of this type. The approach I used here (providing a special accessor for curthread that reads a non-PCPU-related register) is borrowed from the one used on amd64, i386, and alpha. Whether it is the only possibility for this kind of race or not, none of these platforms at least override anything else. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 16:33:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60101065742; Fri, 24 Jun 2011 16:33:30 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9694C8FC1D; Fri, 24 Jun 2011 16:33:30 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5OGXP6b079980 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 24 Jun 2011 09:33:31 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E04B8DC.1020600@freebsd.org> Date: Fri, 24 Jun 2011 09:33:18 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> <4E04B8DC.1020600@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 16:33:31 -0000 On Jun 24, 2011, at 9:18 AM, Nathan Whitehorn wrote: > On 06/24/11 11:11, Marcel Moolenaar wrote: >>=20 >> On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: >>=20 >>> Author: nwhitehorn >>> Date: Thu Jun 23 22:21:28 2011 >>> New Revision: 223485 >>> URL: http://svn.freebsd.org/changeset/base/223485 >>>=20 >>> Log: >>> Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for = ppc64) >>> instead of a PCPU field for curthread. This averts a race on SMP = systems >>> with a high interrupt rate where the thread looking up the value of >>> curthread could be preempted and migrated between obtaining the = PCPU >>> pointer and reading the value of pc_curthread, resulting in = curthread being >>> observed to be the current thread on the thread's original CPU. = This played >>> merry havoc with the system, in particular with mutexes. Many = thanks to >>> jhb for helping me work this one out. >>=20 >> Nice catch! >>=20 >> Another approach would be to have r2/r13 hold the address of the PCPU >> structure and simply do a load from that address to get curthread. >> The difference between the approaches is the need to to a memory load >> or not for curthread. But with r2/r13 pointing to the PCPU, you may >> be faster to get other PCPU fields if reading from the a SPR adds to >> the overhead. Plus, it's easier to be atomic if you don't have to >> read the SPR first and then do a load. >=20 > The trouble with this approach is that r2/r13 would need to be updated = on every CPU switch with the new PCPU pointer, so I just put curthread = in there due to laziness, which is of course constant for a given = thread. Actually, you need to save and assign that register on entry into the kernel only and restore it when you go back to user space (due to it being the thread pointer in user space). It remains a constant within the kernel (from the CPU's point of view) and does not have to be changed on a context switch. If r2/r13 hold curthread, then r2/r13 are indeed constant from the perspective of the thread, but it needs to be changed for every context switch in that case. =46rom the CPU's perspective these registers are not constant then. > Another consideration is that we'd have to additionally maintain SPRG0 = as the PCPU pointer anyway, since we need a PCPU area that userland = can't change (r2/r13 is set from PCPU data when traps are taken now). Yes. On ia64 we use the thread register to hold the address of the PCPU structure and since curthread is at offset 0 in the PCPU structure, we can do an atomic load. We use a kernel register to restore the PCPU address in the thread register on entry into the kernel. Works well and it doesn't make curthread too special (other than it needing to be at offset 0 in the PCPU structure for the dereferencing to be atomic). As such, even PCPU_GET(curthread) is atomic... Anyway: I'll see about fixing Book-E... >=20 >> Is curthread the only field that needs to be atomically accessed or >> are other fields in the PCPU susceptible to race conditions? >=20 > In my discussion with John yesterday, he said he thought it was the = only one susceptible to races of this type. The approach I used here = (providing a special accessor for curthread that reads a = non-PCPU-related register) is borrowed from the one used on amd64, i386, = and alpha. Whether it is the only possibility for this kind of race or = not, none of these platforms at least override anything else. Thanks. That's what I figured, but I never really had any firm confirmation and we still have comments in our code like: /* * XXX The implementation of this operation should be made atomic * with respect to preemption. */ #define PCPU_ADD(member, value) (pcpup->pc_ ## member +=3D (value)) It's always created uncertainty and doubt in my mind... --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 17:54:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8701065672; Fri, 24 Jun 2011 17:54:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BF9C58FC12; Fri, 24 Jun 2011 17:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OHsjuO064600; Fri, 24 Jun 2011 17:54:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OHsjS4064598; Fri, 24 Jun 2011 17:54:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241754.p5OHsjS4064598@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 17:54: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: r223510 - head/usr.sbin/mtest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 17:54:45 -0000 Author: jhb Date: Fri Jun 24 17:54:45 2011 New Revision: 223510 URL: http://svn.freebsd.org/changeset/base/223510 Log: Don't die if either of INET or INET6 aren't in the running kernel. Instead, report "protocol not supported" errors at runtime if a user attempts to use a protocol that the kernel doesn't support. Reviewed by: bz MFC after: 1 week Modified: head/usr.sbin/mtest/mtest.c Modified: head/usr.sbin/mtest/mtest.c ============================================================================== --- head/usr.sbin/mtest/mtest.c Fri Jun 24 17:29:41 2011 (r223509) +++ head/usr.sbin/mtest/mtest.c Fri Jun 24 17:54:45 2011 (r223510) @@ -204,14 +204,16 @@ main(int argc, char **argv) s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (s == -1) + if (s == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - if (s6 == -1) + if (s6 == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv6 socket"); #endif + if (s == -1 && s6 == -1) + errc(1, EPROTONOSUPPORT, "can't open socket"); if (argc < 2) { if (isatty(STDIN_FILENO)) { @@ -371,7 +373,7 @@ af2socklen(const int af) } static void -process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) +process_cmd(char *cmd, int s, int s6, FILE *fp __unused) { char str1[STR_SIZE]; char str2[STR_SIZE]; @@ -457,7 +459,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr; optlen = sizeof(mr.mr); } - if (setsockopt(s, level, optname, optval, + if (s < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -496,7 +501,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr6; optlen = sizeof(mr.mr6); } - if (setsockopt(s6, level, optname, optval, + if (s6 < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s6, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -534,6 +542,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "setsourcefilter"); + break; + } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; @@ -593,6 +605,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } /* First determine our current filter mode. */ n = 0; @@ -700,6 +716,10 @@ process_cmd(char *cmd, int s, int s6 __u } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } nsrc = nreqsrc; if (getsourcefilter(af2sock(af, s, s6), ifindex, &su.sa, su.sa.sa_len, &fmode, &nsrc, &sources[0].ss) != 0) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 18:11:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87B45106566B; Fri, 24 Jun 2011 18:11:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7798B8FC16; Fri, 24 Jun 2011 18:11:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OIBtIv065143; Fri, 24 Jun 2011 18:11:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OIBtLS065141; Fri, 24 Jun 2011 18:11:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241811.p5OIBtLS065141@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:11: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: r223511 - 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: Fri, 24 Jun 2011 18:11:55 -0000 Author: hselasky Date: Fri Jun 24 18:11:55 2011 New Revision: 223511 URL: http://svn.freebsd.org/changeset/base/223511 Log: - Export the URIO USB device ID's. - Add checks for configuration and interface index. MFC after: 3 days Modified: head/sys/dev/usb/storage/urio.c Modified: head/sys/dev/usb/storage/urio.c ============================================================================== --- head/sys/dev/usb/storage/urio.c Fri Jun 24 17:54:45 2011 (r223510) +++ head/sys/dev/usb/storage/urio.c Fri Jun 24 18:11:55 2011 (r223511) @@ -198,22 +198,25 @@ DRIVER_MODULE(urio, uhub, urio_driver, u MODULE_DEPEND(urio, usb, 1, 1, 1); MODULE_VERSION(urio, 1); +static const STRUCT_USB_HOST_ID urio_devs[] = { + {USB_VPI(USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB, 0)}, +}; + static int urio_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((((uaa->info.idVendor == USB_VENDOR_DIAMOND) && - (uaa->info.idProduct == USB_PRODUCT_DIAMOND_RIO500USB)) || - ((uaa->info.idVendor == USB_VENDOR_DIAMOND2) && - ((uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO600USB) || - (uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO800USB))))) - return (0); - else + if (uaa->info.bConfigIndex != 0) return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(urio_devs, sizeof(urio_devs), uaa)); } static int From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 18:14:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB0B1065670; Fri, 24 Jun 2011 18:14:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8D58FC14; Fri, 24 Jun 2011 18:14:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OIEhqa065251; Fri, 24 Jun 2011 18:14:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OIEhXE065248; Fri, 24 Jun 2011 18:14:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241814.p5OIEhXE065248@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:14: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: r223512 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 18:14:43 -0000 Author: hselasky Date: Fri Jun 24 18:14:43 2011 New Revision: 223512 URL: http://svn.freebsd.org/changeset/base/223512 Log: - Move execution of event handlers into the probe and attach function so that dynamically loaded device drivers get a chance to run their event hooks. - Decouple the USB suspend and resume lock from witness. It produces some false warnings due to reusing the lock name among multiple devices. MFC after: 3 days Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jun 24 18:11:55 2011 (r223511) +++ head/sys/dev/usb/usb_device.c Fri Jun 24 18:14:43 2011 (r223512) @@ -1297,6 +1297,21 @@ usb_probe_and_attach(struct usb_device * usb_init_attach_arg(udev, &uaa); + /* + * If the whole USB device is targeted, invoke the USB event + * handler(s): + */ + if (iface_index == USB_IFACE_INDEX_ANY) { + + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); + + if (uaa.dev_state != UAA_DEV_READY) { + /* leave device unconfigured */ + usb_unconfigure(udev, 0); + goto done; + } + } + /* Check if only one interface should be probed: */ if (iface_index != USB_IFACE_INDEX_ANY) { i = iface_index; @@ -1526,7 +1541,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); - sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_DUPOK); + sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1834,11 +1849,6 @@ repeat_set_config: } } } - EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); - if (uaa.dev_state != UAA_DEV_READY) { - /* leave device unconfigured */ - usb_unconfigure(udev, 0); - } config_done: DPRINTF("new dev (addr %d), udev=%p, parent_hub=%p\n", Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Fri Jun 24 18:11:55 2011 (r223511) +++ head/sys/dev/usb/usb_msctest.c Fri Jun 24 18:14:43 2011 (r223512) @@ -489,6 +489,24 @@ bbb_attach(struct usb_device *udev, uint struct usb_interface_descriptor *id; struct bbb_transfer *sc; usb_error_t err; + uint8_t do_unlock; + + /* automatic locking */ + if (usbd_enum_is_locked(udev)) { + do_unlock = 0; + } else { + do_unlock = 1; + usbd_enum_lock(udev); + } + + /* + * Make sure any driver which is hooked up to this interface, + * like umass is gone: + */ + usb_detach_device(udev, iface_index, 0); + + if (do_unlock) + usbd_enum_unlock(udev); iface = usbd_get_iface(udev, iface_index); if (iface == NULL) From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 19:02:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732D9106564A; Fri, 24 Jun 2011 19:02:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 62D5B8FC16; Fri, 24 Jun 2011 19:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OJ2uej066641; Fri, 24 Jun 2011 19:02:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OJ2uCL066639; Fri, 24 Jun 2011 19:02:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241902.p5OJ2uCL066639@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:02: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: r223513 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 19:02:56 -0000 Author: hselasky Date: Fri Jun 24 19:02:56 2011 New Revision: 223513 URL: http://svn.freebsd.org/changeset/base/223513 Log: - Ensure that we get all the required nomatch devd events. MFC after: 3 days Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jun 24 18:14:43 2011 (r223512) +++ head/sys/dev/usb/usb_device.c Fri Jun 24 19:02:56 2011 (r223513) @@ -1358,17 +1358,18 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex, uaa.info.bIfaceNum); - if (usb_probe_and_attach_sub(udev, &uaa)) { - /* ignore */ - } - } + usb_probe_and_attach_sub(udev, &uaa); - if (uaa.temp_dev) { - /* remove the last created child; it is unused */ - - if (device_delete_child(udev->parent_dev, uaa.temp_dev)) { + /* + * Remove the leftover child, if any, to enforce that + * a new nomatch devd event is generated for the next + * interface if no driver is found: + */ + if (uaa.temp_dev == NULL) + continue; + if (device_delete_child(udev->parent_dev, uaa.temp_dev)) DPRINTFN(0, "device delete child failed\n"); - } + uaa.temp_dev = NULL; } done: if (do_unlock) From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 19:24:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655111065670; Fri, 24 Jun 2011 19:24:45 +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 24E5E8FC12; Fri, 24 Jun 2011 19:24:44 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 59269582C0; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) 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 3CbTTET+xgwV; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-119.icecube.wisc.edu [172.16.223.119]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 1D21B58143; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) Message-ID: <4E04E47B.2030007@freebsd.org> Date: Fri, 24 Jun 2011 14:24:43 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Marcel Moolenaar References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> <4E04B8DC.1020600@freebsd.org> <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> In-Reply-To: <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 19:24:45 -0000 On 06/24/11 11:33, Marcel Moolenaar wrote: > > On Jun 24, 2011, at 9:18 AM, Nathan Whitehorn wrote: > >> On 06/24/11 11:11, Marcel Moolenaar wrote: >>> >>> On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: >>> >>>> Author: nwhitehorn Date: Thu Jun 23 22:21:28 2011 New Revision: >>>> 223485 URL: http://svn.freebsd.org/changeset/base/223485 >>>> >>>> Log: Use the ABI-mandated thread pointer register (r2 for >>>> ppc32, r13 for ppc64) instead of a PCPU field for curthread. >>>> This averts a race on SMP systems with a high interrupt rate >>>> where the thread looking up the value of curthread could be >>>> preempted and migrated between obtaining the PCPU pointer and >>>> reading the value of pc_curthread, resulting in curthread >>>> being observed to be the current thread on the thread's >>>> original CPU. This played merry havoc with the system, in >>>> particular with mutexes. Many thanks to jhb for helping me work >>>> this one out. >>> >>> Nice catch! >>> >>> Another approach would be to have r2/r13 hold the address of the >>> PCPU structure and simply do a load from that address to get >>> curthread. The difference between the approaches is the need to >>> to a memory load or not for curthread. But with r2/r13 pointing >>> to the PCPU, you may be faster to get other PCPU fields if >>> reading from the a SPR adds to the overhead. Plus, it's easier to >>> be atomic if you don't have to read the SPR first and then do a >>> load. >> >> The trouble with this approach is that r2/r13 would need to be >> updated on every CPU switch with the new PCPU pointer, so I just >> put curthread in there due to laziness, which is of course constant >> for a given thread. > > Actually, you need to save and assign that register on entry into the > kernel only and restore it when you go back to user space (due to it > being the thread pointer in user space). It remains a constant within > the kernel (from the CPU's point of view) and does not have to be > changed on a context switch. > > If r2/r13 hold curthread, then r2/r13 are indeed constant from the > perspective of the thread, but it needs to be changed for every > context switch in that case. From the CPU's perspective these > registers are not constant then. > >> Another consideration is that we'd have to additionally maintain >> SPRG0 as the PCPU pointer anyway, since we need a PCPU area that >> userland can't change (r2/r13 is set from PCPU data when traps are >> taken now). > > Yes. > > On ia64 we use the thread register to hold the address of the PCPU > structure and since curthread is at offset 0 in the PCPU structure, > we can do an atomic load. We use a kernel register to restore the > PCPU address in the thread register on entry into the kernel. Works > well and it doesn't make curthread too special (other than it needing > to be at offset 0 in the PCPU structure for the dereferencing to be > atomic). As such, even PCPU_GET(curthread) is atomic... Ah, I understand now. There's some code in thread switching that saves/restores R2/R13 which would need to be turned off, but maybe that's something to look into. > Anyway: I'll see about fixing Book-E... Thanks! >>> Is curthread the only field that needs to be atomically accessed >>> or are other fields in the PCPU susceptible to race conditions? >> >> In my discussion with John yesterday, he said he thought it was the >> only one susceptible to races of this type. The approach I used >> here (providing a special accessor for curthread that reads a >> non-PCPU-related register) is borrowed from the one used on amd64, >> i386, and alpha. Whether it is the only possibility for this kind >> of race or not, none of these platforms at least override anything >> else. > > Thanks. That's what I figured, but I never really had any firm > confirmation and we still have comments in our code like: > > /* * XXX The implementation of this operation should be made atomic * > with respect to preemption. */ #define PCPU_ADD(member, value) > (pcpup->pc_ ## member += (value)) > > > It's always created uncertainty and doubt in my mind... Is there a good reason not to just sched_pin() or critical_enter() around those? This doesn't work for curthread, of course, but for the rest it should. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 19:32:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0424D106564A; Fri, 24 Jun 2011 19:32:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E76458FC14; Fri, 24 Jun 2011 19:32:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OJWTdU067533; Fri, 24 Jun 2011 19:32:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OJWT4e067528; Fri, 24 Jun 2011 19:32:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241932.p5OJWT4e067528@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:32: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: r223515 - in head/sys/dev/usb: misc serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 19:32:30 -0000 Author: hselasky Date: Fri Jun 24 19:32:29 2011 New Revision: 223515 URL: http://svn.freebsd.org/changeset/base/223515 Log: - Export more USB device ID's. MFC after: 3 days Modified: head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/misc/udbp.c Fri Jun 24 19:32:29 2011 (r223515) @@ -288,40 +288,27 @@ udbp_modload(module_t mod, int event, vo return (error); } +static const STRUCT_USB_HOST_ID udbp_devs[] = { + {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)}, + {USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)}, + {USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)}, +}; + static int udbp_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) return (ENXIO); - } - /* - * XXX Julian, add the id of the device if you have one to test - * things with. run 'usbdevs -v' and note the 3 ID's that appear. - * The Vendor Id and Product Id are in hex and the Revision Id is in - * bcd. But as usual if the revision is 0x101 then you should - * compare the revision id in the device descriptor with 0x101 Or go - * search the file usbdevs.h. Maybe the device is already in there. - */ - if (((uaa->info.idVendor == USB_VENDOR_NETCHIP) && - (uaa->info.idProduct == USB_PRODUCT_NETCHIP_TURBOCONNECT))) - return (0); - - if (((uaa->info.idVendor == USB_VENDOR_PROLIFIC) && - ((uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2301) || - (uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2302)))) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_ANCHOR) && - (uaa->info.idProduct == USB_PRODUCT_ANCHOR_EZLINK)) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_GENESYS) && - (uaa->info.idProduct == USB_PRODUCT_GENESYS_GL620USB)) - return (0); - return (ENXIO); + return (usbd_lookup_id_by_uaa(udbp_devs, sizeof(udbp_devs), uaa)); } static int Modified: head/sys/dev/usb/misc/ufm.c ============================================================================== --- head/sys/dev/usb/misc/ufm.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/misc/ufm.c Fri Jun 24 19:32:29 2011 (r223515) @@ -118,19 +118,23 @@ DRIVER_MODULE(ufm, uhub, ufm_driver, ufm MODULE_DEPEND(ufm, usb, 1, 1, 1); MODULE_VERSION(ufm, 1); +static const STRUCT_USB_HOST_ID ufm_devs[] = { + {USB_VPI(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_FMRADIO, 0)}, +}; + static int ufm_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((uaa->info.idVendor == USB_VENDOR_CYPRESS) && - (uaa->info.idProduct == USB_PRODUCT_CYPRESS_FMRADIO)) { - return (0); - } - return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(ufm_devs, sizeof(ufm_devs), uaa)); } static int Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/serial/ufoma.c Fri Jun 24 19:32:29 2011 (r223515) @@ -327,6 +327,11 @@ MODULE_DEPEND(ufoma, ucom, 1, 1, 1); MODULE_DEPEND(ufoma, usb, 1, 1, 1); MODULE_VERSION(ufoma, 1); +static const STRUCT_USB_HOST_ID ufoma_devs[] = { + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_MCPC),}, +}; + static int ufoma_probe(device_t dev) { @@ -334,30 +339,31 @@ ufoma_probe(device_t dev) struct usb_interface_descriptor *id; struct usb_config_descriptor *cd; usb_mcpc_acm_descriptor *mad; + int error; - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + + error = usbd_lookup_id_by_uaa(ufoma_devs, sizeof(ufoma_devs), uaa); + if (error) + return (error); + id = usbd_get_interface_descriptor(uaa->iface); cd = usbd_get_config_descriptor(uaa->device); - if ((id == NULL) || - (cd == NULL) || - (id->bInterfaceClass != UICLASS_CDC) || - (id->bInterfaceSubClass != UISUBCLASS_MCPC)) { + if (id == NULL || cd == NULL) return (ENXIO); - } + mad = ufoma_get_intconf(cd, id, UDESC_VS_INTERFACE, UDESCSUB_MCPC_ACM); - if (mad == NULL) { + if (mad == NULL) return (ENXIO); - } + #ifndef UFOMA_HANDSFREE if ((mad->bType == UMCPC_ACM_TYPE_AB5) || - (mad->bType == UMCPC_ACM_TYPE_AB6)) { + (mad->bType == UMCPC_ACM_TYPE_AB6)) return (ENXIO); - } #endif - return (0); + return (BUS_PROBE_GENERIC); } static int Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/serial/umodem.c Fri Jun 24 19:32:29 2011 (r223515) @@ -276,11 +276,14 @@ umodem_probe(device_t dev) DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + error = usbd_lookup_id_by_uaa(umodem_devs, sizeof(umodem_devs), uaa); - return (error); + if (error) + return (error); + + return (BUS_PROBE_GENERIC); } static int From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 20:23:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEB81065674; Fri, 24 Jun 2011 20:23:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 001348FC08; Fri, 24 Jun 2011 20:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OKNo9l069130; Fri, 24 Jun 2011 20:23:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OKNo9g069128; Fri, 24 Jun 2011 20:23:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106242023.p5OKNo9g069128@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 24 Jun 2011 20:23: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: r223517 - 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: Fri, 24 Jun 2011 20:23:51 -0000 Author: jilles Date: Fri Jun 24 20:23:50 2011 New Revision: 223517 URL: http://svn.freebsd.org/changeset/base/223517 Log: sh(1): Document the case command better. Suggested by: netchild Reviewed by: gjb Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Jun 24 20:15:44 2011 (r223516) +++ head/bin/sh/sh.1 Fri Jun 24 20:23:50 2011 (r223517) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 18, 2011 +.Dd June 24, 2011 .Dt SH 1 .Os .Sh NAME @@ -994,11 +994,22 @@ described later), separated by .Ql \&| characters. +Tilde expansion, parameter expansion, command substitution, +arithmetic expansion and quote removal are applied to the word. +Then, each pattern is expanded in turn using tilde expansion, +parameter expansion, command substitution and arithmetic expansion and +the expanded form of the word is checked against it. +If a match is found, the corresponding list is executed. If the selected list is terminated by the control operator .Ql ;& instead of .Ql ;; , -execution continues with the next list. +execution continues with the next list, +continuing until a list terminated with +.Ql ;; +or the end of the +.Ic case +command. The exit code of the .Ic case command is the exit code of the last command executed in the list or From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 20:41:40 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E9F0106564A; Fri, 24 Jun 2011 20:41:40 +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 B39CB8FC12; Fri, 24 Jun 2011 20:41:39 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5OKfald006053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jun 2011 06:41:37 +1000 Date: Sat, 25 Jun 2011 06:41:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20110624080548.GA60075@freebsd.org> Message-ID: <20110625055010.G943@besplex.bde.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> <20110624072113.GA52982@freebsd.org> <20110624080548.GA60075@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Kevin Lo , Roman Divacky , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 20:41:40 -0000 On Fri, 24 Jun 2011, Alexander Best wrote: > On Fri Jun 24 11, Roman Divacky wrote: >> On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: >>> Author: kevlo >>> Date: Fri Jun 24 07:18:44 2011 >>> New Revision: 223493 >>> URL: http://svn.freebsd.org/changeset/base/223493 >>> >>> Log: >>> Remove duplicated header files >> >> You may be interested in this tool: >> >> http://code.google.com/p/include-what-you-use/ > > did they add C support since the last time i tested it? back then it only > worked with CPP code, iirc. it was possible to thorw it at C code, but it > returned pretty useless results. Why not use a FreeBSD utility? There is /usr/src/tools/tools/kerninclude/ kerninclude.sh. This is only for the kernel. No one uses it. I believe it is based on my unusedinc utility which works almost anywhere that make(1) works and has code clean enough to compile with WARNS ~= 6 and doesn't have a convoluted source tree. My utility just copies the source file to the current directory, removes 1 #include line at a time from it, and compiles it before and after with many warning flags; any differences are attributed to the #include line being used. Unfortunately, this gives many false positives and negatives due to namespace pollution and other poor structuring in standard headers. You can remove a primary header like which is obviously used, and find that everything still includes because some other header is polluted. The pollution may be an documented feature (like including ), in which case it may be correct to depend on it and a style bug to include both headers. The pollution may be an undocumented feature, in which case it may be correct to depend on it after fixing the documentation. But usually, the pollution is an undocumented bug. In all cases, before removing a single header, you must: - determine if pollution is involved. I normally try removing the #include line manually, running "make depend", and checking if the file is still included - if pollution is involved, read all the header files and man pages to see if it is intended. kerninclude.sh does a more sophisticated version of this. It does something like copying the entire include hierarchy and replacing each header referred to in an #include line by an empty header, to ensure that the header isn't used by pollution. But would make it too slow to use in a small source tree or one file at a time even if it supported these. unusedinc scribbling in the source directory is sloppy (it does this because using $(mktemp) tends to break paths. This and other problems with paths might be fixable by setting up a full obj tree. I'm not sure if kerninclude.sh does this, but if it does this would be another source of slowness. kerninclude.sh is inconvenient to use on the kernel too. It takes too long, and finds more bugs than you want to know about. AFAIK, google doesn't yet have the AI needed to do this correctly or efficiently. It would have to understand FreeBSD header pollution better than FreeBSD does. Often the correct fix is to fix the pollution in standard headers and not change the application #include's. Often, the correct quick fix is to not change the application #includes and wait for someone to fix the pollution. Example of unusedinc output: % trying /dumpster/home/bde/q/vmstat/vmstat.c % line 75 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 70 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 69 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 66 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 60 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 57 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 56 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 54 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 51 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 50 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 48 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 46 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include % line 45 in source /dumpster/home/bde/q/vmstat/vmstat.c seems to be unnecessary: % #include I only investigated 3 of the lines of output: - the 2 #includes of . kevlo removed 1 of these. The wrong one, since is a documented prerequisite for in at least getrusage(2). was included both before and after . The former was unsorted but satisfied the prerequisite. Now, only the latter is included. This is sorted but doesn't satisfy the prereqisite. However, the documentation is wrong. was depolluted long ago, so doesn't have any prerequisites or any internal pollution. getrusage(2) also documents the old prerequisite . Many other man pages do this too. This was required in POSIX.1-1988, and it was added to some FreeBSD man pages relatively recently (sometimes via OtherBSD). But POSIX.1-2001 removed this requirement, and FreeBSD fixed many other headers to not require it, without updating the man pages. This requirement belongs at most in a portability/history section of the man pages. - is used in vmstat, but removing the #include of it has no effect there since it is still #included via pollution in which uses it bogusly (just once for an incomplete struct declaration of struct nlist for a prototype; gives the complete struct declaration, but this is not used in ). Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 21:27:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4039106566C; Fri, 24 Jun 2011 21:27:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 935128FC1B; Fri, 24 Jun 2011 21:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OLRXGD070902; Fri, 24 Jun 2011 21:27:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OLRXZa070898; Fri, 24 Jun 2011 21:27:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106242127.p5OLRXZa070898@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 21: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: r223518 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 21:27:33 -0000 Author: hselasky Date: Fri Jun 24 21:27:33 2011 New Revision: 223518 URL: http://svn.freebsd.org/changeset/base/223518 Log: - We need to sort all USB device ID's together. Else the matching order will be wrong. This is required because devd only executes one entry. MFC after: 14 days Modified: head/tools/tools/bus_autoconf/bus_autoconf.c head/tools/tools/bus_autoconf/bus_autoconf.h head/tools/tools/bus_autoconf/bus_autoconf.sh Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 20:23:50 2011 (r223517) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 21:27:33 2011 (r223518) @@ -43,15 +43,67 @@ static char *type; static char *file_name; -static char *module; static const char *mode; +struct usb_info; +static void usb_dump_sub(struct usb_device_id *, struct usb_info *); + +/* + * To ensure that the correct USB driver is loaded, the driver having + * the most information about the device must be probed first. Then + * more generic drivers shall be probed. + */ static int usb_compare(const void *_a, const void *_b) { const struct usb_device_id *a = _a; const struct usb_device_id *b = _b; + /* vendor matches first */ + + if (a->match_flag_vendor > b->match_flag_vendor) + return (-1); + if (a->match_flag_vendor < b->match_flag_vendor) + return (1); + + /* product matches first */ + + if (a->match_flag_product > b->match_flag_product) + return (-1); + if (a->match_flag_product < b->match_flag_product) + return (1); + + /* device class matches first */ + + if (a->match_flag_dev_class > b->match_flag_dev_class) + return (-1); + if (a->match_flag_dev_class < b->match_flag_dev_class) + return (1); + + if (a->match_flag_dev_subclass > b->match_flag_dev_subclass) + return (-1); + if (a->match_flag_dev_subclass < b->match_flag_dev_subclass) + return (1); + + /* interface class matches first */ + + if (a->match_flag_int_class > b->match_flag_int_class) + return (-1); + if (a->match_flag_int_class < b->match_flag_int_class) + return (1); + + if (a->match_flag_int_subclass > b->match_flag_int_subclass) + return (-1); + if (a->match_flag_int_subclass < b->match_flag_int_subclass) + return (1); + + if (a->match_flag_int_protocol > b->match_flag_int_protocol) + return (-1); + if (a->match_flag_int_protocol < b->match_flag_int_protocol) + return (1); + + /* then sort according to value */ + if (a->idVendor > b->idVendor) return (1); if (a->idVendor < b->idVendor) @@ -85,7 +137,9 @@ usb_compare(const void *_a, const void * if (a->bInterfaceProtocol < b->bInterfaceProtocol) return (-1); - return (0); + /* in the end sort by module name */ + + return (strcmp(a->module_name, b->module_name)); } static void @@ -105,39 +159,55 @@ static void usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) { #if USB_HAVE_COMPAT_LINUX - if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) - id->match_flag_vendor = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) - id->match_flag_product = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) - id->match_flag_dev_lo = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) - id->match_flag_dev_hi = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) - id->match_flag_dev_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) - id->match_flag_dev_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) - id->match_flag_dev_protocol = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) - id->match_flag_int_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) - id->match_flag_int_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) - id->match_flag_int_protocol = 1; + if (id->match_flags != 0) { + if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) + id->match_flag_vendor = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) + id->match_flag_product = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) + id->match_flag_dev_lo = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) + id->match_flag_dev_hi = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) + id->match_flag_dev_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) + id->match_flag_dev_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) + id->match_flag_dev_protocol = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) + id->match_flag_int_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) + id->match_flag_int_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) + id->match_flag_int_protocol = 1; + id->match_flags = 0; + } #endif + if (pinfo != NULL) { - pinfo->is_iface = id->match_flag_int_class | - id->match_flag_int_protocol | - id->match_flag_int_subclass; + pinfo->is_iface = id->match_flag_int_class | + id->match_flag_int_protocol | + id->match_flag_int_subclass; - pinfo->is_dev = id->match_flag_dev_class | - id->match_flag_dev_subclass; + pinfo->is_dev = id->match_flag_dev_class | + id->match_flag_dev_subclass; - pinfo->is_vp = id->match_flag_vendor | - id->match_flag_product; + pinfo->is_vp = id->match_flag_vendor | + id->match_flag_product; - pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; + pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; + } +} + +static char * +usb_trim(char *ptr) +{ + char *end; + + end = strchr(ptr, ' '); + if (end) + *end = 0; + return (ptr); } static uint32_t @@ -149,7 +219,7 @@ usb_dump(struct usb_device_id *id, uint3 usb_dump_sub(id, &info); if (info.is_any) { - printf("nomatch 10 {\n" + printf("nomatch 32 {\n" " match \"bus\" \"uhub[0-9]+\";\n" " match \"mode\" \"%s\";\n", mode); } else { @@ -212,7 +282,7 @@ usb_dump(struct usb_device_id *id, uint3 id->bInterfaceProtocol); } printf(" action \"kldload %s\";\n" - "};\n\n", module); + "};\n\n", usb_trim(id->module_name)); return (n); } @@ -239,12 +309,21 @@ usb_parse_and_dump(int f, off_t size) } nid = size / sizeof(*id); + for (x = 0; x != nid; x++) { + /* make sure flag bits are correct */ + usb_dump_sub(id + x, NULL); + /* zero terminate string */ + id[x].module_name[sizeof(id[0].module_name) - 1] = 0; + } + usb_sort(id, nid); for (x = 0; x != nid;) x += usb_dump(id + x, nid - x); free(id); + + printf("# %d %s entries processed\n\n", (int)nid, type); } static void @@ -253,7 +332,6 @@ usage(void) fprintf(stderr, "bus_autoconf - devd config file generator\n" " -i \n" - " -m \n" " -t \n" " -h show usage\n" ); @@ -263,7 +341,7 @@ usage(void) int main(int argc, char **argv) { - const char *params = "i:m:ht:"; + const char *params = "i:ht:"; int c; int f; off_t off; @@ -276,16 +354,13 @@ main(int argc, char **argv) case 't': type = optarg; break; - case 'm': - module = optarg; - break; default: usage(); break; } } - if (type == NULL || module == NULL || file_name == NULL) + if (type == NULL || file_name == NULL) usage(); f = open(file_name, O_RDONLY); Modified: head/tools/tools/bus_autoconf/bus_autoconf.h ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.h Fri Jun 24 20:23:50 2011 (r223517) +++ head/tools/tools/bus_autoconf/bus_autoconf.h Fri Jun 24 21:27:33 2011 (r223518) @@ -33,6 +33,9 @@ struct usb_device_id { + /* Internal field */ + char module_name[32]; + /* Hook for driver specific information */ unsigned long driver_info; Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.sh Fri Jun 24 20:23:50 2011 (r223517) +++ head/tools/tools/bus_autoconf/bus_autoconf.sh Fri Jun 24 21:27:33 2011 (r223518) @@ -29,6 +29,30 @@ OS=FreeBSD DOLLAR=$ +cleanup() +{ + # Cleanup + rm -f usb_dual.ids + rm -f usb_host.ids + rm -f usb_device.ids +} + +usb_format() +{ + [ -f ${1} ] || return + + # Split into one and one record + split -b 32 ${1} ${1}. + + # Prefix each record by the module name + for G in $(ls ${1}.*) + do + printf "%-32s" ${3} >> ${2} + cat ${G} >> ${2} + rm -f ${G} + done +} + cat < /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_host -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_host_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_host.ids ${H} + # USB Device -objcopy -j usb_device_id -O binary ${F} ${F}.ids 2> /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_device -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_device_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_device.ids ${H} + # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} ${F}.ids 2> /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_dual -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_dual_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_dual.ids ${H} + done + +# Dump all data +[ -f usb_dual.ids ] && bus_autoconf -i usb_dual.ids -t usb_dual +[ -f usb_host.ids ] && bus_autoconf -i usb_host.ids -t usb_host +[ -f usb_device.ids ] && bus_autoconf -i usb_device.ids -t usb_device + +# Cleanup +cleanup From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 21:32:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72BC5106564A; Fri, 24 Jun 2011 21:32:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 629188FC0A; Fri, 24 Jun 2011 21:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OLW3q9071063; Fri, 24 Jun 2011 21:32:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OLW3DL071062; Fri, 24 Jun 2011 21:32:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106242132.p5OLW3DL071062@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 21:32: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: r223519 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 21:32:03 -0000 Author: hselasky Date: Fri Jun 24 21:32:03 2011 New Revision: 223519 URL: http://svn.freebsd.org/changeset/base/223519 Log: - Add auto-load devd config file for USB kernel modules. MFC after: 14 days Added: head/etc/devd/bus_auto.conf (contents, props changed) Added: head/etc/devd/bus_auto.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/devd/bus_auto.conf Fri Jun 24 21:32:03 2011 (r223519) @@ -0,0 +1,2347 @@ +# +# $FreeBSD$ +# +# This file was automatically generated by "tools/bus_autoconf.sh". +# Please do not edit! +# + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x06"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0a"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0d"; + action "kldload if_cdce"; +}; + +# 3 usb_dual entries processed + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1290"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1292"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1294"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1297"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0104"; + match "product" "0x00be"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03e8"; + match "product" "0x0008"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03eb"; + match "product" "0x2109"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02)"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0402"; + match "product" "0x5632"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0403"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150|0x015d|0x016f)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0413"; + match "product" "0x2101"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0423"; + match "product" "(0x000a|0x000c)"; + action "kldload if_cue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x043e"; + match "product" "0x9c01"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045a"; + match "product" "(0x5001|0x5002)"; + action "kldload urio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045b"; + match "product" "0x0053"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "(0x066a|0x1236|0x200f)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0482"; + match "product" "0x0203"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0489"; + match "product" "(0xe000|0xe003)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "(0x0003|0x0032|0x505a)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a4"; + match "product" "0x0014"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "(0x4027|0x4068)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04ad"; + match "product" "(0x0301|0x0302|0x0303|0x0306)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b4"; + match "product" "0x1002"; + action "kldload ufm"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b7"; + match "product" "0x0531"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b8"; + match "product" "(0x0521|0x0522)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bf"; + match "product" "(0x0115|0x0117)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04c5"; + match "product" "(0x1058|0x1079)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "(0x2500|0x3900)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04dd"; + match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "(0x3008|0x3011|0x3012)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0502"; + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0506"; + match "product" "(0x03e8|0x11f8|0x4601)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0525"; + match "product" "(0x1080|0xa4a2)"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0536"; + match "product" "0x01a0"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0543"; + match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "(0x2008|0x2720)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x055d"; + match "product" "0x2018"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "(0x0001|0x0002|0x0003|0x0005)"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0567"; + match "product" "(0x2000|0x2002)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056c"; + match "product" "0x8007"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x057c"; + match "product" "(0x2200|0x3800)"; + action "kldload ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "(0xb000|0xb020)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x058f"; + match "product" "0x9720"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05a6"; + match "product" "0x0101"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; + action "kldload atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ad"; + match "product" "0x0fba"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05c6"; + match "product" "(0x6000|0x6613)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05cc"; + match "product" "0x3000"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05db"; + match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; + action "kldload uvscom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e0"; + match "product" "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e3"; + match "product" "0x0501"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e9"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x066b"; + match "product" "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0675"; + match "product" "0x0550"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x331a|0xaaa0|0xaaa2)"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067c"; + match "product" "0x1001"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067e"; + match "product" "0x1001"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0681"; + match "product" "0x3c06"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06e1"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "(0xe000|0xe010|0xe020|0xe030)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0707"; + match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0711"; + match "product" "(0x0200|0x0210|0x0230)"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0731"; + match "product" "(0x0528|0x2003)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0745"; + match "product" "(0x0001|0x1000)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0769"; + match "product" "(0x11f2|0x11f3|0x31f3)"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x077b"; + match "product" "0x2226"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x078b"; + match "product" "0x1234"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x079b"; + match "product" "(0x0027|0x004a|0x0062)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07a6"; + match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x0041|0x0042|0x9601)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07c9"; + match "product" "0xb100"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07cf"; + match "product" "(0x2001|0x2002|0x2003)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x081e"; + match "product" "0xdf00"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x082d"; + match "product" "(0x0100|0x0200|0x0300)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0830"; + match "product" "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0833"; + match "product" "(0x012e|0x039f)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0841"; + match "product" "0x0001"; + action "kldload urio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0856"; + match "product" "0xac01"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x085a"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x086e"; + match "product" "0x1920"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x087d"; + match "product" "0x5704"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08d1"; + match "product" "(0x0001|0x0003)"; + action "kldload if_cue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08dd"; + match "product" "(0x0986|0x0987|0x0988|0x8511|0x90ff)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08e6"; + match "product" "0x5501"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08fd"; + match "product" "0x000a"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0915"; + match "product" "(0x2000|0x2002)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x091e"; + match "product" "0x0004"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0921"; + match "product" "0x1001"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b|0x0a07|0x0d45|0x1302)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x093c"; + match "product" "(0x0601|0x0701)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x094b"; + match "product" "0x0001"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0951"; + match "product" "(0x0008|0x000a)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x095a"; + match "product" "0x3003"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0960"; + match "product" "(0x0065|0x0066|0x0067)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0961"; + match "product" "0x0010"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x099e"; + match "product" "(0x0052|0x4000)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x09aa"; + match "product" "0x1000"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x09d7"; + match "product" "0x0100"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a46"; + match "product" "(0x0268|0x8515|0x9601)"; + action "kldload if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a5c"; + match "product" "0x2033"; + action "kldload ubtbcmfw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0ace"; + match "product" "(0x1211|0x1215)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6911|0x6971|0x6971|0x7001|0x7011|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7251|0x7301|0x7361|0x7381|0x7401|0x7501|0x7601|0x7601|0xc031|0xd013|0xd031|0xd033|0xd033|0xd055|0xd055)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1706|0x1707|0x170c|0x171b|0x171d|0x1723|0x1724|0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; + action "kldload if_ural"; +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 21:39:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CFA106566B; Fri, 24 Jun 2011 21:39:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 050DC8FC17; Fri, 24 Jun 2011 21:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OLdd6l071307; Fri, 24 Jun 2011 21:39:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OLdctw071303; Fri, 24 Jun 2011 21:39:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106242139.p5OLdctw071303@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 21:39: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: r223520 - in head/sys: conf dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 21:39:39 -0000 Author: jhb Date: Fri Jun 24 21:39:38 2011 New Revision: 223520 URL: http://svn.freebsd.org/changeset/base/223520 Log: Split out host_pcib_get_busno() from the generic PCI-PCI bridge driver to start a new file that will hold utility APIs used by various Host-PCI bridge drivers and drivers that provide PCI domains. Added: head/sys/dev/pci/pci_subr.c - copied, changed from r223482, head/sys/dev/pci/pci_pci.c Modified: head/sys/conf/files head/sys/dev/pci/pci_pci.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 24 21:32:03 2011 (r223519) +++ head/sys/conf/files Fri Jun 24 21:39:38 2011 (r223520) @@ -1552,6 +1552,7 @@ dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci dev/pci/pci_if.m standard dev/pci/pci_pci.c optional pci +dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/vga_pci.c optional pci Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Fri Jun 24 21:32:03 2011 (r223519) +++ head/sys/dev/pci/pci_pci.c Fri Jun 24 21:39:38 2011 (r223520) @@ -38,16 +38,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include -#include -#include - #include #include #include @@ -1432,91 +1428,3 @@ pcib_power_for_sleep(device_t pcib, devi bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } - -/* - * Try to read the bus number of a host-PCI bridge using appropriate config - * registers. - */ -int -host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, - uint8_t *busnum) -{ - uint32_t id; - - id = read_config(bus, slot, func, PCIR_DEVVENDOR, 4); - if (id == 0xffffffff) - return (0); - - switch (id) { - case 0x12258086: - /* Intel 824?? */ - /* XXX This is a guess */ - /* *busnum = read_config(bus, slot, func, 0x41, 1); */ - *busnum = bus; - break; - case 0x84c48086: - /* Intel 82454KX/GX (Orion) */ - *busnum = read_config(bus, slot, func, 0x4a, 1); - break; - case 0x84ca8086: - /* - * For the 450nx chipset, there is a whole bundle of - * things pretending to be host bridges. The MIOC will - * be seen first and isn't really a pci bridge (the - * actual busses are attached to the PXB's). We need to - * read the registers of the MIOC to figure out the - * bus numbers for the PXB channels. - * - * Since the MIOC doesn't have a pci bus attached, we - * pretend it wasn't there. - */ - return (0); - case 0x84cb8086: - switch (slot) { - case 0x12: - /* Intel 82454NX PXB#0, Bus#A */ - *busnum = read_config(bus, 0x10, func, 0xd0, 1); - break; - case 0x13: - /* Intel 82454NX PXB#0, Bus#B */ - *busnum = read_config(bus, 0x10, func, 0xd1, 1) + 1; - break; - case 0x14: - /* Intel 82454NX PXB#1, Bus#A */ - *busnum = read_config(bus, 0x10, func, 0xd3, 1); - break; - case 0x15: - /* Intel 82454NX PXB#1, Bus#B */ - *busnum = read_config(bus, 0x10, func, 0xd4, 1) + 1; - break; - } - break; - - /* ServerWorks -- vendor 0x1166 */ - case 0x00051166: - case 0x00061166: - case 0x00081166: - case 0x00091166: - case 0x00101166: - case 0x00111166: - case 0x00171166: - case 0x01011166: - case 0x010f1014: - case 0x01101166: - case 0x02011166: - case 0x02251166: - case 0x03021014: - *busnum = read_config(bus, slot, func, 0x44, 1); - break; - - /* Compaq/HP -- vendor 0x0e11 */ - case 0x60100e11: - *busnum = read_config(bus, slot, func, 0xc8, 1); - break; - default: - /* Don't know how to read bus number. */ - return 0; - } - - return 1; -} Copied and modified: head/sys/dev/pci/pci_subr.c (from r223482, head/sys/dev/pci/pci_pci.c) ============================================================================== --- head/sys/dev/pci/pci_pci.c Thu Jun 23 17:42:27 2011 (r223482, copy source) +++ head/sys/dev/pci/pci_subr.c Fri Jun 24 21:39:38 2011 (r223520) @@ -1,7 +1,6 @@ /*- - * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier - * Copyright (c) 2000 Michael Smith - * Copyright (c) 2000 BSDi + * Copyright (c) 2011 Advanced Computing Technologies LLC + * Written by: John H. Baldwin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -12,8 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -32,1407 +29,18 @@ __FBSDID("$FreeBSD$"); /* - * PCI:PCI bridge support. + * Support APIs for Host to PCI bridge drivers and drivers that + * provide PCI domains. */ -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include - -#include #include -#include +#include #include -#include "pcib_if.h" - -static int pcib_probe(device_t dev); -static int pcib_suspend(device_t dev); -static int pcib_resume(device_t dev); -static int pcib_power_for_sleep(device_t pcib, device_t dev, - int *pstate); - -static device_method_t pcib_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, pcib_probe), - DEVMETHOD(device_attach, pcib_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, pcib_suspend), - DEVMETHOD(device_resume, pcib_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), -#ifdef NEW_PCIB - DEVMETHOD(bus_adjust_resource, pcib_adjust_resource), - DEVMETHOD(bus_release_resource, pcib_release_resource), -#else - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), - DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), - DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - - { 0, 0 } -}; - -static devclass_t pcib_devclass; - -DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc)); -DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0); - -#ifdef NEW_PCIB -/* - * XXX Todo: - * - properly handle the ISA enable bit. If it is set, we should change - * the behavior of the I/O window resource and rman to not allocate the - * blocked ranges (upper 768 bytes of each 1K in the first 64k of the - * I/O port address space). - */ - -/* - * Is a resource from a child device sub-allocated from one of our - * resource managers? - */ -static int -pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) -{ - - switch (type) { - case SYS_RES_IOPORT: - return (rman_is_region_manager(r, &sc->io.rman)); - case SYS_RES_MEMORY: - /* Prefetchable resources may live in either memory rman. */ - if (rman_get_flags(r) & RF_PREFETCHABLE && - rman_is_region_manager(r, &sc->pmem.rman)) - return (1); - return (rman_is_region_manager(r, &sc->mem.rman)); - } - return (0); -} - -static int -pcib_is_window_open(struct pcib_window *pw) -{ - - return (pw->valid && pw->base < pw->limit); -} - -/* - * XXX: If RF_ACTIVE did not also imply allocating a bus space tag and - * handle for the resource, we could pass RF_ACTIVE up to the PCI bus - * when allocating the resource windows and rely on the PCI bus driver - * to do this for us. - */ -static void -pcib_activate_window(struct pcib_softc *sc, int type) -{ - - PCI_ENABLE_IO(device_get_parent(sc->dev), sc->dev, type); -} - -static void -pcib_write_windows(struct pcib_softc *sc, int mask) -{ - device_t dev; - uint32_t val; - - dev = sc->dev; - if (sc->io.valid && mask & WIN_IO) { - val = pci_read_config(dev, PCIR_IOBASEL_1, 1); - if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) { - pci_write_config(dev, PCIR_IOBASEH_1, - sc->io.base >> 16, 2); - pci_write_config(dev, PCIR_IOLIMITH_1, - sc->io.limit >> 16, 2); - } - pci_write_config(dev, PCIR_IOBASEL_1, sc->io.base >> 8, 1); - pci_write_config(dev, PCIR_IOLIMITL_1, sc->io.limit >> 8, 1); - } - - if (mask & WIN_MEM) { - pci_write_config(dev, PCIR_MEMBASE_1, sc->mem.base >> 16, 2); - pci_write_config(dev, PCIR_MEMLIMIT_1, sc->mem.limit >> 16, 2); - } - - if (sc->pmem.valid && mask & WIN_PMEM) { - val = pci_read_config(dev, PCIR_PMBASEL_1, 2); - if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) { - pci_write_config(dev, PCIR_PMBASEH_1, - sc->pmem.base >> 32, 4); - pci_write_config(dev, PCIR_PMLIMITH_1, - sc->pmem.limit >> 32, 4); - } - pci_write_config(dev, PCIR_PMBASEL_1, sc->pmem.base >> 16, 2); - pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmem.limit >> 16, 2); - } -} - -static void -pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, - int flags, pci_addr_t max_address) -{ - char buf[64]; - int error, rid; - - if (max_address != (u_long)max_address) - max_address = ~0ul; - w->rman.rm_start = 0; - w->rman.rm_end = max_address; - w->rman.rm_type = RMAN_ARRAY; - snprintf(buf, sizeof(buf), "%s %s window", - device_get_nameunit(sc->dev), w->name); - w->rman.rm_descr = strdup(buf, M_DEVBUF); - error = rman_init(&w->rman); - if (error) - panic("Failed to initialize %s %s rman", - device_get_nameunit(sc->dev), w->name); - - if (!pcib_is_window_open(w)) - return; - - if (w->base > max_address || w->limit > max_address) { - device_printf(sc->dev, - "initial %s window has too many bits, ignoring\n", w->name); - return; - } - rid = w->reg; - w->res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, - w->limit - w->base + 1, flags); - if (w->res == NULL) { - device_printf(sc->dev, - "failed to allocate initial %s window: %#jx-%#jx\n", - w->name, (uintmax_t)w->base, (uintmax_t)w->limit); - w->base = max_address; - w->limit = 0; - pcib_write_windows(sc, w->mask); - return; - } - pcib_activate_window(sc, type); - - error = rman_manage_region(&w->rman, rman_get_start(w->res), - rman_get_end(w->res)); - if (error) - panic("Failed to initialize rman with resource"); -} - -/* - * Initialize I/O windows. - */ -static void -pcib_probe_windows(struct pcib_softc *sc) -{ - pci_addr_t max; - device_t dev; - uint32_t val; - - dev = sc->dev; - - /* Determine if the I/O port window is implemented. */ - val = pci_read_config(dev, PCIR_IOBASEL_1, 1); - if (val == 0) { - /* - * If 'val' is zero, then only 16-bits of I/O space - * are supported. - */ - pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); - if (pci_read_config(dev, PCIR_IOBASEL_1, 1) != 0) { - sc->io.valid = 1; - pci_write_config(dev, PCIR_IOBASEL_1, 0, 1); - } - } else - sc->io.valid = 1; - - /* Read the existing I/O port window. */ - if (sc->io.valid) { - sc->io.reg = PCIR_IOBASEL_1; - sc->io.step = 12; - sc->io.mask = WIN_IO; - sc->io.name = "I/O port"; - if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) { - sc->io.base = PCI_PPBIOBASE( - pci_read_config(dev, PCIR_IOBASEH_1, 2), val); - sc->io.limit = PCI_PPBIOLIMIT( - pci_read_config(dev, PCIR_IOLIMITH_1, 2), - pci_read_config(dev, PCIR_IOLIMITL_1, 1)); - max = 0xffffffff; - } else { - sc->io.base = PCI_PPBIOBASE(0, val); - sc->io.limit = PCI_PPBIOLIMIT(0, - pci_read_config(dev, PCIR_IOLIMITL_1, 1)); - max = 0xffff; - } - pcib_alloc_window(sc, &sc->io, SYS_RES_IOPORT, 0, max); - } - - /* Read the existing memory window. */ - sc->mem.valid = 1; - sc->mem.reg = PCIR_MEMBASE_1; - sc->mem.step = 20; - sc->mem.mask = WIN_MEM; - sc->mem.name = "memory"; - sc->mem.base = PCI_PPBMEMBASE(0, - pci_read_config(dev, PCIR_MEMBASE_1, 2)); - sc->mem.limit = PCI_PPBMEMLIMIT(0, - pci_read_config(dev, PCIR_MEMLIMIT_1, 2)); - pcib_alloc_window(sc, &sc->mem, SYS_RES_MEMORY, 0, 0xffffffff); - - /* Determine if the prefetchable memory window is implemented. */ - val = pci_read_config(dev, PCIR_PMBASEL_1, 2); - if (val == 0) { - /* - * If 'val' is zero, then only 32-bits of memory space - * are supported. - */ - pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); - if (pci_read_config(dev, PCIR_PMBASEL_1, 2) != 0) { - sc->pmem.valid = 1; - pci_write_config(dev, PCIR_PMBASEL_1, 0, 2); - } - } else - sc->pmem.valid = 1; - - /* Read the existing prefetchable memory window. */ - if (sc->pmem.valid) { - sc->pmem.reg = PCIR_PMBASEL_1; - sc->pmem.step = 20; - sc->pmem.mask = WIN_PMEM; - sc->pmem.name = "prefetch"; - if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) { - sc->pmem.base = PCI_PPBMEMBASE( - pci_read_config(dev, PCIR_PMBASEH_1, 4), val); - sc->pmem.limit = PCI_PPBMEMLIMIT( - pci_read_config(dev, PCIR_PMLIMITH_1, 4), - pci_read_config(dev, PCIR_PMLIMITL_1, 2)); - max = 0xffffffffffffffff; - } else { - sc->pmem.base = PCI_PPBMEMBASE(0, val); - sc->pmem.limit = PCI_PPBMEMLIMIT(0, - pci_read_config(dev, PCIR_PMLIMITL_1, 2)); - max = 0xffffffff; - } - pcib_alloc_window(sc, &sc->pmem, SYS_RES_MEMORY, - RF_PREFETCHABLE, max); - } -} - -#else - -/* - * Is the prefetch window open (eg, can we allocate memory in it?) - */ -static int -pcib_is_prefetch_open(struct pcib_softc *sc) -{ - return (sc->pmembase > 0 && sc->pmembase < sc->pmemlimit); -} - -/* - * Is the nonprefetch window open (eg, can we allocate memory in it?) - */ -static int -pcib_is_nonprefetch_open(struct pcib_softc *sc) -{ - return (sc->membase > 0 && sc->membase < sc->memlimit); -} - -/* - * Is the io window open (eg, can we allocate ports in it?) - */ -static int -pcib_is_io_open(struct pcib_softc *sc) -{ - return (sc->iobase > 0 && sc->iobase < sc->iolimit); -} - -/* - * Get current I/O decode. - */ -static void -pcib_get_io_decode(struct pcib_softc *sc) -{ - device_t dev; - uint32_t iolow; - - dev = sc->dev; - - iolow = pci_read_config(dev, PCIR_IOBASEL_1, 1); - if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) - sc->iobase = PCI_PPBIOBASE( - pci_read_config(dev, PCIR_IOBASEH_1, 2), iolow); - else - sc->iobase = PCI_PPBIOBASE(0, iolow); - - iolow = pci_read_config(dev, PCIR_IOLIMITL_1, 1); - if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) - sc->iolimit = PCI_PPBIOLIMIT( - pci_read_config(dev, PCIR_IOLIMITH_1, 2), iolow); - else - sc->iolimit = PCI_PPBIOLIMIT(0, iolow); -} - -/* - * Get current memory decode. - */ -static void -pcib_get_mem_decode(struct pcib_softc *sc) -{ - device_t dev; - pci_addr_t pmemlow; - - dev = sc->dev; - - sc->membase = PCI_PPBMEMBASE(0, - pci_read_config(dev, PCIR_MEMBASE_1, 2)); - sc->memlimit = PCI_PPBMEMLIMIT(0, - pci_read_config(dev, PCIR_MEMLIMIT_1, 2)); - - pmemlow = pci_read_config(dev, PCIR_PMBASEL_1, 2); - if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64) - sc->pmembase = PCI_PPBMEMBASE( - pci_read_config(dev, PCIR_PMBASEH_1, 4), pmemlow); - else - sc->pmembase = PCI_PPBMEMBASE(0, pmemlow); - - pmemlow = pci_read_config(dev, PCIR_PMLIMITL_1, 2); - if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64) - sc->pmemlimit = PCI_PPBMEMLIMIT( - pci_read_config(dev, PCIR_PMLIMITH_1, 4), pmemlow); - else - sc->pmemlimit = PCI_PPBMEMLIMIT(0, pmemlow); -} - -/* - * Restore previous I/O decode. - */ -static void -pcib_set_io_decode(struct pcib_softc *sc) -{ - device_t dev; - uint32_t iohi; - - dev = sc->dev; - - iohi = sc->iobase >> 16; - if (iohi > 0) - pci_write_config(dev, PCIR_IOBASEH_1, iohi, 2); - pci_write_config(dev, PCIR_IOBASEL_1, sc->iobase >> 8, 1); - - iohi = sc->iolimit >> 16; - if (iohi > 0) - pci_write_config(dev, PCIR_IOLIMITH_1, iohi, 2); - pci_write_config(dev, PCIR_IOLIMITL_1, sc->iolimit >> 8, 1); -} - -/* - * Restore previous memory decode. - */ -static void -pcib_set_mem_decode(struct pcib_softc *sc) -{ - device_t dev; - pci_addr_t pmemhi; - - dev = sc->dev; - - pci_write_config(dev, PCIR_MEMBASE_1, sc->membase >> 16, 2); - pci_write_config(dev, PCIR_MEMLIMIT_1, sc->memlimit >> 16, 2); - - pmemhi = sc->pmembase >> 32; - if (pmemhi > 0) - pci_write_config(dev, PCIR_PMBASEH_1, pmemhi, 4); - pci_write_config(dev, PCIR_PMBASEL_1, sc->pmembase >> 16, 2); - - pmemhi = sc->pmemlimit >> 32; - if (pmemhi > 0) - pci_write_config(dev, PCIR_PMLIMITH_1, pmemhi, 4); - pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmemlimit >> 16, 2); -} -#endif - -/* - * Get current bridge configuration. - */ -static void -pcib_cfg_save(struct pcib_softc *sc) -{ - device_t dev; - - dev = sc->dev; - - sc->command = pci_read_config(dev, PCIR_COMMAND, 2); - sc->pribus = pci_read_config(dev, PCIR_PRIBUS_1, 1); - sc->secbus = pci_read_config(dev, PCIR_SECBUS_1, 1); - sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); - sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2); - sc->seclat = pci_read_config(dev, PCIR_SECLAT_1, 1); -#ifndef NEW_PCIB - if (sc->command & PCIM_CMD_PORTEN) - pcib_get_io_decode(sc); - if (sc->command & PCIM_CMD_MEMEN) - pcib_get_mem_decode(sc); -#endif -} - -/* - * Restore previous bridge configuration. - */ -static void -pcib_cfg_restore(struct pcib_softc *sc) -{ - device_t dev; - - dev = sc->dev; - - pci_write_config(dev, PCIR_COMMAND, sc->command, 2); - pci_write_config(dev, PCIR_PRIBUS_1, sc->pribus, 1); - pci_write_config(dev, PCIR_SECBUS_1, sc->secbus, 1); - pci_write_config(dev, PCIR_SUBBUS_1, sc->subbus, 1); - pci_write_config(dev, PCIR_BRIDGECTL_1, sc->bridgectl, 2); - pci_write_config(dev, PCIR_SECLAT_1, sc->seclat, 1); -#ifdef NEW_PCIB - pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM); -#else - if (sc->command & PCIM_CMD_PORTEN) - pcib_set_io_decode(sc); - if (sc->command & PCIM_CMD_MEMEN) - pcib_set_mem_decode(sc); -#endif -} - -/* - * Generic device interface - */ -static int -pcib_probe(device_t dev) -{ - if ((pci_get_class(dev) == PCIC_BRIDGE) && - (pci_get_subclass(dev) == PCIS_BRIDGE_PCI)) { - device_set_desc(dev, "PCI-PCI bridge"); - return(-10000); - } - return(ENXIO); -} - -void -pcib_attach_common(device_t dev) -{ - struct pcib_softc *sc; - struct sysctl_ctx_list *sctx; - struct sysctl_oid *soid; - - sc = device_get_softc(dev); - sc->dev = dev; - - /* - * Get current bridge configuration. - */ - sc->domain = pci_get_domain(dev); - sc->secstat = pci_read_config(dev, PCIR_SECSTAT_1, 2); - pcib_cfg_save(sc); - - /* - * Setup sysctl reporting nodes - */ - sctx = device_get_sysctl_ctx(dev); - soid = device_get_sysctl_tree(dev); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "domain", - CTLFLAG_RD, &sc->domain, 0, "Domain number"); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "pribus", - CTLFLAG_RD, &sc->pribus, 0, "Primary bus number"); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "secbus", - CTLFLAG_RD, &sc->secbus, 0, "Secondary bus number"); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "subbus", - CTLFLAG_RD, &sc->subbus, 0, "Subordinate bus number"); - - /* - * Quirk handling. - */ - switch (pci_get_devid(dev)) { - case 0x12258086: /* Intel 82454KX/GX (Orion) */ - { - uint8_t supbus; - - supbus = pci_read_config(dev, 0x41, 1); - if (supbus != 0xff) { - sc->secbus = supbus + 1; - sc->subbus = supbus + 1; - } - break; - } - - /* - * The i82380FB mobile docking controller is a PCI-PCI bridge, - * and it is a subtractive bridge. However, the ProgIf is wrong - * so the normal setting of PCIB_SUBTRACTIVE bit doesn't - * happen. There's also a Toshiba bridge that behaves this - * way. - */ - case 0x124b8086: /* Intel 82380FB Mobile */ - case 0x060513d7: /* Toshiba ???? */ - sc->flags |= PCIB_SUBTRACTIVE; - break; - - /* Compaq R3000 BIOS sets wrong subordinate bus number. */ - case 0x00dd10de: - { - char *cp; - - if ((cp = getenv("smbios.planar.maker")) == NULL) - break; - if (strncmp(cp, "Compal", 6) != 0) { - freeenv(cp); - break; - } - freeenv(cp); - if ((cp = getenv("smbios.planar.product")) == NULL) - break; - if (strncmp(cp, "08A0", 4) != 0) { - freeenv(cp); - break; - } - freeenv(cp); - if (sc->subbus < 0xa) { - pci_write_config(dev, PCIR_SUBBUS_1, 0xa, 1); - sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); - } - break; - } - } - - if (pci_msi_device_blacklisted(dev)) - sc->flags |= PCIB_DISABLE_MSI; - - /* - * Intel 815, 845 and other chipsets say they are PCI-PCI bridges, - * but have a ProgIF of 0x80. The 82801 family (AA, AB, BAM/CAM, - * BA/CA/DB and E) PCI bridges are HUB-PCI bridges, in Intelese. - * This means they act as if they were subtractively decoding - * bridges and pass all transactions. Mark them and real ProgIf 1 - * parts as subtractive. - */ - if ((pci_get_devid(dev) & 0xff00ffff) == 0x24008086 || - pci_read_config(dev, PCIR_PROGIF, 1) == PCIP_BRIDGE_PCI_SUBTRACTIVE) - sc->flags |= PCIB_SUBTRACTIVE; - -#ifdef NEW_PCIB - pcib_probe_windows(sc); -#endif - if (bootverbose) { - device_printf(dev, " domain %d\n", sc->domain); - device_printf(dev, " secondary bus %d\n", sc->secbus); - device_printf(dev, " subordinate bus %d\n", sc->subbus); -#ifdef NEW_PCIB - if (pcib_is_window_open(&sc->io)) - device_printf(dev, " I/O decode 0x%jx-0x%jx\n", - (uintmax_t)sc->io.base, (uintmax_t)sc->io.limit); - if (pcib_is_window_open(&sc->mem)) - device_printf(dev, " memory decode 0x%jx-0x%jx\n", - (uintmax_t)sc->mem.base, (uintmax_t)sc->mem.limit); - if (pcib_is_window_open(&sc->pmem)) - device_printf(dev, " prefetched decode 0x%jx-0x%jx\n", - (uintmax_t)sc->pmem.base, (uintmax_t)sc->pmem.limit); -#else - if (pcib_is_io_open(sc)) - device_printf(dev, " I/O decode 0x%x-0x%x\n", - sc->iobase, sc->iolimit); - if (pcib_is_nonprefetch_open(sc)) - device_printf(dev, " memory decode 0x%jx-0x%jx\n", - (uintmax_t)sc->membase, (uintmax_t)sc->memlimit); - if (pcib_is_prefetch_open(sc)) - device_printf(dev, " prefetched decode 0x%jx-0x%jx\n", - (uintmax_t)sc->pmembase, (uintmax_t)sc->pmemlimit); -#endif - else - device_printf(dev, " no prefetched decode\n"); - if (sc->flags & PCIB_SUBTRACTIVE) - device_printf(dev, " Subtractively decoded bridge.\n"); - } - - /* - * XXX If the secondary bus number is zero, we should assign a bus number - * since the BIOS hasn't, then initialise the bridge. A simple - * bus_alloc_resource with the a couple of busses seems like the right - * approach, but we don't know what busses the BIOS might have already - * assigned to other bridges on this bus that probe later than we do. - * - * If the subordinate bus number is less than the secondary bus number, - * we should pick a better value. One sensible alternative would be to - * pick 255; the only tradeoff here is that configuration transactions - * would be more widely routed than absolutely necessary. We could - * then do a walk of the tree later and fix it. - */ -} - -int -pcib_attach(device_t dev) -{ - struct pcib_softc *sc; - device_t child; - - pcib_attach_common(dev); - sc = device_get_softc(dev); - if (sc->secbus != 0) { - child = device_add_child(dev, "pci", sc->secbus); - if (child != NULL) - return(bus_generic_attach(dev)); - } - - /* no secondary bus; we should have fixed this */ - return(0); -} - -int -pcib_suspend(device_t dev) -{ - device_t pcib; - int dstate, error; - - pcib_cfg_save(device_get_softc(dev)); - error = bus_generic_suspend(dev); - if (error == 0 && pci_do_power_suspend) { - dstate = PCI_POWERSTATE_D3; - pcib = device_get_parent(device_get_parent(dev)); - if (PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) - pci_set_powerstate(dev, dstate); - } - return (error); -} - -int -pcib_resume(device_t dev) -{ - device_t pcib; - - if (pci_do_power_resume) { - pcib = device_get_parent(device_get_parent(dev)); - if (PCIB_POWER_FOR_SLEEP(pcib, dev, NULL) == 0) - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } - pcib_cfg_restore(device_get_softc(dev)); - return (bus_generic_resume(dev)); -} - -int -pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct pcib_softc *sc = device_get_softc(dev); - - switch (which) { - case PCIB_IVAR_DOMAIN: - *result = sc->domain; - return(0); - case PCIB_IVAR_BUS: - *result = sc->secbus; - return(0); - } - return(ENOENT); -} - -int -pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - struct pcib_softc *sc = device_get_softc(dev); - - switch (which) { - case PCIB_IVAR_DOMAIN: - return(EINVAL); - case PCIB_IVAR_BUS: - sc->secbus = value; - return(0); - } - return(ENOENT); -} - -#ifdef NEW_PCIB -static const char * -pcib_child_name(device_t child) -{ - static char buf[64]; - - if (device_get_nameunit(child) != NULL) - return (device_get_nameunit(child)); - snprintf(buf, sizeof(buf), "pci%d:%d:%d:%d", pci_get_domain(child), - pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); - return (buf); -} - -/* - * Attempt to allocate a resource from the existing resources assigned - * to a window. - */ -static struct resource * -pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, - device_t child, int type, int *rid, u_long start, u_long end, u_long count, - u_int flags) -{ - struct resource *res; - - if (!pcib_is_window_open(w)) - return (NULL); - - res = rman_reserve_resource(&w->rman, start, end, count, - flags & ~RF_ACTIVE, child); - if (res == NULL) - return (NULL); - - if (bootverbose) - device_printf(sc->dev, - "allocated %s range (%#lx-%#lx) for rid %x of %s\n", - w->name, rman_get_start(res), rman_get_end(res), *rid, - pcib_child_name(child)); - rman_set_rid(res, *rid); - - /* - * If the resource should be active, pass that request up the - * tree. This assumes the parent drivers can handle - * activating sub-allocated resources. - */ - if (flags & RF_ACTIVE) { - if (bus_activate_resource(child, type, *rid, res) != 0) { - rman_release_resource(res); - return (NULL); - } - } - - return (res); -} - -/* - * Attempt to grow a window to make room for a given resource request. - * The 'step' parameter is log_2 of the desired I/O window's alignment. - */ -static int -pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, - u_long start, u_long end, u_long count, u_int flags) -{ - u_long align, start_free, end_free, front, back; - int error, rid; - - /* - * Clamp the desired resource range to the maximum address - * this window supports. Reject impossible requests. - */ - if (!w->valid) - return (EINVAL); - if (end > w->rman.rm_end) - end = w->rman.rm_end; - if (start + count - 1 > end || start + count < start) - return (EINVAL); - - /* - * If there is no resource at all, just try to allocate enough - * aligned space for this resource. - */ - if (w->res == NULL) { - if (RF_ALIGNMENT(flags) < w->step) { - flags &= ~RF_ALIGNMENT_MASK; - flags |= RF_ALIGNMENT_LOG2(w->step); - } - start &= ~((1ul << w->step) - 1); - end |= ((1ul << w->step) - 1); - count = roundup2(count, 1ul << w->step); - rid = w->reg; - w->res = bus_alloc_resource(sc->dev, type, &rid, start, end, - count, flags & ~RF_ACTIVE); - if (w->res == NULL) { - if (bootverbose) - device_printf(sc->dev, - "failed to allocate initial %s window (%#lx-%#lx,%#lx)\n", - w->name, start, end, count); - return (ENXIO); - } - if (bootverbose) - device_printf(sc->dev, - "allocated initial %s window of %#lx-%#lx\n", - w->name, rman_get_start(w->res), - rman_get_end(w->res)); - error = rman_manage_region(&w->rman, rman_get_start(w->res), - rman_get_end(w->res)); - if (error) { - if (bootverbose) - device_printf(sc->dev, - "failed to add initial %s window to rman\n", - w->name); - bus_release_resource(sc->dev, type, w->reg, w->res); - w->res = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 22:01:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1261065673; Fri, 24 Jun 2011 22:01:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E1E558FC14; Fri, 24 Jun 2011 22:01:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OM1uhU072098; Fri, 24 Jun 2011 22:01:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OM1uK3072093; Fri, 24 Jun 2011 22:01:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106242201.p5OM1uK3072093@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 22:01: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: r223521 - in head: etc/devd 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: Fri, 24 Jun 2011 22:01:57 -0000 Author: hselasky Date: Fri Jun 24 22:01:56 2011 New Revision: 223521 URL: http://svn.freebsd.org/changeset/base/223521 Log: - Export more USB device ID's. - Update bus_auto.conf accordingly. MFC after: 3 days Modified: head/etc/devd/bus_auto.conf head/sys/dev/usb/input/uep.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c Modified: head/etc/devd/bus_auto.conf ============================================================================== --- head/etc/devd/bus_auto.conf Fri Jun 24 21:39:38 2011 (r223520) +++ head/etc/devd/bus_auto.conf Fri Jun 24 22:01:56 2011 (r223521) @@ -86,6 +86,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0123"; + match "product" "0x0001"; + action "kldload uep"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x03e8"; match "product" "0x0008"; action "kldload if_kue"; @@ -1254,6 +1262,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0eef"; + match "product" "(0x0001|0x0002)"; + action "kldload uep"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0f3d"; match "product" "(0x0112|0x0112)"; action "kldload u3g"; @@ -2263,6 +2279,24 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload ukbd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x02"; + action "kldload ums"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x07"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -2343,5 +2377,5 @@ nomatch 32 { action "kldload umass"; }; -# 1626 usb_host entries processed +# 1631 usb_host entries processed Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Fri Jun 24 21:39:38 2011 (r223520) +++ head/sys/dev/usb/input/uep.c Fri Jun 24 22:01:56 2011 (r223521) @@ -288,6 +288,12 @@ static const struct usb_config uep_confi }, }; +static const STRUCT_USB_HOST_ID uep_devs[] = { + {USB_VPI(USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL, 0)}, + {USB_VPI(USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL2, 0)}, + {USB_VPI(USB_VENDOR_EGALAX2, USB_PRODUCT_EGALAX2_TPANEL, 0)}, +}; + static int uep_probe(device_t dev) { @@ -295,17 +301,12 @@ uep_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); - if ((uaa->info.idVendor == USB_VENDOR_EGALAX) && - ((uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL) || - (uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL2))) - return (BUS_PROBE_SPECIFIC); - - if ((uaa->info.idVendor == USB_VENDOR_EGALAX2) && - (uaa->info.idProduct == USB_PRODUCT_EGALAX2_TPANEL)) - return (BUS_PROBE_SPECIFIC); - - return (ENXIO); + return (usbd_lookup_id_by_uaa(uep_devs, sizeof(uep_devs), uaa)); } static int Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Fri Jun 24 21:39:38 2011 (r223520) +++ head/sys/dev/usb/input/ukbd.c Fri Jun 24 22:01:56 2011 (r223521) @@ -745,6 +745,13 @@ static const struct usb_config ukbd_conf }, }; +/* A match on these entries will load ukbd */ +static const STRUCT_USB_HOST_ID __used ukbd_devs[] = { + {USB_IFACE_CLASS(UICLASS_HID), + USB_IFACE_SUBCLASS(UISUBCLASS_BOOT), + USB_IFACE_PROTOCOL(UIPROTO_BOOT_KEYBOARD),}, +}; + static int ukbd_probe(device_t dev) { Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Fri Jun 24 21:39:38 2011 (r223520) +++ head/sys/dev/usb/input/ums.c Fri Jun 24 22:01:56 2011 (r223521) @@ -355,6 +355,13 @@ static const struct usb_config ums_confi }, }; +/* A match on these entries will load ums */ +static const STRUCT_USB_HOST_ID __used ums_devs[] = { + {USB_IFACE_CLASS(UICLASS_HID), + USB_IFACE_SUBCLASS(UISUBCLASS_BOOT), + USB_IFACE_PROTOCOL(UIPROTO_MOUSE),}, +}; + static int ums_probe(device_t dev) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 22:08:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E31B106566C; Fri, 24 Jun 2011 22:08:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED1C8FC14; Fri, 24 Jun 2011 22:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OM8R97072295; Fri, 24 Jun 2011 22:08:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OM8R4G072293; Fri, 24 Jun 2011 22:08:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106242208.p5OM8R4G072293@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 24 Jun 2011 22:08: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: r223522 - 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: Fri, 24 Jun 2011 22:08:27 -0000 Author: jilles Date: Fri Jun 24 22:08:26 2011 New Revision: 223522 URL: http://svn.freebsd.org/changeset/base/223522 Log: sh(1): Improve documentation of shell patterns: * Shell patterns are also for ${var#pat} and the like. * An '!' by itself will not trigger pathname generation so do not call it a meta-character, even though it has a special meaning directly after an '['. * Character ranges are locale-dependent. * A '^' will complement a character class like '!' but is non-standard. MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Jun 24 22:01:56 2011 (r223521) +++ head/bin/sh/sh.1 Fri Jun 24 22:08:26 2011 (r223522) @@ -1629,15 +1629,15 @@ There are two restrictions on this: firs a string containing a slash, and second, a pattern cannot match a string starting with a period unless the first character of the pattern is a period. -The next section describes the patterns used for both -Pathname Expansion and the +The next section describes the patterns used for +Pathname Expansion, +the four varieties of parameter expansion for substring processing and the .Ic case command. .Ss Shell Patterns A pattern consists of normal characters, which match themselves, and meta-characters. The meta-characters are -.Ql \&! , .Ql * , .Ql \&? , and @@ -1667,7 +1667,7 @@ matches a .Ql \&[ rather than introducing a character class. A character class matches any of the characters between the square brackets. -A range of characters may be specified using a minus sign. +A locale-dependent range of characters may be specified using a minus sign. A named class of characters (see .Xr wctype 3 ) may be specified by surrounding the name with @@ -1680,12 +1680,17 @@ is a shell pattern that matches a single The character class may be complemented by making an exclamation point .Pq Ql !\& the first character of the character class. +A caret +.Pq Ql ^ +has the same effect but is non-standard. .Pp To include a .Ql \&] in a character class, make it the first character listed (after the -.Ql \&! , +.Ql \&! +or +.Ql ^ , if any). To include a .Ql - , From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 22:24:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A7CF106564A; Fri, 24 Jun 2011 22:24:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 54DD88FC0A; Fri, 24 Jun 2011 22:24:02 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=EIZfbDsN8gr1c4B7uGrP4foh/gtfZ6zZRee2cLtKwTU= c=1 sm=1 a=IhcFkomVjv8A:10 a=UfveDn5EhV4A:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=nU1rKr9x6RWyZzmRpIQA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 145020702; Sat, 25 Jun 2011 00:24:01 +0200 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Sat, 25 Jun 2011 00:22:23 +0200 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.4.5; amd64; ; ) References: <201106242127.p5OLRXZa070898@svn.freebsd.org> In-Reply-To: <201106242127.p5OLRXZa070898@svn.freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106250022.23422.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r223518 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Jun 2011 22:24:04 -0000 On Friday 24 June 2011 23:27:33 Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jun 24 21:27:33 2011 > New Revision: 223518 > URL: http://svn.freebsd.org/changeset/base/223518 > > Log: > - We need to sort all USB device ID's together. Else the matching order > will be wrong. This is required because devd only executes one entry. > > MFC after: 14 days > > Modified: > head/tools/tools/bus_autoconf/bus_autoconf.c > head/tools/tools/bus_autoconf/bus_autoconf.h > head/tools/tools/bus_autoconf/bus_autoconf.sh NOTE: This tool only works correctly when the tool and kernel is built on a 64-bit host. This is due to a long in one of the structures. This will be fixed tomorrow. --HPS From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 23:26:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9303F106566B; Fri, 24 Jun 2011 23:26:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83CFC8FC0C; Fri, 24 Jun 2011 23:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ONQjWs074556; Fri, 24 Jun 2011 23:26:45 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ONQjfV074554; Fri, 24 Jun 2011 23:26:45 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201106242326.p5ONQjfV074554@svn.freebsd.org> From: Olivier Houchard Date: Fri, 24 Jun 2011 23:26: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: r223523 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 23:26:45 -0000 Author: cognet Date: Fri Jun 24 23:26:45 2011 New Revision: 223523 URL: http://svn.freebsd.org/changeset/base/223523 Log: Comment out AH_DEBUG, to get this kernel to compile, until AH_DEBUG is fixed. Modified: head/sys/arm/conf/CAMBRIA Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Fri Jun 24 22:08:26 2011 (r223522) +++ head/sys/arm/conf/CAMBRIA Fri Jun 24 23:26:45 2011 (r223523) @@ -130,7 +130,7 @@ options ATH_DIAGAPI #options ATH_TX99_DIAG device ath_rate_sample # SampleRate tx rate control for ath -options AH_DEBUG +#options AH_DEBUG #options AH_ASSERT options AH_PRIVATE_DIAG #device ath_ar5210 From owner-svn-src-head@FreeBSD.ORG Fri Jun 24 23:59:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E61106566C; Fri, 24 Jun 2011 23:59:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33A928FC08; Fri, 24 Jun 2011 23:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ONxFHs075498; Fri, 24 Jun 2011 23:59:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ONxFUv075496; Fri, 24 Jun 2011 23:59:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106242359.p5ONxFUv075496@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 23:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223524 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 23:59:15 -0000 Author: adrian Date: Fri Jun 24 23:59:14 2011 New Revision: 223524 URL: http://svn.freebsd.org/changeset/base/223524 Log: Small fix to bring the non-debug definitions of HALDEBUG/HALDEBUG_G in line with the debug definitions. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Jun 24 23:26:45 2011 (r223523) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Jun 24 23:59:14 2011 (r223524) @@ -528,8 +528,8 @@ extern int ath_hal_debug; /* Global debu extern void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) __printflike(3,4); #else -#define HALDEBUG(_ah, __m, _fmt, ...) -#define HALDEBUG_G(_ah, __m, _fmt, ...) +#define HALDEBUG(_ah, __m, ...) +#define HALDEBUG_G(_ah, __m, ...) #endif /* AH_DEBUG */ /* From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 00:34:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26867106566C; Sat, 25 Jun 2011 00:34:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 174298FC12; Sat, 25 Jun 2011 00:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5P0Yeok076559; Sat, 25 Jun 2011 00:34:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5P0YegK076557; Sat, 25 Jun 2011 00:34:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106250034.p5P0YegK076557@svn.freebsd.org> From: Adrian Chadd Date: Sat, 25 Jun 2011 00:34: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: r223525 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 00:34:41 -0000 Author: adrian Date: Sat Jun 25 00:34:40 2011 New Revision: 223525 URL: http://svn.freebsd.org/changeset/base/223525 Log: Commit missing piece from a couple days ago - re-add ath_hal_debug. Modified: head/sys/dev/ath/ah_osdep.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Fri Jun 24 23:59:14 2011 (r223524) +++ head/sys/dev/ath/ah_osdep.c Sat Jun 25 00:34:40 2011 (r223525) @@ -76,6 +76,14 @@ extern void DO_HALDEBUG(struct ath_hal * /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); +SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); + +#ifdef AH_DEBUG +int ath_hal_debug = 0; +SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, + 0, "Atheros HAL debugging printfs"); +TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); +#endif /* AH_DEBUG */ MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); @@ -147,8 +155,6 @@ DO_HALDEBUG(struct ath_hal *ah, u_int ma #include #include -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); - static struct alq *ath_hal_alq; static int ath_hal_alq_emitdev; /* need to emit DEVICE record */ static u_int ath_hal_alq_lost; /* count of lost records */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 02:15:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0454106566C; Sat, 25 Jun 2011 02:15:14 +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 AF11F8FC0A; Sat, 25 Jun 2011 02:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5P2FES9079365; Sat, 25 Jun 2011 02:15:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5P2FERg079356; Sat, 25 Jun 2011 02:15:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106250215.p5P2FERg079356@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 02:15: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: r223526 - in head/sys: conf ia64/ia64 ia64/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: Sat, 25 Jun 2011 02:15:14 -0000 Author: marcel Date: Sat Jun 25 02:15:14 2011 New Revision: 223526 URL: http://svn.freebsd.org/changeset/base/223526 Log: Switch to the event timers infrastructure. This includes: o Setting td_intr_frame to the XIVs trap frame because it's referenced by the ET event handler. o Signal EOI to the CPU before calling the registered XIV handlers. This prevents lost ITC interrupts, which cause starvation in one-shot mode. o Adding support for IPI_HARDCLOCK with corresponding per-CPU counters. o Have the APs call cpu_initclocks() so as to limited the scattering of clock related initialization. cpu_initclocks() calls the _bsp() or _ap() version accordingly. o Uncomment the ET clock handling in cpu_idle(). o Update the DDB 'show pcpu' output for the new MD fields. o Entirely rewritten ia64_ih_clock(). Note that we don't create as many clock XIVs as we have CPUs, as is done on PowerPC. It doesn't scale. We can only have 240 XIVs and we can have more CPUs than that. There's a single intrcnt index for the cumulative clock ticks and we keep per CPU counts in the PCPU stats structure. o Register the ITC by hooking SI_SUB_CONFIGURE (2nd order). Open issues: o Clock interrupts can still be lost. Some tweaking is still necessary. Thanks to: mav@ for his support, feedback and explanations. ET stats while committing: eris% sysctl machdep.cpu | grep nclks machdep.cpu.0.nclks: 24007 machdep.cpu.1.nclks: 22895 machdep.cpu.2.nclks: 13523 machdep.cpu.3.nclks: 9342 machdep.cpu.4.nclks: 9103 machdep.cpu.5.nclks: 9298 machdep.cpu.6.nclks: 10039 machdep.cpu.7.nclks: 9479 eris% vmstat -i | grep clock clock 108599 50 Modified: head/sys/conf/files.ia64 head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/db_machdep.c head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/include/pcpu.h head/sys/ia64/include/smp.h Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/conf/files.ia64 Sat Jun 25 02:15:14 2011 (r223526) @@ -120,6 +120,7 @@ ia64/pci/pci_cfgreg.c optional pci isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_elf32.c optional compat_freebsd32 +kern/kern_clocksource.c standard libkern/bcmp.c standard libkern/ffsl.c standard libkern/fls.c standard Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/ia64/clock.c Sat Jun 25 02:15:14 2011 (r223526) @@ -32,9 +32,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -45,26 +47,12 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); - -static int adjust_edges = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_edges, CTLFLAG_RD, - &adjust_edges, 0, "Number of times ITC got more than 12.5% behind"); - -static int adjust_excess = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_excess, CTLFLAG_RD, - &adjust_excess, 0, "Total number of ignored ITC interrupts"); - -static int adjust_lost = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_lost, CTLFLAG_RD, - &adjust_lost, 0, "Total number of lost ITC interrupts"); - -static int adjust_ticks = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_ticks, CTLFLAG_RD, - &adjust_ticks, 0, "Total number of ITC interrupts with adjustment"); +#define CLOCK_ET_OFF 0 +#define CLOCK_ET_PERIODIC 1 +#define CLOCK_ET_ONESHOT 2 +static struct eventtimer ia64_clock_et; static u_int ia64_clock_xiv; -static uint64_t ia64_clock_reload; #ifndef SMP static timecounter_get_t ia64_get_timecount; @@ -87,75 +75,100 @@ ia64_get_timecount(struct timecounter* t static u_int ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) { - uint64_t adj, clk, itc; - int64_t delta; - int count; + struct eventtimer *et; + uint64_t itc, load; + uint32_t mode; PCPU_INC(md.stats.pcs_nclks); + intrcnt[INTRCNT_CLOCK]++; - if (PCPU_GET(cpuid) == 0) { - /* - * Clock processing on the BSP. - */ - intrcnt[INTRCNT_CLOCK]++; - - itc = ia64_get_itc(); - - adj = PCPU_GET(md.clockadj); - clk = PCPU_GET(md.clock); - - delta = itc - clk; - count = 0; - while (delta >= ia64_clock_reload) { -#ifdef SMP - ipi_all_but_self(ia64_clock_xiv); -#endif - hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - statclock(TRAPF_USERMODE(tf)); - delta -= ia64_clock_reload; - clk += ia64_clock_reload; - if (adj != 0) - adjust_ticks++; - count++; - } - ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj); - ia64_srlz_d(); - if (count > 0) { - adjust_lost += count - 1; - if (delta > (ia64_clock_reload >> 3)) { - if (adj == 0) - adjust_edges++; - adj = ia64_clock_reload >> 4; - } else - adj = 0; - } else { - adj = 0; - adjust_excess++; - } - PCPU_SET(md.clock, clk); - PCPU_SET(md.clockadj, adj); + itc = ia64_get_itc(); + PCPU_SET(md.clock, itc); + + mode = PCPU_GET(md.clock_mode); + if (mode == CLOCK_ET_PERIODIC) { + load = PCPU_GET(md.clock_load); + ia64_set_itm(itc + load); + } else + ia64_set_itv((1 << 16) | xiv); + ia64_srlz_d(); + + et = &ia64_clock_et; + if (et->et_active) + et->et_event_cb(et, et->et_arg); + return (0); +} + +/* + * Event timer start method. + */ +static int +ia64_clock_start(struct eventtimer *et, struct bintime *first, + struct bintime *period) +{ + u_long itc, load; + register_t is; + + if (period != NULL) { + PCPU_SET(md.clock_mode, CLOCK_ET_PERIODIC); + load = (et->et_frequency * (period->frac >> 32)) >> 32; + if (period->sec > 0) + load += et->et_frequency * period->sec; } else { - /* - * Clock processing on the BSP. - */ - hardclock_cpu(TRAPF_USERMODE(tf)); - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - statclock(TRAPF_USERMODE(tf)); + PCPU_SET(md.clock_mode, CLOCK_ET_ONESHOT); + load = 0; } + PCPU_SET(md.clock_load, load); + + if (first != NULL) { + load = (et->et_frequency * (first->frac >> 32)) >> 32; + if (first->sec > 0) + load += et->et_frequency * first->sec; + } + + is = intr_disable(); + itc = ia64_get_itc(); + ia64_set_itm(itc + load); + ia64_set_itv(ia64_clock_xiv); + ia64_srlz_d(); + intr_restore(is); + return (0); +} + +/* + * Event timer stop method. + */ +static int +ia64_clock_stop(struct eventtimer *et) +{ + + ia64_set_itv((1 << 16) | ia64_clock_xiv); + ia64_srlz_d(); + PCPU_SET(md.clock_mode, CLOCK_ET_OFF); + PCPU_SET(md.clock_load, 0); return (0); } /* - * Start the real-time and statistics clocks. We use ar.itc and cr.itm - * to implement a 1000hz clock. + * We call cpu_initclocks() on the APs as well. It allows us to + * group common initialization in the same function. */ void cpu_initclocks() { + + ia64_clock_stop(NULL); + if (PCPU_GET(cpuid) == 0) + cpu_initclocks_bsp(); + else + cpu_initclocks_ap(); +} + +static void +clock_configure(void *dummy) +{ + struct eventtimer *et; u_long itc_freq; ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI, @@ -165,31 +178,23 @@ cpu_initclocks() itc_freq = (u_long)ia64_itc_freq() * 1000000ul; - stathz = hz; - ia64_clock_reload = (itc_freq + hz/2) / hz; + et = &ia64_clock_et; + et->et_name = "ITC"; + et->et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + et->et_quality = 1000; + et->et_frequency = itc_freq; + et->et_min_period.sec = 0; + et->et_min_period.frac = ((1ul << 32) / itc_freq) << 32; + et->et_max_period.sec = 0xfffffff0 / itc_freq; + et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; + et->et_start = ia64_clock_start; + et->et_stop = ia64_clock_stop; + et->et_priv = NULL; + et_register(et); #ifndef SMP ia64_timecounter.tc_frequency = itc_freq; tc_init(&ia64_timecounter); #endif - - PCPU_SET(md.clockadj, 0); - PCPU_SET(md.clock, ia64_get_itc()); - ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); - ia64_set_itv(ia64_clock_xiv); - ia64_srlz_d(); -} - -void -cpu_startprofclock(void) -{ - - /* nothing to do */ -} - -void -cpu_stopprofclock(void) -{ - - /* nothing to do */ } +SYSINIT(clkcfg, SI_SUB_CONFIGURE, SI_ORDER_SECOND, clock_configure, NULL); Modified: head/sys/ia64/ia64/db_machdep.c ============================================================================== --- head/sys/ia64/ia64/db_machdep.c Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/ia64/db_machdep.c Sat Jun 25 02:15:14 2011 (r223526) @@ -578,11 +578,13 @@ db_show_mdpcpu(struct pcpu *pc) { struct pcpu_md *md = &pc->pc_md; - db_printf("MD: vhpt = %#lx\n", md->vhpt); - db_printf("MD: lid = %#lx\n", md->lid); - db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); - db_printf("MD: stats = %p\n", &md->stats); - db_printf("MD: pmap = %p\n", md->current_pmap); + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx\n", md->clock); + db_printf("MD: clock_mode = %u\n", md->clock_mode); + db_printf("MD: clock_load = %#lx\n", md->clock_load); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/ia64/interrupt.c Sat Jun 25 02:15:14 2011 (r223526) @@ -309,6 +309,7 @@ void ia64_handle_intr(struct trapframe *tf) { struct thread *td; + struct trapframe *stf; u_int xiv; td = curthread; @@ -323,17 +324,20 @@ ia64_handle_intr(struct trapframe *tf) } critical_enter(); + stf = td->td_intr_frame; + td->td_intr_frame = tf; do { + ia64_set_eoi(0); + ia64_srlz_d(); CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", (u_int)tf->tf_special.ifa, xiv); (ia64_handler[xiv])(td, xiv, tf); - ia64_set_eoi(0); - ia64_srlz_d(); xiv = ia64_get_ivr(); ia64_srlz_d(); } while (xiv != 15); + td->td_intr_frame = stf; critical_exit(); out: Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/ia64/machdep.c Sat Jun 25 02:15:14 2011 (r223526) @@ -347,6 +347,11 @@ cpu_startup(void *dummy) SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nhardclocks", CTLFLAG_RD, &pcs->pcs_nhardclocks, + "Number of IPI_HARDCLOCK interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nhighfps", CTLFLAG_RD, &pcs->pcs_nhighfps, "Number of IPI_HIGH_FP interrupts"); @@ -416,12 +421,10 @@ cpu_idle(int busy) { register_t ie; -#if 0 if (!busy) { critical_enter(); cpu_idleclock(); } -#endif ie = intr_disable(); KASSERT(ie != 0, ("%s called with interrupts disabled\n", __func__)); @@ -436,12 +439,10 @@ cpu_idle(int busy) ia64_enable_intr(); } -#if 0 if (!busy) { cpu_activeclock(); critical_exit(); } -#endif } int Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/ia64/mp_machdep.c Sat Jun 25 02:15:14 2011 (r223526) @@ -77,6 +77,7 @@ void ia64_ap_startup(void); struct ia64_ap_state ia64_ap_state; int ia64_ipi_ast; +int ia64_ipi_hardclock; int ia64_ipi_highfp; int ia64_ipi_nmi; int ia64_ipi_preempt; @@ -108,6 +109,16 @@ ia64_ih_ast(struct thread *td, u_int xiv } static u_int +ia64_ih_hardclock(struct thread *td, u_int xiv, struct trapframe *tf) +{ + + PCPU_INC(md.stats.pcs_nhardclocks); + CTR1(KTR_SMP, "IPI_HARDCLOCK, cpuid=%d", PCPU_GET(cpuid)); + hardclockintr(); + return (0); +} + +static u_int ia64_ih_highfp(struct thread *td, u_int xiv, struct trapframe *tf) { @@ -233,10 +244,11 @@ ia64_ap_startup(void) CTR1(KTR_SMP, "SMP: cpu%d launched", PCPU_GET(cpuid)); - /* Mask interval timer interrupts on APs. */ - ia64_set_itv(0x10000); + cpu_initclocks(); + ia64_set_tpr(0); ia64_srlz_d(); + ia64_enable_intr(); sched_throw(NULL); @@ -413,6 +425,8 @@ cpu_mp_unleash(void *dummy) /* Allocate XIVs for IPIs */ ia64_ipi_ast = ia64_xiv_alloc(PI_DULL, IA64_XIV_IPI, ia64_ih_ast); + ia64_ipi_hardclock = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI, + ia64_ih_hardclock); ia64_ipi_highfp = ia64_xiv_alloc(PI_AV, IA64_XIV_IPI, ia64_ih_highfp); ia64_ipi_preempt = ia64_xiv_alloc(PI_SOFT, IA64_XIV_IPI, ia64_ih_preempt); Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/include/pcpu.h Sat Jun 25 02:15:14 2011 (r223526) @@ -37,6 +37,7 @@ struct pcpu_stats { u_long pcs_nasts; /* IPI_AST counter. */ u_long pcs_nclks; /* Clock interrupt counter. */ u_long pcs_nextints; /* ExtINT counter. */ + u_long pcs_nhardclocks; /* IPI_HARDCLOCK counter. */ u_long pcs_nhighfps; /* IPI_HIGH_FP counter. */ u_long pcs_nhwints; /* Hardware int. counter. */ u_long pcs_npreempts; /* IPI_PREEMPT counter. */ @@ -51,7 +52,8 @@ struct pcpu_md { vm_offset_t vhpt; /* Address of VHPT */ uint64_t lid; /* local CPU ID */ uint64_t clock; /* Clock counter. */ - uint64_t clockadj; /* Clock adjust. */ + uint64_t clock_load; /* Clock reload value. */ + uint32_t clock_mode; /* Clock ET mode */ uint32_t awake:1; /* CPU is awake? */ struct pcpu_stats stats; /* Interrupt stats. */ #ifdef _KERNEL Modified: head/sys/ia64/include/smp.h ============================================================================== --- head/sys/ia64/include/smp.h Sat Jun 25 00:34:40 2011 (r223525) +++ head/sys/ia64/include/smp.h Sat Jun 25 02:15:14 2011 (r223526) @@ -7,6 +7,7 @@ #ifdef _KERNEL #define IPI_AST ia64_ipi_ast +#define IPI_HARDCLOCK ia64_ipi_hardclock #define IPI_PREEMPT ia64_ipi_preempt #define IPI_RENDEZVOUS ia64_ipi_rndzvs #define IPI_STOP ia64_ipi_stop @@ -37,6 +38,7 @@ struct ia64_ap_state { }; extern int ia64_ipi_ast; +extern int ia64_ipi_hardclock; extern int ia64_ipi_highfp; extern int ia64_ipi_nmi; extern int ia64_ipi_preempt; From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 02:49:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E1C106564A; Sat, 25 Jun 2011 02:49:47 +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 946948FC0A; Sat, 25 Jun 2011 02:49:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5P2nl5V080371; Sat, 25 Jun 2011 02:49:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5P2nliI080369; Sat, 25 Jun 2011 02:49:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106250249.p5P2nliI080369@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 02:49: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: r223527 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 02:49:47 -0000 Author: marcel Date: Sat Jun 25 02:49:47 2011 New Revision: 223527 URL: http://svn.freebsd.org/changeset/base/223527 Log: Now that ia64 has been switched to the event timers, remove the conditional compilation work-arounds. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jun 25 02:15:14 2011 (r223526) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jun 25 02:49:47 2011 (r223527) @@ -856,10 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; -#ifndef __ia64__ else cpu_can_deep_sleep = 1; -#endif } sbuf_trim(&sb); sbuf_finish(&sb); @@ -929,11 +927,9 @@ acpi_cpu_idle() /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; -#ifndef __ia64__ if (cpu_disable_deep_sleep) i = min(sc->cpu_cx_lowest, sc->cpu_non_c3); else -#endif i = sc->cpu_cx_lowest; for (; i >= 0; i--) { if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 03:37:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9011065672; Sat, 25 Jun 2011 03:37:40 +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 6DEAE8FC19; Sat, 25 Jun 2011 03:37:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5P3beRS082087; Sat, 25 Jun 2011 03:37:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5P3beUB082085; Sat, 25 Jun 2011 03:37:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106250337.p5P3beUB082085@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 03:37: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: r223528 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 03:37:40 -0000 Author: marcel Date: Sat Jun 25 03:37:40 2011 New Revision: 223528 URL: http://svn.freebsd.org/changeset/base/223528 Log: Update copyright. Modified: head/sys/ia64/ia64/clock.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sat Jun 25 02:49:47 2011 (r223527) +++ head/sys/ia64/ia64/clock.c Sat Jun 25 03:37:40 2011 (r223528) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Marcel Moolenaar + * Copyright (c) 2005, 2009-2011 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 03:43:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B75C91065670; Sat, 25 Jun 2011 03:43:58 +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 A75378FC12; Sat, 25 Jun 2011 03:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5P3hw2k082297; Sat, 25 Jun 2011 03:43:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5P3hwAA082295; Sat, 25 Jun 2011 03:43:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106250343.p5P3hwAA082295@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 03:43: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: r223529 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 03:43:58 -0000 Author: marcel Date: Sat Jun 25 03:43:58 2011 New Revision: 223529 URL: http://svn.freebsd.org/changeset/base/223529 Log: Replace the original copyright notice with my own. Everything in this file is written by me and has no bearing on the initial or original version. Modified: head/sys/ia64/ia64/interrupt.c Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sat Jun 25 03:37:40 2011 (r223528) +++ head/sys/ia64/ia64/interrupt.c Sat Jun 25 03:43:58 2011 (r223529) @@ -1,41 +1,33 @@ -/* $FreeBSD$ */ -/* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */ - /*- - * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * Copyright (c) 2010-2011 Marcel Moolenaar * All rights reserved. * - * Authors: Keith Bostic, Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 + * 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. * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ -/*- - * Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center. - * Redistribute and modify at will, leaving only this additional copyright - * notice. + * 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 "opt_ddb.h" -#include /* RCS ID & Copyright macro defns */ +#include +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 10:01:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 162341065675; Sat, 25 Jun 2011 10:01:44 +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 0709C8FC18; Sat, 25 Jun 2011 10:01:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PA1h1w092971; Sat, 25 Jun 2011 10:01:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PA1hcK092969; Sat, 25 Jun 2011 10:01:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106251001.p5PA1hcK092969@svn.freebsd.org> From: Andriy Gapon Date: Sat, 25 Jun 2011 10:01: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: r223530 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 10:01:44 -0000 Author: avg Date: Sat Jun 25 10:01:43 2011 New Revision: 223530 URL: http://svn.freebsd.org/changeset/base/223530 Log: generic_stop_cpus: pull timeout logic from under DIAGNOSTIC ... and also increase the timeout. It's better to try to proceed somehow despite stuck CPUs than to hang indefinitely. Especially so during shutdown and when entering kdb or panic. Timeout value is still an aribitrary value. Timeout diagnostic is just a printf; the work on something more debuggable is planned by attilio. Need to be careful here as stop_cpus_hard is called very early while enetering kdb and soon(-ish) it may become called very early when entering panic. Reviewed by: attilio MFC after: 2 months Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat Jun 25 03:43:58 2011 (r223529) +++ head/sys/kern/subr_smp.c Sat Jun 25 10:01:43 2011 (r223530) @@ -236,12 +236,10 @@ generic_stop_cpus(cpuset_t map, u_int ty /* spin */ cpu_spinwait(); i++; -#ifdef DIAGNOSTIC - if (i == 100000) { + if (i == 100000000) { printf("timeout stopping cpus\n"); break; } -#endif } stopping_cpu = NOCPU; From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 10:28:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 806A51065670; Sat, 25 Jun 2011 10:28:17 +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 5804A8FC0A; Sat, 25 Jun 2011 10:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PASH4T093703; Sat, 25 Jun 2011 10:28:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PASHbS093701; Sat, 25 Jun 2011 10:28:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106251028.p5PASHbS093701@svn.freebsd.org> From: Andriy Gapon Date: Sat, 25 Jun 2011 10:28: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: r223531 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 10:28:17 -0000 Author: avg Date: Sat Jun 25 10:28:16 2011 New Revision: 223531 URL: http://svn.freebsd.org/changeset/base/223531 Log: unconditionally stop other cpus when entering kdb in smp system ... and thus retire debug.kdb.stop_cpus tunable/sysctl. The knob was to work around CPU stopping issues, which since have been either fixed or greatly reduced. kdb should really operate in a special environment with scheduler stopped and interrupts disabled to provide deterministic debugging. Discussed with: attilio, rwatson X-MFC after: 2 months or never Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Sat Jun 25 10:01:43 2011 (r223530) +++ head/sys/kern/subr_kdb.c Sat Jun 25 10:28:16 2011 (r223531) @@ -88,20 +88,6 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_c kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); /* - * Flag indicating whether or not to IPI the other CPUs to stop them on - * entering the debugger. Sometimes, this will result in a deadlock as - * stop_cpus() waits for the other cpus to stop, so we allow it to be - * disabled. In order to maximize the chances of success, use a hard - * stop for that. - */ -#ifdef SMP -static int kdb_stop_cpus = 1; -SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN, - &kdb_stop_cpus, 0, "stop other CPUs when entering the debugger"); -TUNABLE_INT("debug.kdb.stop_cpus", &kdb_stop_cpus); -#endif - -/* * Flag to indicate to debuggers why the debugger was entered. */ const char * volatile kdb_why = KDB_WHY_UNSET; @@ -515,9 +501,6 @@ kdb_trap(int type, int code, struct trap { struct kdb_dbbe *be; register_t intr; -#ifdef SMP - int did_stop_cpus; -#endif int handled; be = kdb_dbbe; @@ -531,8 +514,7 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); #ifdef SMP - if ((did_stop_cpus = kdb_stop_cpus) != 0) - stop_cpus_hard(PCPU_GET(other_cpus)); + stop_cpus_hard(PCPU_GET(other_cpus)); #endif kdb_active++; @@ -558,8 +540,7 @@ kdb_trap(int type, int code, struct trap kdb_active--; #ifdef SMP - if (did_stop_cpus) - restart_cpus(stopped_cpus); + restart_cpus(stopped_cpus); #endif intr_restore(intr); From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 11:21:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34949106566B; Sat, 25 Jun 2011 11:21:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 252A08FC08; Sat, 25 Jun 2011 11:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PBLO6F004769; Sat, 25 Jun 2011 11:21:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PBLO7D004767; Sat, 25 Jun 2011 11:21:24 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201106251121.p5PBLO7D004767@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 25 Jun 2011 11:21: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: r223532 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 11:21:24 -0000 Author: pluknet Date: Sat Jun 25 11:21:23 2011 New Revision: 223532 URL: http://svn.freebsd.org/changeset/base/223532 Log: Add missing libkvm and libutil dependencies. Now libprocstat takes care of its own dependencies and does not require applications to specify them. Reviewed by: stas, jilles Modified: head/lib/libprocstat/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Sat Jun 25 10:28:16 2011 (r223531) +++ head/lib/libprocstat/Makefile Sat Jun 25 11:21:23 2011 (r223532) @@ -19,6 +19,8 @@ INCS= libprocstat.h CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 WITHOUT_MAN= yes +DPADD= ${LIBKVM} ${LIBUTIL} +LDADD= -lkvm -lutil .if ${MK_NCP} != "no" CFLAGS+= -DLIBPROCSTAT_NWFS From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 12:37:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A13C8106566B; Sat, 25 Jun 2011 12:37:06 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91C358FC0C; Sat, 25 Jun 2011 12:37:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PCb6TN006944; Sat, 25 Jun 2011 12:37:06 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PCb6Rv006942; Sat, 25 Jun 2011 12:37:06 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201106251237.p5PCb6Rv006942@svn.freebsd.org> From: Jonathan Anderson Date: Sat, 25 Jun 2011 12:37: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: r223533 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 12:37:06 -0000 Author: jonathan Date: Sat Jun 25 12:37:06 2011 New Revision: 223533 URL: http://svn.freebsd.org/changeset/base/223533 Log: Remove redundant Capsicum sysctl. Since we're now declaring FEATURE(security_capabilities), there's no need for an explicit SYSCTL_NODE. Approved by: rwatson Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat Jun 25 11:21:23 2011 (r223532) +++ head/sys/kern/sys_capability.c Sat Jun 25 12:37:06 2011 (r223533) @@ -64,13 +64,6 @@ __FBSDID("$FreeBSD$"); FEATURE(security_capabilities, "Capsicum Capability Mode"); /* - * We don't currently have any MIB entries for sysctls, but we do expose - * security.capabilities so that it's easy to tell if options CAPABILITIES is - * compiled into the kernel. - */ -SYSCTL_NODE(_security, OID_AUTO, capabilities, CTLFLAG_RW, 0, "Capsicum"); - -/* * System call to enter capability mode for the process. */ int From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 13:44:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13EF2106564A; Sat, 25 Jun 2011 13:44:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 031198FC14; Sat, 25 Jun 2011 13:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PDi5T1008839; Sat, 25 Jun 2011 13:44:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PDi5BV008829; Sat, 25 Jun 2011 13:44:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251344.p5PDi5BV008829@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 13:44: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: r223534 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 13:44:06 -0000 Author: hselasky Date: Sat Jun 25 13:44:05 2011 New Revision: 223534 URL: http://svn.freebsd.org/changeset/base/223534 Log: - Improve bus_autoconf tool. - Implement simple and generic language which can be used to describe any kind of device ID structures. - Fix endian issues. - Add an example format file. Suggested by: imp @ MFC after: 14 days Added: head/tools/tools/bus_autoconf/bus_autoconf_format_example.txt (contents, props changed) head/tools/tools/bus_autoconf/bus_load_file.c (contents, props changed) head/tools/tools/bus_autoconf/bus_load_file.h (contents, props changed) head/tools/tools/bus_autoconf/bus_sections.c (contents, props changed) head/tools/tools/bus_autoconf/bus_sections.h (contents, props changed) head/tools/tools/bus_autoconf/bus_usb.c (contents, props changed) head/tools/tools/bus_autoconf/bus_usb.h (contents, props changed) Modified: head/tools/tools/bus_autoconf/Makefile head/tools/tools/bus_autoconf/bus_autoconf.c head/tools/tools/bus_autoconf/bus_autoconf.h head/tools/tools/bus_autoconf/bus_autoconf.sh Modified: head/tools/tools/bus_autoconf/Makefile ============================================================================== --- head/tools/tools/bus_autoconf/Makefile Sat Jun 25 12:37:06 2011 (r223533) +++ head/tools/tools/bus_autoconf/Makefile Sat Jun 25 13:44:05 2011 (r223534) @@ -36,7 +36,10 @@ PROG= bus_autoconf MAN= BINDIR?= /usr/local/bin -SRCS= bus_autoconf.c +SRCS+= bus_autoconf.c +SRCS+= bus_load_file.c +SRCS+= bus_sections.c +SRCS+= bus_usb.c WARNS= 6 Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Sat Jun 25 12:37:06 2011 (r223533) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Sat Jun 25 13:44:05 2011 (r223534) @@ -33,306 +33,23 @@ #include #include #include -#include -#include -#include -#include #include +#include +#include +#include #include "bus_autoconf.h" - -static char *type; -static char *file_name; -static const char *mode; - -struct usb_info; -static void usb_dump_sub(struct usb_device_id *, struct usb_info *); - -/* - * To ensure that the correct USB driver is loaded, the driver having - * the most information about the device must be probed first. Then - * more generic drivers shall be probed. - */ -static int -usb_compare(const void *_a, const void *_b) -{ - const struct usb_device_id *a = _a; - const struct usb_device_id *b = _b; - - /* vendor matches first */ - - if (a->match_flag_vendor > b->match_flag_vendor) - return (-1); - if (a->match_flag_vendor < b->match_flag_vendor) - return (1); - - /* product matches first */ - - if (a->match_flag_product > b->match_flag_product) - return (-1); - if (a->match_flag_product < b->match_flag_product) - return (1); - - /* device class matches first */ - - if (a->match_flag_dev_class > b->match_flag_dev_class) - return (-1); - if (a->match_flag_dev_class < b->match_flag_dev_class) - return (1); - - if (a->match_flag_dev_subclass > b->match_flag_dev_subclass) - return (-1); - if (a->match_flag_dev_subclass < b->match_flag_dev_subclass) - return (1); - - /* interface class matches first */ - - if (a->match_flag_int_class > b->match_flag_int_class) - return (-1); - if (a->match_flag_int_class < b->match_flag_int_class) - return (1); - - if (a->match_flag_int_subclass > b->match_flag_int_subclass) - return (-1); - if (a->match_flag_int_subclass < b->match_flag_int_subclass) - return (1); - - if (a->match_flag_int_protocol > b->match_flag_int_protocol) - return (-1); - if (a->match_flag_int_protocol < b->match_flag_int_protocol) - return (1); - - /* then sort according to value */ - - if (a->idVendor > b->idVendor) - return (1); - if (a->idVendor < b->idVendor) - return (-1); - if (a->idProduct > b->idProduct) - return (1); - if (a->idProduct < b->idProduct) - return (-1); - if (a->bDeviceClass > b->bDeviceClass) - return (1); - if (a->bDeviceClass < b->bDeviceClass) - return (-1); - if (a->bDeviceSubClass > b->bDeviceSubClass) - return (1); - if (a->bDeviceSubClass < b->bDeviceSubClass) - return (-1); - if (a->bDeviceProtocol > b->bDeviceProtocol) - return (1); - if (a->bDeviceProtocol < b->bDeviceProtocol) - return (-1); - if (a->bInterfaceClass > b->bInterfaceClass) - return (1); - if (a->bInterfaceClass < b->bInterfaceClass) - return (-1); - if (a->bInterfaceSubClass > b->bInterfaceSubClass) - return (1); - if (a->bInterfaceSubClass < b->bInterfaceSubClass) - return (-1); - if (a->bInterfaceProtocol > b->bInterfaceProtocol) - return (1); - if (a->bInterfaceProtocol < b->bInterfaceProtocol) - return (-1); - - /* in the end sort by module name */ - - return (strcmp(a->module_name, b->module_name)); -} - -static void -usb_sort(struct usb_device_id *id, uint32_t nid) -{ - qsort(id, nid, sizeof(*id), &usb_compare); -} - -struct usb_info { - uint8_t is_iface; - uint8_t is_any; - uint8_t is_vp; - uint8_t is_dev; -}; - -static void -usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) -{ -#if USB_HAVE_COMPAT_LINUX - if (id->match_flags != 0) { - if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) - id->match_flag_vendor = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) - id->match_flag_product = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) - id->match_flag_dev_lo = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) - id->match_flag_dev_hi = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) - id->match_flag_dev_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) - id->match_flag_dev_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) - id->match_flag_dev_protocol = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) - id->match_flag_int_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) - id->match_flag_int_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) - id->match_flag_int_protocol = 1; - id->match_flags = 0; - } -#endif - if (pinfo != NULL) { - - pinfo->is_iface = id->match_flag_int_class | - id->match_flag_int_protocol | - id->match_flag_int_subclass; - - pinfo->is_dev = id->match_flag_dev_class | - id->match_flag_dev_subclass; - - pinfo->is_vp = id->match_flag_vendor | - id->match_flag_product; - - pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; - } -} - -static char * -usb_trim(char *ptr) -{ - char *end; - - end = strchr(ptr, ' '); - if (end) - *end = 0; - return (ptr); -} - -static uint32_t -usb_dump(struct usb_device_id *id, uint32_t nid) -{ - uint32_t n = 1; - struct usb_info info; - - usb_dump_sub(id, &info); - - if (info.is_any) { - printf("nomatch 32 {\n" - " match \"bus\" \"uhub[0-9]+\";\n" - " match \"mode\" \"%s\";\n", mode); - } else { - return (n); - } - - if (id->match_flag_vendor) { - printf(" match \"vendor\" \"0x%04x\";\n", - id->idVendor); - } - if (id->match_flag_product) { - uint32_t x; - - if (info.is_any == 1 && info.is_vp == 1) { - /* try to join similar entries */ - while (n < nid) { - usb_dump_sub(id + n, &info); - - if (info.is_any != 1 || info.is_vp != 1) - break; - if (id[n].idVendor != id[0].idVendor) - break; - n++; - } - /* restore infos */ - usb_dump_sub(id, &info); - } - if (n == 1) { - printf(" match \"product\" \"0x%04x\";\n", - id->idProduct); - } else { - printf(" match \"product\" \"("); - - for (x = 0; x != n; x++) { - printf("0x%04x%s", id[x].idProduct, - (x == (n - 1)) ? "" : "|"); - } - - printf(")\";\n"); - } - } - if (id->match_flag_dev_class) { - printf(" match \"devclass\" \"0x%02x\";\n", - id->bDeviceClass); - } - if (id->match_flag_dev_subclass) { - printf(" match \"devsubclass\" \"0x%02x\";\n", - id->bDeviceSubClass); - } - if (id->match_flag_int_class) { - printf(" match \"intclass\" \"0x%02x\";\n", - id->bInterfaceClass); - } - if (id->match_flag_int_subclass) { - printf(" match \"intsubclass\" \"0x%02x\";\n", - id->bInterfaceSubClass); - } - if (id->match_flag_int_protocol) { - printf(" match \"intprotocol\" \"0x%02x\";\n", - id->bInterfaceProtocol); - } - printf(" action \"kldload %s\";\n" - "};\n\n", usb_trim(id->module_name)); - - return (n); -} - -static void -usb_parse_and_dump(int f, off_t size) -{ - struct usb_device_id *id; - uint32_t nid; - uint32_t x; - - if (size % sizeof(struct usb_device_id)) { - errx(EX_NOINPUT, "Size is not divisible by %d", - (int)sizeof(struct usb_device_id)); - } - lseek(f, 0, SEEK_SET); - - id = malloc(size); - if (id == NULL) { - errx(EX_SOFTWARE, "Out of memory"); - } - if (read(f, id, size) != size) { - err(EX_NOINPUT, "Cannot read all data"); - } - nid = size / sizeof(*id); - - for (x = 0; x != nid; x++) { - /* make sure flag bits are correct */ - usb_dump_sub(id + x, NULL); - /* zero terminate string */ - id[x].module_name[sizeof(id[0].module_name) - 1] = 0; - } - - usb_sort(id, nid); - - for (x = 0; x != nid;) - x += usb_dump(id + x, nid - x); - - free(id); - - printf("# %d %s entries processed\n\n", (int)nid, type); -} +#include "bus_sections.h" +#include "bus_load_file.h" +#include "bus_usb.h" static void usage(void) { fprintf(stderr, "bus_autoconf - devd config file generator\n" - " -i \n" - " -t \n" + " -i \n" + " -F \n" " -h show usage\n" ); exit(EX_USAGE); @@ -341,50 +58,68 @@ usage(void) int main(int argc, char **argv) { - const char *params = "i:ht:"; + const char *params = "i:F:h"; + char *fname; + char *section; + char *module; + char *postfix; + uint8_t *ptr; + uint32_t len; int c; - int f; - off_t off; + int any_opt = 0; while ((c = getopt(argc, argv, params)) != -1) { switch (c) { case 'i': - file_name = optarg; + fname = optarg; + load_file(fname, &ptr, &len); + + module = strchr(fname, ','); + if (module == NULL) { + errx(EX_USAGE, "Invalid input " + "file name '%s'", fname); + } + /* split module and section */ + *module++ = 0; + + /* remove postfix */ + postfix = strchr(module, '.'); + if (postfix) + *postfix = 0; + + /* get section name */ + section = fname; + + /* check section type */ + if (strncmp(section, "usb_", 4) == 0) + usb_import_entries(section, module, ptr, len); + else + errx(EX_USAGE, "Invalid section '%s'", section); + + free(ptr); + + any_opt = 1; break; - case 't': - type = optarg; + + case 'F': + fname = optarg; + load_file(fname, &ptr, &len); + format_parse_entries(ptr, len); + free(ptr); + + any_opt = 1; break; + default: usage(); break; } } - if (type == NULL || file_name == NULL) + if (any_opt == 0) usage(); - f = open(file_name, O_RDONLY); - if (f < 0) - err(EX_NOINPUT, "Cannot open file '%s'", file_name); - - off = lseek(f, 0, SEEK_END); - if (off <= 0) - err(EX_NOINPUT, "Cannot seek to end of file"); - - if (strcmp(type, "usb_host") == 0) { - mode = "host"; - usb_parse_and_dump(f, off); - } else if (strcmp(type, "usb_device") == 0) { - mode = "device"; - usb_parse_and_dump(f, off); - } else if (strcmp(type, "usb_dual") == 0) { - mode = "(host|device)"; - usb_parse_and_dump(f, off); - } else { - err(EX_USAGE, "Unsupported structure type: %s", type); - } - - close(f); + usb_dump_entries(); return (0); } Modified: head/tools/tools/bus_autoconf/bus_autoconf.h ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.h Sat Jun 25 12:37:06 2011 (r223533) +++ head/tools/tools/bus_autoconf/bus_autoconf.h Sat Jun 25 13:44:05 2011 (r223534) @@ -28,59 +28,4 @@ #ifndef _BUS_AUTOCONF_H_ #define _BUS_AUTOCONF_H_ -/* Make sure we get the have compat linux definition. */ -#include - -struct usb_device_id { - - /* Internal field */ - char module_name[32]; - - /* Hook for driver specific information */ - unsigned long driver_info; - - /* Used for product specific matches; the BCD range is inclusive */ - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice_lo; - uint16_t bcdDevice_hi; - - /* Used for device class matches */ - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - - /* Used for interface class matches */ - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - - /* Select which fields to match against */ - uint8_t match_flag_vendor:1; - uint8_t match_flag_product:1; - uint8_t match_flag_dev_lo:1; - uint8_t match_flag_dev_hi:1; - uint8_t match_flag_dev_class:1; - uint8_t match_flag_dev_subclass:1; - uint8_t match_flag_dev_protocol:1; - uint8_t match_flag_int_class:1; - uint8_t match_flag_int_subclass:1; - uint8_t match_flag_int_protocol:1; - -#if USB_HAVE_COMPAT_LINUX - /* which fields to match against */ - uint16_t match_flags; -#define USB_DEVICE_ID_MATCH_VENDOR 0x0001 -#define USB_DEVICE_ID_MATCH_PRODUCT 0x0002 -#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004 -#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008 -#define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010 -#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020 -#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040 -#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080 -#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 -#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 -#endif -}; - #endif /* _BUS_AUTOCONF_H_ */ Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.sh Sat Jun 25 12:37:06 2011 (r223533) +++ head/tools/tools/bus_autoconf/bus_autoconf.sh Sat Jun 25 13:44:05 2011 (r223534) @@ -29,30 +29,6 @@ OS=FreeBSD DOLLAR=$ -cleanup() -{ - # Cleanup - rm -f usb_dual.ids - rm -f usb_host.ids - rm -f usb_device.ids -} - -usb_format() -{ - [ -f ${1} ] || return - - # Split into one and one record - split -b 32 ${1} ${1}. - - # Prefix each record by the module name - for G in $(ls ${1}.*) - do - printf "%-32s" ${3} >> ${2} - cat ${G} >> ${2} - rm -f ${G} - done -} - cat < /dev/null -usb_format temp.ids usb_host.ids ${H} - -# USB Device -objcopy -j usb_device_id -O binary ${F} temp.ids 2> /dev/null -usb_format temp.ids usb_device.ids ${H} +# Format information +objcopy -j bus_autoconf_format -O binary ${F} temp.ids 2> /dev/null +[ -f temp.ids ] && cat temp.ids >> bus_autoconf_format.bin + +# USB Host mode +objcopy -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null +[ -f "usb_host_id,${G}" ] && (echo -n " -i usb_host_id,${G}" >> bus_autoconf_args.txt) + +# USB Device mode +objcopy -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null +[ -f "usb_device_id,${G}" ] && (echo -n " -i usb_device_id,${G}" >> bus_autoconf_args.txt) # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} temp.ids 2> /dev/null -usb_format temp.ids usb_dual.ids ${H} +objcopy -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null +[ -f "usb_dual_id,${G}" ] && (echo -n " -i usb_dual_id,${G}" >> bus_autoconf_args.txt) done # Dump all data -[ -f usb_dual.ids ] && bus_autoconf -i usb_dual.ids -t usb_dual -[ -f usb_host.ids ] && bus_autoconf -i usb_host.ids -t usb_host -[ -f usb_device.ids ] && bus_autoconf -i usb_device.ids -t usb_device +bus_autoconf -F bus_autoconf_format.bin $(cat bus_autoconf_args.txt) # Cleanup -cleanup +rm -f -- bus_autoconf_format.bin $(cat bus_autoconf_args.txt) Added: head/tools/tools/bus_autoconf/bus_autoconf_format_example.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_autoconf_format_example.txt Sat Jun 25 13:44:05 2011 (r223534) @@ -0,0 +1,111 @@ +/* $FreeBSD$ */ + +#if BYTE_ORDER == BIG_ENDIAN +#define U16_XOR "8" +#define U32_XOR "12" +#define U64_XOR "56" +#define U8_BITFIELD_XOR "7" +#define U16_BITFIELD_XOR "15" +#define U32_BITFIELD_XOR "31" +#define U64_BITFIELD_XOR "63" +#else +#define U16_XOR "0" +#define U32_XOR "0" +#define U64_XOR "0" +#define U8_BITFIELD_XOR "0" +#define U16_BITFIELD_XOR "0" +#define U32_BITFIELD_XOR "0" +#define U64_BITFIELD_XOR "0" +#endif + +#if USB_HAVE_COMPAT_LINUX +#define MFL_SIZE "1" +#else +#define MFL_SIZE "0" +#endif + +static const char __section("bus_autoconf_format") __used usb_id_format[] = { + + /* + * Declare three different sections that use the same format. + * All sizes are in bits. Fields cannot be greater than + * 8 bits in size. Bitfields having a size greater than 1 + * must fit within the byte in which the bitfield is defined. + */ + + "usb_host_id{256,:}" + "usb_device_id{256,:}" + "usb_dual_id{256,:}" + + /* + * Describe all fields in the usb_device_id structure + * which is found in sys/dev/usb/usbdi.h. + */ + +#if BITS_PER_LONG == 32 || BITS_PER_LONG == 64 + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#if BITS_PER_LONG == 64 + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#endif +#else +#error "Please update code." +#endif + + "idVendor[0]{" U16_XOR ",8}" + "idVendor[1]{" U16_XOR ",8}" + "idProduct[0]{" U16_XOR ",8}" + "idProduct[1]{" U16_XOR ",8}" + "bcdDevice_lo[0]{" U16_XOR ",8}" + "bcdDevice_lo[1]{" U16_XOR ",8}" + "bcdDevice_hi[0]{" U16_XOR ",8}" + "bcdDevice_hi[1]{" U16_XOR ",8}" + + "bDeviceClass{0,8}" + "bDeviceSubClass{0,8}" + "bDeviceProtocol{0,8}" + "bInterfaceClass{0,8}" + "bInterfaceSubClass{0,8}" + "bInterfaceProtocol{0,8}" + +/* NOTE: On big endian machines bitfields are bitreversed. */ + + "mf_vendor{" U8_BITFIELD_XOR ",1}" + "mf_product{" U8_BITFIELD_XOR ",1}" + "mf_dev_lo{" U8_BITFIELD_XOR ",1}" + "mf_dev_hi{" U8_BITFIELD_XOR ",1}" + + "mf_dev_class{" U8_BITFIELD_XOR ",1}" + "mf_dev_subclass{" U8_BITFIELD_XOR ",1}" + "mf_dev_protocol{" U8_BITFIELD_XOR ",1}" + "mf_int_class{" U8_BITFIELD_XOR ",1}" + + "mf_int_subclass{" U8_BITFIELD_XOR ",1}" + "mf_int_protocol{" U8_BITFIELD_XOR ",1}" + "unused{" U8_BITFIELD_XOR ",6}" + + "mfl_vendor{" U16_XOR "," MFL_SIZE "}" + "mfl_product{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_lo{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_hi{" U16_XOR "," MFL_SIZE "}" + + "mfl_dev_class{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_protocol{" U16_XOR "," MFL_SIZE "}" + "mfl_int_class{" U16_XOR "," MFL_SIZE "}" + + "mfl_int_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_int_protocol{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" +}; Added: head/tools/tools/bus_autoconf/bus_load_file.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_load_file.c Sat Jun 25 13:44:05 2011 (r223534) @@ -0,0 +1,72 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "bus_load_file.h" + +void +load_file(const char *fname, uint8_t **pptr, uint32_t *plen) +{ + uint8_t *ptr; + uint32_t len; + off_t off; + int f; + + f = open(fname, O_RDONLY); + if (f < 0) + err(EX_NOINPUT, "Cannot open file '%s'", fname); + + off = lseek(f, 0, SEEK_END); + if (off <= 0) + err(EX_NOINPUT, "Cannot seek to end of file"); + + if (lseek(f, 0, SEEK_SET) < 0) + err(EX_NOINPUT, "Cannot seek to beginning of file"); + + len = off; + if (len != off) + err(EX_NOINPUT, "File '%s' is too big", fname); + + ptr = malloc(len); + if (ptr == NULL) + errx(EX_SOFTWARE, "Out of memory"); + + if (read(f, ptr, len) != len) + err(EX_NOINPUT, "Cannot read all data"); + + close(f); + + *pptr = ptr; + *plen = len; +} Added: head/tools/tools/bus_autoconf/bus_load_file.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_load_file.h Sat Jun 25 13:44:05 2011 (r223534) @@ -0,0 +1,33 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BUS_LOAD_FILE_H_ +#define _BUS_LOAD_FILE_H_ + +void load_file(const char *, uint8_t **, uint32_t *); + +#endif /* _BUS_LOAD_FILE_H_ */ Added: head/tools/tools/bus_autoconf/bus_sections.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_sections.c Sat Jun 25 13:44:05 2011 (r223534) @@ -0,0 +1,223 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "bus_sections.h" + +#define MAX_STRING 64 + +struct format_info; +typedef TAILQ_HEAD(,format_info) format_info_head_t; +typedef TAILQ_ENTRY(format_info) format_info_entry_t; + +static format_info_head_t format_head = TAILQ_HEAD_INITIALIZER(format_head); + +struct format_info { + format_info_entry_t entry; + format_info_head_t fields; + char name[MAX_STRING]; + uint16_t bit_offset; + uint16_t bit_size; +}; + +static struct format_info * +format_info_new(char *pstr, uint16_t bo, uint16_t bs) +{ + struct format_info *pfi; + + pfi = malloc(sizeof(*pfi)); + if (pfi == NULL) + errx(EX_SOFTWARE, "Out of memory."); + + memset(pfi, 0, sizeof(*pfi)); + + TAILQ_INIT(&pfi->fields); + + strlcpy(pfi->name, pstr, sizeof(pfi->name)); + pfi->bit_offset = bo; + pfi->bit_size = bs; + return (pfi); +} + +static const struct format_info * +format_get_section(const char *section) +{ + const struct format_info *psub; + static const struct format_info *psub_last; + static const char *psub_cache; + + if (psub_cache && strcmp(psub_cache, section) == 0) + return (psub_last); + + TAILQ_FOREACH(psub, &format_head, entry) { + if (strcmp(section, psub->name) == 0) { + psub_cache = section; + psub_last = psub; + return (psub); + } + } + warnx("Section '%s' not found", section); + psub_cache = section; + psub_last = psub; + return (NULL); +} + +uint16_t +format_get_section_size(const char *section) +{ + const struct format_info *pfi; + + pfi = format_get_section(section); + if (pfi == NULL) + return (0); + + return ((pfi->bit_offset + 7) / 8); +} + + +uint8_t +format_get_field(const char *section, const char *field, + const uint8_t *ptr, uint16_t size) +{ + const struct format_info *pfi; + const struct format_info *psub; + uint16_t rem; + uint16_t off; + uint16_t sz; + + pfi = format_get_section(section); + if (pfi == NULL) + return (0); + + /* skip until we find the fields */ + while (pfi && TAILQ_FIRST(&pfi->fields) == NULL) + pfi = TAILQ_NEXT(pfi, entry); + + if (pfi == NULL) + return (0); + + TAILQ_FOREACH(psub, &pfi->fields, entry) { + if (strcmp(field, psub->name) == 0) { + + /* range check */ + if (((psub->bit_offset + psub->bit_size) / 8) > size) + return (0); + + /* compute byte offset */ + rem = psub->bit_offset & 7; + off = psub->bit_offset / 8; + sz = psub->bit_size; + + /* extract bit-field */ + return ((ptr[off] >> rem) & ((1 << sz) - 1)); + } + } + warnx("Field '%s' not found in '%s'", field, pfi->name); + return (0); +} + +void +format_parse_entries(const uint8_t *ptr, uint32_t len) +{ + static const char *command_list = "012345678:"; + const char *cmd; + struct format_info *pfi; + struct format_info *pfi_last = NULL; + char linebuf[3][MAX_STRING]; + uint32_t off = 0; + uint16_t bit_offset = 0; + uint8_t state = 0; + uint8_t cmd_index; + int c; + + /* + * The format we are parsing: + * {string,string}{...} + */ + while (len--) { + c = *(ptr++); + + /* skip some characters */ + if (c == 0 || c == '\n' || c == '\r' || c == ' ' || c == '\t') + continue; + + /* accumulate non-field delimiters */ + if (strchr("{,}", c) == NULL) { + if (off < (MAX_STRING - 1)) { + linebuf[state][off] = c; + off++; + } + continue; + } + /* parse keyword */ + linebuf[state][off] = 0; + off = 0; + state++; + if (state == 3) { + /* check for command in command list */ + cmd = strchr(command_list, linebuf[2][0]); + if (cmd != NULL) + cmd_index = cmd - command_list; + else + cmd_index = 255; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 15:22:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D8941065673; Sat, 25 Jun 2011 15:22:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340AB8FC08; Sat, 25 Jun 2011 15:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PFMjAS012211; Sat, 25 Jun 2011 15:22:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PFMjja012207; Sat, 25 Jun 2011 15:22:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251522.p5PFMjja012207@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:22: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: r223535 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 15:22:45 -0000 Author: hselasky Date: Sat Jun 25 15:22:44 2011 New Revision: 223535 URL: http://svn.freebsd.org/changeset/base/223535 Log: - Need to respect the module name and the USB mode when accumulating device ID's. - Be more verbose on file seek failures. Allow a file size of zero. - Improve the wrapper shell. MFC after: 14 days Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh head/tools/tools/bus_autoconf/bus_load_file.c head/tools/tools/bus_autoconf/bus_usb.c Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.sh Sat Jun 25 13:44:05 2011 (r223534) +++ head/tools/tools/bus_autoconf/bus_autoconf.sh Sat Jun 25 15:22:44 2011 (r223535) @@ -28,6 +28,7 @@ OS=FreeBSD DOLLAR=$ +OBJCOPY=objcopy cat < /dev/null -[ -f temp.ids ] && cat temp.ids >> bus_autoconf_format.bin +${OBJCOPY} -j bus_autoconf_format -O binary ${F} bus_autoconf.ids 2> /dev/null +[ -f bus_autoconf.ids ] && cat bus_autoconf.ids >> bus_autoconf_format.bin # USB Host mode -objcopy -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null [ -f "usb_host_id,${G}" ] && (echo -n " -i usb_host_id,${G}" >> bus_autoconf_args.txt) # USB Device mode -objcopy -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null [ -f "usb_device_id,${G}" ] && (echo -n " -i usb_device_id,${G}" >> bus_autoconf_args.txt) # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null [ -f "usb_dual_id,${G}" ] && (echo -n " -i usb_dual_id,${G}" >> bus_autoconf_args.txt) done @@ -69,4 +71,8 @@ done bus_autoconf -F bus_autoconf_format.bin $(cat bus_autoconf_args.txt) # Cleanup -rm -f -- bus_autoconf_format.bin $(cat bus_autoconf_args.txt) +rm -f -- \ + $(cat bus_autoconf_args.txt) \ + bus_autoconf_args.txt \ + bus_autoconf_format.bin \ + bus_autoconf.ids Modified: head/tools/tools/bus_autoconf/bus_load_file.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_load_file.c Sat Jun 25 13:44:05 2011 (r223534) +++ head/tools/tools/bus_autoconf/bus_load_file.c Sat Jun 25 15:22:44 2011 (r223535) @@ -48,11 +48,15 @@ load_file(const char *fname, uint8_t **p err(EX_NOINPUT, "Cannot open file '%s'", fname); off = lseek(f, 0, SEEK_END); - if (off <= 0) - err(EX_NOINPUT, "Cannot seek to end of file"); - - if (lseek(f, 0, SEEK_SET) < 0) - err(EX_NOINPUT, "Cannot seek to beginning of file"); + if (off < 0) { + err(EX_NOINPUT, "Cannot seek to " + "end of file '%s'", fname); + } + + if (lseek(f, 0, SEEK_SET) < 0) { + err(EX_NOINPUT, "Cannot seek to " + "beginning of file '%s'", fname); + } len = off; if (len != off) Modified: head/tools/tools/bus_autoconf/bus_usb.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_usb.c Sat Jun 25 13:44:05 2011 (r223534) +++ head/tools/tools/bus_autoconf/bus_usb.c Sat Jun 25 15:22:44 2011 (r223535) @@ -276,6 +276,10 @@ usb_dump(struct usb_device_id *id, uint3 break; if (id[n].idVendor != id[0].idVendor) break; + if (strcmp(id[n].module_name, id[0].module_name)) + break; + if (strcmp(id[n].module_mode, id[0].module_mode)) + break; n++; } } From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 15:42:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFBAE106564A; Sat, 25 Jun 2011 15:42:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF34C8FC08; Sat, 25 Jun 2011 15:42:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PFgXnE012841; Sat, 25 Jun 2011 15:42:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PFgX22012838; Sat, 25 Jun 2011 15:42:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251542.p5PFgX22012838@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:42: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: r223536 - in head/etc: defaults devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 15:42:34 -0000 Author: hselasky Date: Sat Jun 25 15:42:33 2011 New Revision: 223536 URL: http://svn.freebsd.org/changeset/base/223536 Log: - Move auto-load devd config file into etc/defaults folder. - Regenerate file after bugfix in the generator. Suggested by: Jeremy Messenger MFC after: 14 days Added: head/etc/defaults/devd.conf - copied, changed from r223521, head/etc/devd/bus_auto.conf Deleted: head/etc/devd/bus_auto.conf Modified: head/etc/defaults/Makefile Modified: head/etc/defaults/Makefile ============================================================================== --- head/etc/defaults/Makefile Sat Jun 25 15:22:44 2011 (r223535) +++ head/etc/defaults/Makefile Sat Jun 25 15:42:33 2011 (r223536) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= bluetooth.device.conf devfs.rules periodic.conf rc.conf +FILES= bluetooth.device.conf devd.conf devfs.rules periodic.conf rc.conf NO_OBJ= FILESDIR= /etc/defaults Copied and modified: head/etc/defaults/devd.conf (from r223521, head/etc/devd/bus_auto.conf) ============================================================================== --- head/etc/devd/bus_auto.conf Fri Jun 24 22:01:56 2011 (r223521, copy source) +++ head/etc/defaults/devd.conf Sat Jun 25 15:42:33 2011 (r223536) @@ -7,32 +7,6 @@ nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x06"; - action "kldload if_cdce"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x0a"; - action "kldload if_cdce"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x0d"; - action "kldload if_cdce"; -}; - -# 3 usb_dual entries processed - -nomatch 32 { - match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; match "product" "0x1290"; @@ -111,1253 +85,2549 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x03f0"; - match "product" "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02)"; + match "product" "0x0121"; action "kldload ugensa"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0402"; - match "product" "0x5632"; - action "kldload if_cdce"; + match "vendor" "0x03f0"; + match "product" "(0x1016|0x1116|0x1216)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; - action "kldload uftdi"; + match "vendor" "0x03f0"; + match "product" "(0x1b1d|0x1e1d)"; + action "kldload u3g"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0408"; - match "product" "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; - action "kldload if_run"; + match "vendor" "0x03f0"; + match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0409"; - match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; - action "kldload uipaq"; + match "vendor" "0x03f0"; + match "product" "0x3524"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0411"; - match "product" "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150|0x015d|0x016f)"; - action "kldload if_aue"; + match "vendor" "0x03f0"; + match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0413"; - match "product" "0x2101"; - action "kldload uplcom"; + match "vendor" "0x03f0"; + match "product" "0x811c"; + action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0423"; - match "product" "(0x000a|0x000c)"; - action "kldload if_cue"; + match "vendor" "0x03f0"; + match "product" "0xca02"; + action "kldload if_urtw"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x043e"; - match "product" "0x9c01"; - action "kldload uipaq"; + match "vendor" "0x0402"; + match "product" "0x5632"; + action "kldload if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x045a"; - match "product" "(0x5001|0x5002)"; - action "kldload urio"; + match "vendor" "0x0403"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + action "kldload uftdi"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x045b"; - match "product" "0x0053"; - action "kldload uslcom"; + match "vendor" "0x0408"; + match "product" "0x0304"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x045e"; - match "product" "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; - action "kldload uplcom"; + match "vendor" "0x0408"; + match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload u3g"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0471"; - match "product" "(0x066a|0x1236|0x200f)"; - action "kldload uslcom"; + match "vendor" "0x0409"; + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0482"; - match "product" "0x0203"; - action "kldload umodem"; + match "vendor" "0x0411"; + match "product" "(0x0001|0x0005|0x0009)"; + action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0489"; - match "product" "(0xe000|0xe003)"; - action "kldload uslcom"; + match "vendor" "0x0411"; + match "product" "0x0012"; + action "kldload if_rue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x049f"; - match "product" "(0x0003|0x0032|0x505a)"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "0x003d"; + action "kldload if_axe"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04a4"; - match "product" "0x0014"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "(0x005e|0x0066|0x0067)"; + action "kldload if_ural"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04a5"; - match "product" "(0x4027|0x4068)"; - action "kldload uplcom"; + match "vendor" "0x0411"; + match "product" "0x006e"; + action "kldload if_axe"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04ad"; - match "product" "(0x0301|0x0302|0x0303|0x0306)"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "0x008b"; + action "kldload if_ural"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04b4"; - match "product" "0x1002"; - action "kldload ufm"; + match "vendor" "0x0411"; + match "product" "0x00b3"; + action "kldload uftdi"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04b7"; - match "product" "0x0531"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "(0x00d8|0x00d9)"; + action "kldload if_rum"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04b8"; - match "product" "(0x0521|0x0522)"; - action "kldload uplcom"; + match "vendor" "0x0411"; + match "product" "0x00da"; + action "kldload if_zyd"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04bb"; - match "product" "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)"; - action "kldload if_kue"; + match "vendor" "0x0411"; + match "product" "0x00e8"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04bf"; - match "product" "(0x0115|0x0117)"; - action "kldload uplcom"; + match "vendor" "0x0411"; + match "product" "(0x0116|0x0119)"; + action "kldload if_rum"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04c5"; - match "product" "(0x1058|0x1079)"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "0x012e"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04da"; - match "product" "(0x2500|0x3900)"; - action "kldload uipaq"; + match "vendor" "0x0411"; + match "product" "0x0137"; + action "kldload if_rum"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04dd"; - match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; - action "kldload if_cdce"; + match "vendor" "0x0411"; + match "product" "(0x0148|0x0150|0x015d|0x016f)"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04e8"; - match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; - action "kldload uipaq"; + match "vendor" "0x0413"; + match "product" "0x2101"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04f1"; - match "product" "(0x3008|0x3011|0x3012)"; - action "kldload if_axe"; + match "vendor" "0x0423"; + match "product" "(0x000a|0x000c)"; + action "kldload if_cue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0502"; - match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + match "vendor" "0x043e"; + match "product" "0x9c01"; action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0506"; - match "product" "(0x03e8|0x11f8|0x4601)"; - action "kldload if_kue"; + match "vendor" "0x045a"; + match "product" "(0x5001|0x5002)"; + action "kldload urio"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x050d"; - match "product" "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; - action "kldload ubsa"; + match "vendor" "0x045b"; + match "product" "0x0053"; + action "kldload uslcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0525"; - match "product" "(0x1080|0xa4a2)"; - action "kldload udbp"; + match "vendor" "0x045e"; + match "product" "0x0079"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0536"; - match "product" "0x01a0"; - action "kldload uipaq"; + match "vendor" "0x045e"; + match "product" "0x007a"; + action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0543"; - match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; + match "vendor" "0x045e"; + match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0547"; - match "product" "(0x2008|0x2720)"; - action "kldload uplcom"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x054c"; - match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; - action "kldload uvisor"; + match "vendor" "0x0471"; + match "product" "0x066a"; + action "kldload uslcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0557"; - match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; - action "kldload if_kue"; + match "vendor" "0x0471"; + match "product" "0x1236"; + action "kldload if_zyd"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x055d"; - match "product" "0x2018"; + match "vendor" "0x0471"; + match "product" "0x200f"; action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0565"; - match "product" "(0x0001|0x0002|0x0003|0x0005)"; - action "kldload ubsa"; + match "vendor" "0x0482"; + match "product" "0x0203"; + action "kldload umodem"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0567"; - match "product" "(0x2000|0x2002)"; - action "kldload if_upgt"; + match "vendor" "0x0489"; + match "product" "(0xe000|0xe003)"; + action "kldload uslcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x056c"; - match "product" "0x8007"; - action "kldload ubsa"; + match "vendor" "0x049f"; + match "product" "(0x0003|0x0032)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x056e"; - match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; - action "kldload if_aue"; + match "vendor" "0x049f"; + match "product" "0x505a"; + action "kldload if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x057c"; - match "product" "(0x2200|0x3800)"; - action "kldload ng_ubt"; + match "vendor" "0x04a4"; + match "product" "0x0014"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0584"; - match "product" "(0xb000|0xb020)"; + match "vendor" "0x04a5"; + match "product" "0x4027"; action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0586"; - match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; - action "kldload if_zyd"; + match "vendor" "0x04a5"; + match "product" "0x4068"; + action "kldload u3g"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x058f"; - match "product" "0x9720"; - action "kldload uplcom"; + match "vendor" "0x04ad"; + match "product" "(0x0301|0x0302|0x0303|0x0306)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05a6"; - match "product" "0x0101"; - action "kldload if_run"; + match "vendor" "0x04b4"; + match "product" "0x1002"; + action "kldload ufm"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; - action "kldload atp"; + match "vendor" "0x04b7"; + match "product" "0x0531"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05ad"; - match "product" "0x0fba"; + match "vendor" "0x04b8"; + match "product" "(0x0521|0x0522)"; action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05c6"; - match "product" "(0x6000|0x6613)"; - action "kldload u3g"; + match "vendor" "0x04bb"; + match "product" "0x0901"; + action "kldload if_kue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05cc"; - match "product" "0x3000"; + match "vendor" "0x04bb"; + match "product" "(0x0904|0x0913)"; action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05db"; - match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; - action "kldload uvscom"; + match "vendor" "0x04bb"; + match "product" "0x0930"; + action "kldload if_axe"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05e0"; - match "product" "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)"; - action "kldload uipaq"; + match "vendor" "0x04bb"; + match "product" "(0x0944|0x0945|0x0947|0x0948)"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05e3"; - match "product" "0x0501"; - action "kldload udbp"; + match "vendor" "0x04bb"; + match "product" "(0x0a03|0x0a0e)"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05e9"; - match "product" "(0x0008|0x0009)"; - action "kldload if_kue"; + match "vendor" "0x04bf"; + match "product" "(0x0115|0x0117)"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x066b"; - match "product" "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; - action "kldload if_aue"; + match "vendor" "0x04c5"; + match "product" "(0x1058|0x1079)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0675"; - match "product" "0x0550"; - action "kldload if_zyd"; + match "vendor" "0x04da"; + match "product" "0x2500"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x067b"; - match "product" "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x331a|0xaaa0|0xaaa2)"; - action "kldload udbp"; + match "vendor" "0x04da"; + match "product" "0x3900"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x067c"; - match "product" "0x1001"; - action "kldload if_aue"; + match "vendor" "0x04dd"; + match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031)"; + action "kldload if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x067e"; - match "product" "0x1001"; + match "vendor" "0x04dd"; + match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0681"; - match "product" "0x3c06"; - action "kldload if_ural"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x06e1"; - match "product" "(0x0008|0x0009)"; - action "kldload if_kue"; + match "vendor" "0x04e8"; + match "product" "0x6601"; + action "kldload uvisor"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x06f8"; - match "product" "(0xe000|0xe010|0xe020|0xe030)"; - action "kldload if_ural"; + match "vendor" "0x04e8"; + match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0707"; - match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; - action "kldload if_kue"; + match "vendor" "0x04e8"; + match "product" "0x8001"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0711"; - match "product" "(0x0200|0x0210|0x0230)"; - action "kldload umct"; + match "vendor" "0x04f1"; + match "product" "0x3008"; + action "kldload if_axe"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0731"; - match "product" "(0x0528|0x2003)"; - action "kldload uplcom"; + match "vendor" "0x04f1"; + match "product" "(0x3011|0x3012)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0745"; - match "product" "(0x0001|0x1000)"; - action "kldload uplcom"; + match "vendor" "0x0502"; + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + action "kldload uipaq"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0769"; - match "product" "(0x11f2|0x11f3|0x31f3)"; - action "kldload if_urtw"; + match "vendor" "0x0506"; + match "product" "(0x03e8|0x11f8)"; + action "kldload if_kue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x077b"; - match "product" "0x2226"; - action "kldload if_axe"; + match "vendor" "0x0506"; + match "product" "0x4601"; + action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0789"; - match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; - action "kldload if_urtw"; + match "vendor" "0x050d"; + match "product" "0x0103"; + action "kldload ubsa"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x078b"; - match "product" "0x1234"; - action "kldload uplcom"; + match "vendor" "0x050d"; + match "product" "0x0109"; + action "kldload umct"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x079b"; - match "product" "(0x0027|0x004a|0x0062)"; - action "kldload uplcom"; + match "vendor" "0x050d"; + match "product" "0x0121"; + action "kldload if_aue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07a6"; - match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)"; - action "kldload if_aue"; + match "vendor" "0x050d"; + match "product" "0x0257"; + action "kldload uplcom"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07aa"; - match "product" "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x0041|0x0042|0x9601)"; - action "kldload if_kue"; + match "vendor" "0x050d"; + match "product" "0x0409"; + action "kldload umct"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07b8"; - match "product" "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; - action "kldload if_aue"; + match "vendor" "0x050d"; + match "product" "0x1203"; + action "kldload ubsa"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07c9"; - match "product" "0xb100"; - action "kldload if_aue"; + match "vendor" "0x050d"; + match "product" "0x4050"; + action "kldload if_zyd"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07cf"; - match "product" "(0x2001|0x2002|0x2003)"; - action "kldload uipaq"; + match "vendor" "0x050d"; + match "product" "0x5055"; + action "kldload if_axe"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x07d1"; - match "product" "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; - action "kldload if_uath"; + match "vendor" "0x050d"; + match "product" "0x7050"; + action "kldload if_upgt"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x081e"; - match "product" "0xdf00"; - action "kldload uvisor"; + match "vendor" "0x050d"; + match "product" "(0x7050|0x7051)"; + action "kldload if_ural"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x082d"; - match "product" "(0x0100|0x0200|0x0300)"; - action "kldload uvisor"; + match "vendor" "0x050d"; + match "product" "0x705a"; + action "kldload if_rum"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0830"; - match "product" "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)"; - action "kldload uvisor"; + match "vendor" "0x050d"; + match "product" "0x705c"; + action "kldload if_zyd"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0833"; - match "product" "(0x012e|0x039f)"; - action "kldload uplcom"; + match "vendor" "0x050d"; + match "product" "0x705e"; + action "kldload if_urtw"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x083a"; - match "product" "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; - action "kldload if_aue"; + match "vendor" "0x050d"; + match "product" "(0x8053|0x805c|0x815c|0x825a)"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0841"; - match "product" "0x0001"; - action "kldload urio"; + match "vendor" "0x050d"; + match "product" "0x905b"; + action "kldload if_rum"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0846"; - match "product" "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; - action "kldload if_kue"; + match "vendor" "0x050d"; + match "product" "0x935a"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x0856"; - match "product" "0xac01"; - action "kldload uftdi"; + match "vendor" "0x0525"; + match "product" "0x1080"; + action "kldload udbp"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x085a"; - match "product" "(0x0008|0x0009)"; - action "kldload if_kue"; + match "vendor" "0x0525"; + match "product" "0xa4a2"; + action "kldload if_cdce"; }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 15:46:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46430106564A; Sat, 25 Jun 2011 15:46:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 366E18FC14; Sat, 25 Jun 2011 15:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PFkPPP012996; Sat, 25 Jun 2011 15:46:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PFkPrp012994; Sat, 25 Jun 2011 15:46:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251546.p5PFkPrp012994@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:46: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: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 15:46:25 -0000 Author: hselasky Date: Sat Jun 25 15:46:24 2011 New Revision: 223537 URL: http://svn.freebsd.org/changeset/base/223537 Log: - Remove duplicate USB ID. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:42:33 2011 (r223536) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:46:24 2011 (r223537) @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID zyd_devs ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), ZYD_ZD1211_DEV(ZYXEL, G200V2), /* ZYD_ZD1211B */ - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), ZYD_ZD1211B_DEV(ACCTON, ZD1211B), ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 15:51:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6766106564A; Sat, 25 Jun 2011 15:51:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCE928FC0A; Sat, 25 Jun 2011 15:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PFpiFH013181; Sat, 25 Jun 2011 15:51:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PFpiq8013178; Sat, 25 Jun 2011 15:51:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251551.p5PFpiq8013178@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:51: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: r223538 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 15:51:44 -0000 Author: hselasky Date: Sat Jun 25 15:51:44 2011 New Revision: 223538 URL: http://svn.freebsd.org/changeset/base/223538 Log: - Export the USB device ID format to userspace tools. MFC after: 14 days Modified: head/sys/dev/usb/usb_lookup.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Sat Jun 25 15:46:24 2011 (r223537) +++ head/sys/dev/usb/usb_lookup.c Sat Jun 25 15:51:44 2011 (r223538) @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -144,3 +146,108 @@ usbd_lookup_id_by_uaa(const struct usb_d } return (ENXIO); } + +/*------------------------------------------------------------------------* + * Export the USB device ID format we use to userspace tools. + *------------------------------------------------------------------------*/ +#if BYTE_ORDER == BIG_ENDIAN +#define U16_XOR "8" +#define U32_XOR "12" +#define U64_XOR "56" +#define U8_BITFIELD_XOR "7" +#define U16_BITFIELD_XOR "15" +#define U32_BITFIELD_XOR "31" +#define U64_BITFIELD_XOR "63" +#else +#define U16_XOR "0" +#define U32_XOR "0" +#define U64_XOR "0" +#define U8_BITFIELD_XOR "0" +#define U16_BITFIELD_XOR "0" +#define U32_BITFIELD_XOR "0" +#define U64_BITFIELD_XOR "0" +#endif + +#if USB_HAVE_COMPAT_LINUX +#define MFL_SIZE "1" +#else +#define MFL_SIZE "0" +#endif + +#ifdef KLD_MODULE +static const char __section("bus_autoconf_format") __used usb_id_format[] = { + + /* Declare that three different sections use the same format */ + + "usb_host_id{256,:}" + "usb_device_id{256,:}" + "usb_dual_id{256,:}" + + /* List size of fields in the usb_device_id structure */ + +#if ULONG_MAX >= 0xFFFFFFFFUL + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#if ULONG_MAX >= 0xFFFFFFFFFFFFFFFFULL + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#endif +#else +#error "Please update code." +#endif + + "idVendor[0]{" U16_XOR ",8}" + "idVendor[1]{" U16_XOR ",8}" + "idProduct[0]{" U16_XOR ",8}" + "idProduct[1]{" U16_XOR ",8}" + "bcdDevice_lo[0]{" U16_XOR ",8}" + "bcdDevice_lo[1]{" U16_XOR ",8}" + "bcdDevice_hi[0]{" U16_XOR ",8}" + "bcdDevice_hi[1]{" U16_XOR ",8}" + + "bDeviceClass{0,8}" + "bDeviceSubClass{0,8}" + "bDeviceProtocol{0,8}" + "bInterfaceClass{0,8}" + "bInterfaceSubClass{0,8}" + "bInterfaceProtocol{0,8}" + + "mf_vendor{" U8_BITFIELD_XOR ",1}" + "mf_product{" U8_BITFIELD_XOR ",1}" + "mf_dev_lo{" U8_BITFIELD_XOR ",1}" + "mf_dev_hi{" U8_BITFIELD_XOR ",1}" + + "mf_dev_class{" U8_BITFIELD_XOR ",1}" + "mf_dev_subclass{" U8_BITFIELD_XOR ",1}" + "mf_dev_protocol{" U8_BITFIELD_XOR ",1}" + "mf_int_class{" U8_BITFIELD_XOR ",1}" + + "mf_int_subclass{" U8_BITFIELD_XOR ",1}" + "mf_int_protocol{" U8_BITFIELD_XOR ",1}" + "unused{" U8_BITFIELD_XOR ",6}" + + "mfl_vendor{" U16_XOR "," MFL_SIZE "}" + "mfl_product{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_lo{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_hi{" U16_XOR "," MFL_SIZE "}" + + "mfl_dev_class{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_protocol{" U16_XOR "," MFL_SIZE "}" + "mfl_int_class{" U16_XOR "," MFL_SIZE "}" + + "mfl_int_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_int_protocol{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" +}; +#endif Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sat Jun 25 15:46:24 2011 (r223537) +++ head/sys/dev/usb/usbdi.h Sat Jun 25 15:51:44 2011 (r223538) @@ -270,12 +270,15 @@ struct usb_device_id { uint8_t match_flag_product:1; uint8_t match_flag_dev_lo:1; uint8_t match_flag_dev_hi:1; + uint8_t match_flag_dev_class:1; uint8_t match_flag_dev_subclass:1; uint8_t match_flag_dev_protocol:1; uint8_t match_flag_int_class:1; + uint8_t match_flag_int_subclass:1; uint8_t match_flag_int_protocol:1; + uint8_t match_flag_unused:6; #if USB_HAVE_COMPAT_LINUX /* which fields to match against */ @@ -291,7 +294,10 @@ struct usb_device_id { #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 #endif -}; +} __aligned(32); + +/* check that the size of the structure above is correct */ +extern char usb_device_id_assert[(sizeof(struct usb_device_id) == 32) ? 1 : -1]; #define USB_VENDOR(vend) \ .match_flag_vendor = 1, .idVendor = (vend) From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 16:01:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE31D106566B; Sat, 25 Jun 2011 16:01:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE94D8FC08; Sat, 25 Jun 2011 16:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PG1jRg013524; Sat, 25 Jun 2011 16:01:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PG1j7q013520; Sat, 25 Jun 2011 16:01:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106251601.p5PG1j7q013520@svn.freebsd.org> From: Marius Strobl Date: Sat, 25 Jun 2011 16:01: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: r223539 - head/sys/boot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 16:01:46 -0000 Author: marius Date: Sat Jun 25 16:01:45 2011 New Revision: 223539 URL: http://svn.freebsd.org/changeset/base/223539 Log: As with EFI, OFW and U-Boot etc only compile FDT support on those architectures that actually use it. Modified: head/sys/boot/Makefile head/sys/boot/Makefile.arm head/sys/boot/Makefile.powerpc Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Sat Jun 25 15:51:44 2011 (r223538) +++ head/sys/boot/Makefile Sat Jun 25 16:01:45 2011 (r223539) @@ -8,10 +8,6 @@ SUBDIR+= ficl .endif -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - # Pick the machine-dependent subdir based on the target architecture. ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) Modified: head/sys/boot/Makefile.arm ============================================================================== --- head/sys/boot/Makefile.arm Sat Jun 25 15:51:44 2011 (r223538) +++ head/sys/boot/Makefile.arm Sat Jun 25 16:01:45 2011 (r223539) @@ -1,3 +1,7 @@ # $FreeBSD$ +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + SUBDIR+= uboot Modified: head/sys/boot/Makefile.powerpc ============================================================================== --- head/sys/boot/Makefile.powerpc Sat Jun 25 15:51:44 2011 (r223538) +++ head/sys/boot/Makefile.powerpc Sat Jun 25 16:01:45 2011 (r223539) @@ -1,4 +1,8 @@ # $FreeBSD$ +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + SUBDIR+= ofw SUBDIR+= uboot From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 16:13:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D0A106564A; Sat, 25 Jun 2011 16:13:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1964A8FC0C; Sat, 25 Jun 2011 16:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PGDuq2013945; Sat, 25 Jun 2011 16:13:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PGDute013943; Sat, 25 Jun 2011 16:13:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106251613.p5PGDute013943@svn.freebsd.org> From: Marius Strobl Date: Sat, 25 Jun 2011 16:13: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: r223540 - head/kerberos5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 16:13:57 -0000 Author: marius Date: Sat Jun 25 16:13:56 2011 New Revision: 223540 URL: http://svn.freebsd.org/changeset/base/223540 Log: The kerberos5 tools are only used as build tools but not otherwise and didn't get installed either. MFC after: 1 week Modified: head/kerberos5/Makefile Modified: head/kerberos5/Makefile ============================================================================== --- head/kerberos5/Makefile Sat Jun 25 16:01:45 2011 (r223539) +++ head/kerberos5/Makefile Sat Jun 25 16:13:56 2011 (r223540) @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= doc tools lib libexec usr.bin usr.sbin +SUBDIR= doc lib libexec usr.bin usr.sbin # These are the programs which depend on Kerberos. KPROGS= lib/libpam \ From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 16:27:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB19B106564A; Sat, 25 Jun 2011 16:27:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B27F8FC12; Sat, 25 Jun 2011 16:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PGRnGC014356; Sat, 25 Jun 2011 16:27:49 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PGRnpO014353; Sat, 25 Jun 2011 16:27:49 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201106251627.p5PGRnpO014353@svn.freebsd.org> From: Tim Kientzle Date: Sat, 25 Jun 2011 16:27: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: r223541 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 16:27:49 -0000 Author: kientzle Date: Sat Jun 25 16:27:49 2011 New Revision: 223541 URL: http://svn.freebsd.org/changeset/base/223541 Log: If there is a read error reading Y/N confirmation from the keyboard, exit immediately with an error. If there is an error opening or reading a file to put into the archive, set the return value for a deferred error exit. PR: bin/154407 Modified: head/usr.bin/tar/util.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/util.c ============================================================================== --- head/usr.bin/tar/util.c Sat Jun 25 16:13:56 2011 (r223540) +++ head/usr.bin/tar/util.c Sat Jun 25 16:27:49 2011 (r223541) @@ -226,7 +226,11 @@ yes(const char *fmt, ...) fflush(stderr); l = read(2, buff, sizeof(buff) - 1); - if (l <= 0) + if (l < 0) { + fprintf(stderr, "Keyboard read failed\n"); + exit(1); + } + if (l == 0) return (0); buff[l] = 0; Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sat Jun 25 16:13:56 2011 (r223540) +++ head/usr.bin/tar/write.c Sat Jun 25 16:27:49 2011 (r223541) @@ -919,6 +919,7 @@ write_entry_backend(struct bsdtar *bsdta const char *pathname = archive_entry_sourcepath(entry); fd = open(pathname, O_RDONLY | O_BINARY); if (fd == -1) { + bsdtar->return_value = 1; if (!bsdtar->verbose) bsdtar_warnc(errno, "%s: could not open file", pathname); @@ -1020,6 +1021,12 @@ write_file_data(struct bsdtar *bsdtar, s progress += bytes_written; bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN); } + if (bytes_read < 0) { + bsdtar_warnc(errno, + "%s: Read error", + archive_entry_pathname(entry)); + bsdtar->return_value = 1; + } return 0; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 16:35:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 562BE106567E; Sat, 25 Jun 2011 16:35:44 +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 465518FC16; Sat, 25 Jun 2011 16:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PGZi7D014619; Sat, 25 Jun 2011 16:35:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PGZife014617; Sat, 25 Jun 2011 16:35:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106251635.p5PGZife014617@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 16:35: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: r223542 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 16:35:44 -0000 Author: marcel Date: Sat Jun 25 16:35:43 2011 New Revision: 223542 URL: http://svn.freebsd.org/changeset/base/223542 Log: Define the minimum fractional period in terms of hz. We know hz is a magnitude smaller than itc_freq. A minimum period of 10*hz is sufficient precision. As a side-effect, the number of clocks per second, when the machine is idle, dropped by more than 50%. Be anal and define the maximum period to be at least 4G seconds. With a 64-bit counter and an ITC frequency that's expected to be always less than 4Ghz, it takes longer than that to wrap around. Modified: head/sys/ia64/ia64/clock.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sat Jun 25 16:27:49 2011 (r223541) +++ head/sys/ia64/ia64/clock.c Sat Jun 25 16:35:43 2011 (r223542) @@ -184,8 +184,8 @@ clock_configure(void *dummy) et->et_quality = 1000; et->et_frequency = itc_freq; et->et_min_period.sec = 0; - et->et_min_period.frac = ((1ul << 32) / itc_freq) << 32; - et->et_max_period.sec = 0xfffffff0 / itc_freq; + et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1; + et->et_max_period.sec = ~0ul; /* XXX unless itc_freq >= (1<<32) */ et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; et->et_start = ia64_clock_start; et->et_stop = ia64_clock_stop; From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 16:55:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE9C106566B; Sat, 25 Jun 2011 16:55:23 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id CF1F78FC08; Sat, 25 Jun 2011 16:55:22 +0000 (UTC) Received: by qwc9 with SMTP id 9so2422540qwc.13 for ; Sat, 25 Jun 2011 09:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/G31MaKoWrJEvN9GtqhMIRPePj+gbnzRTmUvEUrT9A4=; b=Vn8CUIgsWe53Xa7p7G2oKF+2yCCSSGUr5r00f4e/+siiqCWYQHAaMMozn5lKmPFMgI UyBFbDPCo5KVSM7XToCWBg7Ait/t4hbU4993MJfg/f9bMiZUs8e6GLvhQaAE2Su+PiHS SAxTeiWkRAZ8fGqtdSbCVHkFJcH2zgRk8knRA= 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=McBtjxgcQtFJ1IAXSIpyygem+2F02wtcCTYBfvTFZkT+/Pq8bm9cR//EiCy3UegLJd sPuU8Ivwf172znHYeVmmye5Hp/UL9YoWEj4axc+konCOXJyxsVPK6PeHSluK+qHDcnkK PUMop4FGkrMWdMG0rhiU3iTLaQq6EnJ2VAUWQ= MIME-Version: 1.0 Received: by 10.229.35.1 with SMTP id n1mr11198qcd.84.1309020921208; Sat, 25 Jun 2011 09:55:21 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.229.227.130 with HTTP; Sat, 25 Jun 2011 09:55:21 -0700 (PDT) In-Reply-To: <201106202259.p5KMxT1h069297@svn.freebsd.org> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> Date: Sat, 25 Jun 2011 20:55:21 +0400 X-Google-Sender-Auth: Sx9z0uPeZ1Gt202loq5TiS6fp40 Message-ID: From: Sergey Kandaurov To: Jack F Vogel 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: r223350 - 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: Sat, 25 Jun 2011 16:55:23 -0000 On 21 June 2011 02:59, Jack F Vogel wrote: > Author: jfv > Date: Mon Jun 20 22:59:29 2011 > New Revision: 223350 > URL: http://svn.freebsd.org/changeset/base/223350 > > Log: > =A0Eliminate some global tuneables in favor of adapter-specific, > =A0particular flow control and dma coalesce. Also improve the > =A0sysctl operation on those too. > > =A0Add IPv6 detection in the ioctl code, this was done for > =A0ixgbe first, carrying that over. > > =A0Add resource ability to disable particular adapter. > > =A0Add HW TSO capability so vlans can make use of TSO This change breaks LINT-NOINET amd64 and i386 builds. ixgbe is broken in the same way in r222588. Something like this should fix it (not tested). Index: sys/dev/e1000/if_igb.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 --- sys/dev/e1000/if_igb.c (revision 223490) +++ sys/dev/e1000/if_igb.c (working copy) @@ -1049,8 +1049,10 @@ ifp->if_flags |=3D IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) igb_init(adapter); +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); +#endif } else #endif error =3D ether_ioctl(ifp, command, data); --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 17:01:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CEA3106566B; Sat, 25 Jun 2011 17:01:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C42F8FC0C; Sat, 25 Jun 2011 17:01:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PH1lNC015374; Sat, 25 Jun 2011 17:01:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PH1l1E015370; Sat, 25 Jun 2011 17:01:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106251701.p5PH1l1E015370@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 Jun 2011 17:01: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: r223543 - in head/etc: defaults devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 17:01:47 -0000 Author: hselasky Date: Sat Jun 25 17:01:46 2011 New Revision: 223543 URL: http://svn.freebsd.org/changeset/base/223543 Log: - Move bus_auto.conf back into /etc/devd/ - Rename bus_auto.conf into usb.conf Requested by: imp @ MFC after: 14 days Added: head/etc/devd/usb.conf - copied unchanged from r223536, head/etc/defaults/devd.conf Deleted: head/etc/defaults/devd.conf Modified: head/etc/defaults/Makefile head/etc/devd/Makefile Modified: head/etc/defaults/Makefile ============================================================================== --- head/etc/defaults/Makefile Sat Jun 25 16:35:43 2011 (r223542) +++ head/etc/defaults/Makefile Sat Jun 25 17:01:46 2011 (r223543) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= bluetooth.device.conf devd.conf devfs.rules periodic.conf rc.conf +FILES= bluetooth.device.conf devfs.rules periodic.conf rc.conf NO_OBJ= FILESDIR= /etc/defaults Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Sat Jun 25 16:35:43 2011 (r223542) +++ head/etc/devd/Makefile Sat Jun 25 17:01:46 2011 (r223543) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= asus.conf uath.conf +FILES= asus.conf uath.conf usb.conf NO_OBJ= FILESDIR= /etc/devd Copied: head/etc/devd/usb.conf (from r223536, head/etc/defaults/devd.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/devd/usb.conf Sat Jun 25 17:01:46 2011 (r223543, copy of r223536, head/etc/defaults/devd.conf) @@ -0,0 +1,4275 @@ +# +# $FreeBSD$ +# +# This file was automatically generated by "tools/bus_autoconf.sh". +# Please do not edit! +# + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1290"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1292"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1294"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1297"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0104"; + match "product" "0x00be"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0123"; + match "product" "0x0001"; + action "kldload uep"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03e8"; + match "product" "0x0008"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03eb"; + match "product" "0x2109"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x0121"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1016|0x1116|0x1216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1b1d|0x1e1d)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x3524"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x811c"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0xca02"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0402"; + match "product" "0x5632"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0403"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "0x0304"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0001|0x0005|0x0009)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x0012"; + action "kldload if_rue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x003d"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x005e|0x0066|0x0067)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x006e"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x008b"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00b3"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x00d8|0x00d9)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00da"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00e8"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0116|0x0119)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x012e"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x0137"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0148|0x0150|0x015d|0x016f)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0413"; + match "product" "0x2101"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0423"; + match "product" "(0x000a|0x000c)"; + action "kldload if_cue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x043e"; + match "product" "0x9c01"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045a"; + match "product" "(0x5001|0x5002)"; + action "kldload urio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045b"; + match "product" "0x0053"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "0x0079"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "0x007a"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x066a"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x1236"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x200f"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0482"; + match "product" "0x0203"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0489"; + match "product" "(0xe000|0xe003)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "(0x0003|0x0032)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "0x505a"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a4"; + match "product" "0x0014"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "0x4027"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "0x4068"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04ad"; + match "product" "(0x0301|0x0302|0x0303|0x0306)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b4"; + match "product" "0x1002"; + action "kldload ufm"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b7"; + match "product" "0x0531"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b8"; + match "product" "(0x0521|0x0522)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "0x0901"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0904|0x0913)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "0x0930"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0944|0x0945|0x0947|0x0948)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0a03|0x0a0e)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bf"; + match "product" "(0x0115|0x0117)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04c5"; + match "product" "(0x1058|0x1079)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "0x2500"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "0x3900"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04dd"; + match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031)"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04dd"; + match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x6601"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x8001"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "0x3008"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "(0x3011|0x3012)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0502"; + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0506"; + match "product" "(0x03e8|0x11f8)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0506"; + match "product" "0x4601"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0103"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0109"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0121"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0257"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0409"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x1203"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x4050"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x5055"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x7050"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x7050|0x7051)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705a"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705c"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705e"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x8053|0x805c|0x815c|0x825a)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x905b"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x935a"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0525"; + match "product" "0x1080"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0525"; + match "product" "0xa4a2"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0536"; + match "product" "0x01a0"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0543"; + match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "0x2008"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "0x2720"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "0x0437"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2002"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2007"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2008"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2009"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x4000"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x055d"; + match "product" "0x2018"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "0x0001"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "(0x0002|0x0003|0x0005)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0567"; + match "product" "(0x2000|0x2002)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056c"; + match "product" "0x8007"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x5003|0x5004)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "0xabc1"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x057c"; + match "product" "(0x2200|0x3800)"; + action "kldload ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "0xb000"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "0xb020"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3416|0x341a)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x058f"; + match "product" "0x9720"; + action "kldload uplcom"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 17:58:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB741065673; Sat, 25 Jun 2011 17:58:35 +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 9BF298FC16; Sat, 25 Jun 2011 17:58:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PHwZBp016978; Sat, 25 Jun 2011 17:58:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PHwZwd016976; Sat, 25 Jun 2011 17:58:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106251758.p5PHwZwd016976@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 17:58: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: r223544 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Jun 2011 17:58:35 -0000 Author: marcel Date: Sat Jun 25 17:58:35 2011 New Revision: 223544 URL: http://svn.freebsd.org/changeset/base/223544 Log: Oops. The sec field of struct bintime is *not* a 32-bit type. It's time_t, which is 64 bits on ia64. Modified: head/sys/ia64/ia64/clock.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sat Jun 25 17:01:46 2011 (r223543) +++ head/sys/ia64/ia64/clock.c Sat Jun 25 17:58:35 2011 (r223544) @@ -185,7 +185,7 @@ clock_configure(void *dummy) et->et_frequency = itc_freq; et->et_min_period.sec = 0; et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1; - et->et_max_period.sec = ~0ul; /* XXX unless itc_freq >= (1<<32) */ + et->et_max_period.sec = 0xffffffff; et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; et->et_start = ia64_clock_start; et->et_stop = ia64_clock_stop; From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 18:36:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0671065675; Sat, 25 Jun 2011 18:36:44 +0000 (UTC) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 98C458FC12; Sat, 25 Jun 2011 18:36:43 +0000 (UTC) Received: from mail-gw12.york.ac.uk ([144.32.129.162]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.8.2.32) by TLS id 1154231234 for hselasky@FreeBSD.org; d005fa52e6c5a123; Sat, 25 Jun 2011 19:26:20 +0100 Received: from ury.york.ac.uk ([144.32.108.81]:44250) by mail-gw12.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QaXYh-0000xE-KJ; Sat, 25 Jun 2011 19:26:19 +0100 Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1QaXYh-0003vl-Dl; Sat, 25 Jun 2011 19:26:19 +0100 Date: Sat, 25 Jun 2011 19:26:19 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@"ury.york.ac.uk." To: Hans Petter Selasky In-Reply-To: <201106251546.p5PFkPrp012994@svn.freebsd.org> Message-ID: References: <201106251546.p5PFkPrp012994@svn.freebsd.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 18:36:44 -0000 On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Jun 25 15:46:24 2011 > New Revision: 223537 > URL: http://svn.freebsd.org/changeset/base/223537 > > Log: > - Remove duplicate USB ID. Are you sure? > Modified: > head/sys/dev/usb/wlan/if_zyd.c > > Modified: head/sys/dev/usb/wlan/if_zyd.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:42:33 2011 (r223536) > +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:46:24 2011 (r223537) > @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID zyd_devs > ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), > ZYD_ZD1211_DEV(ZYXEL, G200V2), > /* ZYD_ZD1211B */ > - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), gavin@psi:/home/gavin 110% grep SMCWUSBG /usr/freebsd/head/sys/dev/usb/usbdevs product ACCTON SMCWUSBG_NF 0x4505 SMCWUSB-G (no firmware) product ACCTON SMCWUSBG 0x4506 SMCWUSB-G This SMCWUSBG_NF ID was only added three months ago, in r219982. The other ID has been in the driver since it was first committed. Gavin From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 18:45:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A65106564A; Sat, 25 Jun 2011 18:45:40 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4D98FC17; Sat, 25 Jun 2011 18:45:39 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=7KD0iiTHYGd0xbPMAUtcJ3OZoqPCTpa2X22hnPESm4A= c=1 sm=1 a=vURWEZHBcHsA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=fh6wi9jYsf1mfZj4V1QA:9 a=TOBH0rrRZHg1JD0bXIAA:7 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 143144476; Sat, 25 Jun 2011 20:45:38 +0200 To: Gavin Atkinson From: Hans Petter Selasky X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?windows-1252?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?windows-1252?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= Date: Sat, 25 Jun 2011 20:43:59 +0200 MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106252043.59444.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 18:45:40 -0000 On Saturday 25 June 2011 20:26:19 Gavin Atkinson wrote: > On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Sat Jun 25 15:46:24 2011 > > New Revision: 223537 > > URL: http://svn.freebsd.org/changeset/base/223537 > > > > Log: > > - Remove duplicate USB ID. > > Are you sure? > > > Modified: > > head/sys/dev/usb/wlan/if_zyd.c > > > > Modified: head/sys/dev/usb/wlan/if_zyd.c > > ========================================================================= > > ===== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:42:33 > > 2011 (r223536) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:46:24 > > 2011 (r223537) @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID > > zyd_devs > > > > ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), > > ZYD_ZD1211_DEV(ZYXEL, G200V2), > > /* ZYD_ZD1211B */ > > > > - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > > > > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > > ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), > > gavin@psi:/home/gavin 110% grep SMCWUSBG > /usr/freebsd/head/sys/dev/usb/usbdevs > product ACCTON SMCWUSBG_NF 0x4505 SMCWUSB-G (no firmware) > product ACCTON SMCWUSBG 0x4506 SMCWUSB-G > > This SMCWUSBG_NF ID was only added three months ago, in r219982. The > other ID has been in the driver since it was first committed. > > Gavin Hi, vendor ACCTON 0x083a Accton Technology If I'm not mistaken, this ID is supposed to be handled by uath.conf, see below. http://svnweb.freebsd.org/base/head/etc/devd/uath.conf?revision=207020&view=markup 5 # Accton 6 # SMCWUSB-G and SMCWUSBT-G2 7 notify 100 { 8 match "system" "USB"; 9 match "subsystem" "DEVICE"; 10 match "type" "ATTACH"; 11 match "vendor" "0x083a"; 12 match "product" "(0x4505|0x4507)"; 13 action "/usr/sbin/uathload -d /dev/$cdev"; 14 }; I think not both of if_zyd and uath.conf should handle this ID. Correct me if I'm wrong. According to the other entries, only the no-firmware ones are supposed to be listed in uath.conf, while the firmware ones in xxx.ko. --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 18:53:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 642E01065695; Sat, 25 Jun 2011 18:53:04 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 20A008FC0C; Sat, 25 Jun 2011 18:53:02 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=7KD0iiTHYGd0xbPMAUtcJ3OZoqPCTpa2X22hnPESm4A= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=vURWEZHBcHsA:10 a=dBRESv0yCI8A:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=fh6wi9jYsf1mfZj4V1QA:9 a=TOBH0rrRZHg1JD0bXIAA:7 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 143144136; Sat, 25 Jun 2011 20:42:59 +0200 Received-SPF: softfail receiver=mailfe05.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Gavin Atkinson Date: Sat, 25 Jun 2011 20:41:19 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106251546.p5PFkPrp012994@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106252041.19851.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 18:53:04 -0000 On Saturday 25 June 2011 20:26:19 Gavin Atkinson wrote: > On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Sat Jun 25 15:46:24 2011 > > New Revision: 223537 > > URL: http://svn.freebsd.org/changeset/base/223537 > > > > Log: > > - Remove duplicate USB ID. > > Are you sure? > > > Modified: > > head/sys/dev/usb/wlan/if_zyd.c > > > > Modified: head/sys/dev/usb/wlan/if_zyd.c > > ========================================================================= > > ===== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:42:33 > > 2011 (r223536) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:46:24 > > 2011 (r223537) @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID > > zyd_devs > > > > ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), > > ZYD_ZD1211_DEV(ZYXEL, G200V2), > > /* ZYD_ZD1211B */ > > > > - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > > > > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > > ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), > > gavin@psi:/home/gavin 110% grep SMCWUSBG > /usr/freebsd/head/sys/dev/usb/usbdevs > product ACCTON SMCWUSBG_NF 0x4505 SMCWUSB-G (no firmware) > product ACCTON SMCWUSBG 0x4506 SMCWUSB-G > > This SMCWUSBG_NF ID was only added three months ago, in r219982. The > other ID has been in the driver since it was first committed. > > Gavin Hi, vendor ACCTON 0x083a Accton Technology If I'm not mistaken, this ID is supposed to be handled by uath.conf, see below. http://svnweb.freebsd.org/base/head/etc/devd/uath.conf?revision=207020&view=markup 5 # Accton 6 # SMCWUSB-G and SMCWUSBT-G2 7 notify 100 { 8 match "system" "USB"; 9 match "subsystem" "DEVICE"; 10 match "type" "ATTACH"; 11 match "vendor" "0x083a"; 12 match "product" "(0x4505|0x4507)"; 13 action "/usr/sbin/uathload -d /dev/$cdev"; 14 }; I think not both of if_zyd and uath.conf should handle this ID. Correct me if I'm wrong. According to the other entries, only the no-firmware ones are supposed to be listed in uath.conf, while the firmware ones in xxx.ko. --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 18:53:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412D6106564A; Sat, 25 Jun 2011 18:53:21 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id ECF9B8FC18; Sat, 25 Jun 2011 18:53:19 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=EIZfbDsN8gr1c4B7uGrP4foh/gtfZ6zZRee2cLtKwTU= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=vURWEZHBcHsA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=Vps-brQPRbC3WPJlKagA:9 a=fQqhcABWXOeJUu3UN3kA:7 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 145270374; Sat, 25 Jun 2011 20:53:18 +0200 From: Hans Petter Selasky To: Gavin Atkinson Date: Sat, 25 Jun 2011 20:51:38 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106252043.59444.hselasky@c2i.net> In-Reply-To: <201106252043.59444.hselasky@c2i.net> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106252051.38956.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , kevlo@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 18:53:21 -0000 On Saturday 25 June 2011 20:43:59 Hans Petter Selasky wrote: > On Saturday 25 June 2011 20:26:19 Gavin Atkinson wrote: > > On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Sat Jun 25 15:46:24 2011 > > > New Revision: 223537 > > > URL: http://svn.freebsd.org/changeset/base/223537 > > > > > > Log: > > > - Remove duplicate USB ID. > > > > Are you sure? > > > > > Modified: > > > head/sys/dev/usb/wlan/if_zyd.c > > > > > > Modified: head/sys/dev/usb/wlan/if_zyd.c > > > ======================================================================= > > > == ===== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:42:33 > > > 2011 (r223536) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jun 25 15:46:24 > > > 2011 (r223537) @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID > > > zyd_devs > > > > > > ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), > > > ZYD_ZD1211_DEV(ZYXEL, G200V2), > > > /* ZYD_ZD1211B */ > > > > > > - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > > > > > > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > > > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > > > ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), > > > > gavin@psi:/home/gavin 110% grep SMCWUSBG > > /usr/freebsd/head/sys/dev/usb/usbdevs > > product ACCTON SMCWUSBG_NF 0x4505 SMCWUSB-G (no firmware) > > product ACCTON SMCWUSBG 0x4506 SMCWUSB-G > > > > This SMCWUSBG_NF ID was only added three months ago, in r219982. The > > other ID has been in the driver since it was first committed. > > > > Gavin > > Hi, > > vendor ACCTON 0x083a Accton Technology > > If I'm not mistaken, this ID is supposed to be handled by uath.conf, see > below. > > http://svnweb.freebsd.org/base/head/etc/devd/uath.conf?revision=207020&view > =markup > > 5 # Accton > 6 # SMCWUSB-G and SMCWUSBT-G2 > 7 notify 100 { > 8 match "system" "USB"; > 9 match "subsystem" "DEVICE"; > 10 match "type" "ATTACH"; > 11 match "vendor" "0x083a"; > 12 match "product" "(0x4505|0x4507)"; > 13 action "/usr/sbin/uathload -d /dev/$cdev"; > 14 }; > > I think not both of if_zyd and uath.conf should handle this ID. Correct me > if I'm wrong. According to the other entries, only the no-firmware ones > are supposed to be listed in uath.conf, while the firmware ones in xxx.ko. > > --HPS Hi, I see a minor bug here: %grep -r ACCTON /sys/dev/usb/wlan/if_zyd.c ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), ZYD_ZD1211B_DEV(ACCTON, ZD1211B), %grep -r ACCTON /sys/dev/usb/wlan/if_uath.c UATH_DEV(ACCTON, SMCWUSBG), UATH_DEV(ACCTON, SMCWUSBTG2), Which one of these drivers support the SMCWUSBG ? --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 18:57:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF6E106564A; Sat, 25 Jun 2011 18:57:27 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id EC44C8FC25; Sat, 25 Jun 2011 18:57:25 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=EIZfbDsN8gr1c4B7uGrP4foh/gtfZ6zZRee2cLtKwTU= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=vURWEZHBcHsA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=91p9J2_7p4pYmcHF-uwA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 145271099; Sat, 25 Jun 2011 20:57:24 +0200 From: Hans Petter Selasky To: Gavin Atkinson Date: Sat, 25 Jun 2011 20:55:45 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106252043.59444.hselasky@c2i.net> <201106252051.38956.hselasky@c2i.net> In-Reply-To: <201106252051.38956.hselasky@c2i.net> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106252055.45798.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , kevlo@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 18:57:27 -0000 On Saturday 25 June 2011 20:51:38 Hans Petter Selasky wrote: > On Saturday 25 June 2011 20:43:59 Hans Petter Selasky wrote: > > On Saturday 25 June 2011 20:26:19 Gavin Atkinson wrote: > > > On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > > Hi, > > I see a minor bug here: > > %grep -r ACCTON /sys/dev/usb/wlan/if_zyd.c > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > > %grep -r ACCTON /sys/dev/usb/wlan/if_uath.c > UATH_DEV(ACCTON, SMCWUSBG), > UATH_DEV(ACCTON, SMCWUSBTG2), > > Which one of these drivers support the SMCWUSBG ? > > --HPS Hi Gavin, Can you figure this out, which ID actually belongs to which driver and fix this in: if_zyd.c, if_uath.c and uath.conf ? --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 19:21:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B825106566B; Sat, 25 Jun 2011 19:21:54 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B47F8FC13; Sat, 25 Jun 2011 19:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PJLsNQ019358; Sat, 25 Jun 2011 19:21:54 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PJLsLO019356; Sat, 25 Jun 2011 19:21:54 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201106251921.p5PJLsLO019356@svn.freebsd.org> From: Joel Dahl Date: Sat, 25 Jun 2011 19:21: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: r223545 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 19:21:54 -0000 Author: joel (doc committer) Date: Sat Jun 25 19:21:54 2011 New Revision: 223545 URL: http://svn.freebsd.org/changeset/base/223545 Log: More accurate birthplace. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Jun 25 17:58:35 2011 (r223544) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Jun 25 19:21:54 2011 (r223545) @@ -289,7 +289,7 @@ 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 -10/20 Joel Dahl born in Lidkoping, Sweden, 1983 +10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 From owner-svn-src-head@FreeBSD.ORG Sat Jun 25 20:37:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C4D21065670; Sat, 25 Jun 2011 20:37:44 +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 4C3A88FC15; Sat, 25 Jun 2011 20:37:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PKbiFL021545; Sat, 25 Jun 2011 20:37:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PKbilr021544; Sat, 25 Jun 2011 20:37:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106252037.p5PKbilr021544@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 25 Jun 2011 20:37: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: r223546 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 20:37:44 -0000 Author: jilles Date: Sat Jun 25 20:37:43 2011 New Revision: 223546 URL: http://svn.freebsd.org/changeset/base/223546 Log: sh: Test that '!' is literal if quoted and first char of bracket expression This also works on stable/8. Added: head/tools/regression/bin/sh/builtins/case10.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/case10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case10.0 Sat Jun 25 20:37:43 2011 (r223546) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +case ! in +[\!!]) ;; +*) echo Failed at $LINENO ;; +esac + +case ! in +['!'!]) ;; +*) echo Failed at $LINENO ;; +esac + +case ! in +["!"!]) ;; +*) echo Failed at $LINENO ;; +esac