From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 00:14: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 21B28106566C; Sun, 13 Feb 2011 00:14:14 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA258FC0C; Sun, 13 Feb 2011 00:14:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1D0EDLX019628; Sun, 13 Feb 2011 00:14:13 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1D0ED5Q019625; Sun, 13 Feb 2011 00:14:13 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201102130014.p1D0ED5Q019625@svn.freebsd.org> From: Daniel Eischen Date: Sun, 13 Feb 2011 00:14: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: r218627 - in head/sys: kern 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: Sun, 13 Feb 2011 00:14:14 -0000 Author: deischen Date: Sun Feb 13 00:14:13 2011 New Revision: 218627 URL: http://svn.freebsd.org/changeset/base/218627 Log: Allow the SO_SETFIB socket option to select the default (0) routing table. Reviewed by: julian Modified: head/sys/kern/uipc_socket.c head/sys/netinet/udp_usrreq.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Feb 12 23:44:05 2011 (r218626) +++ head/sys/kern/uipc_socket.c Sun Feb 13 00:14:13 2011 (r218627) @@ -2449,15 +2449,16 @@ sosetopt(struct socket *so, struct socko case SO_SETFIB: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); - if (optval < 1 || optval > rt_numfibs) { + if (optval < 0 || optval > rt_numfibs) { error = EINVAL; goto bad; } - if ((so->so_proto->pr_domain->dom_family == PF_INET) || - (so->so_proto->pr_domain->dom_family == PF_ROUTE)) { + if (so->so_proto != NULL && + ((so->so_proto->pr_domain->dom_family == PF_INET) || + (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; /* Note: ignore error */ - if (so->so_proto && so->so_proto->pr_ctloutput) + if (so->so_proto->pr_ctloutput) (*so->so_proto->pr_ctloutput)(so, sopt); } else { so->so_fibnum = 0; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Feb 12 23:44:05 2011 (r218626) +++ head/sys/netinet/udp_usrreq.c Sun Feb 13 00:14:13 2011 (r218627) @@ -486,6 +486,10 @@ udp_input(struct mbuf *m, int off) INP_RUNLOCK(inp); continue; } + if (imo == NULL) { + INP_RUNLOCK(inp); + continue; + } bzero(&group, sizeof(struct sockaddr_in)); group.sin_len = sizeof(struct sockaddr_in); group.sin_family = AF_INET; From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 04: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 D4CE31065670; Sun, 13 Feb 2011 04:44:06 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4C328FC14; Sun, 13 Feb 2011 04:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1D4i6RE025660; Sun, 13 Feb 2011 04:44:06 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1D4i6XS025658; Sun, 13 Feb 2011 04:44:06 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201102130444.p1D4i6XS025658@svn.freebsd.org> From: Daniel Eischen Date: Sun, 13 Feb 2011 04: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: r218629 - 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: Sun, 13 Feb 2011 04:44:06 -0000 Author: deischen Date: Sun Feb 13 04:44:06 2011 New Revision: 218629 URL: http://svn.freebsd.org/changeset/base/218629 Log: Oops, revert an accidental local change that got added in my last commit (r218627). No damage was done in the last commit, just some duplicated code was added (which is now removed). Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sun Feb 13 03:20:44 2011 (r218628) +++ head/sys/netinet/udp_usrreq.c Sun Feb 13 04:44:06 2011 (r218629) @@ -486,10 +486,6 @@ udp_input(struct mbuf *m, int off) INP_RUNLOCK(inp); continue; } - if (imo == NULL) { - INP_RUNLOCK(inp); - continue; - } bzero(&group, sizeof(struct sockaddr_in)); group.sin_len = sizeof(struct sockaddr_in); group.sin_family = AF_INET; From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 06:19: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 DB64B106566C; Sun, 13 Feb 2011 06:19:38 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBEFE8FC08; Sun, 13 Feb 2011 06:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1D6JcfE027863; Sun, 13 Feb 2011 06:19:38 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1D6Jc4h027861; Sun, 13 Feb 2011 06:19:38 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201102130619.p1D6Jc4h027861@svn.freebsd.org> From: Martin Wilke Date: Sun, 13 Feb 2011 06:19: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: r218631 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 06:19:39 -0000 Author: miwi (doc,ports committer) Date: Sun Feb 13 06:19:38 2011 New Revision: 218631 URL: http://svn.freebsd.org/changeset/base/218631 Log: - Added following port committers: Marcus von Appen (mva@) (mentor: beech, miwi) Dennis Herrmann (dhn@) (mentor: tabthorpe, miwi) Brendan Fabeny (bf@) (mentor: makc, miwi) Kris Moore (kmoore@) (mentor: brooks, miwi) Sylvio Cesar Teixeira (mentor: itetcu, miwi) Lars Engels (lme) (mentor: miwi) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Feb 13 05:56:00 2011 (r218630) +++ head/share/misc/committers-ports.dot Sun Feb 13 06:19:38 2011 (r218631) @@ -59,6 +59,7 @@ bapt [label="Baptiste Daroussin\nbapt@Fr beat [label="Beat Gaetzi\nbeat@FreeBSD.org\n2009/01/28"] beech [label="Beech Rintoul\nbeech@FreeBSD.org\n2007/05/30"] bland [label="Alexander Nedotsukov\nbland@FreeBSD.org\n2003/08/14"] +bf [label="Brendan Fabeny\nbf@FreeBSD.org\n2010/06/02"] brix [label="Henrik Brix Andersen\nbrix@FreeBSD.org\n2007/10/31"] brooks [label="Brooks Davies\nbrooks@FreeBSD.org\n2004/05/03"] bsam [label="Boris Samorodov\nbsam@FreeBSD.org\n2006/07/20"] @@ -73,6 +74,7 @@ db [label="Diane Bruce\ndb@FreeBSD.org\n decke [label="Bernhard Froehlich\ndecke@FreeBSD.org\n2010/03/21"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/01"] demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] +dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] @@ -105,6 +107,7 @@ jylefort [label="Jean-Yves Lefort\njylef kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2003/02/21"] knu [label="Akinori Musha\nknu@FreeBSD.org\n2000/03/22"] krion [label="Kirill Ponomarew\nkrion@FreeBSD.org\n2003/07/20"] +kmoore [label="Kris Moore\nkmoore@FreeBSD.org\n2009/04/14"] kwm [label="Koop Mast\nkwm@FreeBSD.org\n2004/09/14"] koitsu [label="Jeremy Chadwick\nkoitsu@FreeBSD.org\n2006/11/10"] laszlof [label="Frank Laszlo\nlaszlof@FreeBSD.org\n2006/11/07"] @@ -115,6 +118,7 @@ lev [label="Lev Serebryakov\nlev@FreeBSD linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2003/10/23"] lioux [label="Mario Sergio Fujikawa Ferriera\nlioux@FreeBSD.org\n2000/10/14"] lippe [label="Felippe de Meirelles Motta\nlippe@FreeBSD.org\n2008/03/08"] +lme [label="Lars Engels\nlme@FreeBSD.org\n2007/07/09"] lth [label="Lars Thegler\nlth@FreeBSD.org\n2004/05/04"] lwhsu [label="Li-Wen Hsu\nlwhsu@FreeBSD.org\n2007/04/03"] lx [label="David Thiel\nlx@FreeBSD.org\n2006/11/29"] @@ -128,6 +132,7 @@ mezz [label="Jeremy Messenger\nmezz@Free miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] mm [label="Martin Matuska\nmm@FreeBSD.org\n2007/04/04"] mnag [label="Marcus Alves Grando\nmnag@FreeBSD.org\n2005/09/15"] +mva [label="Marcus von Appen\nmva@FreeBSD.org\n2009/02/16"] nemoliu [label="Tong Liu\nnemoliu@FreeBSD.org\n2007/04/25"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2002/03/19"] nobutaka [label="Nobutaka Mantani\nnobutaka@FreeBSD.org\n2001/11/02"] @@ -157,6 +162,7 @@ sobomax[label="Maxim Sobolev\nsobomax@Fr stas [label="Stanislav Sedov\nstas@FreeBSD.org\n2006/09/18"] stefan [label="Stefan Walter\nstefan@FreeBSD.org\n2006/05/07"] sunpoet [label="Po-Chuan Hsieh\nsunpoet@FreeBSD.org\n2010/09/21"] +sylvio [label="Sylvio Cesar Teixeira\nsylvio@FreeBSD.org\n2009/10/29"] swills [label="Steve Wills\nswills@FreeBSD.org\n2010/09/03"] tabthorpe [label="Thomas Abthorpe\ntabthorpe@FreeBSD.org\n2007/08/20"] tdb [label="Tim Bishop\ntdb@FreeBSD.org\n2005/11/30"] @@ -203,6 +209,8 @@ beech -> mva billf -> sobomax billf -> will +brooks -> kmoore + clement -> tdb clement -> lawrance @@ -263,6 +271,7 @@ ijliao -> leeym itetcu -> araujo itetcu -> dryice itetcu -> sahil +itetcu -> sylvio jadawin -> bapt jadawin -> flo @@ -300,6 +309,8 @@ marcus -> bland marcus -> eik marcus -> jmallett +makc -> bf + mat -> thierry mezz -> tmclaugh @@ -307,14 +318,19 @@ mezz -> tmclaugh miwi -> amdmi3 miwi -> avilla miwi -> beat +miwi -> bf miwi -> decke +miwi -> dhn miwi -> farrokhi miwi -> fluffy miwi -> gahr +miwi -> kmoore +miwi -> lme miwi -> makc miwi -> mandree miwi -> mva miwi -> nox +miwi -> sylvio miwi -> tabthorpe miwi -> trasz miwi -> wen @@ -374,6 +390,7 @@ tabthorpe -> ashish tabthorpe -> avilla tabthorpe -> avl tabthorpe -> bapt +tabthorpe -> dhn tabthorpe -> fluffy tabthorpe -> jacula tabthorpe -> jadawin From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 10:51: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 D1BCC1065679; Sun, 13 Feb 2011 10:51:35 +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 5688A8FC14; Sun, 13 Feb 2011 10:51:34 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1DApVa6002454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Feb 2011 21:51:32 +1100 Date: Sun, 13 Feb 2011 21:51:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201102121312.p1CDCjhD002584@svn.freebsd.org> Message-ID: <20110213213251.B1474@besplex.bde.org> References: <201102121312.p1CDCjhD002584@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: r218603 - head/sbin/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: Sun, 13 Feb 2011 10:51:35 -0000 On Sat, 12 Feb 2011, Konstantin Belousov wrote: > Log: > When creating a directory entry for the journal, always read at least > the fragment, and write the full block. Reading less might not work > due to device sector size bigger then size of direntries in the > last directory fragment. I think it should always write full fragments too (and the kernel should always read/write in units of fragments, not sectors of any size). > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Sat Feb 12 12:52:12 2011 (r218602) > +++ head/sbin/tunefs/tunefs.c Sat Feb 12 13:12:45 2011 (r218603) > @@ -733,16 +740,19 @@ dir_extend(ufs2_daddr_t blk, ufs2_daddr_ > { > char block[MAXBSIZE]; > > - if (bread(&disk, fsbtodb(&sblock, blk), block, size) <= 0) { > + if (bread(&disk, fsbtodb(&sblock, blk), block, > + roundup(size, sblock.fs_fsize)) <= 0) { Rounding up to a fragment boundary is spelled fragroundup(fs, size) in ffs. This use fs->fs_qfmask and fs->fs_fmask for optimality. It is unclear if the kernel macros work in userland, but here we already use fsbtodb() which uses fs->fsbtodb for optimality. [I've just learned again about fragroundup() after trying to fix rounding in cluster_read(). See blksize(). Since cluster_read() doesn't know about the fragment size or the fs dependencies in blksize(), it cannot read ahead correctly across i/o size boundaries (exactly one of which occurs near EOF for almost all files with fragments in ffs). This bug is missing in old breadn() -- it can even handle multiple i/o size boundaries, since it is passed a separate size for every block.] Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 12: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 975D5106566B; Sun, 13 Feb 2011 12:31:01 +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 F30DC8FC1B; Sun, 13 Feb 2011 12:31:00 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1DCUu7F015281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Feb 2011 23:30:57 +1100 Date: Sun, 13 Feb 2011 23:30:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201102121317.p1CDHE9v002742@svn.freebsd.org> Message-ID: <20110213215436.L1544@besplex.bde.org> References: <201102121317.p1CDHE9v002742@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: r218604 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 12:31:01 -0000 On Sat, 12 Feb 2011, Konstantin Belousov wrote: > Log: > In checker, read journal by sectors. > > Due to UFS insistence to pretend that device sector size is 512 bytes, Do you mean that ffs_fsck does this? UFS doesn't exist, and ffs in the kernel didn't use device sectors at all until recently (it used DEV_BSIZE units, but those are not sectors but are the units for bread() and friends). newfs uses a hack to do this. When handling kernel sizes in units of DEV_BSIZE (not a sector size!), ffs_fsck should use DEV_BSIZE (or maybe just fsbtodb()) instead of `dev_bsize' or `sectorsize' and not pretend that DEV_BSIZE (or the corresponding superblock value for the conversion macro) is the sector size. > sector size is obtained from ioctl(DIOCGSECTORSIZE) for real devices, > and from the label otherwise. The file images without label have to > be made with 512 sector size. > Modified: head/sbin/fsck_ffs/fsck.h > ============================================================================== > --- head/sbin/fsck_ffs/fsck.h Sat Feb 12 13:12:45 2011 (r218603) > +++ head/sbin/fsck_ffs/fsck.h Sat Feb 12 13:17:14 2011 (r218604) > @@ -268,6 +268,7 @@ char snapname[BUFSIZ]; /* when doing sna > char *cdevname; /* name of device being checked */ > long dev_bsize; /* computed value of DEV_BSIZE */ > long secsize; /* actual disk sector size */ > +long real_dev_bsize; If `secsize' is the actual disk sector size, then we don't need another variable giving the real sector size. The new variable has no comment. What is the difference between a sector size and a dev_bsize? There is enough confusion between DEV_BSIZE and sector sizes already. DEV_BSIZE has come to means nothing to do with sectors and little to do with devices or block sizes. It is just a minimal i/o sizes for use in old interfaces (ones that didn't want to use more than 32 bits for disk addresses, but now use 64 bits anyway, so that they can address 72 bits after multiplication by DEV_BSIZE). These variables are named and documented slightly better in mkfs: % extern int sectorsize; /* bytes/sector */ % extern int realsectorsize; /* bytes/sector in hardware*/ At lease the fake sector size variable doesn't claim to be actual, and the real sector size variable doesn't have extra underscores and claims to be a sector size variable. > Modified: head/sbin/fsck_ffs/setup.c > ============================================================================== > --- head/sbin/fsck_ffs/setup.c Sat Feb 12 13:12:45 2011 (r218603) > +++ head/sbin/fsck_ffs/setup.c Sat Feb 12 13:17:14 2011 (r218604) > @@ -446,7 +446,7 @@ sblock_init(void) > if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL) > errx(EEXIT, "cannot allocate space for superblock"); > if ((lp = getdisklabel(NULL, fsreadfd))) > - dev_bsize = secsize = lp->d_secsize; > + real_dev_bsize = dev_bsize = secsize = lp->d_secsize; > else > dev_bsize = secsize = DEV_BSIZE; > } Both the variables are real enough here, provided getdisklabel() works. Otherwise, you are in trouble and should fail instead of defaulting the size unless the size is set by another means. newfs seems to fail, and I'm sure newfs_msdos does fail if the sector size is unknown. > Modified: head/sbin/fsck_ffs/suj.c > ============================================================================== > --- head/sbin/fsck_ffs/suj.c Sat Feb 12 13:12:45 2011 (r218603) > +++ head/sbin/fsck_ffs/suj.c Sat Feb 12 13:17:14 2011 (r218604) > @@ -28,6 +28,7 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > #include > @@ -201,6 +202,11 @@ opendisk(const char *devnam) > disk->d_error); > } > fs = &disk->d_fs; > + if (real_dev_bsize == 0 && ioctl(disk->d_fd, DIOCGSECTORSIZE, > + &real_dev_bsize) == -1) > + real_dev_bsize = secsize; > + if (debug) > + printf("dev_bsize %ld\n", real_dev_bsize); > } > > /* If this gives a different "real_dev_bsize", and this is different from the sector size in the label or defaulted-to, then the latter is presumably wrong, and we're left with a `secsize' that is not the "actual sector size". It is a bug to replace the sector size in the label with the one obtained here. The former should be correct, and it is the only one under user control. It might need to be changed if one given by the ioctl is wrong or just if it is fake. (Labels only have 32-bit disk addresses, so fake sector sizes are needed to address more than 41 bits if the physical sector size has is 512.) newfs doesn't have the precedence that I want: - sectorsize set on the command line (-S option) has precedence. [Bug; -S 0 is needed to cancel any previous setting of sectorsize on the command line by -S or maybe by -T, but it is treated as an error.] fsck_ffs unfortunately doesn't seem to have any -S or -T option. These used to be unneeded since sector size weren't used, and labels worked and contain enough info to locate the superblock where there is more info. - then try setting sectorsize using the ioctl if sectorsize is not already set. [Bug: no error checking for this ioctl. If it fails, then it may clobber sectorsize, which breaks the next step.] - then set sectorsize from the label if there is a label and sectorsize is not already set - fail if sectorsize is not set Then the hacks involving realsectorsize: - set it to sectorsize - if sectorsize != DEV_BSIZE, change it to DEV_BSIZE and fix up related quantities (I hope the change to the partition table is never written). Now `sectorsize' is no longer "actual", though it was actual before the hacks. We continue with the actual sector size recorded in realsectorsize. > @@ -2262,7 +2268,7 @@ suj_build(void) > rec = (union jrec *)seg->ss_blk; > for (i = 0; i < seg->ss_rec.jsr_cnt; off += JREC_SIZE, rec++) { > /* skip the segrec. */ > - if ((off % DEV_BSIZE) == 0) > + if ((off % real_dev_bsize) == 0) > continue; > switch (rec->rec_jrefrec.jr_op) { > case JOP_ADDREF: > ... This is all sort of backwards. DEV_BSIZE is the real DEV_BSIZE. Old code that uses units of DEV_BSIZE spells this as dev_bsize although it is constant. New code that uses units of sectors spelled this as DEV_BSIZE although the correct size is variable; now the new code spelled this as real_dev_bsize, which is variable but unrelated to dev_bsize = DEV_BSIZE :-). I think using fragments instead of sectors would work better. For a start, you can get the fragment size from the superblock and not have to worry about labels of ioctls. There is a problem locating the superblock. The kernel and various utilities only try reading the superblock with size SBSIZE (8K). This fails if the sector size is not a divisor of 8K. They also only try reading at various offsets which might not be a multiple of the sector size, but which are larger than 8K so they are more likely to be a multiple. I fixed this problem in fsck_msdosfs where it is larger (fsck_msdosfs assumes that the sector size is a divisor of 512, but sector sizes like 2K and 4K are now common relative to sizes of 16K). Hmm, the initialization of dev_bsize is even more obfuscated than I remembered: % /* % * Compute block size that the file system is based on, % * according to fsbtodb, and adjust superblock block number % * so we can tell if this is an alternate later. % */ % super *= dev_bsize; We may have needed a fake sector size to read the superblock. I forget if we got a non-fake one from the label or ioctl before here. We should have just tried all reasonable power of 2 sizes between 1 and 1M (I use 64K down to DOSBOOTBLOCKSIZE = 512 in fsck_msdosfs). % dev_bsize = sblock.fs_fsize / fsbtodb(&sblock, 1); This is an obfuscated way of spelling DEV_BSIZE. Although fsbtodb() converts to blocks with fixed size DEV_BSIZE, it needs a variable shift count to handle the variable fragment size. This shift count is fs_fsbtodb, which was initialized in newfs to ilog2(fs_fsize / sectorsize). But sectorsize was fake there (always DEV_BSIZE). Suppose for example than fs_fsize is the default (2K). Then fs_fsbtodb = ilog2(4) = 2, so fsbtodb(&sbblock, 1) is 4 and dev_bsize = 2K / 4 = DEV_BSIZE again. It is always DEV_BSIZE again, since the fake sectorsize in newfs is always DEV_BSIZE. The fakery is extended to fsck_ffs by the above assignment. The above assignment is necessary if the kernel is changed to not fake things so much, or to fake them differently (newfs can't can change it's i/o methods but can't change the generated fs_fsbtodb etc. unless the kernel changes. All it could do much better is to make the conversions between different block sizes (real and virtual either way) more explicit). However, things are already confusing enough with a fixed DEV_BSIZE. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 12:55: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 C5FF4106566B; Sun, 13 Feb 2011 12:55:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3138FC1D; Sun, 13 Feb 2011 12:55:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 456CA41C7CF; Sun, 13 Feb 2011 13:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ETuigWYn7rgD; Sun, 13 Feb 2011 13:55:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 8CC1341C7C3; Sun, 13 Feb 2011 13:55:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 023134448F3; Sun, 13 Feb 2011 12:52:51 +0000 (UTC) Date: Sun, 13 Feb 2011 12:52:50 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Bruce Evans In-Reply-To: <20110213215436.L1544@besplex.bde.org> Message-ID: <20110213124436.E13400@maildrop.int.zabbadoz.net> References: <201102121317.p1CDHE9v002742@svn.freebsd.org> <20110213215436.L1544@besplex.bde.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov Subject: Re: svn commit: r218604 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 12:55:08 -0000 On Sun, 13 Feb 2011, Bruce Evans wrote: > On Sat, 12 Feb 2011, Konstantin Belousov wrote: > >> Log: >> In checker, read journal by sectors. >> >> Due to UFS insistence to pretend that device sector size is 512 bytes, [long explanation stripped] I don't claim to understand a word; all I know is that you can now put a su+j on top of say: mdconfig -s 128M -S 4096 or a geli on top of a real disk as given in the first example in geli(8). Previously either would panic as fast as: newfs .. tunefs -j eanble .. mount .. /mnt mkdir /mnt/x *kaboom* If you want to change the names and macros and arithmetics I am all fine if it's (as I try to understand) unified, but then make sure the above works well and that all cases on top of it work again afterwards. Thanks:) -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 13:11: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 3A6A31065674; Sun, 13 Feb 2011 13:11:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275468FC1F; Sun, 13 Feb 2011 13:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DDB10R039707; Sun, 13 Feb 2011 13:11:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DDB1l8039705; Sun, 13 Feb 2011 13:11:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102131311.p1DDB1l8039705@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Feb 2011 13:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218637 - head/tools/tools/ath/ath_ee_v14_print X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 13:11:01 -0000 Author: adrian Date: Sun Feb 13 13:11:00 2011 New Revision: 218637 URL: http://svn.freebsd.org/changeset/base/218637 Log: * add in new EEPROM fields from later revisions * add in printing futureBase Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c ============================================================================== --- head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Sun Feb 13 11:10:57 2011 (r218636) +++ head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Sun Feb 13 13:11:00 2011 (r218637) @@ -87,6 +87,7 @@ eeprom_v14_base_print(uint16_t *buf) { HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; BASE_EEP_HEADER *eh = &eep->ee_base.baseEepHeader; + int i; printf("| Version: 0x%.4x | Length: 0x%.4x | Checksum: 0x%.4x ", eh->version, eh->length, eh->checksum); @@ -104,14 +105,22 @@ eeprom_v14_base_print(uint16_t *buf) (int) eh->pwdclkind, (int) eh->fastClk5g, (int) eh->divChain, (int) eh->rxGainType); - printf("| dacHiPwrMode: 0x%.2x | openLoopPwrCntl: 0x%.2x | dacLpMode: 0x%.2x ", - (int) eh->dacHiPwrMode, (int) eh->openLoopPwrCntl, (int) eh->dacLpMode); + printf("| dacHiPwrMode_5G: 0x%.2x | openLoopPwrCntl: 0x%.2x | dacLpMode: 0x%.2x ", + (int) eh->dacHiPwrMode_5G, (int) eh->openLoopPwrCntl, (int) eh->dacLpMode); printf("| txGainType: 0x%.2x | rcChainMask: 0x%.2x |\n", (int) eh->txGainType, (int) eh->rcChainMask); + printf("| desiredScaleCCK: 0x%.2x | pwr_table_offset: 0x%.2x | frac_n_5g: %.2x\n", + (int) eh->desiredScaleCCK, (int) eh->pwr_table_offset, (int) eh->frac_n_5g); + /* because it's convienent */ printf("| antennaGainMax[0]: 0x%.2x antennaGainMax[1]: 0x%.2x |\n", eep->ee_antennaGainMax[0], eep->ee_antennaGainMax[1]); + + printf(" | futureBase:"); + for (i = 0; i < sizeof(eh->futureBase) / sizeof(uint8_t); i++) + printf(" %.2x", (int) eh->futureBase[i]); + printf("\n"); } static void From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 13:14: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 948B7106564A; Sun, 13 Feb 2011 13:14:17 +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 A0A2A8FC18; Sun, 13 Feb 2011 13:14:16 +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 p1DDEBnQ073045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Feb 2011 15:14:11 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p1DDEBmV030252; Sun, 13 Feb 2011 15:14:11 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p1DDEBww030251; Sun, 13 Feb 2011 15:14:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 13 Feb 2011 15:14:11 +0200 From: Kostik Belousov To: Bruce Evans Message-ID: <20110213131411.GI78089@deviant.kiev.zoral.com.ua> References: <201102121317.p1CDHE9v002742@svn.freebsd.org> <20110213215436.L1544@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ve0F8fDhlCYJZdTN" Content-Disposition: inline In-Reply-To: <20110213215436.L1544@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, 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: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218604 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 13:14:17 -0000 --Ve0F8fDhlCYJZdTN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 13, 2011 at 11:30:56PM +1100, Bruce Evans wrote: > On Sat, 12 Feb 2011, Konstantin Belousov wrote: >=20 > >Log: > > In checker, read journal by sectors. > > > > Due to UFS insistence to pretend that device sector size is 512 bytes, >=20 > Do you mean that ffs_fsck does this? UFS doesn't exist, and ffs in the > kernel didn't use device sectors at all until recently (it used DEV_BSIZE > units, but those are not sectors but are the units for bread() and friend= s). Yes, the journal writer started using DEV_BSIZE as _sector_ size to write the journal blocks, and fixing this was the point of the series of commits. Journal was unoperable on the providers with non-512 byte sectors. > newfs uses a hack to do this. When handling kernel sizes in units of > DEV_BSIZE (not a sector size!), ffs_fsck should use DEV_BSIZE (or maybe > just fsbtodb()) instead of `dev_bsize' or `sectorsize' and not > pretend that DEV_BSIZE (or the corresponding superblock value for the > conversion macro) is the sector size. >=20 > > sector size is obtained from ioctl(DIOCGSECTORSIZE) for real devices, > > and from the label otherwise. The file images without label have to > > be made with 512 sector size. >=20 > >Modified: head/sbin/fsck_ffs/fsck.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/sbin/fsck_ffs/fsck.h Sat Feb 12 13:12:45 2011 (r218603) > >+++ head/sbin/fsck_ffs/fsck.h Sat Feb 12 13:17:14 2011 (r218604) > >@@ -268,6 +268,7 @@ char snapname[BUFSIZ]; /* when doing sna > >char *cdevname; /* name of device being checked */ > >long dev_bsize; /* computed value of DEV_BSIZE */ > >long secsize; /* actual disk sector size */ > >+long real_dev_bsize; >=20 > If `secsize' is the actual disk sector size, then we don't need another > variable giving the real sector size. >=20 > The new variable has no comment. What is the difference between a sector > size and a dev_bsize? There is enough confusion between DEV_BSIZE and > sector sizes already. DEV_BSIZE has come to means nothing to do with > sectors and little to do with devices or block sizes. It is just a minim= al > i/o sizes for use in old interfaces (ones that didn't want to use more th= an > 32 bits for disk addresses, but now use 64 bits anyway, so that they can > address 72 bits after multiplication by DEV_BSIZE). There is no "actual" difference (I tired of the word actual when debugging the patches), they are all DEV_BSIZE. >=20 > These variables are named and documented slightly better in mkfs: >=20 > % extern int sectorsize; /* bytes/sector */ > % extern int realsectorsize; /* bytes/sector in hardware*/ >=20 > At lease the fake sector size variable doesn't claim to be actual, and > the real sector size variable doesn't have extra underscores and claims > to be a sector size variable. >=20 > >Modified: head/sbin/fsck_ffs/setup.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/fsck_ffs/setup.c Sat Feb 12 13:12:45 2011 (r218603) > >+++ head/sbin/fsck_ffs/setup.c Sat Feb 12 13:17:14 2011 (r218604) > >@@ -446,7 +446,7 @@ sblock_init(void) > > if (sblk.b_un.b_buf =3D=3D NULL || asblk.b_un.b_buf =3D=3D NULL) > > errx(EEXIT, "cannot allocate space for superblock"); > > if ((lp =3D getdisklabel(NULL, fsreadfd))) > >- dev_bsize =3D secsize =3D lp->d_secsize; > >+ real_dev_bsize =3D dev_bsize =3D secsize =3D lp->d_secsize; > > else > > dev_bsize =3D secsize =3D DEV_BSIZE; > >} >=20 > Both the variables are real enough here, provided getdisklabel() works. > Otherwise, you are in trouble and should fail instead of defaulting the > size unless the size is set by another means. newfs seems to fail, and > I'm sure newfs_msdos does fail if the sector size is unknown. >=20 > >Modified: head/sbin/fsck_ffs/suj.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/fsck_ffs/suj.c Sat Feb 12 13:12:45 2011 (r218603) > >+++ head/sbin/fsck_ffs/suj.c Sat Feb 12 13:17:14 2011 (r218604) > >@@ -28,6 +28,7 @@ > >__FBSDID("$FreeBSD$"); > > > >#include > >+#include > >#include > >#include > >#include > >@@ -201,6 +202,11 @@ opendisk(const char *devnam) > > disk->d_error); > > } > > fs =3D &disk->d_fs; > >+ if (real_dev_bsize =3D=3D 0 && ioctl(disk->d_fd, DIOCGSECTORSIZE, > >+ &real_dev_bsize) =3D=3D -1) > >+ real_dev_bsize =3D secsize; > >+ if (debug) > >+ printf("dev_bsize %ld\n", real_dev_bsize); > >} > > > >/* >=20 > If this gives a different "real_dev_bsize", and this is different from the > sector size in the label or defaulted-to, then the latter is presumably > wrong, and we're left with a `secsize' that is not the "actual sector siz= e". Yes, secsize is not the "actual sector size", it is equal to DEV_BSIZE, see setup.c:sblock_init(). >=20 > It is a bug to replace the sector size in the label with the one obtained > here. The former should be correct, and it is the only one under user > control. It might need to be changed if one given by the ioctl is wrong > or just if it is fake. (Labels only have 32-bit disk addresses, so fake > sector sizes are needed to address more than 41 bits if the physical sect= or > size has is 512.) >=20 > newfs doesn't have the precedence that I want: > - sectorsize set on the command line (-S option) has precedence. [Bug; > -S 0 is needed to cancel any previous setting of sectorsize on the > command line by -S or maybe by -T, but it is treated as an error.] > fsck_ffs unfortunately doesn't seem to have any -S or -T option. These > used to be unneeded since sector size weren't used, and labels worked > and contain enough info to locate the superblock where there is more > info. > - then try setting sectorsize using the ioctl if sectorsize is not already > set. [Bug: no error checking for this ioctl. If it fails, then it > may clobber sectorsize, which breaks the next step.] > - then set sectorsize from the label if there is a label and sectorsize > is not already set > - fail if sectorsize is not set newfs.c does not do what you describe, in fact. After going to all troubles finding the sector size, it performs the following: if (sectorsize !=3D DEV_BSIZE) { /* XXX */ int secperblk =3D sectorsize / DEV_BSIZE; sectorsize =3D DEV_BSIZE; fssize *=3D secperblk; if (pp !=3D NULL) pp->p_size *=3D secperblk; } And now layout calculations happen as if sector size is 512 bytes. I was puzzled for long time why libufs givess me 512 in d_bsize for a volume over 4096-bytes per sector md: disk->d_bsize =3D fs->fs_fsize / fsbtodb(fs, 1); >=20 > Then the hacks involving realsectorsize: > - set it to sectorsize > - if sectorsize !=3D DEV_BSIZE, change it to DEV_BSIZE and fix up related > quantities (I hope the change to the partition table is never written). > Now `sectorsize' is no longer "actual", though it was actual before the > hacks. We continue with the actual sector size recorded in=20 > realsectorsize. realsectorsize is not used. You are citing the piece of code I pasted above. >=20 > >@@ -2262,7 +2268,7 @@ suj_build(void) > > rec =3D (union jrec *)seg->ss_blk; > > for (i =3D 0; i < seg->ss_rec.jsr_cnt; off +=3D JREC_SIZE,=20 > > rec++) { > > /* skip the segrec. */ > >- if ((off % DEV_BSIZE) =3D=3D 0) > >+ if ((off % real_dev_bsize) =3D=3D 0) > > continue; > > switch (rec->rec_jrefrec.jr_op) { > > case JOP_ADDREF: > >... >=20 > This is all sort of backwards. DEV_BSIZE is the real DEV_BSIZE. Old code > that uses units of DEV_BSIZE spells this as dev_bsize although it is > constant. New code that uses units of sectors spelled this as DEV_BSIZE > although the correct size is variable; now the new code spelled this as > real_dev_bsize, which is variable but unrelated to dev_bsize =3D DEV_BSIZ= E=20 > :-). We need to write the journal block atomically, and device/geom level only provides that: - we must write at least sector; - any write bigger then sector is not atomic. >=20 > I think using fragments instead of sectors would work better. For a star= t, > you can get the fragment size from the superblock and not have to worry > about labels of ioctls. No, it would not, since fragment write can be non-atomic. >=20 > There is a problem locating the superblock. The kernel and various > utilities only try reading the superblock with size SBSIZE (8K). This > fails if the sector size is not a divisor of 8K. They also only try > reading at various offsets which might not be a multiple of the sector > size, but which are larger than 8K so they are more likely to be a > multiple. I fixed this problem in fsck_msdosfs where it is larger > (fsck_msdosfs assumes that the sector size is a divisor of 512, but > sector sizes like 2K and 4K are now common relative to sizes of 16K). >=20 > Hmm, the initialization of dev_bsize is even more obfuscated than I > remembered: >=20 > % /* > % * Compute block size that the file system is based on, > % * according to fsbtodb, and adjust superblock block number > % * so we can tell if this is an alternate later. > % */ > % super *=3D dev_bsize; >=20 > We may have needed a fake sector size to read the superblock. I forget if > we got a non-fake one from the label or ioctl before here. We should have > just tried all reasonable power of 2 sizes between 1 and 1M (I use > 64K down to DOSBOOTBLOCKSIZE =3D 512 in fsck_msdosfs). >=20 > % dev_bsize =3D sblock.fs_fsize / fsbtodb(&sblock, 1); >=20 > This is an obfuscated way of spelling DEV_BSIZE. Although fsbtodb() > converts to blocks with fixed size DEV_BSIZE, it needs a variable shift > count to handle the variable fragment size. This shift count is > fs_fsbtodb, which was initialized in newfs to > ilog2(fs_fsize / sectorsize). But sectorsize was fake there > (always DEV_BSIZE). Suppose for example than fs_fsize is the default > (2K). Then fs_fsbtodb =3D ilog2(4) =3D 2, so fsbtodb(&sbblock, 1) is 4 > and dev_bsize =3D 2K / 4 =3D DEV_BSIZE again. It is always DEV_BSIZE aga= in, > since the fake sectorsize in newfs is always DEV_BSIZE. The fakery is > extended to fsck_ffs by the above assignment. The above assignment is > necessary if the kernel is changed to not fake things so much, or to > fake them differently (newfs can't can change it's i/o methods but can't > change the generated fs_fsbtodb etc. unless the kernel changes. All it > could do much better is to make the conversions between different block > sizes (real and virtual either way) more explicit). However, things > are already confusing enough with a fixed DEV_BSIZE. Again, you are describing what I pasted above, and what I referred to as "UFS (ok, FFS) pretending that sector size is 512 bytes". I agree that it would be cleaner if FFS does not make such obscuring arithmetic, but it did not matter while i/o was done in units of whole fragments. Journal requirements are different. --Ve0F8fDhlCYJZdTN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1X2SIACgkQC3+MBN1Mb4hGJACfUvdEVje1OLZamE9cVtDKFqcY 7dgAoLnMYTVl21xIyzO8lQ9tUnJKTDpV =yLzZ -----END PGP SIGNATURE----- --Ve0F8fDhlCYJZdTN-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 13:53: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 AE602106566C; Sun, 13 Feb 2011 13:53:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2AA8FC08; Sun, 13 Feb 2011 13:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DDrSH7040702; Sun, 13 Feb 2011 13:53:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DDrScv040700; Sun, 13 Feb 2011 13:53:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201102131353.p1DDrScv040700@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 Feb 2011 13:53: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: r218639 - 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: Sun, 13 Feb 2011 13:53:28 -0000 Author: tuexen Date: Sun Feb 13 13:53:28 2011 New Revision: 218639 URL: http://svn.freebsd.org/changeset/base/218639 Log: Fix several bugs related to stream scheduling. Obtained from: Robin Seggelmann MFC after: 3 months. Modified: head/sys/netinet/sctp_ss_functions.c Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Sun Feb 13 13:21:55 2011 (r218638) +++ head/sys/netinet/sctp_ss_functions.c Sun Feb 13 13:53:28 2011 (r218639) @@ -59,11 +59,9 @@ sctp_ss_default_init(struct sctp_tcb *st * stream queues to the wheel. */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_add(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); } return; } @@ -72,14 +70,19 @@ static void sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_remove(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -100,7 +103,9 @@ sctp_ss_default_add(struct sctp_tcb *stc if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -126,11 +131,16 @@ sctp_ss_default_remove(struct sctp_tcb * struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next != NULL || + strq->ss_params.rr.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, @@ -244,7 +254,8 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -271,48 +282,20 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st * Always interates the streams in ascending order and * only fills messages of the same stream in a packet. */ -static void -sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_stream_out *strq, - struct sctp_stream_queue_pending *sp, int holds_lock) +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) { - struct sctp_stream_out *strqt; - - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { - TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - while (strqt != NULL && strqt->stream_no < strq->stream_no) { - strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - } - if (strqt != NULL) { - TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); - } else { - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } - } - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } - return; + return asoc->last_out_stream; } -static struct sctp_stream_out * -sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_association *asoc) { struct sctp_stream_out *strq, *strqt; strqt = asoc->last_out_stream; - if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { - return (strqt); - } rrp_again: /* Find the next stream to use */ if (strqt == NULL) { @@ -339,53 +322,13 @@ rrp_again: TAILQ_FIRST(&strq->outqueue)->net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) { if (strq == asoc->last_out_stream) { - return (NULL); + strq = NULL; } else { strqt = strq; goto rrp_again; } } } - return (strq); -} - -static void -sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, - struct sctp_association *asoc) -{ - struct sctp_stream_out *strq, *strqt; - - strqt = asoc->last_out_stream; -rrp_pd_again: - /* Find the next stream to use */ - if (strqt == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } else { - strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } - } - - /* - * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destination requested - * by the caller. Note that if we turn out to be locked to a stream - * (assigning TSN's then we must stop, since we cannot look for - * another stream with data to send to that destination). In CMT's - * case, by skipping this check, we will send one data packet - * towards the requested net. - */ - if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && - (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { - if (strq == asoc->last_out_stream) { - strq = NULL; - } else { - strqt = strq; - goto rrp_pd_again; - } - } asoc->last_out_stream = strq; return; } @@ -399,14 +342,23 @@ static void sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) - stcb->asoc.strmout[i].ss_params.prio.priority = 0; - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.prio.priority = 0; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.prio.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -434,7 +386,9 @@ sctp_ss_prio_add(struct sctp_tcb *stcb, if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next == NULL) && (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); @@ -461,11 +415,16 @@ sctp_ss_prio_remove(struct sctp_tcb *stc struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next != NULL || + strq->ss_params.prio.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.prio.next_spoke); @@ -477,7 +436,7 @@ sctp_ss_prio_remove(struct sctp_tcb *stc asoc->last_out_stream = NULL; } } - TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; } @@ -502,7 +461,7 @@ prio_again: strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); if (strqn != NULL && strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { - strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + strq = strqn; } else { strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); } @@ -565,15 +524,22 @@ static void sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) { - stcb->asoc.strmout[i].ss_params.fb.rounds = -1; - } - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.fb.rounds = -1; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.fb.next_spoke); + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -599,11 +565,12 @@ sctp_ss_fb_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (!TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.fb.rounds < 0) + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next == NULL) && + (strq->ss_params.fb.next_spoke.tqe_prev == NULL)) { + if (strq->ss_params.fb.rounds < 0) strq->ss_params.fb.rounds = TAILQ_FIRST(&strq->outqueue)->length; - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -616,11 +583,16 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next != NULL || + strq->ss_params.fb.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.fb.next_spoke); @@ -632,7 +604,6 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, asoc->last_out_stream = NULL; } } - strq->ss_params.fb.rounds = -1; TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; @@ -649,20 +620,19 @@ sctp_ss_fb_select(struct sctp_tcb *stcb, { struct sctp_stream_out *strq = NULL, *strqt; - if (TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { + if (asoc->last_out_stream == NULL || + TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); } else { - if (asoc->last_out_stream != NULL) { - strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } + strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); } do { - if ((strqt != NULL) && TAILQ_FIRST(&strqt->outqueue) && - TAILQ_FIRST(&strqt->outqueue)->net != NULL && - ((net == NULL || TAILQ_FIRST(&strqt->outqueue)->net == net) || - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0))) { + if ((strqt != NULL) && + ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0) || + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0 && + (net == NULL || (TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net == NULL) || + (net != NULL && TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net != NULL && + TAILQ_FIRST(&strqt->outqueue)->net == net))))) { if ((strqt->ss_params.fb.rounds >= 0) && (strq == NULL || strqt->ss_params.fb.rounds < strq->ss_params.fb.rounds)) { strq = strqt; @@ -748,9 +718,15 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb int clear_values, int holds_lock) { if (clear_values) { + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } while (!TAILQ_EMPTY(&asoc->ss_data.out_list)) { TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), ss_next); } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } } return; } @@ -880,7 +856,7 @@ struct sctp_ss_functions sctp_ss_functio .sctp_ss_init = sctp_ss_default_init, .sctp_ss_clear = sctp_ss_default_clear, .sctp_ss_init_stream = sctp_ss_default_init_stream, - .sctp_ss_add_to_stream = sctp_ss_rrp_add, + .sctp_ss_add_to_stream = sctp_ss_rr_add, .sctp_ss_is_empty = sctp_ss_default_is_empty, .sctp_ss_remove_from_stream = sctp_ss_default_remove, .sctp_ss_select_stream = sctp_ss_rrp_select, From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 14:46: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 3FAB7106566B; Sun, 13 Feb 2011 14:46: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 2C8B18FC16; Sun, 13 Feb 2011 14:46:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DEkeD0041941; Sun, 13 Feb 2011 14:46:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DEkeSQ041938; Sun, 13 Feb 2011 14:46:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102131446.p1DEkeSQ041938@svn.freebsd.org> From: Alan Cox Date: Sun, 13 Feb 2011 14:46: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: r218640 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 14:46:40 -0000 Author: alc Date: Sun Feb 13 14:46:39 2011 New Revision: 218640 URL: http://svn.freebsd.org/changeset/base/218640 Log: Eliminate tn_reg.tn_aobj_pages. Instead, correctly maintain the vm object's size field. Previously, that field was always zero, even when the object tn_reg.tn_aobj contained numerous pages. Apply style fixes to tmpfs_reg_resize(). In collaboration with: kib Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sun Feb 13 13:53:28 2011 (r218639) +++ head/sys/fs/tmpfs/tmpfs.h Sun Feb 13 14:46:39 2011 (r218640) @@ -283,7 +283,6 @@ struct tmpfs_node { * issue the required page ins or page outs whenever * a position within the file is accessed. */ vm_object_t tn_aobj; - size_t tn_aobj_pages; }tn_reg; Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Feb 13 13:53:28 2011 (r218639) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Feb 13 14:46:39 2011 (r218640) @@ -146,7 +146,6 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp nnode->tn_reg.tn_aobj = vm_pager_allocate(OBJT_SWAP, NULL, 0, VM_PROT_DEFAULT, 0, NULL /* XXXKIB - tmpfs needs swap reservation */); - nnode->tn_reg.tn_aobj_pages = 0; break; default: @@ -184,7 +183,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp void tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node) { - size_t pages = 0; + vm_object_t uobj; #ifdef INVARIANTS TMPFS_NODE_LOCK(node); @@ -220,9 +219,13 @@ tmpfs_free_node(struct tmpfs_mount *tmp, break; case VREG: - if (node->tn_reg.tn_aobj != NULL) - vm_object_deallocate(node->tn_reg.tn_aobj); - pages = node->tn_reg.tn_aobj_pages; + uobj = node->tn_reg.tn_aobj; + if (uobj != NULL) { + TMPFS_LOCK(tmp); + tmp->tm_pages_used -= uobj->size; + TMPFS_UNLOCK(tmp); + vm_object_deallocate(uobj); + } break; default: @@ -231,10 +234,6 @@ tmpfs_free_node(struct tmpfs_mount *tmp, free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); - - TMPFS_LOCK(tmp); - tmp->tm_pages_used -= pages; - TMPFS_UNLOCK(tmp); } /* --------------------------------------------------------------------- */ @@ -884,16 +883,20 @@ tmpfs_dir_whiteout_remove(struct vnode * int tmpfs_reg_resize(struct vnode *vp, off_t newsize) { - int error; - size_t newpages, oldpages; struct tmpfs_mount *tmp; struct tmpfs_node *node; + vm_object_t uobj; + vm_page_t m; + vm_pindex_t newpages, oldpages; off_t oldsize; + size_t zerolen; + int error; MPASS(vp->v_type == VREG); MPASS(newsize >= 0); node = VP_TO_TMPFS_NODE(vp); + uobj = node->tn_reg.tn_aobj; tmp = VFS_TO_TMPFS(vp->v_mount); /* Convert the old and new sizes to the number of pages needed to @@ -901,9 +904,9 @@ tmpfs_reg_resize(struct vnode *vp, off_t * because the last allocated page can accommodate the change on * its own. */ oldsize = node->tn_size; - oldpages = round_page(oldsize) / PAGE_SIZE; - MPASS(oldpages == node->tn_reg.tn_aobj_pages); - newpages = round_page(newsize) / PAGE_SIZE; + oldpages = OFF_TO_IDX(oldsize + PAGE_MASK); + MPASS(oldpages == uobj->size); + newpages = OFF_TO_IDX(newsize + PAGE_MASK); if (newpages > oldpages && newpages - oldpages > TMPFS_PAGES_AVAIL(tmp)) { @@ -911,48 +914,39 @@ tmpfs_reg_resize(struct vnode *vp, off_t goto out; } - node->tn_reg.tn_aobj_pages = newpages; - TMPFS_LOCK(tmp); tmp->tm_pages_used += (newpages - oldpages); TMPFS_UNLOCK(tmp); node->tn_size = newsize; vnode_pager_setsize(vp, newsize); + VM_OBJECT_LOCK(uobj); if (newsize < oldsize) { - size_t zerolen = round_page(newsize) - newsize; - vm_object_t uobj = node->tn_reg.tn_aobj; - vm_page_t m; - /* * free "backing store" */ - VM_OBJECT_LOCK(uobj); if (newpages < oldpages) { - swap_pager_freespace(uobj, - newpages, oldpages - newpages); - vm_object_page_remove(uobj, - OFF_TO_IDX(newsize + PAGE_MASK), 0, FALSE); + swap_pager_freespace(uobj, newpages, oldpages - + newpages); + vm_object_page_remove(uobj, newpages, 0, FALSE); } /* * zero out the truncated part of the last page. */ - + zerolen = round_page(newsize) - newsize; if (zerolen > 0) { m = vm_page_grab(uobj, OFF_TO_IDX(newsize), VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - pmap_zero_page_area(m, PAGE_SIZE - zerolen, - zerolen); + pmap_zero_page_area(m, PAGE_SIZE - zerolen, zerolen); } - VM_OBJECT_UNLOCK(uobj); - } - + uobj->size = newpages; + VM_OBJECT_UNLOCK(uobj); error = 0; out: - return error; + return (error); } /* --------------------------------------------------------------------- */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 14:48: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 17E0D1065693; Sun, 13 Feb 2011 14:48:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06358FC17; Sun, 13 Feb 2011 14:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DEmB2a042009; Sun, 13 Feb 2011 14:48:11 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DEmBC5042007; Sun, 13 Feb 2011 14:48:11 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201102131448.p1DEmBC5042007@svn.freebsd.org> From: Randall Stewart Date: Sun, 13 Feb 2011 14:48: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: r218641 - 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: Sun, 13 Feb 2011 14:48:12 -0000 Author: rrs Date: Sun Feb 13 14:48:11 2011 New Revision: 218641 URL: http://svn.freebsd.org/changeset/base/218641 Log: Fix a bug reported by Jonathan Leighton in his web-sctp testing at the Univ-of-Del. Basically when a 1-to-1 socket did a socket/bind/send(data)/close. If the timing was right we would dereference a socket that is NULL. MFC after: 1 month Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Feb 13 14:46:39 2011 (r218640) +++ head/sys/netinet/sctp_input.c Sun Feb 13 14:48:11 2011 (r218641) @@ -2865,24 +2865,31 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } #endif - soisconnected(stcb->sctp_socket); + if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { + soisconnected(stcb->sctp_socket); + } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); /* * since we did not send a HB make sure we don't double * things */ net->hb_responded = 1; + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { + /* + * We don't need to do the asconf thing, nor hb or + * autoclose if the socket is closed. + */ + goto closed_socket; + } + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + + if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, @@ -2906,6 +2913,7 @@ sctp_handle_cookie_ack(struct sctp_cooki #endif } } +closed_socket: /* Toss the cookie if I can */ sctp_toss_old_cookies(stcb, asoc); if (!TAILQ_EMPTY(&asoc->sent_queue)) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 15:14: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 BF9571065696; Sun, 13 Feb 2011 15:14: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 AE3C28FC0A; Sun, 13 Feb 2011 15:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DFED3a042665; Sun, 13 Feb 2011 15:14:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DFEDbv042663; Sun, 13 Feb 2011 15:14:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102131514.p1DFEDbv042663@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Feb 2011 15:14: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: r218642 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 15:14:13 -0000 Author: adrian Date: Sun Feb 13 15:14:13 2011 New Revision: 218642 URL: http://svn.freebsd.org/changeset/base/218642 Log: This should be TX stream, not RX stream. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sun Feb 13 14:48:11 2011 (r218641) +++ head/sys/dev/ath/if_ath_tx_ht.c Sun Feb 13 15:14:13 2011 (r218642) @@ -131,7 +131,7 @@ ath_rateseries_setup(struct ath_softc *s series[i].PktDuration = ath_computedur_ht(pktlen , txrate - , ic->ic_rxstream + , ic->ic_txstream , (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) , series[i].RateFlags & HAL_RATESERIES_HALFGI); } else { From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 16:07: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 4245F1065674; Sun, 13 Feb 2011 16:07:14 +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 971A18FC13; Sun, 13 Feb 2011 16:07:13 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1DG79h6025189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Feb 2011 03:07:10 +1100 Date: Mon, 14 Feb 2011 03:07:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20110213131411.GI78089@deviant.kiev.zoral.com.ua> Message-ID: <20110214005846.X2133@besplex.bde.org> References: <201102121317.p1CDHE9v002742@svn.freebsd.org> <20110213215436.L1544@besplex.bde.org> <20110213131411.GI78089@deviant.kiev.zoral.com.ua> 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: r218604 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 16:07:14 -0000 On Sun, 13 Feb 2011, Kostik Belousov wrote: > On Sun, Feb 13, 2011 at 11:30:56PM +1100, Bruce Evans wrote: >> On Sat, 12 Feb 2011, Konstantin Belousov wrote: >> >>> Log: >>> In checker, read journal by sectors. >>> >>> Due to UFS insistence to pretend that device sector size is 512 bytes, >> >> Do you mean that ffs_fsck does this? UFS doesn't exist, and ffs in the >> kernel didn't use device sectors at all until recently (it used DEV_BSIZE >> units, but those are not sectors but are the units for bread() and friends). > Yes, the journal writer started using DEV_BSIZE as _sector_ size to > write the journal blocks, and fixing this was the point of the series > of commits. Journal was unoperable on the providers with non-512 byte > sectors. I now think userland shouldn't use any kernel sizes (DEV_BSIZE, ffs frag size, or ffs block size, otherfs block sizes) for i/o. It can use the disk sector size (if any), but that will be bad for performance so it normally should't be used either, and there is no need to determine it (just use a large size that works). Some reblocking from fs block sizes to good i/o sizes may be needed, especially if the sizes that works is large (say 256K -- you would use it as a cache and reblock to it). This is best done using block devices so that even 1-byte i/o's are reblocked with no extra code, but block devices are axed in FreeBSD. >>> Modified: head/sbin/fsck_ffs/fsck.h >>> ============================================================================== >>> --- head/sbin/fsck_ffs/fsck.h Sat Feb 12 13:12:45 2011 (r218603) >>> +++ head/sbin/fsck_ffs/fsck.h Sat Feb 12 13:17:14 2011 (r218604) >>> @@ -268,6 +268,7 @@ char snapname[BUFSIZ]; /* when doing sna >>> char *cdevname; /* name of device being checked */ >>> long dev_bsize; /* computed value of DEV_BSIZE */ >>> long secsize; /* actual disk sector size */ >>> +long real_dev_bsize; >> >> If `secsize' is the actual disk sector size, then we don't need another >> variable giving the real sector size. >> >> The new variable has no comment. What is the difference between a sector >> size and a dev_bsize? There is enough confusion between DEV_BSIZE and >> sector sizes already. DEV_BSIZE has come to means nothing to do with >> sectors and little to do with devices or block sizes. It is just a minimal >> i/o sizes for use in old interfaces (ones that didn't want to use more than >> 32 bits for disk addresses, but now use 64 bits anyway, so that they can >> address 72 bits after multiplication by DEV_BSIZE). > There is no "actual" difference (I tired of the word actual when debugging > the patches), they are all DEV_BSIZE. Any chance of fixing the comment or removing one of the variables? I now see that secsize really is the actual sector size, modulo bugs (*), unlike in newfs, and it is used mainly to do i/o of a working size, with some rebocking, in fsutil.c. (*) Old bug: there was no call to DIOCGSECTORSIZE to determine the sector size, so if the label didn't give it then it could easily be wrong. New bug: DIOCGSECTORSIZE is now called, but it is only used to set real_dev_bsize. So the old code in fsutil.c doesn't benifit from the better determination of the sector size. I think it just fails if the label didn't give the size and the default of DEV_BSIZE is too small to work. suj.c also seems to be in error in calling bread() instead of blread(). This prevents any chance of the old code's reblocking to size secsize (I'm not sure if there is enough reblocking to work, but the old code only uses size secsize). All old parts of fsck_ffs call bread() via blread(). The only places that call bread() directly are suj.c (many times) and gjournal.c (once). real_dev_bsize still seems bogus. DEV_BSIZE is the real DEV_BSIZE. I think you mainly want an i/o size that works. This can be secsize, as in old code, provided that is initialized correctly. In my fixes in fsck_msdosfs, the i/o size that works (except while probing for one that works) is named iosize. >>> Modified: head/sbin/fsck_ffs/setup.c >>> ============================================================================== >>> --- head/sbin/fsck_ffs/setup.c Sat Feb 12 13:12:45 2011 (r218603) >>> +++ head/sbin/fsck_ffs/setup.c Sat Feb 12 13:17:14 2011 (r218604) >>> @@ -446,7 +446,7 @@ sblock_init(void) >>> if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL) >>> errx(EEXIT, "cannot allocate space for superblock"); >>> if ((lp = getdisklabel(NULL, fsreadfd))) >>> - dev_bsize = secsize = lp->d_secsize; >>> + real_dev_bsize = dev_bsize = secsize = lp->d_secsize; >>> else >>> dev_bsize = secsize = DEV_BSIZE; >>> } >> >> Both the variables are real enough here, provided getdisklabel() works. >> Otherwise, you are in trouble and should fail instead of defaulting the >> size unless the size is set by another means. newfs seems to fail, and >> I'm sure newfs_msdos does fail if the sector size is unknown. >> >>> Modified: head/sbin/fsck_ffs/suj.c >>> ============================================================================== >>> --- head/sbin/fsck_ffs/suj.c Sat Feb 12 13:12:45 2011 (r218603) >>> +++ head/sbin/fsck_ffs/suj.c Sat Feb 12 13:17:14 2011 (r218604) >>> @@ -28,6 +28,7 @@ >>> __FBSDID("$FreeBSD$"); >>> >>> #include >>> +#include >>> #include >>> #include >>> #include >>> @@ -201,6 +202,11 @@ opendisk(const char *devnam) >>> disk->d_error); >>> } >>> fs = &disk->d_fs; >>> + if (real_dev_bsize == 0 && ioctl(disk->d_fd, DIOCGSECTORSIZE, >>> + &real_dev_bsize) == -1) >>> + real_dev_bsize = secsize; >>> + if (debug) >>> + printf("dev_bsize %ld\n", real_dev_bsize); >>> } >>> >>> /* >> >> If this gives a different "real_dev_bsize", and this is different from the >> sector size in the label or defaulted-to, then the latter is presumably >> wrong, and we're left with a `secsize' that is not the "actual sector size". > Yes, secsize is not the "actual sector size", it is equal to DEV_BSIZE, > see setup.c:sblock_init(). DEV_BSIZE is only the default there. When there is a label, all of real_dev_bsize, dev_bsize and secsize are set to lp->d_secsize. lp->d_secsize is set by g_sectorsize(), so it shouldn't be completely wrong. I don't believe in g, but it is an anachronism to start using DIOCGSECTORSIZE in fsck_ffs long after bsdlabel was changed to use g_sectorsize() instead. >> newfs doesn't have the precedence that I want: >> - sectorsize set on the command line (-S option) has precedence. [Bug; >> -S 0 is needed to cancel any previous setting of sectorsize on the >> command line by -S or maybe by -T, but it is treated as an error.] >> fsck_ffs unfortunately doesn't seem to have any -S or -T option. These >> used to be unneeded since sector size weren't used, and labels worked >> and contain enough info to locate the superblock where there is more >> info. >> - then try setting sectorsize using the ioctl if sectorsize is not already >> set. [Bug: no error checking for this ioctl. If it fails, then it >> may clobber sectorsize, which breaks the next step.] >> - then set sectorsize from the label if there is a label and sectorsize >> is not already set >> - fail if sectorsize is not set > newfs.c does not do what you describe, in fact. After going to all > troubles finding the sector size, it performs the following: Er that is what I described -- first it determines the sector size as described above; then it clobbers the sector size as below:: > > if (sectorsize != DEV_BSIZE) { /* XXX */ > int secperblk = sectorsize / DEV_BSIZE; > > sectorsize = DEV_BSIZE; > fssize *= secperblk; > if (pp != NULL) > pp->p_size *= secperblk; > } > > And now layout calculations happen as if sector size is 512 bytes. except it preserves the original size in `realsectorsize' before clobbering `sectorsize'. My description of these points quoted far below. > I was > puzzled for long time why libufs givess me 512 in d_bsize for a volume over > 4096-bytes per sector md: > disk->d_bsize = fs->fs_fsize / fsbtodb(fs, 1); Yes, it is very confusing, and becomes even more confusing with even more block size variables that don't match their name and/or comments. This reminds me that libufs may be part of the problem. ffs utilities used to have very simple read and write routines. Now they use libufs. libufs is so uneasy to use that newfs has even lost its error checking for its most critical write -- sbwrite(). The error checking used to be in the low-level write routine (it was to print a message and exit IIRC). Now libufs just returns an error code, and none of the sbwrite() calls in newfs check for errors. Back to the current problem. libufs needs a block size in a couple of places, and it uses disk->d_bsize. The above is its main initialization. There are considerable possibilities for d_bsize being inconsistent with ffs, or with the faked block sizes in utilites, or just not working since it is not a multiple of the sector size. Here are all reference to d_bsize in libufs: % block.c: cnt = pread(disk->d_fd, p2, size, (off_t)(blockno * disk->d_bsize)); % block.c: cnt = pwrite(disk->d_fd, data, size, (off_t)(blockno * disk->d_bsize)); % block.c: ioarg[0] = blockno * disk->d_bsize; For the offset calculations, disk->d_bsize should be spelled DEV_BSIZE. Require all callers to pass block numbers in DEV_BSIZE units. Don't try to be more general than the kernel. fsdbtodb() will convert fs block numbers into DEV_BSIZE units for us in most cases. % bread.3:.Va d_bsize % libufs.h: long d_bsize; /* device bsize */ The comment adds nothing. As elsewhere, this has little to do with devices, but is block size for talking to the historical kernel interfaces bread(9) and friends. It is always DEV_BSIZE in the kernel. That won't change, and neither will DEV_BSIZE change from 512, since these are only historical interfaces. Any interface changes would be to use units of 1 byte. % sblock.c: disk->d_bsize = fs->fs_fsize / fsbtodb(fs, 1); Same calculation as in fsck_ffs. Always gives DEV_BSIZE. % sblock.c: disk->d_sblock = superblock / disk->d_bsize; % sblock.c: disk->d_sblock = disk->d_fs.fs_sblockloc / disk->d_bsize; % type.c: disk->d_bsize = 1; Hopefully nver used. >> Then the hacks involving realsectorsize: >> - set it to sectorsize >> - if sectorsize != DEV_BSIZE, change it to DEV_BSIZE and fix up related >> quantities (I hope the change to the partition table is never written). >> Now `sectorsize' is no longer "actual", though it was actual before the >> hacks. We continue with the actual sector size recorded in >> realsectorsize. > realsectorsize is not used. You are citing the piece of code I pasted above. I only said that realsectorsize is inititialized :-). But it is used, just once, a few lines later to un-rescale pp->p_size. (This is also confusing. pp->p_size is in units of sectors and shouldn't need rescaling. It just needs initialization if there is no label to begin with. When there is a label to begin with, and the sector size is not DEV_BSIZE, we seem to end up with no change by bogusly rescaling then undoing this. The case where their is no label to begin with has less-localized code and I didn't check it.) >>> @@ -2262,7 +2268,7 @@ suj_build(void) >>> rec = (union jrec *)seg->ss_blk; >>> for (i = 0; i < seg->ss_rec.jsr_cnt; off += JREC_SIZE, >>> rec++) { >>> /* skip the segrec. */ >>> - if ((off % DEV_BSIZE) == 0) >>> + if ((off % real_dev_bsize) == 0) >>> continue; >>> switch (rec->rec_jrefrec.jr_op) { >>> case JOP_ADDREF: >>> ... >> >> This is all sort of backwards. DEV_BSIZE is the real DEV_BSIZE. Old code >> that uses units of DEV_BSIZE spells this as dev_bsize although it is >> constant. New code that uses units of sectors spelled this as DEV_BSIZE >> although the correct size is variable; now the new code spelled this as >> real_dev_bsize, which is variable but unrelated to dev_bsize = DEV_BSIZE >> :-). > We need to write the journal block atomically, and device/geom level only > provides that: > - we must write at least sector; > - any write bigger then sector is not atomic. Does it really operate on active file systems/devices? We use libufs, and it is not clear how atomic that is. I think it should provide caching. I thought that the old fsck_ffs code would do i/o of the correct size (it uses secsize), but there are minor problems: - it does some caching. Seems to be not a problem here, since blwrite() doesn't use the cache (as in the kernel). - blwrite() first tries to write with the specified size. It does no reblocking. It doesn't actually use secsize. If the first try fails, then it retries 1 "sector" at a time using the non-sector size dev_bsize. - blread() is similar, except it retries using the sector size secsize and has different printfs for errors when dev_bsize differs from both secsize and 1. We can easily gaurantee than blwrite() doesn't do unwanted caching or reblocking. It writes directly. It reblocks in the error case, but that is null provided the original size is the sector size blwrite() uses the correct size for the retry. Original sizes smaller than the sector size just won't work, unless the sector size is virtual and larger than the physical sector size. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 17:43: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 B2D41106566B; Sun, 13 Feb 2011 17:43:56 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A17548FC21; Sun, 13 Feb 2011 17:43:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DHhuX3045902; Sun, 13 Feb 2011 17:43:56 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DHhutb045900; Sun, 13 Feb 2011 17:43:56 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102131743.p1DHhutb045900@svn.freebsd.org> From: Bruce Cran Date: Sun, 13 Feb 2011 17:43: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: r218645 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 17:43:56 -0000 Author: brucec Date: Sun Feb 13 17:43:56 2011 New Revision: 218645 URL: http://svn.freebsd.org/changeset/base/218645 Log: Document some more sysconf(3) variables. MFC after: 1 month Modified: head/lib/libc/gen/sysconf.3 Modified: head/lib/libc/gen/sysconf.3 ============================================================================== --- head/lib/libc/gen/sysconf.3 Sun Feb 13 16:18:22 2011 (r218644) +++ head/lib/libc/gen/sysconf.3 Sun Feb 13 17:43:56 2011 (r218645) @@ -28,7 +28,7 @@ .\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 14, 2006 +.Dd February 13, 2011 .Dt SYSCONF 3 .Os .Sh NAME @@ -85,6 +85,9 @@ The number of processors currently onlin The maximum number of open files per user id. .It Li _SC_PAGESIZE The size of a system page in bytes. +.It Li _SC_PAGE_SIZE +Equivalent to +.Li _SC_PAGESIZE . .It Li _SC_STREAM_MAX The minimum maximum number of streams that a process may have open at any one time. @@ -160,10 +163,64 @@ otherwise \-1. .It Li _SC_2_UPE Return 1 if the system supports the User Portability Utilities Option, otherwise \-1. +.It Li _SC_AIO_LISTIO_MAX +Maximum number of I/O operations in a single list I/O call supported. +.It Li _SC_AIO_MAX +Maximum number of outstanding asynchronous I/O operations supported. +.It Li _SC_AIO_PRIO_DELTA_MAX +The maximum amount by which a process can decrease its asynchronous I/O +priority level from its own scheduling priority. +.It Li _SC_DELAYTIMER_MAX +Maximum number of timer expiration overruns. +.It Li _SC_MQ_OPEN_MAX +The maximum number of open message queue descriptors a process may hold. +.It Li _SC_RTSIG_MAX +Maximum number of realtime signals reserved for application use. +.It Li _SC_SEM_NSEMS_MAX +Maximum number of semaphores that a process may have. +.It Li _SC_SEM_VALUE_MAX +The maximum value a semaphore may have. +.It Li _SC_SIGQUEUE_MAX +Maximum number of queued signals that a process may send and have pending at +the receiver(s) at any time. +.It Li _SC_TIMER_MAX +Maximum number of timers per process supported. +.It Li _SC_GETGR_R_SIZE_MAX +Suggested initial value for the size of the group entry buffer. +.It Li _SC_GETPW_R_SIZE_MAX +Suggested initial value for the size of the password entry buffer. +.It Li _SC_HOST_NAME_MAX +Maximum length of a host name (not including the terminating null) as +returned from the +.Fn gethostname +function. +.It Li _SC_LOGIN_NAME_MAX +Maximum length of a login name. +.It Li _SC_THREAD_STACK_MIN +Minimum size in bytes of thread stack storage. +.It Li _SC_THREAD_THREADS_MAX +Maximum number of threads that can be created per process. +.It Li _SC_TTY_NAME_MAX +Maximum length of terminal device name. +.It Li _SC_SYMLOOP_MAX +Maximum number of symbolic links that can be reliably traversed in the +resolution of a pathname in the absence of a loop. +.It Li _SC_ATEXIT_MAX +Maximum number of functions that may be registered with +.Fn atexit . +.It Li _SC_XOPEN_VERSION +An integer value greater than or equal to 4, +indicating the version of the X/Open Portability Guide to which this +system conforms. +.It Li _SC_XOPEN_XCU_VERSION +An integer value indicating the version of the XCU Specification to which +this system conforms. .El .Pp These values also exist, but may not be standard: .Bl -tag -width 6n +.It Li _SC_CPUSET_SIZE +Size of the kernel cpuset. .It Li _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible that the product of this value and the value of From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 17:56: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 358A51065670; Sun, 13 Feb 2011 17:56:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2438C8FC08; Sun, 13 Feb 2011 17:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DHuNuo046255; Sun, 13 Feb 2011 17:56:23 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DHuNWW046253; Sun, 13 Feb 2011 17:56:23 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102131756.p1DHuNWW046253@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Feb 2011 17:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218646 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 17:56:23 -0000 Author: dchagin Date: Sun Feb 13 17:56:22 2011 New Revision: 218646 URL: http://svn.freebsd.org/changeset/base/218646 Log: The bitset field of freshly created futex should be initialized explicity. Otherwise, REQUEUE operations fails. Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Feb 13 17:43:56 2011 (r218645) +++ head/sys/compat/linux/linux_futex.c Sun Feb 13 17:56:22 2011 (r218646) @@ -194,6 +194,7 @@ retry: tmpf = malloc(sizeof(*tmpf), M_FUTEX, M_WAITOK | M_ZERO); tmpf->f_uaddr = uaddr; tmpf->f_refcount = 1; + tmpf->f_bitset = FUTEX_BITSET_MATCH_ANY; FUTEX_INIT(tmpf); TAILQ_INIT(&tmpf->f_waiting_proc); From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 18:18: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 210691065695; Sun, 13 Feb 2011 18:18:58 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC8C8FC19; Sun, 13 Feb 2011 18:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DIIv8G046966; Sun, 13 Feb 2011 18:18:57 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DIIuLL046962; Sun, 13 Feb 2011 18:18:56 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102131818.p1DIIuLL046962@svn.freebsd.org> From: Bruce Cran Date: Sun, 13 Feb 2011 18:18: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: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 18:18:58 -0000 Author: brucec Date: Sun Feb 13 18:18:56 2011 New Revision: 218650 URL: http://svn.freebsd.org/changeset/base/218650 Log: Move potentially offensive fortune to fortunes-o. PR: bin/137702 MFC after: 3 days Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Sun Feb 13 18:08:53 2011 (r218649) +++ head/games/fortune/datfiles/fortunes Sun Feb 13 18:18:56 2011 (r218650) @@ -38136,10 +38136,6 @@ couldn't compete successfully with poets -- Kilgore Trout (Philip J. Farmer) "Venus on the Half Shell" % -PLATONIC FRIENDSHIP: - What develops when two people get - tired of making love to each other. -% Play Rogue, visit exotic locations, meet strange creatures and kill them. % Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Sun Feb 13 18:08:53 2011 (r218649) +++ head/games/fortune/datfiles/fortunes-o.real Sun Feb 13 18:18:56 2011 (r218650) @@ -10487,6 +10487,10 @@ Pile driver, n.: Planned Parenthood: The emission Control Center. % +PLATONIC FRIENDSHIP: + What develops when two people get + tired of making love to each other. +% Playing poker with busty Ms. Ware, He announced as he folded with flair, "I had four of a kind, From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 18:30: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 090A1106564A; Sun, 13 Feb 2011 18:30:18 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBFE08FC19; Sun, 13 Feb 2011 18:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DIUHQY047354; Sun, 13 Feb 2011 18:30:17 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DIUHHG047352; Sun, 13 Feb 2011 18:30:17 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102131830.p1DIUHHG047352@svn.freebsd.org> From: Bruce Cran Date: Sun, 13 Feb 2011 18:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218652 - head/sbin/mdconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 18:30:18 -0000 Author: brucec Date: Sun Feb 13 18:30:17 2011 New Revision: 218652 URL: http://svn.freebsd.org/changeset/base/218652 Log: Only print the unit number when invoked with the -n flag. PR: bin/144300 Submitted by: arundel MFC after: 3 days Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Sun Feb 13 18:21:41 2011 (r218651) +++ head/sbin/mdconfig/mdconfig.c Sun Feb 13 18:30:17 2011 (r218652) @@ -373,7 +373,7 @@ md_list(char *units, int opt) found = 1; } gc = &pp->lg_config; - printf("%s", pp->lg_name); + printf("%s", nflag ? pp->lg_name + 2 : pp->lg_name); if (opt & OPT_VERBOSE || opt & OPT_UNIT) { type = geom_config_get(gc, "type"); if (strcmp(type, "vnode") == 0) From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 18:41: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 F1A81106564A; Sun, 13 Feb 2011 18:41:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E05A48FC14; Sun, 13 Feb 2011 18:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DIfe7m047661; Sun, 13 Feb 2011 18:41:40 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DIfeLG047659; Sun, 13 Feb 2011 18:41:40 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102131841.p1DIfeLG047659@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Feb 2011 18:41: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: r218654 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 18:41:41 -0000 Author: dchagin Date: Sun Feb 13 18:41:40 2011 New Revision: 218654 URL: http://svn.freebsd.org/changeset/base/218654 Log: Stop printing the LOR, as this is expected behavior. Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Feb 13 18:35:21 2011 (r218653) +++ head/sys/compat/linux/linux_futex.c Sun Feb 13 18:41:40 2011 (r218654) @@ -88,7 +88,7 @@ struct futex_list futex_list; #define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) #define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) -#define FUTEX_INIT(f) sx_init_flags(&(f)->f_lck, "ftlk", 0) +#define FUTEX_INIT(f) sx_init_flags(&(f)->f_lck, "ftlk", SX_DUPOK) #define FUTEX_DESTROY(f) sx_destroy(&(f)->f_lck) #define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 18:46: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 DE6E11065675; Sun, 13 Feb 2011 18:46:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6138FC08; Sun, 13 Feb 2011 18:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DIkYXx047812; Sun, 13 Feb 2011 18:46:34 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DIkYn4047810; Sun, 13 Feb 2011 18:46:34 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102131846.p1DIkYn4047810@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Feb 2011 18:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218655 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 18:46:35 -0000 Author: dchagin Date: Sun Feb 13 18:46:34 2011 New Revision: 218655 URL: http://svn.freebsd.org/changeset/base/218655 Log: Remove comment about 'ftlk' LOR. Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Feb 13 18:41:40 2011 (r218654) +++ head/sys/compat/linux/linux_futex.c Sun Feb 13 18:46:34 2011 (r218655) @@ -553,8 +553,7 @@ linux_sys_futex(struct thread *td, struc /* * To avoid deadlocks return EINVAL if second futex - * exists at this time. Otherwise create the new futex - * and ignore false positive LOR which thus happens. + * exists at this time. * * Glibc fall back to FUTEX_WAKE in case of any error * returned by FUTEX_CMP_REQUEUE. From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19:07: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 A93EC106564A; Sun, 13 Feb 2011 19:07:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A398FC16; Sun, 13 Feb 2011 19:07:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJ7mnS048664; Sun, 13 Feb 2011 19:07:48 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJ7mZA048661; Sun, 13 Feb 2011 19:07:48 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102131907.p1DJ7mZA048661@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Feb 2011 19:07: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: r218658 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 19:07:48 -0000 Author: dchagin Date: Sun Feb 13 19:07:48 2011 New Revision: 218658 URL: http://svn.freebsd.org/changeset/base/218658 Log: Sort include files in the alphabetical order. Modified: head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Feb 13 19:07:17 2011 (r218657) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Feb 13 19:07:48 2011 (r218658) @@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Feb 13 19:07:17 2011 (r218657) +++ head/sys/i386/linux/linux_sysvec.c Sun Feb 13 19:07:48 2011 (r218658) @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19:24:05 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 27D69106566B; Sun, 13 Feb 2011 19:24:05 +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 142698FC0A; Sun, 13 Feb 2011 19:24:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJO4Jg049225; Sun, 13 Feb 2011 19:24:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJO4YG049223; Sun, 13 Feb 2011 19:24:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102131924.p1DJO4YG049223@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Feb 2011 19:24: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: r218660 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 19:24:05 -0000 Author: marcel Date: Sun Feb 13 19:24:04 2011 New Revision: 218660 URL: http://svn.freebsd.org/changeset/base/218660 Log: Use the preload_fetch_addr() and preload_fetch_size() convenience functions to obtain the address and size of the overriding DSDT. Sponsored by: Juniper Networks. Modified: head/sys/dev/acpica/Osd/OsdTable.c Modified: head/sys/dev/acpica/Osd/OsdTable.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdTable.c Sun Feb 13 19:15:42 2011 (r218659) +++ head/sys/dev/acpica/Osd/OsdTable.c Sun Feb 13 19:24:04 2011 (r218660) @@ -68,29 +68,31 @@ AcpiOsTableOverride(ACPI_TABLE_HEADER *E ACPI_TABLE_HEADER **NewTable) { char modname[] = "acpi_dsdt"; - caddr_t acpi_table, p, s; + caddr_t acpi_table; + ACPI_TABLE_HEADER *hdr; + size_t sz; if (ExistingTable == NULL || NewTable == NULL) return (AE_BAD_PARAMETER); + *NewTable = NULL; #ifdef notyet for (int i = 0; i < ACPI_NAME_SIZE; i++) modname[i + 5] = tolower(ExistingTable->Signature[i]); #else /* If we're not overriding the DSDT, just return. */ - if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) { - *NewTable = NULL; + if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) return (AE_OK); - } #endif - if ((acpi_table = preload_search_by_type(modname)) != NULL && - (p = preload_search_info(acpi_table, MODINFO_ADDR)) != NULL && - (s = preload_search_info(acpi_table, MODINFO_SIZE)) != NULL && - *(size_t *)s != 0) - *NewTable = *(ACPI_TABLE_HEADER **)p; - else - *NewTable = NULL; + acpi_table = preload_search_by_type(modname); + if (acpi_table == NULL) + return (AE_OK); + + hdr = preload_fetch_addr(acpi_table); + sz = preload_fetch_size(acpi_table); + if (hdr != NULL && sz != 0) + *NewTable = hdr; return (AE_OK); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19:25: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 4D5AE106564A; Sun, 13 Feb 2011 19:25: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 3BF688FC16; Sun, 13 Feb 2011 19:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJPnGZ049327; Sun, 13 Feb 2011 19:25:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJPnDO049325; Sun, 13 Feb 2011 19:25:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102131925.p1DJPnDO049325@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Feb 2011 19:25: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: r218661 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 19:25:49 -0000 Author: marcel Date: Sun Feb 13 19:25:48 2011 New Revision: 218661 URL: http://svn.freebsd.org/changeset/base/218661 Log: Use the preload_fetch_addr() and preload_fetch_size() convenience functions to obtain the address and size of the bitmap splash image. Sponsored by: Juniper Networks. Modified: head/sys/dev/fb/splash.c Modified: head/sys/dev/fb/splash.c ============================================================================== --- head/sys/dev/fb/splash.c Sun Feb 13 19:24:04 2011 (r218660) +++ head/sys/dev/fb/splash.c Sun Feb 13 19:25:48 2011 (r218661) @@ -59,26 +59,28 @@ static void *splash_arg; static int splash_find_data(splash_decoder_t *decoder) { - caddr_t image_module; - caddr_t p; + caddr_t image_module; + void *ptr; + size_t sz; if (decoder->data_type == NULL) - return 0; + return (0); + image_module = preload_search_by_type(decoder->data_type); if (image_module == NULL) - return ENOENT; - p = preload_search_info(image_module, MODINFO_ADDR); - if (p == NULL) - return ENOENT; - decoder->data = *(void **)p; - p = preload_search_info(image_module, MODINFO_SIZE); - if (p == NULL) - return ENOENT; - decoder->data_size = *(size_t *)p; + return (ENOENT); + + ptr = preload_fetch_addr(image_module); + sz = preload_fetch_size(image_module); + if (ptr == NULL || sz == 0) + return (ENOENT); + if (bootverbose) - printf("splash: image@%p, size:%lu\n", - (void *)decoder->data, (long)decoder->data_size); - return 0; + printf("splash: image@%p, size:%zu\n", ptr, sz); + + decoder->data = ptr; + decoder->data_size = sz; + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19:26: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 889A3106564A; Sun, 13 Feb 2011 19:26:51 +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 773BE8FC20; Sun, 13 Feb 2011 19:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJQp0M049390; Sun, 13 Feb 2011 19:26:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJQpnF049388; Sun, 13 Feb 2011 19:26:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102131926.p1DJQpnF049388@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Feb 2011 19:26: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: r218662 - 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: Sun, 13 Feb 2011 19:26:51 -0000 Author: marcel Date: Sun Feb 13 19:26:51 2011 New Revision: 218662 URL: http://svn.freebsd.org/changeset/base/218662 Log: Use the preload_fetch_addr() and preload_fetch_size() convenience functions to obtain the address and size of the PCI vendor data. Sponsored by: Juniper Networks. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Feb 13 19:25:48 2011 (r218661) +++ head/sys/dev/pci/pci.c Sun Feb 13 19:26:51 2011 (r218662) @@ -3056,15 +3056,20 @@ pci_resume(device_t dev) static void pci_load_vendor_data(void) { - caddr_t vendordata, info; - - if ((vendordata = preload_search_by_type("pci_vendor_data")) != NULL) { - info = preload_search_info(vendordata, MODINFO_ADDR); - pci_vendordata = *(char **)info; - info = preload_search_info(vendordata, MODINFO_SIZE); - pci_vendordata_size = *(size_t *)info; - /* terminate the database */ - pci_vendordata[pci_vendordata_size] = '\n'; + caddr_t data; + void *ptr; + size_t sz; + + data = preload_search_by_type("pci_vendor_data"); + if (data != NULL) { + ptr = preload_fetch_addr(data); + sz = preload_fetch_size(data); + if (ptr != NULL && sz != 0) { + pci_vendordata = ptr; + pci_vendordata_size = sz; + /* terminate the database */ + pci_vendordata[pci_vendordata_size] = '\n'; + } } } From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19: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 67ABD106566C; Sun, 13 Feb 2011 19: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 3BE828FC12; Sun, 13 Feb 2011 19:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJYnM2049657; Sun, 13 Feb 2011 19:34:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJYnnK049655; Sun, 13 Feb 2011 19:34:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102131934.p1DJYnnK049655@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Feb 2011 19: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: r218663 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 19:34:49 -0000 Author: marcel Date: Sun Feb 13 19:34:48 2011 New Revision: 218663 URL: http://svn.freebsd.org/changeset/base/218663 Log: Use the preload_fetch_addr() and preload_fetch_size() convenience functions to obtain the address and size of the preloaded key files. Sponsored by: Juniper Networks. Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sun Feb 13 19:26:51 2011 (r218662) +++ head/sys/geom/eli/g_eli.c Sun Feb 13 19:34:48 2011 (r218663) @@ -981,8 +981,9 @@ g_eli_destroy_geom(struct gctl_req *req static int g_eli_keyfiles_load(struct hmac_ctx *ctx, const char *provider) { - u_char *keyfile, *data, *size; + u_char *keyfile, *data; char *file, name[64]; + size_t size; int i; for (i = 0; ; i++) { @@ -990,15 +991,14 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx keyfile = preload_search_by_type(name); if (keyfile == NULL) return (i); /* Return number of loaded keyfiles. */ - data = preload_search_info(keyfile, MODINFO_ADDR); + data = preload_fetch_addr(keyfile); if (data == NULL) { G_ELI_DEBUG(0, "Cannot find key file data for %s.", name); return (0); } - data = *(void **)data; - size = preload_search_info(keyfile, MODINFO_SIZE); - if (size == NULL) { + size = preload_fetch_size(keyfile); + if (size == 0) { G_ELI_DEBUG(0, "Cannot find key file size for %s.", name); return (0); @@ -1011,15 +1011,16 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx } G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); - g_eli_crypto_hmac_update(ctx, data, *(size_t *)size); + g_eli_crypto_hmac_update(ctx, data, size); } } static void g_eli_keyfiles_clear(const char *provider) { - u_char *keyfile, *data, *size; + u_char *keyfile, *data; char name[64]; + size_t size; int i; for (i = 0; ; i++) { @@ -1027,12 +1028,10 @@ g_eli_keyfiles_clear(const char *provide keyfile = preload_search_by_type(name); if (keyfile == NULL) return; - data = preload_search_info(keyfile, MODINFO_ADDR); - size = preload_search_info(keyfile, MODINFO_SIZE); - if (data == NULL || size == NULL) - continue; - data = *(void **)data; - bzero(data, *(size_t *)size); + data = preload_fetch_addr(keyfile); + size = preload_fetch_size(keyfile); + if (data != NULL && size != 0) + bzero(data, size); } } From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 19:46: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 564DB106566B; Sun, 13 Feb 2011 19:46:55 +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 44D728FC14; Sun, 13 Feb 2011 19:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DJktc8049988; Sun, 13 Feb 2011 19:46:55 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DJktSM049986; Sun, 13 Feb 2011 19:46:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102131946.p1DJktSM049986@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Feb 2011 19:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218665 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 19:46:55 -0000 Author: marcel Date: Sun Feb 13 19:46:55 2011 New Revision: 218665 URL: http://svn.freebsd.org/changeset/base/218665 Log: Use the preload_fetch_addr() and preload_fetch_size() convenience functions to obtain the address and size of the preloaded pool configuration file/repository. Sponsored by: Juniper Networks. Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Sun Feb 13 19:37:05 2011 (r218664) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Sun Feb 13 19:46:55 2011 (r218665) @@ -200,10 +200,9 @@ kobj_read_file_loader(struct _buf *file, { char *ptr; - ptr = preload_search_info(file->ptr, MODINFO_ADDR); + ptr = preload_fetch_addr(file->ptr); if (ptr == NULL) return (ENOENT); - ptr = *(void **)ptr; bcopy(ptr + off, buf, size); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:02: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 9FCE51065672; Sun, 13 Feb 2011 20:02:46 +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 8D0FD8FC19; Sun, 13 Feb 2011 20:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DK2kYj051321; Sun, 13 Feb 2011 20:02:46 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DK2kRg051314; Sun, 13 Feb 2011 20:02:46 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201102132002.p1DK2kRg051314@svn.freebsd.org> From: Olivier Houchard Date: Sun, 13 Feb 2011 20:02: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: r218666 - in head/sys/arm: at91 econa sa11x0 xscale/i80321 xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 20:02:46 -0000 Author: cognet Date: Sun Feb 13 20:02:46 2011 New Revision: 218666 URL: http://svn.freebsd.org/changeset/base/218666 Log: Call init_param1() much earlier, so that msgbufsize is non-zero when we want to map and use the msgbuf. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/at91/at91_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -234,7 +234,7 @@ at91_ramsize(void) bw = (cr & AT91SAM9G20_SDRAMC_CR_DBW_16) ? 1 : 2; } - return (1 << (cols + rows + banks + bw)); + return ((1 << (cols + rows + banks + bw)); } void * @@ -302,6 +302,8 @@ initarm(void *arg, void *arg2) valloc_pages(kernelstack, KSTACK_PAGES); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); + /* Do basic tuning, hz etc */ + init_param1(); /* * Now we start construction of the L1 page table * We start by mapping the L2 page tables into the L1. @@ -440,8 +442,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = PHYSADDR + memsize; phys_avail[i++] = 0; phys_avail[i++] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/econa/econa_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -208,6 +208,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; /* Define a macro to simplify memory allocation */ @@ -384,8 +387,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = PHYSADDR + memsize; phys_avail[i++] = 0; phys_avail[i++] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/sa11x0/assabet_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -226,6 +226,9 @@ initarm(void *arg, void *arg2) pcpu_init(pc, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + physical_start = (vm_offset_t) KERNBASE; physical_end = lastaddr; physical_freestart = (((vm_offset_t)physical_end) + PAGE_MASK) & ~PAGE_MASK; @@ -408,8 +411,6 @@ initarm(void *arg, void *arg2) mutex_init(); pmap_bootstrap(freemempos, 0xd0000000, &kernel_l1pt); - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -210,6 +210,9 @@ initarm(void *arg, void *arg2) (var) = freemempos; \ memset((char *)(var), 0, ((np) * PAGE_SIZE)); + /* Do basic tuning, hz etc */ + init_param1(); + while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) freemempos -= PAGE_SIZE; valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); @@ -411,8 +414,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -200,6 +200,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -417,8 +420,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sun Feb 13 19:46:55 2011 (r218665) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sun Feb 13 20:02:46 2011 (r218666) @@ -245,6 +245,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + /* * We allocate memory downwards from where we were loaded * by RedBoot; first the L1 page table, then NUM_KERNEL_PTS @@ -474,8 +477,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:04: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 B5659106566C; Sun, 13 Feb 2011 20:04:29 +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 A3F538FC0A; Sun, 13 Feb 2011 20:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DK4TVk051521; Sun, 13 Feb 2011 20:04:29 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DK4TsE051519; Sun, 13 Feb 2011 20:04:29 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201102132004.p1DK4TsE051519@svn.freebsd.org> From: Olivier Houchard Date: Sun, 13 Feb 2011 20:04: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: r218667 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 20:04:29 -0000 Author: cognet Date: Sun Feb 13 20:04:29 2011 New Revision: 218667 URL: http://svn.freebsd.org/changeset/base/218667 Log: Oops, wasn't supposed to commit this. Modified: head/sys/arm/at91/at91_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sun Feb 13 20:02:46 2011 (r218666) +++ head/sys/arm/at91/at91_machdep.c Sun Feb 13 20:04:29 2011 (r218667) @@ -234,7 +234,7 @@ at91_ramsize(void) bw = (cr & AT91SAM9G20_SDRAMC_CR_DBW_16) ? 1 : 2; } - return ((1 << (cols + rows + banks + bw)); + return (1 << (cols + rows + banks + bw)); } void * From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:05:05 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 8249E1065674; Sun, 13 Feb 2011 20:05:05 +0000 (UTC) (envelope-from ivoras@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 1C5E18FC1B; Sun, 13 Feb 2011 20:05:04 +0000 (UTC) Received: by qwj9 with SMTP id 9so2592547qwj.13 for ; Sun, 13 Feb 2011 12:05:04 -0800 (PST) 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:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=yLzmwc7E34STKgOBznNZaHR5cKSOz1cu2GsjtVdqh7o=; b=eNeJSqv/fITwW9uc9NWrfUovb6QtpERtT55LVk4yjG50GuWAASZwdh0akiEiFURkI4 tz04HhXJteRcpgly336WCNYseTchhCUAslcZq36AIy89MMDFwAWOScf114Pj310Yc+H2 C7h3T4erwJzIFzE40l13ZUauQl4p9KHuLxO2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=n2wNHf9yID4O1hGYeETupdN9WdjBoUydE2eH3SEaBbZzduINAFKpvo/XxseYTvCoUI OaDv+HEtcSy36wkJnMDBQRBVqjRSn+8i0atoMfokTLHydv331xdZ90Yxe+z4Oej1mJAq BVMMZ/LEPPDvjB9seqBLUvN0KcgPcwVEietaU= Received: by 10.229.95.193 with SMTP id e1mr2167384qcn.171.1297625732346; Sun, 13 Feb 2011 11:35:32 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.188.140 with HTTP; Sun, 13 Feb 2011 11:34:52 -0800 (PST) In-Reply-To: <20110213213251.B1474@besplex.bde.org> References: <201102121312.p1CDCjhD002584@svn.freebsd.org> <20110213213251.B1474@besplex.bde.org> From: Ivan Voras Date: Sun, 13 Feb 2011 20:34:52 +0100 X-Google-Sender-Auth: 2uuAzy7PlY78MHc9srSJIS1c1w8 Message-ID: To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r218603 - head/sbin/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: Sun, 13 Feb 2011 20:05:05 -0000 On 13 February 2011 11:51, Bruce Evans wrote: > On Sat, 12 Feb 2011, Konstantin Belousov wrote: > >> Log: >> =C2=A0When creating a directory entry for the journal, always read at le= ast >> =C2=A0the fragment, and write the full block. Reading less might not wor= k >> =C2=A0due to device sector size bigger then size of direntries in the >> =C2=A0last directory fragment. > > I think it should always write full fragments too (and the kernel should > always read/write in units of fragments, not sectors of any size). Or at least One Single Variable, preferably recorded in the superblock, so when the need arises there's only one thing to change (so it might as well be fragment size in case of UFS). There is currently nothing technically wrong with what this commit does, but it's pretty much a certainty that future will be more strange than today and future developers may forget there are two places they need to change. From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:07: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 925A91065675; Sun, 13 Feb 2011 20:07:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8108C8FC0C; Sun, 13 Feb 2011 20:07:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DK7mcZ051870; Sun, 13 Feb 2011 20:07:48 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DK7mlm051868; Sun, 13 Feb 2011 20:07:48 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102132007.p1DK7mlm051868@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Feb 2011 20:07: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: r218668 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 20:07:48 -0000 Author: dchagin Date: Sun Feb 13 20:07:48 2011 New Revision: 218668 URL: http://svn.freebsd.org/changeset/base/218668 Log: Sort include files in the alphabetical order. Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Feb 13 20:04:29 2011 (r218667) +++ head/sys/compat/linux/linux_futex.c Sun Feb 13 20:07:48 2011 (r218668) @@ -60,8 +60,8 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #endif -#include #include +#include #include MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:13:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 0B47D106566C; Sun, 13 Feb 2011 20:13:16 +0000 (UTC) Date: Sun, 13 Feb 2011 20:13:16 +0000 From: Alexander Best To: Bruce Cran Message-ID: <20110213201315.GA15607@freebsd.org> References: <201102131830.p1DIUHHG047352@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102131830.p1DIUHHG047352@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218652 - head/sbin/mdconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Feb 2011 20:13:16 -0000 On Sun Feb 13 11, Bruce Cran wrote: > Author: brucec > Date: Sun Feb 13 18:30:17 2011 > New Revision: 218652 > URL: http://svn.freebsd.org/changeset/base/218652 > > Log: > Only print the unit number when invoked with the -n flag. wow. i completely forget about this one. ;) thanks for taking care of it. :) > > PR: bin/144300 > Submitted by: arundel > MFC after: 3 days > > Modified: > head/sbin/mdconfig/mdconfig.c > > Modified: head/sbin/mdconfig/mdconfig.c > ============================================================================== > --- head/sbin/mdconfig/mdconfig.c Sun Feb 13 18:21:41 2011 (r218651) > +++ head/sbin/mdconfig/mdconfig.c Sun Feb 13 18:30:17 2011 (r218652) > @@ -373,7 +373,7 @@ md_list(char *units, int opt) > found = 1; > } > gc = &pp->lg_config; > - printf("%s", pp->lg_name); > + printf("%s", nflag ? pp->lg_name + 2 : pp->lg_name); > if (opt & OPT_VERBOSE || opt & OPT_UNIT) { > type = geom_config_get(gc, "type"); > if (strcmp(type, "vnode") == 0) -- a13x From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 20:45: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 2D1CE10656A4; Sun, 13 Feb 2011 20:45:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F15A28FC0A; Sun, 13 Feb 2011 20:45:07 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 86FCD46B89; Sun, 13 Feb 2011 15:45:07 -0500 (EST) Date: Sun, 13 Feb 2011 20:45:07 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <201102061317.p16DHfrW065985@svn.freebsd.org> Message-ID: References: <201102061317.p16DHfrW065985@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218371 - 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: Sun, 13 Feb 2011 20:45:08 -0000 On Sun, 6 Feb 2011, Randall Stewart wrote: > Author: rrs > Date: Sun Feb 6 13:17:40 2011 > New Revision: 218371 > URL: http://svn.freebsd.org/changeset/base/218371 > > Log: > 1) Use same scheme Michael and I discussed for a selected for a flowid > 2) If flowid is not set, arrange so it is stored. > 3) If flowid is set by lower layer, use it. Beware that selecting a flowid at this level has implications not just for load balancing, but also CPU affinity in the transmit path for multiqueue drivers such as cxgb, etc. With the pcbgroup patch going into the tree soon, flowids will grow types to be set by device drivers, network layers, etc, so that other layers can use those semantics. Once we do that, we'll need to retain that at the connection level, etc, as we.. Robert > > MFC after: 3 Months > > Modified: > head/sys/netinet/sctp_input.c > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Sun Feb 6 12:21:29 2011 (r218370) > +++ head/sys/netinet/sctp_input.c Sun Feb 6 13:17:40 2011 (r218371) > @@ -5946,32 +5946,32 @@ sctp_input(struct mbuf *m, int off) > struct sctphdr *sh; > int offset; > int cpu_to_use; > - uint32_t tag; > + uint32_t flowid, tag; > > if (mp_ncpus > 1) { > - ip = mtod(m, struct ip *); > - offset = off + sizeof(*sh); > - if (SCTP_BUF_LEN(m) < offset) { > - if ((m = m_pullup(m, offset)) == 0) { > - SCTP_STAT_INCR(sctps_hdrops); > - return; > - } > - ip = mtod(m, struct ip *); > - } > - sh = (struct sctphdr *)((caddr_t)ip + off); > - if (sh->v_tag) { > - tag = htonl(sh->v_tag); > + if (m->m_flags & M_FLOWID) { > + flowid = m->m_pkthdr.flowid; > } else { > /* > - * Distribute new INIT's to all CPU's don't just > - * pick on 0. > + * No flow id built by lower layers fix it so we > + * create one. > */ > - struct timeval tv; > - > - (void)SCTP_GETTIME_TIMEVAL(&tv); > - tag = (uint32_t) tv.tv_usec; > + ip = mtod(m, struct ip *); > + offset = off + sizeof(*sh); > + if (SCTP_BUF_LEN(m) < offset) { > + if ((m = m_pullup(m, offset)) == 0) { > + SCTP_STAT_INCR(sctps_hdrops); > + return; > + } > + ip = mtod(m, struct ip *); > + } > + sh = (struct sctphdr *)((caddr_t)ip + off); > + tag = htonl(sh->v_tag); > + flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); > + m->m_pkthdr.flowid = flowid; > + m->m_flags |= M_FLOWID; > } > - cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; > + cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; > sctp_queue_to_mcore(m, off, cpu_to_use); > return; > } > From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 21:52: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 91771106564A; Sun, 13 Feb 2011 21:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FC8F8FC18; Sun, 13 Feb 2011 21:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DLqQYj061756; Sun, 13 Feb 2011 21:52:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DLqQ7x061754; Sun, 13 Feb 2011 21:52:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102132152.p1DLqQ7x061754@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Feb 2011 21:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218670 - 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, 13 Feb 2011 21:52:26 -0000 Author: kib Date: Sun Feb 13 21:52:26 2011 New Revision: 218670 URL: http://svn.freebsd.org/changeset/base/218670 Log: Lock the vnode around clearing of VV_TEXT flag. Remove mp_fixme() note mentioning that vnode lock is needed. Reviewed by: alc Tested by: pho MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Feb 13 21:12:05 2011 (r218669) +++ head/sys/vm/vm_object.c Sun Feb 13 21:52:26 2011 (r218670) @@ -437,16 +437,21 @@ vm_object_vndeallocate(vm_object_t objec } #endif - object->ref_count--; - if (object->ref_count == 0) { - mp_fixme("Unlocked vflag access."); - vp->v_vflag &= ~VV_TEXT; + if (object->ref_count > 1) { + object->ref_count--; + VM_OBJECT_UNLOCK(object); + /* vrele may need the vnode lock. */ + vrele(vp); + } else { + VM_OBJECT_UNLOCK(object); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VM_OBJECT_LOCK(object); + object->ref_count--; + if (object->ref_count == 0) + vp->v_vflag &= ~VV_TEXT; + VM_OBJECT_UNLOCK(object); + vput(vp); } - VM_OBJECT_UNLOCK(object); - /* - * vrele may need a vop lock - */ - vrele(vp); } /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 22:17: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 176001065674; Sun, 13 Feb 2011 22:17:50 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 047318FC1B; Sun, 13 Feb 2011 22:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1DMHncL064356; Sun, 13 Feb 2011 22:17:49 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1DMHnpD064354; Sun, 13 Feb 2011 22:17:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201102132217.p1DMHnpD064354@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 13 Feb 2011 22:17: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: r218672 - head/gnu/usr.bin/groff/tmac stable/7/gnu/usr.bin/groff/tmac stable/8/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 22:17:50 -0000 Author: uqs Date: Sun Feb 13 22:17:49 2011 New Revision: 218672 URL: http://svn.freebsd.org/changeset/base/218672 Log: Add back soon-to-be-release FreeBSD 7.4 which got clobbered in the previous merges. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Changes in other areas also in this revision: Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local stable/8/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Sun Feb 13 22:09:33 2011 (r218671) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Sun Feb 13 22:17:49 2011 (r218672) @@ -74,6 +74,7 @@ .ds doc-default-operating-system FreeBSD\~9.0 . .\" FreeBSD releases not found in doc-common +.ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.2 8.2 .ds doc-operating-system-FreeBSD-9.0 9.0 . From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 22:27: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 CE83F106564A; Sun, 13 Feb 2011 22:27:39 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5E20A8FC1C; Sun, 13 Feb 2011 22:27:39 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p1DMRcDC046742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Feb 2011 23:27:38 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1297636058; bh=k+IHz0pDQ4ZHUDECaP6X61T2JtapKaacy6X5crFzC34=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=Pp+k4QG4m2ob4QbSUEflgRyQ1sSx+TWUq9qrUWPhnnFtyHlzT6TTqv0d66nVCq7qj nO+VmIk55E3aXg5C8bw9Jd7N0LFPazmab3AYLtY7CnD8EFY7fvtbwwPxS24uBaEjUh ImRg4vVVzhD3U7iENe+DOpbPjaDlDsTLu+5jhH6g= Date: Sun, 13 Feb 2011 23:27:38 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Glen Barber Message-ID: <20110213222738.GH65811@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Glen Barber , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201102072233.p17MXdUY024795@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102072233.p17MXdUY024795@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: r218421 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 22:27:39 -0000 On Mon, 07.02.2011 at 22:33:39 +0000, Glen Barber wrote: > Author: gjb (doc committer) > Date: Mon Feb 7 22:33:39 2011 > New Revision: 218421 > URL: http://svn.freebsd.org/changeset/base/218421 > > Log: > Update manpage to remove CRT reference. Would you mind tackling these as well? bin/stty/stty.1 share/man/man4/acpi_panasonic.4 usr.bin/colcrt/colcrt.1 (I think this tool should be removed) usr.bin/ul/ul.1 Cheers Uli From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 23:09: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 93BFB106564A for ; Sun, 13 Feb 2011 23:09:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (aries.glenbarber.us [204.109.63.207]) by mx1.freebsd.org (Postfix) with SMTP id 416698FC13 for ; Sun, 13 Feb 2011 23:09:58 +0000 (UTC) Received: (qmail 4930 invoked by uid 0); 13 Feb 2011 17:58:50 -0500 Received: from unknown (HELO schism.local) (gjb@71.230.240.241) by 0 with SMTP; 13 Feb 2011 17:58:50 -0500 Message-ID: <4D586229.1070506@FreeBSD.org> Date: Sun, 13 Feb 2011 17:58:49 -0500 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201102072233.p17MXdUY024795@svn.freebsd.org> <20110213222738.GH65811@acme.spoerlein.net> In-Reply-To: <20110213222738.GH65811@acme.spoerlein.net> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r218421 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 23:09:58 -0000 Hi, On 2/13/11 5:27 PM, Ulrich Spörlein wrote: >> Log: >> Update manpage to remove CRT reference. > > Would you mind tackling these as well? > > bin/stty/stty.1 > share/man/man4/acpi_panasonic.4 > usr.bin/colcrt/colcrt.1 (I think this tool should be removed) > usr.bin/ul/ul.1 > Sure thing. Cheers, -- Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project From owner-svn-src-head@FreeBSD.ORG Sun Feb 13 23:09: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 A957C1065675 for ; Sun, 13 Feb 2011 23:09:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (aries.glenbarber.us [204.109.63.207]) by mx1.freebsd.org (Postfix) with SMTP id 56AB68FC19 for ; Sun, 13 Feb 2011 23:09:58 +0000 (UTC) Received: (qmail 5252 invoked by uid 0); 13 Feb 2011 18:05:47 -0500 Received: from unknown (HELO schism.local) (gjb@71.230.240.241) by 0 with SMTP; 13 Feb 2011 18:05:47 -0500 Message-ID: <4D5863CA.8030801@FreeBSD.org> Date: Sun, 13 Feb 2011 18:05:46 -0500 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201102072233.p17MXdUY024795@svn.freebsd.org> <20110213222738.GH65811@acme.spoerlein.net> <4D586229.1070506@FreeBSD.org> In-Reply-To: <4D586229.1070506@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r218421 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 23:09:58 -0000 On 2/13/11 5:58 PM, Glen Barber wrote: > Hi, > > On 2/13/11 5:27 PM, Ulrich Spörlein wrote: >>> Log: >>> Update manpage to remove CRT reference. >> >> Would you mind tackling these as well? >> >> share/man/man4/acpi_panasonic.4 Hmm.. acpi_panasonic(4) appears to have a mode which differentiates between LCD and CRT modes. Do you think this manual should be left as-is? Cheers, -- Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 02:37: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 51035106566B; Mon, 14 Feb 2011 02:37:28 +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 405EB8FC17; Mon, 14 Feb 2011 02:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1E2bSBO077041; Mon, 14 Feb 2011 02:37:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1E2bSIl077039; Mon, 14 Feb 2011 02:37:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102140237.p1E2bSIl077039@svn.freebsd.org> From: Alan Cox Date: Mon, 14 Feb 2011 02:37: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: r218673 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 02:37:28 -0000 Author: alc Date: Mon Feb 14 02:37:27 2011 New Revision: 218673 URL: http://svn.freebsd.org/changeset/base/218673 Log: Retire mp_fixme(). It's no longer used. Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sun Feb 13 22:17:49 2011 (r218672) +++ head/sys/sys/mutex.h Mon Feb 14 02:37:27 2011 (r218673) @@ -74,16 +74,6 @@ */ #define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) -#endif /* _KERNEL */ - -/* - * XXX: Friendly reminder to fix things in MP code that is presently being - * XXX: worked on. - */ -#define mp_fixme(string) - -#ifdef _KERNEL - /* * Prototypes * From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 08:09: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 6F11D106566B; Mon, 14 Feb 2011 08:09:03 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 418C68FC12; Mon, 14 Feb 2011 08:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1E893IL084416; Mon, 14 Feb 2011 08:09:03 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1E8937L084414; Mon, 14 Feb 2011 08:09:03 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201102140809.p1E8937L084414@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 14 Feb 2011 08:09: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: r218675 - head/sys/geom/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Feb 2011 08:09:03 -0000 Author: luigi Date: Mon Feb 14 08:09:02 2011 New Revision: 218675 URL: http://svn.freebsd.org/changeset/base/218675 Log: Correct a subtle bug in the 'gsched_rr' disk scheduler. The algorithm is supposed to work as follows: in order to prevent starvation, when a new client starts being served we record the start time and reset the counter of bytes served. We then switch to a new client after a certain amount of time or bytes, even if the current one still has pending requests. To avoid charging a new client the time of the first seek, we start counting time when the first request is served. Unfortunately a bug in the previous version of the code failed to set the start time in certain cases, resulting in some processes exceeding their timeslice. The fix (in this patch) is trivial, though it took a while to find out and replicate the bug. Thanks to Tommaso Caprai for investigating and fixing the problem. Submitted by: Tommaso Caprai MFC after: 1 week Modified: head/sys/geom/sched/gs_rr.c Modified: head/sys/geom/sched/gs_rr.c ============================================================================== --- head/sys/geom/sched/gs_rr.c Mon Feb 14 06:06:20 2011 (r218674) +++ head/sys/geom/sched/gs_rr.c Mon Feb 14 08:09:02 2011 (r218675) @@ -71,6 +71,7 @@ enum g_rr_state { /* possible queue flags */ enum g_rr_flags { + /* G_FLAG_COMPLETED means that the field q_slice_end is valid. */ G_FLAG_COMPLETED = 1, /* Completed a req. in the current budget. */ }; @@ -87,7 +88,7 @@ struct g_rr_queue { enum g_rr_state q_status; unsigned int q_service; /* service received so far */ - int q_slice_end; /* actual slice end in ticks */ + int q_slice_end; /* actual slice end time, in ticks */ enum g_rr_flags q_flags; /* queue flags */ struct bio_queue_head q_bioq; @@ -638,14 +639,25 @@ g_rr_done(void *data, struct bio *bp) sc->sc_in_flight--; qp = bp->bio_caller1; - if (qp == sc->sc_active && qp->q_status == G_QUEUE_BUSY) { - if (!(qp->q_flags & G_FLAG_COMPLETED)) { - qp->q_flags |= G_FLAG_COMPLETED; - /* in case we want to make the slice adaptive */ - qp->q_slice_duration = get_bounded(&me.quantum_ms, 2); - qp->q_slice_end = ticks + qp->q_slice_duration; - } + /* + * When the first request for this queue completes, update the + * duration and end of the slice. We do not do it when the + * slice starts to avoid charging to the queue the time for + * the first seek. + */ + if (!(qp->q_flags & G_FLAG_COMPLETED)) { + qp->q_flags |= G_FLAG_COMPLETED; + /* + * recompute the slice duration, in case we want + * to make it adaptive. This is not used right now. + * XXX should we do the same for q_quantum and q_wait_ticks ? + */ + qp->q_slice_duration = get_bounded(&me.quantum_ms, 2); + qp->q_slice_end = ticks + qp->q_slice_duration; + } + + if (qp == sc->sc_active && qp->q_status == G_QUEUE_BUSY) { /* The queue is trying anticipation, start the timer. */ qp->q_status = G_QUEUE_IDLING; /* may make this adaptive */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 08:14: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 54876106566C; Mon, 14 Feb 2011 08:14:07 +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 4078C8FC16; Mon, 14 Feb 2011 08:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1E8E7tp084579; Mon, 14 Feb 2011 08:14:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1E8E7RI084575; Mon, 14 Feb 2011 08:14:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102140814.p1E8E7RI084575@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 14 Feb 2011 08:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218676 - 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: Mon, 14 Feb 2011 08:14:07 -0000 Author: hselasky Date: Mon Feb 14 08:14:06 2011 New Revision: 218676 URL: http://svn.freebsd.org/changeset/base/218676 Log: * Fix page fault caused by referring freed node. While updating Tx stats, already freed node could be referred and cause page fault. To avoid such panic, spool Tx stats in driver's softc. Then, on every ratectl interval, grab node though ieee80211_iterate_nodes() and update ratectl stats. * Simplify some code in run_iter_func(). * Fix typo * Use memset instead of bzero (hselasky @) PR: kern/153938 Submitted by: PseudoCylon Approved by: thompsa (mentor) Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Feb 14 08:09:02 2011 (r218675) +++ head/sys/dev/usb/wlan/if_run.c Mon Feb 14 08:14:06 2011 (r218676) @@ -1684,7 +1684,7 @@ run_read_eeprom(struct run_softc *sc) return (0); } -struct ieee80211_node * +static struct ieee80211_node * run_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { return malloc(sizeof (struct run_node), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -1787,7 +1787,6 @@ run_newstate(struct ieee80211vap *vap, e } break; - case IEEE80211_S_RUN: if (!(sc->runbmap & bid)) { if(sc->running++) @@ -2229,10 +2228,10 @@ run_drain_fifo(void *arg) { struct run_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; - struct ieee80211_node *ni = sc->sc_ni[0]; /* make compiler happy */ uint32_t stat; - int retrycnt = 0; + uint16_t (*wstat)[3]; uint8_t wcid, mcs, pid; + int8_t retry; RUN_LOCK_ASSERT(sc, MA_OWNED); @@ -2250,31 +2249,32 @@ run_drain_fifo(void *arg) wcid == 0) continue; - ni = sc->sc_ni[wcid]; - if (ni->ni_rctls == NULL) - continue; - - /* update per-STA AMRR stats */ - if (stat & RT2860_TXQ_OK) { - /* - * Check if there were retries, ie if the Tx - * success rate is different from the requested - * rate. Note that it works only because we do - * not allow rate fallback from OFDM to CCK. - */ - mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f; - pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf; - if (mcs + 1 != pid) - retrycnt = 1; - ieee80211_ratectl_tx_complete(ni->ni_vap, ni, - IEEE80211_RATECTL_TX_SUCCESS, - &retrycnt, NULL); - } else { - retrycnt = 1; - ieee80211_ratectl_tx_complete(ni->ni_vap, ni, - IEEE80211_RATECTL_TX_FAILURE, - &retrycnt, NULL); + /* + * Even though each stat is Tx-complete-status like format, + * the device can poll stats. Because there is no guarantee + * that the referring node is still around when read the stats. + * So that, if we use ieee80211_ratectl_tx_update(), we will + * have hard time not to refer already freed node. + * + * To eliminate such page faults, we poll stats in softc. + * Then, update the rates later with ieee80211_ratectl_tx_update(). + */ + wstat = &(sc->wcid_stats[wcid]); + (*wstat)[RUN_TXCNT]++; + if (stat & RT2860_TXQ_OK) + (*wstat)[RUN_SUCCESS]++; + else ifp->if_oerrors++; + /* + * Check if there were retries, ie if the Tx success rate is + * different from the requested rate. Note that it works only + * because we do not allow rate fallback from OFDM to CCK. + */ + mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f; + pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf; + if ((retry = pid -1 - mcs) > 0) { + (*wstat)[RUN_TXCNT] += retry; + (*wstat)[RUN_RETRY] += retry; } } DPRINTFN(3, "count=%d\n", sc->fifo_cnt); @@ -2290,46 +2290,51 @@ run_iter_func(void *arg, struct ieee8021 struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; struct run_node *rn = (void *)ni; - uint32_t sta[3]; - int txcnt = 0, success = 0, retrycnt = 0; - int error; + union run_stats sta[2]; + uint16_t (*wstat)[3]; + int txcnt, success, retrycnt, error; + + RUN_LOCK(sc); if (sc->rvp_cnt <= 1 && (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_STA)) { - RUN_LOCK(sc); - /* read statistic counters (clear on read) and update AMRR state */ error = run_read_region_1(sc, RT2860_TX_STA_CNT0, (uint8_t *)sta, sizeof sta); if (error != 0) - return; - - DPRINTFN(3, "retrycnt=%d txcnt=%d failcnt=%d\n", - le32toh(sta[1]) >> 16, le32toh(sta[1]) & 0xffff, - le32toh(sta[0]) & 0xffff); + goto fail; /* count failed TX as errors */ - ifp->if_oerrors += le32toh(sta[0]) & 0xffff; + ifp->if_oerrors += le16toh(sta[0].error.fail); - retrycnt = - (le32toh(sta[0]) & 0xffff) + /* failed TX count */ - (le32toh(sta[1]) >> 16); /* TX retransmission count */ - - txcnt = - retrycnt + - (le32toh(sta[1]) & 0xffff); /* successful TX count */ - - success = - (le32toh(sta[1]) >> 16) + - (le32toh(sta[1]) & 0xffff); + retrycnt = le16toh(sta[1].tx.retry); + success = le16toh(sta[1].tx.success); + txcnt = retrycnt + success + le16toh(sta[0].error.fail); - ieee80211_ratectl_tx_update(vap, ni, &txcnt, &success, - &retrycnt); + DPRINTFN(3, "retrycnt=%d success=%d failcnt=%d\n", + retrycnt, success, le16toh(sta[0].error.fail)); + } else { + wstat = &(sc->wcid_stats[RUN_AID2WCID(ni->ni_associd)]); - RUN_UNLOCK(sc); + if (wstat == &(sc->wcid_stats[0]) || + wstat > &(sc->wcid_stats[RT2870_WCID_MAX])) + goto fail; + + txcnt = (*wstat)[RUN_TXCNT]; + success = (*wstat)[RUN_SUCCESS]; + retrycnt = (*wstat)[RUN_RETRY]; + DPRINTFN(3, "retrycnt=%d txcnt=%d success=%d\n", + retrycnt, txcnt, success); + + memset(wstat, 0, sizeof(*wstat)); } + ieee80211_ratectl_tx_update(vap, ni, &txcnt, &success, &retrycnt); rn->amrr_ridx = ieee80211_ratectl_rate(ni, NULL, 0); + +fail: + RUN_UNLOCK(sc); + DPRINTFN(3, "ridx=%d\n", rn->amrr_ridx); } @@ -2345,6 +2350,8 @@ run_newassoc_cb(void *arg) run_write_region_1(sc, RT2860_WCID_ENTRY(wcid), ni->ni_macaddr, IEEE80211_ADDR_LEN); + + memset(&(sc->wcid_stats[wcid]), 0, sizeof(sc->wcid_stats[wcid])); } static void @@ -2384,8 +2391,6 @@ run_newassoc(struct ieee80211_node *ni, DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); - sc->sc_ni[wcid] = ni; - for (i = 0; i < rs->rs_nrates; i++) { rate = rs->rs_rates[i] & IEEE80211_RATE_VAL; /* convert 802.11 rate to hardware rate index */ Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Mon Feb 14 08:09:02 2011 (r218675) +++ head/sys/dev/usb/wlan/if_runreg.h Mon Feb 14 08:14:06 2011 (r218676) @@ -1208,4 +1208,17 @@ static const struct rt2860_rate { { 30, 0x09 }, \ { 31, 0x10 } + +union run_stats { + uint32_t raw; + struct { + uint16_t fail; + uint16_t pad; + } error; + struct { + uint16_t success; + uint16_t retry; + } tx; +} __aligned(4); + #endif /* _IF_RUNREG_H_ */ Modified: head/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_runvar.h Mon Feb 14 08:09:02 2011 (r218675) +++ head/sys/dev/usb/wlan/if_runvar.h Mon Feb 14 08:14:06 2011 (r218676) @@ -160,7 +160,10 @@ struct run_softc { device_t sc_dev; struct usb_device *sc_udev; struct ifnet *sc_ifp; - struct ieee80211_node *sc_ni[RT2870_WCID_MAX + 1]; + uint16_t wcid_stats[RT2870_WCID_MAX + 1][3]; +#define RUN_TXCNT 0 +#define RUN_SUCCESS 1 +#define RUN_RETRY 2 int (*sc_srom_read)(struct run_softc *, uint16_t, uint16_t *); From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 08:39: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 9B0A41065670; Mon, 14 Feb 2011 08:39:07 +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 7C40E8FC0A; Mon, 14 Feb 2011 08:39:06 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1E8d08u015563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Feb 2011 19:39:01 +1100 Date: Mon, 14 Feb 2011 19:39:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ivan Voras In-Reply-To: Message-ID: <20110214190055.V1273@besplex.bde.org> References: <201102121312.p1CDCjhD002584@svn.freebsd.org> <20110213213251.B1474@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-46083153-1297672740=:1273" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov , Bruce Evans Subject: Re: svn commit: r218603 - head/sbin/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: Mon, 14 Feb 2011 08:39:07 -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-46083153-1297672740=:1273 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 13 Feb 2011, Ivan Voras wrote: > On 13 February 2011 11:51, Bruce Evans wrote: >> On Sat, 12 Feb 2011, Konstantin Belousov wrote: >> >>> Log: >>> =C2=A0When creating a directory entry for the journal, always read at l= east >>> =C2=A0the fragment, and write the full block. Reading less might not wo= rk >>> =C2=A0due to device sector size bigger then size of direntries in the >>> =C2=A0last directory fragment. >> >> I think it should always write full fragments too (and the kernel should >> always read/write in units of fragments, not sectors of any size). > > Or at least One Single Variable, preferably recorded in the > superblock, so when the need arises there's only one thing to change > (so it might as well be fragment size in case of UFS). kib pointed out that the writes in fsck_ffs need to be atomic, and geom/device drivers only guarantee atomicity for single-sector writes (which I thing is a bug -- up to the driver's max_iosize should be guaranteed, and userland needs to be able to see this max if it needs to do atomic writes). I don't know if tunefs needs this too (maybe not, since AFAIK tunefs doesn't even work on ro-mounted file systems except in my version). Now I think size shouldn't be given by any fs parameter. The device used by utilities may have support different i/o sizes than the device used by the kernel. For example, it might be a block device or a regular file. I've actually made use of this. When block devices were broken on FreeBSD, Linux e2fsck stopped working. I used the workaround of copying a small (~1GB) partition to a regular file for fsck'ing and back to the disk for use in the kernel. It would be more unusual for the device used by utilities to require a larger i/o size than the kernel is using, and utilities would need more reblocking than they have to work if this size exceeds the fragment size, but this is possible too. Say the file system records the hardware sector size of the device on which it was created. This size will become unusable if the file system is copied to another device that has a larger hard sector size. But everything will keep working if you use a size that works on the current device, and this size is a divisor of the fragment size (else at least the kernel will stop working) and is not larger than 8K (else the superblock probe will fail). Examples: - start with a "device" consisting of a regular file. The ioctl to determine the sector size will fail, so you must not depend on it working or use its value. You can do no better than requiring the size to be specified on the command line. You can also default to 512. Copy the resulting file system image to a new disk with 4K sectors (and no block size fakery of its own :-). - start with a normal device with a normal sector size of 512. Use this a bit, then copy it to a new disk with 4K sectors. - test all this by copying file systems to md devices with various larger and smaller sector sizes. > There is currently nothing technically wrong with what this commit > does, but it's pretty much a certainty that future will be more > strange than today and future developers may forget there are two > places they need to change. Another technical error is lack of support for different i/o sizes for read and write. Not a large error since this is broken in the kernel too. But probing for an i/o size that works would handle all combinations. I have a DVD drive with this problem. For DVD-RW, it has a minimum read size of 2K but a minimum write size of 32K. It advertises a "firmware" sector size of 2K. So using the firmware sector size doesn't work for writing, and recent changes in fsck_ffs wouldn't work. The fragment size needs to be 32K to work. IIRC, the kernel did work with this fragment size, but 32K is too inefficient to actually use for long. This depends on reads of < 32K working, since the probe for the superblock only tries size 8K. A pure minimum i/o size of 32K would fail for just the buggy superblock probe and buggy utilities. Bruce --0-46083153-1297672740=:1273-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 09:58: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 525981065781; Mon, 14 Feb 2011 09:58:48 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EE3C8FC19; Mon, 14 Feb 2011 09:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1E9wmQM086917; Mon, 14 Feb 2011 09:58:48 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1E9wmc0086915; Mon, 14 Feb 2011 09:58:48 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102140958.p1E9wmc0086915@svn.freebsd.org> From: Bruce Cran Date: Mon, 14 Feb 2011 09:58: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: r218677 - head/sbin/mdconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Feb 2011 09:58:48 -0000 Author: brucec Date: Mon Feb 14 09:58:47 2011 New Revision: 218677 URL: http://svn.freebsd.org/changeset/base/218677 Log: Add a check to make sure the provider name is "mdN" before printing the unit number. Suggested by: jh MFC after: 3 days Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Mon Feb 14 08:14:06 2011 (r218676) +++ head/sbin/mdconfig/mdconfig.c Mon Feb 14 09:58:47 2011 (r218677) @@ -373,7 +373,11 @@ md_list(char *units, int opt) found = 1; } gc = &pp->lg_config; - printf("%s", nflag ? pp->lg_name + 2 : pp->lg_name); + if (nflag && strncmp(pp->lg_name, "md", 2) == 0) + printf("%s", pp->lg_name + 2); + else + printf("%s", pp->lg_name); + if (opt & OPT_VERBOSE || opt & OPT_UNIT) { type = geom_config_get(gc, "type"); if (strcmp(type, "vnode") == 0) From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 12:55: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 0BA05106566C; Mon, 14 Feb 2011 12:55:19 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE808FC17; Mon, 14 Feb 2011 12:55:18 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p1ECtH8p061912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Feb 2011 13:55:17 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1297688117; bh=zKj2FgpO+qCtUbbFd9New7eapTqBzq54rgjVcPs9tFA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=H6qR46Gwy07W4PoQGXYLJRsWVfTQKNmhrMJ+I2xV5G4lMHpOPyHzfSkPYrAXiinpz C371Umk5KpjOpCSZAWVBcj4+LL+5LOjFWi8AColyW49DFYa2IRApsqB6f365dXR1g6 TUYtiJGTnlc4KOphu/NO5bZMb5pZzaq/KXfx7Yz4= Date: Mon, 14 Feb 2011 13:55:17 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Glen Barber Message-ID: <20110214125517.GK65811@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Glen Barber , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201102072233.p17MXdUY024795@svn.freebsd.org> <20110213222738.GH65811@acme.spoerlein.net> <4D586229.1070506@FreeBSD.org> <4D5863CA.8030801@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4D5863CA.8030801@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: r218421 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 12:55:19 -0000 On Sun, 13.02.2011 at 18:05:46 -0500, Glen Barber wrote: > On 2/13/11 5:58 PM, Glen Barber wrote: > > Hi, > > > > On 2/13/11 5:27 PM, Ulrich Spörlein wrote: > >>> Log: > >>> Update manpage to remove CRT reference. > >> > >> Would you mind tackling these as well? > >> > > >> share/man/man4/acpi_panasonic.4 > > Hmm.. acpi_panasonic(4) appears to have a mode which differentiates > between LCD and CRT modes. Do you think this manual should be left as-is? I think this is bogus. Sure, the "internal" display is of type LCD, but what the manpage really tries to say is, that the button switches between the laptop display (can you call that internal?) and the external VGA port. Not sure how to best phrase this. "LCD brightness" should be replaced with "display brightness", although it only pertains to the internal display, not any externally attached ones ...) Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 15:36: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 0DD271065673; Mon, 14 Feb 2011 15:36:39 +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 D96C28FC1E; Mon, 14 Feb 2011 15:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1EFac5B097529; Mon, 14 Feb 2011 15:36:38 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1EFacxX097527; Mon, 14 Feb 2011 15:36:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102141536.p1EFacxX097527@svn.freebsd.org> From: Alan Cox Date: Mon, 14 Feb 2011 15:36: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: r218681 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 15:36:39 -0000 Author: alc Date: Mon Feb 14 15:36:38 2011 New Revision: 218681 URL: http://svn.freebsd.org/changeset/base/218681 Log: Further simplify tmpfs_reg_resize(). Also, update its comments, including style fixes. Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Feb 14 14:26:14 2011 (r218680) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Feb 14 15:36:38 2011 (r218681) @@ -874,9 +874,9 @@ tmpfs_dir_whiteout_remove(struct vnode * /* --------------------------------------------------------------------- */ /* - * Resizes the aobj associated to the regular file pointed to by vp to - * the size newsize. 'vp' must point to a vnode that represents a regular - * file. 'newsize' must be positive. + * Resizes the aobj associated with the regular file pointed to by 'vp' to the + * size 'newsize'. 'vp' must point to a vnode that represents a regular file. + * 'newsize' must be positive. * * Returns zero on success or an appropriate error code on failure. */ @@ -890,7 +890,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t vm_pindex_t newpages, oldpages; off_t oldsize; size_t zerolen; - int error; MPASS(vp->v_type == VREG); MPASS(newsize >= 0); @@ -899,20 +898,19 @@ tmpfs_reg_resize(struct vnode *vp, off_t uobj = node->tn_reg.tn_aobj; tmp = VFS_TO_TMPFS(vp->v_mount); - /* Convert the old and new sizes to the number of pages needed to + /* + * Convert the old and new sizes to the number of pages needed to * store them. It may happen that we do not need to do anything * because the last allocated page can accommodate the change on - * its own. */ + * its own. + */ oldsize = node->tn_size; oldpages = OFF_TO_IDX(oldsize + PAGE_MASK); MPASS(oldpages == uobj->size); newpages = OFF_TO_IDX(newsize + PAGE_MASK); - if (newpages > oldpages && - newpages - oldpages > TMPFS_PAGES_AVAIL(tmp)) { - error = ENOSPC; - goto out; - } + newpages - oldpages > TMPFS_PAGES_AVAIL(tmp)) + return (ENOSPC); TMPFS_LOCK(tmp); tmp->tm_pages_used += (newpages - oldpages); @@ -923,7 +921,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t VM_OBJECT_LOCK(uobj); if (newsize < oldsize) { /* - * free "backing store" + * Release any swap space and free any whole pages. */ if (newpages < oldpages) { swap_pager_freespace(uobj, newpages, oldpages - @@ -932,7 +930,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t } /* - * zero out the truncated part of the last page. + * Zero the truncated part of the last page. */ zerolen = round_page(newsize) - newsize; if (zerolen > 0) { @@ -943,10 +941,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t } uobj->size = newpages; VM_OBJECT_UNLOCK(uobj); - error = 0; - -out: - return (error); + return (0); } /* --------------------------------------------------------------------- */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 16:23: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 7A1C0106566B; Mon, 14 Feb 2011 16:23:00 +0000 (UTC) (envelope-from fabien.thomas@netasq.com) Received: from work.netasq.com (mars.netasq.com [91.212.116.3]) by mx1.freebsd.org (Postfix) with ESMTP id 041798FC14; Mon, 14 Feb 2011 16:22:59 +0000 (UTC) Received: from [10.20.1.1] (unknown [10.2.1.1]) by work.netasq.com (Postfix) with ESMTPSA id 4C655740019; Mon, 14 Feb 2011 17:03:03 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1082) From: Fabien Thomas In-Reply-To: <201102111949.p1BJn7dd072027@svn.freebsd.org> Date: Mon, 14 Feb 2011 17:04:07 +0100 Message-Id: References: <201102111949.p1BJn7dd072027@svn.freebsd.org> To: Jack F Vogel X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218583 - 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, 14 Feb 2011 16:23:00 -0000 > > > @@ -1937,6 +1937,10 @@ igb_local_timer(void *arg) > goto timeout; > out: > callout_reset(&adapter->timer, hz, igb_local_timer, adapter); > +#ifndef DEVICE_POLLING > + /* Fire off all queue interrupts - deadlock protection */ > + E1000_WRITE_REG(&adapter->hw, E1000_EICS, adapter->que_mask); > +#endif > return; It seems this one need a check on the polling runtime interface flag? Fabien From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 17: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 5A8131065672; Mon, 14 Feb 2011 17:20:20 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9F98FC08; Mon, 14 Feb 2011 17:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1EHKKGY000453; Mon, 14 Feb 2011 17:20:20 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1EHKKeU000451; Mon, 14 Feb 2011 17:20:20 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201102141720.p1EHKKeU000451@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 14 Feb 2011 17:20: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: r218685 - 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: Mon, 14 Feb 2011 17:20:20 -0000 Author: mdf Date: Mon Feb 14 17:20:20 2011 New Revision: 218685 URL: http://svn.freebsd.org/changeset/base/218685 Log: Prevent reading from the ACPI_RESOURCE past its actual end. For paranoia limit to the size of the ACPI_RESOURCE as well. Reviewd by: jhb (in spirit) MFC after: 1 week Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 16:54:03 2011 (r218684) +++ head/sys/dev/acpica/acpi_resource.c Mon Feb 14 17:20:20 2011 (r218685) @@ -60,6 +60,7 @@ static ACPI_STATUS acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) { struct lookup_irq_request *req; + size_t len; u_int irqnum, irq; switch (res->Type) { @@ -82,7 +83,10 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r req->found = 1; KASSERT(irq == rman_get_start(req->res), ("IRQ resources do not match")); - bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE)); + len = res->Length; + if (len > sizeof(ACPI_RESOURCE)) + len = sizeof(ACPI_RESOURCE); + bcopy(res, req->acpi_res, len); return (AE_CTRL_TERMINATE); } return (AE_OK); From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 17:24: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 372C5106566C; Mon, 14 Feb 2011 17:24:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 286B78FC0C; Mon, 14 Feb 2011 17:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1EHOxt4000604; Mon, 14 Feb 2011 17:24:59 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1EHOxf4000602; Mon, 14 Feb 2011 17:24:59 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102141724.p1EHOxf4000602@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 14 Feb 2011 17:24: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: r218686 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 17:24:59 -0000 Author: dchagin Date: Mon Feb 14 17:24:58 2011 New Revision: 218686 URL: http://svn.freebsd.org/changeset/base/218686 Log: Style(9) fix. Do not initialize variables in the declarations. Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Mon Feb 14 17:20:20 2011 (r218685) +++ head/sys/compat/linux/linux_futex.c Mon Feb 14 17:24:58 2011 (r218686) @@ -436,8 +436,8 @@ linux_sys_futex(struct thread *td, struc int clockrt, nrwake, op_ret, ret, val; struct linux_emuldata *em; struct waiting_proc *wp; - struct futex *f, *f2 = NULL; - int error = 0; + struct futex *f, *f2; + int error; /* * Our implementation provides only privates futexes. Most of the apps @@ -460,6 +460,9 @@ linux_sys_futex(struct thread *td, struc args->op != LINUX_FUTEX_WAIT_REQUEUE_PI) return (ENOSYS); + error = 0; + f = f2 = NULL; + switch (args->op) { case LINUX_FUTEX_WAIT: args->val3 = FUTEX_BITSET_MATCH_ANY; From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 17:52:24 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 AED58106564A; Mon, 14 Feb 2011 17:52:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 14 Feb 2011 12:51:44 -0500 User-Agent: KMail/1.6.2 References: <201102141720.p1EHKKeU000451@svn.freebsd.org> In-Reply-To: <201102141720.p1EHKKeU000451@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102141252.06136.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org Subject: Re: svn commit: r218685 - 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: Mon, 14 Feb 2011 17:52:25 -0000 On Monday 14 February 2011 12:20 pm, Matthew D Fleming wrote: > Author: mdf > Date: Mon Feb 14 17:20:20 2011 > New Revision: 218685 > URL: http://svn.freebsd.org/changeset/base/218685 > > Log: > Prevent reading from the ACPI_RESOURCE past its actual end. For > paranoia limit to the size of the ACPI_RESOURCE as well. > > Reviewd by: jhb (in spirit) > MFC after: 1 week > > Modified: > head/sys/dev/acpica/acpi_resource.c > > Modified: head/sys/dev/acpica/acpi_resource.c > =================================================================== >=========== --- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 > 16:54:03 2011 (r218684) +++ head/sys/dev/acpica/acpi_resource.c Mon > Feb 14 17:20:20 2011 (r218685) @@ -60,6 +60,7 @@ static ACPI_STATUS > acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) > { > struct lookup_irq_request *req; > + size_t len; > u_int irqnum, irq; > > switch (res->Type) { > @@ -82,7 +83,10 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r > req->found = 1; > KASSERT(irq == rman_get_start(req->res), > ("IRQ resources do not match")); > - bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE)); > + len = res->Length; > + if (len > sizeof(ACPI_RESOURCE)) > + len = sizeof(ACPI_RESOURCE); > + bcopy(res, req->acpi_res, len); > return (AE_CTRL_TERMINATE); > } > return (AE_OK); Hmm... I am not sure this is a correct fix. For most cases, directly using sizeof(ACPI_RESOURCE) is evil as it does not reflect actual size of underlying structure. With the same reason, sizeof(ACPI_RESOURCE_IRQ) and sizeof(ACPI_RESOURCE_EXTENDED_IRQ) is not recommended, either. A correct fix is to extend acpi_lookup_irq_resource() to allocate necessary space dynamically. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 18:34: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 D84EA106566B; Mon, 14 Feb 2011 18:34:04 +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 A93B78FC12; Mon, 14 Feb 2011 18:34:04 +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 3D21846B03; Mon, 14 Feb 2011 13:34:04 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7B8DB8A009; Mon, 14 Feb 2011 13:34:03 -0500 (EST) From: John Baldwin To: Matthew D Fleming Date: Mon, 14 Feb 2011 13:33:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102141720.p1EHKKeU000451@svn.freebsd.org> In-Reply-To: <201102141720.p1EHKKeU000451@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102141333.05054.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 14 Feb 2011 13:34:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218685 - 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: Mon, 14 Feb 2011 18:34:04 -0000 On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote: > Author: mdf > Date: Mon Feb 14 17:20:20 2011 > New Revision: 218685 > URL: http://svn.freebsd.org/changeset/base/218685 > > Log: > Prevent reading from the ACPI_RESOURCE past its actual end. For > paranoia limit to the size of the ACPI_RESOURCE as well. I think in practice that len would never be > sizeof(ACPI_RESOURCE). You could probably get by with using a KASSERT() instead: KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too large")); bcopy(res, req->acpi_res, res->Length); -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 18:47: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 D605D1065694; Mon, 14 Feb 2011 18:47:19 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id ADBD88FC1B; Mon, 14 Feb 2011 18:47:18 +0000 (UTC) Received: by wwi17 with SMTP id 17so2210722wwi.1 for ; Mon, 14 Feb 2011 10:47:17 -0800 (PST) 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=PrZ27HjedUIsliEKOcaOdcK5+x6Ivwf9glvc8RSjABM=; b=H/yeiWXgbk76PFrqLcHC76XPAlzW+jdUqnYKnfBVkN2F2pSSmEoCMAwdqSCpqicja5 bcVdDUjgwLZGdaH5D6z53b8N8oO+qNLqc+jyK2xWSXrozLbsN0igt2KvCgM9d54Gj+OZ ZtkM9fliS2+ZCHjausH/Oj+usYTC+KM25nur8= 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=gpX6a7vMz540ot4TShsie5I1iG9aq/LfoJ8UWBjHemWgNciTyHXl+O2rfgHisfv9kP JW6myKwLrDFC4RljEBLF1mOLusJ3JL1vOh6F9Icpo+OvnDlAHU4x45dZ2sSdMxG3uBnc hYFFvykNu4r+8uytpQzw3d7R5D1DTYBUbdeSw= MIME-Version: 1.0 Received: by 10.216.162.131 with SMTP id y3mr3611237wek.6.1297709237214; Mon, 14 Feb 2011 10:47:17 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.216.86.200 with HTTP; Mon, 14 Feb 2011 10:47:17 -0800 (PST) In-Reply-To: <201102141333.05054.jhb@freebsd.org> References: <201102141720.p1EHKKeU000451@svn.freebsd.org> <201102141333.05054.jhb@freebsd.org> Date: Mon, 14 Feb 2011 10:47:17 -0800 X-Google-Sender-Auth: 5bFHl5MOFjpMyQLsCJ40QVJ7xpM Message-ID: From: mdf@FreeBSD.org To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218685 - 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: Mon, 14 Feb 2011 18:47:20 -0000 On Mon, Feb 14, 2011 at 10:33 AM, John Baldwin wrote: > On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote: >> Author: mdf >> Date: Mon Feb 14 17:20:20 2011 >> New Revision: 218685 >> URL: http://svn.freebsd.org/changeset/base/218685 >> >> Log: >> =A0 Prevent reading from the ACPI_RESOURCE past its actual end. =A0For >> =A0 paranoia limit to the size of the ACPI_RESOURCE as well. > > I think in practice that len would never be > sizeof(ACPI_RESOURCE). > > You could probably get by with using a KASSERT() instead: > > =A0 =A0 =A0 =A0KASSERT(res->Length <=3D sizeof(ACPI_RESOURCE), "resource = too large")); > =A0 =A0 =A0 =A0bcopy(res, req->acpi_res, res->Length); Thanks. I wanted to be paranoid since the problem was sporadic. Anyone who can better test this code should feel free to modify it further. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 18:51:08 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 33535106564A; Mon, 14 Feb 2011 18:51:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Mon, 14 Feb 2011 13:50:48 -0500 User-Agent: KMail/1.6.2 References: <201102141720.p1EHKKeU000451@svn.freebsd.org> <201102141333.05054.jhb@freebsd.org> In-Reply-To: <201102141333.05054.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102141350.55218.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218685 - 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: Mon, 14 Feb 2011 18:51:09 -0000 On Monday 14 February 2011 01:33 pm, John Baldwin wrote: > On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote: > > Author: mdf > > Date: Mon Feb 14 17:20:20 2011 > > New Revision: 218685 > > URL: http://svn.freebsd.org/changeset/base/218685 > > > > Log: > > Prevent reading from the ACPI_RESOURCE past its actual end. > > For paranoia limit to the size of the ACPI_RESOURCE as well. > > I think in practice that len would never be > > sizeof(ACPI_RESOURCE). > > You could probably get by with using a KASSERT() instead: > > KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too > large")); bcopy(res, req->acpi_res, res->Length); We should avoid sizeof(ACPI_RESOURCE). If you really have to know size of a specific resource type, there is a convenience macro, i.e., ACPI_RS_SIZE(type). Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 20: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 F1474106566B; Mon, 14 Feb 2011 20:05:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C675A8FC1A; Mon, 14 Feb 2011 20:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1EK5bVf005069; Mon, 14 Feb 2011 20:05:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1EK5bYJ005067; Mon, 14 Feb 2011 20:05:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201102142005.p1EK5bYJ005067@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Feb 2011 20: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: r218687 - 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: Mon, 14 Feb 2011 20:05:38 -0000 Author: jkim Date: Mon Feb 14 20:05:37 2011 New Revision: 218687 URL: http://svn.freebsd.org/changeset/base/218687 Log: Rework r218685. Copy just enough data for the resource type. Reviewed by: jhb, mdf Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 17:24:58 2011 (r218686) +++ head/sys/dev/acpica/acpi_resource.c Mon Feb 14 20:05:37 2011 (r218687) @@ -65,31 +65,30 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: + irqnum = res->Data.Irq.InterruptCount; + irq = res->Data.Irq.Interrupts[0]; + len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ); + break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - if (res->Type == ACPI_RESOURCE_TYPE_IRQ) { - irqnum = res->Data.Irq.InterruptCount; - irq = res->Data.Irq.Interrupts[0]; - } else { - irqnum = res->Data.ExtendedIrq.InterruptCount; - irq = res->Data.ExtendedIrq.Interrupts[0]; - } - if (irqnum != 1) - break; - req = (struct lookup_irq_request *)context; - if (req->counter != req->rid) { - req->counter++; - break; - } - req->found = 1; - KASSERT(irq == rman_get_start(req->res), - ("IRQ resources do not match")); - len = res->Length; - if (len > sizeof(ACPI_RESOURCE)) - len = sizeof(ACPI_RESOURCE); - bcopy(res, req->acpi_res, len); - return (AE_CTRL_TERMINATE); + irqnum = res->Data.ExtendedIrq.InterruptCount; + irq = res->Data.ExtendedIrq.Interrupts[0]; + len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ); + break; + default: + return (AE_OK); + } + if (irqnum != 1) + return (AE_OK); + req = (struct lookup_irq_request *)context; + if (req->counter != req->rid) { + req->counter++; + return (AE_OK); } - return (AE_OK); + req->found = 1; + KASSERT(irq == rman_get_start(req->res), + ("IRQ resources do not match")); + bcopy(res, req->acpi_res, len); + return (AE_CTRL_TERMINATE); } ACPI_STATUS From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 20:49: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 533AB106566B; Mon, 14 Feb 2011 20:49:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41CB58FC08; Mon, 14 Feb 2011 20:49:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1EKncsg006152; Mon, 14 Feb 2011 20:49:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1EKncgO006150; Mon, 14 Feb 2011 20:49:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201102142049.p1EKncgO006150@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 14 Feb 2011 20:49: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: r218688 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 20:49:38 -0000 Author: bz Date: Mon Feb 14 20:49:37 2011 New Revision: 218688 URL: http://svn.freebsd.org/changeset/base/218688 Log: Mfp4 CH=177256: Catch a set vnet upon return to user space. This usually means return paths with CURVNET_RESTORE() missing. If VNET_DEBUG is turned on we can even tell the function that did the CURVNET_SET() which is really helpful; else we print "N/A". Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Reviewed by: jhb MFC after: 11 days Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Mon Feb 14 20:05:37 2011 (r218687) +++ head/sys/kern/subr_trap.c Mon Feb 14 20:49:37 2011 (r218688) @@ -74,6 +74,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef VIMAGE +#include +#endif + #ifdef XEN #include #include @@ -126,6 +130,13 @@ userret(struct thread *td, struct trapfr sched_userret(td); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held.", td->td_locks)); +#ifdef VIMAGE + /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ + VNET_ASSERT(curvnet == NULL, + ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s", + __func__, td, p->p_pid, td->td_name, curvnet, + (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); +#endif #ifdef XEN PT_UPDATES_FLUSH(); #endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 21:24: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 6BA04106566B; Mon, 14 Feb 2011 21:24:54 +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 58DCB8FC0A; Mon, 14 Feb 2011 21:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1ELOsTo006994; Mon, 14 Feb 2011 21:24:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1ELOsuT006991; Mon, 14 Feb 2011 21:24:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102142124.p1ELOsuT006991@svn.freebsd.org> From: Adrian Chadd Date: Mon, 14 Feb 2011 21:24: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: r218689 - 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: Mon, 14 Feb 2011 21:24:54 -0000 Author: adrian Date: Mon Feb 14 21:24:54 2011 New Revision: 218689 URL: http://svn.freebsd.org/changeset/base/218689 Log: Some statistics additions - prepare for error codes > 32 (since the AR5416 error mask is > 5 bits) and add some extra CRC/HT40/ShortGI counters to help debug 802.11n issues. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Feb 14 20:49:37 2011 (r218688) +++ head/sys/dev/ath/if_ath.c Mon Feb 14 21:24:54 2011 (r218689) @@ -3715,7 +3715,6 @@ ath_rx_proc(void *arg, int npending) struct mbuf *m; struct ieee80211_node *ni; int len, type, ngood; - u_int phyerr; HAL_STATUS status; int16_t nf; u_int64_t tsf; @@ -3769,6 +3768,21 @@ ath_rx_proc(void *arg, int npending) if (status == HAL_EINPROGRESS) break; STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); + + /* These aren't specifically errors */ + if (rs->rs_flags & HAL_RX_GI) + sc->sc_stats.ast_rx_halfgi++; + if (rs->rs_flags & HAL_RX_2040) + sc->sc_stats.ast_rx_2040++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) + sc->sc_stats.ast_rx_pre_crc_err++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) + sc->sc_stats.ast_rx_post_crc_err++; + if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) + sc->sc_stats.ast_rx_decrypt_busy_err++; + if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) + sc->sc_stats.ast_rx_hi_rx_chain++; + if (rs->rs_status != 0) { if (rs->rs_status & HAL_RXERR_CRC) sc->sc_stats.ast_rx_crcerr++; @@ -3776,8 +3790,9 @@ ath_rx_proc(void *arg, int npending) sc->sc_stats.ast_rx_fifoerr++; if (rs->rs_status & HAL_RXERR_PHY) { sc->sc_stats.ast_rx_phyerr++; - phyerr = rs->rs_phyerr & 0x1f; - sc->sc_stats.ast_rx_phy[phyerr]++; + /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ + if (rs->rs_phyerr < 64) + sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; goto rx_error; /* NB: don't count in ierrors */ } if (rs->rs_status & HAL_RXERR_DECRYPT) { @@ -6402,7 +6417,7 @@ ath_sysctl_stats_attach_rxphyerr(struct tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx_phy_err", CTLFLAG_RD, NULL, "Per-code RX PHY Errors"); child = SYSCTL_CHILDREN(tree); - for (i = 0; i < 32; i++) { + for (i = 0; i < 64; i++) { snprintf(sn, sizeof(sn), "%d", i); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, &sc->sc_stats.ast_rx_phy[i], 0, ""); } @@ -6580,6 +6595,13 @@ ath_sysctl_stats_attach(struct ath_softc SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_agg", CTLFLAG_RD, &sc->sc_stats.ast_rx_agg, 0, "number of aggregate frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_halfgi", CTLFLAG_RD, &sc->sc_stats.ast_rx_halfgi, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_2040", CTLFLAG_RD, &sc->sc_stats.ast_rx_2040, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_pre_crc_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_pre_crc_err, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_post_crc_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_post_crc_err, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_decrypt_busy_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_decrypt_busy_err, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_hi_rx_chain", CTLFLAG_RD, &sc->sc_stats.ast_rx_hi_rx_chain, 0, ""); + /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); } Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Mon Feb 14 20:49:37 2011 (r218688) +++ head/sys/dev/ath/if_athioctl.h Mon Feb 14 21:24:54 2011 (r218689) @@ -79,7 +79,7 @@ struct ath_stats { u_int32_t ast_rx_badcrypt;/* rx failed 'cuz decryption */ u_int32_t ast_rx_badmic; /* rx failed 'cuz MIC failure */ u_int32_t ast_rx_phyerr; /* rx failed 'cuz of PHY err */ - u_int32_t ast_rx_phy[32]; /* rx PHY error per-code counts */ + u_int32_t ast_rx_phy[64]; /* rx PHY error per-code counts */ u_int32_t ast_rx_tooshort;/* rx discarded 'cuz frame too short */ u_int32_t ast_rx_toobig; /* rx discarded 'cuz frame too large */ u_int32_t ast_rx_packets; /* packet recv on the interface */ @@ -121,7 +121,13 @@ struct ath_stats { u_int32_t ast_be_missed; /* missed beacons */ u_int32_t ast_ani_cal; /* ANI calibrations performed */ u_int32_t ast_rx_agg; /* number of aggregate frames RX'ed */ - u_int32_t ast_pad[11]; + u_int32_t ast_rx_halfgi; + u_int32_t ast_rx_2040; + u_int32_t ast_rx_pre_crc_err; + u_int32_t ast_rx_post_crc_err; + u_int32_t ast_rx_decrypt_busy_err; + u_int32_t ast_rx_hi_rx_chain; + u_int32_t ast_pad[4]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 21: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 29EF8106564A; Mon, 14 Feb 2011 21:35:12 +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 17AAF8FC0A; Mon, 14 Feb 2011 21:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1ELZBnK007261; Mon, 14 Feb 2011 21:35:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1ELZB3d007259; Mon, 14 Feb 2011 21:35:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102142135.p1ELZB3d007259@svn.freebsd.org> From: Adrian Chadd Date: Mon, 14 Feb 2011 21:35: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: r218690 - head/sys/dev/ath/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: Mon, 14 Feb 2011 21:35:12 -0000 Author: adrian Date: Mon Feb 14 21:35:11 2011 New Revision: 218690 URL: http://svn.freebsd.org/changeset/base/218690 Log: bring this in line with what ath9k does. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 14 21:24:54 2011 (r218689) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 14 21:35:11 2011 (r218690) @@ -2296,7 +2296,7 @@ ar5416Set11nRegs(struct ath_hal *ah, con /* carrier sense timeout */ OS_REG_SET_BIT(ah, AR_GTTM, AR_GTTM_CST_USEC); - OS_REG_WRITE(ah, AR_CST, 1 << AR_CST_TIMEOUT_LIMIT_S); + OS_REG_WRITE(ah, AR_CST, 0xF << AR_CST_TIMEOUT_LIMIT_S); } void From owner-svn-src-head@FreeBSD.ORG Mon Feb 14 21:50: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 ED83E106566C; Mon, 14 Feb 2011 21:50:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D73728FC31; Mon, 14 Feb 2011 21:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1ELopJ9007604; Mon, 14 Feb 2011 21:50:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1ELop35007596; Mon, 14 Feb 2011 21:50:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201102142150.p1ELop35007596@svn.freebsd.org> From: Marius Strobl Date: Mon, 14 Feb 2011 21:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218691 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Feb 2011 21:50:52 -0000 Author: marius Date: Mon Feb 14 21:50:51 2011 New Revision: 218691 URL: http://svn.freebsd.org/changeset/base/218691 Log: - Use the correct DMA tag/map pair for synchronize the FC scratch area. - Allocate coherent DMA memory for the request/response queue area and and the FC scratch area. These changes allow isp(4) to work properly on sparc64 with usage of the IOMMU streaming buffers enabled. Approved by: mjacob MFC after: 2 weeks Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp.c Mon Feb 14 21:50:51 2011 (r218691) @@ -777,7 +777,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); ISP_MEMZERO(&mbs, sizeof (mbs)); if (la < 0x10000 && nw < 0x10000) { mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; @@ -846,7 +846,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); ISP_MEMZERO(&mbs, sizeof (mbs)); if (la < 0x10000) { mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; @@ -1716,7 +1716,7 @@ isp_fibre_init(ispsoftc_t *isp) isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)", fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32), (uint32_t) fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, 0); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -2008,7 +2008,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %04x%04x%04x%04x", DMA_WD3(fcp->isp_scdma), DMA_WD2(fcp->isp_scdma), DMA_WD1(fcp->isp_scdma), DMA_WD0(fcp->isp_scdma)); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, 0); @@ -2125,13 +2125,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uin mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { rval = mbs.param[0]; goto out; } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); scp += QENTRY_LEN; isp_get_plogx(isp, (isp_plogx_t *) scp, plp); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -2324,7 +2324,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui return (-1); } } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { if (dolock) { @@ -3215,7 +3215,7 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan rq->snscb_fc4_type = FC4_SCSI; isp_put_gid_ft_request(isp, rq, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); mbs.param[0] = MBOX_SEND_SNS; @@ -3310,12 +3310,12 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -3328,7 +3328,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, chan, pt->ctp_status); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16); + MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16, chan); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]); } @@ -3414,7 +3414,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha return (0); } - MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN, chan); rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); rs1 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+OGPOFF); isp_get_gid_ft_response(isp, rs0, rs1, NGENT); @@ -4008,7 +4008,7 @@ isp_register_fc4_type(ispsoftc_t *isp, i mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE, chan); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, chan); if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { @@ -4094,13 +4094,13 @@ isp_register_fc4_type_24xx(ispsoftc_t *i mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -4552,7 +4552,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); fcp->sendmarker = 1; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -4560,7 +4560,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, - QENTRY_LEN); + QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); @@ -4656,14 +4656,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab2 = (isp24xx_abrt_t *) &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; ab2->abrt_nphdl = 0xdeaf; - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); break; } MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, - QENTRY_LEN); + QENTRY_LEN, chan); isp_get_24xx_abrt(isp, ab2, ab); FC_SCRATCH_RELEASE(isp, chan); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { @@ -4936,7 +4936,7 @@ again: void *addr; oop = optr; - MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); isp_get_hdr(isp, addr, (isphdr_t *)qe); hp = (isphdr_t *)qe; @@ -5053,7 +5053,7 @@ again: /* * Synchronize our view of this response queue entry. */ - MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp_freebsd.c Mon Feb 14 21:50:51 2011 (r218691) @@ -604,11 +604,11 @@ ispioctl(struct cdev *dev, u_long c, cad break; } isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; sp->req_completion_status = 1; retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); FC_SCRATCH_RELEASE(isp, chan); if (retval || sp->req_completion_status != 0) { Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp_freebsd.h Mon Feb 14 21:50:51 2011 (r218691) @@ -338,15 +338,27 @@ struct isposinfo { #define MAXISPREQUEST(isp) ((IS_FC(isp) || IS_ULTRA2(isp))? 1024 : 256) -#define MEMORYBARRIER(isp, type, offset, size) \ +#define MEMORYBARRIER(isp, type, offset, size, chan) \ switch (type) { \ case SYNC_SFORDEV: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +} \ case SYNC_REQUEST: \ bus_dmamap_sync(isp->isp_osinfo.cdmat, \ isp->isp_osinfo.cdmap, \ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ break; \ case SYNC_SFORCPU: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ +} \ case SYNC_RESULT: \ bus_dmamap_sync(isp->isp_osinfo.cdmat, \ isp->isp_osinfo.cdmap, \ Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp_library.c Mon Feb 14 21:50:51 2011 (r218691) @@ -591,13 +591,13 @@ isp_fc_change_role(ispsoftc_t *isp, int mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (EIO); } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); #ifdef ISP_TARGET_MODE Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp_pci.c Mon Feb 14 21:50:51 2011 (r218691) @@ -1180,12 +1180,12 @@ isp_pci_rd_reg(ispsoftc_t *isp, int rego */ oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } return (rv); } @@ -1202,13 +1202,13 @@ isp_pci_wr_reg(ispsoftc_t *isp, int rego oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } } @@ -1231,17 +1231,17 @@ isp_pci_rd_reg_1080(ispsoftc_t *isp, int else tc |= BIU_PCI1080_CONF1_SXP0; BXW2(isp, IspVirt2Off(isp, BIU_CONF1), tc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } else if ((regoff & _BLK_REG_MASK) == DMA_BLOCK) { oc = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc | BIU_PCI1080_CONF1_DMA); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); if (oc) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } return (rv); } @@ -1264,18 +1264,18 @@ isp_pci_wr_reg_1080(ispsoftc_t *isp, int else tc |= BIU_PCI1080_CONF1_SXP0; BXW2(isp, IspVirt2Off(isp, BIU_CONF1), tc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } else if ((regoff & _BLK_REG_MASK) == DMA_BLOCK) { oc = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc | BIU_PCI1080_CONF1_DMA); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); if (oc) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } } @@ -1350,7 +1350,7 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int break; case MBOX_BLOCK: BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); return; case SXP_BLOCK: isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK write at 0x%x", regoff); @@ -1386,7 +1386,7 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int case BIU2400_GPIOE: case BIU2400_HSEMA: BXW4(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4, -1); break; default: isp_prt(isp, ISP_LOGERR, @@ -1574,7 +1574,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (1); } - if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT, &isp->isp_osinfo.cdmap) != 0) { + if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &isp->isp_osinfo.cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); @@ -1603,7 +1603,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, ISP_FC_SCRLEN, 1, slim, 0, &fc->tdmat)) { goto bad; } - if (bus_dmamem_alloc(fc->tdmat, (void **)&base, BUS_DMA_NOWAIT, &fc->tdmap) != 0) { + if (bus_dmamem_alloc(fc->tdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &fc->tdmap) != 0) { bus_dma_tag_destroy(fc->tdmat); goto bad; } Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/isp_sbus.c Mon Feb 14 21:50:51 2011 (r218691) @@ -401,7 +401,7 @@ isp_sbus_wr_reg(ispsoftc_t *isp, int reg isp_prt(isp, ISP_LOGDEBUG3, "isp_sbus_wr_reg(off %x) = %x", regoff, val); bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val); - MEMORYBARRIER(isp, SYNC_REG, offset, 2); + MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1); } struct imush { @@ -496,7 +496,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) return (1); } - if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT, + if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &isp->isp_osinfo.cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Mon Feb 14 21:35:11 2011 (r218690) +++ head/sys/dev/isp/ispvar.h Mon Feb 14 21:50:51 2011 (r218691) @@ -154,13 +154,13 @@ struct ispmdvec { #define ISP_QAVAIL(isp) \ ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp)) -#define ISP_ADD_REQUEST(isp, nxti) \ - MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \ - ISP_WRITE(isp, isp->isp_rqstinrp, nxti); \ +#define ISP_ADD_REQUEST(isp, nxti) \ + MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN, -1); \ + ISP_WRITE(isp, isp->isp_rqstinrp, nxti); \ isp->isp_reqidx = nxti #define ISP_SYNC_REQUEST(isp) \ - MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \ + MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN, -1); \ isp->isp_reqidx = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)); \ ISP_WRITE(isp, isp->isp_rqstinrp, isp->isp_reqidx) @@ -1010,7 +1010,7 @@ void isp_async(ispsoftc_t *, ispasync_t, * MAXISPREQUEST(ispsoftc_t *) maximum request queue size * for this particular board type * - * MEMORYBARRIER(ispsoftc_t *, barrier_type, offset, size) + * MEMORYBARRIER(ispsoftc_t *, barrier_type, offset, size, chan) * * Function/Macro the provides memory synchronization on * various objects so that the ISP's and the system's view From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 05:57: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 1790E106564A; Tue, 15 Feb 2011 05:57:54 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05F8C8FC08; Tue, 15 Feb 2011 05:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1F5vrmJ019269; Tue, 15 Feb 2011 05:57:53 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1F5vrEX019267; Tue, 15 Feb 2011 05:57:53 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201102150557.p1F5vrEX019267@svn.freebsd.org> From: Martin Wilke Date: Tue, 15 Feb 2011 05:57: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: r218694 - 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: Tue, 15 Feb 2011 05:57:54 -0000 Author: miwi (doc,ports committer) Date: Tue Feb 15 05:57:53 2011 New Revision: 218694 URL: http://svn.freebsd.org/changeset/base/218694 Log: - Add Dell Wireless 1390 BCM4311 Mini PCI to supported list. PR: 154500 Submitted by: Ruslan Mahmatkhanov Approved by: rwatson Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Tue Feb 15 01:34:46 2011 (r218693) +++ head/share/man/man4/bwn.4 Tue Feb 15 05:57:53 2011 (r218694) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2010 +.Dd February 15, 2011 .Dt BWN 4 .Os .Sh NAME @@ -81,6 +81,7 @@ driver supports Broadcom BCM43xx based w .It "Apple Airport Extreme BCM4318 PCI b/g" .It "ASUS WL-138g BCM4318 PCI b/g" .It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" +.It "Dell Wireless 1390 BCM4311 Mini PCI b/g" .It "Dell Wireless 1470 BCM4318 Mini PCI b/g" .It "Dell Truemobile 1400 BCM4309 Mini PCI b/g" .It "HP Compaq 6715b BCM4312 PCI b/g" From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 07:16: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 B0F14106566B; Tue, 15 Feb 2011 07:16:27 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A07308FC0C; Tue, 15 Feb 2011 07:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1F7GRfL021506; Tue, 15 Feb 2011 07:16:27 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1F7GRM4021504; Tue, 15 Feb 2011 07:16:27 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201102150716.p1F7GRM4021504@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 15 Feb 2011 07:16: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: r218699 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Feb 2011 07:16:27 -0000 Author: keramida (doc committer) Date: Tue Feb 15 07:16:27 2011 New Revision: 218699 URL: http://svn.freebsd.org/changeset/base/218699 Log: Document TRYBROKEN in ports(7). PR: docs/153542 Submitted by: Eitan Adler MFC after: 3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Feb 15 07:12:41 2011 (r218698) +++ head/share/man/man7/ports.7 Tue Feb 15 07:16:27 2011 (r218699) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2009 +.Dd February 14, 2009 .Dt PORTS 7 .Os .Sh NAME @@ -477,6 +477,9 @@ Of course, these ports may not work as e what you are doing and are sure about installing a forbidden port, then .Va NO_IGNORE lets you do it. +.It Va TRYBROKEN +If defined, attempt to build a port even if it is marked as +.Aq Va BROKEN . .It Va PORT_DBDIR Directory where the results of configuring .Va OPTIONS From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 07:25: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 A9CD6106564A; Tue, 15 Feb 2011 07:25:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 993B78FC12; Tue, 15 Feb 2011 07:25:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1F7PsWY021761; Tue, 15 Feb 2011 07:25:54 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1F7Psxn021759; Tue, 15 Feb 2011 07:25:54 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201102150725.p1F7Psxn021759@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 15 Feb 2011 07:25: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: r218700 - head/sbin/mksnap_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: Tue, 15 Feb 2011 07:25:54 -0000 Author: keramida (doc committer) Date: Tue Feb 15 07:25:54 2011 New Revision: 218700 URL: http://svn.freebsd.org/changeset/base/218700 Log: Note that a UFS filesystem can have up to 20 active snapshots. PR: docs/151104 Submitted by: Aldis Berjoza MFC after: 3 days Modified: head/sbin/mksnap_ffs/mksnap_ffs.8 Modified: head/sbin/mksnap_ffs/mksnap_ffs.8 ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.8 Tue Feb 15 07:16:27 2011 (r218699) +++ head/sbin/mksnap_ffs/mksnap_ffs.8 Tue Feb 15 07:25:54 2011 (r218700) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 29, 2009 +.Dd February 14, 2011 .Dt MKSNAP_FFS 8 .Os .Sh NAME @@ -79,3 +79,12 @@ utility first appeared in .Sh CAVEATS The disk full situation is not handled gracefully and may lead to a system panic when no free blocks are found. +.Pp +Every filesystem can have only up to 20 active snapshots. +When this limit is reached, attempting to create more snapshots +fails with +.Er ENOSPC , +and +.Nm +reports that it is +.Dq out of space . From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 09:03: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 9BF74106564A; Tue, 15 Feb 2011 09:03:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF188FC15; Tue, 15 Feb 2011 09:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1F93wEe024033; Tue, 15 Feb 2011 09:03:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1F93wBK024031; Tue, 15 Feb 2011 09:03:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102150903.p1F93wBK024031@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Feb 2011 09:03: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: r218701 - 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, 15 Feb 2011 09:03:58 -0000 Author: kib Date: Tue Feb 15 09:03:58 2011 New Revision: 218701 URL: http://svn.freebsd.org/changeset/base/218701 Log: Since r218070 reenabled the call to vm_map_simplify_entry() from vm_map_insert(), the kmem_back() assumption about newly inserted entry might be broken due to interference of two factors. In the low memory condition, when vm_page_alloc() returns NULL, supplied map is unlocked. If another thread performs kmem_malloc() meantime, and its map entry is placed right next to our thread map entry in the map, both entries wire count is still 0 and entries are coalesced due to vm_map_simplify_entry(). Mark new entry with MAP_ENTRY_IN_TRANSITION to prevent coalesce. Fix some style issues, tighten the assertions to account for MAP_ENTRY_IN_TRANSITION state. Reported and tested by: pho Reviewed by: alc Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Feb 15 07:25:54 2011 (r218700) +++ head/sys/vm/vm_kern.c Tue Feb 15 09:03:58 2011 (r218701) @@ -353,12 +353,24 @@ kmem_back(vm_map_t map, vm_offset_t addr vm_map_entry_t entry; vm_page_t m; int pflags; + boolean_t found; KASSERT(vm_map_locked(map), ("kmem_back: map %p is not locked", map)); offset = addr - VM_MIN_KERNEL_ADDRESS; vm_object_reference(kmem_object); vm_map_insert(map, kmem_object, offset, addr, addr + size, - VM_PROT_ALL, VM_PROT_ALL, 0); + VM_PROT_ALL, VM_PROT_ALL, 0); + + /* + * Assert: vm_map_insert() will never be able to extend the + * previous entry so vm_map_lookup_entry() will find a new + * entry exactly corresponding to this address range and it + * will have wired_count == 0. + */ + found = vm_map_lookup_entry(map, addr, &entry); + KASSERT(found && entry->start == addr && entry->end == addr + size && + entry->wired_count == 0 && (entry->eflags & MAP_ENTRY_IN_TRANSITION) + == 0, ("kmem_back: entry not found or misaligned")); if ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; @@ -381,9 +393,15 @@ retry: if (m == NULL) { if ((flags & M_NOWAIT) == 0) { VM_OBJECT_UNLOCK(kmem_object); + entry->eflags |= MAP_ENTRY_IN_TRANSITION; vm_map_unlock(map); VM_WAIT; vm_map_lock(map); + KASSERT( +(entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_NEEDS_WAKEUP)) == + MAP_ENTRY_IN_TRANSITION, + ("kmem_back: volatile entry")); + entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; VM_OBJECT_LOCK(kmem_object); goto retry; } @@ -413,15 +431,11 @@ retry: VM_OBJECT_UNLOCK(kmem_object); /* - * Mark map entry as non-pageable. Assert: vm_map_insert() will never - * be able to extend the previous entry so there will be a new entry - * exactly corresponding to this address range and it will have - * wired_count == 0. + * Mark map entry as non-pageable. Repeat the assert. */ - if (!vm_map_lookup_entry(map, addr, &entry) || - entry->start != addr || entry->end != addr + size || - entry->wired_count != 0) - panic("kmem_malloc: entry not found or misaligned"); + KASSERT(entry->start == addr && entry->end == addr + size && + entry->wired_count == 0, + ("kmem_back: entry not found or misaligned after allocation")); entry->wired_count = 1; /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 12:42: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 EEB8E106566B; Tue, 15 Feb 2011 12:42:18 +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 DDAB68FC14; Tue, 15 Feb 2011 12:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FCgI14031571; Tue, 15 Feb 2011 12:42:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FCgICL031569; Tue, 15 Feb 2011 12:42:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201102151242.p1FCgICL031569@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Feb 2011 12:42: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: r218707 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Feb 2011 12:42:19 -0000 Author: jhb Date: Tue Feb 15 12:42:18 2011 New Revision: 218707 URL: http://svn.freebsd.org/changeset/base/218707 Log: Properly check for errors from waitpid(). Submitted by: gcooper MFC after: 1 week Modified: head/usr.bin/truss/setup.c Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Feb 15 11:22:47 2011 (r218706) +++ head/usr.bin/truss/setup.c Tue Feb 15 12:42:18 2011 (r218707) @@ -83,7 +83,7 @@ setup_and_wait(char *command[]) } /* Only in the parent here */ - if (waitpid(pid, &waitval, 0) < -1) { + if (waitpid(pid, &waitval, 0) < 0) { err(1, "unexpect stop in waitpid"); return 0; } @@ -114,7 +114,7 @@ start_tracing(int pid) err(1, "can not attach to target process"); child_pid = pid; - if (waitpid(pid, &waitval, 0) < -1) + if (waitpid(pid, &waitval, 0) < 0) err(1, "Unexpect stop in waitpid"); return (0); @@ -133,7 +133,7 @@ restore_proc(int signo __unused) /* stop the child so that we can detach */ kill(child_pid, SIGSTOP); - if (waitpid(child_pid, &waitval, 0) < -1) + if (waitpid(child_pid, &waitval, 0) < 0) err(1, "Unexpected stop in waitpid"); if (ptrace(PT_DETACH, child_pid, (caddr_t)1, 0) < 0) @@ -183,7 +183,7 @@ waitevent(struct trussinfo *info) ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal); pending_signal = 0; - if (waitpid(info->pid, &waitval, 0) < -1) { + if (waitpid(info->pid, &waitval, 0) < 0) { err(1, "Unexpected stop in waitpid"); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 13:29: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 7E5C2106566B; Tue, 15 Feb 2011 13:29:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF2B8FC14; Tue, 15 Feb 2011 13:29:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FDTqGG032670; Tue, 15 Feb 2011 13:29:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FDTqAC032668; Tue, 15 Feb 2011 13:29:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102151329.p1FDTqAC032668@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 Feb 2011 13:29: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: r218708 - head/sys/dev/ath/ath_hal/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: Tue, 15 Feb 2011 13:29:52 -0000 Author: adrian Date: Tue Feb 15 13:29:52 2011 New Revision: 218708 URL: http://svn.freebsd.org/changeset/base/218708 Log: Disable flipping antennas for AR9280. Flipping antennas when doing 11n would cause all kinds of strange issues. Just don't do it for now and when it comes time to do it, don't do it here. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Feb 15 12:42:18 2011 (r218707) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Feb 15 13:29:52 2011 (r218708) @@ -705,11 +705,18 @@ ar9280FillCapabilityInfo(struct ath_hal return AH_TRUE; } +/* + * This has been disabled - having the HAL flip chainmasks on/off + * when attempting to implement 11n disrupts things. For now, just + * leave this flipped off and worry about implementing TX diversity + * for legacy and MCS0-7 when 11n is fully functioning. + */ HAL_BOOL ar9280SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings) { #define ANTENNA0_CHAINMASK 0x1 #define ANTENNA1_CHAINMASK 0x2 +#if 0 struct ath_hal_5416 *ahp = AH5416(ah); /* Antenna selection is done by setting the tx/rx chainmasks approp. */ @@ -736,6 +743,7 @@ ar9280SetAntennaSwitch(struct ath_hal *a HALDEBUG(ah, HAL_DEBUG_ANY, "%s: settings=%d, tx/rx chainmask=%d/%d\n", __func__, settings, ahp->ah_tx_chainmask, ahp->ah_rx_chainmask); +#endif return AH_TRUE; #undef ANTENNA0_CHAINMASK #undef ANTENNA1_CHAINMASK From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 15:35: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 37A9610656C3; Tue, 15 Feb 2011 15:35:02 +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 00F258FC14; Tue, 15 Feb 2011 15:35:02 +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 AF76046B38; Tue, 15 Feb 2011 10:35:01 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3D8198A01D; Tue, 15 Feb 2011 10:34:56 -0500 (EST) From: John Baldwin To: Bruce M Simpson Date: Tue, 15 Feb 2011 10:34:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <200904290950.n3T9o46f075350@svn.freebsd.org> In-Reply-To: <200904290950.n3T9o46f075350@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102151034.46242.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Feb 2011 10:34:56 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191651 - 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: Tue, 15 Feb 2011 15:35:02 -0000 On Wednesday, April 29, 2009 5:50:04 am Bruce M Simpson wrote: > Author: bms > Date: Wed Apr 29 09:50:04 2009 > New Revision: 191651 > URL: http://svn.freebsd.org/changeset/base/191651 > > Log: > Merge IPv6-capable mtest(8) from MLDv2 branch. > > Modified: > head/usr.sbin/mtest/Makefile > head/usr.sbin/mtest/mtest.8 > head/usr.sbin/mtest/mtest.c This is completely broken as it fails to work if you don't have INET6 compiled into the kernel, even if all you want to do is test joining IPv4 multicast groups. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 18:16:05 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 33F631065780; Tue, 15 Feb 2011 18:16:05 +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 232438FC16; Tue, 15 Feb 2011 18:16:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FIG5HG039890; Tue, 15 Feb 2011 18:16:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FIG5t9039888; Tue, 15 Feb 2011 18:16:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102151816.p1FIG5t9039888@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 15 Feb 2011 18:16: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: r218710 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 18:16:05 -0000 Author: yongari Date: Tue Feb 15 18:16:04 2011 New Revision: 218710 URL: http://svn.freebsd.org/changeset/base/218710 Log: Fix a regression introduced in r215906. The change made in r215906 caused link re-negotiation whenever application joins or leaves a multicast group. If driver is running, it would have established a link so there is no need to start re-negotiation. The re-negotiation broke established link which in turn stopped multicast application working while re-negotiation is in progress. PR: kern/154667 MFC after: 1 week Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Tue Feb 15 16:09:08 2011 (r218709) +++ head/sys/dev/fxp/if_fxp.c Tue Feb 15 18:16:04 2011 (r218710) @@ -2823,8 +2823,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm case SIOCADDMULTI: case SIOCDELMULTI: + FXP_LOCK(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - fxp_init(sc); + fxp_init_body(sc, 0); + FXP_UNLOCK(sc); break; case SIOCSIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 20: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 24064106564A; Tue, 15 Feb 2011 20:04:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1364B8FC17; Tue, 15 Feb 2011 20:04:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FK4DnI042551; Tue, 15 Feb 2011 20:04:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FK4DHA042549; Tue, 15 Feb 2011 20:04:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201102152004.p1FK4DHA042549@svn.freebsd.org> From: Ed Schouten Date: Tue, 15 Feb 2011 20:04: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: r218711 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 20:04:14 -0000 Author: ed Date: Tue Feb 15 20:04:13 2011 New Revision: 218711 URL: http://svn.freebsd.org/changeset/base/218711 Log: Remove dead reference to regexp(3). Use regex(3) instead. PR: docs/149950 Submitted by: arundel@ Modified: head/lib/libc/gen/glob.3 Modified: head/lib/libc/gen/glob.3 ============================================================================== --- head/lib/libc/gen/glob.3 Tue Feb 15 18:16:04 2011 (r218710) +++ head/lib/libc/gen/glob.3 Tue Feb 15 20:04:13 2011 (r218711) @@ -417,7 +417,7 @@ execvp("ls", g.gl_pathv); .Sh SEE ALSO .Xr sh 1 , .Xr fnmatch 3 , -.Xr regexp 3 +.Xr regex 3 .Sh STANDARDS The current implementation of the .Fn glob From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 20:07: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 2CB88106566C; Tue, 15 Feb 2011 20:07:36 +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 01E068FC08; Tue, 15 Feb 2011 20:07:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FK7Zd5042656; Tue, 15 Feb 2011 20:07:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FK7ZZF042654; Tue, 15 Feb 2011 20:07:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201102152007.p1FK7ZZF042654@svn.freebsd.org> From: Ed Schouten Date: Tue, 15 Feb 2011 20:07: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: r218712 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 20:07:36 -0000 Author: ed Date: Tue Feb 15 20:07:35 2011 New Revision: 218712 URL: http://svn.freebsd.org/changeset/base/218712 Log: Don't forget to bump man page date for r218711. Modified: head/lib/libc/gen/glob.3 Modified: head/lib/libc/gen/glob.3 ============================================================================== --- head/lib/libc/gen/glob.3 Tue Feb 15 20:04:13 2011 (r218711) +++ head/lib/libc/gen/glob.3 Tue Feb 15 20:07:35 2011 (r218712) @@ -30,7 +30,7 @@ .\" @(#)glob.3 8.3 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd September 1, 2004 +.Dd February 15, 2011 .Dt GLOB 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 20:18: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 ABB31106566B; Tue, 15 Feb 2011 20:18:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8878FC14; Tue, 15 Feb 2011 20:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FKIqJg042996; Tue, 15 Feb 2011 20:18:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FKIqnZ042993; Tue, 15 Feb 2011 20:18:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102152018.p1FKIqnZ042993@svn.freebsd.org> From: Dimitry Andric Date: Tue, 15 Feb 2011 20:18: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: r218713 - in head/sys/boot: common i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 20:18:52 -0000 Author: dim Date: Tue Feb 15 20:18:52 2011 New Revision: 218713 URL: http://svn.freebsd.org/changeset/base/218713 Log: Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: head/sys/boot/common/ufsread.c head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Tue Feb 15 20:07:35 2011 (r218712) +++ head/sys/boot/common/ufsread.c Tue Feb 15 20:18:52 2011 (r218713) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + u_int8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Tue Feb 15 20:07:35 2011 (r218712) +++ head/sys/boot/i386/boot2/boot2.c Tue Feb 15 20:18:52 2011 (r218713) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 20:50: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 7E7A6106564A; Tue, 15 Feb 2011 20:50:17 +0000 (UTC) (envelope-from yanegomi@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 B80A28FC13; Tue, 15 Feb 2011 20:50:16 +0000 (UTC) Received: by wwf26 with SMTP id 26so607115wwf.31 for ; Tue, 15 Feb 2011 12:50:15 -0800 (PST) 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=2e2ydZMd8CW4U1+A4LLKQbUgP6qiRd63d8POUt7dcgg=; b=R4kzAAAR0EAyew/+E0uTCosoE4pPDwFLG1YFuYYj7p/7Ea7pRwgJwSjj0PPuFr/reK V7aWo+55KZIkq4/RTFNU1KalLXNVrWdkaXCuYrgagtztbiysIk5zNBcd2Vk1oK516eN2 /aO27UizCQflKF/GLgcOq+1Zta/XE5dfsf0Zs= 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=qs8xRw4wDbiBbTGURT4OPXLRmmHZZa/pBWlvSfIYUxIL4MBWnPb1Z0GP96rsoTdXmd 4g+tfm/a31F6+AqmIMJDITaouAz5oh1U8moXRJ1Gq0HJZk8N53WHVBY6oIW091j3Vk+V +mDrMOHMS87hgedR4ZtnxuNPQggSi6L2kjQHk= MIME-Version: 1.0 Received: by 10.216.63.138 with SMTP id a10mr2217944wed.27.1297803015518; Tue, 15 Feb 2011 12:50:15 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.71.200 with HTTP; Tue, 15 Feb 2011 12:50:15 -0800 (PST) In-Reply-To: <201102152018.p1FKIqnZ042993@svn.freebsd.org> References: <201102152018.p1FKIqnZ042993@svn.freebsd.org> Date: Tue, 15 Feb 2011 12:50:15 -0800 X-Google-Sender-Auth: MHhy3-MSSdiVYHeB2LDcFLzpl5A Message-ID: From: Garrett Cooper To: Dimitry Andric 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: r218713 - in head/sys/boot: common i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 20:50:17 -0000 On Tue, Feb 15, 2011 at 12:18 PM, Dimitry Andric wrote: > Author: dim > Date: Tue Feb 15 20:18:52 2011 > New Revision: 218713 > URL: http://svn.freebsd.org/changeset/base/218713 > > Log: > =A0Apply a few small optimizations to boot2's code, to make it shrink a > =A0little further. =A0This gets us further on the way to be able to build= it > =A0successfully with clang. =A0Using in-tree gcc, this shrinks boot2.bin = with > =A060 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 byte= s. I recently had the pleasure of looking at this code, and I think that this could be shrunk down further but it would require a functional change as to how things work with loader.conf, etc. I'll hash out the ideas on arch@ I had in mind after I let them stew a bit longer, but I think that boot[2] could be simplified more. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:01: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 B9D43106566B; Tue, 15 Feb 2011 21:01:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8E368FC18; Tue, 15 Feb 2011 21:01:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FL1DEO044264; Tue, 15 Feb 2011 21:01:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FL1D5Z044262; Tue, 15 Feb 2011 21:01:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102152101.p1FL1D5Z044262@svn.freebsd.org> From: Dimitry Andric Date: Tue, 15 Feb 2011 21:01: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: r218716 - 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: Tue, 15 Feb 2011 21:01:13 -0000 Author: dim Date: Tue Feb 15 21:01:13 2011 New Revision: 218716 URL: http://svn.freebsd.org/changeset/base/218716 Log: In sys/boot/common/ufsread.c, use uint8_t instead of u_int8_t. Submitted by: mdf Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Tue Feb 15 20:53:01 2011 (r218715) +++ head/sys/boot/common/ufsread.c Tue Feb 15 21:01:13 2011 (r218716) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - u_int8_t dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:08: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 AB8C0106564A; Tue, 15 Feb 2011 21:08:32 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE748FC0C; Tue, 15 Feb 2011 21:08:31 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 204609CB0D9; Tue, 15 Feb 2011 22:08:30 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kvsffB1Vpa4I; Tue, 15 Feb 2011 22:08:17 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CC6499CB0E8; Tue, 15 Feb 2011 22:08:17 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p1FL8H68064573; Tue, 15 Feb 2011 22:08:17 +0100 (CET) (envelope-from rdivacky) Date: Tue, 15 Feb 2011 22:08:17 +0100 From: Roman Divacky To: Dimitry Andric Message-ID: <20110215210817.GA64113@freebsd.org> References: <201102152101.p1FL1D5Z044262@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102152101.p1FL1D5Z044262@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: r218716 - 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: Tue, 15 Feb 2011 21:08:32 -0000 I put there u_int8_t for a reason. That reason being that it's basically struct direct->d_type which is u_int8_t and not uint8_t. On Tue, Feb 15, 2011 at 09:01:13PM +0000, Dimitry Andric wrote: > Author: dim > Date: Tue Feb 15 21:01:13 2011 > New Revision: 218716 > URL: http://svn.freebsd.org/changeset/base/218716 > > Log: > In sys/boot/common/ufsread.c, use uint8_t instead of u_int8_t. > > Submitted by: mdf > > Modified: > head/sys/boot/common/ufsread.c > > Modified: head/sys/boot/common/ufsread.c > ============================================================================== > --- head/sys/boot/common/ufsread.c Tue Feb 15 20:53:01 2011 (r218715) > +++ head/sys/boot/common/ufsread.c Tue Feb 15 21:01:13 2011 (r218716) > @@ -122,7 +122,7 @@ lookup(const char *path) > const char *s; > ino_t ino; > ssize_t n; > - u_int8_t dt; > + uint8_t dt; > > ino = ROOTINO; > dt = DT_DIR; From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:18: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 C2A1A1065744; Tue, 15 Feb 2011 21:18:43 +0000 (UTC) (envelope-from yanegomi@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 9946F8FC13; Tue, 15 Feb 2011 21:18:42 +0000 (UTC) Received: by wwf26 with SMTP id 26so633927wwf.31 for ; Tue, 15 Feb 2011 13:18:41 -0800 (PST) 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=rAt0JEkON4Mu0Kry9kFmS4jsJglCRg1RqnSea8FJToc=; b=LHnsZuWp9hLz20HE94UvYc+jg+i1ZQd/4oYkj/bZ+6IApIOKaSBzE3aqveIKA03wRh kcO882pD1cLFTdPDu3prFnkNUV5H10jiKrz/wWHw42+Osx25y3L9lkZolH/+17emsGNs RI9+K2Ck0oNoOJnO7pzFuR7abSfpicW8dPROE= 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=SjfSnat7JAxWBSIFoDDNLBa8TKpRUY7wZB7l162w87+fMROMm0nQTs0bmZIjKdPbas dpwHuHvTIa30yhmmbxteDO+pU+PRMnIF116fFA7xRIEh5GOfZ/JeJFVNzjEWnXufWrDx TsHi+7a5Wb2TOfDdoSsqJkV3j5ptA4/qLbV1s= MIME-Version: 1.0 Received: by 10.216.51.130 with SMTP id b2mr4802367wec.42.1297804721163; Tue, 15 Feb 2011 13:18:41 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.71.200 with HTTP; Tue, 15 Feb 2011 13:18:41 -0800 (PST) In-Reply-To: <20110215210817.GA64113@freebsd.org> References: <201102152101.p1FL1D5Z044262@svn.freebsd.org> <20110215210817.GA64113@freebsd.org> Date: Tue, 15 Feb 2011 13:18:41 -0800 X-Google-Sender-Auth: hNcZfl64j6znO19H6-61QugAWXg Message-ID: From: Garrett Cooper To: Roman Divacky Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r218716 - 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: Tue, 15 Feb 2011 21:18:43 -0000 On Tue, Feb 15, 2011 at 1:08 PM, Roman Divacky wrote: > I put there u_int8_t for a reason. That reason being that > it's basically struct direct->d_type which is u_int8_t > and not uint8_t. Even though they're technically the same typedef'ed type (I'd keep style consistent according to the argument rdivacky is making). I guess this has about the same bikeshed-ability as my proposal to change all of the *chflags syscalls to use fflags_t instead of u_long/int/etc on freebsd-fs did a few weeks back. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:22: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 8B8CB106564A; Tue, 15 Feb 2011 21:22:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0F58FC08; Tue, 15 Feb 2011 21:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FLM9ED045122; Tue, 15 Feb 2011 21:22:09 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FLM9QC045119; Tue, 15 Feb 2011 21:22:09 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102152122.p1FLM9QC045119@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 15 Feb 2011 21:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218717 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 21:22:09 -0000 Author: dchagin Date: Tue Feb 15 21:22:09 2011 New Revision: 218717 URL: http://svn.freebsd.org/changeset/base/218717 Log: Put the macro declaration in the relevant include file for future use. Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_signal.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Feb 15 21:01:13 2011 (r218716) +++ head/sys/compat/linux/linux_misc.c Tue Feb 15 21:22:09 2011 (r218717) @@ -92,9 +92,6 @@ __FBSDID("$FreeBSD$"); int stclohz; /* Statistics clock frequency */ -#define BSD_TO_LINUX_SIGNAL(sig) \ - (((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig) - static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, Modified: head/sys/compat/linux/linux_signal.h ============================================================================== --- head/sys/compat/linux/linux_signal.h Tue Feb 15 21:01:13 2011 (r218716) +++ head/sys/compat/linux/linux_signal.h Tue Feb 15 21:22:09 2011 (r218717) @@ -40,4 +40,7 @@ void ksiginfo_to_lsiginfo(ksiginfo_t *ks #define LINUX_SIG_VALID(sig) ((sig) <= LINUX_NSIG && (sig) > 0) +#define BSD_TO_LINUX_SIGNAL(sig) \ + (((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig) + #endif /* _LINUX_SIGNAL_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:24: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 354611065670; Tue, 15 Feb 2011 21:24:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7F58FC19; Tue, 15 Feb 2011 21:24:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FLOpjw045639; Tue, 15 Feb 2011 21:24:51 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FLOpfT045637; Tue, 15 Feb 2011 21:24:51 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102152124.p1FLOpfT045637@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 15 Feb 2011 21:24: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: r218718 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 21:24:51 -0000 Author: dchagin Date: Tue Feb 15 21:24:50 2011 New Revision: 218718 URL: http://svn.freebsd.org/changeset/base/218718 Log: Style(9) fix. Wrap long lines in linux_rt_sigtimedwait(). Modified: head/sys/compat/linux/linux_signal.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Tue Feb 15 21:22:09 2011 (r218717) +++ head/sys/compat/linux/linux_signal.c Tue Feb 15 21:24:50 2011 (r218718) @@ -457,8 +457,9 @@ linux_rt_sigtimedwait(struct thread *td, return (error); #ifdef DEBUG if (ldebug(rt_sigtimedwait)) - printf(LMSG("linux_rt_sigtimedwait: incoming timeout (%d/%d)\n"), - ltv.tv_sec, ltv.tv_usec); + printf(LMSG("linux_rt_sigtimedwait: " + "incoming timeout (%d/%d)\n"), + ltv.tv_sec, ltv.tv_usec); #endif tv.tv_sec = (long)ltv.tv_sec; tv.tv_usec = (suseconds_t)ltv.tv_usec; @@ -477,8 +478,9 @@ linux_rt_sigtimedwait(struct thread *td, timevalclear(&tv); #ifdef DEBUG if (ldebug(rt_sigtimedwait)) - printf(LMSG("linux_rt_sigtimedwait: converted timeout (%jd/%ld)\n"), - (intmax_t)tv.tv_sec, tv.tv_usec); + printf(LMSG("linux_rt_sigtimedwait: " + "converted timeout (%jd/%ld)\n"), + (intmax_t)tv.tv_sec, tv.tv_usec); #endif } TIMEVAL_TO_TIMESPEC(&tv, &ts); @@ -487,7 +489,8 @@ linux_rt_sigtimedwait(struct thread *td, error = kern_sigtimedwait(td, bset, &info, tsa); #ifdef DEBUG if (ldebug(rt_sigtimedwait)) - printf(LMSG("linux_rt_sigtimedwait: sigtimedwait returning (%d)\n"), error); + printf(LMSG("linux_rt_sigtimedwait: " + "sigtimedwait returning (%d)\n"), error); #endif if (error) return (error); From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21: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 10E53106566C; Tue, 15 Feb 2011 21:35:44 +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 D58458FC13; Tue, 15 Feb 2011 21:35: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 9079946B37; Tue, 15 Feb 2011 16:35:43 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B6DAC8A009; Tue, 15 Feb 2011 16:35:42 -0500 (EST) From: John Baldwin To: Garrett Cooper Date: Tue, 15 Feb 2011 16:35:42 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102152101.p1FL1D5Z044262@svn.freebsd.org> <20110215210817.GA64113@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102151635.42232.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Feb 2011 16:35:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, Dimitry Andric , svn-src-all@freebsd.org Subject: Re: svn commit: r218716 - 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: Tue, 15 Feb 2011 21:35:44 -0000 On Tuesday, February 15, 2011 4:18:41 pm Garrett Cooper wrote: > On Tue, Feb 15, 2011 at 1:08 PM, Roman Divacky wrote: > > I put there u_int8_t for a reason. That reason being that > > it's basically struct direct->d_type which is u_int8_t > > and not uint8_t. > > Even though they're technically the same typedef'ed type (I'd keep > style consistent according to the argument rdivacky is making). I > guess this has about the same bikeshed-ability as my proposal to > change all of the *chflags syscalls to use fflags_t instead of > u_long/int/etc on freebsd-fs did a few weeks back. No, this is different. The uint8_t is correct. C99 adopted uint*_t making u_int*_t deprecated. In general all new code should use the C99 types. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:42: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 CC222106564A; Tue, 15 Feb 2011 21:42:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B96278FC13; Tue, 15 Feb 2011 21:42:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FLgmJP046231; Tue, 15 Feb 2011 21:42:48 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FLgm0P046229; Tue, 15 Feb 2011 21:42:48 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102152142.p1FLgm0P046229@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 15 Feb 2011 21: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: r218719 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 21:42:48 -0000 Author: dchagin Date: Tue Feb 15 21:42:48 2011 New Revision: 218719 URL: http://svn.freebsd.org/changeset/base/218719 Log: Make a linux_rt_sigtimedwait() system call is actually working. 1) Translate the native signal number in the appropriate Linux signal. 2) Remove bogus code, which can lead to a panic as it calls kern_sigtimedwait with same ksiginfo. 3) Return the corresponding signal number. Modified: head/sys/compat/linux/linux_signal.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Tue Feb 15 21:24:50 2011 (r218718) +++ head/sys/compat/linux/linux_signal.c Tue Feb 15 21:42:48 2011 (r218719) @@ -431,7 +431,7 @@ int linux_rt_sigtimedwait(struct thread *td, struct linux_rt_sigtimedwait_args *args) { - int error; + int error, sig; l_timeval ltv; struct timeval tv; struct timespec ts, *tsa; @@ -495,19 +495,15 @@ linux_rt_sigtimedwait(struct thread *td, if (error) return (error); + sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo); + if (args->ptr) { memset(&linfo, 0, sizeof(linfo)); - linfo.lsi_signo = info.ksi_signo; + ksiginfo_to_lsiginfo(&info, &linfo, sig); error = copyout(&linfo, args->ptr, sizeof(linfo)); } - - /* Repost if we got an error. */ - if (error && info.ksi_signo) { - PROC_LOCK(td->td_proc); - tdksignal(td, info.ksi_signo, &info); - PROC_UNLOCK(td->td_proc); - } else - td->td_retval[0] = info.ksi_signo; + if (error == 0) + td->td_retval[0] = sig; return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 21:46: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 AAD0C106566B; Tue, 15 Feb 2011 21:46:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98F248FC08; Tue, 15 Feb 2011 21:46:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FLkaOx046364; Tue, 15 Feb 2011 21:46:36 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FLkaun046360; Tue, 15 Feb 2011 21:46:36 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102152146.p1FLkaun046360@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 15 Feb 2011 21:46: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: r218720 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 21:46:36 -0000 Author: dchagin Date: Tue Feb 15 21:46:36 2011 New Revision: 218720 URL: http://svn.freebsd.org/changeset/base/218720 Log: For realtime signals fill the sigval value. Modified: head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_signal.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Tue Feb 15 21:42:48 2011 (r218719) +++ head/sys/amd64/linux32/linux.h Tue Feb 15 21:46:36 2011 (r218720) @@ -306,6 +306,7 @@ struct l_new_utsname { #define LINUX_SIGPOLL LINUX_SIGIO #define LINUX_SIGPWR 30 #define LINUX_SIGSYS 31 +#define LINUX_SIGRTMIN 32 #define LINUX_SIGTBLSZ 31 #define LINUX_NSIG_WORDS 2 Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Tue Feb 15 21:42:48 2011 (r218719) +++ head/sys/compat/linux/linux_signal.c Tue Feb 15 21:46:36 2011 (r218720) @@ -649,4 +649,8 @@ ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_ lsi->lsi_uid = ksi->ksi_uid; break; } + if (sig >= LINUX_SIGRTMIN) { + lsi->lsi_int = ksi->ksi_info.si_value.sival_int; + lsi->lsi_ptr = PTROUT(ksi->ksi_info.si_value.sival_ptr); + } } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Tue Feb 15 21:42:48 2011 (r218719) +++ head/sys/i386/linux/linux.h Tue Feb 15 21:46:36 2011 (r218720) @@ -281,6 +281,7 @@ struct l_new_utsname { #define LINUX_SIGPOLL LINUX_SIGIO #define LINUX_SIGPWR 30 #define LINUX_SIGSYS 31 +#define LINUX_SIGRTMIN 32 #define LINUX_SIGTBLSZ 31 #define LINUX_NSIG_WORDS 2 From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 22:03: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 1E764106566B; Tue, 15 Feb 2011 22:03:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2888FC12; Tue, 15 Feb 2011 22:03:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FM39XP046838; Tue, 15 Feb 2011 22:03:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FM39ej046832; Tue, 15 Feb 2011 22:03:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102152203.p1FM39ej046832@svn.freebsd.org> From: Dimitry Andric Date: Tue, 15 Feb 2011 22:03: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: r218723 - in head: cddl/lib/libzpool lib/liblzma lib/libmd lib/libz secure/lib/libcrypto X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Feb 2011 22:03:10 -0000 Author: dim Date: Tue Feb 15 22:03:09 2011 New Revision: 218723 URL: http://svn.freebsd.org/changeset/base/218723 Log: Fix some leftover binaries and shared libraries in the system that still have an executable stack, due to linking in hand-assembled .S or .s files, that have no .GNU-stack sections: RWX --- --- /lib/libcrypto.so.6 RWX --- --- /lib/libmd.so.5 RWX --- --- /lib/libz.so.6 RWX --- --- /lib/libzpool.so.2 RWX --- --- /usr/lib/liblzma.so.5 These were found using scanelf, from the sysutils/pax-utils port. Reviewed by: kib Modified: head/cddl/lib/libzpool/Makefile head/lib/liblzma/Makefile head/lib/libmd/Makefile head/lib/libz/Makefile head/secure/lib/libcrypto/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Tue Feb 15 22:01:39 2011 (r218722) +++ head/cddl/lib/libzpool/Makefile Tue Feb 15 22:03:09 2011 (r218723) @@ -14,6 +14,7 @@ .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S +ACFLAGS+= -Wa,--noexecstack .else .PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c Modified: head/lib/liblzma/Makefile ============================================================================== --- head/lib/liblzma/Makefile Tue Feb 15 22:01:39 2011 (r218722) +++ head/lib/liblzma/Makefile Tue Feb 15 22:03:09 2011 (r218723) @@ -78,6 +78,7 @@ SRCS+= check.c \ .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386" SRCS+= crc32_x86.S \ crc64_x86.S +ACFLAGS+= -Wa,--noexecstack .else SRCS+= crc32_fast.c \ crc64_fast.c Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Tue Feb 15 22:01:39 2011 (r218722) +++ head/lib/libmd/Makefile Tue Feb 15 22:03:09 2011 (r218723) @@ -43,11 +43,14 @@ CFLAGS+= -I${.CURDIR} .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S -CFLAGS+= -DSHA1_ASM -DELF +CFLAGS+= -DSHA1_ASM .endif .if exists(${MACHINE_ARCH}/rmd160.S) SRCS+= rmd160.S -CFLAGS+= -DRMD160_ASM -DELF +CFLAGS+= -DRMD160_ASM +.endif +.if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) +ACFLAGS+= -DELF -Wa,--noexecstack .endif md2hl.c: mdXhl.c Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Tue Feb 15 22:01:39 2011 (r218722) +++ head/lib/libz/Makefile Tue Feb 15 22:03:09 2011 (r218723) @@ -39,12 +39,14 @@ SRCS+= zutil.c .PATH: ${.CURDIR}/contrib/asm686 SRCS+= match.S CFLAGS+= -DASMV -DNO_UNDERLINE +ACFLAGS+= -Wa,--noexecstack .endif .if ${MACHINE_ARCH} == "amd64" .PATH: ${.CURDIR}/contrib/gcc_gvmat64 SRCS+= gvmat64.S CFLAGS+= -DASMV -DNO_UNDERLINE +ACFLAGS+= -Wa,--noexecstack .endif VERSION_DEF= ${.CURDIR}/Versions.def Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Tue Feb 15 22:01:39 2011 (r218722) +++ head/secure/lib/libcrypto/Makefile Tue Feb 15 22:03:09 2011 (r218723) @@ -345,6 +345,10 @@ INCSDIR= ${INCLUDEDIR}/openssl CSTD= gnu89 +.if !empty(SRCS:M*.s) +AFLAGS+= --noexecstack +.endif + CLEANFILES= buildinf.h opensslconf.h evp.h buildinf.h: ${.CURDIR}/Makefile From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 22:17: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 E8421106566B; Tue, 15 Feb 2011 22:17:47 +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 D6FA98FC0C; Tue, 15 Feb 2011 22:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FMHlU7047231; Tue, 15 Feb 2011 22:17:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FMHlkM047229; Tue, 15 Feb 2011 22:17:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102152217.p1FMHlkM047229@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Feb 2011 22:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218724 - head/bin/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 22:17:48 -0000 Author: jilles Date: Tue Feb 15 22:17:47 2011 New Revision: 218724 URL: http://svn.freebsd.org/changeset/base/218724 Log: test: Note that this is used both as a normal program and a shell builtin. MFC after: 1 week Modified: head/bin/test/test.c Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Tue Feb 15 22:03:09 2011 (r218723) +++ head/bin/test/test.c Tue Feb 15 22:17:47 2011 (r218724) @@ -9,6 +9,10 @@ * * This program is in the Public Domain. */ +/* + * Important: This file is used both as a standalone program /bin/test and + * as a builtin for /bin/sh (#define SHELL). + */ #include __FBSDID("$FreeBSD$"); From owner-svn-src-head@FreeBSD.ORG Tue Feb 15 22:28: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 185611065679; Tue, 15 Feb 2011 22:28:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071FF8FC13; Tue, 15 Feb 2011 22:28:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1FMSFsT047581; Tue, 15 Feb 2011 22:28:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1FMSF4p047579; Tue, 15 Feb 2011 22:28:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102152228.p1FMSF4p047579@svn.freebsd.org> From: Dimitry Andric Date: Tue, 15 Feb 2011 22:28: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: r218725 - head/cddl/lib/libzpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Feb 2011 22:28:16 -0000 Author: dim Date: Tue Feb 15 22:28:15 2011 New Revision: 218725 URL: http://svn.freebsd.org/changeset/base/218725 Log: When building libzpool on ia64 or sparc64, don't add the .note.GNU-stack section. Submitted by: kib Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Tue Feb 15 22:17:47 2011 (r218724) +++ head/cddl/lib/libzpool/Makefile Tue Feb 15 22:28:15 2011 (r218725) @@ -14,7 +14,9 @@ .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S +.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack +.endif .else .PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 06:00: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 B9B62106564A; Wed, 16 Feb 2011 06:00:27 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8C18FC16; Wed, 16 Feb 2011 06:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1G60Rdq057806; Wed, 16 Feb 2011 06:00:27 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1G60RAl057803; Wed, 16 Feb 2011 06:00:27 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201102160600.p1G60RAl057803@svn.freebsd.org> From: Kirk McKusick Date: Wed, 16 Feb 2011 06:00: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: r218726 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 06:00:27 -0000 Author: mckusick Date: Wed Feb 16 06:00:27 2011 New Revision: 218726 URL: http://svn.freebsd.org/changeset/base/218726 Log: Add the -j option to enable soft updates journaling when creating a new file system. Reviewed by: Kostik Belousov Modified: head/sbin/newfs/newfs.8 head/sbin/newfs/newfs.c Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Tue Feb 15 22:28:15 2011 (r218725) +++ head/sbin/newfs/newfs.8 Wed Feb 16 06:00:27 2011 (r218726) @@ -36,7 +36,7 @@ .Nd construct a new UFS1/UFS2 file system .Sh SYNOPSIS .Nm -.Op Fl EJNUlnt +.Op Fl EJNUjlnt .Op Fl L Ar volname .Op Fl O Ar filesystem-type .Op Fl S Ar sector-size @@ -157,6 +157,12 @@ If fewer inodes are desired, a larger nu to create more inodes a smaller number should be given. One inode is required for each distinct file, so this value effectively specifies the average file size on the file system. +.It Fl j +Enable soft updates journaling on the new file system. +This flag is implemented by running the +.Xr tunefs 8 +utility found in the user's +.Dv $PATH . .It Fl l Enable multilabel MAC on the new file system. .It Fl m Ar free-space Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Tue Feb 15 22:28:15 2011 (r218725) +++ head/sbin/newfs/newfs.c Wed Feb 16 06:00:27 2011 (r218726) @@ -87,6 +87,7 @@ int Nflag; /* run without writing file int Oflag = 2; /* file system format (1 => UFS1, 2 => UFS2) */ int Rflag; /* regression test */ int Uflag; /* enable soft updates for file system */ +int jflag; /* enable soft updates journaling for filesys */ int Xflag = 0; /* exit in middle of newfs for testing */ int Jflag; /* enable gjournal for file system */ int lflag; /* enable multilabel for file system */ @@ -140,7 +141,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:t")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:jlm:no:p:r:s:t")) != -1) switch (ch) { case 'E': Eflag = 1; @@ -180,6 +181,9 @@ main(int argc, char *argv[]) case 'T': disktype = optarg; break; + case 'j': + jflag = 1; + /* fall through to enable soft updates */ case 'U': Uflag = 1; break; @@ -397,7 +401,11 @@ main(int argc, char *argv[]) rewritelabel(special, lp); } ufs_disk_close(&disk); - exit(0); + if (!jflag) + exit(0); + if (execlp("tunefs", "newfs", "-j", "enable", special, NULL) < 0) + err(1, "Cannot enable soft updates journaling, tunefs"); + /* NOT REACHED */ } void @@ -492,6 +500,7 @@ usage() fprintf(stderr, "\t-g average file size\n"); fprintf(stderr, "\t-h average files per directory\n"); fprintf(stderr, "\t-i number of bytes per inode\n"); + fprintf(stderr, "\t-j enable soft updates journaling\n"); fprintf(stderr, "\t-l enable multilabel MAC\n"); fprintf(stderr, "\t-n do not create .snap directory\n"); fprintf(stderr, "\t-m minimum free space %%\n"); From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 08:33: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 90DF0106564A; Wed, 16 Feb 2011 08:33:30 +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 7BAE08FC1B; Wed, 16 Feb 2011 08:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1G8XUeP062752; Wed, 16 Feb 2011 08:33:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1G8XUd8062748; Wed, 16 Feb 2011 08:33:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102160833.p1G8XUd8062748@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 16 Feb 2011 08:33: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: r218729 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/mos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 08:33:30 -0000 Author: hselasky Date: Wed Feb 16 08:33:30 2011 New Revision: 218729 URL: http://svn.freebsd.org/changeset/base/218729 Log: Add support for new USB to ethernet controller: Moschip MCS7730/MCS7830 Submitted by: Rick van der Zwet Approved by: thompsa (mentor) Added: head/share/man/man4/mos.4 (contents, props changed) head/sys/dev/usb/net/if_mos.c (contents, props changed) head/sys/dev/usb/net/if_mosreg.h (contents, props changed) head/sys/modules/usb/mos/ head/sys/modules/usb/mos/Makefile (contents, props changed) Modified: head/sys/dev/usb/usbdevs head/sys/modules/usb/Makefile Added: head/share/man/man4/mos.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mos.4 Wed Feb 16 08:33:30 2011 (r218729) @@ -0,0 +1,95 @@ +.\" +.\" Copyright (c) 2011 Rick van der Zwet +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 14, 2011 +.Dt MOS 4 +.Os +.Sh NAME +.Nm mos +.Nd Moschip MCS7730/MCS7840 USB Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device miibus" +.Cd "device mos" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_mos_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for USB Ethernet adapters based on the +Moschip MCS7730/MCS7830 chipset. +.Pp +The adapters that contain the Moschip MCS7730/MCS7830 chipset +will operate at 100Base-TX and full-duplex. +.Pp +The Moschip contains a 10/100 +Ethernet MAC with MII interface and is designed to work with both +Ethernet and HomePNA transceivers. +Although designed to interface with +100Mbps peripherals, this only works with USB 2.0. The existing USB 1.0 +standard specifies a maximum transfer speed of 12Mbps. +USB 1.0 Users should therefore not expect to actually achieve 100Mbps speeds +with these devices. +.Pp +The Moschip supports a 64-bit multicast hash table, single perfect +filter entry for the station address and promiscuous mode. +Packets are +received and transmitted over separate USB bulk transfer endpoints. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +Adapters supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Sitecom LN030 +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 +.Rs +.%T ADMtek AN986 data sheet +.%O http://www.moschip.com/data/products/MCS7830/Data%20Sheet_7830.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 8.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Rick van der Zwet info@rickvanderzwet.nl . Added: head/sys/dev/usb/net/if_mos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_mos.c Wed Feb 16 08:33:30 2011 (r218729) @@ -0,0 +1,1024 @@ +/*- + * Copyright (c) 2011 Rick van der Zwet + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Copyright (c) 2008 Johann Christian Rode + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Copyright (c) 2005, 2006, 2007 Jonathan Gray + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Copyright (c) 1997, 1998, 1999, 2000-2003 + * Bill Paul . 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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$"); + +/* + * Moschip MCS7730/MCS7830 USB to Ethernet controller + * The datasheet is available at the following URL: + * http://www.moschip.com/data/products/MCS7830/Data%20Sheet_7830.pdf + */ + +/* + * The FreeBSD if_mos.c driver is based on various different sources: + * The vendor provided driver at the following URL: + * http://www.moschip.com/data/products/MCS7830/Driver_FreeBSD_7830.tar.gz + * + * Mixed together with the OpenBSD if_mos.c driver for validation and checking + * and the FreeBSD if_reu.c as reference for the USB Ethernet framework. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR mos_debug +#include +#include + +#include + +//#include +#include "if_mosreg.h" + +#ifdef USB_DEBUG +static int mos_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); +SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, CTLFLAG_RW, &mos_debug, 0, + "Debug level"); +#endif + +#define MOS_DPRINTFN(fmt,...) \ + DPRINTF("mos: %s: " fmt "\n",__FUNCTION__,## __VA_ARGS__) + +#define USB_PRODUCT_MOSCHIP_MCS7730 0x7730 +#define USB_PRODUCT_SITECOMEU_LN030 0x0021 + + + +/* Various supported device vendors/products. */ +static const struct usb_device_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)}, +}; + +static int mos_probe(device_t dev); +static int mos_attach(device_t dev); +static void mos_attach_post(struct usb_ether *ue); +static int mos_detach(device_t dev); + +static void mos_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error); +static void mos_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error); +static void mos_intr_callback(struct usb_xfer *xfer, usb_error_t error); +static void mos_tick(struct usb_ether *); +static void mos_start(struct usb_ether *); +static void mos_init(struct usb_ether *); +static void mos_chip_init(struct mos_softc *); +static void mos_stop(struct usb_ether *); +static int mos_miibus_readreg(device_t, int, int); +static int mos_miibus_writereg(device_t, int, int, int); +static void mos_miibus_statchg(device_t); +static int mos_ifmedia_upd(struct ifnet *); +static void mos_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void mos_reset(struct mos_softc *sc); + +static int mos_reg_read_1(struct mos_softc *, int); +static int mos_reg_read_2(struct mos_softc *, int); +static int mos_reg_write_1(struct mos_softc *, int, int); +static int mos_reg_write_2(struct mos_softc *, int, int); +static int mos_readmac(struct mos_softc *, uint8_t *); +static int mos_writemac(struct mos_softc *, uint8_t *); +static int mos_write_mcast(struct mos_softc *, u_char *); + +static void mos_setmulti(struct usb_ether *); +static void mos_setpromisc(struct usb_ether *); + +static const struct usb_config mos_config[MOS_ENDPT_MAX] = { + + [MOS_ENDPT_TX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = mos_bulk_write_callback, + .timeout = 10000, + }, + + [MOS_ENDPT_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = (MCLBYTES + 4 + ETHER_CRC_LEN), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = mos_bulk_read_callback, + }, + + [MOS_ENDPT_INTR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, + .callback = mos_intr_callback, + }, +}; + +static device_method_t mos_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mos_probe), + DEVMETHOD(device_attach, mos_attach), + DEVMETHOD(device_detach, mos_detach), + + /* bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* MII interface */ + DEVMETHOD(miibus_readreg, mos_miibus_readreg), + DEVMETHOD(miibus_writereg, mos_miibus_writereg), + DEVMETHOD(miibus_statchg, mos_miibus_statchg), + + {0, 0} +}; + +static driver_t mos_driver = { + .name = "mos", + .methods = mos_methods, + .size = sizeof(struct mos_softc) +}; + +static devclass_t mos_devclass; + +DRIVER_MODULE(mos, uhub, mos_driver, mos_devclass, NULL, 0); +DRIVER_MODULE(miibus, mos, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(mos, uether, 1, 1, 1); +MODULE_DEPEND(mos, usb, 1, 1, 1); +MODULE_DEPEND(mos, ether, 1, 1, 1); +MODULE_DEPEND(mos, miibus, 1, 1, 1); + +static const struct usb_ether_methods mos_ue_methods = { + .ue_attach_post = mos_attach_post, + .ue_start = mos_start, + .ue_init = mos_init, + .ue_stop = mos_stop, + .ue_tick = mos_tick, + .ue_setmulti = mos_setmulti, + .ue_setpromisc = mos_setpromisc, + .ue_mii_upd = mos_ifmedia_upd, + .ue_mii_sts = mos_ifmedia_sts, +}; + + +static int +mos_reg_read_1(struct mos_softc *sc, int reg) +{ + struct usb_device_request req; + usb_error_t err; + uByte val = 0; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = MOS_UR_READREG; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, 1); + + err = uether_do_request(&sc->sc_ue, &req, &val, 1000); + + if (err) { + MOS_DPRINTFN("mos_reg_read_1 error, reg: %d\n", reg); + return (-1); + } + return (val); +} + +static int +mos_reg_read_2(struct mos_softc *sc, int reg) +{ + struct usb_device_request req; + usb_error_t err; + uWord val; + + USETW(val, 0); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = MOS_UR_READREG; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, 2); + + err = uether_do_request(&sc->sc_ue, &req, &val, 1000); + + if (err) { + MOS_DPRINTFN("mos_reg_read_2 error, reg: %d", reg); + return (-1); + } + return (UGETW(val)); +} + +static int +mos_reg_write_1(struct mos_softc *sc, int reg, int aval) +{ + struct usb_device_request req; + usb_error_t err; + uByte val; + val = aval; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = MOS_UR_WRITEREG; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, 1); + + err = uether_do_request(&sc->sc_ue, &req, &val, 1000); + + if (err) { + MOS_DPRINTFN("mos_reg_write_1 error, reg: %d", reg); + return (-1); + } + return (0); +} + +static int +mos_reg_write_2(struct mos_softc *sc, int reg, int aval) +{ + struct usb_device_request req; + usb_error_t err; + uWord val; + + USETW(val, aval); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = MOS_UR_WRITEREG; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, 2); + + err = uether_do_request(&sc->sc_ue, &req, &val, 1000); + + if (err) { + MOS_DPRINTFN("mos_reg_write_2 error, reg: %d", reg); + return (-1); + } + return (0); +} + +static int +mos_readmac(struct mos_softc *sc, u_char *mac) +{ + struct usb_device_request req; + usb_error_t err; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = MOS_UR_READREG; + USETW(req.wValue, 0); + USETW(req.wIndex, MOS_MAC); + USETW(req.wLength, ETHER_ADDR_LEN); + + err = uether_do_request(&sc->sc_ue, &req, mac, 1000); + + if (err) { + return (-1); + } + return (0); +} + +static int +mos_writemac(struct mos_softc *sc, uint8_t *mac) +{ + struct usb_device_request req; + usb_error_t err; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = MOS_UR_WRITEREG; + USETW(req.wValue, 0); + USETW(req.wIndex, MOS_MAC); + USETW(req.wLength, ETHER_ADDR_LEN); + + err = uether_do_request(&sc->sc_ue, &req, mac, 1000); + + if (err) { + MOS_DPRINTFN("mos_writemac error"); + return (-1); + } + return (0); +} + +static int +mos_write_mcast(struct mos_softc *sc, u_char *hashtbl) +{ + struct usb_device_request req; + usb_error_t err; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = MOS_UR_WRITEREG; + USETW(req.wValue, 0); + USETW(req.wIndex, MOS_MCAST_TABLE); + USETW(req.wLength, 8); + + err = uether_do_request(&sc->sc_ue, &req, hashtbl, 1000); + + if (err) { + MOS_DPRINTFN("mos_reg_mcast error"); + return (-1); + } + return (0); +} + +static int +mos_miibus_readreg(struct device *dev, int phy, int reg) +{ + struct mos_softc *sc = device_get_softc(dev); + uWord val; + int i, res, locked; + + USETW(val, 0); + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MOS_LOCK(sc); + + mos_reg_write_2(sc, MOS_PHY_DATA, 0); + mos_reg_write_1(sc, MOS_PHY_CTL, (phy & MOS_PHYCTL_PHYADDR) | + MOS_PHYCTL_READ); + mos_reg_write_1(sc, MOS_PHY_STS, (reg & MOS_PHYSTS_PHYREG) | + MOS_PHYSTS_PENDING); + + for (i = 0; i < MOS_TIMEOUT; i++) { + if (mos_reg_read_1(sc, MOS_PHY_STS) & MOS_PHYSTS_READY) + break; + } + if (i == MOS_TIMEOUT) { + MOS_DPRINTFN("MII read timeout"); + } + res = mos_reg_read_2(sc, MOS_PHY_DATA); + + if (!locked) + MOS_UNLOCK(sc); + return (res); +} + +static int +mos_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct mos_softc *sc = device_get_softc(dev); + int i, locked; + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MOS_LOCK(sc); + + mos_reg_write_2(sc, MOS_PHY_DATA, val); + mos_reg_write_1(sc, MOS_PHY_CTL, (phy & MOS_PHYCTL_PHYADDR) | + MOS_PHYCTL_WRITE); + mos_reg_write_1(sc, MOS_PHY_STS, (reg & MOS_PHYSTS_PHYREG) | + MOS_PHYSTS_PENDING); + + for (i = 0; i < MOS_TIMEOUT; i++) { + if (mos_reg_read_1(sc, MOS_PHY_STS) & MOS_PHYSTS_READY) + break; + } + if (i == MOS_TIMEOUT) + MOS_DPRINTFN("MII write timeout"); + + if (!locked) + MOS_UNLOCK(sc); + return 0; +} + +static void +mos_miibus_statchg(device_t dev) +{ + struct mos_softc *sc = device_get_softc(dev); + struct mii_data *mii = GET_MII(sc); + int val, err, locked; + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MOS_LOCK(sc); + + /* disable RX, TX prior to changing FDX, SPEEDSEL */ + val = mos_reg_read_1(sc, MOS_CTL); + val &= ~(MOS_CTL_TX_ENB | MOS_CTL_RX_ENB); + mos_reg_write_1(sc, MOS_CTL, val); + + /* reset register which counts dropped frames */ + mos_reg_write_1(sc, MOS_FRAME_DROP_CNT, 0); + + if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) + val |= MOS_CTL_FDX_ENB; + else + val &= ~(MOS_CTL_FDX_ENB); + + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_100_TX: + val |= MOS_CTL_SPEEDSEL; + break; + case IFM_10_T: + val &= ~(MOS_CTL_SPEEDSEL); + break; + } + + /* re-enable TX, RX */ + val |= (MOS_CTL_TX_ENB | MOS_CTL_RX_ENB); + err = mos_reg_write_1(sc, MOS_CTL, val); + + if (err) + MOS_DPRINTFN("media change failed"); + + if (!locked) + MOS_UNLOCK(sc); +} + +/* + * Set media options. + */ +static int +mos_ifmedia_upd(struct ifnet *ifp) +{ + struct mos_softc *sc = ifp->if_softc; + struct mii_data *mii = GET_MII(sc); + struct mii_softc *miisc; + + MOS_LOCK_ASSERT(sc, MA_OWNED); + + sc->mos_link = 0; + if (mii->mii_instance) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } + mii_mediachg(mii); + return (0); +} + +/* + * Report current media status. + */ +static void +mos_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct mos_softc *sc = ifp->if_softc; + struct mii_data *mii = GET_MII(sc); + + MOS_LOCK(sc); + mii_pollstat(mii); + MOS_UNLOCK(sc); + + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; +} + +static void +mos_setpromisc(struct usb_ether *ue) +{ + struct mos_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); + + uint8_t rxmode; + + MOS_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = mos_reg_read_1(sc, MOS_CTL); + + /* If we want promiscuous mode, set the allframes bit. */ + if (ifp->if_flags & IFF_PROMISC) { + rxmode |= MOS_CTL_RX_PROMISC; + } else { + rxmode &= ~MOS_CTL_RX_PROMISC; + } + + mos_reg_write_1(sc, MOS_CTL, rxmode); +} + + + +static void +mos_setmulti(struct usb_ether *ue) +{ + struct mos_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); + struct ifmultiaddr *ifma; + + uint32_t h = 0; + uint8_t rxmode; + uint8_t hashtbl[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int allmulti = 0; + + MOS_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = mos_reg_read_1(sc, MOS_CTL); + + if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) + allmulti = 1; + + /* get all new ones */ + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) { + allmulti = 1; + continue; + }; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + /* now program new ones */ + if (allmulti == 1) { + rxmode |= MOS_CTL_ALLMULTI; + mos_reg_write_1(sc, MOS_CTL, rxmode); + } else { + rxmode &= ~MOS_CTL_ALLMULTI; + mos_write_mcast(sc, (void *)&hashtbl); + mos_reg_write_1(sc, MOS_CTL, rxmode); + } +} + +static void +mos_reset(struct mos_softc *sc) +{ + uint8_t ctl; + + ctl = mos_reg_read_1(sc, MOS_CTL); + ctl &= ~(MOS_CTL_RX_PROMISC | MOS_CTL_ALLMULTI | MOS_CTL_TX_ENB | + MOS_CTL_RX_ENB); + /* Disable RX, TX, promiscuous and allmulticast mode */ + mos_reg_write_1(sc, MOS_CTL, ctl); + + /* Reset frame drop counter register to zero */ + mos_reg_write_1(sc, MOS_FRAME_DROP_CNT, 0); + + /* Wait a little while for the chip to get its brains in order. */ + usb_pause_mtx(&sc->sc_mtx, hz / 128); + return; +} + +static void +mos_chip_init(struct mos_softc *sc) +{ + int i; + + /* + * Rev.C devices have a pause threshold register which needs to be set + * at startup. + */ + if (mos_reg_read_1(sc, MOS_PAUSE_TRHD) != -1) { + for (i = 0; i < MOS_PAUSE_REWRITES; i++) + mos_reg_write_1(sc, MOS_PAUSE_TRHD, 0); + } + sc->mos_phyaddrs[0] = 1; + sc->mos_phyaddrs[1] = 0xFF; +} + +/* + * Probe for a MCS7x30 chip. + */ +static int +mos_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + int retval; + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != MOS_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != MOS_IFACE_IDX) + return (ENXIO); + + retval = usbd_lookup_id_by_uaa(mos_devs, sizeof(mos_devs), uaa); + return (retval); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +mos_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct mos_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + uint8_t iface_index; + int error; + + sc->mos_flags = USB_GET_DRIVER_INFO(uaa); + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = MOS_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, mos_config, MOS_ENDPT_MAX, + sc, &sc->sc_mtx); + + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &mos_ue_methods; + + + if (sc->mos_flags & MCS7730) { + MOS_DPRINTFN("model: MCS7730"); + } else if (sc->mos_flags & MCS7830) { + MOS_DPRINTFN("model: MCS7830"); + } + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); + + +detach: + mos_detach(dev); + return (ENXIO); +} + + +static void +mos_attach_post(struct usb_ether *ue) +{ + struct mos_softc *sc = uether_getsc(ue); + int err; + + /* Read MAC address, inform the world. */ + err = mos_readmac(sc, ue->ue_eaddr); + + if (err) + MOS_DPRINTFN("couldn't get MAC address"); + + MOS_DPRINTFN("address: %s", ether_sprintf(ue->ue_eaddr)); + + mos_chip_init(sc); +} + +static int +mos_detach(device_t dev) +{ + struct mos_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + + usbd_transfer_unsetup(sc->sc_xfer, MOS_ENDPT_MAX); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + + + + +/* + * A frame has been uploaded: pass the resulting mbuf chain up to + * the higher level protocols. + */ +static void +mos_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct mos_softc *sc = usbd_xfer_softc(xfer); + struct usb_ether *ue = &sc->sc_ue; + struct ifnet *ifp = uether_getifp(ue); + + uint8_t rxstat = 0; + uint32_t actlen; + uint16_t pktlen = 0; + struct usb_page_cache *pc; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + pc = usbd_xfer_get_frame(xfer, 0); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + MOS_DPRINTFN("actlen : %d", actlen); + if (actlen <= 1) { + ifp->if_ierrors++; + goto tr_setup; + } + /* evaluate status byte at the end */ + usbd_copy_out(pc, actlen - sizeof(rxstat), &rxstat, + sizeof(rxstat)); + + if (rxstat != MOS_RXSTS_VALID) { + MOS_DPRINTFN("erroneous frame received"); + if (rxstat & MOS_RXSTS_SHORT_FRAME) + MOS_DPRINTFN("frame size less than 64 bytes"); + if (rxstat & MOS_RXSTS_LARGE_FRAME) + MOS_DPRINTFN("frame size larger than 1532 bytes"); + if (rxstat & MOS_RXSTS_CRC_ERROR) + MOS_DPRINTFN("CRC error"); + if (rxstat & MOS_RXSTS_ALIGN_ERROR) + MOS_DPRINTFN("alignment error"); + ifp->if_ierrors++; + goto tr_setup; + } + /* Remember the last byte was used for the status fields */ + pktlen = actlen - 1; + if (pktlen < sizeof(struct ether_header)) { + MOS_DPRINTFN("error: pktlen %i is smaller than ether_header %i", pktlen, sizeof(struct ether_header)); + ifp->if_ierrors++; + goto tr_setup; + } + uether_rxbuf(ue, pc, 0, actlen); + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + default: + MOS_DPRINTFN("bulk read error, %s", usbd_errstr(error)); + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + MOS_DPRINTFN("start rx %i", usbd_xfer_max_len(xfer)); + return; + } +} + +/* + * A frame was downloaded to the chip. It's safe for us to clean up + * the list buffers. + */ +static void +mos_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct mos_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct usb_page_cache *pc; + struct mbuf *m; + + + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + MOS_DPRINTFN("transfer of complete"); + ifp->if_opackets++; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + /* + * XXX: don't send anything if there is no link? + */ + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + return; + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len); + + usbd_xfer_set_frame_len(xfer, 0, m->m_pkthdr.len); + + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + usbd_transfer_submit(xfer); + + ifp->if_opackets++; + return; + default: + MOS_DPRINTFN("usb error on tx: %s\n", usbd_errstr(error)); + ifp->if_oerrors++; + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +mos_tick(struct usb_ether *ue) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 09:18: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 782461065673; Wed, 16 Feb 2011 09:18:37 +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 A16B18FC12; Wed, 16 Feb 2011 09:18:36 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=O4luLtK3s/BI/ZI2MixGyL7hJC8Dk2jKRuc55HZ6Kk0= c=1 sm=1 a=SnDesWiRLDkA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=A7YgwG7hLn49lNH38kUA:9 a=H-Z5PIaaiIOJjBtC7Ki0kiZT9_QA:4 a=pILNOxqGKmIA:10 a=6I5d2MoRAAAA:8 a=Wq95O-PtwxLR_cIk1nUA:9 a=KpspBby8odZWiBk5VU4A:7 a=6CvDi8QMNYYX61CZVEs81cJL99QA:4 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 87554678; Wed, 16 Feb 2011 10:18:34 +0100 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Wed, 16 Feb 2011 10:18:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201102160833.p1G8XUd8062748@svn.freebsd.org> In-Reply-To: <201102160833.p1G8XUd8062748@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: Multipart/Mixed; boundary="Boundary-00=_gZ5WNJX2eUzp5Vx" Message-Id: <201102161018.24222.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r218729 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/mos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 09:18:37 -0000 --Boundary-00=_gZ5WNJX2eUzp5Vx Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Hi, There was a minor missing delta in if_mos.c, needed for build with USB_DEBUG set on AMD64. Can someone approve that I commit this, hence my mentor just went offline :-) --HPS --Boundary-00=_gZ5WNJX2eUzp5Vx Content-Type: text/plain; charset="windows-1252"; name="if_mos_fix.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="if_mos_fix.txt" ==== Patch level 1 Source: [No source] Target: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f:/head/sys/dev/usb/net:218729 [mirrored] (svn+ssh://hselasky@svn.freebsd.org/base) Log: Fix build breakage in if_mos.c when USB_DEBUG option is set. Approved by: thompsa (mentor) === if_mos.c ================================================================== --- if_mos.c (revision 218729) +++ if_mos.c (patch if_mos_fix.txt level 1) @@ -814,7 +814,7 @@ /* Remember the last byte was used for the status fields */ pktlen = actlen - 1; if (pktlen < sizeof(struct ether_header)) { - MOS_DPRINTFN("error: pktlen %i is smaller than ether_header %i", pktlen, sizeof(struct ether_header)); + MOS_DPRINTFN("error: pktlen %i is smaller than ether_header %i", pktlen, (int)sizeof(struct ether_header)); ifp->if_ierrors++; goto tr_setup; } --Boundary-00=_gZ5WNJX2eUzp5Vx-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 09:26: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 0D0AA1065674; Wed, 16 Feb 2011 09:26:57 +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 EEC8B8FC13; Wed, 16 Feb 2011 09:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1G9QuHS064047; Wed, 16 Feb 2011 09:26:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1G9Qu0P064045; Wed, 16 Feb 2011 09:26:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102160926.p1G9Qu0P064045@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 16 Feb 2011 09:26: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: r218730 - 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: Wed, 16 Feb 2011 09:26:57 -0000 Author: hselasky Date: Wed Feb 16 09:26:56 2011 New Revision: 218730 URL: http://svn.freebsd.org/changeset/base/218730 Log: Fix build breakage in if_mos.c when USB_DEBUG option is set. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/net/if_mos.c Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Wed Feb 16 08:33:30 2011 (r218729) +++ head/sys/dev/usb/net/if_mos.c Wed Feb 16 09:26:56 2011 (r218730) @@ -814,7 +814,7 @@ mos_bulk_read_callback(struct usb_xfer * /* Remember the last byte was used for the status fields */ pktlen = actlen - 1; if (pktlen < sizeof(struct ether_header)) { - MOS_DPRINTFN("error: pktlen %i is smaller than ether_header %i", pktlen, sizeof(struct ether_header)); + MOS_DPRINTFN("error: pktlen %d is smaller than ether_header %zd", pktlen, sizeof(struct ether_header)); ifp->if_ierrors++; goto tr_setup; } From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 12:31: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 89EF21065672; Wed, 16 Feb 2011 12:31:27 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 55D288FC1C; Wed, 16 Feb 2011 12:31:27 +0000 (UTC) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 9667620B5A; Wed, 16 Feb 2011 07:13:33 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 16 Feb 2011 07:13:33 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=f7byHeiI48CNbS/meXPQHfMog4Y=; b=cgHmvBGmKA3LljePk9xb+LRJ3IbS2gxU/75vUMfOGdqqH6ZA4QCkzSc3xvIWMx6gPoHuKyjppmWSQXaQjxXhLaNpT9M0cjhnyL7dyyiJKbtGvG4me6DexX2D1qJg6hzP2e/XMxoSB/nVD9+zuc5nR10dUnyszCmN7mv2SHSN3Fw= X-Sasl-enc: UAoj47QLGU7CP/GRjdJv5ego5zjQeHK1gkRAucp4HM5I 1297858413 Received: from [192.168.0.50] (83-244-134-234.cust-83.exponential-e.net [83.244.134.234]) by mail.messagingengine.com (Postfix) with ESMTPSA id 074E2444867; Wed, 16 Feb 2011 07:13:32 -0500 (EST) Message-ID: <4D5BBF76.40409@incunabulum.net> Date: Wed, 16 Feb 2011 12:13:42 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: John Baldwin References: <200904290950.n3T9o46f075350@svn.freebsd.org> <201102151034.46242.jhb@freebsd.org> In-Reply-To: <201102151034.46242.jhb@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r191651 - 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: Wed, 16 Feb 2011 12:31:27 -0000 John, That's news to me. I'm pretty sure I tested this code with and without INET6 when I checked it in, given I was mostly testing without INET6. This was a very long time ago, so I was surprised to receive your message. Could something have changed to have broken mtest? thanks BMS John Baldwin wrote: > On Wednesday, April 29, 2009 5:50:04 am Bruce M Simpson wrote: >> Author: bms >> Date: Wed Apr 29 09:50:04 2009 >> New Revision: 191651 >> URL: http://svn.freebsd.org/changeset/base/191651 >> >> Log: >> Merge IPv6-capable mtest(8) from MLDv2 branch. >> >> Modified: >> head/usr.sbin/mtest/Makefile >> head/usr.sbin/mtest/mtest.8 >> head/usr.sbin/mtest/mtest.c > > This is completely broken as it fails to work if you don't have INET6 compiled > into the kernel, even if all you want to do is test joining IPv4 multicast > groups. > From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 14:01: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 DD4AC106566B; Wed, 16 Feb 2011 14:01:21 +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 AE2E18FC08; Wed, 16 Feb 2011 14:01:21 +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 5F2D446B2A; Wed, 16 Feb 2011 09:01:21 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7893F8A01D; Wed, 16 Feb 2011 09:01:20 -0500 (EST) From: John Baldwin To: Bruce Simpson Date: Wed, 16 Feb 2011 08:58:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <200904290950.n3T9o46f075350@svn.freebsd.org> <201102151034.46242.jhb@freebsd.org> <4D5BBF76.40409@incunabulum.net> In-Reply-To: <4D5BBF76.40409@incunabulum.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102160858.53577.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 16 Feb 2011 09:01:20 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r191651 - 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: Wed, 16 Feb 2011 14:01:22 -0000 On Wednesday, February 16, 2011 7:13:42 am Bruce Simpson wrote: > John, > > That's news to me. I'm pretty sure I tested this code with and without > INET6 when I checked it in, given I was mostly testing without INET6. > > This was a very long time ago, so I was surprised to receive your > message. Could something have changed to have broken mtest? I think the code was always busted (and I just tried to use mtest on 8 for the first time today with a kernel that had INET6 compiled out): int main(int argc, char **argv) { char line[LINE_LENGTH]; char *p; int i, s, s6; s = -1; s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s6 == -1) err(1, "can't open IPv6 socket"); #endif With INET6 enabled in userland but a kernel not built with INET6, then the call to socket() for s6 will fail causing it to exit right away. Presumably the code should be changed to do something more like: #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); #else s = -1; #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); #else s6 = -1; #endif if (s < 0 && s6 < 0) err(1, "can't open socket"); However, the rest of the code in mtest needs to be updated as well to not assume that 's' and 's6' are always valid so it would be a fair amount of work. > thanks > BMS > > John Baldwin wrote: > > On Wednesday, April 29, 2009 5:50:04 am Bruce M Simpson wrote: > >> Author: bms > >> Date: Wed Apr 29 09:50:04 2009 > >> New Revision: 191651 > >> URL: http://svn.freebsd.org/changeset/base/191651 > >> > >> Log: > >> Merge IPv6-capable mtest(8) from MLDv2 branch. > >> > >> Modified: > >> head/usr.sbin/mtest/Makefile > >> head/usr.sbin/mtest/mtest.8 > >> head/usr.sbin/mtest/mtest.c > > > > This is completely broken as it fails to work if you don't have INET6 compiled > > into the kernel, even if all you want to do is test joining IPv4 multicast > > groups. > > > -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 15:20: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 199DC1065675; Wed, 16 Feb 2011 15:20:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A78C8FC18; Wed, 16 Feb 2011 15:20:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GFKbq6074283; Wed, 16 Feb 2011 15:20:37 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GFKbhs074281; Wed, 16 Feb 2011 15:20:37 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201102161520.p1GFKbhs074281@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 16 Feb 2011 15:20: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: r218737 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 15:20:38 -0000 Author: nyan Date: Wed Feb 16 15:20:37 2011 New Revision: 218737 URL: http://svn.freebsd.org/changeset/base/218737 Log: MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Wed Feb 16 15:19:31 2011 (r218736) +++ head/sys/boot/pc98/boot2/boot2.c Wed Feb 16 15:20:37 2011 (r218737) @@ -134,7 +134,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 15:43: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 5E42D1065702; Wed, 16 Feb 2011 15:43:35 +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 4F0318FC1C; Wed, 16 Feb 2011 15:43:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GFhZfq074993; Wed, 16 Feb 2011 15:43:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GFhZmm074991; Wed, 16 Feb 2011 15:43:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201102161543.p1GFhZmm074991@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 16 Feb 2011 15:43: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: r218741 - 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: Wed, 16 Feb 2011 15:43:35 -0000 Author: pluknet Date: Wed Feb 16 15:43:35 2011 New Revision: 218741 URL: http://svn.freebsd.org/changeset/base/218741 Log: Bump dummynet module version to meet dummynet schedulers' requirements, and thus unbreak loading dummynet.ko via /boot/loader.conf. Reported by: rihad on freebsd-net Approved by: kib (mentor) Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Wed Feb 16 15:27:54 2011 (r218740) +++ head/sys/netinet/ipfw/ip_dummynet.c Wed Feb 16 15:43:35 2011 (r218741) @@ -2294,7 +2294,7 @@ static moduledata_t dummynet_mod = { #define DN_MODEV_ORD (SI_ORDER_ANY - 128) /* after ipfw */ DECLARE_MODULE(dummynet, dummynet_mod, DN_SI_SUB, DN_MODEV_ORD); MODULE_DEPEND(dummynet, ipfw, 2, 2, 2); -MODULE_VERSION(dummynet, 1); +MODULE_VERSION(dummynet, 3); /* * Starting up. Done in order after dummynet_modevent() has been called. From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 17:50: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 BA0D7106564A; Wed, 16 Feb 2011 17:50:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A73458FC15; Wed, 16 Feb 2011 17:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GHoLuH078289; Wed, 16 Feb 2011 17:50:21 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GHoLuL078282; Wed, 16 Feb 2011 17:50:21 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201102161750.p1GHoLuL078282@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 16 Feb 2011 17:50: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: r218744 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 17:50:21 -0000 Author: dchagin Date: Wed Feb 16 17:50:21 2011 New Revision: 218744 URL: http://svn.freebsd.org/changeset/base/218744 Log: To avoid excessive code duplication create wrapper for fill regs from stack frame. Change the trap() code to use newly created function instead of explicit regs assignment. Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/reg.h head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/reg.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/amd64/amd64/machdep.c Wed Feb 16 17:50:21 2011 (r218744) @@ -1842,6 +1842,12 @@ fill_regs(struct thread *td, struct reg struct trapframe *tp; tp = td->td_frame; + return (fill_frame_regs(tp, regs)); +} + +int +fill_frame_regs(struct trapframe *tp, struct reg *regs) +{ regs->r_r15 = tp->tf_r15; regs->r_r14 = tp->tf_r14; regs->r_r13 = tp->tf_r13; Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/amd64/amd64/trap.c Wed Feb 16 17:50:21 2011 (r218744) @@ -249,38 +249,8 @@ trap(struct trapframe *frame) if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; - - regs.r_r15 = frame->tf_r15; - regs.r_r14 = frame->tf_r14; - regs.r_r13 = frame->tf_r13; - regs.r_r12 = frame->tf_r12; - regs.r_r11 = frame->tf_r11; - regs.r_r10 = frame->tf_r10; - regs.r_r9 = frame->tf_r9; - regs.r_r8 = frame->tf_r8; - regs.r_rdi = frame->tf_rdi; - regs.r_rsi = frame->tf_rsi; - regs.r_rbp = frame->tf_rbp; - regs.r_rbx = frame->tf_rbx; - regs.r_rdx = frame->tf_rdx; - regs.r_rcx = frame->tf_rcx; - regs.r_rax = frame->tf_rax; - regs.r_rip = frame->tf_rip; - regs.r_cs = frame->tf_cs; - regs.r_rflags = frame->tf_rflags; - regs.r_rsp = frame->tf_rsp; - regs.r_ss = frame->tf_ss; - if (frame->tf_flags & TF_HASSEGS) { - regs.r_ds = frame->tf_ds; - regs.r_es = frame->tf_es; - regs.r_fs = frame->tf_fs; - regs.r_gs = frame->tf_gs; - } else { - regs.r_ds = 0; - regs.r_es = 0; - regs.r_fs = 0; - regs.r_gs = 0; - } + + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) Modified: head/sys/amd64/include/reg.h ============================================================================== --- head/sys/amd64/include/reg.h Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/amd64/include/reg.h Wed Feb 16 17:50:21 2011 (r218744) @@ -130,6 +130,7 @@ struct dbreg { * XXX these interfaces are MI, so they should be declared in a MI place. */ int fill_regs(struct thread *, struct reg *); +int fill_frame_regs(struct trapframe *, struct reg *); int set_regs(struct thread *, struct reg *); int fill_fpregs(struct thread *, struct fpreg *); int set_fpregs(struct thread *, struct fpreg *); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/i386/i386/machdep.c Wed Feb 16 17:50:21 2011 (r218744) @@ -3122,6 +3122,13 @@ fill_regs(struct thread *td, struct reg tp = td->td_frame; pcb = td->td_pcb; + regs->r_gs = pcb->pcb_gs; + return (fill_frame_regs(tp, regs)); +} + +int +fill_frame_regs(struct trapframe *tp, struct reg *regs) +{ regs->r_fs = tp->tf_fs; regs->r_es = tp->tf_es; regs->r_ds = tp->tf_ds; @@ -3137,7 +3144,6 @@ fill_regs(struct thread *td, struct reg regs->r_eflags = tp->tf_eflags; regs->r_esp = tp->tf_esp; regs->r_ss = tp->tf_ss; - regs->r_gs = pcb->pcb_gs; return (0); } Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/i386/i386/trap.c Wed Feb 16 17:50:21 2011 (r218744) @@ -271,21 +271,7 @@ trap(struct trapframe *frame) type == T_BPTFLT) { struct reg regs; - regs.r_fs = frame->tf_fs; - regs.r_es = frame->tf_es; - regs.r_ds = frame->tf_ds; - regs.r_edi = frame->tf_edi; - regs.r_esi = frame->tf_esi; - regs.r_ebp = frame->tf_ebp; - regs.r_ebx = frame->tf_ebx; - regs.r_edx = frame->tf_edx; - regs.r_ecx = frame->tf_ecx; - regs.r_eax = frame->tf_eax; - regs.r_eip = frame->tf_eip; - regs.r_cs = frame->tf_cs; - regs.r_eflags = frame->tf_eflags; - regs.r_esp = frame->tf_esp; - regs.r_ss = frame->tf_ss; + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) Modified: head/sys/i386/include/reg.h ============================================================================== --- head/sys/i386/include/reg.h Wed Feb 16 16:19:54 2011 (r218743) +++ head/sys/i386/include/reg.h Wed Feb 16 17:50:21 2011 (r218744) @@ -161,6 +161,7 @@ struct dbreg { * XXX these interfaces are MI, so they should be declared in a MI place. */ int fill_regs(struct thread *, struct reg *); +int fill_frame_regs(struct trapframe *, struct reg *); int set_regs(struct thread *, struct reg *); int fill_fpregs(struct thread *, struct fpreg *); int set_fpregs(struct thread *, struct fpreg *); From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 18:05: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 8455B1065670; Wed, 16 Feb 2011 18:05: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 7279B8FC15; Wed, 16 Feb 2011 18:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GI5AZe078770; Wed, 16 Feb 2011 18:05:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GI5ABX078768; Wed, 16 Feb 2011 18:05:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201102161805.p1GI5ABX078768@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Feb 2011 18:05: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: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 18:05:10 -0000 Author: imp Date: Wed Feb 16 18:05:10 2011 New Revision: 218745 URL: http://svn.freebsd.org/changeset/base/218745 Log: Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 20:07: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 3BDD1106564A; Wed, 16 Feb 2011 20:07:45 +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 1DDA18FC12; Wed, 16 Feb 2011 20:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GK7jFg082172; Wed, 16 Feb 2011 20:07:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GK7jok082170; Wed, 16 Feb 2011 20:07:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102162007.p1GK7jok082170@svn.freebsd.org> From: Adrian Chadd Date: Wed, 16 Feb 2011 20:07: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: r218747 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 20:07:45 -0000 Author: adrian Date: Wed Feb 16 20:07:44 2011 New Revision: 218747 URL: http://svn.freebsd.org/changeset/base/218747 Log: Modify the spi flash driver to allow smaller read IO sizes, but enforce the larger, aligned write+erase sizes the driver currently implements. This preserves write behaviour but makes the flash driver usable for things like a read-only FFS or a geom_uzip/geom_compress . Note that since GEOM will now return the sector size as being smaller, writes of sector size/alignment will now fail with an EIO. Code which writes to the flash device will have to be (for now) manually taught about the flash write blocksize. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Wed Feb 16 19:30:29 2011 (r218746) +++ head/sys/dev/flash/mx25l.c Wed Feb 16 20:07:44 2011 (r218747) @@ -49,6 +49,13 @@ __FBSDID("$FreeBSD$"); #define FL_ERASE_4K 0x01 #define FL_ERASE_32K 0x02 +/* + * Define the sectorsize to be a smaller size rather than the flash + * sector size. Trying to run FFS off of a 64k flash sector size + * results in a completely un-usable system. + */ +#define MX25L_SECTORSIZE 512 + struct mx25l_flash_ident { const char *name; @@ -231,15 +238,11 @@ mx25l_write(device_t dev, off_t offset, write_offset = offset; /* - * Sanity checks + * Use the erase sectorsize here since blocks are fully erased + * first before they're written to. */ - KASSERT(count % sc->sc_sectorsize == 0, - ("count for BIO_WRITE is not sector size (%d bytes) aligned", - sc->sc_sectorsize)); - - KASSERT(offset % sc->sc_sectorsize == 0, - ("offset for BIO_WRITE is not sector size (%d bytes) aligned", - sc->sc_sectorsize)); + if (count % sc->sc_sectorsize != 0 || offset % sc->sc_sectorsize != 0) + return (EIO); /* * Assume here that we write per-sector only @@ -308,15 +311,13 @@ mx25l_read(device_t dev, off_t offset, c sc = device_get_softc(dev); /* - * Sanity checks + * Enforce the disk read sectorsize not the erase sectorsize. + * In this way, smaller read IO is possible,dramatically + * speeding up filesystem/geom_compress access. */ - KASSERT(count % sc->sc_sectorsize == 0, - ("count for BIO_READ is not sector size (%d bytes) aligned", - sc->sc_sectorsize)); - - KASSERT(offset % sc->sc_sectorsize == 0, - ("offset for BIO_READ is not sector size (%d bytes) aligned", - sc->sc_sectorsize)); + if (count % sc->sc_disk->d_sectorsize != 0 + || offset % sc->sc_disk->d_sectorsize != 0) + return (EIO); txBuf[0] = CMD_FAST_READ; cmd.tx_cmd_sz = 5; @@ -371,7 +372,7 @@ mx25l_attach(device_t dev) sc->sc_disk->d_name = "flash/spi"; sc->sc_disk->d_drv1 = sc; sc->sc_disk->d_maxsize = DFLTPHYS; - sc->sc_disk->d_sectorsize = ident->sectorsize; + sc->sc_disk->d_sectorsize = MX25L_SECTORSIZE; sc->sc_disk->d_mediasize = ident->sectorsize * ident->sectorcount; sc->sc_disk->d_unit = device_get_unit(sc->sc_dev); sc->sc_disk->d_dump = NULL; /* NB: no dumps */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 20:46: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 E59BD1065679; Wed, 16 Feb 2011 20:46:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3FA38FC2C; Wed, 16 Feb 2011 20:46:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GKkvkV083135; Wed, 16 Feb 2011 20:46:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GKkvng083133; Wed, 16 Feb 2011 20:46:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102162046.p1GKkvng083133@svn.freebsd.org> From: Dimitry Andric Date: Wed, 16 Feb 2011 20:46: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: r218748 - head/usr.sbin/uathload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 20:46:58 -0000 Author: dim Date: Wed Feb 16 20:46:57 2011 New Revision: 218748 URL: http://svn.freebsd.org/changeset/base/218748 Log: Fix the last binary in the base system that still has an executable stack, /usr/sbin/uathload. Since this program links in a .o file containing a firmware blob, and there is no clean way to add a .note.GNU-stack section to this .o file, we simply use the -z noexecstack option to ld here. Modified: head/usr.sbin/uathload/Makefile Modified: head/usr.sbin/uathload/Makefile ============================================================================== --- head/usr.sbin/uathload/Makefile Wed Feb 16 20:07:44 2011 (r218747) +++ head/usr.sbin/uathload/Makefile Wed Feb 16 20:46:57 2011 (r218748) @@ -7,6 +7,10 @@ SRCS= uathload.c ar5523.bin CLEANFILES= ar5523.bin +.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" +LDFLAGS+= -Wl,-z,noexecstack +.endif + ar5523.bin: ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu uudecode -p ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu > ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 21:04: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 652751065693; Wed, 16 Feb 2011 21:04:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D598FC19; Wed, 16 Feb 2011 21:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GL4lRK083636; Wed, 16 Feb 2011 21:04:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GL4liR083634; Wed, 16 Feb 2011 21:04:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102162104.p1GL4liR083634@svn.freebsd.org> From: Dimitry Andric Date: Wed, 16 Feb 2011 21:04: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: r218749 - head/usr.sbin/uathload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 21:04:47 -0000 Author: dim Date: Wed Feb 16 21:04:47 2011 New Revision: 218749 URL: http://svn.freebsd.org/changeset/base/218749 Log: Only use -z noexecstack for these explicit arches: i386, amd64, powerpc and powerpc64. Other arches currently do not support this feature. Reminded by: kib Modified: head/usr.sbin/uathload/Makefile Modified: head/usr.sbin/uathload/Makefile ============================================================================== --- head/usr.sbin/uathload/Makefile Wed Feb 16 20:46:57 2011 (r218748) +++ head/usr.sbin/uathload/Makefile Wed Feb 16 21:04:47 2011 (r218749) @@ -7,7 +7,7 @@ SRCS= uathload.c ar5523.bin CLEANFILES= ar5523.bin -.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -Wl,-z,noexecstack .endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 21:23: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 747BE106566C; Wed, 16 Feb 2011 21:23:09 +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 638988FC20; Wed, 16 Feb 2011 21:23:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GLN9vv084299; Wed, 16 Feb 2011 21:23:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GLN9f9084297; Wed, 16 Feb 2011 21:23:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201102162123.p1GLN9f9084297@svn.freebsd.org> From: Doug Barton Date: Wed, 16 Feb 2011 21:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218753 - head/etc/namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 21:23:09 -0000 Author: dougb Date: Wed Feb 16 21:23:09 2011 New Revision: 218753 URL: http://svn.freebsd.org/changeset/base/218753 Log: Remove in-addr.arpa from the list of zones it is possible to slave locally Modified: head/etc/namedb/named.conf Modified: head/etc/namedb/named.conf ============================================================================== --- head/etc/namedb/named.conf Wed Feb 16 21:21:23 2011 (r218752) +++ head/etc/namedb/named.conf Wed Feb 16 21:23:09 2011 (r218753) @@ -109,14 +109,6 @@ zone "arpa" { }; notify no; }; -zone "in-addr.arpa" { - type slave; - file "/etc/namedb/slave/in-addr.arpa.slave"; - masters { - 192.5.5.241; // F.ROOT-SERVERS.NET. - }; - notify no; -}; */ /* Serving the following zones locally will prevent any queries From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 21:29: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 92C2E10657C0; Wed, 16 Feb 2011 21:29:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3768FC13; Wed, 16 Feb 2011 21:29:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GLTEb3084641; Wed, 16 Feb 2011 21:29:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GLTE4U084618; Wed, 16 Feb 2011 21:29:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201102162129.p1GLTE4U084618@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 16 Feb 2011 21:29: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: r218757 - in head/sys: fs/nfsclient fs/portalfs kern net netgraph/bluetooth/socket netinet nfsclient 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: Wed, 16 Feb 2011 21:29:14 -0000 Author: bz Date: Wed Feb 16 21:29:13 2011 New Revision: 218757 URL: http://svn.freebsd.org/changeset/base/218757 Log: Mfp4 CH=177274,177280,177284-177285,177297,177324-177325 VNET socket push back: try to minimize the number of places where we have to switch vnets and narrow down the time we stay switched. Add assertions to the socket code to catch possibly unset vnets as seen in r204147. While this reduces the number of vnet recursion in some places like NFS, POSIX local sockets and some netgraph, .. recursions are impossible to fix. The current expectations are documented at the beginning of uipc_socket.c along with the other information there. Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Reviewed by: jhb Tested by: zec Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/portalfs/portal_vnops.c head/sys/kern/kern_descrip.c head/sys/kern/sys_socket.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/net/if.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_peeloff.c head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/krpc_subr.c head/sys/nfsclient/nfs_diskless.c head/sys/nfsclient/nfs_vfsops.c head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/rpc_generic.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_generic.c head/sys/rpc/svc_vc.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed Feb 16 21:29:13 2011 (r218757) @@ -452,10 +452,12 @@ ncl_mountroot(struct mount *mp) sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ + CURVNET_SET(TD_TO_VNET(td)); error = rtrequest(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, RTF_UP | RTF_GATEWAY, NULL); + CURVNET_RESTORE(); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); } Modified: head/sys/fs/portalfs/portal_vnops.c ============================================================================== --- head/sys/fs/portalfs/portal_vnops.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/fs/portalfs/portal_vnops.c Wed Feb 16 21:29:13 2011 (r218757) @@ -60,6 +60,8 @@ #include +#include + static int portal_fileid = PORTAL_ROOTFILEID+1; static void portal_closefd(struct thread *td, int fd); @@ -185,8 +187,12 @@ portal_connect(so, so2) if ((so2->so_options & SO_ACCEPTCONN) == 0) return (ECONNREFUSED); - if ((so3 = sonewconn(so2, 0)) == 0) + CURVNET_SET(so2->so_vnet); + if ((so3 = sonewconn(so2, 0)) == 0) { + CURVNET_RESTORE(); return (ECONNREFUSED); + } + CURVNET_RESTORE(); unp2 = sotounpcb(so2); unp3 = sotounpcb(so3); Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/kern/kern_descrip.c Wed Feb 16 21:29:13 2011 (r218757) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include #include @@ -2330,7 +2332,9 @@ fputsock(struct socket *so) ACCEPT_LOCK(); SOCK_LOCK(so); + CURVNET_SET(so->so_vnet); sorele(so); + CURVNET_RESTORE(); } /* Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/kern/sys_socket.c Wed Feb 16 21:29:13 2011 (r218757) @@ -80,9 +80,7 @@ soo_read(struct file *fp, struct uio *ui if (error) return (error); #endif - CURVNET_SET(so->so_vnet); error = soreceive(so, 0, uio, 0, 0, 0); - CURVNET_RESTORE(); return (error); } @@ -123,7 +121,6 @@ soo_ioctl(struct file *fp, u_long cmd, v struct socket *so = fp->f_data; int error = 0; - CURVNET_SET(so->so_vnet); switch (cmd) { case FIONBIO: SOCK_LOCK(so); @@ -210,14 +207,18 @@ soo_ioctl(struct file *fp, u_long cmd, v */ if (IOCGROUP(cmd) == 'i') error = ifioctl(so, cmd, data, td); - else if (IOCGROUP(cmd) == 'r') + else if (IOCGROUP(cmd) == 'r') { + CURVNET_SET(so->so_vnet); error = rtioctl_fib(cmd, data, so->so_fibnum); - else + CURVNET_RESTORE(); + } else { + CURVNET_SET(so->so_vnet); error = ((*so->so_proto->pr_usrreqs->pru_control) (so, cmd, data, 0, td)); + CURVNET_RESTORE(); + } break; } - CURVNET_RESTORE(); return (error); } Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/kern/uipc_socket.c Wed Feb 16 21:29:13 2011 (r218757) @@ -92,6 +92,12 @@ * from a listen queue to a file descriptor, in order to prevent garbage * collection of the socket at an untimely moment. For a number of reasons, * these interfaces are not preferred, and should be avoided. + * + * NOTE: With regard to VNETs the general rule is that callers do not set + * curvnet. Exceptions to this rule include soabort(), sodisconnect(), + * sofree() (and with that sorele(), sotryfree()), as well as sonewconn() + * and sorflush(), which are usually called from a pre-set VNET context. + * sopoll() currently does not need a VNET context to be set. */ #include @@ -175,6 +181,10 @@ int maxsockets; MALLOC_DEFINE(M_SONAME, "soname", "socket name"); MALLOC_DEFINE(M_PCB, "pcb", "protocol control block"); +#define VNET_SO_ASSERT(so) \ + VNET_ASSERT(curvnet != NULL, \ + ("%s:%d curvnet is NULL, so=%p", __func__, __LINE__, (so))); + static int somaxconn = SOMAXCONN; static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS); /* XXX: we dont have SYSCTL_USHORT */ @@ -295,6 +305,8 @@ soalloc(struct vnet *vnet) so->so_gencnt = ++so_gencnt; ++numopensockets; #ifdef VIMAGE + VNET_ASSERT(vnet != NULL, ("%s:%d vnet is NULL, so=%p", + __func__, __LINE__, so)); vnet->vnet_sockcnt++; so->so_vnet = vnet; #endif @@ -318,6 +330,8 @@ sodealloc(struct socket *so) so->so_gencnt = ++so_gencnt; --numopensockets; /* Could be below, but faster here. */ #ifdef VIMAGE + VNET_ASSERT(so->so_vnet != NULL, ("%s:%d so_vnet is NULL, so=%p", + __func__, __LINE__, so)); so->so_vnet->vnet_sockcnt--; #endif mtx_unlock(&so_global_mtx); @@ -457,6 +471,7 @@ sonewconn(struct socket *head, int conns #endif knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); + VNET_SO_ASSERT(head); if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); @@ -531,8 +546,12 @@ sobind(struct socket *so, struct sockadd int solisten(struct socket *so, int backlog, struct thread *td) { + int error; - return ((*so->so_proto->pr_usrreqs->pru_listen)(so, backlog, td)); + CURVNET_SET(so->so_vnet); + error = (*so->so_proto->pr_usrreqs->pru_listen)(so, backlog, td); + CURVNET_RESTORE(); + return error; } int @@ -620,6 +639,7 @@ sofree(struct socket *so) SOCK_UNLOCK(so); ACCEPT_UNLOCK(); + VNET_SO_ASSERT(so); if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) (*pr->pr_domain->dom_dispose)(so->so_rcv.sb_mb); if (pr->pr_usrreqs->pru_detach != NULL) @@ -749,6 +769,7 @@ soabort(struct socket *so) KASSERT(so->so_state & SS_NOFDREF, ("soabort: !SS_NOFDREF")); KASSERT((so->so_state & SQ_COMP) == 0, ("soabort: SQ_COMP")); KASSERT((so->so_state & SQ_INCOMP) == 0, ("soabort: SQ_INCOMP")); + VNET_SO_ASSERT(so); if (so->so_proto->pr_usrreqs->pru_abort != NULL) (*so->so_proto->pr_usrreqs->pru_abort)(so); @@ -766,7 +787,10 @@ soaccept(struct socket *so, struct socka KASSERT((so->so_state & SS_NOFDREF) != 0, ("soaccept: !NOFDREF")); so->so_state &= ~SS_NOFDREF; SOCK_UNLOCK(so); + + CURVNET_SET(so->so_vnet); error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam); + CURVNET_RESTORE(); return (error); } @@ -804,8 +828,12 @@ soconnect(struct socket *so, struct sock int soconnect2(struct socket *so1, struct socket *so2) { + int error; - return ((*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2)); + CURVNET_SET(so1->so_vnet); + error = (*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2); + CURVNET_RESTORE(); + return (error); } int @@ -817,6 +845,7 @@ sodisconnect(struct socket *so) return (ENOTCONN); if (so->so_state & SS_ISDISCONNECTING) return (EALREADY); + VNET_SO_ASSERT(so); error = (*so->so_proto->pr_usrreqs->pru_disconnect)(so); return (error); } @@ -1080,6 +1109,7 @@ sosend_dgram(struct socket *so, struct s * there are probably other places that this also happens. We must * rethink this. */ + VNET_SO_ASSERT(so); error = (*so->so_proto->pr_usrreqs->pru_send)(so, (flags & MSG_OOB) ? PRUS_OOB : /* @@ -1267,6 +1297,7 @@ restart: * places that this also happens. We must rethink * this. */ + VNET_SO_ASSERT(so); error = (*so->so_proto->pr_usrreqs->pru_send)(so, (flags & MSG_OOB) ? PRUS_OOB : /* @@ -1333,6 +1364,7 @@ soreceive_rcvoob(struct socket *so, stru int error; KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0")); + VNET_SO_ASSERT(so); m = m_get(M_WAIT, MT_DATA); error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK); @@ -1441,8 +1473,10 @@ soreceive_generic(struct socket *so, str if (mp != NULL) *mp = NULL; if ((pr->pr_flags & PR_WANTRCVD) && (so->so_state & SS_ISCONFIRMING) - && uio->uio_resid) + && uio->uio_resid) { + VNET_SO_ASSERT(so); (*pr->pr_usrreqs->pru_rcvd)(so, 0); + } error = sblock(&so->so_rcv, SBLOCKWAIT(flags)); if (error) @@ -1589,6 +1623,7 @@ dontblock: cm->m_next = NULL; if (pr->pr_domain->dom_externalize != NULL) { SOCKBUF_UNLOCK(&so->so_rcv); + VNET_SO_ASSERT(so); error = (*pr->pr_domain->dom_externalize) (cm, controlp); SOCKBUF_LOCK(&so->so_rcv); @@ -1804,6 +1839,7 @@ dontblock: */ if (pr->pr_flags & PR_WANTRCVD) { SOCKBUF_UNLOCK(&so->so_rcv); + VNET_SO_ASSERT(so); (*pr->pr_usrreqs->pru_rcvd)(so, flags); SOCKBUF_LOCK(&so->so_rcv); } @@ -1850,6 +1886,7 @@ dontblock: if (!(flags & MSG_SOCALLBCK) && (pr->pr_flags & PR_WANTRCVD)) { SOCKBUF_UNLOCK(&so->so_rcv); + VNET_SO_ASSERT(so); (*pr->pr_usrreqs->pru_rcvd)(so, flags); SOCKBUF_LOCK(&so->so_rcv); } @@ -2046,6 +2083,7 @@ deliver: (((flags & MSG_WAITALL) && uio->uio_resid > 0) || !(flags & MSG_SOCALLBCK))) { SOCKBUF_UNLOCK(sb); + VNET_SO_ASSERT(so); (*so->so_proto->pr_usrreqs->pru_rcvd)(so, flags); SOCKBUF_LOCK(sb); } @@ -2256,9 +2294,13 @@ int soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { + int error; - return (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, mp0, + CURVNET_SET(so->so_vnet); + error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, mp0, controlp, flagsp)); + CURVNET_RESTORE(); + return (error); } int @@ -2269,17 +2311,19 @@ soshutdown(struct socket *so, int how) if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR)) return (EINVAL); + + CURVNET_SET(so->so_vnet); if (pr->pr_usrreqs->pru_flush != NULL) { (*pr->pr_usrreqs->pru_flush)(so, how); } if (how != SHUT_WR) sorflush(so); if (how != SHUT_RD) { - CURVNET_SET(so->so_vnet); error = (*pr->pr_usrreqs->pru_shutdown)(so); CURVNET_RESTORE(); return (error); } + CURVNET_RESTORE(); return (0); } @@ -2290,6 +2334,8 @@ sorflush(struct socket *so) struct protosw *pr = so->so_proto; struct sockbuf asb; + VNET_SO_ASSERT(so); + /* * In order to avoid calling dom_dispose with the socket buffer mutex * held, and in order to generally avoid holding the lock for a long @@ -2303,7 +2349,6 @@ sorflush(struct socket *so) * socket buffer. Don't let our acquire be interrupted by a signal * despite any existing socket disposition on interruptable waiting. */ - CURVNET_SET(so->so_vnet); socantrcvmore(so); (void) sblock(sb, SBL_WAIT | SBL_NOINTR); @@ -2327,7 +2372,6 @@ sorflush(struct socket *so) if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) (*pr->pr_domain->dom_dispose)(asb.sb_mb); sbrelease_internal(&asb, so); - CURVNET_RESTORE(); } /* @@ -2392,11 +2436,14 @@ sosetopt(struct socket *so, struct socko struct mac extmac; #endif + CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) - return ((*so->so_proto->pr_ctloutput) - (so, sopt)); + if (so->so_proto && so->so_proto->pr_ctloutput) { + error = (*so->so_proto->pr_ctloutput)(so, sopt); + CURVNET_RESTORE(); + return (error); + } error = ENOPROTOOPT; } else { switch (sopt->sopt_name) { @@ -2592,6 +2639,7 @@ sosetopt(struct socket *so, struct socko } } bad: + CURVNET_RESTORE(); return (error); } @@ -2635,13 +2683,15 @@ sogetopt(struct socket *so, struct socko struct mac extmac; #endif + CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) { - return ((*so->so_proto->pr_ctloutput) - (so, sopt)); - } else - return (ENOPROTOOPT); + if (so->so_proto && so->so_proto->pr_ctloutput) + error = (*so->so_proto->pr_ctloutput)(so, sopt); + else + error = ENOPROTOOPT; + CURVNET_RESTORE(); + return (error); } else { switch (sopt->sopt_name) { #ifdef INET @@ -2725,11 +2775,11 @@ integer: error = sooptcopyin(sopt, &extmac, sizeof(extmac), sizeof(extmac)); if (error) - return (error); + goto bad; error = mac_getsockopt_label(sopt->sopt_td->td_ucred, so, &extmac); if (error) - return (error); + goto bad; error = sooptcopyout(sopt, &extmac, sizeof extmac); #else error = EOPNOTSUPP; @@ -2741,11 +2791,11 @@ integer: error = sooptcopyin(sopt, &extmac, sizeof(extmac), sizeof(extmac)); if (error) - return (error); + goto bad; error = mac_getsockopt_peerlabel( sopt->sopt_td->td_ucred, so, &extmac); if (error) - return (error); + goto bad; error = sooptcopyout(sopt, &extmac, sizeof extmac); #else error = EOPNOTSUPP; @@ -2768,8 +2818,12 @@ integer: error = ENOPROTOOPT; break; } - return (error); } +#ifdef MAC +bad: +#endif + CURVNET_RESTORE(); + return (error); } /* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */ @@ -2903,6 +2957,10 @@ sopoll(struct socket *so, int events, st struct thread *td) { + /* + * We do not need to set or assert curvnet as long as everyone uses + * sopoll_generic(). + */ return (so->so_proto->pr_usrreqs->pru_sopoll(so, events, active_cred, td)); } Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/kern/uipc_syscalls.c Wed Feb 16 21:29:13 2011 (r218757) @@ -260,14 +260,9 @@ listen(td, uap) so = fp->f_data; #ifdef MAC error = mac_socket_check_listen(td->td_ucred, so); - if (error == 0) { + if (error == 0) #endif - CURVNET_SET(so->so_vnet); error = solisten(so, uap->backlog, td); - CURVNET_RESTORE(); -#ifdef MAC - } -#endif fdrop(fp, td); } return(error); @@ -428,9 +423,7 @@ kern_accept(struct thread *td, int s, st tmp = fflag & FASYNC; (void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td); sa = 0; - CURVNET_SET(so->so_vnet); error = soaccept(so, &sa); - CURVNET_RESTORE(); if (error) { /* * return a namelen of zero for older code which might @@ -981,11 +974,9 @@ kern_recvit(td, s, mp, fromseg, controlp ktruio = cloneuio(&auio); #endif len = auio.uio_resid; - CURVNET_SET(so->so_vnet); error = soreceive(so, &fromsa, &auio, (struct mbuf **)0, (mp->msg_control || controlp) ? &control : (struct mbuf **)0, &mp->msg_flags); - CURVNET_RESTORE(); if (error) { if (auio.uio_resid != (int)len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -1331,9 +1322,7 @@ kern_setsockopt(td, s, level, name, val, error = getsock(td->td_proc->p_fd, s, &fp, NULL); if (error == 0) { so = fp->f_data; - CURVNET_SET(so->so_vnet); error = sosetopt(so, &sopt); - CURVNET_RESTORE(); fdrop(fp, td); } return(error); @@ -1412,9 +1401,7 @@ kern_getsockopt(td, s, level, name, val, error = getsock(td->td_proc->p_fd, s, &fp, NULL); if (error == 0) { so = fp->f_data; - CURVNET_SET(so->so_vnet); error = sogetopt(so, &sopt); - CURVNET_RESTORE(); *valsize = sopt.sopt_valsize; fdrop(fp, td); } Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/kern/uipc_usrreq.c Wed Feb 16 21:29:13 2011 (r218757) @@ -1311,7 +1311,9 @@ unp_connect(struct socket *so, struct so } if (so->so_proto->pr_flags & PR_CONNREQUIRED) { if (so2->so_options & SO_ACCEPTCONN) { + CURVNET_SET(so2->so_vnet); so3 = sonewconn(so2, 0); + CURVNET_RESTORE(); } else so3 = NULL; if (so3 == NULL) { @@ -2215,8 +2217,14 @@ unp_gc(__unused void *arg, int pending) * struct files associated with these sockets but leave each socket * with one remaining ref. */ - for (i = 0; i < total; i++) - sorflush(unref[i]->f_data); + for (i = 0; i < total; i++) { + struct socket *so; + + so = unref[i]->f_data; + CURVNET_SET(so->so_vnet); + sorflush(so); + CURVNET_RESTORE(); + } /* * And finally release the sockets so they can be reclaimed. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/net/if.c Wed Feb 16 21:29:13 2011 (r218757) @@ -2440,10 +2440,13 @@ ifioctl(struct socket *so, u_long cmd, c int error; int oif_flags; + CURVNET_SET(so->so_vnet); switch (cmd) { case SIOCGIFCONF: case OSIOCGIFCONF: - return (ifconf(cmd, data)); + error = ifconf(cmd, data); + CURVNET_RESTORE(); + return (error); #ifdef COMPAT_FREEBSD32 case SIOCGIFCONF32: @@ -2455,7 +2458,9 @@ ifioctl(struct socket *so, u_long cmd, c ifc.ifc_len = ifc32->ifc_len; ifc.ifc_buf = PTRIN(ifc32->ifc_buf); - return (ifconf(SIOCGIFCONF, (void *)&ifc)); + error = ifconf(SIOCGIFCONF, (void *)&ifc); + CURVNET_RESTORE(); + return (error); } #endif } @@ -2465,42 +2470,55 @@ ifioctl(struct socket *so, u_long cmd, c #ifdef VIMAGE case SIOCSIFRVNET: error = priv_check(td, PRIV_NET_SETIFVNET); - if (error) - return (error); - return (if_vmove_reclaim(td, ifr->ifr_name, ifr->ifr_jid)); + if (error == 0) + error = if_vmove_reclaim(td, ifr->ifr_name, + ifr->ifr_jid); + CURVNET_RESTORE(); + return (error); #endif case SIOCIFCREATE: case SIOCIFCREATE2: error = priv_check(td, PRIV_NET_IFCREATE); - if (error) - return (error); - return (if_clone_create(ifr->ifr_name, sizeof(ifr->ifr_name), - cmd == SIOCIFCREATE2 ? ifr->ifr_data : NULL)); + if (error == 0) + error = if_clone_create(ifr->ifr_name, + sizeof(ifr->ifr_name), + cmd == SIOCIFCREATE2 ? ifr->ifr_data : NULL); + CURVNET_RESTORE(); + return (error); case SIOCIFDESTROY: error = priv_check(td, PRIV_NET_IFDESTROY); - if (error) - return (error); - return if_clone_destroy(ifr->ifr_name); + if (error == 0) + error = if_clone_destroy(ifr->ifr_name); + CURVNET_RESTORE(); + return (error); case SIOCIFGCLONERS: - return (if_clone_list((struct if_clonereq *)data)); + error = if_clone_list((struct if_clonereq *)data); + CURVNET_RESTORE(); + return (error); case SIOCGIFGMEMB: - return (if_getgroupmembers((struct ifgroupreq *)data)); + error = if_getgroupmembers((struct ifgroupreq *)data); + CURVNET_RESTORE(); + return (error); } ifp = ifunit_ref(ifr->ifr_name); - if (ifp == NULL) + if (ifp == NULL) { + CURVNET_RESTORE(); return (ENXIO); + } error = ifhwioctl(cmd, ifp, data, td); if (error != ENOIOCTL) { if_rele(ifp); + CURVNET_RESTORE(); return (error); } oif_flags = ifp->if_flags; if (so->so_proto == NULL) { if_rele(ifp); + CURVNET_RESTORE(); return (EOPNOTSUPP); } #ifndef COMPAT_43 @@ -2575,6 +2593,7 @@ ifioctl(struct socket *so, u_long cmd, c #endif } if_rele(ifp); + CURVNET_RESTORE(); return (error); } Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Feb 16 21:29:13 2011 (r218757) @@ -50,6 +50,9 @@ #include #include #include + +#include + #include #include #include @@ -592,8 +595,11 @@ ng_btsocket_l2cap_process_l2ca_con_ind(s * space then create new socket and set proper source address. */ - if (pcb->so->so_qlen <= pcb->so->so_qlimit) + if (pcb->so->so_qlen <= pcb->so->so_qlimit) { + CURVNET_SET(pcb->so->so_vnet); so1 = sonewconn(pcb->so, 0); + CURVNET_RESTORE(); + } if (so1 == NULL) { result = NG_L2CAP_NO_RESOURCES; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Wed Feb 16 21:29:13 2011 (r218757) @@ -52,6 +52,9 @@ #include #include #include + +#include + #include #include #include @@ -1163,8 +1166,11 @@ ng_btsocket_rfcomm_connect_ind(ng_btsock mtx_lock(&pcb->pcb_mtx); - if (pcb->so->so_qlen <= pcb->so->so_qlimit) + if (pcb->so->so_qlen <= pcb->so->so_qlimit) { + CURVNET_SET(pcb->so->so_vnet); so1 = sonewconn(pcb->so, 0); + CURVNET_RESTORE(); + } mtx_unlock(&pcb->pcb_mtx); Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Wed Feb 16 21:29:13 2011 (r218757) @@ -50,6 +50,9 @@ #include #include #include + +#include + #include #include #include @@ -477,8 +480,11 @@ ng_btsocket_sco_process_lp_con_ind(struc * space then create new socket and set proper source address. */ - if (pcb->so->so_qlen <= pcb->so->so_qlimit) + if (pcb->so->so_qlen <= pcb->so->so_qlimit) { + CURVNET_SET(pcb->so->so_vnet); so1 = sonewconn(pcb->so, 0); + CURVNET_RESTORE(); + } if (so1 == NULL) { status = 0x0d; /* Rejected due to limited resources */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/netinet/sctp_input.c Wed Feb 16 21:29:13 2011 (r218757) @@ -2675,8 +2675,10 @@ sctp_handle_cookie_echo(struct mbuf *m, oso = (*inp_p)->sctp_socket; atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); + CURVNET_SET(oso->so_vnet); so = sonewconn(oso, 0 ); + CURVNET_RESTORE(); SCTP_TCB_LOCK((*stcb)); atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/netinet/sctp_peeloff.c Wed Feb 16 21:29:13 2011 (r218757) @@ -167,8 +167,10 @@ sctp_get_peeloff(struct socket *head, sc } atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); + CURVNET_SET(head->so_vnet); newso = sonewconn(head, SS_ISCONNECTED ); + CURVNET_RESTORE(); if (newso == NULL) { SCTPDBG(SCTP_DEBUG_PEEL1, "sctp_peeloff:sonewconn failed\n"); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOMEM); Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/nfsclient/bootp_subr.c Wed Feb 16 21:29:13 2011 (r218757) @@ -584,8 +584,6 @@ bootpc_call(struct bootpc_globalcontext int retry; const char *s; - CURVNET_SET(TD_TO_VNET(td)); - /* * Create socket and set its recieve timeout. */ @@ -962,7 +960,6 @@ gotreply: out: soclose(so); out0: - CURVNET_RESTORE(); return error; } @@ -977,8 +974,6 @@ bootpc_fakeup_interface(struct bootpc_if struct ifaddr *ifa; struct sockaddr_dl *sdl; - CURVNET_SET(TD_TO_VNET(td)); - error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td->td_ucred, td); if (error != 0) panic("nfs_boot: socreate, error=%d", error); @@ -1053,8 +1048,6 @@ bootpc_fakeup_interface(struct bootpc_if ifctx->ireq.ifr_name); ifctx->sdl = sdl; - CURVNET_RESTORE(); - return error; } @@ -1630,6 +1623,7 @@ bootpc_init(void) /* * Find a network interface. */ + CURVNET_SET(TD_TO_VNET(td)); #ifdef BOOTP_WIRED_TO printf("bootpc_init: wired to interface '%s'\n", __XSTRING(BOOTP_WIRED_TO)); @@ -1676,6 +1670,7 @@ bootpc_init(void) ifctx = ifctx->next; } IFNET_RUNLOCK(); + CURVNET_RESTORE(); if (gctx->interfaces == NULL || gctx->interfaces->ifp == NULL) { #ifdef BOOTP_WIRED_TO Modified: head/sys/nfsclient/krpc_subr.c ============================================================================== --- head/sys/nfsclient/krpc_subr.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/nfsclient/krpc_subr.c Wed Feb 16 21:29:13 2011 (r218757) @@ -216,8 +216,6 @@ krpc_call(struct sockaddr_in *sa, u_int nam = mhead = NULL; from = NULL; - CURVNET_SET(TD_TO_VNET(td)); - /* * Create socket and set its recieve timeout. */ @@ -430,7 +428,6 @@ krpc_call(struct sockaddr_in *sa, u_int if (mhead) m_freem(mhead); if (from) free(from, M_SONAME); soclose(so); - CURVNET_RESTORE(); return error; } Modified: head/sys/nfsclient/nfs_diskless.c ============================================================================== --- head/sys/nfsclient/nfs_diskless.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/nfsclient/nfs_diskless.c Wed Feb 16 21:29:13 2011 (r218757) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -202,6 +203,7 @@ nfs_setup_diskless(void) return; } ifa = NULL; + CURVNET_SET(TD_TO_VNET(curthread)); IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -213,12 +215,14 @@ nfs_setup_diskless(void) LLADDR(&ourdl), sdl->sdl_alen)) { IFNET_RUNLOCK(); + CURVNET_RESTORE(); goto match_done; } } } } IFNET_RUNLOCK(); + CURVNET_RESTORE(); printf("nfs_diskless: no interface\n"); return; /* no matching interface */ match_done: Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/nfsclient/nfs_vfsops.c Wed Feb 16 21:29:13 2011 (r218757) @@ -428,7 +428,6 @@ nfs_mountroot(struct mount *mp) char buf[128]; char *cp; - CURVNET_SET(TD_TO_VNET(td)); #if defined(BOOTP_NFSROOT) && defined(BOOTP) bootpc_init(); /* use bootp to get nfs_diskless filled in */ @@ -437,7 +436,6 @@ nfs_mountroot(struct mount *mp) #endif if (nfs_diskless_valid == 0) { - CURVNET_RESTORE(); return (-1); } if (nfs_diskless_valid == 1) @@ -504,10 +502,12 @@ nfs_mountroot(struct mount *mp) sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ + CURVNET_SET(TD_TO_VNET(td)); error = rtrequest(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, RTF_UP | RTF_GATEWAY, NULL); + CURVNET_RESTORE(); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); } @@ -525,7 +525,6 @@ nfs_mountroot(struct mount *mp) nd->root_args.hostname = buf; if ((error = nfs_mountdiskless(buf, &nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) { - CURVNET_RESTORE(); return (error); } @@ -539,7 +538,6 @@ nfs_mountroot(struct mount *mp) sizeof (prison0.pr_hostname)); mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); - CURVNET_RESTORE(); return (0); } Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/rpc/clnt_dg.c Wed Feb 16 21:29:13 2011 (r218757) @@ -200,14 +200,11 @@ clnt_dg_create( return (NULL); } - CURVNET_SET(so->so_vnet); if (!__rpc_socket2sockinfo(so, &si)) { rpc_createerr.cf_stat = RPC_TLIERROR; rpc_createerr.cf_error.re_errno = 0; - CURVNET_RESTORE(); return (NULL); } - CURVNET_RESTORE(); /* * Find the receive and the send size Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/rpc/clnt_vc.c Wed Feb 16 21:29:13 2011 (r218757) @@ -220,9 +220,7 @@ clnt_vc_create( } } - CURVNET_SET(so->so_vnet); if (!__rpc_socket2sockinfo(so, &si)) { - CURVNET_RESTORE(); goto err; } @@ -245,7 +243,6 @@ clnt_vc_create( sopt.sopt_valsize = sizeof(one); sosetopt(so, &sopt); } - CURVNET_RESTORE(); ct->ct_closeit = FALSE; Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/rpc/rpc_generic.c Wed Feb 16 21:29:13 2011 (r218757) @@ -187,7 +187,9 @@ __rpc_socket2sockinfo(struct socket *so, struct sockopt opt; int error; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return 0; @@ -825,7 +827,6 @@ bindresvport(struct socket *so, struct s sa->sa_len = salen; if (*portp == 0) { - CURVNET_SET(so->so_vnet); bzero(&opt, sizeof(opt)); opt.sopt_dir = SOPT_GET; opt.sopt_level = proto; @@ -834,14 +835,12 @@ bindresvport(struct socket *so, struct s opt.sopt_valsize = sizeof(old); error = sogetopt(so, &opt); if (error) { - CURVNET_RESTORE(); goto out; } opt.sopt_dir = SOPT_SET; opt.sopt_val = &portlow; error = sosetopt(so, &opt); - CURVNET_RESTORE(); if (error) goto out; } @@ -852,9 +851,7 @@ bindresvport(struct socket *so, struct s if (error) { opt.sopt_dir = SOPT_SET; opt.sopt_val = &old; - CURVNET_SET(so->so_vnet); sosetopt(so, &opt); - CURVNET_RESTORE(); } } out: Modified: head/sys/rpc/svc_dg.c ============================================================================== --- head/sys/rpc/svc_dg.c Wed Feb 16 21:29:05 2011 (r218756) +++ head/sys/rpc/svc_dg.c Wed Feb 16 21:29:13 2011 (r218757) @@ -103,10 +103,8 @@ svc_dg_create(SVCPOOL *pool, struct sock struct sockaddr* sa; int error; - CURVNET_SET(so->so_vnet); if (!__rpc_socket2sockinfo(so, &si)) { printf(svc_dg_str, svc_dg_err1); - CURVNET_RESTORE(); return (NULL); } /* @@ -116,7 +114,6 @@ svc_dg_create(SVCPOOL *pool, struct sock recvsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsize); if ((sendsize == 0) || (recvsize == 0)) { printf(svc_dg_str, svc_dg_err2); - CURVNET_RESTORE(); return (NULL); } @@ -128,6 +125,7 @@ svc_dg_create(SVCPOOL *pool, struct sock xprt->xp_p2 = NULL; xprt->xp_ops = &svc_dg_ops; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 21:59: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 0DD93106564A; Wed, 16 Feb 2011 21:59:43 +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 D74C98FC19; Wed, 16 Feb 2011 21:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1GLxgsW085465; Wed, 16 Feb 2011 21:59:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1GLxgwb085462; Wed, 16 Feb 2011 21:59:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102162159.p1GLxgwb085462@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Feb 2011 21:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218760 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 21:59:43 -0000 Author: yongari Date: Wed Feb 16 21:59:42 2011 New Revision: 218760 URL: http://svn.freebsd.org/changeset/base/218760 Log: Add initial support for RTL8401E PCIe Fast Ethernet. PR: 154789 Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Feb 16 21:46:03 2011 (r218759) +++ head/sys/dev/re/if_re.c Wed Feb 16 21:59:42 2011 (r218760) @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1377,6 +1378,7 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8401E: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1502,8 +1504,11 @@ re_attach(device_t dev) } /* Take PHY out of power down mode. */ - if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) { CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); + if (hw_rev->rl_rev == RL_HWREV_8401E) + CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) & ~0x08); + } if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Feb 16 21:46:03 2011 (r218759) +++ head/sys/pci/if_rlreg.h Wed Feb 16 21:59:42 2011 (r218760) @@ -160,6 +160,7 @@ #define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 #define RL_HWREV_8102EL 0x24800000 #define RL_HWREV_8102EL_SPIN1 0x24C00000 #define RL_HWREV_8168D 0x28000000 From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 22:10:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3A8E01065670; Wed, 16 Feb 2011 22:10:14 +0000 (UTC) Date: Wed, 16 Feb 2011 22:10:14 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110216221014.GA43296@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102161805.p1GI5ABX078768@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 22:10:14 -0000 On Wed Feb 16 11, Warner Losh wrote: > Author: imp > Date: Wed Feb 16 18:05:10 2011 > New Revision: 218745 > URL: http://svn.freebsd.org/changeset/base/218745 > > Log: > Remove reading of symbols from a.out loaded files. Since we are tight > on space for clang and a.out support is only needed for /boot/loader, > they are excess bytes that serve no useful purpose other than to > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > support over support for these old kernels and remove this code. We > gain about 100 bytes of space this way. i think without this code uint32_t x serves no purpose any longer: /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: unused variable 'x' [-Wunused-variable] uint32_t addr, x; ^ cheers. alex > > Reviewed by: rdivacky@ > > Modified: > head/sys/boot/i386/boot2/boot2.c > > Modified: head/sys/boot/i386/boot2/boot2.c > ============================================================================== > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > @@ -347,23 +347,6 @@ load(void) > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > if (xfsread(ino, p, hdr.ex.a_data)) > return; > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > - bootinfo.bi_symtab = VTOP(p); > - *(uint32_t*)p = hdr.ex.a_syms; > - p += sizeof(hdr.ex.a_syms); > - if (hdr.ex.a_syms) { > - if (xfsread(ino, p, hdr.ex.a_syms)) > - return; > - p += hdr.ex.a_syms; > - if (xfsread(ino, p, sizeof(int))) > - return; > - x = *(uint32_t *)p; > - p += sizeof(int); > - x -= sizeof(int); > - if (xfsread(ino, p, x)) > - return; > - p += x; > - } > } else { > fs_off = hdr.eh.e_phoff; > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > @@ -395,8 +378,8 @@ load(void) > } > } > addr = hdr.eh.e_entry & 0xffffff; > + bootinfo.bi_esymtab = VTOP(p); > } > - bootinfo.bi_esymtab = VTOP(p); > bootinfo.bi_kernelname = VTOP(kname); > bootinfo.bi_bios_dev = dsk.drive; > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), -- a13x From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 22:11: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 DFA04106564A for ; Wed, 16 Feb 2011 22:11:22 +0000 (UTC) (envelope-from dougb@dougbarton.us) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 34A338FC12 for ; Wed, 16 Feb 2011 22:11:20 +0000 (UTC) Received: (qmail 24130 invoked by uid 399); 16 Feb 2011 21:44:37 -0000 Received: from router.ka9q.net (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@75.60.237.91) by mail2.fluidhosting.com with ESMTPAM; 16 Feb 2011 21:44:37 -0000 X-Originating-IP: 75.60.237.91 X-Sender: dougb@dougbarton.us Message-ID: <4D5C4544.9030803@dougbarton.us> Date: Wed, 16 Feb 2011 13:44:36 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110129 Thunderbird/3.1.7 MIME-Version: 1.0 To: Bruce Cran References: <201102131818.p1DIIuLL046962@svn.freebsd.org> In-Reply-To: <201102131818.p1DIIuLL046962@svn.freebsd.org> 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: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Feb 2011 22:11:23 -0000 On 02/13/2011 10:18, Bruce Cran wrote: > Author: brucec > Date: Sun Feb 13 18:18:56 2011 > New Revision: 218650 > URL: http://svn.freebsd.org/changeset/base/218650 > > Log: > Move potentially offensive fortune to fortunes-o. FYI, we never ever do this unless there is a really good reason. The problem is that what is offensive in one person's eyes is not in another's, and this is an area that can (speaking from experience) become a huge bikeshed. To be clear, I don't specifically object to this change, nor the MFC, I'm not asking for you to revert it, etc. etc. I am merely stating a rather strong preference that before another change of this nature is considered that very careful thought is given to whether it's worth it. 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 Wed Feb 16 22:17:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id B68061065673; Wed, 16 Feb 2011 22:17:12 +0000 (UTC) Date: Wed, 16 Feb 2011 22:17:12 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110216221712.GA44796@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110216221014.GA43296@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 22:17:12 -0000 On Wed Feb 16 11, Alexander Best wrote: > On Wed Feb 16 11, Warner Losh wrote: > > Author: imp > > Date: Wed Feb 16 18:05:10 2011 > > New Revision: 218745 > > URL: http://svn.freebsd.org/changeset/base/218745 > > > > Log: > > Remove reading of symbols from a.out loaded files. Since we are tight > > on space for clang and a.out support is only needed for /boot/loader, > > they are excess bytes that serve no useful purpose other than to > > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > > support over support for these old kernels and remove this code. We > > gain about 100 bytes of space this way. > > i think without this code uint32_t x serves no purpose any longer: > > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: unused variable 'x' [-Wunused-variable] > uint32_t addr, x; > ^ also due to /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align] t1 = *(uint32_t *)PTOV(0x46c); ^~~~~~~~~~~~~~~~~~~~~~~ i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be casted to (uint8_t *), instead of (uint32_t *). cheers. alex > > cheers. > alex > > > > > Reviewed by: rdivacky@ > > > > Modified: > > head/sys/boot/i386/boot2/boot2.c > > > > Modified: head/sys/boot/i386/boot2/boot2.c > > ============================================================================== > > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > > @@ -347,23 +347,6 @@ load(void) > > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > > if (xfsread(ino, p, hdr.ex.a_data)) > > return; > > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > > - bootinfo.bi_symtab = VTOP(p); > > - *(uint32_t*)p = hdr.ex.a_syms; > > - p += sizeof(hdr.ex.a_syms); > > - if (hdr.ex.a_syms) { > > - if (xfsread(ino, p, hdr.ex.a_syms)) > > - return; > > - p += hdr.ex.a_syms; > > - if (xfsread(ino, p, sizeof(int))) > > - return; > > - x = *(uint32_t *)p; > > - p += sizeof(int); > > - x -= sizeof(int); > > - if (xfsread(ino, p, x)) > > - return; > > - p += x; > > - } > > } else { > > fs_off = hdr.eh.e_phoff; > > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > > @@ -395,8 +378,8 @@ load(void) > > } > > } > > addr = hdr.eh.e_entry & 0xffffff; > > + bootinfo.bi_esymtab = VTOP(p); > > } > > - bootinfo.bi_esymtab = VTOP(p); > > bootinfo.bi_kernelname = VTOP(kname); > > bootinfo.bi_bios_dev = dsk.drive; > > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > > -- > a13x -- a13x From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 22:41:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 69CB91065673; Wed, 16 Feb 2011 22:41:26 +0000 (UTC) Date: Wed, 16 Feb 2011 22:41:26 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110216224126.GA47777@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> <20110216221712.GA44796@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110216221712.GA44796@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 22:41:26 -0000 On Wed Feb 16 11, Alexander Best wrote: > On Wed Feb 16 11, Alexander Best wrote: > > On Wed Feb 16 11, Warner Losh wrote: > > > Author: imp > > > Date: Wed Feb 16 18:05:10 2011 > > > New Revision: 218745 > > > URL: http://svn.freebsd.org/changeset/base/218745 > > > > > > Log: > > > Remove reading of symbols from a.out loaded files. Since we are tight > > > on space for clang and a.out support is only needed for /boot/loader, > > > they are excess bytes that serve no useful purpose other than to > > > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > > > support over support for these old kernels and remove this code. We > > > gain about 100 bytes of space this way. > > > > i think without this code uint32_t x serves no purpose any longer: > > > > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: unused variable 'x' [-Wunused-variable] > > uint32_t addr, x; > > ^ > > also due to > > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align] > t1 = *(uint32_t *)PTOV(0x46c); > ^~~~~~~~~~~~~~~~~~~~~~~ > > i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be casted > to (uint8_t *), instead of (uint32_t *). with this additional change the code fits when compiled with clang: diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S index 7b8e9eb..d745129 100644 --- a/sys/boot/i386/boot2/sio.S +++ b/sys/boot/i386/boot2/sio.S @@ -29,11 +29,11 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format outb %al,(%dx) # and DLAB - pushl %edx # Save + pushb %dl # Save subb $0x3,%dl # Divisor latch reg movl 0x8(%esp),%eax # Set outw %ax,(%dx) # BPS - popl %edx # Restore + popb %dl # Restore movb $SIO_FMT,%al # Clear outb %al,(%dx) # DLAB incl %edx # Modem control reg ...since we're only modifying %dl in subb $0x3,%dl, we don't need to push/pop a 32 bit value, but only 8 bits. cheers. alex > > cheers. > alex > > > > > cheers. > > alex > > > > > > > > Reviewed by: rdivacky@ > > > > > > Modified: > > > head/sys/boot/i386/boot2/boot2.c > > > > > > Modified: head/sys/boot/i386/boot2/boot2.c > > > ============================================================================== > > > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > > > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > > > @@ -347,23 +347,6 @@ load(void) > > > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > > > if (xfsread(ino, p, hdr.ex.a_data)) > > > return; > > > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > > > - bootinfo.bi_symtab = VTOP(p); > > > - *(uint32_t*)p = hdr.ex.a_syms; > > > - p += sizeof(hdr.ex.a_syms); > > > - if (hdr.ex.a_syms) { > > > - if (xfsread(ino, p, hdr.ex.a_syms)) > > > - return; > > > - p += hdr.ex.a_syms; > > > - if (xfsread(ino, p, sizeof(int))) > > > - return; > > > - x = *(uint32_t *)p; > > > - p += sizeof(int); > > > - x -= sizeof(int); > > > - if (xfsread(ino, p, x)) > > > - return; > > > - p += x; > > > - } > > > } else { > > > fs_off = hdr.eh.e_phoff; > > > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > > > @@ -395,8 +378,8 @@ load(void) > > > } > > > } > > > addr = hdr.eh.e_entry & 0xffffff; > > > + bootinfo.bi_esymtab = VTOP(p); > > > } > > > - bootinfo.bi_esymtab = VTOP(p); > > > bootinfo.bi_kernelname = VTOP(kname); > > > bootinfo.bi_bios_dev = dsk.drive; > > > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > > > > -- > > a13x > > -- > a13x -- a13x From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 23:04: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 9B907106564A; Wed, 16 Feb 2011 23:04:31 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out0.tiscali.nl (smtp-out0.tiscali.nl [195.241.79.175]) by mx1.freebsd.org (Postfix) with ESMTP id 2B59F8FC0C; Wed, 16 Feb 2011 23:04:30 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out0.tiscali.nl with esmtp (Exim) (envelope-from ) id 1PpqCF-0004Sz-JT; Wed, 16 Feb 2011 23:50:07 +0100 Received: from 212-123-145-58.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id 9002FF0B3; Wed, 16 Feb 2011 23:50:00 +0100 (CET) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Warner Losh" , "Alexander Best" References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> <20110216221712.GA44796@freebsd.org> <20110216224126.GA47777@freebsd.org> Date: Wed, 16 Feb 2011 23:50:00 +0100 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: <20110216224126.GA47777@freebsd.org> User-Agent: Opera Mail/11.01 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 23:04:31 -0000 On Wed, 16 Feb 2011 23:41:26 +0100, Alexander Best = =20 wrote: > On Wed Feb 16 11, Alexander Best wrote: >> On Wed Feb 16 11, Alexander Best wrote: >> > On Wed Feb 16 11, Warner Losh wrote: >> > > Author: imp >> > > Date: Wed Feb 16 18:05:10 2011 >> > > New Revision: 218745 >> > > URL: http://svn.freebsd.org/changeset/base/218745 >> > > >> > > Log: >> > > Remove reading of symbols from a.out loaded files. Since we are= =20 >> tight >> > > on space for clang and a.out support is only needed for =20 >> /boot/loader, >> > > they are excess bytes that serve no useful purpose other than to >> > > support really old kernels (FreeBSD < 3.2 or so). Prefer clang >> > > support over support for these old kernels and remove this code.= =20 >> We >> > > gain about 100 bytes of space this way. >> > >> > i think without this code uint32_t x serves no purpose any longer: >> > >> > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: =20 >> unused variable 'x' [-Wunused-variable] >> > uint32_t addr, x; >> > ^ >> >> also due to >> >> /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast= =20 >> from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') =20 >> increases required alignment from 1 to 4 [-Wcast-align] >> t1 =3D *(uint32_t *)PTOV(0x46c); >> ^~~~~~~~~~~~~~~~~~~~~~~ >> >> i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be= =20 >> casted >> to (uint8_t *), instead of (uint32_t *). > > with this additional change the code fits when compiled with clang: > > diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S > index 7b8e9eb..d745129 100644 > --- a/sys/boot/i386/boot2/sio.S > +++ b/sys/boot/i386/boot2/sio.S > @@ -29,11 +29,11 @@ > sio_init: movw $SIO_PRT+0x3,%dx # Data format reg > movb $SIO_FMT|0x80,%al # Set format > outb %al,(%dx) # and DLAB > - pushl %edx # Save > + pushb %dl # Save > subb $0x3,%dl # Divisor latch reg > movl 0x8(%esp),%eax # Set > outw %ax,(%dx) # BPS > - popl %edx # Restore > + popb %dl # Restore > movb $SIO_FMT,%al # Clear > outb %al,(%dx) # DLAB > incl %edx # Modem control reg > > ...since we're only modifying %dl in subb $0x3,%dl, we don't need to =20 > push/pop > a 32 bit value, but only 8 bits. You guys are kings. :-) I heard they don't even teach assembly anymore at= =20 a lot of universities. > > cheers. > alex > >> >> cheers. >> alex >> >> > >> > cheers. >> > alex >> > >> > > >> > > Reviewed by: rdivacky@ >> > > >> > > Modified: >> > > head/sys/boot/i386/boot2/boot2.c >> > > >> > > Modified: head/sys/boot/i386/boot2/boot2.c >> > > =20 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 =20 >> 2011 (r218744) >> > > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 =20 >> 2011 (r218745) >> > > @@ -347,23 +347,6 @@ load(void) >> > > p +=3D roundup2(hdr.ex.a_text, PAGE_SIZE); >> > > if (xfsread(ino, p, hdr.ex.a_data)) >> > > return; >> > > - p +=3D hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); >> > > - bootinfo.bi_symtab =3D VTOP(p); >> > > - *(uint32_t*)p =3D hdr.ex.a_syms; >> > > - p +=3D sizeof(hdr.ex.a_syms); >> > > - if (hdr.ex.a_syms) { >> > > - if (xfsread(ino, p, hdr.ex.a_syms)) >> > > - return; >> > > - p +=3D hdr.ex.a_syms; >> > > - if (xfsread(ino, p, sizeof(int))) >> > > - return; >> > > - x =3D *(uint32_t *)p; >> > > - p +=3D sizeof(int); >> > > - x -=3D sizeof(int); >> > > - if (xfsread(ino, p, x)) >> > > - return; >> > > - p +=3D x; >> > > - } >> > > } else { >> > > fs_off =3D hdr.eh.e_phoff; >> > > for (j =3D i =3D 0; i < hdr.eh.e_phnum && j < 2; i++) { >> > > @@ -395,8 +378,8 @@ load(void) >> > > } >> > > } >> > > addr =3D hdr.eh.e_entry & 0xffffff; >> > > + bootinfo.bi_esymtab =3D VTOP(p); >> > > } >> > > - bootinfo.bi_esymtab =3D VTOP(p); >> > > bootinfo.bi_kernelname =3D VTOP(kname); >> > > bootinfo.bi_bios_dev =3D dsk.drive; >> > > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), >> > >> > -- >> > a13x >> >> -- >> a13x From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 23:30:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 7697E1065675; Wed, 16 Feb 2011 23:30:21 +0000 (UTC) Date: Wed, 16 Feb 2011 23:30:21 +0000 From: Alexander Best To: Ronald Klop Message-ID: <20110216233021.GA50813@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> <20110216221712.GA44796@freebsd.org> <20110216224126.GA47777@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 23:30:21 -0000 On Wed Feb 16 11, Ronald Klop wrote: > On Wed, 16 Feb 2011 23:41:26 +0100, Alexander Best > wrote: > > >On Wed Feb 16 11, Alexander Best wrote: > >>On Wed Feb 16 11, Alexander Best wrote: > >>> On Wed Feb 16 11, Warner Losh wrote: > >>> > Author: imp > >>> > Date: Wed Feb 16 18:05:10 2011 > >>> > New Revision: 218745 > >>> > URL: http://svn.freebsd.org/changeset/base/218745 > >>> > > >>> > Log: > >>> > Remove reading of symbols from a.out loaded files. Since we are > >>tight > >>> > on space for clang and a.out support is only needed for > >>/boot/loader, > >>> > they are excess bytes that serve no useful purpose other than to > >>> > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > >>> > support over support for these old kernels and remove this code. > >>We > >>> > gain about 100 bytes of space this way. > >>> > >>> i think without this code uint32_t x serves no purpose any longer: > >>> > >>> /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: > >>unused variable 'x' [-Wunused-variable] > >>> uint32_t addr, x; > >>> ^ > >> > >>also due to > >> > >>/usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast > >>from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') > >>increases required alignment from 1 to 4 [-Wcast-align] > >> t1 = *(uint32_t *)PTOV(0x46c); > >> ^~~~~~~~~~~~~~~~~~~~~~~ > >> > >>i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be > >>casted > >>to (uint8_t *), instead of (uint32_t *). > > > >with this additional change the code fits when compiled with clang: > > > >diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S > >index 7b8e9eb..d745129 100644 > >--- a/sys/boot/i386/boot2/sio.S > >+++ b/sys/boot/i386/boot2/sio.S > >@@ -29,11 +29,11 @@ > > sio_init: movw $SIO_PRT+0x3,%dx # Data format reg > > movb $SIO_FMT|0x80,%al # Set format > > outb %al,(%dx) # and DLAB > >- pushl %edx # Save > >+ pushb %dl # Save > > subb $0x3,%dl # Divisor latch reg > > movl 0x8(%esp),%eax # Set > > outw %ax,(%dx) # BPS > >- popl %edx # Restore > >+ popb %dl # Restore > > movb $SIO_FMT,%al # Clear > > outb %al,(%dx) # DLAB > > incl %edx # Modem control reg > > > >...since we're only modifying %dl in subb $0x3,%dl, we don't need to > >push/pop > >a 32 bit value, but only 8 bits. > > > You guys are kings. :-) I heard they don't even teach assembly anymore at > a lot of universities. *lol* assembly (especially i386) isn't that complicated. but you're right: they don't teach it at university that much. usually you only get to hear about it in classes which focus on the principals of the CPU, RAM, cache, etc. the reason for that is quite simple: assembly languages don't get used that much anymore. in the past they were used a lot to optimise speed, but since computers have gotten so fast that's not needed anymore. even for embedded platforms assembly isn't used very often. one of the reason is also that it's incredibly hard to maintain. comprehending foreign code (written by another programmer) is really really hard work. so +1 for having fewer assembly code nowadays. we now have enough cpu power and hardware ressources in general to having the luxury of letting the computer do all the abstractions from human thinking to how computers work. cheers. alex > > > > > > > > > > > > > >cheers. > >alex > > > >> > >>cheers. > >>alex > >> > >>> > >>> cheers. > >>> alex > >>> > >>> > > >>> > Reviewed by: rdivacky@ > >>> > > >>> > Modified: > >>> > head/sys/boot/i386/boot2/boot2.c > >>> > > >>> > Modified: head/sys/boot/i386/boot2/boot2.c > >>> > > >>============================================================================== > >>> > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 > >>2011 (r218744) > >>> > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 > >>2011 (r218745) > >>> > @@ -347,23 +347,6 @@ load(void) > >>> > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > >>> > if (xfsread(ino, p, hdr.ex.a_data)) > >>> > return; > >>> > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > >>> > - bootinfo.bi_symtab = VTOP(p); > >>> > - *(uint32_t*)p = hdr.ex.a_syms; > >>> > - p += sizeof(hdr.ex.a_syms); > >>> > - if (hdr.ex.a_syms) { > >>> > - if (xfsread(ino, p, hdr.ex.a_syms)) > >>> > - return; > >>> > - p += hdr.ex.a_syms; > >>> > - if (xfsread(ino, p, sizeof(int))) > >>> > - return; > >>> > - x = *(uint32_t *)p; > >>> > - p += sizeof(int); > >>> > - x -= sizeof(int); > >>> > - if (xfsread(ino, p, x)) > >>> > - return; > >>> > - p += x; > >>> > - } > >>> > } else { > >>> > fs_off = hdr.eh.e_phoff; > >>> > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > >>> > @@ -395,8 +378,8 @@ load(void) > >>> > } > >>> > } > >>> > addr = hdr.eh.e_entry & 0xffffff; > >>> > + bootinfo.bi_esymtab = VTOP(p); > >>> > } > >>> > - bootinfo.bi_esymtab = VTOP(p); > >>> > bootinfo.bi_kernelname = VTOP(kname); > >>> > bootinfo.bi_bios_dev = dsk.drive; > >>> > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > >>> > >>> -- > >>> a13x > >> > >>-- > >>a13x -- a13x From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 01:09:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 04DDC1065679; Thu, 17 Feb 2011 01:09:54 +0000 (UTC) Date: Thu, 17 Feb 2011 01:09:54 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110217010953.GA65017@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> <20110216221712.GA44796@freebsd.org> <20110216224126.GA47777@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110216224126.GA47777@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 01:09:54 -0000 On Wed Feb 16 11, Alexander Best wrote: > On Wed Feb 16 11, Alexander Best wrote: > > On Wed Feb 16 11, Alexander Best wrote: > > > On Wed Feb 16 11, Warner Losh wrote: > > > > Author: imp > > > > Date: Wed Feb 16 18:05:10 2011 > > > > New Revision: 218745 > > > > URL: http://svn.freebsd.org/changeset/base/218745 > > > > > > > > Log: > > > > Remove reading of symbols from a.out loaded files. Since we are tight > > > > on space for clang and a.out support is only needed for /boot/loader, > > > > they are excess bytes that serve no useful purpose other than to > > > > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > > > > support over support for these old kernels and remove this code. We > > > > gain about 100 bytes of space this way. sorry false alarm. :( > > > > > > i think without this code uint32_t x serves no purpose any longer: > > > > > > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: unused variable 'x' [-Wunused-variable] > > > uint32_t addr, x; > > > ^ > > > > also due to > > > > /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align] > > t1 = *(uint32_t *)PTOV(0x46c); > > ^~~~~~~~~~~~~~~~~~~~~~~ > > > > i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be casted > > to (uint8_t *), instead of (uint32_t *). this will actually increase the size. > > with this additional change the code fits when compiled with clang: > > diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S > index 7b8e9eb..d745129 100644 > --- a/sys/boot/i386/boot2/sio.S > +++ b/sys/boot/i386/boot2/sio.S > @@ -29,11 +29,11 @@ > sio_init: movw $SIO_PRT+0x3,%dx # Data format reg > movb $SIO_FMT|0x80,%al # Set format > outb %al,(%dx) # and DLAB > - pushl %edx # Save > + pushb %dl # Save > subb $0x3,%dl # Divisor latch reg > movl 0x8(%esp),%eax # Set > outw %ax,(%dx) # BPS > - popl %edx # Restore > + popb %dl # Restore > movb $SIO_FMT,%al # Clear > outb %al,(%dx) # DLAB > incl %edx # Modem control reg cannot push a single byte onto the stack on i386 32 bit. ...back to the drawing board. > > ...since we're only modifying %dl in subb $0x3,%dl, we don't need to push/pop > a 32 bit value, but only 8 bits. > > cheers. > alex > > > > > cheers. > > alex > > > > > > > > cheers. > > > alex > > > > > > > > > > > Reviewed by: rdivacky@ > > > > > > > > Modified: > > > > head/sys/boot/i386/boot2/boot2.c > > > > > > > > Modified: head/sys/boot/i386/boot2/boot2.c > > > > ============================================================================== > > > > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > > > > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > > > > @@ -347,23 +347,6 @@ load(void) > > > > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > > > > if (xfsread(ino, p, hdr.ex.a_data)) > > > > return; > > > > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > > > > - bootinfo.bi_symtab = VTOP(p); > > > > - *(uint32_t*)p = hdr.ex.a_syms; > > > > - p += sizeof(hdr.ex.a_syms); > > > > - if (hdr.ex.a_syms) { > > > > - if (xfsread(ino, p, hdr.ex.a_syms)) > > > > - return; > > > > - p += hdr.ex.a_syms; > > > > - if (xfsread(ino, p, sizeof(int))) > > > > - return; > > > > - x = *(uint32_t *)p; > > > > - p += sizeof(int); > > > > - x -= sizeof(int); > > > > - if (xfsread(ino, p, x)) > > > > - return; > > > > - p += x; > > > > - } > > > > } else { > > > > fs_off = hdr.eh.e_phoff; > > > > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > > > > @@ -395,8 +378,8 @@ load(void) > > > > } > > > > } > > > > addr = hdr.eh.e_entry & 0xffffff; > > > > + bootinfo.bi_esymtab = VTOP(p); > > > > } > > > > - bootinfo.bi_esymtab = VTOP(p); > > > > bootinfo.bi_kernelname = VTOP(kname); > > > > bootinfo.bi_bios_dev = dsk.drive; > > > > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > > > > > > -- > > > a13x > > > > -- > > a13x > > -- > a13x -- a13x From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 01:52:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3D67A1065672; Thu, 17 Feb 2011 01:52:11 +0000 (UTC) Date: Thu, 17 Feb 2011 01:52:11 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110217015211.GA67933@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <201102161805.p1GI5ABX078768@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 01:52:11 -0000 --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed Feb 16 11, Warner Losh wrote: > Author: imp > Date: Wed Feb 16 18:05:10 2011 > New Revision: 218745 > URL: http://svn.freebsd.org/changeset/base/218745 > > Log: > Remove reading of symbols from a.out loaded files. Since we are tight > on space for clang and a.out support is only needed for /boot/loader, > they are excess bytes that serve no useful purpose other than to > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > support over support for these old kernels and remove this code. We > gain about 100 bytes of space this way. sorry for my crappy previous attempt to reduce boot2's size. obviously the *.S files aren't the problem, because even with clang we're using GAS. so working on boot2.c is the only way of reducing the size. i've managed to do so (even with another 4 bytes to spare) with the attached patch. i did otaku% grep -r bi_basemem * sys/boot/i386/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ sys/boot/i386/boot2/machine/bootinfo.h: u_int32_t bi_basemem; sys/boot/i386/gptboot/gptboot.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ sys/boot/i386/libi386/bootinfo32.c: bi.bi_basemem = bios_basemem / 1024; sys/boot/i386/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; sys/boot/i386/zfsboot/zfsboot.c: bootinfo.bi_basemem = bios_basemem / 1024; sys/boot/pc98/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ sys/boot/pc98/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; sys/i386/include/bootinfo.h: u_int32_t bi_basemem; sys/mips/include/bootinfo.h: u_int32_t bi_basemem; which led me to the conclusion that bootinfo.bi_basemem doesn't need to initialised, because it will always be set by the loader (as the XXX comment says). turning ioctrl from uint8_t to int also saves a few bytes for whatever reason). removing x doesn't save any bytes, but gets rid of a warning (as noted in one of my messages). cheers. alex ...and sorry for the previous noise. :( > > Reviewed by: rdivacky@ > > Modified: > head/sys/boot/i386/boot2/boot2.c > > Modified: head/sys/boot/i386/boot2/boot2.c > ============================================================================== > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > @@ -347,23 +347,6 @@ load(void) > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > if (xfsread(ino, p, hdr.ex.a_data)) > return; > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > - bootinfo.bi_symtab = VTOP(p); > - *(uint32_t*)p = hdr.ex.a_syms; > - p += sizeof(hdr.ex.a_syms); > - if (hdr.ex.a_syms) { > - if (xfsread(ino, p, hdr.ex.a_syms)) > - return; > - p += hdr.ex.a_syms; > - if (xfsread(ino, p, sizeof(int))) > - return; > - x = *(uint32_t *)p; > - p += sizeof(int); > - x -= sizeof(int); > - if (xfsread(ino, p, x)) > - return; > - p += x; > - } > } else { > fs_off = hdr.eh.e_phoff; > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > @@ -395,8 +378,8 @@ load(void) > } > } > addr = hdr.eh.e_entry & 0xffffff; > + bootinfo.bi_esymtab = VTOP(p); > } > - bootinfo.bi_esymtab = VTOP(p); > bootinfo.bi_kernelname = VTOP(kname); > bootinfo.bi_bios_dev = dsk.drive; > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), -- a13x --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="boot2.c.diff" diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 3849725..d572700 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -135,7 +135,7 @@ static char kname[1024]; static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static int ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -245,7 +245,7 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ + /* bootinfo.bi_basemem = 0; XXX will be filled by loader or kernel */ bootinfo.bi_extmem = memsize(); bootinfo.bi_memsizes_valid++; @@ -319,7 +319,7 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; uint8_t fmt; --SUOF0GtieIMvvwua-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 05:16: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 BB8C5106564A; Thu, 17 Feb 2011 05:16:59 +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 A951A8FC0A; Thu, 17 Feb 2011 05:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H5GxwL096017; Thu, 17 Feb 2011 05:16:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H5GxNv096014; Thu, 17 Feb 2011 05:16:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102170516.p1H5GxNv096014@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 05:16: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: r218761 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 05:16:59 -0000 Author: adrian Date: Thu Feb 17 05:16:59 2011 New Revision: 218761 URL: http://svn.freebsd.org/changeset/base/218761 Log: Properly propagate whether the channel is HT40 or not when calculating packet duration for the ath_rate_sample module. This doesn't affect the packet TX at all; only how much time the sample rate module attributes to a completed TX. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed Feb 16 21:59:42 2011 (r218760) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu Feb 17 05:16:59 2011 (r218761) @@ -426,18 +426,19 @@ update_stats(struct ath_softc *sc, struc const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); int tt, tries_so_far; + int is_ht40 = (an->an_node.ni_htcap & IEEE80211_HTCAP_CHWIDTH40); if (!IS_RATE_DEFINED(sn, rix0)) return; tt = calc_usecs_unicast_packet(sc, size, rix0, short_tries, - MIN(tries0, tries) - 1); + MIN(tries0, tries) - 1, is_ht40); tries_so_far = tries0; if (tries1 && tries_so_far < tries) { if (!IS_RATE_DEFINED(sn, rix1)) return; tt += calc_usecs_unicast_packet(sc, size, rix1, short_tries, - MIN(tries1 + tries_so_far, tries) - tries_so_far - 1); + MIN(tries1 + tries_so_far, tries) - tries_so_far - 1, is_ht40); tries_so_far += tries1; } @@ -445,7 +446,7 @@ update_stats(struct ath_softc *sc, struc if (!IS_RATE_DEFINED(sn, rix2)) return; tt += calc_usecs_unicast_packet(sc, size, rix2, short_tries, - MIN(tries2 + tries_so_far, tries) - tries_so_far - 1); + MIN(tries2 + tries_so_far, tries) - tries_so_far - 1, is_ht40); tries_so_far += tries2; } @@ -453,7 +454,7 @@ update_stats(struct ath_softc *sc, struc if (!IS_RATE_DEFINED(sn, rix3)) return; tt += calc_usecs_unicast_packet(sc, size, rix3, short_tries, - MIN(tries3 + tries_so_far, tries) - tries_so_far - 1); + MIN(tries3 + tries_so_far, tries) - tries_so_far - 1, is_ht40); } if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { @@ -765,7 +766,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, if ((mask & 1) == 0) continue; printf(" %d/%d", dot11rate(rt, rix), - calc_usecs_unicast_packet(sc, 1600, rix, 0,0)); + calc_usecs_unicast_packet(sc, 1600, rix, 0,0, + (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40))); } printf("\n"); } @@ -794,7 +796,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, sn->stats[y][rix].last_tx = 0; sn->stats[y][rix].perfect_tx_time = - calc_usecs_unicast_packet(sc, size, rix, 0, 0); + calc_usecs_unicast_packet(sc, size, rix, 0, 0, + (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)); sn->stats[y][rix].average_tx_time = sn->stats[y][rix].perfect_tx_time; } Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Wed Feb 16 21:59:42 2011 (r218760) +++ head/sys/dev/ath/ath_rate/sample/sample.h Thu Feb 17 05:16:59 2011 (r218761) @@ -115,7 +115,9 @@ struct sample_node { */ static unsigned calc_usecs_unicast_packet(struct ath_softc *sc, int length, - int rix, int short_retries, int long_retries) { + int rix, int short_retries, + int long_retries, int is_ht40) +{ const HAL_RATE_TABLE *rt = sc->sc_currates; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -198,7 +200,7 @@ static unsigned calc_usecs_unicast_packe /* XXX assumes short preamble */ /* XXX assumes HT/20; the node info isn't yet available here */ - ctsduration += ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, AH_TRUE); + ctsduration += ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, is_ht40); if (cts) /* SIFS + ACK */ ctsduration += rt->info[cix].spAckDuration; @@ -209,7 +211,7 @@ static unsigned calc_usecs_unicast_packe /* XXX assumes short preamble */ /* XXX assumes HT/20; the node info isn't yet available here */ - tt += (long_retries+1)*ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, AH_TRUE); + tt += (long_retries+1)*ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, is_ht40); tt += (long_retries+1)*(t_sifs + rt->info[rix].spAckDuration); for (x = 0; x <= short_retries + long_retries; x++) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 05:30: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 5B7F1106566B; Thu, 17 Feb 2011 05:30:38 +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 4A0C88FC13; Thu, 17 Feb 2011 05:30:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H5Uc1T096346; Thu, 17 Feb 2011 05:30:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H5Uc0W096344; Thu, 17 Feb 2011 05:30:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102170530.p1H5Uc0W096344@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 05:30: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: r218762 - head/sys/dev/ath/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, 17 Feb 2011 05:30:38 -0000 Author: adrian Date: Thu Feb 17 05:30:38 2011 New Revision: 218762 URL: http://svn.freebsd.org/changeset/base/218762 Log: Call the right function. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 17 05:16:59 2011 (r218761) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 17 05:30:38 2011 (r218762) @@ -58,7 +58,7 @@ ar5416AniSetup(struct ath_hal *ah) .period = 100, }; /* NB: ANI is not enabled yet */ - ar5212AniAttach(ah, &aniparams, &aniparams, AH_FALSE); + ar5416AniAttach(ah, &aniparams, &aniparams, AH_FALSE); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 05:52: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 02D00106564A; Thu, 17 Feb 2011 05:52:54 +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 E50B28FC0C; Thu, 17 Feb 2011 05:52:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H5qrlS096827; Thu, 17 Feb 2011 05:52:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H5qrXd096822; Thu, 17 Feb 2011 05:52:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102170552.p1H5qrXd096822@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 05:52: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: r218763 - in head/sys/dev/ath/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, 17 Feb 2011 05:52:54 -0000 Author: adrian Date: Thu Feb 17 05:52:53 2011 New Revision: 218763 URL: http://svn.freebsd.org/changeset/base/218763 Log: Add a new parameter to selectively enable/disable the ANI operations. This was inspired by ath9k, which disables ANI anti-noise immunity parameter tweaking (but leaves the rest of the ANI operations alone.) Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 17 05:30:38 2011 (r218762) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 17 05:52:53 2011 (r218763) @@ -408,14 +408,15 @@ extern HAL_BOOL ath_hal_getTxQProps(stru HAL_TXQ_INFO *qInfo, const HAL_TX_QUEUE_INFO *qi); typedef enum { - HAL_ANI_PRESENT, /* is ANI support present */ - HAL_ANI_NOISE_IMMUNITY_LEVEL, /* set level */ - HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, /* enable/disable */ - HAL_ANI_CCK_WEAK_SIGNAL_THR, /* enable/disable */ - HAL_ANI_FIRSTEP_LEVEL, /* set level */ - HAL_ANI_SPUR_IMMUNITY_LEVEL, /* set level */ - HAL_ANI_MODE = 6, /* 0 => manual, 1 => auto (XXX do not change) */ - HAL_ANI_PHYERR_RESET, /* reset phy error stats */ + HAL_ANI_PRESENT = 0x1, /* is ANI support present */ + HAL_ANI_NOISE_IMMUNITY_LEVEL = 0x2, /* set level */ + HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4, /* enable/disable */ + HAL_ANI_CCK_WEAK_SIGNAL_THR = 0x8, /* enable/disable */ + HAL_ANI_FIRSTEP_LEVEL = 0x10, /* set level */ + HAL_ANI_SPUR_IMMUNITY_LEVEL = 0x20, /* set level */ + HAL_ANI_MODE = 0x40, /* 0 => manual, 1 => auto (XXX do not change) */ + HAL_ANI_PHYERR_RESET =0x80, /* reset phy error stats */ + HAL_ANI_ALL = 0xff } HAL_ANI_CMD; #define HAL_SPUR_VAL_MASK 0x3FFF Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Thu Feb 17 05:30:38 2011 (r218762) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Thu Feb 17 05:52:53 2011 (r218763) @@ -87,6 +87,8 @@ struct ath_hal_5416 { uint32_t ah_rx_chainmask; uint32_t ah_tx_chainmask; + HAL_ANI_CMD ah_ani_function; + struct ar5416PerCal ah_cal; /* periodic calibration state */ struct ar5416NfLimits nf_2g; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Feb 17 05:30:38 2011 (r218762) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Feb 17 05:52:53 2011 (r218763) @@ -177,7 +177,7 @@ ar5416AniControl(struct ath_hal *ah, HAL OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd); - switch (cmd) { + switch (cmd & AH5416(ah)->ah_ani_function) { case HAL_ANI_NOISE_IMMUNITY_LEVEL: { u_int level = param; @@ -354,13 +354,15 @@ ar5416AniOfdmErrTrigger(struct ath_hal * aniState = ahp->ah_curani; params = aniState->params; /* First, raise noise immunity level, up to max */ - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if ((AH5416(ah)->ah_ani_function & HAL_ANI_NOISE_IMMUNITY_LEVEL) && + (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) { ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, aniState->noiseImmunityLevel + 1); return; } /* then, raise spur immunity level, up to max */ - if (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel) { + if ((AH5416(ah)->ah_ani_function & HAL_ANI_SPUR_IMMUNITY_LEVEL) && + (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) { ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, aniState->spurImmunityLevel + 1); return; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 17 05:30:38 2011 (r218762) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 17 05:52:53 2011 (r218763) @@ -168,6 +168,9 @@ ar5416InitState(struct ath_hal_5416 *ahp */ AH5416(ah)->ah_rx_chainmask = AR5416_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK; + + /* Enable all ANI functions to begin with */ + AH5416(ah)->ah_ani_function = HAL_ANI_ALL; } uint32_t From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 05:56: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 BD131106566C; Thu, 17 Feb 2011 05:56: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 920778FC17; Thu, 17 Feb 2011 05:56:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H5u3HM096936; Thu, 17 Feb 2011 05:56:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H5u3Wm096934; Thu, 17 Feb 2011 05:56:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102170556.p1H5u3Wm096934@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 05:56: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: r218764 - head/sys/dev/ath/ath_hal/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, 17 Feb 2011 05:56:03 -0000 Author: adrian Date: Thu Feb 17 05:56:03 2011 New Revision: 218764 URL: http://svn.freebsd.org/changeset/base/218764 Log: Add in ANI parameters for the AR9280. These aren't enabled by default as they're likely not entirely correct, but they give people something to toy with to compare behaviour/performance. Disable the anti-noise part, as this apparently interferes with RIFS. I haven't verified this. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Feb 17 05:52:53 2011 (r218763) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Feb 17 05:56:03 2011 (r218764) @@ -68,8 +68,34 @@ static void ar9280WriteIni(struct ath_ha static void ar9280AniSetup(struct ath_hal *ah) { - /* NB: disable ANI for reliable RIFS rx */ - ar5416AniAttach(ah, AH_NULL, AH_NULL, AH_FALSE); + /* + * These are the parameters from the AR5416 ANI code; + * they likely need quite a bit of adjustment for the + * AR9280. + */ + static const struct ar5212AniParams aniparams = { + .maxNoiseImmunityLevel = 4, /* levels 0..4 */ + .totalSizeDesired = { -55, -55, -55, -55, -62 }, + .coarseHigh = { -14, -14, -14, -14, -12 }, + .coarseLow = { -64, -64, -64, -64, -70 }, + .firpwr = { -78, -78, -78, -78, -80 }, + .maxSpurImmunityLevel = 2, + .cycPwrThr1 = { 2, 4, 6 }, + .maxFirstepLevel = 2, /* levels 0..2 */ + .firstep = { 0, 4, 8 }, + .ofdmTrigHigh = 500, + .ofdmTrigLow = 200, + .cckTrigHigh = 200, + .cckTrigLow = 100, + .rssiThrHigh = 40, + .rssiThrLow = 7, + .period = 100, + }; + /* NB: disable ANI noise immmunity for reliable RIFS rx */ + AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL; + + /* NB: ANI is not enabled yet */ + ar5416AniAttach(ah, &aniparams, &aniparams, AH_FALSE); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 07:39: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 5EEAE106566C; Thu, 17 Feb 2011 07:39:54 +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 433798FC15; Thu, 17 Feb 2011 07:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H7dsnF099568; Thu, 17 Feb 2011 07:39:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H7dsFp099563; Thu, 17 Feb 2011 07:39:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102170739.p1H7dsFp099563@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 17 Feb 2011 07:39: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: r218765 - in head: share/man/man4 sys/conf 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: Thu, 17 Feb 2011 07:39:54 -0000 Author: hselasky Date: Thu Feb 17 07:39:53 2011 New Revision: 218765 URL: http://svn.freebsd.org/changeset/base/218765 Log: - Fix build of manual page and inclusion of mos driver into kernel config file. - Fix style compliancy by wrapping some long lines in if_mos.c Approved by: thompsa (mentor) Modified: head/share/man/man4/Makefile head/share/man/man4/mos.4 head/sys/conf/files head/sys/dev/usb/net/if_mos.c Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Feb 17 05:56:03 2011 (r218764) +++ head/share/man/man4/Makefile Thu Feb 17 07:39:53 2011 (r218765) @@ -221,6 +221,7 @@ MAN= aac.4 \ mmc.4 \ mmcsd.4 \ mn.4 \ + mos.4 \ mouse.4 \ mps.4 \ mpt.4 \ Modified: head/share/man/man4/mos.4 ============================================================================== --- head/share/man/man4/mos.4 Thu Feb 17 05:56:03 2011 (r218764) +++ head/share/man/man4/mos.4 Thu Feb 17 07:39:53 2011 (r218765) @@ -28,6 +28,7 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device uhci" .Cd "device ohci" +.Cd "device ehci" .Cd "device usb" .Cd "device miibus" .Cd "device mos" @@ -72,6 +73,7 @@ driver include: .Bl -bullet -compact .It Sitecom LN030 +.El .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 17 05:56:03 2011 (r218764) +++ head/sys/conf/files Thu Feb 17 07:39:53 2011 (r218765) @@ -1815,10 +1815,11 @@ dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth dev/usb/net/if_kue.c optional kue +dev/usb/net/if_mos.c optional mos dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | rue | \ - udav +dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ + rue | udav dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Thu Feb 17 05:56:03 2011 (r218764) +++ head/sys/dev/usb/net/if_mos.c Thu Feb 17 07:39:53 2011 (r218765) @@ -802,8 +802,10 @@ mos_bulk_read_callback(struct usb_xfer * MOS_DPRINTFN("erroneous frame received"); if (rxstat & MOS_RXSTS_SHORT_FRAME) MOS_DPRINTFN("frame size less than 64 bytes"); - if (rxstat & MOS_RXSTS_LARGE_FRAME) - MOS_DPRINTFN("frame size larger than 1532 bytes"); + if (rxstat & MOS_RXSTS_LARGE_FRAME) { + MOS_DPRINTFN("frame size larger than " + "1532 bytes"); + } if (rxstat & MOS_RXSTS_CRC_ERROR) MOS_DPRINTFN("CRC error"); if (rxstat & MOS_RXSTS_ALIGN_ERROR) @@ -814,7 +816,9 @@ mos_bulk_read_callback(struct usb_xfer * /* Remember the last byte was used for the status fields */ pktlen = actlen - 1; if (pktlen < sizeof(struct ether_header)) { - MOS_DPRINTFN("error: pktlen %d is smaller than ether_header %zd", pktlen, sizeof(struct ether_header)); + MOS_DPRINTFN("error: pktlen %d is smaller " + "than ether_header %zd", pktlen, + sizeof(struct ether_header)); ifp->if_ierrors++; goto tr_setup; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 08:28: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 1911A1065674; Thu, 17 Feb 2011 08:28:20 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 682788FC0C; Thu, 17 Feb 2011 08:28:18 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 00CEB9CB472; Thu, 17 Feb 2011 09:28:17 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9TXgRNyzSxl5; Thu, 17 Feb 2011 09:28:04 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B5E929CB4C4; Thu, 17 Feb 2011 09:28:04 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p1H8S4Vl094803; Thu, 17 Feb 2011 09:28:04 +0100 (CET) (envelope-from rdivacky) Date: Thu, 17 Feb 2011 09:28:04 +0100 From: Roman Divacky To: Alexander Best Message-ID: <20110217082804.GA94566@freebsd.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110217015211.GA67933@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110217015211.GA67933@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 08:28:20 -0000 I have some more WIP patches that shrink stuff some more, plus I have clang/llvm changes that help too.. this will get fixed On Thu, Feb 17, 2011 at 01:52:11AM +0000, Alexander Best wrote: > On Wed Feb 16 11, Warner Losh wrote: > > Author: imp > > Date: Wed Feb 16 18:05:10 2011 > > New Revision: 218745 > > URL: http://svn.freebsd.org/changeset/base/218745 > > > > Log: > > Remove reading of symbols from a.out loaded files. Since we are tight > > on space for clang and a.out support is only needed for /boot/loader, > > they are excess bytes that serve no useful purpose other than to > > support really old kernels (FreeBSD < 3.2 or so). Prefer clang > > support over support for these old kernels and remove this code. We > > gain about 100 bytes of space this way. > > sorry for my crappy previous attempt to reduce boot2's size. obviously > the *.S files aren't the problem, because even with clang we're using GAS. > so working on boot2.c is the only way of reducing the size. > > i've managed to do so (even with another 4 bytes to spare) with the attached > patch. > > i did > > otaku% grep -r bi_basemem * > sys/boot/i386/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/i386/boot2/machine/bootinfo.h: u_int32_t bi_basemem; > sys/boot/i386/gptboot/gptboot.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/i386/libi386/bootinfo32.c: bi.bi_basemem = bios_basemem / 1024; > sys/boot/i386/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; > sys/boot/i386/zfsboot/zfsboot.c: bootinfo.bi_basemem = bios_basemem / 1024; > sys/boot/pc98/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/pc98/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; > sys/i386/include/bootinfo.h: u_int32_t bi_basemem; > sys/mips/include/bootinfo.h: u_int32_t bi_basemem; > > which led me to the conclusion that bootinfo.bi_basemem doesn't need to > initialised, because it will always be set by the loader (as the XXX comment > says). > > turning ioctrl from uint8_t to int also saves a few bytes for whatever reason). > removing x doesn't save any bytes, but gets rid of a warning (as noted in one > of my messages). > > cheers. > alex > > ...and sorry for the previous noise. :( > > > > > Reviewed by: rdivacky@ > > > > Modified: > > head/sys/boot/i386/boot2/boot2.c > > > > Modified: head/sys/boot/i386/boot2/boot2.c > > ============================================================================== > > --- head/sys/boot/i386/boot2/boot2.c Wed Feb 16 17:50:21 2011 (r218744) > > +++ head/sys/boot/i386/boot2/boot2.c Wed Feb 16 18:05:10 2011 (r218745) > > @@ -347,23 +347,6 @@ load(void) > > p += roundup2(hdr.ex.a_text, PAGE_SIZE); > > if (xfsread(ino, p, hdr.ex.a_data)) > > return; > > - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); > > - bootinfo.bi_symtab = VTOP(p); > > - *(uint32_t*)p = hdr.ex.a_syms; > > - p += sizeof(hdr.ex.a_syms); > > - if (hdr.ex.a_syms) { > > - if (xfsread(ino, p, hdr.ex.a_syms)) > > - return; > > - p += hdr.ex.a_syms; > > - if (xfsread(ino, p, sizeof(int))) > > - return; > > - x = *(uint32_t *)p; > > - p += sizeof(int); > > - x -= sizeof(int); > > - if (xfsread(ino, p, x)) > > - return; > > - p += x; > > - } > > } else { > > fs_off = hdr.eh.e_phoff; > > for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { > > @@ -395,8 +378,8 @@ load(void) > > } > > } > > addr = hdr.eh.e_entry & 0xffffff; > > + bootinfo.bi_esymtab = VTOP(p); > > } > > - bootinfo.bi_esymtab = VTOP(p); > > bootinfo.bi_kernelname = VTOP(kname); > > bootinfo.bi_bios_dev = dsk.drive; > > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > > -- > a13x > diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c > index 3849725..d572700 100644 > --- a/sys/boot/i386/boot2/boot2.c > +++ b/sys/boot/i386/boot2/boot2.c > @@ -135,7 +135,7 @@ static char kname[1024]; > static uint16_t opts; > static int comspeed = SIOSPD; > static struct bootinfo bootinfo; > -static uint8_t ioctrl = IO_KEYBOARD; > +static int ioctrl = IO_KEYBOARD; > > void exit(int); > static void load(void); > @@ -245,7 +245,7 @@ main(void) > dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; > bootinfo.bi_version = BOOTINFO_VERSION; > bootinfo.bi_size = sizeof(bootinfo); > - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > + /* bootinfo.bi_basemem = 0; XXX will be filled by loader or kernel */ > bootinfo.bi_extmem = memsize(); > bootinfo.bi_memsizes_valid++; > > @@ -319,7 +319,7 @@ load(void) > static Elf32_Shdr es[2]; > caddr_t p; > ino_t ino; > - uint32_t addr, x; > + uint32_t addr; > int i, j; > uint8_t fmt; > From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 08:54: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 EF81C1065672; Thu, 17 Feb 2011 08:54:22 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE4E28FC14; Thu, 17 Feb 2011 08:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1H8sMdY001622; Thu, 17 Feb 2011 08:54:22 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1H8sMR6001620; Thu, 17 Feb 2011 08:54:22 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201102170854.p1H8sMR6001620@svn.freebsd.org> From: Poul-Henning Kamp Date: Thu, 17 Feb 2011 08:54: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: r218766 - head/tools/tools/sysbuild X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 08:54:23 -0000 Author: phk Date: Thu Feb 17 08:54:22 2011 New Revision: 218766 URL: http://svn.freebsd.org/changeset/base/218766 Log: Improve the check for ports which have gone missing, and just ignore them. We want a run to perform as much work as possible before it gives up. Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Thu Feb 17 07:39:53 2011 (r218765) +++ head/tools/tools/sysbuild/sysbuild.sh Thu Feb 17 08:54:22 2011 (r218766) @@ -178,7 +178,11 @@ ports_recurse() ( do if [ ! -d $d ] ; then echo "Missing port $d" 1>&2 - exit 2 + continue + fi + if [ ! -f $d/Makefile ] ; then + echo "Missing port $d" 1>&2 + continue fi if [ "x$t" != "x." ] ; then echo "\"$t\" -> \"$d\"" >> /tmp/_.plist.dot From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 10:03: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 D0C9F106566B; Thu, 17 Feb 2011 10:03:49 +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 AC0798FC0C; Thu, 17 Feb 2011 10:03:48 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1HA3dL5026916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Feb 2011 21:03:43 +1100 Date: Thu, 17 Feb 2011 21:03:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20110217010953.GA65017@freebsd.org> Message-ID: <20110217182526.G1149@besplex.bde.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110216221014.GA43296@freebsd.org> <20110216221712.GA44796@freebsd.org> <20110216224126.GA47777@freebsd.org> <20110217010953.GA65017@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, Warner Losh Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 10:03:49 -0000 On Thu, 17 Feb 2011, Alexander Best wrote: > On Wed Feb 16 11, Alexander Best wrote: >> On Wed Feb 16 11, Alexander Best wrote: >>> On Wed Feb 16 11, Alexander Best wrote: >>>> On Wed Feb 16 11, Warner Losh wrote: >>>> i think without this code uint32_t x serves no purpose any longer: >>>> >>>> /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:322:20: warning: unused variable 'x' [-Wunused-variable] >>>> uint32_t addr, x; >>>> ^ Removing it won't save any space, however. >>> also due to >>> >>> /usr/git-freebsd-head/sys/boot/i386/boot2/boot2.c:631:8: warning: cast from 'caddr_t' (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align] >>> t1 = *(uint32_t *)PTOV(0x46c); >>> ^~~~~~~~~~~~~~~~~~~~~~~ >>> >>> i think t0 and t1 can be turned into uint8_t's and PTOV(0x46c); can be casted >>> to (uint8_t *), instead of (uint32_t *). Maybe, but further changes would be required. The variable is a 32-bit tick counter. I think the tick frequency is 18.2 Hz. This will wrap after some time, and the code is already broken when it wraps. This brokenness is not too important since this code is normally used soon after booting and the wrap occurs after 7.25 years, but if you reduce the counts to uint8_t's then the wrap occurs after only 14 seconds, so you should be more careful. From an old version of boot2.c: % static int % keyhit(unsigned ticks) Ticks might also be best as uint8_t, especially if t0 and t1 are changed to uint8_t. It always has the value 3*SECOND or 5*SECOND, where SECOND is the tick frequency 18.2 rounded to 18 (rounding gives an error of 1 tick after 5 seconds; this can be fixed using floating point evaluated at compile time). I think the compiler is prevented from reducing it to its constant value by lack of (implicit) inlining. % { % uint32_t t0, t1; % % if (opts & 1 << RBX_NOINTR) % return 0; The only change in the current verion is to obfuscate the bit test using a macro. Such optimizations make it hard to see where the bloat is. % t0 = 0; % for (;;) { % if (xgetc(1)) % return 1; % t1 = *(uint32_t *)PTOV(0x46c); % if (!t0) % t0 = t1; Might be able to rewrite this so it is auto-initializing without a special case. Try putting 't0 = *(uint32_t *)PTOV(0x46c);' outside of the loop. I think it is intentionally not done this way since PTOV(0x46c) involves the large address constant 0x46c (which tends to generate large code (see below)) and the PTOV() macro makes this worse due to the bad implementation of this macro. (PTOV(pa) is ((caddr_t)(pa) - __base). Subtracting the base makes no sense, and defeats the normal address mode base+offset. However, here the address of PTOV(0x46C) is best calculated (with the bad PTOV()) by loading 0x46C into a register and subtracting __base. Then we have a pointer to it and can load t0 initially by just dereferencing this pointer. With the better PTOV(pa) of (__actual_base_with_the_correct_type + (pa)) the best calculation of the address is to load the actual base into a register and not add 0x46C to that register if we are only using PTOV(0x46c) once, but when PTOV(046c) is used twice the best code is less clear.) % if (t1 < t0 || t1 >= t0 + ticks) % return 0; Oops, this does handle wrap, but in a slow way and sloppy way. t1 < t0 means that the counter has wrapped. We then return immediately. Not too bad if there is 1 error 7.25 years after booting. With the counter reduced to 8 bits, this error after 14 seconds would be annoying. But the usual method of handling cyclic counters takes less code and is less sloppy: if ((counter_size_t)(t1 - t0) >= ticks) return 0; We must be careful with the cast. Then this works with a counter_size_t of uint8_t, since the maximum value for `ticks' is 70 which fits in 8 bits. Also, we can almost guarantee that this code isn't interrupted, so we won't miss a single change of the counter. With interruption, we would have to be very unlucky to miss a counter rollover after 7.25 7.25 years or even after 14 seconds, and even if we miss we would normally only wait at most `ticks' ticks extra; then we do a less-wrong thing than returning early. % } % } > this will actually increase the size. Maybe. Smaller types often give larger object code due to extra prefix bytes (in i386 code) and extra instructions to promote the types before using them. 16-bit types in 32-bit i386 code are especially bad, since they require prefixes. In the above, t1 < t0 gives the same size object code with either uint8_t or unisigned. t1 >= t0 + ticks gives larger object code with uint8_t. At least 1 movl will have to become movzbl to promote a uint8_t. But with everything uint8_t, only 8-bit instructions should be needed. >> with this additional change the code fits when compiled with clang: >> >> diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S >> index 7b8e9eb..d745129 100644 >> --- a/sys/boot/i386/boot2/sio.S >> +++ b/sys/boot/i386/boot2/sio.S >> @@ -29,11 +29,11 @@ >> sio_init: movw $SIO_PRT+0x3,%dx # Data format reg >> movb $SIO_FMT|0x80,%al # Set format >> outb %al,(%dx) # and DLAB >> - pushl %edx # Save >> + pushb %dl # Save >> subb $0x3,%dl # Divisor latch reg >> movl 0x8(%esp),%eax # Set >> outw %ax,(%dx) # BPS >> - popl %edx # Restore >> + popb %dl # Restore >> movb $SIO_FMT,%al # Clear >> outb %al,(%dx) # DLAB >> incl %edx # Modem control reg > > cannot push a single byte onto the stack on i386 32 bit. Indeed. It could only save a space by not generating any code for pushb. Compiling with -Wa,-al shows the null code, but also shows errors. push/pop of a single byte only works on i386 for pushing a single _immediate_ byte. The result is still to push a 16- ot 32-bit word, with the immediate byte sign extended, but when you have a constant value that is between -128 and 127, "push[lw] $value" is by far the shortest way to put this value in memory (2 bytes, 1 for the opcode and 1 for the value). In contrast, storing a general constant value to a general address often takes 10 bytes (2 bytes for the opcode, 4 for the memory address, and 4 for the value; with a reduction of only the last from 4 to 1 for a small immediate value). >> ...since we're only modifying %dl in subb $0x3,%dl, we don't need to push/pop >> a 32 bit value, but only 8 bits. gcc also has little idea of how to generate small code for this. Use of any byte register except %al should be avoided, since for example subb $3,%dl takes 3 bytes while subb $3,%al takes 2 bytes. However in sio.S, the result is needed in %dx. Operating on %dl is already a trick to save space, but is is far from best: unlike operations, movb to %al is no more efficient than movb to any byte register. subb $3,%dl should therefore be written as movb $mumble,%dl to save 1 byte. $mumble is the device's register set address, plus the device register offset, all mod 256, and the everything must be known at compile time not cross a 256-byte boundary for this to work. The source code is then more readable (no magic $3, which is the difference between the offset of the device register previously used (very context dependent) and the device register to be used next; instead, just the offset of the device reguster to be used next combined with the base). ISTR seeing gcc doing this optimization starting from C code, but it rarely gets a chance since the base address is rarely known at compile time. Here we direct the code generated precisely and don't do it as well as a compiler could starting from C code -- sio.S never needed to be in asm. In sio.S, the base is known at compile time (as SIOPRT), and xx50 ports are always aligned at 8-byte boundaries and have 8 internal registers so there is no problem with 256-byte boundaries. Here is serial.S from the old and better boot loader i386/boot/biosboot which I use, translated into C according to the above ideas. When compiled with -Os -fomit-frame-pointer, it has size 112 bytes, but serial.S gives size 105 bytes so this doesn't quite prove my case that C is better even for things than are carefully optimized in asm. gcc-3.3.3 gives size 128 bytes, so gcc is actually getting closer to being competitive with asm programmers. serial.c: % /* % * The serial port interface routines implement a simple polled i/o % * interface to a standard serial port. Due to the space restrictions % * for the boot blocks, no BIOS support is used (since BIOS requires % * expensive real/protected mode switches), instead the rudimentary % * BIOS support is duplicated here. % * % * XXX modes switches shouldn't be expensive. An int86() function % * could be used, so that new BIOS calls could be written in C. This % * would probably take more space, however. The switch could be done % * automagically by trapping interrupts. This would allow space-efficient % * calls of the form asm("int nn" : "outputs" : "inputs"). % * % * The base address and speed for the i/o port are passed from the % * Makefile in the COMCONSOLE and CONSPEED preprocessor macros. The % * line control parameters are currently hard-coded to 8 bits, no % * parity, 1 stop bit (8N1). This can be changed in init_serial(). % * % * XXX FIXME we now use the kernel's default 8N1. % */ % % #ifdef broken % #include "boot.h" % #endif % % #include % #include % % #include % % #include % #include /* XXX incompletely globalized defs */ % #define COMCONSOLE 0x3f8 /* XXX another; normally in makefile */ % % #define COMBRD(x) (1843200 / (16 * (x))) % #define CONADDR COMCONSOLE % % /* % * Write a character to the serial port. % */ % /* % * XXX should be named serial_putchar(). % */ % void % serial_putc(ch) % int ch; % { % int timeout; % % for (timeout = 10000; --timeout != 0;) % if ((inb(CONADDR + com_lsr) & LSR_TXRDY)) % break; % outb(CONADDR + com_data, ch); % } % % /* % * Read a character from the serial port. % */ % /* % * XXX should be named serial_getchar(). % */ % int % serial_getc() % { % unsigned char ch; % % while (!(inb(CONADDR + com_lsr) & LSR_RXRDY)) % ; % ch = inb(CONADDR + com_data); % % /* Remove any parity bit. */ % ch &= 0x7f; % % /* Convert DEL to BACKSPACE. */ % if (ch == 0x7f) % ch = 8; % % return (ch); % } % % /* % * Return nonzero if getc() wouldn't block. % */ % /* % * XXX should be named serial_ischar(). % * XXX FIXME this should be static inline to save space. % */ % int % serial_ischar() % { % return (inb(CONADDR + com_lsr) & LSR_RXRDY); % } % % /* % * Initialize port CONADDR to speed CONSPEED, line settings 8N1. % */ % /* % * XXX should be named serial_init(). % * XXX FIXME his should be static inline to save space. % */ % void % init_serial() % { % outb(CONADDR + com_cfcr, CFCR_DLAB); % outb(CONADDR + com_dlbl, COMBRD(CONSPEED)); % outb(CONADDR + com_dlbh, COMBRD(CONSPEED) >> 8); % % /* Disable fifo to reduce worst-case busy-wait. */ % outb(CONADDR + com_fcr, 0); % % outb(CONADDR + com_cfcr, CFCR_8BITS); /* 8N1 */ % outb(CONADDR + com_mcr, MCR_DTR | MCR_RTS); % % /* Flush (unconditionally the first time) all input. */ % do % inb(CONADDR + com_data); % while (inb(CONADDR + com_lsr) & LSR_RXRDY); % } Code generated from the above by gcc-4.2.1 -Os -fomit-frame-pointer -Wa,-al: % GAS LISTING /var/tmp//cc2FFF3R.s page 1 % % % 1 .file "w.c" % 2 .text % 3 .globl serial_getc % 4 .type serial_getc, @function % 5 serial_getc: % 6 .L3: % 7 0000 BAFD0300 movl $1021, %edx % 7 00 This takes 5 bytes (1 byte opcode and 4-byte immediate value), but should take 4 bytes (1 byte operand size prefix, 1 byte opcode and 2-byte immediate value. My old asms in cpufunc.h are probably at fault here. Those intentionally use "u_int port" to avoid the prefix. This optimizes for time instead of space (the prefix costs a cycle on old x86's). The value is 0x3f8+3, obfuscated in the usual way by gcc (gcc generates decimal constants even when the source code uses hex constants :-(). % 8 #APP % 9 0005 EC inb %dx,%al % 10 #NO_APP Only the low 16 bits of %edx are used. This allows a 16-bit load to work. But the above did a 32-bit load to optimize for time. % 11 0006 A801 testb $1, %al % 12 0008 74F6 je .L3 % 13 000a B2F8 movb $-8, %dl Here we see gcc perfectly optimizing the adjustment from 0x3f8+3 to 0x3f8 -- it doesn't subtract 3, but loads 0xf8. The obfuscation of the value is even better here -- 0xf8 technically can't be loaded since the immediate byte is signed, but that is how the value should be written. % 14 #APP % 15 000c EC inb %dx,%al % 16 #NO_APP % 17 000d 83E07F andl $127, %eax It could use andb to save a byte, but this prepares a good return value at a cost of only 1 byte. % 18 0010 3C7F cmpb $127, %al % 19 0012 7502 jne .L5 % 20 0014 B008 movb $8, %al % 21 .L5: % 22 0016 0FB6C0 movzbl %al, %eax This wastes 3 bytes. We already zero-extended using the andl. Perhaps the source code can be tweaked to make this clear to the compiler. % 23 0019 C3 ret I think the interface is intentionally pessimized to return a 32 bit value and thus require wasting 1 byte for the above andl, since if we don't extend once here then the callers will tend to extend more than once later. % 24 .size serial_getc, .-serial_getc % 25 .globl serial_putc % 26 .type serial_putc, @function % 27 serial_putc: % 28 001a B9102700 movl $10000, %ecx % 28 00 % 29 001f EB0A jmp .L11 % 30 .L12: % 31 0021 BAFD0300 movl $1021, %edx % 31 00 % 32 #APP % 33 0026 EC inb %dx,%al % 34 #NO_APP % 35 0027 A820 testb $32, %al % 36 0029 7503 jne .L13 % 37 .L11: % 38 002b 49 decl %ecx % 39 002c 75F3 jne .L12 gcc apparently doesn't know about the `loop' instruction which does this in 2 bytes. The `loop*' instructions are useless and normally slower except: - they save space - on 8088's, the instruction fetcher was so weak that saving space in instruction space also saved time in just about all cases. % 40 .L13: % 41 002e BAF80300 movl $1016, %edx % 41 00 This loads the full register (32 bits, though 16 would be enough) since it is jumped to. Better generated code would load CONADDR into %[e]dx initially so that it is available for low-byte-only modifications throughout. % 42 0033 8A442404 movb 4(%esp), %al This function returns void so it automatically avoids extra code to extend the return value, but its parameter may have been excessively extended when passed here. % 43 #APP % 44 0037 EE outb %al,%dx % 45 #NO_APP % 46 0038 C3 ret % 47 .size serial_putc, .-serial_putc % 48 .globl init_serial % 49 .type init_serial, @function % 50 init_serial: % 51 0039 B9FB0300 movl $1019, %ecx % 51 00 % 52 003e B080 movb $-128, %al % GAS LISTING /var/tmp//cc2FFF3R.s page 2 % % % 53 0040 89CA movl %ecx, %edx % 54 #APP % 55 0042 EE outb %al,%dx % 56 #NO_APP % 57 0043 B00C movb $12, %al % 58 0045 B2F8 movb $-8, %dl % 59 #APP % 60 0047 EE outb %al,%dx % 61 #NO_APP % 62 0048 31C0 xorl %eax, %eax % 63 004a B2F9 movb $-7, %dl % 64 #APP % 65 004c EE outb %al,%dx % 66 #NO_APP % 67 004d B2FA movb $-6, %dl % 68 #APP % 69 004f EE outb %al,%dx % 70 #NO_APP % 71 0050 B003 movb $3, %al % 72 0052 89CA movl %ecx, %edx % 73 #APP % 74 0054 EE outb %al,%dx % 75 #NO_APP % 76 0055 B2FC movb $-4, %dl % 77 #APP % 78 0057 EE outb %al,%dx % 79 #NO_APP % 80 .L16: % 81 0058 BAF80300 movl $1016, %edx % 81 00 % 82 #APP % 83 005d EC inb %dx,%al % 84 #NO_APP % 85 005e B2FD movb $-3, %dl % 86 #APP % 87 0060 EC inb %dx,%al % 88 #NO_APP % 89 0061 A801 testb $1, %al % 90 0063 75F3 jne .L16 % 91 0065 C3 ret % 92 .size init_serial, .-init_serial I didn't try hard to optimize the initialization function for use here, but may have written parts of the asm that it is based on and wrote them for small size, and tried hard to make the cpufuncs not turn small code into large code. The results are not quite perfect -- the initial load of is into %ecx when it should be direct into %dx, and there is another load into %edx. % 93 .globl serial_ischar % 94 .type serial_ischar, @function % 95 serial_ischar: % 96 0066 BAFD0300 movl $1021, %edx % 96 00 % 97 #APP % 98 006b EC inb %dx,%al % 99 #NO_APP % 100 006c 83E001 andl $1, %eax andb and a byte return should be enough. % 101 006f C3 ret % 102 .size serial_ischar, .-serial_ischar Inlining might reduce the loading of %dx even more. This function is called twice, so it is not quite small enough to always inline. % 103 .ident "GCC: (GNU) 4.2.1 20070719 [FreeBSD]" Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 11:23: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 C845F106566B; Thu, 17 Feb 2011 11:23:53 +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 2C5598FC19; Thu, 17 Feb 2011 11:23:52 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1HBNlZ3001015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Feb 2011 22:23:48 +1100 Date: Thu, 17 Feb 2011 22:23:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20110217015211.GA67933@freebsd.org> Message-ID: <20110217210358.I1149@besplex.bde.org> References: <201102161805.p1GI5ABX078768@svn.freebsd.org> <20110217015211.GA67933@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, Warner Losh Subject: Re: svn commit: r218745 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 11:23:53 -0000 On Thu, 17 Feb 2011, Alexander Best wrote: > sorry for my crappy previous attempt to reduce boot2's size. obviously > the *.S files aren't the problem, because even with clang we're using GAS. > so working on boot2.c is the only way of reducing the size. > > i've managed to do so (even with another 4 bytes to spare) with the attached > patch. > > i did > > otaku% grep -r bi_basemem * > sys/boot/i386/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/i386/boot2/machine/bootinfo.h: u_int32_t bi_basemem; > sys/boot/i386/gptboot/gptboot.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/i386/libi386/bootinfo32.c: bi.bi_basemem = bios_basemem / 1024; > sys/boot/i386/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; > sys/boot/i386/zfsboot/zfsboot.c: bootinfo.bi_basemem = bios_basemem / 1024; > sys/boot/pc98/boot2/boot2.c: bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ > sys/boot/pc98/loader/main.c: initial_bootinfo->bi_basemem = bios_basemem / 1024; > sys/i386/include/bootinfo.h: u_int32_t bi_basemem; > sys/mips/include/bootinfo.h: u_int32_t bi_basemem; > > which led me to the conclusion that bootinfo.bi_basemem doesn't need to > initialised, because it will always be set by the loader (as the XXX comment > says). It isn't always set by the loader, since the loader isn't always used (I consider its existence a bug and normally don't use it). The XXX comment says that bootinfo.bi_basemem will be initialized by the kernel (if not by the boot blocks or loader), but I can't find anywhere where the kernel either sets or uses bi_basemem (the only access in the kernel to it seems to be to copy it in locore). It was used in FreeBSD-3, but seems to be unused in FreeBSD-4. Thus it seems to be pure garbage, except for kernels older than ones that I test (I still boot FreeBSD-4 for testing a couple of times per year, and keep FreeBSD_3 kernels handy but haven't booted them for 5+ years). Similarly for bootinfo.bi_extmem and bootinfo.bi_memsizes_valid. There is also a lot of garbage is i386/locore.s to support booting with old boot blocks. Not just 5 years old, but almost 20 years, from before I created bootinfo to give a fixed ABI for booting. This garbage probably rotted, and became pure when the kernel became ELF, since old boot blocks only supported AOUT so they cannot boot a current kernel. The use in FreeBSD-3 i386/machdep.c was: % #ifdef VM86 % initial_bioscalls(&biosbasemem, &biosextmem); % #else % % /* Use BIOS values stored in RTC CMOS RAM, since probing % * breaks certain 386 AT relics. % */ % biosbasemem = rtcin(RTC_BASELO)+ (rtcin(RTC_BASEHI)<<8); % biosextmem = rtcin(RTC_EXTLO)+ (rtcin(RTC_EXTHI)<<8); % #endif % % /* % * If BIOS tells us that it has more than 640k in the basemem, % * don't believe it - set it to 640k. % */ % if (biosbasemem > 640) { % printf("Preposterous RTC basemem of %uK, truncating to 640K\n", % biosbasemem); % biosbasemem = 640; % } % if (bootinfo.bi_memsizes_valid && bootinfo.bi_basemem > 640) { % printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", % bootinfo.bi_basemem); % bootinfo.bi_basemem = 640; % } I.e., optionally use VM86; otherwise use RTC values; then check the results againts bi_basemem; later, in code not shown, use the value in bi_basemem iff it is value. But already in FreeBSD-4, VM86 was non-optional; the RTC values were only used as a last resort after 3 or 4 different vm86 calls failed, and the bootinfo values were not used at all. At least biosboot, bi_basemem and bi_extmem were just the result of the BIOS calls 0x12 and 0x15. These values were not needed in FreeBSD-4 once VM86 could be used to make the same calls, and became useless soon after when memory sizes became too large for them to report. I just noticed that boot2 doesn't even make a memsize() call for bi_basemem, so you are talking about removing less than I first thought. It just makes the 0x15 call for bi_extmem. Thus it is already broken for FreeBSD-3 and earlier kernels without VM86, and nothing would be lost by completing this breakage. I think all of the following can be removed: % static uint32_t memsize(void); % % static inline uint32_t % memsize(void) % { % v86.addr = MEM_EXT; % v86.eax = 0x8800; % v86int(); % return v86.eax; % } Also, infrastructure like the definition of MEM_EXT. The definition of MEM_BASE was not removed when its use was removed. % % bootinfo.bi_version = BOOTINFO_VERSION; % bootinfo.bi_size = sizeof(bootinfo); Can't be removed, but should probably be moved: (1) bootinfo seems to have size 0x88. It is allocated in the bss, so doesn't take any space except for code to initialize it. OTOH, values like the above are constant so they could be initialized at compile time using less space than this code for each one, but probably more space overall, especially after the following are removed. (2) It's good to keep all accesses to bootinfo together, so that they can be done relative to a single pointer register. After removing the following, the group of them here becomes small, so it might be better to combine the above with another group. % bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ % bootinfo.bi_extmem = memsize(); % bootinfo.bi_memsizes_valid++; Support for disk geometry fields in bootinfo was lost long ago. This leaves only the following bootinfo fields supported (by boot2) and used: bi_version, bi_size, bi_symtab, bi_esymtab, bi_kernelname. bi_bios_dev is another garbage one. This seems to have never been used. I may have intended it to replace the pre-bootinfo `bootdev'. The interface for non-nfsdiskless boot blocks was (*btext)(howto, bootdev, cyloffset, esym); now it is (*btext)(howto, bootdev, 0, 0, 0, &bootinfo). Note that the bootdev arg is still passed, but it has mostly rotted too, having been mostly replaced by a device name in ASCII format passed by the loader. The garbage is pure in -current except for the bogus sysctl machdep.guessed_bootdev). Or perhaps bi_bios_dev was intended for geometry translation -- there is a problem if the BIOS device number differs from the kernel device number, and we can only be sure of the BIOS geometry for the kernel device if we are sure that we have matched the kernel device with the BIOS one (as boot2 has some support for). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 12:21: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 8BBF31065670; Thu, 17 Feb 2011 12:21:14 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C2108FC15; Thu, 17 Feb 2011 12:21:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HCLEAK008085; Thu, 17 Feb 2011 12:21:14 GMT (envelope-from osa@svn.freebsd.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HCLEEV008083; Thu, 17 Feb 2011 12:21:14 GMT (envelope-from osa@svn.freebsd.org) Message-Id: <201102171221.p1HCLEEV008083@svn.freebsd.org> From: "Sergey A. Osokin" Date: Thu, 17 Feb 2011 12:21: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: r218771 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 12:21:14 -0000 Author: osa (ports committer) Date: Thu Feb 17 12:21:14 2011 New Revision: 218771 URL: http://svn.freebsd.org/changeset/base/218771 Log: Fix the beginning day of the Great Lent, it starts on Monday for 7 weeks before Paskha. Fix the Exaltation of the Holy Cross day. Add more Twelve holidays (dvunadesyatye prazdniki). Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox (contents, props changed) Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox Thu Feb 17 11:50:30 2011 (r218770) +++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox Thu Feb 17 12:21:14 2011 (r218771) @@ -11,13 +11,14 @@ LANG=ru_RU.KOI8-R Paskha=ðÁÓÈÁ 21 ÓÅÎ òÏÖÄÅÓÔ×Ï ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ -28 ÓÅÎ ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ +27 ÓÅÎ ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ 14 ÏËÔ ðÏËÒÏ× ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ 4 ÄÅË ÷×ÅÄÅÎÉÅ ×Ï ÈÒÁÍ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ 7 ÑÎ× òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï +14 ÑÎ× ïÂÒÅÚÁÎÉÅ çÏÓÐÏÄÎÅ 19 ÑÎ× âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ 15 ÆÅ× óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ -ðÁÓÈÁ-46 ÷ÅÌÉËÉÊ ðÏÓÔ +ðÁÓÈÁ-48 ÷ÅÌÉËÉÊ ðÏÓÔ ðÁÓÈÁ-7 ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ ðÁÓÈÁ-3 ÷ÅÌÉËÉÊ þÅÔ×ÅÒÇ ðÁÓÈÁ-2 óÔÒÁÓÔÎÁÑ ðÑÔÎÉÃÁ @@ -27,8 +28,11 @@ Paskha=ðÁÓÈÁ ðÁÓÈÁ+56 ôÒÏÉÃÉÎ äÅÎØ ðÁÓÈÁ+60 ðÒÁÚÄÎÉË ôÅÌÁ èÒÉÓÔÏ×Á 7 ÁÐÒ âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ + 7 ÉÀÌ òÏÖÄÅÓÔ×Ï éÏÎÎÁ ðÒÅÄÔÅÞÉ +12 ÉÀÌ äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ 19 Á×Ç ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ 28 Á×Ç õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ +11 ÓÅÎ õÓÅËÎÏ×ÅÎÉÅ ÇÌÁ×Ù éÏÁÎÎÁ ðÒÅÄÔÅÞÉ #endif /* !_ru_RU_KOI8_R_orthodox_ */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 15:10: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 C58FF106564A; Thu, 17 Feb 2011 15:10:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48BC8FC13; Thu, 17 Feb 2011 15:10:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HFAD3Y014469; Thu, 17 Feb 2011 15:10:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HFADrA014466; Thu, 17 Feb 2011 15:10:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102171510.p1HFADrA014466@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Feb 2011 15:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218772 - in head: etc/mtree include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2011 15:10:13 -0000 Author: kib Date: Thu Feb 17 15:10:13 2011 New Revision: 218772 URL: http://svn.freebsd.org/changeset/base/218772 Log: Install iodev.h. Reviewed by: attilio MFC after: 1 week Modified: head/etc/mtree/BSD.include.dist head/include/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Feb 17 12:21:14 2011 (r218771) +++ head/etc/mtree/BSD.include.dist Thu Feb 17 15:10:13 2011 (r218772) @@ -106,6 +106,8 @@ .. iicbus .. + io + .. lmc .. mfi Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu Feb 17 12:21:14 2011 (r218771) +++ head/include/Makefile Thu Feb 17 15:10:13 2011 (r218772) @@ -40,7 +40,7 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/mfi dev/ofw \ + dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 15:36: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 BAD62106564A; Thu, 17 Feb 2011 15:36:29 +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 A76008FC1E; Thu, 17 Feb 2011 15:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HFaTNR015694; Thu, 17 Feb 2011 15:36:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HFaTf7015684; Thu, 17 Feb 2011 15:36:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102171536.p1HFaTf7015684@svn.freebsd.org> From: Alan Cox Date: Thu, 17 Feb 2011 15:36: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: r218773 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include 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, 17 Feb 2011 15:36:29 -0000 Author: alc Date: Thu Feb 17 15:36:29 2011 New Revision: 218773 URL: http://svn.freebsd.org/changeset/base/218773 Log: Remove pmap fields that are either unused or not fully implemented. Discussed with: kib Modified: head/sys/amd64/include/pmap.h head/sys/arm/include/pmap.h head/sys/i386/include/pmap.h head/sys/ia64/include/pmap.h head/sys/mips/include/pmap.h head/sys/powerpc/include/pmap.h head/sys/sparc64/include/pmap.h head/sys/sun4v/include/pmap.h head/sys/vm/vm_page.c Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/amd64/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -251,8 +251,6 @@ struct pmap { pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ cpumask_t pm_active; /* active on cpus */ - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; /* spare u_int here due to padding */ struct pmap_statistics pm_stats; /* pmap statistics */ vm_page_t pm_root; /* spare page table pages */ Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/arm/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -134,8 +134,6 @@ struct pmap { struct l1_ttable *pm_l1; struct l2_dtable *pm_l2[L2_SIZE]; pd_entry_t *pm_pdir; /* KVA of page directory */ - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/i386/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -436,8 +436,6 @@ struct pmap { cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; #ifdef PAE pdpt_entry_t *pm_pdpt; /* KVA of page director pointer table */ Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/ia64/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -77,8 +77,6 @@ struct pmap { TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ uint32_t pm_rid[5]; /* base RID for pmap */ struct pmap_statistics pm_stats; /* pmap statistics */ - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; }; typedef struct pmap *pmap_t; Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/mips/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -79,8 +79,6 @@ struct pmap { pd_entry_t *pm_segtab; /* KVA of segment table */ TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in * pmap */ - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; cpumask_t pm_active; /* active on cpus */ struct { u_int32_t asid:ASID_BITS; /* TLB address space tag */ Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/powerpc/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -99,8 +99,6 @@ struct pmap { register_t pm_sr[16]; #endif cpumask_t pm_active; - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; struct pmap *pmap_phys; struct pmap_statistics pm_stats; @@ -178,16 +176,11 @@ struct pmap { struct mtx pm_mtx; /* pmap mutex */ tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ cpumask_t pm_active; /* active on cpus */ - int pm_refs; /* ref count */ struct pmap_statistics pm_stats; /* pmap statistics */ /* Page table directory, array of pointers to page tables. */ pte_t *pm_pdir[PDIR_NENTRIES]; - /* generation count (pmap lock dropped) */ - uint32_t pm_gen_count; - u_int pm_retries; - /* List of allocated ptbl bufs (ptbl kva regions). */ TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; }; Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/sparc64/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -62,8 +62,6 @@ struct pmap { struct tte *pm_tsb; vm_object_t pm_tsb_obj; cpumask_t pm_active; - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; Modified: head/sys/sun4v/include/pmap.h ============================================================================== --- head/sys/sun4v/include/pmap.h Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/sun4v/include/pmap.h Thu Feb 17 15:36:29 2011 (r218773) @@ -74,8 +74,6 @@ struct pmap { struct tte_hash *pm_hash; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ struct hv_tsb_info pm_tsb; - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; cpumask_t pm_active; /* mask of cpus currently using pmap */ cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Feb 17 15:10:13 2011 (r218772) +++ head/sys/vm/vm_page.c Thu Feb 17 15:36:29 2011 (r218773) @@ -152,10 +152,6 @@ TUNABLE_INT("vm.boot_pages", &boot_pages SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); -static int pa_tryrelock_race; -SYSCTL_INT(_vm, OID_AUTO, tryrelock_race, CTLFLAG_RD, - &pa_tryrelock_race, 0, "Number of tryrelock race cases"); - static int pa_tryrelock_restart; SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD, &pa_tryrelock_restart, 0, "Number of tryrelock restarts"); @@ -181,9 +177,7 @@ int vm_page_pa_tryrelock(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) { vm_paddr_t lockpa; - uint32_t gen_count; - gen_count = pmap->pm_gen_count; lockpa = *locked; *locked = pa; if (lockpa) { @@ -198,13 +192,7 @@ vm_page_pa_tryrelock(pmap_t pmap, vm_pad atomic_add_int(&pa_tryrelock_restart, 1); PA_LOCK(pa); PMAP_LOCK(pmap); - - if (pmap->pm_gen_count != gen_count + 1) { - pmap->pm_retries++; - atomic_add_int(&pa_tryrelock_race, 1); - return (EAGAIN); - } - return (0); + return (EAGAIN); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 16:33: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 0CB551065674; Thu, 17 Feb 2011 16:33:42 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDBBE8FC0A; Thu, 17 Feb 2011 16:33:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HGXf9x017819; Thu, 17 Feb 2011 16:33:41 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HGXfiM017814; Thu, 17 Feb 2011 16:33:41 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201102171633.p1HGXfiM017814@svn.freebsd.org> From: Josh Paetzel Date: Thu, 17 Feb 2011 16:33: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: r218776 - in head/usr.sbin/pc-sysinstall: backend conf examples X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 16:33:42 -0000 Author: jpaetzel Date: Thu Feb 17 16:33:41 2011 New Revision: 218776 URL: http://svn.freebsd.org/changeset/base/218776 Log: Add "Extract Only" functionality to pc-sysinstall. This allows disk setup to be done manually, pc-sysinstall is pointed to a mount-point for installation. PR: bin/154685 Submitted by: kmoore Approved by: kib (mentor) Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf head/usr.sbin/pc-sysinstall/examples/README Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions.sh Thu Feb 17 16:21:26 2011 (r218775) +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Thu Feb 17 16:33:41 2011 (r218776) @@ -409,6 +409,7 @@ write_image() fi }; +# Setup and install on a new disk / partition install_fresh() { # Lets start setting up the disk slices now @@ -458,6 +459,39 @@ install_fresh() echo_log "Installation finished!" }; +# Extract the system to a pre-mounted directory +install_extractonly() +{ + # We are ready to begin extraction, lets start now + init_extraction + + # Check if we have any optional modules to load + install_components + + # Check if we have any packages to install + install_packages + + # Do any localization in configuration + run_localize + + # Save any networking config on the installed system + save_networking_install + + # Now add any users + setup_users + + # Now run any commands specified + run_commands + + # Set a hostname on the install system + setup_hostname + + # Set the root_pw if it is specified + set_root_pw + + echo_log "Installation finished!" +}; + install_image() { # We are ready to begin extraction, lets start now @@ -478,7 +512,7 @@ install_upgrade() # Do any localization in configuration run_localize - # ow run any commands specified + # Now run any commands specified run_commands # Merge any old configuration files Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Thu Feb 17 16:21:26 2011 (r218775) +++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Thu Feb 17 16:33:41 2011 (r218776) @@ -67,11 +67,10 @@ fi export CFGF # Start by doing a sanity check, which will catch any obvious mistakes in the config -file_sanity_check "installMode disk0 installType installMedium packageType" +file_sanity_check "installMode installType installMedium packageType" # We passed the Sanity check, lets grab some of the universal config settings and store them -check_value installMode "fresh upgrade" -check_value bootManager "bsd none" +check_value installMode "fresh upgrade extract" check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image" check_value packageType "uzip tar rsync split" @@ -108,6 +107,16 @@ case "${INSTALLMODE}" in fi ;; + extract) + # Extracting only, make sure we have a valid target directory + get_value_from_cfg installLocation + FSMNT="${VAL}" ; export FSMNT + if [ -z "$FSMNT" ] ; then exit_err "Missing installLocation=" ; fi + if [ ! -d "$FSMNT" ] ; then exit_err "No such directory: $FSMNT" ; fi + + install_extractonly + ;; + upgrade) install_upgrade ;; Modified: head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf ============================================================================== --- head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Thu Feb 17 16:21:26 2011 (r218775) +++ head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Thu Feb 17 16:33:41 2011 (r218776) @@ -36,8 +36,8 @@ RSYNCTRIES="3" export RSYNCTRIES # Set our mount-points -CDMNT="/cdmnt-install" -FSMNT="/mnt" +CDMNT=${CDMNT-/cdmnt-install} +FSMNT=${FSMNT-/mnt} UZIP_DIR="/usr" BOOT_PART_MOUNT="/boot-mount" export FSMNT CDMNT UZIP_DIR BOOT_PART_MOUNT Modified: head/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- head/usr.sbin/pc-sysinstall/examples/README Thu Feb 17 16:21:26 2011 (r218775) +++ head/usr.sbin/pc-sysinstall/examples/README Thu Feb 17 16:33:41 2011 (r218776) @@ -12,9 +12,9 @@ installed system When hostname= is not present, pc-sysinstall will auto-generate a hostname such as freebsd-XXXX or pcbsd-XXXX -# installMode=(fresh or upgrade) +# installMode=(fresh/upgrade/extract) -Set the type of install we are doing, fresh or upgrade. +Set the type of install we are doing. Fresh installs will format and mount the target disks before extracting the install images to the system. Using this mode @@ -27,6 +27,19 @@ The conf/exclude-from-upgrade file can b additional files to exclude from overwriting during the install process. +Extract will skip any disk setup, and perform an installation +to the directory specified by "installLocation=". This location +should be a directory with your pre-mounted file-systems ready +for file extraction. When using the "extract" option, /etc/fstab +on the installed system will *not* be automatically configured. + +# installLocation= + +Used only when installMode is set to extract. + +This is set to the location you want to extract your system to, +and should already be mounted properly. + # installInteractive=(yes or no) Set if the installer is running in interactive mode, and @@ -320,7 +333,7 @@ Run the specified command within chroot # runScript= runScript will copy the specified script into FSMNT, and run it in chroot of the system -Usefull when you have a 3rd party script on the DVD / USB, and you want to copy it into +Useful when you have a 3rd party script on the DVD / USB, and you want to copy it into the installed system and run # runExtCommand= @@ -330,7 +343,7 @@ The variable $FSMNT is set to the mount- ######################################################################## -# PC-BSD SPECIFC OPTIONS +# PC-BSD SPECIFIC OPTIONS ######################################################################## Options for time-zones and NTP on the installed system From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 17:03: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 8F311106564A; Thu, 17 Feb 2011 17:03:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62AEE8FC0A; Thu, 17 Feb 2011 17:03:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HH3u95019172; Thu, 17 Feb 2011 17:03:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HH3uNm019170; Thu, 17 Feb 2011 17:03:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201102171703.p1HH3uNm019170@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Feb 2011 17:03: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: r218777 - head/usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 17:03:56 -0000 Author: jhb Date: Thu Feb 17 17:03:56 2011 New Revision: 218777 URL: http://svn.freebsd.org/changeset/base/218777 Log: Save a copy of errno before invoking syslog() if accept() or select() fail. syslog() can trash the errno value causing nfsd to exit for non-fatal errors like ECONNABORTED from accept(). MFC after: 1 week Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Feb 17 16:33:41 2011 (r218776) +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 17 17:03:56 2011 (r218777) @@ -134,7 +134,7 @@ main(int argc, char **argv) socklen_t len; int on = 1, unregister, reregister, sock; int tcp6sock, ip6flag, tcpflag, tcpsock; - int udpflag, ecode, s, srvcnt; + int udpflag, ecode, error, s, srvcnt; int bindhostc, bindanyflag, rpcbreg, rpcbregcnt; int stablefd, nfssvc_addsock; char **bindhost = NULL; @@ -738,8 +738,9 @@ main(int argc, char **argv) if (connect_type_cnt > 1) { if (select(maxsock + 1, &ready, NULL, NULL, NULL) < 1) { + error = errno; syslog(LOG_ERR, "select failed: %m"); - if (errno == EINTR) + if (error == EINTR) continue; nfsd_exit(1); } @@ -750,9 +751,10 @@ main(int argc, char **argv) len = sizeof(inetpeer); if ((msgsock = accept(tcpsock, (struct sockaddr *)&inetpeer, &len)) < 0) { + error = errno; syslog(LOG_ERR, "accept failed: %m"); - if (errno == ECONNABORTED || - errno == EINTR) + if (error == ECONNABORTED || + error == EINTR) continue; nfsd_exit(1); } @@ -772,10 +774,11 @@ main(int argc, char **argv) if ((msgsock = accept(tcpsock, (struct sockaddr *)&inet6peer, &len)) < 0) { + error = errno; syslog(LOG_ERR, "accept failed: %m"); - if (errno == ECONNABORTED || - errno == EINTR) + if (error == ECONNABORTED || + error == EINTR) continue; nfsd_exit(1); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 17:31: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 F36691065672; Thu, 17 Feb 2011 17:31:36 +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 E12F08FC0A; Thu, 17 Feb 2011 17:31:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HHVa8b020296; Thu, 17 Feb 2011 17:31:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HHVaYe020294; Thu, 17 Feb 2011 17:31:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102171731.p1HHVaYe020294@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 17: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: r218778 - 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: Thu, 17 Feb 2011 17:31:37 -0000 Author: adrian Date: Thu Feb 17 17:31:36 2011 New Revision: 218778 URL: http://svn.freebsd.org/changeset/base/218778 Log: Disable short-GI in 20mhz mode - the hardware doesn't support this. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 17 17:03:56 2011 (r218777) +++ head/sys/dev/ath/if_ath.c Thu Feb 17 17:31:36 2011 (r218778) @@ -635,7 +635,10 @@ ath_attach(u_int16_t devid, struct ath_s | IEEE80211_HTC_AMPDU /* A-MPDU tx/rx */ | IEEE80211_HTC_AMSDU /* A-MSDU tx/rx */ | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ + /* At the present time, the hardware doesn't support short-GI in 20mhz mode */ +#if 0 | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ +#endif | IEEE80211_HTCAP_SMPS_OFF; /* SM power save off */ ; From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 17:35: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 927CD106564A; Thu, 17 Feb 2011 17:35:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8012E8FC17; Thu, 17 Feb 2011 17:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HHZ9Fl020415; Thu, 17 Feb 2011 17:35:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HHZ9kp020413; Thu, 17 Feb 2011 17:35:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102171735.p1HHZ9kp020413@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Feb 2011 17:35: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: r218779 - 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: Thu, 17 Feb 2011 17:35:09 -0000 Author: adrian Date: Thu Feb 17 17:35:09 2011 New Revision: 218779 URL: http://svn.freebsd.org/changeset/base/218779 Log: Just be double-sure short-gi isn't being enabled in 20mhz mode. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 17 17:31:36 2011 (r218778) +++ head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 17 17:35:09 2011 (r218779) @@ -119,8 +119,13 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_RTS_CTS; if (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) series[i].RateFlags |= HAL_RATESERIES_2040; - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20 || - ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + + /* + * The hardware only supports short-gi in 40mhz mode - + * if later hardware supports it in 20mhz mode, be sure + * to add the relevant check here. + */ + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) series[i].RateFlags |= HAL_RATESERIES_HALFGI; /* XXX should this check the short preamble value should be set for legacy rates? -adrian */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 17 19:31: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 D83671065672; Thu, 17 Feb 2011 19:31:21 +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 C68098FC14; Thu, 17 Feb 2011 19:31:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1HJVLqO026800; Thu, 17 Feb 2011 19:31:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1HJVL6k026798; Thu, 17 Feb 2011 19:31:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102171931.p1HJVL6k026798@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 Feb 2011 19:31: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: r218780 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Feb 2011 19:31:21 -0000 Author: marcel Date: Thu Feb 17 19:31:21 2011 New Revision: 218780 URL: http://svn.freebsd.org/changeset/base/218780 Log: Fix the R_ARM_ABS32 relocation implementation. The memory address contains the addend that we need to include. Obtained from: Juniper Networks. Fixed by: Santhanakrishnan Balraj Modified: head/sys/arm/arm/elf_machdep.c Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Thu Feb 17 17:35:09 2011 (r218779) +++ head/sys/arm/arm/elf_machdep.c Thu Feb 17 19:31:21 2011 (r218780) @@ -169,9 +169,7 @@ elf_reloc_internal(linker_file_t lf, Elf addr = lookup(lf, symidx, 1); if (addr == 0) return -1; - if (*where != addr) - *where = addr; - + *where += addr; break; case R_ARM_COPY: /* none */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 01:56: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 EB66F106564A; Fri, 18 Feb 2011 01:56:25 +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 D7EF08FC12; Fri, 18 Feb 2011 01:56:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I1uPAT038338; Fri, 18 Feb 2011 01:56:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I1uPI8038335; Fri, 18 Feb 2011 01:56:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102180156.p1I1uPI8038335@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 01:56: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: r218786 - 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: Fri, 18 Feb 2011 01:56:26 -0000 Author: yongari Date: Fri Feb 18 01:56:25 2011 New Revision: 218786 URL: http://svn.freebsd.org/changeset/base/218786 Log: Always check memory allocation failure. If driver encounter memory allocation error, do not attach driver. Reviewed by: marius Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 00:02:35 2011 (r218785) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 01:56:25 2011 (r218786) @@ -287,11 +287,11 @@ static void dc_reset(struct dc_softc *); static int dc_list_rx_init(struct dc_softc *); static int dc_list_tx_init(struct dc_softc *); -static void dc_read_srom(struct dc_softc *, int); -static void dc_parse_21143_srom(struct dc_softc *); -static void dc_decode_leaf_sia(struct dc_softc *, struct dc_eblock_sia *); -static void dc_decode_leaf_mii(struct dc_softc *, struct dc_eblock_mii *); -static void dc_decode_leaf_sym(struct dc_softc *, struct dc_eblock_sym *); +static int dc_read_srom(struct dc_softc *, int); +static int dc_parse_21143_srom(struct dc_softc *); +static int dc_decode_leaf_sia(struct dc_softc *, struct dc_eblock_sia *); +static int dc_decode_leaf_mii(struct dc_softc *, struct dc_eblock_mii *); +static int dc_decode_leaf_sym(struct dc_softc *, struct dc_eblock_sym *); static void dc_apply_fixup(struct dc_softc *, int); static int dc_check_multiport(struct dc_softc *); @@ -1616,12 +1616,16 @@ dc_apply_fixup(struct dc_softc *sc, int } } -static void +static int dc_decode_leaf_sia(struct dc_softc *sc, struct dc_eblock_sia *l) { struct dc_mediainfo *m; m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO); + if (m == NULL) { + device_printf(sc->dc_dev, "Could not allocate mediainfo\n"); + return (ENOMEM); + } switch (l->dc_sia_code & ~DC_SIA_CODE_EXT) { case DC_SIA_CODE_10BT: m->dc_media = IFM_10_T; @@ -1658,14 +1662,19 @@ dc_decode_leaf_sia(struct dc_softc *sc, sc->dc_mi = m; sc->dc_pmode = DC_PMODE_SIA; + return (0); } -static void +static int dc_decode_leaf_sym(struct dc_softc *sc, struct dc_eblock_sym *l) { struct dc_mediainfo *m; m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO); + if (m == NULL) { + device_printf(sc->dc_dev, "Could not allocate mediainfo\n"); + return (ENOMEM); + } if (l->dc_sym_code == DC_SYM_CODE_100BT) m->dc_media = IFM_100_TX; @@ -1679,15 +1688,20 @@ dc_decode_leaf_sym(struct dc_softc *sc, sc->dc_mi = m; sc->dc_pmode = DC_PMODE_SYM; + return (0); } -static void +static int dc_decode_leaf_mii(struct dc_softc *sc, struct dc_eblock_mii *l) { struct dc_mediainfo *m; u_int8_t *p; m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO); + if (m == NULL) { + device_printf(sc->dc_dev, "Could not allocate mediainfo\n"); + return (ENOMEM); + } /* We abuse IFM_AUTO to represent MII. */ m->dc_media = IFM_AUTO; m->dc_gp_len = l->dc_gpr_len; @@ -1702,24 +1716,30 @@ dc_decode_leaf_mii(struct dc_softc *sc, m->dc_next = sc->dc_mi; sc->dc_mi = m; + return (0); } -static void +static int dc_read_srom(struct dc_softc *sc, int bits) { int size; - size = 2 << bits; + size = DC_ROM_SIZE(bits); sc->dc_srom = malloc(size, M_DEVBUF, M_NOWAIT); + if (sc->dc_srom == NULL) { + device_printf(sc->dc_dev, "Could not allocate SROM buffer\n"); + return (ENOMEM); + } dc_read_eeprom(sc, (caddr_t)sc->dc_srom, 0, (size / 2), 0); + return (0); } -static void +static int dc_parse_21143_srom(struct dc_softc *sc) { struct dc_leaf_hdr *lhdr; struct dc_eblock_hdr *hdr; - int have_mii, i, loff; + int error, have_mii, i, loff; char *ptr; have_mii = 0; @@ -1746,20 +1766,21 @@ dc_parse_21143_srom(struct dc_softc *sc) */ ptr = (char *)lhdr; ptr += sizeof(struct dc_leaf_hdr) - 1; + error = 0; for (i = 0; i < lhdr->dc_mcnt; i++) { hdr = (struct dc_eblock_hdr *)ptr; switch (hdr->dc_type) { case DC_EBLOCK_MII: - dc_decode_leaf_mii(sc, (struct dc_eblock_mii *)hdr); + error = dc_decode_leaf_mii(sc, (struct dc_eblock_mii *)hdr); break; case DC_EBLOCK_SIA: if (! have_mii) - dc_decode_leaf_sia(sc, + error = dc_decode_leaf_sia(sc, (struct dc_eblock_sia *)hdr); break; case DC_EBLOCK_SYM: if (! have_mii) - dc_decode_leaf_sym(sc, + error = dc_decode_leaf_sym(sc, (struct dc_eblock_sym *)hdr); break; default: @@ -1769,6 +1790,7 @@ dc_parse_21143_srom(struct dc_softc *sc) ptr += (hdr->dc_len & 0x7F); ptr++; } + return (error); } static void @@ -1835,6 +1857,7 @@ dc_attach(device_t dev) sc->dc_info = dc_devtype(dev); revision = pci_get_revid(dev); + error = 0; /* Get the eeprom width, but PNIC and XIRCOM have diff eeprom */ if (sc->dc_info->dc_devid != DC_DEVID(DC_VENDORID_LO, DC_DEVICEID_82C168) && @@ -1848,7 +1871,9 @@ dc_attach(device_t dev) sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR; sc->dc_flags |= DC_REDUCED_MII_POLL; /* Save EEPROM contents so we can parse them later. */ - dc_read_srom(sc, sc->dc_romwidth); + error = dc_read_srom(sc, sc->dc_romwidth); + if (error != 0) + goto fail; break; case DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009): case DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9100): @@ -1867,7 +1892,9 @@ dc_attach(device_t dev) sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; - dc_read_srom(sc, sc->dc_romwidth); + error = dc_read_srom(sc, sc->dc_romwidth); + if (error != 0) + goto fail; break; case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN983): case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN985): @@ -1934,6 +1961,12 @@ dc_attach(device_t dev) sc->dc_flags |= DC_TX_STORENFWD | DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_PNIC_RX_BUG_WAR; sc->dc_pnic_rx_buf = malloc(DC_RXLEN * 5, M_DEVBUF, M_NOWAIT); + if (sc->dc_pnic_rx_buf == NULL) { + device_printf(sc->dc_dev, + "Could not allocate PNIC RX buffer\n"); + error = ENOMEM; + goto fail; + } if (revision < DC_REVISION_82C169) sc->dc_pmode = DC_PMODE_SYM; break; @@ -1959,7 +1992,9 @@ dc_attach(device_t dev) sc->dc_flags |= DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_pmode = DC_PMODE_MII; - dc_read_srom(sc, sc->dc_romwidth); + error = dc_read_srom(sc, sc->dc_romwidth); + if (error != 0) + goto fail; break; default: device_printf(dev, "unknown device: %x\n", @@ -1990,9 +2025,11 @@ dc_attach(device_t dev) * The tricky ones are the Macronix/PNIC II and the * Intel 21143. */ - if (DC_IS_INTEL(sc)) - dc_parse_21143_srom(sc); - else if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) { + if (DC_IS_INTEL(sc)) { + error = dc_parse_21143_srom(sc); + if (error != 0) + goto fail; + } else if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) { if (sc->dc_type == DC_TYPE_98713) sc->dc_pmode = DC_PMODE_MII; else Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Fri Feb 18 00:02:35 2011 (r218785) +++ head/sys/dev/dc/if_dcreg.h Fri Feb 18 01:56:25 2011 (r218786) @@ -1064,6 +1064,8 @@ struct dc_softc { * SROM nonsense. */ +#define DC_ROM_SIZE(bits) (2 << (bits)) + #define DC_IB_CTLRCNT 0x13 #define DC_IB_LEAF0_CNUM 0x1A #define DC_IB_LEAF0_OFFSET 0x1B From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 02:14: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 8BD7C106564A; Fri, 18 Feb 2011 02:14:53 +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 5EC988FC18; Fri, 18 Feb 2011 02:14:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I2Er67038793; Fri, 18 Feb 2011 02:14:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I2ErOJ038791; Fri, 18 Feb 2011 02:14:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102180214.p1I2ErOJ038791@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 02:14: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: r218787 - 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: Fri, 18 Feb 2011 02:14:53 -0000 Author: yongari Date: Fri Feb 18 02:14:53 2011 New Revision: 218787 URL: http://svn.freebsd.org/changeset/base/218787 Log: When driver have to use base softc due to lack of SROM on second port, copy SROM information from base softc as well and run SROM parser again. This change is necessary for some dual port controllers to make dc(4) correctly detect PHY media based on first port configuration table. While I'm here add a check for validity of the base softc before duplicating SROM contents from base softc. If driver failed to attach to the first port it can access invalid area. PR: kern/79262 Reviewed by: marius Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 01:56:25 2011 (r218786) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 02:14:53 2011 (r218787) @@ -1815,6 +1815,7 @@ dc_attach(device_t dev) u_int32_t command; struct dc_softc *sc; struct ifnet *ifp; + struct dc_mediainfo *m; u_int32_t reg, revision; int error, i, mac_offset, phy, rid, tmp; u_int8_t *mac; @@ -2108,8 +2109,24 @@ dc_attach(device_t dev) if ((sc->dc_eaddr[0] == 0 && (sc->dc_eaddr[1] & ~0xffff) == 0) || (sc->dc_eaddr[0] == 0xffffffff && (sc->dc_eaddr[1] & 0xffff) == 0xffff)) { - if (dc_check_multiport(sc) == 0) + error = dc_check_multiport(sc); + if (error == 0) { bcopy(sc->dc_eaddr, eaddr, sizeof(eaddr)); + /* Extract media information. */ + if (DC_IS_INTEL(sc) && sc->dc_srom != NULL) { + while (sc->dc_mi != NULL) { + m = sc->dc_mi->dc_next; + free(sc->dc_mi, M_DEVBUF); + sc->dc_mi = m; + } + error = dc_parse_21143_srom(sc); + if (error != 0) + goto fail; + } + } else if (error == ENOMEM) + goto fail; + else + error = 0; } /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ @@ -3875,12 +3892,30 @@ dc_check_multiport(struct dc_softc *sc) continue; if (unit > device_get_unit(sc->dc_dev)) continue; + if (device_is_attached(child) == 0) + continue; dsc = device_get_softc(child); - device_printf(sc->dc_dev, "Using station address of %s as base", + device_printf(sc->dc_dev, + "Using station address of %s as base\n", device_get_nameunit(child)); bcopy(dsc->dc_eaddr, sc->dc_eaddr, ETHER_ADDR_LEN); eaddr = (uint8_t *)sc->dc_eaddr; eaddr[5]++; + /* Prepare SROM to parse again. */ + if (DC_IS_INTEL(sc) && dsc->dc_srom != NULL && + sc->dc_romwidth != 0) { + free(sc->dc_srom, M_DEVBUF); + sc->dc_romwidth = dsc->dc_romwidth; + sc->dc_srom = malloc(DC_ROM_SIZE(sc->dc_romwidth), + M_DEVBUF, M_NOWAIT); + if (sc->dc_srom == NULL) { + device_printf(sc->dc_dev, + "Could not allocate SROM buffer\n"); + return (ENOMEM); + } + bcopy(dsc->dc_srom, sc->dc_srom, + DC_ROM_SIZE(sc->dc_romwidth)); + } return (0); } return (ENOENT); From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 02:58: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 44F33106564A; Fri, 18 Feb 2011 02:58:10 +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 31D788FC08; Fri, 18 Feb 2011 02:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I2wAf4040044; Fri, 18 Feb 2011 02:58:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I2wALe040042; Fri, 18 Feb 2011 02:58:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102180258.p1I2wALe040042@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 02:58: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: r218788 - 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: Fri, 18 Feb 2011 02:58:10 -0000 Author: yongari Date: Fri Feb 18 02:58:09 2011 New Revision: 218788 URL: http://svn.freebsd.org/changeset/base/218788 Log: Apply special PHY initialization code for 21143 controllers before any other media configuration. Otherwise some 21143 controller cannot establish a link. While I'm here remove the PHY initialization code in dc_setcfg(). Since dc_setcfg() is called whenever link state is changed, having the PHY initialization code in dc_setcfg() resulted in continuous link flips. After driver resets SIA, use default SIA transmit/receive configuration instead of disabling autosense/autonegotiation. Otherwise, controller fails to establish a link as well as losing auto-negotiation capability. For manual media configuration, always configure 21143 controller with specified media to ensure media change. This change makes ANA-6922 establish link with/without auto-negotiation. While I'm here be more strict on link UP/DOWN detection logic. Many thanks to marius who fixed several bugs in initial patch and even tested the patch on a couple of dc(4) controllers. PR: kern/79262 Reviewed by: marius Tested by: marius Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 02:14:53 2011 (r218787) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 02:58:09 2011 (r218788) @@ -944,23 +944,45 @@ static void dc_miibus_statchg(device_t dev) { struct dc_softc *sc; + struct ifnet *ifp; struct mii_data *mii; struct ifmedia *ifm; sc = device_get_softc(dev); - if (DC_IS_ADMTEK(sc)) - return; mii = device_get_softc(sc->dc_miibus); + ifp = sc->dc_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + ifm = &mii->mii_media; if (DC_IS_DAVICOM(sc) && IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) { dc_setcfg(sc, ifm->ifm_media); sc->dc_if_media = ifm->ifm_media; - } else { - dc_setcfg(sc, mii->mii_media_active); - sc->dc_if_media = mii->mii_media_active; + return; + } + + sc->dc_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->dc_link = 1; + break; + default: + break; + } } + if (sc->dc_link == 0) + return; + + sc->dc_if_media = mii->mii_media_active; + if (DC_IS_ADMTEK(sc)) + return; + dc_setcfg(sc, mii->mii_media_active); } /* @@ -1404,8 +1426,6 @@ dc_setcfg(struct dc_softc *sc, int media if (!DC_IS_DAVICOM(sc)) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); DC_CLRBIT(sc, DC_10BTCTRL, 0xFFFF); - if (DC_IS_INTEL(sc)) - dc_apply_fixup(sc, IFM_AUTO); } else { if (DC_IS_PNIC(sc)) { DC_PN_GPIO_SETBIT(sc, DC_PN_GPIO_SPEEDSEL); @@ -1415,10 +1435,6 @@ dc_setcfg(struct dc_softc *sc, int media DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PCS); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SCRAMBLER); - if (DC_IS_INTEL(sc)) - dc_apply_fixup(sc, - (media & IFM_GMASK) == IFM_FDX ? - IFM_100_TX | IFM_FDX : IFM_100_TX); } } @@ -1442,8 +1458,6 @@ dc_setcfg(struct dc_softc *sc, int media if (!DC_IS_DAVICOM(sc)) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); DC_CLRBIT(sc, DC_10BTCTRL, 0xFFFF); - if (DC_IS_INTEL(sc)) - dc_apply_fixup(sc, IFM_AUTO); } else { if (DC_IS_PNIC(sc)) { DC_PN_GPIO_CLRBIT(sc, DC_PN_GPIO_SPEEDSEL); @@ -1463,9 +1477,6 @@ dc_setcfg(struct dc_softc *sc, int media DC_SETBIT(sc, DC_SIARESET, DC_SIA_RESET); DC_CLRBIT(sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); - dc_apply_fixup(sc, - (media & IFM_GMASK) == IFM_FDX ? - IFM_10_T | IFM_FDX : IFM_10_T); DELAY(20000); } } @@ -1537,7 +1548,7 @@ dc_reset(struct dc_softc *sc) */ if (DC_IS_INTEL(sc)) { DC_SETBIT(sc, DC_SIARESET, DC_SIA_RESET); - CSR_WRITE_4(sc, DC_10BTCTRL, 0); + CSR_WRITE_4(sc, DC_10BTCTRL, 0xFFFFFFFF); CSR_WRITE_4(sc, DC_WATCHDOG, 0); } } @@ -2963,11 +2974,8 @@ dc_tick(void *xsc) */ if ((DC_HAS_BROKEN_RXSTATE(sc) || (CSR_READ_4(sc, DC_ISR) & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT) && - sc->dc_cdata.dc_tx_cnt == 0) { + sc->dc_cdata.dc_tx_cnt == 0) mii_tick(mii); - if (!(mii->mii_media_status & IFM_ACTIVE)) - sc->dc_link = 0; - } } } else mii_tick(mii); @@ -2991,12 +2999,8 @@ dc_tick(void *xsc) * that time, packets will stay in the send queue, and once the * link comes up, they will be flushed out to the wire. */ - if (!sc->dc_link && mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->dc_link++; - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - dc_start_locked(ifp); - } + if (sc->dc_link != 0 && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + dc_start_locked(ifp); if (sc->dc_flags & DC_21143_NWAY && !sc->dc_link) callout_reset(&sc->dc_stat_ch, hz/10, dc_tick, sc); @@ -3421,6 +3425,7 @@ dc_init_locked(struct dc_softc *sc) { struct ifnet *ifp = sc->dc_ifp; struct mii_data *mii; + struct ifmedia *ifm; DC_LOCK_ASSERT(sc); @@ -3431,6 +3436,10 @@ dc_init_locked(struct dc_softc *sc) */ dc_stop(sc); dc_reset(sc); + if (DC_IS_INTEL(sc)) { + ifm = &mii->mii_media; + dc_apply_fixup(sc, ifm->ifm_media); + } /* * Set cache alignment and burst length. @@ -3574,12 +3583,12 @@ dc_init_locked(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); CSR_WRITE_4(sc, DC_RXSTART, 0xFFFFFFFF); - mii_mediachg(mii); - dc_setcfg(sc, sc->dc_if_media); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + mii_mediachg(mii); + dc_setcfg(sc, sc->dc_if_media); + /* Don't start the ticker if this is a homePNA link. */ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1) sc->dc_link = 1; @@ -3610,7 +3619,9 @@ dc_ifmedia_upd(struct ifnet *ifp) mii_mediachg(mii); ifm = &mii->mii_media; - if (DC_IS_DAVICOM(sc) && + if (DC_IS_INTEL(sc)) + dc_setcfg(sc, ifm->ifm_media); + else if (DC_IS_DAVICOM(sc) && IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) dc_setcfg(sc, ifm->ifm_media); else From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 03:37: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 71153106564A; Fri, 18 Feb 2011 03:37:53 +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 5E94F8FC0A; Fri, 18 Feb 2011 03:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I3brPH041267; Fri, 18 Feb 2011 03:37:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I3brab041264; Fri, 18 Feb 2011 03:37:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102180337.p1I3brab041264@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 03:37: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: r218789 - 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: Fri, 18 Feb 2011 03:37:53 -0000 Author: yongari Date: Fri Feb 18 03:37:53 2011 New Revision: 218789 URL: http://svn.freebsd.org/changeset/base/218789 Log: Remove use case of DC_TX_ONE. It was used to limit queue just 1 TX frame in DM910x controllers. In r67595(more than 10 years ago) it was replaced to use "Store and Forward" mode and made controller generate TX completion interrupt for every frame. Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 02:58:09 2011 (r218788) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 03:37:53 2011 (r218789) @@ -3391,11 +3391,6 @@ dc_start_locked(struct ifnet *ifp) * to him. */ BPF_MTAP(ifp, m_head); - - if (sc->dc_flags & DC_TX_ONE) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } } if (queued > 0) { Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Fri Feb 18 02:58:09 2011 (r218788) +++ head/sys/dev/dc/if_dcreg.h Fri Feb 18 03:37:53 2011 (r218789) @@ -780,7 +780,6 @@ struct dc_softc { #define DC_128BIT_HASH 0x00001000 #define DC_64BIT_HASH 0x00002000 #define DC_TULIP_LEDS 0x00004000 -#define DC_TX_ONE 0x00008000 #define DC_TX_ALIGN 0x00010000 /* align mbuf on tx */ /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 07:37: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 1153C106566C; Fri, 18 Feb 2011 07:37:31 +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 000788FC15; Fri, 18 Feb 2011 07:37:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I7bUq7046747; Fri, 18 Feb 2011 07:37:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I7bU1t046745; Fri, 18 Feb 2011 07:37:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102180737.p1I7bU1t046745@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Feb 2011 07:37: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: r218791 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 07:37:31 -0000 Author: hselasky Date: Fri Feb 18 07:37:30 2011 New Revision: 218791 URL: http://svn.freebsd.org/changeset/base/218791 Log: - Make an enum for all the umidi USB transfers. - Use the USB stack's builtin clear-stall feature. - Wrap some long lines. - Use memcpy() instead of bcopy(). - Use memset() instead of bzero(). - Tested applications: /usr/ports/audio/fluidsynth MFC after: 7 days Approved by: thompsa (mentor) Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri Feb 18 06:42:15 2011 (r218790) +++ head/sys/dev/sound/usb/uaudio.c Fri Feb 18 07:37:30 2011 (r218791) @@ -191,10 +191,15 @@ struct uaudio_chan { uint8_t iface_alt_index; }; -#define UMIDI_N_TRANSFER 4 /* units */ #define UMIDI_CABLES_MAX 16 /* units */ #define UMIDI_BULK_SIZE 1024 /* bytes */ +enum { + UMIDI_TX_TRANSFER, + UMIDI_RX_TRANSFER, + UMIDI_N_TRANSFER, +}; + struct umidi_sub_chan { struct usb_fifo_sc fifo; uint8_t *temp_cmd; @@ -224,10 +229,6 @@ struct umidi_chan { uint8_t iface_index; uint8_t iface_alt_index; - uint8_t flags; -#define UMIDI_FLAG_READ_STALL 0x01 -#define UMIDI_FLAG_WRITE_STALL 0x02 - uint8_t read_open_refcount; uint8_t write_open_refcount; @@ -336,9 +337,7 @@ static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; static usb_callback_t uaudio_chan_record_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; -static usb_callback_t umidi_read_clear_stall_callback; static usb_callback_t umidi_bulk_read_callback; -static usb_callback_t umidi_write_clear_stall_callback; static usb_callback_t umidi_bulk_write_callback; static void uaudio_chan_fill_info_sub(struct uaudio_softc *, @@ -493,7 +492,7 @@ uint8_t umidi_cmd_to_len[16] = { static const struct usb_config umidi_config[UMIDI_N_TRANSFER] = { - [0] = { + [UMIDI_TX_TRANSFER] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -502,7 +501,7 @@ static const struct usb_config .callback = &umidi_bulk_write_callback, }, - [1] = { + [UMIDI_RX_TRANSFER] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -510,26 +509,6 @@ static const struct usb_config .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.proxy_buffer = 1,}, .callback = &umidi_bulk_read_callback, }, - - [2] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .bufsize = sizeof(struct usb_device_request), - .callback = &umidi_write_clear_stall_callback, - .timeout = 1000, /* 1 second */ - .interval = 50, /* 50ms */ - }, - - [3] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .bufsize = sizeof(struct usb_device_request), - .callback = &umidi_read_clear_stall_callback, - .timeout = 1000, /* 1 second */ - .interval = 50, /* 50ms */ - }, }; static devclass_t uaudio_devclass; @@ -1577,10 +1556,10 @@ static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc) { struct uaudio_mixer_node *p_mc_new = - malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK); + malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK); - if (p_mc_new) { - bcopy(mc, p_mc_new, sizeof(*p_mc_new)); + if (p_mc_new != NULL) { + memcpy(p_mc_new, mc, sizeof(*p_mc_new)); p_mc_new->next = sc->sc_mixer_root; sc->sc_mixer_root = p_mc_new; sc->sc_mixer_count++; @@ -1722,7 +1701,7 @@ uaudio_mixer_add_mixer(struct uaudio_sof DPRINTFN(3, "ichs=%d ochs=%d\n", ichs, ochs); - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); uaudio_mixer_determine_class(&iot[id], &mix); @@ -1782,7 +1761,7 @@ uaudio_mixer_add_selector(struct uaudio_ if (d->bNrInPins == 0) { return; } - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); mix.wValue[0] = MAKE_WORD(0, 0); @@ -1852,7 +1831,7 @@ uaudio_mixer_add_feature(struct uaudio_s if (d->bControlSize == 0) { return; } - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); nchan = (d->bLength - 7) / d->bControlSize; mmask = uaudio_mixer_feature_get_bmaControls(d, 0); @@ -1986,7 +1965,7 @@ uaudio_mixer_add_processing_updown(struc DPRINTF("no mode select\n"); return; } - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); mix.nchan = 1; @@ -2012,7 +1991,7 @@ uaudio_mixer_add_processing(struct uaudi struct uaudio_mixer_node mix; uint16_t ptype; - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); ptype = UGETW(d0->wProcessType); @@ -2067,7 +2046,7 @@ uaudio_mixer_add_extension(struct uaudio } if (d1->bmControls[0] & UA_EXT_ENABLE_MASK) { - bzero(&mix, sizeof(mix)); + memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); mix.nchan = 1; @@ -2294,7 +2273,7 @@ uaudio_mixer_get_cluster(uint8_t id, con } error: DPRINTF("bad data\n"); - bzero(&r, sizeof(r)); + memset(&r, 0, sizeof(r)); done: return (r); } @@ -3284,25 +3263,12 @@ uaudio_mixer_setrecsrc(struct uaudio_sof *========================================================================*/ static void -umidi_read_clear_stall_callback(struct usb_xfer *xfer, usb_error_t error) -{ - struct umidi_chan *chan = usbd_xfer_softc(xfer); - struct usb_xfer *xfer_other = chan->xfer[1]; - - if (usbd_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - chan->flags &= ~UMIDI_FLAG_READ_STALL; - usbd_transfer_start(xfer_other); - } -} - -static void umidi_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct umidi_chan *chan = usbd_xfer_softc(xfer); struct umidi_sub_chan *sub; struct usb_page_cache *pc; - uint8_t buf[1]; + uint8_t buf[4]; uint8_t cmd_len; uint8_t cn; uint16_t pos; @@ -3320,57 +3286,47 @@ umidi_bulk_read_callback(struct usb_xfer while (actlen >= 4) { - usbd_copy_out(pc, pos, buf, 1); - - cmd_len = umidi_cmd_to_len[buf[0] & 0xF]; /* command length */ - cn = buf[0] >> 4; /* cable number */ + /* copy out the MIDI data */ + usbd_copy_out(pc, pos, buf, 4); + /* command length */ + cmd_len = umidi_cmd_to_len[buf[0] & 0xF]; + /* cable number */ + cn = buf[0] >> 4; + /* + * Lookup sub-channel. The index is range + * checked below. + */ sub = &chan->sub[cn]; - if (cmd_len && (cn < chan->max_cable) && sub->read_open) { - usb_fifo_put_data(sub->fifo.fp[USB_FIFO_RX], pc, - pos + 1, cmd_len, 1); - } else { - /* ignore the command */ + if ((cmd_len != 0) && + (cn < chan->max_cable) && + (sub->read_open != 0)) { + + /* Send data to the application */ + usb_fifo_put_data_linear( + sub->fifo.fp[USB_FIFO_RX], + buf + 1, cmd_len, 1); } - actlen -= 4; pos += 4; } case USB_ST_SETUP: DPRINTF("start\n"); - - if (chan->flags & UMIDI_FLAG_READ_STALL) { - usbd_transfer_start(chan->xfer[3]); - return; - } +tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); - return; + break; default: DPRINTF("error=%s\n", usbd_errstr(error)); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ - chan->flags |= UMIDI_FLAG_READ_STALL; - usbd_transfer_start(chan->xfer[3]); + usbd_xfer_set_stall(xfer); + goto tr_setup; } - return; - - } -} - -static void -umidi_write_clear_stall_callback(struct usb_xfer *xfer, usb_error_t error) -{ - struct umidi_chan *chan = usbd_xfer_softc(xfer); - struct usb_xfer *xfer_other = chan->xfer[0]; - - if (usbd_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - chan->flags &= ~UMIDI_FLAG_WRITE_STALL; - usbd_transfer_start(xfer_other); + break; } } @@ -3502,6 +3458,8 @@ umidi_convert_to_usb(struct umidi_sub_ch sub->temp_cmd = sub->temp_1; sub->state = UMIDI_ST_SYSEX_0; return (1); + default: + break; } } return (0); @@ -3527,13 +3485,9 @@ umidi_bulk_write_callback(struct usb_xfe DPRINTF("actlen=%d bytes\n", len); case USB_ST_SETUP: - +tr_setup: DPRINTF("start\n"); - if (chan->flags & UMIDI_FLAG_WRITE_STALL) { - usbd_transfer_start(chan->xfer[2]); - return; - } total_length = 0; /* reset */ start_cable = chan->curr_cable; tr_any = 0; @@ -3593,7 +3547,7 @@ umidi_bulk_write_callback(struct usb_xfe usbd_xfer_set_frame_len(xfer, 0, total_length); usbd_transfer_submit(xfer); } - return; + break; default: /* Error */ @@ -3601,11 +3555,10 @@ umidi_bulk_write_callback(struct usb_xfe if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ - chan->flags |= UMIDI_FLAG_WRITE_STALL; - usbd_transfer_start(chan->xfer[2]); + usbd_xfer_set_stall(xfer); + goto tr_setup; } - return; - + break; } } @@ -3635,7 +3588,7 @@ umidi_start_read(struct usb_fifo *fifo) { struct umidi_chan *chan = usb_fifo_softc(fifo); - usbd_transfer_start(chan->xfer[1]); + usbd_transfer_start(chan->xfer[UMIDI_RX_TRANSFER]); } static void @@ -3662,7 +3615,7 @@ umidi_start_write(struct usb_fifo *fifo) { struct umidi_chan *chan = usb_fifo_softc(fifo); - usbd_transfer_start(chan->xfer[0]); + usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]); } static void @@ -3677,8 +3630,7 @@ umidi_stop_write(struct usb_fifo *fifo) if (--(chan->write_open_refcount) == 0) { DPRINTF("(stopping write transfer)\n"); - usbd_transfer_stop(chan->xfer[2]); - usbd_transfer_stop(chan->xfer[0]); + usbd_transfer_stop(chan->xfer[UMIDI_TX_TRANSFER]); } } @@ -3703,7 +3655,7 @@ umidi_open(struct usb_fifo *fifo, int ff } /* clear stall first */ mtx_lock(&chan->mtx); - chan->flags |= UMIDI_FLAG_WRITE_STALL; + usbd_xfer_set_stall(chan->xfer[UMIDI_TX_TRANSFER]); chan->write_open_refcount++; sub->write_open = 1; @@ -3769,7 +3721,8 @@ umidi_probe(device_t dev) DPRINTF("setting of alternate index failed!\n"); goto detach; } - usbd_set_parent_iface(sc->sc_udev, chan->iface_index, sc->sc_mixer_iface_index); + usbd_set_parent_iface(sc->sc_udev, chan->iface_index, + sc->sc_mixer_iface_index); error = usbd_transfer_setup(uaa->device, &chan->iface_index, chan->xfer, umidi_config, UMIDI_N_TRANSFER, @@ -3799,13 +3752,15 @@ umidi_probe(device_t dev) mtx_lock(&chan->mtx); /* clear stall first */ - chan->flags |= UMIDI_FLAG_READ_STALL; + usbd_xfer_set_stall(chan->xfer[UMIDI_RX_TRANSFER]); /* - * NOTE: at least one device will not work properly unless - * the BULK pipe is open all the time. + * NOTE: At least one device will not work properly unless the + * BULK IN pipe is open all the time. This might have to do + * about that the internal queues of the device overflow if we + * don't read them regularly. */ - usbd_transfer_start(chan->xfer[1]); + usbd_transfer_start(chan->xfer[UMIDI_RX_TRANSFER]); mtx_unlock(&chan->mtx); @@ -3828,8 +3783,7 @@ umidi_detach(device_t dev) mtx_lock(&chan->mtx); - usbd_transfer_stop(chan->xfer[3]); - usbd_transfer_stop(chan->xfer[1]); + usbd_transfer_stop(chan->xfer[UMIDI_RX_TRANSFER]); mtx_unlock(&chan->mtx); From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 08:00: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 20D9710656B8; Fri, 18 Feb 2011 08:00:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2CC8FC12; Fri, 18 Feb 2011 08:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I80Rge047728; Fri, 18 Feb 2011 08:00:27 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I80QGt047717; Fri, 18 Feb 2011 08:00:26 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201102180800.p1I80QGt047717@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 18 Feb 2011 08:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218792 - in head: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/modules sys/modules/cxgbe usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 08:00:27 -0000 Author: np Date: Fri Feb 18 08:00:26 2011 New Revision: 218792 URL: http://svn.freebsd.org/changeset/base/218792 Log: cxgbe(4) - NIC driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters. MFC after: 3 weeks Added: head/share/man/man4/cxgbe.4 (contents, props changed) head/sys/dev/cxgbe/ head/sys/dev/cxgbe/adapter.h (contents, props changed) head/sys/dev/cxgbe/common/ head/sys/dev/cxgbe/common/common.h (contents, props changed) head/sys/dev/cxgbe/common/t4_hw.c (contents, props changed) head/sys/dev/cxgbe/common/t4_hw.h (contents, props changed) head/sys/dev/cxgbe/common/t4_msg.h (contents, props changed) head/sys/dev/cxgbe/common/t4_regs.h (contents, props changed) head/sys/dev/cxgbe/common/t4_regs_values.h (contents, props changed) head/sys/dev/cxgbe/common/t4_tcb.h (contents, props changed) head/sys/dev/cxgbe/common/t4fw_interface.h (contents, props changed) head/sys/dev/cxgbe/offload.h (contents, props changed) head/sys/dev/cxgbe/osdep.h (contents, props changed) head/sys/dev/cxgbe/t4_ioctl.h (contents, props changed) head/sys/dev/cxgbe/t4_main.c (contents, props changed) head/sys/dev/cxgbe/t4_sge.c (contents, props changed) head/sys/modules/cxgbe/ head/sys/modules/cxgbe/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/vlan.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/modules/Makefile head/usr.sbin/sysinstall/devices.c Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Feb 18 07:37:30 2011 (r218791) +++ head/share/man/man4/Makefile Fri Feb 18 08:00:26 2011 (r218792) @@ -83,6 +83,7 @@ MAN= aac.4 \ crypto.4 \ cue.4 \ cxgb.4 \ + cxgbe.4 \ cy.4 \ da.4 \ dc.4 \ Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Fri Feb 18 07:37:30 2011 (r218791) +++ head/share/man/man4/altq.4 Fri Feb 18 08:00:26 2011 (r218792) @@ -127,6 +127,7 @@ They have been applied to the following .Xr bfe 4 , .Xr bge 4 , .Xr cas 4 , +.Xr cxgbe 4 , .Xr dc 4 , .Xr de 4 , .Xr ed 4 , Added: head/share/man/man4/cxgbe.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cxgbe.4 Fri Feb 18 08:00:26 2011 (r218792) @@ -0,0 +1,167 @@ +.\" Copyright (c) 2011, Chelsio Inc +.\" 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. +.\" +.\" 3. Neither the name of the Chelsio Inc 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.\" $FreeBSD$ +.\" +.Dd February 14, 2011 +.Dt CXGBE 4 +.Os +.Sh NAME +.Nm cxgbe +.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device cxgbe" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_cxgbe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for PCI Express Ethernet adapters based on +the Chelsio Terminator 4 (T4) ASIC. +The driver supprts Jumbo Frames, Transmit/Receive checksum offload, +TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN +tag insertion/extraction, VLAN checksum offload, VLAN TSO, and +Receive Side Steering (RSS). + +For further hardware information and questions related to hardware +requirements, see +.Pa http://www.chelsio.com/ . +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T420-CR +.It +Chelsio T422-CR +.It +Chelsio T440-CR +.It +Chelsio T420-BCH +.It +Chelsio T440-BCH +.It +Chelsio T440-CH +.It +Chelsio T420-SO +.It +Chelsio T420-CX +.It +Chelsio T420-BT +.It +Chelsio T404-BT +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.cxgbe.max_ntxq_10G_port +The maximum number of tx queues to use for a 10Gb port. +The default value is 8. +.It Va hw.cxgbe.max_nrxq_10G_port +The maximum number of rx queues to use for a 10Gb port. +The default value is 8. +.It Va hw.cxgbe.max_ntxq_1G_port +The maximum number of tx queues to use for a 1Gb port. +The default value is 2. +.It Va hw.cxgbe.max_nrxq_1G_port +The maximum number of rx queues to use for a 1Gb port. +The default value is 2. +.It Va hw.cxgbe.holdoff_timer_idx_10G +.It Va hw.cxgbe.holdoff_timer_idx_1G +The timer index value to use to delay interrupts. +The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 +by default (all values are in microseconds) and the index selects a +value from this list. +The default value is 1 for both 10Gb and 1Gb ports, which means the +timer value is 5us. +.It Va hw.cxgbe.holdoff_pktc_idx_10G +.It Va hw.cxgbe.holdoff_pktc_idx_1G +The packet-count index value to use to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default +and the index selects a value from this list. +The default value is 2 for both 10Gb and 1Gb ports, which means 16 +packets (or the holdoff timer going off) before an interrupt is +generated. +.It Va hw.cxgbe.qsize_txq +The size, in number of entries, of the descriptor ring used for a tx +queue. +A buf_ring of the same size is also allocated for additional +software queuing. See +.Xr ifnet 9 . +The default value is 1024. +.It Va hw.cxgbe.qsize_rxq +The size, in number of entries, of the descriptor ring used for an +rx queue. +The default value is 1024. +.Sh SUPPORT +For general information and support, +go to the Chelsio support website at: +.Pa http://www.chelsio.com/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq support@chelsio.com . +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr cxgb 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.0 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Navdeep Parhar Aq np@FreeBSD.org . Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Fri Feb 18 07:37:30 2011 (r218791) +++ head/share/man/man4/vlan.4 Fri Feb 18 08:00:26 2011 (r218792) @@ -128,6 +128,7 @@ in the hardware is limited to the follow .Xr bce 4 , .Xr bge 4 , .Xr cxgb 4 , +.Xr cxgbe 4 , .Xr em 4 , .Xr igb 4 , .Xr ixgb 4 , Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 18 07:37:30 2011 (r218791) +++ head/sys/conf/NOTES Fri Feb 18 08:00:26 2011 (r218792) @@ -1902,6 +1902,8 @@ device xmphy # XaQti XMAC II # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. +# cxgbe: Support for PCI express 10Gb/1Gb adapters based on the Chelsio T4 +# (Terminator 4) ASIC. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2073,6 +2075,7 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. +device cxgbe # Chelsio T4 10GbE PCIe adapter device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 18 07:37:30 2011 (r218791) +++ head/sys/conf/files Fri Feb 18 08:00:26 2011 (r218792) @@ -853,6 +853,12 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgbe/t4_main.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_sge.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/common/t4_hw.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Feb 18 07:37:30 2011 (r218791) +++ head/sys/conf/kern.pre.mk Fri Feb 18 08:00:26 2011 (r218792) @@ -82,8 +82,8 @@ INCLUDES+= -I$S/dev/twa # ... and XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs -# ... and the same for cxgb -INCLUDES+= -I$S/dev/cxgb +# ... and the same for cxgb and cxgbe +INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe .endif Added: head/sys/dev/cxgbe/adapter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/adapter.h Fri Feb 18 08:00:26 2011 (r218792) @@ -0,0 +1,569 @@ +/*- + * Copyright (c) 2011 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef __T4_ADAPTER_H__ +#define __T4_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "offload.h" +#include "common/t4fw_interface.h" + +#define T4_FWNAME "t4fw" + +MALLOC_DECLARE(M_CXGBE); +#define CXGBE_UNIMPLEMENTED(s) \ + panic("%s (%s, line %d) not implemented yet.", s, __FILE__, __LINE__) + +#if defined(__i386__) || defined(__amd64__) +static __inline void +prefetch(void *x) +{ + __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); +} +#else +#define prefetch(x) +#endif + +#ifdef __amd64__ +/* XXX: need systemwide bus_space_read_8/bus_space_write_8 */ +static __inline uint64_t +t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t offset) +{ + KASSERT(tag == X86_BUS_SPACE_IO, + ("64-bit reads from I/O space not possible.")); + + return (*(volatile uint64_t *)(handle + offset)); +} + +static __inline void +t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, + bus_size_t offset, uint64_t value) +{ + KASSERT(tag == X86_BUS_SPACE_IO, + ("64-bit writes to I/O space not possible.")); + *(volatile uint64_t *)(bsh + offset) = value; +} +#else +static __inline uint64_t +t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return (uint64_t)bus_space_read_4(tag, handle, offset) + + ((uint64_t)bus_space_read_4(tag, handle, offset + 4) << 32); +} + +static __inline void +t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, + bus_size_t offset, uint64_t value) +{ + bus_space_write_4(tag, bsh, offset, value); + bus_space_write_4(tag, bsh, offset + 4, value >> 32); +} +#endif + +struct adapter; +typedef struct adapter adapter_t; + +enum { + FW_IQ_QSIZE = 256, + FW_IQ_ESIZE = 64, /* At least 64 mandated by the firmware spec */ + + RX_IQ_QSIZE = 1024, + RX_IQ_ESIZE = 64, /* At least 64 so CPL_RX_PKT will fit */ + + RX_FL_ESIZE = 64, /* 8 64bit addresses */ + + FL_BUF_SIZES = 4, + + TX_EQ_QSIZE = 1024, + TX_EQ_ESIZE = 64, + TX_SGL_SEGS = 36, + TX_WR_FLITS = SGE_MAX_WR_LEN / 8 +}; + +enum { + /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + FW_OK = (1 << 1), + INTR_FWD = (1 << 2), + + CXGBE_BUSY = (1 << 9), + + /* port flags */ + DOOMED = (1 << 0), + VI_ENABLED = (1 << 1), +}; + +#define IS_DOOMED(pi) (pi->flags & DOOMED) +#define SET_DOOMED(pi) do {pi->flags |= DOOMED;} while (0) +#define IS_BUSY(sc) (sc->flags & CXGBE_BUSY) +#define SET_BUSY(sc) do {sc->flags |= CXGBE_BUSY;} while (0) +#define CLR_BUSY(sc) do {sc->flags &= ~CXGBE_BUSY;} while (0) + +struct port_info { + device_t dev; + struct adapter *adapter; + + struct ifnet *ifp; + struct ifmedia media; + + struct mtx pi_lock; + char lockname[16]; + unsigned long flags; + int if_flags; + + uint16_t viid; + int16_t xact_addr_filt;/* index of exact MAC address filter */ + uint16_t rss_size; /* size of VI's RSS table slice */ + uint8_t lport; /* associated offload logical port */ + int8_t mdio_addr; + uint8_t port_type; + uint8_t mod_type; + uint8_t port_id; + uint8_t tx_chan; + + /* These need to be int as they are used in sysctl */ + int ntxq; /* # of tx queues */ + int first_txq; /* index of first tx queue */ + int nrxq; /* # of rx queues */ + int first_rxq; /* index of first rx queue */ + int tmr_idx; + int pktc_idx; + int qsize_rxq; + int qsize_txq; + + struct link_config link_cfg; + struct port_stats stats; + + struct callout tick; + struct sysctl_ctx_list ctx; /* lives from ifconfig up to down */ + struct sysctl_oid *oid_rxq; + struct sysctl_oid *oid_txq; + + uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ +}; + +struct fl_sdesc { + struct mbuf *m; + bus_dmamap_t map; + caddr_t cl; + uint8_t tag_idx; /* the sc->fl_tag this map comes from */ +#ifdef INVARIANTS + __be64 ba_tag; +#endif +}; + +struct tx_desc { + __be64 flit[8]; +}; + +struct tx_map { + struct mbuf *m; + bus_dmamap_t map; +}; + +struct tx_sdesc { + uint8_t desc_used; /* # of hardware descriptors used by the WR */ + uint8_t map_used; /* # of frames sent out in the WR */ +}; + +typedef void (iq_intr_handler_t)(void *); + +enum { + /* iq flags */ + IQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ + IQ_STARTED = (1 << 2), /* started */ +}; + +/* + * Ingress Queue: T4 is producer, driver is consumer. + */ +struct sge_iq { + bus_dma_tag_t desc_tag; + bus_dmamap_t desc_map; + struct mtx iq_lock; + char lockname[16]; + unsigned int flags; + struct adapter *adapter; + + __be64 *desc; /* KVA of descriptor ring */ + bus_addr_t ba; /* bus address of descriptor ring */ + const __be64 *cdesc; /* current descriptor */ + uint8_t gen; /* generation bit */ + uint8_t intr_params; /* interrupt holdoff parameters */ + int8_t intr_pktc_idx; /* packet count threshold index */ + uint8_t intr_next; /* holdoff for next interrupt */ + uint8_t esize; /* size (bytes) of each entry in the queue */ + uint16_t qsize; /* size (# of entries) of the queue */ + uint16_t cidx; /* consumer index */ + uint16_t cntxt_id; /* SGE context id for the iq */ + uint16_t abs_id; /* absolute SGE id for the iq */ + iq_intr_handler_t *handler; +}; + +enum { + /* eq flags */ + EQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ + EQ_STARTED = (1 << 2), /* started */ + EQ_STALLED = (1 << 3), /* currently stalled */ +}; + +/* + * Egress Queue: driver is producer, T4 is consumer. + * + * Note: A free list is an egress queue (driver produces the buffers and T4 + * consumes them) but it's special enough to have its own struct (see sge_fl). + */ +struct sge_eq { + bus_dma_tag_t tx_tag; /* tag for transmit buffers */ + bus_dma_tag_t desc_tag; + bus_dmamap_t desc_map; + char lockname[16]; + unsigned int flags; + struct mtx eq_lock; + + struct tx_desc *desc; /* KVA of descriptor ring */ + bus_addr_t ba; /* bus address of descriptor ring */ + struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ + struct buf_ring *br; /* tx buffer ring */ + struct sge_qstat *spg; /* status page, for convenience */ + uint16_t cap; /* max # of desc, for convenience */ + uint16_t avail; /* available descriptors, for convenience */ + uint16_t qsize; /* size (# of entries) of the queue */ + uint16_t cidx; /* consumer idx (desc idx) */ + uint16_t pidx; /* producer idx (desc idx) */ + uint16_t pending; /* # of descriptors used since last doorbell */ + uint32_t cntxt_id; /* SGE context id for the eq */ + + /* DMA maps used for tx */ + struct tx_map *maps; + uint32_t map_total; /* # of DMA maps */ + uint32_t map_pidx; /* next map to be used */ + uint32_t map_cidx; /* reclaimed up to this index */ + uint32_t map_avail; /* # of available maps */ +} __aligned(CACHE_LINE_SIZE); + +struct sge_fl { + bus_dma_tag_t desc_tag; + bus_dmamap_t desc_map; + bus_dma_tag_t tag[FL_BUF_SIZES]; + uint8_t tag_idx; + struct mtx fl_lock; + char lockname[16]; + + __be64 *desc; /* KVA of descriptor ring, ptr to addresses */ + bus_addr_t ba; /* bus address of descriptor ring */ + struct fl_sdesc *sdesc; /* KVA of software descriptor ring */ + uint32_t cap; /* max # of buffers, for convenience */ + uint16_t qsize; /* size (# of entries) of the queue */ + uint16_t cntxt_id; /* SGE context id for the freelist */ + uint32_t cidx; /* consumer idx (buffer idx, NOT hw desc idx) */ + uint32_t pidx; /* producer idx (buffer idx, NOT hw desc idx) */ + uint32_t needed; /* # of buffers needed to fill up fl. */ + uint32_t pending; /* # of bufs allocated since last doorbell */ + unsigned int dmamap_failed; +}; + +/* txq: SGE egress queue + miscellaneous items */ +struct sge_txq { + struct sge_eq eq; /* MUST be first */ + struct mbuf *m; /* held up due to temporary resource shortage */ + + /* stats for common events first */ + + uint64_t txcsum; /* # of times hardware assisted with checksum */ + uint64_t tso_wrs; /* # of IPv4 TSO work requests */ + uint64_t vlan_insertion;/* # of times VLAN tag was inserted */ + uint64_t imm_wrs; /* # of work requests with immediate data */ + uint64_t sgl_wrs; /* # of work requests with direct SGL */ + uint64_t txpkt_wrs; /* # of txpkt work requests (not coalesced) */ + uint64_t txpkts_wrs; /* # of coalesced tx work requests */ + uint64_t txpkts_pkts; /* # of frames in coalesced tx work requests */ + + /* stats for not-that-common events */ + + uint32_t no_dmamap; /* no DMA map to load the mbuf */ + uint32_t no_desc; /* out of hardware descriptors */ + uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for txq */ +}; + +enum { + RXQ_LRO_ENABLED = (1 << 0) +}; +/* rxq: SGE ingress queue + SGE free list + miscellaneous items */ +struct sge_rxq { + struct sge_iq iq; /* MUST be first */ + struct sge_fl fl; + + unsigned int flags; + struct port_info *port; /* the port this rxq belongs to */ + struct lro_ctrl lro; /* LRO state */ + + /* stats for common events first */ + + uint64_t rxcsum; /* # of times hardware assisted with checksum */ + uint64_t vlan_extraction;/* # of times VLAN tag was extracted */ + + /* stats for not-that-common events */ + +} __aligned(CACHE_LINE_SIZE); + +struct sge { + uint16_t timer_val[SGE_NTIMERS]; + uint8_t counter_val[SGE_NCOUNTERS]; + + int nrxq; /* total rx queues (all ports and the rest) */ + int ntxq; /* total tx queues (all ports and the rest) */ + int niq; /* total ingress queues */ + int neq; /* total egress queues */ + + struct sge_iq fwq; /* Firmware event queue */ + struct sge_iq *fiq; /* Forwarded interrupt queues (INTR_FWD) */ + struct sge_txq *txq; /* NIC tx queues */ + struct sge_rxq *rxq; /* NIC rx queues */ + + uint16_t iq_start; + int eq_start; + struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ + struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ +}; + +struct adapter { + device_t dev; + struct cdev *cdev; + + /* PCIe register resources */ + int regs_rid; + struct resource *regs_res; + int msix_rid; + struct resource *msix_res; + bus_space_handle_t bh; + bus_space_tag_t bt; + bus_size_t mmio_len; + + unsigned int pf; + unsigned int mbox; + + /* Interrupt information */ + int intr_type; + int intr_count; + struct irq { + struct resource *res; + int rid; + void *tag; + } *irq; + + bus_dma_tag_t dmat; /* Parent DMA tag */ + + struct sge sge; + + struct port_info *port[MAX_NPORTS]; + uint8_t chan_map[NCHAN]; + + struct tid_info tids; + + int registered_device_map; + int open_device_map; + int flags; + + char fw_version[32]; + struct adapter_params params; + struct t4_virt_res vres; + + struct mtx sc_lock; + char lockname[16]; +}; + +#define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) +#define ADAPTER_UNLOCK(sc) mtx_unlock(&(sc)->sc_lock) +#define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) +#define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) + +#define PORT_LOCK(pi) mtx_lock(&(pi)->pi_lock) +#define PORT_UNLOCK(pi) mtx_unlock(&(pi)->pi_lock) +#define PORT_LOCK_ASSERT_OWNED(pi) mtx_assert(&(pi)->pi_lock, MA_OWNED) +#define PORT_LOCK_ASSERT_NOTOWNED(pi) mtx_assert(&(pi)->pi_lock, MA_NOTOWNED) + +#define IQ_LOCK(iq) mtx_lock(&(iq)->iq_lock) +#define IQ_UNLOCK(iq) mtx_unlock(&(iq)->iq_lock) +#define IQ_LOCK_ASSERT_OWNED(iq) mtx_assert(&(iq)->iq_lock, MA_OWNED) +#define IQ_LOCK_ASSERT_NOTOWNED(iq) mtx_assert(&(iq)->iq_lock, MA_NOTOWNED) + +#define FL_LOCK(fl) mtx_lock(&(fl)->fl_lock) +#define FL_TRYLOCK(fl) mtx_trylock(&(fl)->fl_lock) +#define FL_UNLOCK(fl) mtx_unlock(&(fl)->fl_lock) +#define FL_LOCK_ASSERT_OWNED(fl) mtx_assert(&(fl)->fl_lock, MA_OWNED) +#define FL_LOCK_ASSERT_NOTOWNED(fl) mtx_assert(&(fl)->fl_lock, MA_NOTOWNED) + +#define RXQ_LOCK(rxq) IQ_LOCK(&(rxq)->iq) +#define RXQ_UNLOCK(rxq) IQ_UNLOCK(&(rxq)->iq) +#define RXQ_LOCK_ASSERT_OWNED(rxq) IQ_LOCK_ASSERT_OWNED(&(rxq)->iq) +#define RXQ_LOCK_ASSERT_NOTOWNED(rxq) IQ_LOCK_ASSERT_NOTOWNED(&(rxq)->iq) + +#define RXQ_FL_LOCK(rxq) FL_LOCK(&(rxq)->fl) +#define RXQ_FL_UNLOCK(rxq) FL_UNLOCK(&(rxq)->fl) +#define RXQ_FL_LOCK_ASSERT_OWNED(rxq) FL_LOCK_ASSERT_OWNED(&(rxq)->fl) +#define RXQ_FL_LOCK_ASSERT_NOTOWNED(rxq) FL_LOCK_ASSERT_NOTOWNED(&(rxq)->fl) + +#define EQ_LOCK(eq) mtx_lock(&(eq)->eq_lock) +#define EQ_TRYLOCK(eq) mtx_trylock(&(eq)->eq_lock) +#define EQ_UNLOCK(eq) mtx_unlock(&(eq)->eq_lock) +#define EQ_LOCK_ASSERT_OWNED(eq) mtx_assert(&(eq)->eq_lock, MA_OWNED) +#define EQ_LOCK_ASSERT_NOTOWNED(eq) mtx_assert(&(eq)->eq_lock, MA_NOTOWNED) + +#define TXQ_LOCK(txq) EQ_LOCK(&(txq)->eq) +#define TXQ_TRYLOCK(txq) EQ_TRYLOCK(&(txq)->eq) +#define TXQ_UNLOCK(txq) EQ_UNLOCK(&(txq)->eq) +#define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq) +#define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) + +#define for_each_txq(pi, iter, txq) \ + txq = &pi->adapter->sge.txq[pi->first_txq]; \ + for (iter = 0; iter < pi->ntxq; ++iter, ++txq) +#define for_each_rxq(pi, iter, rxq) \ + rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \ + for (iter = 0; iter < pi->nrxq; ++iter, ++rxq) + +#define NFIQ(sc) ((sc)->intr_count > 1 ? (sc)->intr_count - 1 : 1) + +static inline uint32_t +t4_read_reg(struct adapter *sc, uint32_t reg) +{ + return bus_space_read_4(sc->bt, sc->bh, reg); +} + +static inline void +t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val) +{ + bus_space_write_4(sc->bt, sc->bh, reg, val); +} + +static inline uint64_t +t4_read_reg64(struct adapter *sc, uint32_t reg) +{ + return t4_bus_space_read_8(sc->bt, sc->bh, reg); +} + +static inline void +t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val) +{ + t4_bus_space_write_8(sc->bt, sc->bh, reg, val); +} + +static inline void +t4_os_pci_read_cfg1(struct adapter *sc, int reg, uint8_t *val) +{ + *val = pci_read_config(sc->dev, reg, 1); +} + +static inline void +t4_os_pci_write_cfg1(struct adapter *sc, int reg, uint8_t val) +{ + pci_write_config(sc->dev, reg, val, 1); +} + +static inline void +t4_os_pci_read_cfg2(struct adapter *sc, int reg, uint16_t *val) +{ + *val = pci_read_config(sc->dev, reg, 2); +} + +static inline void +t4_os_pci_write_cfg2(struct adapter *sc, int reg, uint16_t val) +{ + pci_write_config(sc->dev, reg, val, 2); +} + +static inline void +t4_os_pci_read_cfg4(struct adapter *sc, int reg, uint32_t *val) +{ + *val = pci_read_config(sc->dev, reg, 4); +} + +static inline void +t4_os_pci_write_cfg4(struct adapter *sc, int reg, uint32_t val) +{ + pci_write_config(sc->dev, reg, val, 4); +} + +static inline struct port_info * +adap2pinfo(struct adapter *sc, int idx) +{ + return (sc->port[idx]); +} + +static inline void +t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[]) +{ + bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN); +} + +static inline bool is_10G_port(const struct port_info *pi) +{ + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); +} + +int t4_os_find_pci_capability(struct adapter *, int); +int t4_os_pci_save_state(struct adapter *); +int t4_os_pci_restore_state(struct adapter *); + +void t4_os_portmod_changed(const struct adapter *, int); +void t4_os_link_changed(struct adapter *, int, int); + +void t4_sge_init(struct adapter *); +int t4_create_dma_tag(struct adapter *); +int t4_destroy_dma_tag(struct adapter *); +int t4_setup_adapter_iqs(struct adapter *); +int t4_teardown_adapter_iqs(struct adapter *); +int t4_setup_eth_queues(struct port_info *); +int t4_teardown_eth_queues(struct port_info *); +void t4_intr_all(void *); +void t4_intr_fwd(void *); +void t4_intr_err(void *); +void t4_intr_evt(void *); +void t4_intr_data(void *); +int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); +void t4_update_fl_bufsize(struct ifnet *); + +#endif Added: head/sys/dev/cxgbe/common/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/common/common.h Fri Feb 18 08:00:26 2011 (r218792) @@ -0,0 +1,517 @@ +/*- + * Copyright (c) 2011 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef __CHELSIO_COMMON_H +#define __CHELSIO_COMMON_H + +#include "t4_hw.h" + + +enum { + MAX_NPORTS = 4, /* max # of ports */ + SERNUM_LEN = 24, /* Serial # length */ + EC_LEN = 16, /* E/C length */ + ID_LEN = 16, /* ID length */ +}; + +enum { MEM_EDC0, MEM_EDC1, MEM_MC }; + +enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; + +enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR }; + +enum { + PAUSE_RX = 1 << 0, + PAUSE_TX = 1 << 1, + PAUSE_AUTONEG = 1 << 2 +}; + +#define FW_VERSION_MAJOR 1 +#define FW_VERSION_MINOR 2 +#define FW_VERSION_MICRO 65 + +struct port_stats { + u64 tx_octets; /* total # of octets in good frames */ + u64 tx_frames; /* all good frames */ + u64 tx_bcast_frames; /* all broadcast frames */ + u64 tx_mcast_frames; /* all multicast frames */ + u64 tx_ucast_frames; /* all unicast frames */ + u64 tx_error_frames; /* all error frames */ + + u64 tx_frames_64; /* # of Tx frames in a particular range */ + u64 tx_frames_65_127; + u64 tx_frames_128_255; + u64 tx_frames_256_511; + u64 tx_frames_512_1023; + u64 tx_frames_1024_1518; + u64 tx_frames_1519_max; + + u64 tx_drop; /* # of dropped Tx frames */ + u64 tx_pause; /* # of transmitted pause frames */ + u64 tx_ppp0; /* # of transmitted PPP prio 0 frames */ + u64 tx_ppp1; /* # of transmitted PPP prio 1 frames */ + u64 tx_ppp2; /* # of transmitted PPP prio 2 frames */ + u64 tx_ppp3; /* # of transmitted PPP prio 3 frames */ + u64 tx_ppp4; /* # of transmitted PPP prio 4 frames */ + u64 tx_ppp5; /* # of transmitted PPP prio 5 frames */ + u64 tx_ppp6; /* # of transmitted PPP prio 6 frames */ + u64 tx_ppp7; /* # of transmitted PPP prio 7 frames */ + + u64 rx_octets; /* total # of octets in good frames */ + u64 rx_frames; /* all good frames */ + u64 rx_bcast_frames; /* all broadcast frames */ + u64 rx_mcast_frames; /* all multicast frames */ + u64 rx_ucast_frames; /* all unicast frames */ + u64 rx_too_long; /* # of frames exceeding MTU */ + u64 rx_jabber; /* # of jabber frames */ + u64 rx_fcs_err; /* # of received frames with bad FCS */ + u64 rx_len_err; /* # of received frames with length error */ + u64 rx_symbol_err; /* symbol errors */ + u64 rx_runt; /* # of short frames */ + + u64 rx_frames_64; /* # of Rx frames in a particular range */ + u64 rx_frames_65_127; + u64 rx_frames_128_255; + u64 rx_frames_256_511; + u64 rx_frames_512_1023; + u64 rx_frames_1024_1518; + u64 rx_frames_1519_max; + + u64 rx_pause; /* # of received pause frames */ + u64 rx_ppp0; /* # of received PPP prio 0 frames */ + u64 rx_ppp1; /* # of received PPP prio 1 frames */ + u64 rx_ppp2; /* # of received PPP prio 2 frames */ + u64 rx_ppp3; /* # of received PPP prio 3 frames */ + u64 rx_ppp4; /* # of received PPP prio 4 frames */ + u64 rx_ppp5; /* # of received PPP prio 5 frames */ + u64 rx_ppp6; /* # of received PPP prio 6 frames */ + u64 rx_ppp7; /* # of received PPP prio 7 frames */ + + u64 rx_ovflow0; /* drops due to buffer-group 0 overflows */ + u64 rx_ovflow1; /* drops due to buffer-group 1 overflows */ + u64 rx_ovflow2; /* drops due to buffer-group 2 overflows */ + u64 rx_ovflow3; /* drops due to buffer-group 3 overflows */ + u64 rx_trunc0; /* buffer-group 0 truncated packets */ + u64 rx_trunc1; /* buffer-group 1 truncated packets */ + u64 rx_trunc2; /* buffer-group 2 truncated packets */ + u64 rx_trunc3; /* buffer-group 3 truncated packets */ +}; + +struct lb_port_stats { + u64 octets; + u64 frames; + u64 bcast_frames; + u64 mcast_frames; + u64 ucast_frames; + u64 error_frames; + + u64 frames_64; + u64 frames_65_127; + u64 frames_128_255; + u64 frames_256_511; + u64 frames_512_1023; + u64 frames_1024_1518; + u64 frames_1519_max; + + u64 drop; + + u64 ovflow0; + u64 ovflow1; + u64 ovflow2; + u64 ovflow3; + u64 trunc0; + u64 trunc1; + u64 trunc2; + u64 trunc3; +}; + +struct tp_tcp_stats { + u32 tcpOutRsts; + u64 tcpInSegs; + u64 tcpOutSegs; + u64 tcpRetransSegs; +}; + +struct tp_usm_stats { + u32 frames; + u32 drops; + u64 octets; +}; + +struct tp_fcoe_stats { + u32 framesDDP; + u32 framesDrop; + u64 octetsDDP; +}; + +struct tp_err_stats { + u32 macInErrs[4]; + u32 hdrInErrs[4]; + u32 tcpInErrs[4]; + u32 tnlCongDrops[4]; + u32 ofldChanDrops[4]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 09:40: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 B57EE106566C; Fri, 18 Feb 2011 09:40:13 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39DC8FC0A; Fri, 18 Feb 2011 09:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1I9eDVg050536; Fri, 18 Feb 2011 09:40:13 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1I9eD29050530; Fri, 18 Feb 2011 09:40:13 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <201102180940.p1I9eD29050530@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Fri, 18 Feb 2011 09:40: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: r218794 - in head: . sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 09:40:13 -0000 Author: vanhu Date: Fri Feb 18 09:40:13 2011 New Revision: 218794 URL: http://svn.freebsd.org/changeset/base/218794 Log: Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant. This will break interoperability with all older versions of FreeBSD for those algorithms. Reviewed by: bz, gnn Obtained from: NETASQ MFC after: 1w Modified: head/UPDATING head/sys/netipsec/key.c head/sys/netipsec/xform.h head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 18 08:38:24 2011 (r218793) +++ head/UPDATING Fri Feb 18 09:40:13 2011 (r218794) @@ -9,6 +9,16 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20110218: + IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 + compliant, and will now use half of hash for authentication. + This will break interoperability with all stacks (including all + actual FreeBSD versions) who implement + draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for + authentication). + The only workaround with such peers is to use another HMAC + algorithm for IPsec ("phase 2") authentication. + NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW: FreeBSD 9.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Feb 18 08:38:24 2011 (r218793) +++ head/sys/netipsec/key.c Fri Feb 18 09:40:13 2011 (r218794) @@ -6095,6 +6095,9 @@ key_getsizes_ah( case SADB_X_AALG_MD5: *min = *max = 16; break; case SADB_X_AALG_SHA: *min = *max = 20; break; case SADB_X_AALG_NULL: *min = 1; *max = 256; break; + case SADB_X_AALG_SHA2_256: *min = *max = 32; break; + case SADB_X_AALG_SHA2_384: *min = *max = 48; break; + case SADB_X_AALG_SHA2_512: *min = *max = 64; break; default: DPRINTF(("%s: unknown AH algorithm %u\n", __func__, alg)); @@ -6120,7 +6123,11 @@ key_getcomb_ah() for (i = 1; i <= SADB_AALG_MAX; i++) { #if 1 /* we prefer HMAC algorithms, not old algorithms */ - if (i != SADB_AALG_SHA1HMAC && i != SADB_AALG_MD5HMAC) + if (i != SADB_AALG_SHA1HMAC && + i != SADB_AALG_MD5HMAC && + i != SADB_X_AALG_SHA2_256 && + i != SADB_X_AALG_SHA2_384 && + i != SADB_X_AALG_SHA2_512) continue; #endif algo = ah_algorithm_lookup(i); Modified: head/sys/netipsec/xform.h ============================================================================== --- head/sys/netipsec/xform.h Fri Feb 18 08:38:24 2011 (r218793) +++ head/sys/netipsec/xform.h Fri Feb 18 09:40:13 2011 (r218794) @@ -46,6 +46,7 @@ #include #define AH_HMAC_HASHLEN 12 /* 96 bits of authenticator */ +#define AH_HMAC_MAXHASHLEN (SHA2_512_HASH_LEN/2) /* Keep this updated */ #define AH_HMAC_INITIAL_RPL 1 /* replay counter initial value */ /* Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Fri Feb 18 08:38:24 2011 (r218793) +++ head/sys/netipsec/xform_ah.c Fri Feb 18 09:40:13 2011 (r218794) @@ -85,8 +85,7 @@ * to use a fixed 16-byte authenticator. The new algorithm use 12-byte * authenticator. */ -#define AUTHSIZE(sav) \ - ((sav->flags & SADB_X_EXT_OLD) ? 16 : AH_HMAC_HASHLEN) +#define AUTHSIZE(sav) ah_authsize(sav) VNET_DEFINE(int, ah_enable) = 1; /* control flow of packets with AH */ VNET_DEFINE(int, ah_cleartos) = 1; /* clear ip_tos when doing AH calc */ @@ -105,6 +104,27 @@ static unsigned char ipseczeroes[256]; / static int ah_input_cb(struct cryptop*); static int ah_output_cb(struct cryptop*); +static int +ah_authsize(struct secasvar *sav) +{ + + IPSEC_ASSERT(sav != NULL, ("%s: sav == NULL", __func__)); + + if (sav->flags & SADB_X_EXT_OLD) + return 16; + + switch (sav->alg_auth) { + case SADB_X_AALG_SHA2_256: + return 16; + case SADB_X_AALG_SHA2_384: + return 24; + case SADB_X_AALG_SHA2_512: + return 32; + default: + return AH_HMAC_HASHLEN; + } + /* NOTREACHED */ +} /* * NB: this is public for use by the PF_KEY support. */ Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Fri Feb 18 08:38:24 2011 (r218793) +++ head/sys/netipsec/xform_esp.c Fri Feb 18 09:40:13 2011 (r218794) @@ -303,7 +303,19 @@ esp_input(struct mbuf *m, struct secasva else hlen = sizeof (struct newesp) + sav->ivlen; /* Authenticator hash size */ - alen = esph ? AH_HMAC_HASHLEN : 0; + if (esph != NULL) { + switch (esph->type) { + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + alen = esph->hashsize/2; + break; + default: + alen = AH_HMAC_HASHLEN; + break; + } + }else + alen = 0; /* * Verify payload length is multiple of encryption algorithm @@ -456,8 +468,8 @@ esp_input(struct mbuf *m, struct secasva static int esp_input_cb(struct cryptop *crp) { - u_int8_t lastthree[3], aalg[AH_HMAC_HASHLEN]; - int hlen, skip, protoff, error; + u_int8_t lastthree[3], aalg[AH_HMAC_MAXHASHLEN]; + int hlen, skip, protoff, error, alen; struct mbuf *m; struct cryptodesc *crd; struct auth_hash *esph; @@ -525,6 +537,16 @@ esp_input_cb(struct cryptop *crp) /* If authentication was performed, check now. */ if (esph != NULL) { + switch (esph->type) { + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + alen = esph->hashsize/2; + break; + default: + alen = AH_HMAC_HASHLEN; + break; + } /* * If we have a tag, it means an IPsec-aware NIC did * the verification for us. Otherwise we need to @@ -533,13 +555,13 @@ esp_input_cb(struct cryptop *crp) V_ahstat.ahs_hist[sav->alg_auth]++; if (mtag == NULL) { /* Copy the authenticator from the packet */ - m_copydata(m, m->m_pkthdr.len - AH_HMAC_HASHLEN, - AH_HMAC_HASHLEN, aalg); + m_copydata(m, m->m_pkthdr.len - alen, + alen, aalg); ptr = (caddr_t) (tc + 1); /* Verify authenticator */ - if (bcmp(ptr, aalg, AH_HMAC_HASHLEN) != 0) { + if (bcmp(ptr, aalg, alen) != 0) { DPRINTF(("%s: " "authentication hash mismatch for packet in SA %s/%08lx\n", __func__, @@ -552,7 +574,7 @@ esp_input_cb(struct cryptop *crp) } /* Remove trailing authenticator */ - m_adj(m, -AH_HMAC_HASHLEN); + m_adj(m, -alen); } /* Release the crypto descriptors */ @@ -696,7 +718,16 @@ esp_output( plen = rlen + padding; /* Padded payload length. */ if (esph) + switch (esph->type) { + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + alen = esph->hashsize/2; + break; + default: alen = AH_HMAC_HASHLEN; + break; + } else alen = 0; @@ -950,7 +981,7 @@ esp_output_cb(struct cryptop *crp) #ifdef REGRESSION /* Emulate man-in-the-middle attack when ipsec_integrity is TRUE. */ if (V_ipsec_integrity) { - static unsigned char ipseczeroes[AH_HMAC_HASHLEN]; + static unsigned char ipseczeroes[AH_HMAC_MAXHASHLEN]; struct auth_hash *esph; /* @@ -959,8 +990,20 @@ esp_output_cb(struct cryptop *crp) */ esph = sav->tdb_authalgxform; if (esph != NULL) { - m_copyback(m, m->m_pkthdr.len - AH_HMAC_HASHLEN, - AH_HMAC_HASHLEN, ipseczeroes); + int alen; + + switch (esph->type) { + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + alen = esph->hashsize/2; + break; + default: + alen = AH_HMAC_HASHLEN; + break; + } + m_copyback(m, m->m_pkthdr.len - alen, + alen, ipseczeroes); } } #endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 13:21: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 334A9106566B; Fri, 18 Feb 2011 13:21:31 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F56D8FC0C; Fri, 18 Feb 2011 13:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IDLVSK059067; Fri, 18 Feb 2011 13:21:31 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IDLVU6059065; Fri, 18 Feb 2011 13:21:31 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <201102181321.p1IDLVU6059065@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Fri, 18 Feb 2011 13:21: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: r218796 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 13:21:31 -0000 Author: vanhu Date: Fri Feb 18 13:21:30 2011 New Revision: 218796 URL: http://svn.freebsd.org/changeset/base/218796 Log: Moved the general note about FreeBSD 9.x at the beginning of the list. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 18 09:47:58 2011 (r218795) +++ head/UPDATING Fri Feb 18 13:21:30 2011 (r218796) @@ -9,16 +9,6 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. -20110218: - IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 - compliant, and will now use half of hash for authentication. - This will break interoperability with all stacks (including all - actual FreeBSD versions) who implement - draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for - authentication). - The only workaround with such peers is to use another HMAC - algorithm for IPsec ("phase 2") authentication. - NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW: FreeBSD 9.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of @@ -32,6 +22,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110218: + IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 + compliant, and will now use half of hash for authentication. + This will break interoperability with all stacks (including all + actual FreeBSD versions) who implement + draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for + authentication). + The only workaround with such peers is to use another HMAC + algorithm for IPsec ("phase 2") authentication. + 20110207: Remove the uio_yield prototype and symbol. This function has been misnamed since it was introduced and should not be From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 13:41: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 7219D1065695; Fri, 18 Feb 2011 13:41:45 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF4D8FC23; Fri, 18 Feb 2011 13:41:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IDfjFL059573; Fri, 18 Feb 2011 13:41:45 GMT (envelope-from osa@svn.freebsd.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IDfjEq059570; Fri, 18 Feb 2011 13:41:45 GMT (envelope-from osa@svn.freebsd.org) Message-Id: <201102181341.p1IDfjEq059570@svn.freebsd.org> From: "Sergey A. Osokin" Date: Fri, 18 Feb 2011 13:41: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: r218797 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 13:41:45 -0000 Author: osa (ports committer) Date: Fri Feb 18 13:41:45 2011 New Revision: 218797 URL: http://svn.freebsd.org/changeset/base/218797 Log: Replace hard-coded value by Julian2Gregorian converter function. Modified: head/usr.bin/calendar/calendar.h head/usr.bin/calendar/paskha.c Modified: head/usr.bin/calendar/calendar.h ============================================================================== --- head/usr.bin/calendar/calendar.h Fri Feb 18 13:21:30 2011 (r218796) +++ head/usr.bin/calendar/calendar.h Fri Feb 18 13:41:45 2011 (r218797) @@ -170,6 +170,7 @@ FILE *opencal(void); /* ostern.c / paskha.c */ int paskha(int); int easter(int); +int j2g(int); /* dates.c */ extern int cumdaytab[][14]; Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Fri Feb 18 13:21:30 2011 (r218796) +++ head/usr.bin/calendar/paskha.c Fri Feb 18 13:41:45 2011 (r218797) @@ -36,6 +36,15 @@ __FBSDID("$FreeBSD$"); #define PASKHA "paskha" #define PASKHALEN (sizeof(PASKHA) - 1) +/* return difference in days between Julian and Gregorian calendars */ +int +j2g(int year) +{ + return (year < 1500) ? + 0 : + 10 + (year/100 - 16) - ((year/100 - 16) / 4); +} + /* return year day for Orthodox Easter using Gauss formula */ /* (new style result) */ @@ -53,5 +62,5 @@ paskha(int R) /*year*/ d = (19 * a + x) % 30; e = (2 * b + 4 * c + 6 * d + y) % 7; cumday = cumdaytab[isleap(R)]; - return (((cumday[3] + 1) + 22) + (d + e) + 13); + return (((cumday[3] + 1) + 22) + (d + e) + j2g(R)); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 14:54: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 07FD5106564A; Fri, 18 Feb 2011 14:54:35 +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 E40A08FC19; Fri, 18 Feb 2011 14:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IEsYOW061542; Fri, 18 Feb 2011 14:54:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IEsYRZ061528; Fri, 18 Feb 2011 14:54:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201102181454.p1IEsYRZ061528@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Feb 2011 14:54: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: r218799 - in head: etc/mtree usr.sbin usr.sbin/bsdinstall usr.sbin/bsdinstall/distextract usr.sbin/bsdinstall/distfetch usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 14:54:35 -0000 Author: nwhitehorn Date: Fri Feb 18 14:54:34 2011 New Revision: 218799 URL: http://svn.freebsd.org/changeset/base/218799 Log: Import bsdinstall. This is meant to be (eventually in conjunction with pc-sysinstall) a replacement for sysinstall in the 9.0 release and beyond. Currently supported platforms are sparc64, pc98, i386, amd64, powerpc, and powerpc64. Integration into the build system will occur in the coming weeks. Merging with pc-sysinstall will use this code as a frontend, while temporarily retaining the interactive partition editor here. This work will be done in parallel with improvements on this code and release integration. Thanks to all who have provided testing and comments! Added: head/usr.sbin/bsdinstall/ head/usr.sbin/bsdinstall/Makefile (contents, props changed) head/usr.sbin/bsdinstall/bsdinstall (contents, props changed) head/usr.sbin/bsdinstall/distextract/ head/usr.sbin/bsdinstall/distextract/Makefile (contents, props changed) head/usr.sbin/bsdinstall/distextract/distextract.c (contents, props changed) head/usr.sbin/bsdinstall/distfetch/ head/usr.sbin/bsdinstall/distfetch/Makefile (contents, props changed) head/usr.sbin/bsdinstall/distfetch/distfetch.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/ head/usr.sbin/bsdinstall/partedit/Makefile (contents, props changed) head/usr.sbin/bsdinstall/partedit/diskeditor.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/diskeditor.h (contents, props changed) head/usr.sbin/bsdinstall/partedit/gpart_ops.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/part_wizard.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit.h (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit_generic.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit_pc98.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c (contents, props changed) head/usr.sbin/bsdinstall/partedit/partedit_x86.c (contents, props changed) head/usr.sbin/bsdinstall/scripts/ head/usr.sbin/bsdinstall/scripts/Makefile (contents, props changed) head/usr.sbin/bsdinstall/scripts/adduser (contents, props changed) head/usr.sbin/bsdinstall/scripts/auto (contents, props changed) head/usr.sbin/bsdinstall/scripts/config (contents, props changed) head/usr.sbin/bsdinstall/scripts/hostname (contents, props changed) head/usr.sbin/bsdinstall/scripts/jail (contents, props changed) head/usr.sbin/bsdinstall/scripts/keymap (contents, props changed) head/usr.sbin/bsdinstall/scripts/mount (contents, props changed) head/usr.sbin/bsdinstall/scripts/netconfig (contents, props changed) head/usr.sbin/bsdinstall/scripts/rootpass (contents, props changed) head/usr.sbin/bsdinstall/scripts/services (contents, props changed) head/usr.sbin/bsdinstall/scripts/time (contents, props changed) head/usr.sbin/bsdinstall/scripts/umount (contents, props changed) head/usr.sbin/bsdinstall/scripts/wlanconfig (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri Feb 18 14:34:33 2011 (r218798) +++ head/etc/mtree/BSD.usr.dist Fri Feb 18 14:54:34 2011 (r218799) @@ -32,6 +32,8 @@ .. .. libexec + bsdinstall + .. lpr ru .. Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Feb 18 14:34:33 2011 (r218798) +++ head/usr.sbin/Makefile Fri Feb 18 14:54:34 2011 (r218799) @@ -7,6 +7,7 @@ SUBDIR= adduser \ arp \ bootparamd \ burncd \ + bsdinstall \ cdcontrol \ chkgrp \ chown \ Added: head/usr.sbin/bsdinstall/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/Makefile Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SUBDIR= distextract distfetch partedit scripts +SCRIPTS= bsdinstall + +.include Added: head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/bsdinstall Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,43 @@ +#!/bin/sh +#- +# Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +: ${DISTRIBUTIONS="kernel.tgz world.tgz"}; export DISTRIBUTIONS +: ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG +: ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC +: ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB +: ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR +: ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT + +VERB=$1; shift + +if [ -z $VERB ]; then + VERB=auto +fi + +exec /usr/libexec/bsdinstall/$VERB $@ + Added: head/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/distextract/Makefile Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +BINDIR= /usr/libexec/bsdinstall +PROG= distextract +LDADD= -larchive -lncursesw -ldialog -lm + +WARNS?= 6 +NO_MAN= true + +.include Added: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,176 @@ +/*- + * Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +static int extract_files(int nfiles, const char **files); + +int +main(void) +{ + char *diststring = strdup(getenv("DISTRIBUTIONS")); + const char **dists; + int i, retval, ndists = 0; + for (i = 0; diststring[i] != 0; i++) + if (isspace(diststring[i]) && !isspace(diststring[i+1])) + ndists++; + ndists++; /* Last one */ + + dists = calloc(ndists, sizeof(const char *)); + for (i = 0; i < ndists; i++) + dists[i] = strsep(&diststring, " \t"); + + chdir(getenv("BSDINSTALL_CHROOT")); + retval = extract_files(ndists, dists); + + free(diststring); + free(dists); + + return (retval); +} + +static int +extract_files(int nfiles, const char **files) +{ + const char *items[nfiles*2]; + char path[PATH_MAX]; + int archive_files[nfiles]; + int total_files, current_files, archive_file; + struct archive *archive; + struct archive_entry *entry; + char errormsg[512]; + char status[8]; + int i, err, progress, last_progress; + + err = 0; + progress = 0; + + /* Make the transfer list for dialog */ + for (i = 0; i < nfiles; i++) { + items[i*2] = strrchr(files[i], '/'); + if (items[i*2] != NULL) + items[i*2]++; + else + items[i*2] = files[i]; + items[i*2 + 1] = "Pending"; + } + + init_dialog(stdin, stdout); + dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); + dlg_put_backtitle(); + dialog_msgbox("", + "Checking distribution archives.\nPlease wait...", 0, 0, FALSE); + + /* Open all the archives */ + total_files = 0; + for (i = 0; i < nfiles; i++) { + archive = archive_read_new(); + archive_read_support_format_all(archive); + archive_read_support_compression_all(archive); + sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), files[i]); + err = archive_read_open_filename(archive, path, 4096); + if (err != ARCHIVE_OK) { + snprintf(errormsg, sizeof(errormsg), + "Error while extracting %s: %s\n", items[i*2], + archive_error_string(archive)); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Extract Error", errormsg, 0, 0, + TRUE); + goto exit; + } + archive_files[i] = 0; + while (archive_read_next_header(archive, &entry) == ARCHIVE_OK) + archive_files[i]++; + total_files += archive_files[i]; + archive_read_free(archive); + } + + current_files = 0; + + for (i = 0; i < nfiles; i++) { + archive = archive_read_new(); + archive_read_support_format_all(archive); + archive_read_support_compression_all(archive); + sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), files[i]); + err = archive_read_open_filename(archive, path, 4096); + + items[i*2 + 1] = "In Progress"; + archive_file = 0; + + while ((err = archive_read_next_header(archive, &entry)) == + ARCHIVE_OK) { + last_progress = progress; + progress = (current_files*100)/total_files; + + sprintf(status, "-%d", + (archive_file*100)/archive_files[i]); + items[i*2 + 1] = status; + + if (progress > last_progress) + dialog_mixedgauge("Archive Extraction", + "Extracting distribution files...", 0, 0, + progress, nfiles, + __DECONST(char **, items)); + + err = archive_read_extract(archive, entry, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_OWNER | + ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | + ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_FFLAGS); + + if (err != ARCHIVE_OK) + break; + + archive_file++; + current_files++; + } + + items[i*2 + 1] = "Done"; + + if (err != ARCHIVE_EOF) { + snprintf(errormsg, sizeof(errormsg), + "Error while extracting %s: %s\n", items[i*2], + archive_error_string(archive)); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Extract Error", errormsg, 0, 0, + TRUE); + goto exit; + } + + archive_read_free(archive); + } + + err = 0; +exit: + end_dialog(); + + return (err); +} Added: head/usr.sbin/bsdinstall/distfetch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/distfetch/Makefile Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +BINDIR= /usr/libexec/bsdinstall +PROG= distfetch +LDADD= -lfetch -lncursesw -ldialog -lm + +WARNS?= 6 +NO_MAN= true + +.include Added: head/usr.sbin/bsdinstall/distfetch/distfetch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/distfetch/distfetch.c Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +static int fetch_files(int nfiles, char **urls); + +int +main(void) +{ + char *diststring = strdup(getenv("DISTRIBUTIONS")); + char **urls; + int i, nfetched, ndists = 0; + for (i = 0; diststring[i] != 0; i++) + if (isspace(diststring[i]) && !isspace(diststring[i+1])) + ndists++; + ndists++; /* Last one */ + + urls = calloc(ndists, sizeof(const char *)); + for (i = 0; i < ndists; i++) { + urls[i] = malloc(PATH_MAX); + sprintf(urls[i], "%s/%s", getenv("BSDINSTALL_DISTSITE"), + strsep(&diststring, " \t")); + } + + chdir(getenv("BSDINSTALL_DISTDIR")); + nfetched = fetch_files(ndists, urls); + + free(diststring); + for (i = 0; i < ndists; i++) + free(urls[i]); + free(urls); + + return ((nfetched == ndists) ? 0 : 1); +} + +static int +fetch_files(int nfiles, char **urls) +{ + const char **items; + FILE *fetch_out, *file_out; + struct url_stat ustat; + off_t total_bytes, current_bytes, fsize; + char status[8]; + char errormsg[512]; + uint8_t block[4096]; + size_t chunk; + int i, progress, last_progress; + int nsuccess = 0; /* Number of files successfully downloaded */ + + progress = 0; + + /* Make the transfer list for dialog */ + items = calloc(sizeof(char *), nfiles * 2); + for (i = 0; i < nfiles; i++) { + items[i*2] = strrchr(urls[i], '/'); + if (items[i*2] != NULL) + items[i*2]++; + else + items[i*2] = urls[i]; + items[i*2 + 1] = "Pending"; + } + + init_dialog(stdin, stdout); + dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); + dlg_put_backtitle(); + + dialog_msgbox("", "Connecting to server.\nPlease wait...", 0, 0, FALSE); + + /* Try to stat all the files */ + total_bytes = 0; + for (i = 0; i < nfiles; i++) { + if (fetchStatURL(urls[i], &ustat, "") == 0 && ustat.size > 0) + total_bytes += ustat.size; + } + + current_bytes = 0; + for (i = 0; i < nfiles; i++) { + last_progress = progress; + if (total_bytes == 0) + progress = (i*100)/nfiles; + + fetchLastErrCode = 0; + fetch_out = fetchXGetURL(urls[i], &ustat, ""); + if (fetch_out == NULL) { + snprintf(errormsg, sizeof(errormsg), + "Error while fetching %s: %s\n", urls[i], + fetchLastErrString); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Fetch Error", errormsg, 0, 0, + TRUE); + continue; + } + + items[i*2 + 1] = "In Progress"; + fsize = 0; + file_out = fopen(items[i*2], "w+"); + if (file_out == NULL) { + snprintf(errormsg, sizeof(errormsg), + "Error while fetching %s: %s\n", + urls[i], strerror(errno)); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Fetch Error", errormsg, 0, 0, + TRUE); + fclose(fetch_out); + continue; + } + + while ((chunk = fread(block, 1, sizeof(block), fetch_out)) + > 0) { + if (fwrite(block, 1, chunk, file_out) < chunk) + break; + + current_bytes += chunk; + fsize += chunk; + + if (total_bytes > 0) { + last_progress = progress; + progress = (current_bytes*100)/total_bytes; + } + + if (ustat.size > 0) { + sprintf(status, "-%jd", (fsize*100)/ustat.size); + items[i*2 + 1] = status; + } + + if (progress > last_progress) + dialog_mixedgauge("Fetching Distribution", + "Fetching distribution files...", 0, 0, + progress, nfiles, + __DECONST(char **, items)); + } + + if (ustat.size > 0 && fsize < ustat.size) { + if (fetchLastErrCode == 0) + snprintf(errormsg, sizeof(errormsg), + "Error while fetching %s: %s\n", + urls[i], strerror(errno)); + else + snprintf(errormsg, sizeof(errormsg), + "Error while fetching %s: %s\n", + urls[i], fetchLastErrString); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Fetch Error", errormsg, 0, 0, + TRUE); + } else { + items[i*2 + 1] = "Done"; + nsuccess++; + } + + fclose(fetch_out); + fclose(file_out); + } + end_dialog(); + + free(items); + return (nsuccess); +} Added: head/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/partedit/Makefile Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +BINDIR= /usr/libexec/bsdinstall +PROG= partedit +LINKS= ${BINDIR}/partedit ${BINDIR}/autopart +LDADD= -lgeom -lncursesw -lutil -ldialog -lm + +PARTEDIT_ARCH= ${MACHINE} +.if ${MACHINE} == "i386" || ${MACHINE} == "amd64" +PARTEDIT_ARCH= x86 +.endif +.if ${MACHINE} == "sun4v" +PARTEDIT_ARCH= sparc64 +.endif +.if !exists(partedit_${PARTEDIT_ARCH}.c) +PARTEDIT_ARCH= generic +.endif + +SRCS= diskeditor.c partedit.c gpart_ops.c partedit_${PARTEDIT_ARCH}.c \ + part_wizard.c + +WARNS?= 3 +NO_MAN= true + +.include Added: head/usr.sbin/bsdinstall/partedit/diskeditor.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/partedit/diskeditor.c Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,261 @@ +/*- + * Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include "diskeditor.h" + +static void +print_partedit_item(WINDOW *partitions, struct partedit_item *items, + int item, int nscroll, int selected) +{ + chtype attr = A_NORMAL; + char sizetext[16]; + int y = item - nscroll + 1; + + wattrset(partitions, selected ? item_selected_attr : item_attr); + wmove(partitions, y, MARGIN + items[item].indentation*2); + dlg_print_text(partitions, items[item].name, 8, &attr); + wmove(partitions, y, 15); + wattrset(partitions, item_attr); + + humanize_number(sizetext, 7, items[item].size, "B", HN_AUTOSCALE, + HN_DECIMAL); + dlg_print_text(partitions, sizetext, 8, &attr); + wmove(partitions, y, 25); + dlg_print_text(partitions, items[item].type, 15, &attr); + wmove(partitions, y, 40); + if (items[item].mountpoint != NULL) + dlg_print_text(partitions, items[item].mountpoint, 8, &attr); +} + +int +diskeditor_show(const char *title, const char *cprompt, + struct partedit_item *items, int nitems, int *selected, int *nscroll) +{ + WINDOW *dialog, *partitions; + char *prompt; + const char *buttons[] = + { "Create", "Delete", "Modify", "Revert", "Auto", "Exit", NULL }; + int x, y; + int i; + int height, width, min_width; + int partlist_height, partlist_width, min_partlist_width; + int cur_scroll = 0; + int key, fkey; + int cur_button = 0, cur_part = 0; + int result = DLG_EXIT_UNKNOWN; + + static DLG_KEYS_BINDING binding[] = { + ENTERKEY_BINDINGS, + DLG_KEYS_DATA( DLGK_ENTER, ' ' ), + DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ), + DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ), + DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), + DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), + DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), + DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), + + SCROLLKEY_BINDINGS, + END_KEYS_BINDING + }; + + /* + * Set up editor window. + */ + prompt = dlg_strclone(cprompt); + + min_width = 50; + height = width = 0; + partlist_height = 10; + min_partlist_width = 0; + dlg_tab_correct_str(prompt); + dlg_button_layout(buttons, &min_width); + dlg_auto_size(title, prompt, &height, &width, 2, min_width); + height += partlist_height; + partlist_width = width - 2*MARGIN; + dlg_print_size(height, width); + dlg_ctl_size(height, width); + + x = dlg_box_x_ordinate(width); + y = dlg_box_y_ordinate(height); + + dialog = dlg_new_window(height, width, y, x); + dlg_register_window(dialog, "diskeditorbox", binding); + dlg_register_buttons(dialog, "diskeditorbox", buttons); + + dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); + dlg_draw_bottom_box(dialog); + dlg_draw_title(dialog, title); + wattrset(dialog, dialog_attr); + + /* Partition list sub-window */ + partitions = dlg_sub_window(dialog, partlist_height, partlist_width, + y + 3, x + 1); + dlg_register_window(partitions, "partlist", binding); + dlg_register_buttons(partitions, "partlist", buttons); + wattrset(partitions, menubox_attr); + + dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, + cur_button, FALSE, width); + dlg_print_autowrap(dialog, prompt, height, width); + + if (selected != NULL) + cur_part = *selected; + if (nscroll != NULL) + cur_scroll = *nscroll; + if (cur_part - cur_scroll >= partlist_height - 2 || + cur_part - cur_scroll < 0) + cur_scroll = cur_part; + +repaint: + dlg_draw_box(dialog, 3, 1, partlist_height, partlist_width, + menubox_border_attr, menubox_attr); + for (i = cur_scroll; i < MIN(cur_scroll + partlist_height - 2, nitems); + i++) + print_partedit_item(partitions, items, i, cur_scroll, + i == cur_part); + if (nitems > partlist_height - 2) + dlg_draw_arrows(partitions, cur_scroll > 0, + nitems > cur_scroll + partlist_height - 2, + partlist_width - 5, 0, partlist_height - 1); + wrefresh(partitions); + + while (result == DLG_EXIT_UNKNOWN) { + key = dlg_mouse_wgetch(dialog, &fkey); + if ((i = dlg_char_to_button(key, buttons)) >= 0) { + cur_button = i; + dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, + cur_button, FALSE, width); + break; + } + + if (!fkey) + continue; + + switch (key) { + case DLGK_FIELD_NEXT: + cur_button = dlg_next_button(buttons, cur_button); + if (cur_button < 0) + cur_button = 0; + dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, + cur_button, FALSE, width); + break; + case DLGK_FIELD_PREV: + cur_button = dlg_prev_button(buttons, cur_button); + if (cur_button < 0) + cur_button = 0; + dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, + cur_button, FALSE, width); + break; + case DLGK_ITEM_NEXT: + if (cur_part == nitems - 1) + break; /* End of list */ + + /* Deselect old item */ + print_partedit_item(partitions, items, cur_part, + cur_scroll, 0); + /* Select new item */ + cur_part++; + if (cur_part - cur_scroll >= partlist_height - 2) { + cur_scroll = cur_part; + goto repaint; + } + print_partedit_item(partitions, items, cur_part, + cur_scroll, 1); + wrefresh(partitions); + break; + case DLGK_ITEM_PREV: + if (cur_part == 0) + break; /* Start of list */ + + /* Deselect old item */ + print_partedit_item(partitions, items, cur_part, + cur_scroll, 0); + /* Select new item */ + cur_part--; + if (cur_part - cur_scroll < 0) { + cur_scroll = cur_part; + goto repaint; + } + print_partedit_item(partitions, items, cur_part, + cur_scroll, 1); + wrefresh(partitions); + break; + case DLGK_PAGE_NEXT: + cur_scroll += (partlist_height - 2); + if (cur_scroll + partlist_height - 2 >= nitems) + cur_scroll = nitems - (partlist_height - 2); + if (cur_part < cur_scroll) + cur_part = cur_scroll; + goto repaint; + case DLGK_PAGE_PREV: + cur_scroll -= (partlist_height - 2); + if (cur_scroll < 0) + cur_scroll = 0; + if (cur_part >= cur_scroll + partlist_height - 2) + cur_part = cur_scroll; + goto repaint; + case DLGK_PAGE_FIRST: + cur_scroll = 0; + cur_part = cur_scroll; + goto repaint; + case DLGK_PAGE_LAST: + cur_scroll = nitems - (partlist_height - 2); + cur_part = cur_scroll; + goto repaint; + case DLGK_ENTER: + goto done; + default: + if (is_DLGK_MOUSE(key)) { + cur_button = key - M_EVENT; + dlg_draw_buttons(dialog, height - 2*MARGIN, 0, + buttons, cur_button, FALSE, width); + goto done; + } + break; + } + } + +done: + if (selected != NULL) + *selected = cur_part; + if (nscroll != NULL) + *nscroll = cur_scroll; + + dlg_del_window(partitions); + dlg_del_window(dialog); + dlg_mouse_free_regions(); + + return (cur_button); +} + Added: head/usr.sbin/bsdinstall/partedit/diskeditor.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/partedit/diskeditor.h Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PARTEDIT_DISKEDITOR_H +#define _PARTEDIT_DISKEDITOR_H + +#include + +struct partedit_item { + int indentation; + const char *name; + intmax_t size; + const char *type; + char *mountpoint; + + void *cookie; +}; + +int diskeditor_show(const char *title, const char *prompt, + struct partedit_item *items, int nitems, int *selected, int *scroll); + +#endif Added: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Feb 18 14:54:34 2011 (r218799) @@ -0,0 +1,1092 @@ +/*- + * Copyright (c) 2011 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "partedit.h" + +#define GPART_FLAGS "x" /* Do not commit changes by default */ + +static void +gpart_show_error(const char *title, const char *explanation, const char *errstr) +{ + char *errmsg; + char message[512]; + int error; + + if (explanation == NULL) + explanation = ""; + + error = strtol(errstr, &errmsg, 0); + if (errmsg != errstr) { + while (errmsg[0] == ' ') + errmsg++; + if (errmsg[0] != '\0') + sprintf(message, "%s%s. %s", explanation, + strerror(error), errmsg); + else + sprintf(message, "%s%s", explanation, strerror(error)); + } else { + sprintf(message, "%s%s", explanation, errmsg); + } + + dialog_msgbox(title, message, 0, 0, TRUE); +} + +int +gpart_partition(const char *lg_name, const char *scheme) +{ + int cancel, choice; + struct gctl_req *r; + const char *errstr; + + DIALOG_LISTITEM items[] = { + {"APM", "Apple Partition Map", + "Bootable on PowerPC Apple Hardware", 0 }, + {"BSD", "BSD Labels", + "Bootable on most x86 systems", 0 }, + {"GPT", "GUID Partition Table", + "Bootable on most x86 systems", 0 }, + {"MBR", "DOS Partitions", + "Bootable on most x86 systems", 0 }, + {"PC98", "NEC PC9801 Partition Table", + "Bootable on NEC PC9801 systems", 0 }, + {"VTOC8", "Sun VTOC8 Partition Table", + "Bootable on Sun SPARC systems", 0 }, + }; + +schememenu: + if (scheme == NULL) { + dialog_vars.default_item = __DECONST(char *, default_scheme()); + cancel = dlg_menu("Partition Scheme", + "Select a partition scheme for this volume:", 0, 0, 0, + sizeof(items) / sizeof(items[0]), items, &choice, NULL); + dialog_vars.default_item = NULL; + + if (cancel) + return (-1); + + if (!is_scheme_bootable(items[choice].name)) { + char message[512]; + sprintf(message, "This partition scheme (%s) is not " + "bootable on this platform. Are you sure you want " + "to proceed?", items[choice].name); + dialog_vars.defaultno = TRUE; + cancel = dialog_yesno("Warning", message, 0, 0); + dialog_vars.defaultno = FALSE; + if (cancel) /* cancel */ + goto schememenu; + } + + scheme = items[choice].name; + } + + r = gctl_get_handle(); + gctl_ro_param(r, "class", -1, "PART"); + gctl_ro_param(r, "arg0", -1, lg_name); + gctl_ro_param(r, "flags", -1, GPART_FLAGS); + gctl_ro_param(r, "scheme", -1, scheme); + gctl_ro_param(r, "verb", -1, "create"); + + errstr = gctl_issue(r); + if (errstr != NULL && errstr[0] != '\0') { + gpart_show_error("Error", NULL, errstr); + gctl_free(r); + scheme = NULL; + goto schememenu; + } + gctl_free(r); + + if (bootcode_path(scheme) != NULL) + get_part_metadata(lg_name, 1)->bootcode = 1; + return (0); +} + +static void +gpart_activate(struct gprovider *pp) +{ + struct gconfig *gc; + struct gctl_req *r; + const char *errstr, *scheme; + const char *attribute = NULL; + intmax_t idx; + + /* + * Some partition schemes need this partition to be marked 'active' + * for it to be bootable. + */ + LIST_FOREACH(gc, &pp->lg_geom->lg_config, lg_config) { + if (strcmp(gc->lg_name, "scheme") == 0) { + scheme = gc->lg_val; + break; + } + } + + if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "EBR") == 0 || + strcmp(scheme, "PC98") == 0) + attribute = "active"; + else + return; + + LIST_FOREACH(gc, &pp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "index") == 0) { + idx = atoi(gc->lg_val); + break; + } + } + + r = gctl_get_handle(); + gctl_ro_param(r, "class", -1, "PART"); + gctl_ro_param(r, "arg0", -1, pp->lg_geom->lg_name); + gctl_ro_param(r, "verb", -1, "set"); + gctl_ro_param(r, "attrib", -1, attribute); + gctl_ro_param(r, "index", sizeof(idx), &idx); + + errstr = gctl_issue(r); + if (errstr != NULL && errstr[0] != '\0') + gpart_show_error("Error", "Error marking partition active:", + errstr); + gctl_free(r); +} + +static void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:00: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 A4FC7106566B; Fri, 18 Feb 2011 15:00:25 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 909D48FC16; Fri, 18 Feb 2011 15:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IF0P4l061796; Fri, 18 Feb 2011 15:00:25 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IF0PK4061793; Fri, 18 Feb 2011 15:00:25 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201102181500.p1IF0PK4061793@svn.freebsd.org> From: Josh Paetzel Date: Fri, 18 Feb 2011 15:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218800 - in head/usr.sbin/pc-sysinstall: backend-partmanager pc-sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 15:00:25 -0000 Author: jpaetzel Date: Fri Feb 18 15:00:25 2011 New Revision: 218800 URL: http://svn.freebsd.org/changeset/base/218800 Log: Add support to pc-sysinstall's create-part feature, to create non MBR type partitions, such as GPT and others. PR: bin/154684 Submitted by: kmoore Approved by: kib (mentor, implicit) Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Fri Feb 18 14:54:34 2011 (r218799) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Fri Feb 18 15:00:25 2011 (r218800) @@ -25,7 +25,7 @@ # # $FreeBSD$ -# Query a disk for partitions and display them +# Create partitions on a target disk ############################# . ${PROGDIR}/backend/functions.sh @@ -47,46 +47,52 @@ fi DISK="${1}" MB="${2}" +TYPE="${3}" +STARTBLOCK="${4}" TOTALBLOCKS="`expr $MB \* 2048`" +# If no TYPE specified, default to MBR +if [ -z "$TYPE" ] ; then TYPE="mbr" ; fi -# Lets figure out what number this slice will be -LASTSLICE="`fdisk -s /dev/${DISK} 2>/dev/null | grep -v ${DISK} | grep ':' | tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +# Sanity check the gpart type +case $TYPE in + apm|APM) ;; + bsd|BSD) ;; + ebr|EBR) ;; + pc98|pc98) ;; + gpt|GPT) ;; + mbr|MBR) ;; + vtoc8|VTOC8) ;; + *) echo "Error: Unknown gpart type: $TYPE" ; exit 1 ;; +esac + +# Lets figure out what number this partition will be +LASTSLICE="`gpart show $DISK | grep -v -e $DISK -e '\- free \-' -e '^$' | awk 'END {print $3}'`" if [ -z "${LASTSLICE}" ] ; then LASTSLICE="1" else LASTSLICE="`expr $LASTSLICE + 1`" fi -if [ ${LASTSLICE} -gt "4" ] ; then - echo "Error: FreeBSD MBR setups can only have a max of 4 slices" - exit 1 -fi - - SLICENUM="${LASTSLICE}" -# Lets get the starting block -if [ "${SLICENUM}" = "1" ] ; then - STARTBLOCK="63" -else - # Lets figure out where the prior slice ends - checkslice="`expr ${SLICENUM} - 1`" - - # Get starting block of this slice - fdisk -s /dev/${DISK} | grep -v "${DISK}:" | grep "${checkslice}:" | tr -s " " >${TMPDIR}/pfdisk - pstartblock="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`" - psize="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`" - STARTBLOCK="`expr ${pstartblock} + ${psize}`" +# Set a 4k Aligned start block if none specified +if [ "${SLICENUM}" = "1" -a -z "$STARTBLOCK" ] ; then + STARTBLOCK="2016" fi -# If this is an empty disk, see if we need to create a new MBR scheme for it +# If this is an empty disk, see if we need to create a new scheme for it gpart show ${DISK} >/dev/null 2>/dev/null if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then - gpart create -s mbr ${DISK} + gpart create -s ${TYPE} ${DISK} +fi + +# If we have a starting block, use it +if [ -z "$STARTBLOCK" ] ; then + sBLOCK="-b $STARTBLOCK" fi -gpart add -b ${STARTBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK} +gpart add ${sBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK} exit "$?" Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Fri Feb 18 14:54:34 2011 (r218799) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Fri Feb 18 15:00:25 2011 (r218800) @@ -125,7 +125,7 @@ case $1 in ;; # The user is wanting to create a new partition - create-part) ${PARTMANAGERDIR}/create-part.sh "${2}" "${3}" + create-part) ${PARTMANAGERDIR}/create-part.sh "${2}" "${3}" "${4}" "${5}" ;; # The user is wanting to delete an existing partition From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:06: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 0D776106564A; Fri, 18 Feb 2011 15:06:36 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8528FC16; Fri, 18 Feb 2011 15:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IF6Zsd061990; Fri, 18 Feb 2011 15:06:35 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IF6Z8Y061988; Fri, 18 Feb 2011 15:06:35 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201102181506.p1IF6Z8Y061988@svn.freebsd.org> From: Josh Paetzel Date: Fri, 18 Feb 2011 15:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218801 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 15:06:36 -0000 Author: jpaetzel Date: Fri Feb 18 15:06:35 2011 New Revision: 218801 URL: http://svn.freebsd.org/changeset/base/218801 Log: Improve pc-sysinstall's localization options to include support for GDM & KDM desktop login managers. PR: bin/154686 Submitted by: kmoore Approved by: kib (mentor, implicit) Modified: head/usr.sbin/pc-sysinstall/backend/functions-localize.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-localize.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-localize.sh Fri Feb 18 15:00:25 2011 (r218800) +++ head/usr.sbin/pc-sysinstall/backend/functions-localize.sh Fri Feb 18 15:06:35 2011 (r218801) @@ -38,25 +38,46 @@ localize_freebsd() rm ${FSMNT}/etc/login.conf.bak }; +localize_x_desktops() { -# Function which localizes a PC-BSD install -localize_pcbsd() -{ - #Change the skel files + # Check for and customize KDE lang ########################################################################## - sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals - sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals - sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals - sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals - #Change KDM Langs + # Check if we can localize KDE via skel + if [ -e "${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals" ] ; then + sed -i '' "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + sed -i '' "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + sed -i '' "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + fi + + # Check if we have a KDE root config + if [ -e "${FSMNT}/root/.kde4/share/config/kdeglobals" ] ; then + sed -i '' "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + fi + + # Check for KDM + if [ -e "${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc" ] ; then + sed -i '' "s/Language=en_US/Language=${LOCALE}.UTF-8/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + fi + + # Check for and customize GNOME / GDM lang ########################################################################## - sed -i.bak "s/Language=en_US/Language=${LOCALE}.UTF-8/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + # See if GDM is enabled and customize its lang + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep "gdm_enable=\"YES\"" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + echo "gdm_lang=\"${LOCALE}.UTF-8\"" >> ${FSMNT}/etc/rc.conf + fi + +}; + +# Function which localizes a PC-BSD install +localize_pcbsd() +{ # Check if we have a localized splash screen and copy it - if [ -e "${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx" ] + if [ -e "${FSMNT}/usr/local/share/pcbsd/splash-screens/loading-screen-${SETLANG}.pcx" ] then - cp ${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx ${FSMNT}/boot/loading-screen.pcx + cp ${FSMNT}/usr/local/share/pcbsd/splash-screens/loading-screen-${SETLANG}.pcx ${FSMNT}/boot/loading-screen.pcx fi }; @@ -117,12 +138,14 @@ localize_x_keyboard() cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile # Save it for KDM - echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup + if [ -e "${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup" ] ; then + echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup + fi fi - - # Create the kxkbrc configuration using these options - echo "[Layout] + # Create the kxkbrc configuration using these options + if [ -d "${FSMNT}/usr/share/skel/.kde4/share/config" ] ; then + echo "[Layout] DisplayNames=${KXLAYOUT}${COUNTRY} IndicatorOnly=false LayoutList=${KXLAYOUT}${KXVAR}${COUNTRY} @@ -133,6 +156,7 @@ ShowFlag=true ShowSingle=false SwitchMode=WinClass Use=true " >${FSMNT}/usr/share/skel/.kde4/share/config/kxkbrc + fi }; @@ -454,7 +478,12 @@ run_localize() then localize_pcbsd "$VAL" fi + + # Localize FreeBSD localize_freebsd "$VAL" + + # Localize any X pkgs + localize_x_desktops "$VAL" fi # Check if we need to do any keylayouts From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:13: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 4F4F01065673; Fri, 18 Feb 2011 15:13:08 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE198FC13; Fri, 18 Feb 2011 15:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IFD86G062193; Fri, 18 Feb 2011 15:13:08 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IFD8tR062191; Fri, 18 Feb 2011 15:13:08 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201102181513.p1IFD8tR062191@svn.freebsd.org> From: Josh Paetzel Date: Fri, 18 Feb 2011 15:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218802 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 15:13:08 -0000 Author: jpaetzel Date: Fri Feb 18 15:13:07 2011 New Revision: 218802 URL: http://svn.freebsd.org/changeset/base/218802 Log: Sort available keyboard layouts to a more sane default. PR: bin/154687 Submitted by: kmoore Approved by: kib (mentor, implicit) Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Fri Feb 18 15:06:35 2011 (r218801) +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Fri Feb 18 15:13:07 2011 (r218802) @@ -26,6 +26,12 @@ # $FreeBSD$ FOUND="0" +TMPLIST="/tmp/.xkeyList.$$" +XLST="/usr/local/share/X11/xkb/rules/xorg.lst" + +if [ ! -e "${XLST}" ] ; then + exit 1 +fi # Lets parse the xorg.list file, and see what layouts are supported while read line @@ -36,9 +42,9 @@ do echo $line | grep '! ' >/dev/null 2>/dev/null if [ "$?" = "0" ] then - exit 0 + break else - echo "$line" + echo "$line" >> ${TMPLIST} fi fi @@ -51,6 +57,13 @@ do fi fi -done < /usr/local/share/X11/xkb/rules/xorg.lst +done < $XLST + +# Display the output, with us English as the first entry +echo "us U.S. English" +sort -b -d +1 $TMPLIST + +# Delete the tmp file +rm $TMPLIST exit 0 From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:23: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 865E31065670; Fri, 18 Feb 2011 15:23:07 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 13C918FC14; Fri, 18 Feb 2011 15:23:07 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9FA63E8150; Fri, 18 Feb 2011 15:23:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=zF5I6E2Wnk0E fBn9HOvKv38Cf/o=; b=gMnP0AU3XKRWi3uLvs9fE501gZfS/ayX/Zg+zmFZZH4j GNicckNW9Ekav6+YKt6RYvHrjTnmo9qeflZIWaTwDswLn1fkRi8uil8JDiZAc2BQ HI9Tdy6tKGTrQlIZOKeNbdaFuVYQMIhESKYKnBRTYxPcorMRn2WzMWoZ7w7mVco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=ojFgzW DBHjr1PCLHgyxeMiEEKTTqMY4iwgQCyxRcIjV/Ir+n92IP1jjbUtSY+CpT8IG4oR irbBIGmEhUdTsp14NoKoSsaJpjmCGHLDY7wMQGiH1gGDfDE/lbXI6RJUNG0Yvhel NQXTuRWmRce3Ez/VTMBYVaknx2oz+1cmrggXI= Received: from unknown (client-86-31-177-138.oxfd.adsl.virginmedia.com [86.31.177.138]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 413D2E80B2; Fri, 18 Feb 2011 15:23:03 +0000 (GMT) Date: Fri, 18 Feb 2011 15:22:42 +0000 From: Bruce Cran To: Josh Paetzel Message-ID: <20110218152242.00001628@unknown> In-Reply-To: <201102181513.p1IFD8tR062191@svn.freebsd.org> References: <201102181513.p1IFD8tR062191@svn.freebsd.org> X-Mailer: Claws Mail 3.7.8cvs9 (GTK+ 2.16.6; i586-pc-mingw32msvc) 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: r218802 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 15:23:07 -0000 On Fri, 18 Feb 2011 15:13:08 +0000 (UTC) Josh Paetzel wrote: > +# Display the output, with us English as the first entry > +echo "us U.S. English" If the default has to be US English, would it be possible to select the entry in the list instead of putting it at the top? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:45: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 00E0E106566B; Fri, 18 Feb 2011 15:45:33 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) by mx1.freebsd.org (Postfix) with ESMTP id D7B4A8FC13; Fri, 18 Feb 2011 15:45:32 +0000 (UTC) Received: from mail.ixsystems.com (localhost [127.0.0.1]) by mail.iXsystems.com (Postfix) with ESMTP id AE879A6643D; Fri, 18 Feb 2011 07:27:16 -0800 (PST) Received: from mail.iXsystems.com ([127.0.0.1]) by mail.ixsystems.com (mail.ixsystems.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 98421-04; Fri, 18 Feb 2011 07:27:16 -0800 (PST) Received: from [192.168.0.196] (96-38-85-215.dhcp.jcsn.tn.charter.com [96.38.85.215]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id 4277CA66409; Fri, 18 Feb 2011 07:27:16 -0800 (PST) Message-ID: <4D5E8FD2.7030507@pcbsd.org> Date: Fri, 18 Feb 2011 10:27:14 -0500 From: Kris Moore User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110128 Thunderbird/3.1.7 MIME-Version: 1.0 To: svn-src-head@freebsd.org, jpaetzel@FreeBSD.org References: <201102181513.p1IFD8tR062191@svn.freebsd.org> <20110218152242.00001628@unknown> In-Reply-To: <20110218152242.00001628@unknown> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r218802 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 15:45:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/18/2011 10:22, Bruce Cran wrote: > On Fri, 18 Feb 2011 15:13:08 +0000 (UTC) > Josh Paetzel wrote: > >> +# Display the output, with us English as the first entry >> +echo "us U.S. English" > > If the default has to be US English, would it be possible to select the > entry in the list instead of putting it at the top? > Yea, we could move that logic to the front-ends instead, not a biggie. I'll get a patch sent over for it soon. - -- Kris Moore PC-BSD Software iXsystems -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNXo/SAAoJEDv6T4U6J2HSlLYH/RafjeiOfiCNFuID5nkbUUyf NTmeEPD1louhKGhb2xRp0GEJrNxm0qFNE32cFMzX/GdWwAbtLLwZqKtBKkvhqOnM rBIAatU2+FaHpotBdd6VE2S6AYwmKcU3Ke+Fb1w7OMWv07695u6p5VbC4ddprqhn 9bX4hxvLIYP8Nl9WHXpouzfBWAFLJ1vlTZZO5jtda7LQVc+yaL46LsYCuoHwPAPZ fqBE7Lw/833Lrxw2gXefOEyqdVOukISwYnl9Cv9ziVVd8pxrFX/Lhr8ZyC3mHi7X pOC1l7DYf11ox6yLhh7IoPZt+2bBvLVAB0o6N4XhxrLDE8CgU6a0ZRN0jNV64dI= =/3MS -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 15:52: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 B7E01106566B; Fri, 18 Feb 2011 15:52:57 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4DFB8FC08; Fri, 18 Feb 2011 15:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IFqvtm063146; Fri, 18 Feb 2011 15:52:57 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IFqvGT063144; Fri, 18 Feb 2011 15:52:57 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201102181552.p1IFqvGT063144@svn.freebsd.org> From: Josh Paetzel Date: Fri, 18 Feb 2011 15:52: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: r218803 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 15:52:57 -0000 Author: jpaetzel Date: Fri Feb 18 15:52:57 2011 New Revision: 218803 URL: http://svn.freebsd.org/changeset/base/218803 Log: Remove US as the default layout in backend, let front-ends decide that Submitted by: kmoore Approved by: kib (mentor, implicit) Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Fri Feb 18 15:13:07 2011 (r218802) +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Fri Feb 18 15:52:57 2011 (r218803) @@ -59,8 +59,6 @@ do done < $XLST -# Display the output, with us English as the first entry -echo "us U.S. English" sort -b -d +1 $TMPLIST # Delete the tmp file From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 17:01: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 76C8B106566C; Fri, 18 Feb 2011 17:01:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63E198FC27; Fri, 18 Feb 2011 17:01:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IH1vUu065596; Fri, 18 Feb 2011 17:01:57 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IH1vqs065592; Fri, 18 Feb 2011 17:01:57 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201102181701.p1IH1vqs065592@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 18 Feb 2011 17:01: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: r218811 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 17:01:57 -0000 Author: ken Date: Fri Feb 18 17:01:57 2011 New Revision: 218811 URL: http://svn.freebsd.org/changeset/base/218811 Log: In the MPS driver, during device removal processing, don't assume that the controller firmware will return all of our commands. Instead, keep track of outstanding I/Os and return them to CAM once device removal processing completes. mpsvar.h: Declare the new "io_list" in the mps_softc. mps.c: Initialize the new "io_list" in the mps softc. mps_sas.c: o Track SCSI I/O requests on the io_list from the time of mpssas_action() through mpssas_scsiio_complete(). o Zero out the request structures used for device removal commands prior to filling them out. o Once the target reset task management function completes during device removal processing, assume any SCSI I/O commands that are still oustanding will never return from the controller, and process them manually. Submitted by: gibbs MFC after: 3 days Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Feb 18 16:29:38 2011 (r218810) +++ head/sys/dev/mps/mps.c Fri Feb 18 17:01:57 2011 (r218811) @@ -898,6 +898,7 @@ mps_attach(struct mps_softc *sc) TAILQ_INIT(&sc->req_list); TAILQ_INIT(&sc->chain_list); TAILQ_INIT(&sc->tm_list); + TAILQ_INIT(&sc->io_list); if (((error = mps_alloc_queues(sc)) != 0) || ((error = mps_alloc_replies(sc)) != 0) || Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Feb 18 16:29:38 2011 (r218810) +++ head/sys/dev/mps/mps_sas.c Fri Feb 18 17:01:57 2011 (r218811) @@ -486,7 +486,10 @@ mpssas_prepare_remove(struct mpssas_soft return; } + mps_dprint(sc, MPS_INFO, "Preparing to remove target %d\n", targ->tid); + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + memset(req, 0, sizeof(*req)); req->DevHandle = targ->handle; req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; @@ -507,6 +510,7 @@ mpssas_remove_device(struct mps_softc *s MPI2_SCSI_TASK_MANAGE_REPLY *reply; MPI2_SAS_IOUNIT_CONTROL_REQUEST *req; struct mpssas_target *targ; + struct mps_command *next_cm; uint16_t handle; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); @@ -523,11 +527,13 @@ mpssas_remove_device(struct mps_softc *s return; } - mps_printf(sc, "Reset aborted %d commands\n", reply->TerminationCount); + mps_dprint(sc, MPS_INFO, "Reset aborted %u commands\n", + reply->TerminationCount); mps_free_reply(sc, cm->cm_reply_data); /* Reuse the existing command */ req = (MPI2_SAS_IOUNIT_CONTROL_REQUEST *)cm->cm_req; + memset(req, 0, sizeof(*req)); req->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; req->Operation = MPI2_SAS_OP_REMOVE_DEVICE; req->DevHandle = handle; @@ -539,6 +545,17 @@ mpssas_remove_device(struct mps_softc *s mps_map_command(sc, cm); mps_dprint(sc, MPS_INFO, "clearing target handle 0x%04x\n", handle); + TAILQ_FOREACH_SAFE(cm, &sc->io_list, cm_link, next_cm) { + union ccb *ccb; + + if (cm->cm_targ->handle != handle) + continue; + + mps_dprint(sc, MPS_INFO, "Completing missed command %p\n", cm); + ccb = cm->cm_complete_data; + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + mpssas_scsiio_complete(sc, cm); + } targ = mpssas_find_target(sc->sassc, 0, handle); if (targ != NULL) { targ->handle = 0x0; @@ -1430,6 +1447,7 @@ mpssas_action_scsiio(struct mpssas_softc cm->cm_complete_data = ccb; cm->cm_targ = targ; + TAILQ_INSERT_TAIL(&sc->io_list, cm, cm_link); callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000, mpssas_scsiio_timeout, cm); @@ -1449,6 +1467,7 @@ mpssas_scsiio_complete(struct mps_softc mps_dprint(sc, MPS_TRACE, "%s\n", __func__); callout_stop(&cm->cm_callout); + TAILQ_REMOVE(&sc->io_list, cm, cm_link); sassc = sc->sassc; ccb = cm->cm_complete_data; @@ -1470,8 +1489,10 @@ mpssas_scsiio_complete(struct mps_softc /* Take the fast path to completion */ if (cm->cm_reply == NULL) { - ccb->ccb_h.status = CAM_REQ_CMP; - ccb->csio.scsi_status = SCSI_STATUS_OK; + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { + ccb->ccb_h.status = CAM_REQ_CMP; + ccb->csio.scsi_status = SCSI_STATUS_OK; + } mps_free_command(sc, cm); xpt_done(ccb); return; Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Fri Feb 18 16:29:38 2011 (r218810) +++ head/sys/dev/mps/mpsvar.h Fri Feb 18 17:01:57 2011 (r218811) @@ -133,6 +133,7 @@ struct mps_softc { TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_chain) chain_list; TAILQ_HEAD(, mps_command) tm_list; + TAILQ_HEAD(, mps_command) io_list; int replypostindex; int replyfreeindex; From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 17:06: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 91DDB106566B; Fri, 18 Feb 2011 17:06:06 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE8D8FC17; Fri, 18 Feb 2011 17:06:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IH66wq065734; Fri, 18 Feb 2011 17:06:06 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IH66Bv065730; Fri, 18 Feb 2011 17:06:06 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201102181706.p1IH66Bv065730@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 18 Feb 2011 17:06: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: r218812 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 17:06:06 -0000 Author: ken Date: Fri Feb 18 17:06:06 2011 New Revision: 218812 URL: http://svn.freebsd.org/changeset/base/218812 Log: Fix several issues with the mps(4) driver. When the driver ran out of DMA chaining buffers, it kept the timeout for the I/O, and I/O would stall. The driver was not freezing the device queue on errors. mps.c: Pull command completion logic into a separate function, and call the callback/wakeup for commands that are never sent due to lack of chain buffers. Add a number of extra diagnostic sysctl variables. Handle pre-hardware errors for configuration I/O. This doesn't panic the system, but it will fail the configuration I/O and there is no retry mechanism. So the device probe will not succeed. This should be a very uncommon situation, however. mps_sas.c: Freeze the SIM queue when we run out of chain buffers, and unfreeze it when more commands complete. Freeze the device queue when errors occur, so that CAM can insure proper command ordering. Report pre-hardware errors for task management commands. In general, that shouldn't be possible because task management commands don't have S/G lists, and that is currently the only error path before we get to the hardware. Handle pre-hardware errors (like out of chain elements) for SMP requests. That shouldn't happen either, since we should have enough space for two S/G elements in the standard request. For commands that end with MPI2_IOCSTATUS_SCSI_IOC_TERMINATED and MPI2_IOCSTATUS_SCSI_EXT_TERMINATED, return them with CAM_REQUEUE_REQ to retry them unconditionally. These seem to be related to back end, transport related problems that are hopefully transient. We don't want to go through the retry count for something that is not a permanent error. Keep track of the number of outstanding I/Os. mpsvar.h: Track the number of free chain elements. Add variables for the number of outstanding I/Os, and I/O high water mark. Add variables to track the number of free chain buffers and the chain low water mark, as well as the number of chain allocation failures. Add I/O state flags and an attach done flag. MFC after: 3 days Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Feb 18 17:01:57 2011 (r218811) +++ head/sys/dev/mps/mps.c Fri Feb 18 17:06:06 2011 (r218812) @@ -62,6 +62,7 @@ static void mps_startup(void *arg); static void mps_startup_complete(struct mps_softc *sc, struct mps_command *cm); static int mps_send_iocinit(struct mps_softc *sc); static int mps_attach_log(struct mps_softc *sc); +static __inline void mps_complete_command(struct mps_command *cm); static void mps_dispatch_event(struct mps_softc *sc, uintptr_t data, MPI2_EVENT_NOTIFICATION_REPLY *reply); static void mps_config_complete(struct mps_softc *sc, struct mps_command *cm); static void mps_periodic(void *); @@ -387,6 +388,15 @@ mps_enqueue_request(struct mps_softc *sc mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + if (sc->mps_flags & MPS_FLAGS_ATTACH_DONE) + mtx_assert(&sc->mps_mtx, MA_OWNED); + + if ((cm->cm_desc.Default.SMID < 1) + || (cm->cm_desc.Default.SMID >= sc->num_reqs)) { + mps_printf(sc, "%s: invalid SMID %d, desc %#x %#x\n", + __func__, cm->cm_desc.Default.SMID, + cm->cm_desc.Words.High, cm->cm_desc.Words.Low); + } mps_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET, cm->cm_desc.Words.Low); mps_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET, @@ -732,6 +742,7 @@ mps_alloc_requests(struct mps_softc *sc) chain->chain_busaddr = sc->chain_busaddr + i * sc->facts->IOCRequestFrameSize * 4; mps_free_chain(sc, chain); + sc->chain_free_lowwater++; } /* XXX Need to pick a more precise value */ @@ -855,6 +866,26 @@ mps_attach(struct mps_softc *sc) &sc->allow_multiple_tm_cmds, 0, "allow multiple simultaneous task management cmds"); + SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "io_cmds_active", CTLFLAG_RD, + &sc->io_cmds_active, 0, "number of currently active commands"); + + SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "io_cmds_highwater", CTLFLAG_RD, + &sc->io_cmds_highwater, 0, "maximum active commands seen"); + + SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "chain_free", CTLFLAG_RD, + &sc->chain_free, 0, "number of free chain elements"); + + SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "chain_free_lowwater", CTLFLAG_RD, + &sc->chain_free_lowwater, 0,"lowest number of free chain elements"); + + SYSCTL_ADD_UQUAD(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "chain_alloc_fail", CTLFLAG_RD, + &sc->chain_alloc_fail, "chain allocation failures"); + if ((error = mps_transition_ready(sc)) != 0) return (error); @@ -895,6 +926,8 @@ mps_attach(struct mps_softc *sc) sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + mps_dprint(sc, MPS_INFO, "num_reqs %d, num_replies %d\n", sc->num_reqs, + sc->num_replies); TAILQ_INIT(&sc->req_list); TAILQ_INIT(&sc->chain_list); TAILQ_INIT(&sc->tm_list); @@ -968,6 +1001,8 @@ mps_attach(struct mps_softc *sc) error = EINVAL; } + sc->mps_flags |= MPS_FLAGS_ATTACH_DONE; + return (error); } @@ -1167,6 +1202,22 @@ mps_free(struct mps_softc *sc) return (0); } +static __inline void +mps_complete_command(struct mps_command *cm) +{ + if (cm->cm_flags & MPS_CM_FLAGS_POLLED) + cm->cm_flags |= MPS_CM_FLAGS_COMPLETE; + + if (cm->cm_complete != NULL) + cm->cm_complete(cm->cm_sc, cm); + + if (cm->cm_flags & MPS_CM_FLAGS_WAKEUP) { + mps_dprint(cm->cm_sc, MPS_TRACE, "%s: waking up %p\n", + __func__, cm); + wakeup(cm); + } +} + void mps_intr(void *data) { @@ -1293,16 +1344,8 @@ mps_intr_locked(void *data) break; } - if (cm != NULL) { - if (cm->cm_flags & MPS_CM_FLAGS_POLLED) - cm->cm_flags |= MPS_CM_FLAGS_COMPLETE; - - if (cm->cm_complete != NULL) - cm->cm_complete(sc, cm); - - if (cm->cm_flags & MPS_CM_FLAGS_WAKEUP) - wakeup(cm); - } + if (cm != NULL) + mps_complete_command(cm); desc->Words.Low = 0xffffffff; desc->Words.High = 0xffffffff; @@ -1663,6 +1706,8 @@ mps_data_cb(void *arg, bus_dma_segment_t if (error != 0) { /* Resource shortage, roll back! */ mps_printf(sc, "out of chain frames\n"); + cm->cm_flags |= MPS_CM_FLAGS_CHAIN_FAILED; + mps_complete_command(cm); return; } } @@ -1802,6 +1847,15 @@ mps_config_complete(struct mps_softc *sc bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); } + /* + * XXX KDM need to do more error recovery? This results in the + * device in question not getting probed. + */ + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + params->status = MPI2_IOCSTATUS_BUSY; + goto bailout; + } + reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; params->status = reply->IOCStatus; if (params->hdr.Ext.ExtPageType != 0) { @@ -1814,6 +1868,8 @@ mps_config_complete(struct mps_softc *sc params->hdr.Struct.PageVersion = reply->Header.PageVersion; } +bailout: + mps_free_command(sc, cm); if (params->callback != NULL) params->callback(sc, params); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Feb 18 17:01:57 2011 (r218811) +++ head/sys/dev/mps/mps_sas.c Fri Feb 18 17:06:06 2011 (r218812) @@ -520,6 +520,18 @@ mpssas_remove_device(struct mps_softc *s mpssas_complete_tm_request(sc, cm, /*free_cm*/ 0); + /* + * Currently there should be no way we can hit this case. It only + * happens when we have a failure to allocate chain frames, and + * task management commands don't have S/G lists. + */ + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + mps_printf(sc, "%s: cm_flags = %#x for remove of handle %#04x! " + "This should not happen!\n", __func__, cm->cm_flags, + handle); + return; + } + if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { mps_printf(sc, "Failure 0x%x reseting device 0x%04x\n", reply->IOCStatus, handle); @@ -1100,6 +1112,17 @@ mpssas_abort_complete(struct mps_softc * req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + /* + * Currently there should be no way we can hit this case. It only + * happens when we have a failure to allocate chain frames, and + * task management commands don't have S/G lists. + */ + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + mps_printf(sc, "%s: cm_flags = %#x for abort on handle %#04x! " + "This should not happen!\n", __func__, cm->cm_flags, + req->DevHandle); + } + mps_printf(sc, "%s: abort request on handle %#04x SMID %d " "complete\n", __func__, req->DevHandle, req->TaskMID); @@ -1216,7 +1239,8 @@ mpssas_tm_complete(struct mps_softc *sc, resp = (MPI2_SCSI_TASK_MANAGE_REPLY *)cm->cm_reply; - resp->ResponseCode = error; + if (resp != NULL) + resp->ResponseCode = error; /* * Call the callback for this command, it will be @@ -1366,6 +1390,7 @@ mpssas_action_scsiio(struct mpssas_softc } req = (MPI2_SCSI_IO_REQUEST *)cm->cm_req; + bzero(req, sizeof(*req)); req->DevHandle = targ->handle; req->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; req->MsgFlags = 0; @@ -1447,6 +1472,10 @@ mpssas_action_scsiio(struct mpssas_softc cm->cm_complete_data = ccb; cm->cm_targ = targ; + sc->io_cmds_active++; + if (sc->io_cmds_active > sc->io_cmds_highwater) + sc->io_cmds_highwater = sc->io_cmds_active; + TAILQ_INSERT_TAIL(&sc->io_list, cm, cm_link); callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000, mpssas_scsiio_timeout, cm); @@ -1468,11 +1497,17 @@ mpssas_scsiio_complete(struct mps_softc callout_stop(&cm->cm_callout); TAILQ_REMOVE(&sc->io_list, cm, cm_link); + sc->io_cmds_active--; sassc = sc->sassc; ccb = cm->cm_complete_data; rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; + /* + * XXX KDM if the chain allocation fails, does it matter if we do + * the sync and unload here? It is simpler to do it in every case, + * assuming it doesn't cause problems. + */ if (cm->cm_data != NULL) { if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; @@ -1482,9 +1517,34 @@ mpssas_scsiio_complete(struct mps_softc bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); } - if (sassc->flags & MPSSAS_QUEUE_FROZEN) { - ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; - sassc->flags &= ~MPSSAS_QUEUE_FROZEN; + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + /* + * We ran into an error after we tried to map the command, + * so we're getting a callback without queueing the command + * to the hardware. So we set the status here, and it will + * be retained below. We'll go through the "fast path", + * because there can be no reply when we haven't actually + * gone out to the hardware. + */ + ccb->ccb_h.status |= CAM_REQUEUE_REQ; + + /* + * Currently the only error included in the mask is + * MPS_CM_FLAGS_CHAIN_FAILED, which means we're out of + * chain frames. We need to freeze the queue until we get + * a command that completed without this error, which will + * hopefully have some chain frames attached that we can + * use. If we wanted to get smarter about it, we would + * only unfreeze the queue in this condition when we're + * sure that we're getting some chain frames back. That's + * probably unnecessary. + */ + if ((sassc->flags & MPSSAS_QUEUE_FROZEN) == 0) { + xpt_freeze_simq(sassc->sim, 1); + sassc->flags |= MPSSAS_QUEUE_FROZEN; + mps_printf(sc, "Error sending command, freezing " + "SIM queue\n"); + } } /* Take the fast path to completion */ @@ -1492,6 +1552,15 @@ mpssas_scsiio_complete(struct mps_softc if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { ccb->ccb_h.status = CAM_REQ_CMP; ccb->csio.scsi_status = SCSI_STATUS_OK; + + if (sassc->flags & MPSSAS_QUEUE_FROZEN) { + ccb->ccb_h.status |= CAM_RELEASE_SIMQ; + sassc->flags &= ~MPSSAS_QUEUE_FROZEN; + mps_printf(sc, "Unfreezing SIM queue\n"); + } + } else { + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, /*count*/ 1); } mps_free_command(sc, cm); xpt_done(ccb); @@ -1547,7 +1616,16 @@ mpssas_scsiio_complete(struct mps_softc break; case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: +#if 0 ccb->ccb_h.status = CAM_REQ_ABORTED; +#endif + mps_printf(sc, "(%d:%d:%d) terminated ioc %x scsi %x state %x " + "xfer %u\n", xpt_path_path_id(ccb->ccb_h.path), + xpt_path_target_id(ccb->ccb_h.path), + xpt_path_lun_id(ccb->ccb_h.path), + rep->IOCStatus, rep->SCSIStatus, rep->SCSIState, + rep->TransferCount); + ccb->ccb_h.status = CAM_REQUEUE_REQ; break; case MPI2_IOCSTATUS_INVALID_SGL: mps_print_scsiio_cmd(sc, cm); @@ -1601,6 +1679,15 @@ mpssas_scsiio_complete(struct mps_softc if (rep->SCSIState & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) ccb->ccb_h.status = CAM_REQ_CMP_ERR; + if (sassc->flags & MPSSAS_QUEUE_FROZEN) { + ccb->ccb_h.status |= CAM_RELEASE_SIMQ; + sassc->flags &= ~MPSSAS_QUEUE_FROZEN; + mps_printf(sc, "Command completed, unfreezing SIM queue\n"); + } + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, /*count*/ 1); + } mps_free_command(sc, cm); xpt_done(ccb); } @@ -1615,6 +1702,20 @@ mpssas_smpio_complete(struct mps_softc * union ccb *ccb; ccb = cm->cm_complete_data; + + /* + * Currently there should be no way we can hit this case. It only + * happens when we have a failure to allocate chain frames, and SMP + * commands require two S/G elements only. That should be handled + * in the standard request size. + */ + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + mps_printf(sc, "%s: cm_flags = %#x on SMP request!\n", + __func__, cm->cm_flags); + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + goto bailout; + } + rpl = (MPI2_SMP_PASSTHROUGH_REPLY *)cm->cm_reply; if (rpl == NULL) { mps_dprint(sc, MPS_INFO, "%s: NULL cm_reply!\n", __func__); @@ -1994,6 +2095,19 @@ mpssas_resetdev_complete(struct mps_soft resp = (MPI2_SCSI_TASK_MANAGE_REPLY *)cm->cm_reply; ccb = cm->cm_complete_data; + if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { + MPI2_SCSI_TASK_MANAGE_REQUEST *req; + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + + mps_printf(sc, "%s: cm_flags = %#x for reset of handle %#04x! " + "This should not happen!\n", __func__, cm->cm_flags, + req->DevHandle); + + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + goto bailout; + } + printf("resetdev complete IOCStatus= 0x%x ResponseCode= 0x%x\n", resp->IOCStatus, resp->ResponseCode); @@ -2002,6 +2116,7 @@ mpssas_resetdev_complete(struct mps_soft else ccb->ccb_h.status = CAM_REQ_CMP_ERR; +bailout: mpssas_complete_tm_request(sc, cm, /*free_cm*/ 1); xpt_done(ccb); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Fri Feb 18 17:01:57 2011 (r218811) +++ head/sys/dev/mps/mpsvar.h Fri Feb 18 17:06:06 2011 (r218812) @@ -92,6 +92,8 @@ struct mps_command { #define MPS_CM_FLAGS_ACTIVE (1 << 6) #define MPS_CM_FLAGS_USE_UIO (1 << 7) #define MPS_CM_FLAGS_SMP_PASS (1 << 8) +#define MPS_CM_FLAGS_CHAIN_FAILED (1 << 9) +#define MPS_CM_FLAGS_ERROR_MASK MPS_CM_FLAGS_CHAIN_FAILED u_int cm_state; #define MPS_CM_STATE_FREE 0 #define MPS_CM_STATE_BUSY 1 @@ -119,9 +121,15 @@ struct mps_softc { #define MPS_FLAGS_MSI (1 << 1) #define MPS_FLAGS_BUSY (1 << 2) #define MPS_FLAGS_SHUTDOWN (1 << 3) +#define MPS_FLAGS_ATTACH_DONE (1 << 4) u_int mps_debug; u_int allow_multiple_tm_cmds; int tm_cmds_active; + int io_cmds_active; + int io_cmds_highwater; + int chain_free; + int chain_free_lowwater; + uint64_t chain_alloc_fail; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct mps_command *commands; @@ -229,8 +237,13 @@ mps_alloc_chain(struct mps_softc *sc) { struct mps_chain *chain; - if ((chain = TAILQ_FIRST(&sc->chain_list)) != NULL) + if ((chain = TAILQ_FIRST(&sc->chain_list)) != NULL) { TAILQ_REMOVE(&sc->chain_list, chain, chain_link); + sc->chain_free--; + if (sc->chain_free < sc->chain_free_lowwater) + sc->chain_free_lowwater = sc->chain_free; + } else + sc->chain_alloc_fail++; return (chain); } @@ -240,6 +253,7 @@ mps_free_chain(struct mps_softc *sc, str #if 0 bzero(chain->chain, 128); #endif + sc->chain_free++; TAILQ_INSERT_TAIL(&sc->chain_list, chain, chain_link); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 17:43: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 12E2A1065670; Fri, 18 Feb 2011 17:43:23 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001DF8FC1A; Fri, 18 Feb 2011 17:43:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IHhMop066778; Fri, 18 Feb 2011 17:43:22 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IHhMRu066776; Fri, 18 Feb 2011 17:43:22 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <201102181743.p1IHhMRu066776@svn.freebsd.org> From: Daniel Gerzo Date: Fri, 18 Feb 2011 17:43: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: r218815 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 17:43:23 -0000 Author: danger (doc committer) Date: Fri Feb 18 17:43:22 2011 New Revision: 218815 URL: http://svn.freebsd.org/changeset/base/218815 Log: - add missing if_ devices which were missing and are available as loadable modules too Reviewed by: brucec Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Fri Feb 18 17:42:29 2011 (r218814) +++ head/sys/boot/forth/loader.conf Fri Feb 18 17:43:22 2011 (r218815) @@ -252,6 +252,7 @@ pf_load="NO" # packet filter ### Networking drivers ##################################### ############################################################## +bridgestp_load="NO" # if_bridge(4) support miibus_load="NO" # miibus support, needed for some drivers if_ae_load="NO" # Attansic/Atheros L2 FastEthernet if_age_load="NO" # Attansic/Atheros L1 Gigabit Ethernet @@ -264,8 +265,10 @@ if_axe_load="NO" # ASIX Electronics AX8 if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_bridge_load="NO" # if_bridge(4) devices if_bwi_load="NO" # Broadcom BCM53xx IEEE 802.11b/g wireness NICs if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs +if_carp_load="NO" # carp(4) devices if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 @@ -296,6 +299,7 @@ if_iwn_load="NO" # Intel Wireless WiFi if_ixgb_load="NO" # Intel PRO/10Gb Ethernet if_ixgbe_load="NO" # Intel PRO/10Gb Ethernet PCI Express if_jme_load="NO" # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +if_lagg_load="NO" # lagg(4) devices if_le_load="NO" # AMD Am7900 LANCE and Am79C9xx PCnet if_lge_load="NO" # Level 1 LXT1001 NetCellerator PCI Gigabit # Ethernet From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 19:07: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 C8951106564A; Fri, 18 Feb 2011 19:07:16 +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 9ABDD8FC15; Fri, 18 Feb 2011 19:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IJ7GTF068937; Fri, 18 Feb 2011 19:07:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IJ7GdP068935; Fri, 18 Feb 2011 19:07:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201102181907.p1IJ7GdP068935@svn.freebsd.org> From: Xin LI Date: Fri, 18 Feb 2011 19:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218816 - head/tools/tools/nanobsd/Files/root X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 19:07:16 -0000 Author: delphij Date: Fri Feb 18 19:07:16 2011 New Revision: 218816 URL: http://svn.freebsd.org/changeset/base/218816 Log: Add a helper script that detects which partition we are on and update the other. MFC after: 1 month Obtained from: FreeNAS Sponsored by: iXsystems, Inc. Added: head/tools/tools/nanobsd/Files/root/update (contents, props changed) Added: head/tools/tools/nanobsd/Files/root/update ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/Files/root/update Fri Feb 18 19:07:16 2011 (r218816) @@ -0,0 +1,44 @@ +#!/bin/sh +# +# Copyright (c) 2011 iXsystems, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +# Script to update a NanoBSD system. +# +# usage: +# ssh somewhere cat image.s1 | sh update +# + +set -e + +. /etc/nanobsd.conf + +if mount | grep ${NANO_DRIVE}s1 > /dev/null ; then + exec sh /root/updatep2 +else + exec sh /root/updatep1 +fi + From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 20:30: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 C9132106564A; Fri, 18 Feb 2011 20:30:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51608FC0A; Fri, 18 Feb 2011 20:30:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IKUwtV071161; Fri, 18 Feb 2011 20:30:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IKUwWH071159; Fri, 18 Feb 2011 20:30:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201102182030.p1IKUwWH071159@svn.freebsd.org> From: Michael Tuexen Date: Fri, 18 Feb 2011 20:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218818 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 20:30:58 -0000 Author: tuexen Date: Fri Feb 18 20:30:58 2011 New Revision: 218818 URL: http://svn.freebsd.org/changeset/base/218818 Log: Bugfix: Get per vnet sysctl variables and statistics working. MFC after:3 months. Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Feb 18 20:25:30 2011 (r218817) +++ head/sys/netinet/sctp_sysctl.c Fri Feb 18 20:30:58 2011 (r218818) @@ -566,7 +566,11 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) { int error; +#ifdef VIMAGE + error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#else error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#endif if (error == 0) { RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); @@ -828,301 +832,298 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_INIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_FRMAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); -/* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_SS_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); #if defined(SCTP_LOCAL_TRACE_BUF) -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); - - - #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); -#endif /* SCTP_DEBUG */ +#endif #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif + #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, CTLTYPE_STRUCT | CTLFLAG_RW, 0, 0, sysctl_stat_get, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); #else -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, &SCTP_BASE_STATS_SYSCTL, sctpstat, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 20:37: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 4108A106564A; Fri, 18 Feb 2011 20:37:10 +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 2E6F88FC1D; Fri, 18 Feb 2011 20:37:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IKbAsX071449; Fri, 18 Feb 2011 20:37:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IKbAg2071446; Fri, 18 Feb 2011 20:37:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102182037.p1IKbAg2071446@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 18 Feb 2011 20:37: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: r218819 - in head/tools/regression/bin/sh: builtins expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 20:37:10 -0000 Author: jilles Date: Fri Feb 18 20:37:09 2011 New Revision: 218819 URL: http://svn.freebsd.org/changeset/base/218819 Log: sh: Unset some more locale vars in two tests that may cause them to break. Modified: head/tools/regression/bin/sh/builtins/locale1.0 head/tools/regression/bin/sh/expansion/cmdsubst3.0 Modified: head/tools/regression/bin/sh/builtins/locale1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/locale1.0 Fri Feb 18 20:30:58 2011 (r218818) +++ head/tools/regression/bin/sh/builtins/locale1.0 Fri Feb 18 20:37:09 2011 (r218819) @@ -11,6 +11,7 @@ check() { } unset LANG LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME LC_MESSAGES +unset LANGUAGE msgeng="No such file or directory" msgdut="Bestand of map niet gevonden" Modified: head/tools/regression/bin/sh/expansion/cmdsubst3.0 ============================================================================== --- head/tools/regression/bin/sh/expansion/cmdsubst3.0 Fri Feb 18 20:30:58 2011 (r218818) +++ head/tools/regression/bin/sh/expansion/cmdsubst3.0 Fri Feb 18 20:37:09 2011 (r218819) @@ -1,5 +1,8 @@ # $FreeBSD$ +unset LC_ALL +export LC_CTYPE=en_US.ISO8859-1 + e= for i in 0 1 2 3; do for j in 0 1 2 3 4 5 6 7; do From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 20: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 0314F106564A; Fri, 18 Feb 2011 20:38:06 +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 DA9798FC1A; Fri, 18 Feb 2011 20:38:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IKc5LT071506; Fri, 18 Feb 2011 20:38:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IKc5Mk071503; Fri, 18 Feb 2011 20:38:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102182038.p1IKc5Mk071503@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 20:38: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: r218820 - 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: Fri, 18 Feb 2011 20:38:06 -0000 Author: yongari Date: Fri Feb 18 20:38:05 2011 New Revision: 218820 URL: http://svn.freebsd.org/changeset/base/218820 Log: For controllers that have TX interrupt moderation capability, request TX completion interrupt for every 8-th frames. Previously dc(4) requested TX completion interrupt if number of queued TX descriptors is greater than 64. This caused a lot of TX completion interrupt under high TX load once driver queued more than 64 TX descriptors. It's quite normal to see more than 64 queued TX descriptors under high TX load. This change reduces the number of TX completion interrupts to be less than 17k under high TX load. Because this change does not generate TX completion interrupt for each frame, add reclaiming transmitted buffers in dc_tick not to generate false watchdog timeouts. While I'm here add check for queued descriptors in dc_txeof() since there is no more work to do when there is no pending descriptors. Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 20:37:09 2011 (r218819) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 20:38:05 2011 (r218820) @@ -2473,6 +2473,7 @@ dc_list_tx_init(struct dc_softc *sc) } cd->dc_tx_prod = cd->dc_tx_cons = cd->dc_tx_cnt = 0; + cd->dc_tx_pkts = 0; bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return (0); @@ -2841,6 +2842,9 @@ dc_txeof(struct dc_softc *sc) int idx; u_int32_t ctl, txstat; + if (sc->dc_cdata.dc_tx_cnt == 0) + return; + ifp = sc->dc_ifp; /* @@ -2952,6 +2956,13 @@ dc_tick(void *xsc) ifp = sc->dc_ifp; mii = device_get_softc(sc->dc_miibus); + /* + * Reclaim transmitted frames for controllers that do + * not generate TX completion interrupt for every frame. + */ + if (sc->dc_flags & DC_TX_USE_TX_INTR) + dc_txeof(sc); + if (sc->dc_flags & DC_REDUCED_MII_POLL) { if (sc->dc_flags & DC_21143_NWAY) { r = CSR_READ_4(sc, DC_10BTSTAT); @@ -3322,8 +3333,11 @@ dc_encap(struct dc_softc *sc, struct mbu htole32(DC_TXCTL_FINT); if (sc->dc_flags & DC_TX_INTR_ALWAYS) sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); - if (sc->dc_flags & DC_TX_USE_TX_INTR && sc->dc_cdata.dc_tx_cnt > 64) + if (sc->dc_flags & DC_TX_USE_TX_INTR && + ++sc->dc_cdata.dc_tx_pkts >= 8) { + sc->dc_cdata.dc_tx_pkts = 0; sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); + } sc->dc_ldata->dc_tx_list[first].dc_status = htole32(DC_TXSTAT_OWN); bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_tx_map[idx], Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Fri Feb 18 20:37:09 2011 (r218819) +++ head/sys/dev/dc/if_dcreg.h Fri Feb 18 20:38:05 2011 (r218820) @@ -495,6 +495,7 @@ struct dc_chain_data { bus_dmamap_t dc_tx_map[DC_TX_LIST_CNT]; u_int32_t *dc_sbuf; u_int8_t dc_pad[DC_MIN_FRAMELEN]; + int dc_tx_pkts; int dc_tx_first; int dc_tx_prod; int dc_tx_cons; From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 20:51: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 E2E0F106566C; Fri, 18 Feb 2011 20:51:13 +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 D0D768FC0A; Fri, 18 Feb 2011 20:51:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IKpDlc071890; Fri, 18 Feb 2011 20:51:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IKpDCU071888; Fri, 18 Feb 2011 20:51:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102182051.p1IKpDCU071888@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 18 Feb 2011 20:51: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: r218821 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 20:51:14 -0000 Author: jilles Date: Fri Feb 18 20:51:13 2011 New Revision: 218821 URL: http://svn.freebsd.org/changeset/base/218821 Log: sh: Test that the read builtin passes through all byte values except NUL, newline and backslash. This also passes on stable/8. Added: head/tools/regression/bin/sh/builtins/read5.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/read5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read5.0 Fri Feb 18 20:51:13 2011 (r218821) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +unset LC_ALL +LC_CTYPE=en_US.ISO8859-1 +export LC_CTYPE + +# Note: the first and last characters are not whitespace. +# Exclude backslash and newline. +bad1=`printf %03o \'\\\\` +bad2=`printf %03o \'' +'` +e= +for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in + 000|$bad1|$bad2) continue ;; + esac + e="$e\\$i$j$k" + done + done +done +e=`printf "$e"` +[ "${#e}" = 253 ] || echo length bad + +r1=`printf '%s\n' "$e" | { read -r x; printf '%s' "$x"; }` +[ "$r1" = "$e" ] || echo "read with -r bad" +r2=`printf '%s\n' "$e" | { read x; printf '%s' "$x"; }` +[ "$r2" = "$e" ] || echo "read without -r bad 1" +IFS= +r3=`printf '%s\n' "$e" | { read x; printf '%s' "$x"; }` +[ "$r3" = "$e" ] || echo "read without -r bad 2" From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 20:54: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 DA9421065672; Fri, 18 Feb 2011 20:54:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C30758FC12; Fri, 18 Feb 2011 20:54:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IKsDN5071990; Fri, 18 Feb 2011 20:54:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IKsDMx071986; Fri, 18 Feb 2011 20:54:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102182054.p1IKsDMx071986@svn.freebsd.org> From: Dimitry Andric Date: Fri, 18 Feb 2011 20:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218822 - in head: . contrib/binutils contrib/binutils/bfd contrib/binutils/bfd/doc contrib/binutils/bfd/po contrib/binutils/binutils contrib/binutils/binutils/doc contrib/binutils/binu... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 20:54:14 -0000 Author: dim Date: Fri Feb 18 20:54:12 2011 New Revision: 218822 URL: http://svn.freebsd.org/changeset/base/218822 Log: Merge binutils 2.17.50 to head. This brings a number of improvements to x86 CPU support, better support for powerpc64, some new directives, and many other things. Bump __FreeBSD_version, and add a note to UPDATING. Thanks to the many people that have helped to test this. Obtained from: projects/binutils-2.17 Added: head/contrib/binutils/bfd/ChangeLog-2006 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/ChangeLog-2006 head/contrib/binutils/bfd/cpu-cr16.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/cpu-cr16.c head/contrib/binutils/bfd/cpu-mep.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/cpu-mep.c head/contrib/binutils/bfd/cpu-score.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/cpu-score.c head/contrib/binutils/bfd/cpu-spu.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/cpu-spu.c head/contrib/binutils/bfd/elf-attrs.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf-attrs.c head/contrib/binutils/bfd/elf-vxworks.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf-vxworks.c head/contrib/binutils/bfd/elf-vxworks.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf-vxworks.h head/contrib/binutils/bfd/elf32-arm.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-arm.c head/contrib/binutils/bfd/elf32-avr.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-avr.h head/contrib/binutils/bfd/elf32-cr16.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-cr16.c head/contrib/binutils/bfd/elf32-mep.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-mep.c head/contrib/binutils/bfd/elf32-score.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-score.c head/contrib/binutils/bfd/elf32-sh-relocs.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-sh-relocs.h head/contrib/binutils/bfd/elf32-spu.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-spu.c head/contrib/binutils/bfd/elf32-spu.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elf32-spu.h head/contrib/binutils/bfd/elfxx-sparc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elfxx-sparc.c head/contrib/binutils/bfd/elfxx-sparc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/elfxx-sparc.h head/contrib/binutils/bfd/mep-relocs.pl - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/mep-relocs.pl head/contrib/binutils/bfd/pe-arm-wince.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/pe-arm-wince.c head/contrib/binutils/bfd/pe-x86_64.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/pe-x86_64.c head/contrib/binutils/bfd/pei-arm-wince.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/pei-arm-wince.c head/contrib/binutils/bfd/pei-x86_64.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/bfd/pei-x86_64.c head/contrib/binutils/binutils/ChangeLog-2006 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/ChangeLog-2006 head/contrib/binutils/binutils/bin2c.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/bin2c.c head/contrib/binutils/binutils/dwarf.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/dwarf.c head/contrib/binutils/binutils/dwarf.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/dwarf.h head/contrib/binutils/binutils/embedspu.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/embedspu.sh head/contrib/binutils/binutils/mclex.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/mclex.c head/contrib/binutils/binutils/mcparse.y - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/mcparse.y head/contrib/binutils/binutils/sysdep.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/sysdep.h head/contrib/binutils/binutils/windint.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/windint.h head/contrib/binutils/binutils/windmc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/windmc.c head/contrib/binutils/binutils/windmc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/binutils/windmc.h head/contrib/binutils/config.rpath - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config.rpath head/contrib/binutils/config/confsubdir.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/confsubdir.m4 head/contrib/binutils/config/ld-symbolic.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/ld-symbolic.m4 head/contrib/binutils/config/mt-mep - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/mt-mep head/contrib/binutils/config/mt-spu - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/mt-spu head/contrib/binutils/config/multi.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/multi.m4 head/contrib/binutils/config/unwind_ipinfo.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/config/unwind_ipinfo.m4 head/contrib/binutils/configure.ac - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/configure.ac head/contrib/binutils/gas/ChangeLog-2006 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/ChangeLog-2006 head/contrib/binutils/gas/config/tc-cr16.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-cr16.c head/contrib/binutils/gas/config/tc-cr16.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-cr16.h head/contrib/binutils/gas/config/tc-mep.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-mep.c head/contrib/binutils/gas/config/tc-mep.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-mep.h head/contrib/binutils/gas/config/tc-score.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-score.c head/contrib/binutils/gas/config/tc-score.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-score.h head/contrib/binutils/gas/config/tc-spu.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-spu.c head/contrib/binutils/gas/config/tc-spu.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/tc-spu.h head/contrib/binutils/gas/config/te-pep.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/config/te-pep.h head/contrib/binutils/gas/doc/c-avr.texi - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/doc/c-avr.texi head/contrib/binutils/gas/doc/c-cr16.texi - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/doc/c-cr16.texi head/contrib/binutils/gas/itbl-lex.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gas/itbl-lex.h head/contrib/binutils/gprof/po/ms.po - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/gprof/po/ms.po head/contrib/binutils/include/elf/bfin.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/bfin.h head/contrib/binutils/include/elf/cr16.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/cr16.h head/contrib/binutils/include/elf/crx.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/crx.h head/contrib/binutils/include/elf/m32c.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/m32c.h head/contrib/binutils/include/elf/mep.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/mep.h head/contrib/binutils/include/elf/mt.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/mt.h head/contrib/binutils/include/elf/score.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/score.h head/contrib/binutils/include/elf/spu.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/elf/spu.h head/contrib/binutils/include/opcode/cr16.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/opcode/cr16.h head/contrib/binutils/include/opcode/score-datadep.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/opcode/score-datadep.h head/contrib/binutils/include/opcode/score-inst.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/opcode/score-inst.h head/contrib/binutils/include/opcode/spu-insns.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/opcode/spu-insns.h head/contrib/binutils/include/opcode/spu.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/include/opcode/spu.h head/contrib/binutils/ld/ChangeLog-2006 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/ChangeLog-2006 head/contrib/binutils/ld/emulparams/arm_wince_pe.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/arm_wince_pe.sh head/contrib/binutils/ld/emulparams/avr6.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/avr6.sh head/contrib/binutils/ld/emulparams/elf32_spu.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/elf32_spu.sh head/contrib/binutils/ld/emulparams/elf32cr16.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/elf32cr16.sh head/contrib/binutils/ld/emulparams/elf32mep.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/elf32mep.sh head/contrib/binutils/ld/emulparams/elf32ppccommon.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/elf32ppccommon.sh head/contrib/binutils/ld/emulparams/elf64bmip-defs.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/elf64bmip-defs.sh head/contrib/binutils/ld/emulparams/i386pep.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/i386pep.sh head/contrib/binutils/ld/emulparams/scoreelf.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/scoreelf.sh head/contrib/binutils/ld/emulparams/shelf_uclinux.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/shelf_uclinux.sh head/contrib/binutils/ld/emulparams/shelf_vxworks.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/shelf_vxworks.sh head/contrib/binutils/ld/emulparams/shlelf_vxworks.sh - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emulparams/shlelf_vxworks.sh head/contrib/binutils/ld/emultempl/avrelf.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/avrelf.em head/contrib/binutils/ld/emultempl/cr16elf.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/cr16elf.em head/contrib/binutils/ld/emultempl/elf-generic.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/elf-generic.em head/contrib/binutils/ld/emultempl/genelf.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/genelf.em head/contrib/binutils/ld/emultempl/pep.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/pep.em head/contrib/binutils/ld/emultempl/scoreelf.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/scoreelf.em head/contrib/binutils/ld/emultempl/spu_ovl.S - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/spu_ovl.S head/contrib/binutils/ld/emultempl/spu_ovl.o - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/spu_ovl.o head/contrib/binutils/ld/emultempl/spuelf.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/spuelf.em head/contrib/binutils/ld/pep-dll.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/pep-dll.c head/contrib/binutils/ld/pep-dll.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/pep-dll.h head/contrib/binutils/ld/scripttempl/elf32cr16.sc - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/scripttempl/elf32cr16.sc head/contrib/binutils/ld/scripttempl/mep.sc - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/scripttempl/mep.sc head/contrib/binutils/ld/scripttempl/pep.sc - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/scripttempl/pep.sc head/contrib/binutils/libiberty/at-file.texi - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/libiberty/at-file.texi head/contrib/binutils/libiberty/filename_cmp.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/libiberty/filename_cmp.c head/contrib/binutils/libiberty/unlink-if-ordinary.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/libiberty/unlink-if-ordinary.c head/contrib/binutils/ltgcc.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ltgcc.m4 head/contrib/binutils/ltoptions.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ltoptions.m4 head/contrib/binutils/ltsugar.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ltsugar.m4 head/contrib/binutils/ltversion.m4 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ltversion.m4 head/contrib/binutils/opcodes/ChangeLog-2006 - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/ChangeLog-2006 head/contrib/binutils/opcodes/cr16-dis.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/cr16-dis.c head/contrib/binutils/opcodes/cr16-opc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/cr16-opc.c head/contrib/binutils/opcodes/i386-gen.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-gen.c head/contrib/binutils/opcodes/i386-opc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-opc.c head/contrib/binutils/opcodes/i386-opc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-opc.h head/contrib/binutils/opcodes/i386-opc.tbl - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-reg.tbl - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-reg.tbl head/contrib/binutils/opcodes/i386-tbl.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/i386-tbl.h head/contrib/binutils/opcodes/mep-asm.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-asm.c head/contrib/binutils/opcodes/mep-desc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-desc.c head/contrib/binutils/opcodes/mep-desc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-desc.h head/contrib/binutils/opcodes/mep-dis.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-dis.c head/contrib/binutils/opcodes/mep-ibld.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-ibld.c head/contrib/binutils/opcodes/mep-opc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-opc.c head/contrib/binutils/opcodes/mep-opc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/mep-opc.h head/contrib/binutils/opcodes/score-dis.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/score-dis.c head/contrib/binutils/opcodes/score-opc.h - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/score-opc.h head/contrib/binutils/opcodes/spu-dis.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/spu-dis.c head/contrib/binutils/opcodes/spu-opc.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/opcodes/spu-opc.c head/gnu/usr.bin/binutils/addr2line/addr2line.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/addr2line/addr2line.1 head/gnu/usr.bin/binutils/ar/ar.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/ar/ar.1 head/gnu/usr.bin/binutils/as/as.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/as/as.1 head/gnu/usr.bin/binutils/ld/ld.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/ld/ld.1 head/gnu/usr.bin/binutils/nm/nm.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/nm/nm.1 head/gnu/usr.bin/binutils/objcopy/objcopy.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/objcopy/objcopy.1 head/gnu/usr.bin/binutils/objdump/objdump.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/objdump/objdump.1 head/gnu/usr.bin/binutils/ranlib/ranlib.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/ranlib/ranlib.1 head/gnu/usr.bin/binutils/readelf/readelf.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/readelf/readelf.1 head/gnu/usr.bin/binutils/size/size.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/size/size.1 head/gnu/usr.bin/binutils/strings/strings.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/strings/strings.1 head/gnu/usr.bin/binutils/strip/strip.1 - copied unchanged from r216378, projects/binutils-2.17/gnu/usr.bin/binutils/strip/strip.1 Replaced: head/contrib/binutils/ld/emultempl/mipself.em - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/ld/emultempl/mipself.em head/contrib/binutils/libiberty/pexecute.c - copied unchanged from r216367, projects/binutils-2.17/contrib/binutils/libiberty/pexecute.c Deleted: head/contrib/binutils/bfd/aout-encap.c head/contrib/binutils/bfd/doc/aoutx.texi head/contrib/binutils/bfd/doc/archive.texi head/contrib/binutils/bfd/doc/archures.texi head/contrib/binutils/bfd/doc/bfdio.texi head/contrib/binutils/bfd/doc/bfdt.texi head/contrib/binutils/bfd/doc/bfdwin.texi head/contrib/binutils/bfd/doc/cache.texi head/contrib/binutils/bfd/doc/coffcode.texi head/contrib/binutils/bfd/doc/core.texi head/contrib/binutils/bfd/doc/elf.texi head/contrib/binutils/bfd/doc/elfcode.texi head/contrib/binutils/bfd/doc/format.texi head/contrib/binutils/bfd/doc/hash.texi head/contrib/binutils/bfd/doc/init.texi head/contrib/binutils/bfd/doc/libbfd.texi head/contrib/binutils/bfd/doc/linker.texi head/contrib/binutils/bfd/doc/mmo.texi head/contrib/binutils/bfd/doc/opncls.texi head/contrib/binutils/bfd/doc/reloc.texi head/contrib/binutils/bfd/doc/section.texi head/contrib/binutils/bfd/doc/syms.texi head/contrib/binutils/bfd/doc/targets.texi head/contrib/binutils/bfd/elf32-arm.h head/contrib/binutils/bfd/elfarm-nabi.c head/contrib/binutils/bfd/elfarm-oabi.c head/contrib/binutils/bfd/elflink.h head/contrib/binutils/bfd/po/POTFILES.in head/contrib/binutils/binutils/acinclude.m4 head/contrib/binutils/binutils/budemang.c head/contrib/binutils/binutils/budemang.h head/contrib/binutils/binutils/defparse.c head/contrib/binutils/binutils/defparse.h head/contrib/binutils/binutils/doc/addr2line.1 head/contrib/binutils/binutils/doc/ar.1 head/contrib/binutils/binutils/doc/cxxfilt.man head/contrib/binutils/binutils/doc/dlltool.1 head/contrib/binutils/binutils/doc/nm.1 head/contrib/binutils/binutils/doc/objcopy.1 head/contrib/binutils/binutils/doc/objdump.1 head/contrib/binutils/binutils/doc/ranlib.1 head/contrib/binutils/binutils/doc/readelf.1 head/contrib/binutils/binutils/doc/size.1 head/contrib/binutils/binutils/doc/strings.1 head/contrib/binutils/binutils/doc/strip.1 head/contrib/binutils/binutils/rclex.l head/contrib/binutils/config.if head/contrib/binutils/config/mh-mingw32 head/contrib/binutils/config/mh-openedition head/contrib/binutils/config/mh-sysv head/contrib/binutils/config/mt-armpic head/contrib/binutils/config/mt-elfalphapic head/contrib/binutils/config/mt-ia64pic head/contrib/binutils/config/mt-linux head/contrib/binutils/config/mt-papic head/contrib/binutils/config/mt-ppcpic head/contrib/binutils/config/mt-s390pic head/contrib/binutils/config/mt-sparcpic head/contrib/binutils/config/mt-x86pic head/contrib/binutils/configure.in head/contrib/binutils/contrib/ head/contrib/binutils/gas/bignum-copy.c head/contrib/binutils/gas/config/obj-generic.c head/contrib/binutils/gas/config/obj-generic.h head/contrib/binutils/gas/config/obj-ieee.c head/contrib/binutils/gas/config/obj-ieee.h head/contrib/binutils/gas/config/te-aux.h head/contrib/binutils/gas/config/te-ppcnw.h head/contrib/binutils/gas/config/te-sysv32.h head/contrib/binutils/gas/doc/as.1 head/contrib/binutils/gas/doc/gasp.texi head/contrib/binutils/gas/doc/gasver.texi head/contrib/binutils/gas/gasp.c head/contrib/binutils/gas/link.cmd head/contrib/binutils/include/bin-bugs.h head/contrib/binutils/include/callback.h head/contrib/binutils/include/regs/ head/contrib/binutils/include/remote-sim.h head/contrib/binutils/ld/acinclude.m4 head/contrib/binutils/ld/emulparams/armelf_oabi.sh head/contrib/binutils/ld/emulparams/i386freebsd.sh head/contrib/binutils/ld/emultempl/armelf_oabi.em head/contrib/binutils/ld/ld.1 head/contrib/binutils/ld/ldver.texi head/contrib/binutils/libiberty/config.table head/contrib/binutils/libiberty/configure.in head/contrib/binutils/ltcf-c.sh head/contrib/binutils/ltcf-cxx.sh head/contrib/binutils/ltcf-gcj.sh head/contrib/binutils/ltconfig head/contrib/binutils/md5.sum head/contrib/binutils/opcodes/acinclude.m4 head/contrib/binutils/opcodes/arm-opc.h head/gnu/lib/libg2c/ head/gnu/lib/libiberty/ head/gnu/usr.bin/binutils/as/tc-sparc-fixed.c Modified: head/UPDATING head/contrib/binutils/ChangeLog head/contrib/binutils/MAINTAINERS head/contrib/binutils/Makefile.def head/contrib/binutils/Makefile.in head/contrib/binutils/Makefile.tpl head/contrib/binutils/bfd/ChangeLog head/contrib/binutils/bfd/ChangeLog-0203 head/contrib/binutils/bfd/Makefile.am head/contrib/binutils/bfd/Makefile.in head/contrib/binutils/bfd/acinclude.m4 head/contrib/binutils/bfd/aclocal.m4 head/contrib/binutils/bfd/aout-arm.c head/contrib/binutils/bfd/aout-sparcle.c head/contrib/binutils/bfd/aout-target.h head/contrib/binutils/bfd/aout0.c head/contrib/binutils/bfd/aout32.c head/contrib/binutils/bfd/aout64.c head/contrib/binutils/bfd/aoutf1.h head/contrib/binutils/bfd/aoutx.h head/contrib/binutils/bfd/archive.c head/contrib/binutils/bfd/archive64.c head/contrib/binutils/bfd/archures.c head/contrib/binutils/bfd/armnetbsd.c head/contrib/binutils/bfd/bfd-in.h head/contrib/binutils/bfd/bfd-in2.h head/contrib/binutils/bfd/bfd.c head/contrib/binutils/bfd/bfdio.c head/contrib/binutils/bfd/bfdwin.c head/contrib/binutils/bfd/binary.c head/contrib/binutils/bfd/bout.c head/contrib/binutils/bfd/cache.c head/contrib/binutils/bfd/coff-alpha.c head/contrib/binutils/bfd/coff-arm.c head/contrib/binutils/bfd/coff-aux.c head/contrib/binutils/bfd/coff-i386.c head/contrib/binutils/bfd/coff-ia64.c head/contrib/binutils/bfd/coff-mips.c head/contrib/binutils/bfd/coff-ppc.c head/contrib/binutils/bfd/coff-rs6000.c head/contrib/binutils/bfd/coff-sparc.c head/contrib/binutils/bfd/coff-x86_64.c head/contrib/binutils/bfd/coff64-rs6000.c head/contrib/binutils/bfd/coffcode.h head/contrib/binutils/bfd/coffgen.c head/contrib/binutils/bfd/cofflink.c head/contrib/binutils/bfd/coffswap.h head/contrib/binutils/bfd/config.bfd head/contrib/binutils/bfd/config.in head/contrib/binutils/bfd/configure head/contrib/binutils/bfd/configure.host head/contrib/binutils/bfd/configure.in head/contrib/binutils/bfd/corefile.c head/contrib/binutils/bfd/cpu-alpha.c head/contrib/binutils/bfd/cpu-arc.c head/contrib/binutils/bfd/cpu-arm.c head/contrib/binutils/bfd/cpu-i386.c head/contrib/binutils/bfd/cpu-ia64-opc.c head/contrib/binutils/bfd/cpu-ia64.c head/contrib/binutils/bfd/cpu-mips.c head/contrib/binutils/bfd/cpu-powerpc.c head/contrib/binutils/bfd/cpu-rs6000.c head/contrib/binutils/bfd/cpu-s390.c head/contrib/binutils/bfd/cpu-sparc.c head/contrib/binutils/bfd/demo64.c head/contrib/binutils/bfd/dep-in.sed head/contrib/binutils/bfd/doc/ChangeLog head/contrib/binutils/bfd/doc/Makefile.am head/contrib/binutils/bfd/doc/Makefile.in head/contrib/binutils/bfd/doc/bfd.texinfo head/contrib/binutils/bfd/doc/bfdint.texi head/contrib/binutils/bfd/doc/chew.c head/contrib/binutils/bfd/doc/fdl.texi head/contrib/binutils/bfd/dwarf1.c head/contrib/binutils/bfd/dwarf2.c head/contrib/binutils/bfd/ecoff.c head/contrib/binutils/bfd/ecofflink.c head/contrib/binutils/bfd/ecoffswap.h head/contrib/binutils/bfd/efi-app-ia32.c head/contrib/binutils/bfd/efi-app-ia64.c head/contrib/binutils/bfd/elf-bfd.h head/contrib/binutils/bfd/elf-eh-frame.c head/contrib/binutils/bfd/elf-strtab.c head/contrib/binutils/bfd/elf.c head/contrib/binutils/bfd/elf32-arc.c head/contrib/binutils/bfd/elf32-gen.c head/contrib/binutils/bfd/elf32-i386.c head/contrib/binutils/bfd/elf32-mips.c head/contrib/binutils/bfd/elf32-ppc.c head/contrib/binutils/bfd/elf32-ppc.h head/contrib/binutils/bfd/elf32-s390.c head/contrib/binutils/bfd/elf32-sparc.c head/contrib/binutils/bfd/elf32.c head/contrib/binutils/bfd/elf64-alpha.c head/contrib/binutils/bfd/elf64-gen.c head/contrib/binutils/bfd/elf64-mips.c head/contrib/binutils/bfd/elf64-ppc.c head/contrib/binutils/bfd/elf64-ppc.h head/contrib/binutils/bfd/elf64-s390.c head/contrib/binutils/bfd/elf64-sparc.c head/contrib/binutils/bfd/elf64-x86-64.c head/contrib/binutils/bfd/elf64.c head/contrib/binutils/bfd/elfcode.h head/contrib/binutils/bfd/elfcore.h head/contrib/binutils/bfd/elflink.c head/contrib/binutils/bfd/elfn32-mips.c head/contrib/binutils/bfd/elfxx-ia64.c head/contrib/binutils/bfd/elfxx-mips.c head/contrib/binutils/bfd/elfxx-mips.h head/contrib/binutils/bfd/elfxx-target.h head/contrib/binutils/bfd/format.c head/contrib/binutils/bfd/freebsd.h head/contrib/binutils/bfd/gen-aout.c head/contrib/binutils/bfd/genlink.h head/contrib/binutils/bfd/hash.c head/contrib/binutils/bfd/host-aout.c head/contrib/binutils/bfd/i386aout.c head/contrib/binutils/bfd/i386bsd.c head/contrib/binutils/bfd/i386freebsd.c head/contrib/binutils/bfd/i386linux.c head/contrib/binutils/bfd/i386netbsd.c head/contrib/binutils/bfd/ieee.c head/contrib/binutils/bfd/ihex.c head/contrib/binutils/bfd/init.c head/contrib/binutils/bfd/libaout.h head/contrib/binutils/bfd/libbfd-in.h head/contrib/binutils/bfd/libbfd.c head/contrib/binutils/bfd/libbfd.h head/contrib/binutils/bfd/libcoff-in.h head/contrib/binutils/bfd/libcoff.h head/contrib/binutils/bfd/libecoff.h head/contrib/binutils/bfd/libieee.h head/contrib/binutils/bfd/libpei.h head/contrib/binutils/bfd/libxcoff.h head/contrib/binutils/bfd/linker.c head/contrib/binutils/bfd/merge.c head/contrib/binutils/bfd/mipsbsd.c head/contrib/binutils/bfd/netbsd-core.c head/contrib/binutils/bfd/netbsd.h head/contrib/binutils/bfd/opncls.c head/contrib/binutils/bfd/osf-core.c head/contrib/binutils/bfd/pe-arm.c head/contrib/binutils/bfd/pe-i386.c head/contrib/binutils/bfd/pe-mips.c head/contrib/binutils/bfd/pe-ppc.c head/contrib/binutils/bfd/peXXigen.c head/contrib/binutils/bfd/pei-mips.c head/contrib/binutils/bfd/peicode.h head/contrib/binutils/bfd/po/BLD-POTFILES.in head/contrib/binutils/bfd/po/Make-in head/contrib/binutils/bfd/po/SRC-POTFILES.in head/contrib/binutils/bfd/po/bfd.pot head/contrib/binutils/bfd/ppcboot.c head/contrib/binutils/bfd/ptrace-core.c head/contrib/binutils/bfd/reloc.c head/contrib/binutils/bfd/reloc16.c head/contrib/binutils/bfd/rs6000-core.c head/contrib/binutils/bfd/sco5-core.c head/contrib/binutils/bfd/section.c head/contrib/binutils/bfd/simple.c head/contrib/binutils/bfd/sparclinux.c head/contrib/binutils/bfd/sparcnetbsd.c head/contrib/binutils/bfd/srec.c head/contrib/binutils/bfd/stab-syms.c head/contrib/binutils/bfd/stabs.c head/contrib/binutils/bfd/sunos.c head/contrib/binutils/bfd/syms.c head/contrib/binutils/bfd/sysdep.h head/contrib/binutils/bfd/targets.c head/contrib/binutils/bfd/tekhex.c head/contrib/binutils/bfd/trad-core.c head/contrib/binutils/bfd/version.h head/contrib/binutils/bfd/xcoff-target.h head/contrib/binutils/bfd/xcofflink.c head/contrib/binutils/binutils/ChangeLog head/contrib/binutils/binutils/MAINTAINERS head/contrib/binutils/binutils/Makefile.am head/contrib/binutils/binutils/Makefile.in head/contrib/binutils/binutils/NEWS head/contrib/binutils/binutils/aclocal.m4 head/contrib/binutils/binutils/addr2line.c head/contrib/binutils/binutils/ar.c head/contrib/binutils/binutils/arlex.l head/contrib/binutils/binutils/arparse.y head/contrib/binutils/binutils/arsup.c head/contrib/binutils/binutils/arsup.h head/contrib/binutils/binutils/binemul.c head/contrib/binutils/binutils/binemul.h head/contrib/binutils/binutils/bucomm.c head/contrib/binutils/binutils/bucomm.h head/contrib/binutils/binutils/budbg.h head/contrib/binutils/binutils/coffdump.c head/contrib/binutils/binutils/coffgrok.c head/contrib/binutils/binutils/coffgrok.h head/contrib/binutils/binutils/config.in head/contrib/binutils/binutils/configure head/contrib/binutils/binutils/configure.in head/contrib/binutils/binutils/cxxfilt.c head/contrib/binutils/binutils/debug.c head/contrib/binutils/binutils/debug.h head/contrib/binutils/binutils/deflex.l head/contrib/binutils/binutils/defparse.y head/contrib/binutils/binutils/dep-in.sed head/contrib/binutils/binutils/dlltool.c head/contrib/binutils/binutils/dlltool.h head/contrib/binutils/binutils/dllwrap.c head/contrib/binutils/binutils/doc/Makefile.am head/contrib/binutils/binutils/doc/Makefile.in head/contrib/binutils/binutils/doc/binutils.texi head/contrib/binutils/binutils/doc/fdl.texi head/contrib/binutils/binutils/emul_vanilla.c head/contrib/binutils/binutils/filemode.c head/contrib/binutils/binutils/ieee.c head/contrib/binutils/binutils/nm.c head/contrib/binutils/binutils/objcopy.c head/contrib/binutils/binutils/objdump.c head/contrib/binutils/binutils/po/Make-in head/contrib/binutils/binutils/po/POTFILES.in head/contrib/binutils/binutils/po/binutils.pot head/contrib/binutils/binutils/prdbg.c head/contrib/binutils/binutils/ranlib.sh head/contrib/binutils/binutils/rclex.c head/contrib/binutils/binutils/rcparse.y head/contrib/binutils/binutils/rdcoff.c head/contrib/binutils/binutils/rddbg.c head/contrib/binutils/binutils/readelf.c head/contrib/binutils/binutils/rename.c head/contrib/binutils/binutils/resbin.c head/contrib/binutils/binutils/rescoff.c head/contrib/binutils/binutils/resrc.c head/contrib/binutils/binutils/resres.c head/contrib/binutils/binutils/size.c head/contrib/binutils/binutils/srconv.c head/contrib/binutils/binutils/stabs.c head/contrib/binutils/binutils/strings.c head/contrib/binutils/binutils/sysdump.c head/contrib/binutils/binutils/sysinfo.y head/contrib/binutils/binutils/syslex.l head/contrib/binutils/binutils/unwind-ia64.c head/contrib/binutils/binutils/unwind-ia64.h head/contrib/binutils/binutils/version.c head/contrib/binutils/binutils/wrstabs.c head/contrib/binutils/config-ml.in head/contrib/binutils/config.guess head/contrib/binutils/config.sub head/contrib/binutils/config/ChangeLog head/contrib/binutils/config/acinclude.m4 head/contrib/binutils/config/mh-cxux head/contrib/binutils/config/mh-necv4 head/contrib/binutils/config/mh-sco head/contrib/binutils/config/mh-solaris head/contrib/binutils/config/mh-sysv4 head/contrib/binutils/config/mh-sysv5 head/contrib/binutils/config/mt-v810 head/contrib/binutils/configure head/contrib/binutils/etc/ChangeLog head/contrib/binutils/etc/Makefile.in head/contrib/binutils/gas/ChangeLog head/contrib/binutils/gas/ChangeLog-0001 head/contrib/binutils/gas/ChangeLog-0203 head/contrib/binutils/gas/ChangeLog-9295 head/contrib/binutils/gas/ChangeLog-9697 head/contrib/binutils/gas/ChangeLog-9899 head/contrib/binutils/gas/Makefile.am head/contrib/binutils/gas/Makefile.in head/contrib/binutils/gas/NEWS head/contrib/binutils/gas/README head/contrib/binutils/gas/acinclude.m4 head/contrib/binutils/gas/aclocal.m4 head/contrib/binutils/gas/app.c head/contrib/binutils/gas/as.c head/contrib/binutils/gas/as.h head/contrib/binutils/gas/asintl.h head/contrib/binutils/gas/atof-generic.c head/contrib/binutils/gas/bignum.h head/contrib/binutils/gas/bit_fix.h head/contrib/binutils/gas/cgen.c head/contrib/binutils/gas/cgen.h head/contrib/binutils/gas/cond.c head/contrib/binutils/gas/config.in head/contrib/binutils/gas/config/aout_gnu.h head/contrib/binutils/gas/config/atof-ieee.c head/contrib/binutils/gas/config/atof-vax.c head/contrib/binutils/gas/config/itbl-mips.h head/contrib/binutils/gas/config/obj-aout.c head/contrib/binutils/gas/config/obj-aout.h head/contrib/binutils/gas/config/obj-coff.c head/contrib/binutils/gas/config/obj-coff.h head/contrib/binutils/gas/config/obj-ecoff.c head/contrib/binutils/gas/config/obj-ecoff.h head/contrib/binutils/gas/config/obj-elf.c head/contrib/binutils/gas/config/obj-elf.h head/contrib/binutils/gas/config/obj-multi.h head/contrib/binutils/gas/config/tc-alpha.c head/contrib/binutils/gas/config/tc-alpha.h head/contrib/binutils/gas/config/tc-arc.c head/contrib/binutils/gas/config/tc-arc.h head/contrib/binutils/gas/config/tc-arm.c head/contrib/binutils/gas/config/tc-arm.h head/contrib/binutils/gas/config/tc-generic.c head/contrib/binutils/gas/config/tc-generic.h head/contrib/binutils/gas/config/tc-i386.c head/contrib/binutils/gas/config/tc-i386.h head/contrib/binutils/gas/config/tc-ia64.c head/contrib/binutils/gas/config/tc-ia64.h head/contrib/binutils/gas/config/tc-m68851.h head/contrib/binutils/gas/config/tc-mips.c head/contrib/binutils/gas/config/tc-mips.h head/contrib/binutils/gas/config/tc-ppc.c head/contrib/binutils/gas/config/tc-ppc.h head/contrib/binutils/gas/config/tc-s390.c head/contrib/binutils/gas/config/tc-s390.h head/contrib/binutils/gas/config/tc-sparc.c head/contrib/binutils/gas/config/tc-sparc.h head/contrib/binutils/gas/config/te-386bsd.h head/contrib/binutils/gas/config/te-freebsd.h head/contrib/binutils/gas/config/te-nbsd.h head/contrib/binutils/gas/config/te-sparcaout.h head/contrib/binutils/gas/config/te-tmips.h head/contrib/binutils/gas/configure head/contrib/binutils/gas/configure.in head/contrib/binutils/gas/debug.c head/contrib/binutils/gas/dep-in.sed head/contrib/binutils/gas/depend.c head/contrib/binutils/gas/doc/Makefile.am head/contrib/binutils/gas/doc/Makefile.in head/contrib/binutils/gas/doc/all.texi head/contrib/binutils/gas/doc/as.texinfo head/contrib/binutils/gas/doc/c-alpha.texi head/contrib/binutils/gas/doc/c-arc.texi head/contrib/binutils/gas/doc/c-arm.texi head/contrib/binutils/gas/doc/c-i386.texi head/contrib/binutils/gas/doc/c-ia64.texi head/contrib/binutils/gas/doc/c-mips.texi head/contrib/binutils/gas/doc/c-ppc.texi head/contrib/binutils/gas/doc/c-sh.texi head/contrib/binutils/gas/doc/c-sparc.texi head/contrib/binutils/gas/doc/internals.texi head/contrib/binutils/gas/dw2gencfi.c head/contrib/binutils/gas/dw2gencfi.h head/contrib/binutils/gas/dwarf2dbg.c head/contrib/binutils/gas/dwarf2dbg.h head/contrib/binutils/gas/ecoff.c head/contrib/binutils/gas/ecoff.h head/contrib/binutils/gas/ehopt.c head/contrib/binutils/gas/emul-target.h head/contrib/binutils/gas/emul.h head/contrib/binutils/gas/expr.c head/contrib/binutils/gas/expr.h head/contrib/binutils/gas/flonum-copy.c head/contrib/binutils/gas/flonum-konst.c head/contrib/binutils/gas/flonum-mult.c head/contrib/binutils/gas/flonum.h head/contrib/binutils/gas/frags.c head/contrib/binutils/gas/frags.h head/contrib/binutils/gas/gdbinit.in head/contrib/binutils/gas/hash.c head/contrib/binutils/gas/hash.h head/contrib/binutils/gas/input-file.c head/contrib/binutils/gas/input-file.h head/contrib/binutils/gas/input-scrub.c head/contrib/binutils/gas/itbl-lex.l head/contrib/binutils/gas/itbl-ops.c head/contrib/binutils/gas/itbl-ops.h head/contrib/binutils/gas/itbl-parse.y head/contrib/binutils/gas/listing.c head/contrib/binutils/gas/listing.h head/contrib/binutils/gas/literal.c head/contrib/binutils/gas/macro.c head/contrib/binutils/gas/macro.h head/contrib/binutils/gas/messages.c head/contrib/binutils/gas/obj.h head/contrib/binutils/gas/output-file.c head/contrib/binutils/gas/output-file.h head/contrib/binutils/gas/po/Make-in head/contrib/binutils/gas/po/POTFILES.in head/contrib/binutils/gas/po/gas.pot head/contrib/binutils/gas/read.c head/contrib/binutils/gas/read.h head/contrib/binutils/gas/sb.c head/contrib/binutils/gas/sb.h head/contrib/binutils/gas/stabs.c head/contrib/binutils/gas/struc-symbol.h head/contrib/binutils/gas/subsegs.c head/contrib/binutils/gas/subsegs.h head/contrib/binutils/gas/symbols.c head/contrib/binutils/gas/symbols.h head/contrib/binutils/gas/tc.h head/contrib/binutils/gas/write.c head/contrib/binutils/gas/write.h head/contrib/binutils/gprof/mips.c head/contrib/binutils/gprof/po/Make-in head/contrib/binutils/gprof/po/gprof.pot head/contrib/binutils/include/ChangeLog head/contrib/binutils/include/ansidecl.h head/contrib/binutils/include/aout/ChangeLog head/contrib/binutils/include/aout/aout64.h head/contrib/binutils/include/aout/ar.h head/contrib/binutils/include/aout/encap.h head/contrib/binutils/include/aout/host.h head/contrib/binutils/include/aout/ranlib.h head/contrib/binutils/include/aout/reloc.h head/contrib/binutils/include/aout/stab.def head/contrib/binutils/include/aout/stab_gnu.h head/contrib/binutils/include/aout/sun4.h head/contrib/binutils/include/bfdlink.h head/contrib/binutils/include/coff/ChangeLog head/contrib/binutils/include/coff/alpha.h head/contrib/binutils/include/coff/arm.h head/contrib/binutils/include/coff/aux-coff.h head/contrib/binutils/include/coff/ecoff.h head/contrib/binutils/include/coff/external.h head/contrib/binutils/include/coff/i386.h head/contrib/binutils/include/coff/ia64.h head/contrib/binutils/include/coff/mips.h head/contrib/binutils/include/coff/mipspe.h head/contrib/binutils/include/coff/pe.h head/contrib/binutils/include/coff/powerpc.h head/contrib/binutils/include/coff/rs6000.h head/contrib/binutils/include/coff/rs6k64.h head/contrib/binutils/include/coff/sh.h head/contrib/binutils/include/coff/sparc.h head/contrib/binutils/include/coff/symconst.h head/contrib/binutils/include/coff/ti.h head/contrib/binutils/include/coff/xcoff.h head/contrib/binutils/include/demangle.h head/contrib/binutils/include/dis-asm.h head/contrib/binutils/include/dyn-string.h head/contrib/binutils/include/elf/ChangeLog head/contrib/binutils/include/elf/ChangeLog-9103 head/contrib/binutils/include/elf/alpha.h head/contrib/binutils/include/elf/arc.h head/contrib/binutils/include/elf/arm.h head/contrib/binutils/include/elf/avr.h head/contrib/binutils/include/elf/common.h head/contrib/binutils/include/elf/cris.h head/contrib/binutils/include/elf/d10v.h head/contrib/binutils/include/elf/d30v.h head/contrib/binutils/include/elf/dlx.h head/contrib/binutils/include/elf/dwarf.h head/contrib/binutils/include/elf/dwarf2.h head/contrib/binutils/include/elf/external.h head/contrib/binutils/include/elf/fr30.h head/contrib/binutils/include/elf/frv.h head/contrib/binutils/include/elf/h8.h head/contrib/binutils/include/elf/hppa.h head/contrib/binutils/include/elf/i370.h head/contrib/binutils/include/elf/i386.h head/contrib/binutils/include/elf/i860.h head/contrib/binutils/include/elf/i960.h head/contrib/binutils/include/elf/ia64.h head/contrib/binutils/include/elf/internal.h head/contrib/binutils/include/elf/ip2k.h head/contrib/binutils/include/elf/iq2000.h head/contrib/binutils/include/elf/m32r.h head/contrib/binutils/include/elf/m68hc11.h head/contrib/binutils/include/elf/m68k.h head/contrib/binutils/include/elf/mcore.h head/contrib/binutils/include/elf/mips.h head/contrib/binutils/include/elf/mmix.h head/contrib/binutils/include/elf/mn10200.h head/contrib/binutils/include/elf/mn10300.h head/contrib/binutils/include/elf/msp430.h head/contrib/binutils/include/elf/openrisc.h head/contrib/binutils/include/elf/or32.h head/contrib/binutils/include/elf/pj.h head/contrib/binutils/include/elf/ppc.h head/contrib/binutils/include/elf/ppc64.h head/contrib/binutils/include/elf/reloc-macros.h head/contrib/binutils/include/elf/s390.h head/contrib/binutils/include/elf/sh.h head/contrib/binutils/include/elf/sparc.h head/contrib/binutils/include/elf/v850.h head/contrib/binutils/include/elf/vax.h head/contrib/binutils/include/elf/x86-64.h head/contrib/binutils/include/elf/xstormy16.h head/contrib/binutils/include/elf/xtensa.h head/contrib/binutils/include/fibheap.h head/contrib/binutils/include/filenames.h head/contrib/binutils/include/floatformat.h head/contrib/binutils/include/fnmatch.h head/contrib/binutils/include/gdbm.h head/contrib/binutils/include/hashtab.h head/contrib/binutils/include/ieee.h head/contrib/binutils/include/libiberty.h head/contrib/binutils/include/md5.h head/contrib/binutils/include/objalloc.h head/contrib/binutils/include/obstack.h head/contrib/binutils/include/opcode/ChangeLog head/contrib/binutils/include/opcode/ChangeLog-9103 head/contrib/binutils/include/opcode/alpha.h head/contrib/binutils/include/opcode/arc.h head/contrib/binutils/include/opcode/arm.h head/contrib/binutils/include/opcode/cgen.h head/contrib/binutils/include/opcode/convex.h head/contrib/binutils/include/opcode/i386.h head/contrib/binutils/include/opcode/ia64.h head/contrib/binutils/include/opcode/mips.h head/contrib/binutils/include/opcode/np1.h head/contrib/binutils/include/opcode/pn.h head/contrib/binutils/include/opcode/ppc.h head/contrib/binutils/include/opcode/s390.h head/contrib/binutils/include/opcode/sparc.h head/contrib/binutils/include/partition.h head/contrib/binutils/include/progress.h head/contrib/binutils/include/safe-ctype.h head/contrib/binutils/include/sort.h head/contrib/binutils/include/splay-tree.h head/contrib/binutils/include/symcat.h head/contrib/binutils/include/ternary.h head/contrib/binutils/include/xregex2.h head/contrib/binutils/install-sh head/contrib/binutils/ld/ChangeLog head/contrib/binutils/ld/Makefile.am head/contrib/binutils/ld/Makefile.in head/contrib/binutils/ld/NEWS head/contrib/binutils/ld/aclocal.m4 head/contrib/binutils/ld/config.in head/contrib/binutils/ld/configure head/contrib/binutils/ld/configure.host head/contrib/binutils/ld/configure.in head/contrib/binutils/ld/configure.tgt head/contrib/binutils/ld/deffile.h head/contrib/binutils/ld/deffilep.y head/contrib/binutils/ld/dep-in.sed head/contrib/binutils/ld/emulparams/arcelf.sh head/contrib/binutils/ld/emulparams/armelf.sh head/contrib/binutils/ld/emulparams/armelf_fbsd.sh head/contrib/binutils/ld/emulparams/armelf_linux.sh head/contrib/binutils/ld/emulparams/armelf_nbsd.sh head/contrib/binutils/ld/emulparams/armpe.sh head/contrib/binutils/ld/emulparams/elf32_sparc.sh head/contrib/binutils/ld/emulparams/elf32bmip.sh head/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh head/contrib/binutils/ld/emulparams/elf32bmipn32.sh head/contrib/binutils/ld/emulparams/elf32btsmip.sh head/contrib/binutils/ld/emulparams/elf32btsmipn32.sh head/contrib/binutils/ld/emulparams/elf32ppc.sh head/contrib/binutils/ld/emulparams/elf32ppclinux.sh head/contrib/binutils/ld/emulparams/elf64_ia64.sh head/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh head/contrib/binutils/ld/emulparams/elf64_s390.sh head/contrib/binutils/ld/emulparams/elf64_sparc.sh head/contrib/binutils/ld/emulparams/elf64_sparc_fbsd.sh head/contrib/binutils/ld/emulparams/elf64alpha.sh head/contrib/binutils/ld/emulparams/elf64bmip.sh head/contrib/binutils/ld/emulparams/elf64btsmip.sh head/contrib/binutils/ld/emulparams/elf64ppc.sh head/contrib/binutils/ld/emulparams/elf_i386.sh head/contrib/binutils/ld/emulparams/elf_i386_chaos.sh head/contrib/binutils/ld/emulparams/elf_i386_ldso.sh head/contrib/binutils/ld/emulparams/elf_s390.sh head/contrib/binutils/ld/emulparams/elf_x86_64.sh head/contrib/binutils/ld/emulparams/elf_x86_64_fbsd.sh head/contrib/binutils/ld/emulparams/i386moss.sh head/contrib/binutils/ld/emulparams/i386nto.sh head/contrib/binutils/ld/emulparams/i386nw.sh head/contrib/binutils/ld/emulparams/i386pe.sh head/contrib/binutils/ld/emulparams/i386pe_posix.sh head/contrib/binutils/ld/emulparams/mipsidt.sh head/contrib/binutils/ld/emulparams/mipsidtl.sh head/contrib/binutils/ld/emulparams/mipspe.sh head/contrib/binutils/ld/emulparams/ppcnw.sh head/contrib/binutils/ld/emulparams/ppcpe.sh head/contrib/binutils/ld/emultempl/alphaelf.em head/contrib/binutils/ld/emultempl/armcoff.em head/contrib/binutils/ld/emultempl/armelf.em head/contrib/binutils/ld/emultempl/elf32.em head/contrib/binutils/ld/emultempl/generic.em head/contrib/binutils/ld/emultempl/ia64elf.em head/contrib/binutils/ld/emultempl/linux.em head/contrib/binutils/ld/emultempl/mipsecoff.em head/contrib/binutils/ld/emultempl/needrelax.em head/contrib/binutils/ld/emultempl/pe.em head/contrib/binutils/ld/emultempl/ppc32elf.em head/contrib/binutils/ld/emultempl/ppc64elf.em head/contrib/binutils/ld/emultempl/sunos.em head/contrib/binutils/ld/emultempl/ticoff.em head/contrib/binutils/ld/emultempl/vanilla.em head/contrib/binutils/ld/fdl.texi head/contrib/binutils/ld/gen-doc.texi head/contrib/binutils/ld/genscripts.sh head/contrib/binutils/ld/ld.h head/contrib/binutils/ld/ld.texinfo head/contrib/binutils/ld/ldcref.c head/contrib/binutils/ld/ldctor.c head/contrib/binutils/ld/ldctor.h head/contrib/binutils/ld/ldemul.c head/contrib/binutils/ld/ldemul.h head/contrib/binutils/ld/ldexp.c head/contrib/binutils/ld/ldexp.h head/contrib/binutils/ld/ldfile.c head/contrib/binutils/ld/ldfile.h head/contrib/binutils/ld/ldgram.y head/contrib/binutils/ld/ldint.texinfo head/contrib/binutils/ld/ldlang.c head/contrib/binutils/ld/ldlang.h head/contrib/binutils/ld/ldlex.h head/contrib/binutils/ld/ldlex.l head/contrib/binutils/ld/ldmain.c head/contrib/binutils/ld/ldmain.h head/contrib/binutils/ld/ldmisc.c head/contrib/binutils/ld/ldmisc.h head/contrib/binutils/ld/ldver.c head/contrib/binutils/ld/ldver.h head/contrib/binutils/ld/ldwrite.c head/contrib/binutils/ld/ldwrite.h head/contrib/binutils/ld/lexsup.c head/contrib/binutils/ld/mri.c head/contrib/binutils/ld/mri.h head/contrib/binutils/ld/pe-dll.c head/contrib/binutils/ld/pe-dll.h head/contrib/binutils/ld/po/Make-in head/contrib/binutils/ld/po/POTFILES.in head/contrib/binutils/ld/po/ld.pot head/contrib/binutils/ld/scripttempl/elf.sc head/contrib/binutils/ld/scripttempl/mips.sc head/contrib/binutils/ld/scripttempl/pe.sc head/contrib/binutils/ld/sysdep.h head/contrib/binutils/libiberty/ChangeLog head/contrib/binutils/libiberty/Makefile.in head/contrib/binutils/libiberty/_doprnt.c head/contrib/binutils/libiberty/aclocal.m4 head/contrib/binutils/libiberty/alloca.c head/contrib/binutils/libiberty/argv.c head/contrib/binutils/libiberty/asprintf.c head/contrib/binutils/libiberty/atexit.c head/contrib/binutils/libiberty/basename.c head/contrib/binutils/libiberty/bcmp.c head/contrib/binutils/libiberty/bcopy.c head/contrib/binutils/libiberty/bsearch.c head/contrib/binutils/libiberty/bzero.c head/contrib/binutils/libiberty/calloc.c head/contrib/binutils/libiberty/choose-temp.c head/contrib/binutils/libiberty/clock.c head/contrib/binutils/libiberty/concat.c head/contrib/binutils/libiberty/config.in head/contrib/binutils/libiberty/configure head/contrib/binutils/libiberty/copying-lib.texi head/contrib/binutils/libiberty/copysign.c head/contrib/binutils/libiberty/cp-demangle.c head/contrib/binutils/libiberty/cp-demangle.h head/contrib/binutils/libiberty/cp-demint.c head/contrib/binutils/libiberty/cplus-dem.c head/contrib/binutils/libiberty/dyn-string.c head/contrib/binutils/libiberty/fdmatch.c head/contrib/binutils/libiberty/ffs.c head/contrib/binutils/libiberty/fibheap.c head/contrib/binutils/libiberty/floatformat.c head/contrib/binutils/libiberty/fnmatch.c head/contrib/binutils/libiberty/functions.texi head/contrib/binutils/libiberty/gather-docs head/contrib/binutils/libiberty/getcwd.c head/contrib/binutils/libiberty/getpagesize.c head/contrib/binutils/libiberty/getpwd.c head/contrib/binutils/libiberty/getruntime.c head/contrib/binutils/libiberty/hashtab.c head/contrib/binutils/libiberty/hex.c head/contrib/binutils/libiberty/index.c head/contrib/binutils/libiberty/insque.c head/contrib/binutils/libiberty/lbasename.c head/contrib/binutils/libiberty/libiberty.texi head/contrib/binutils/libiberty/lrealpath.c head/contrib/binutils/libiberty/maint-tool head/contrib/binutils/libiberty/make-relative-prefix.c head/contrib/binutils/libiberty/make-temp-file.c head/contrib/binutils/libiberty/md5.c head/contrib/binutils/libiberty/memchr.c head/contrib/binutils/libiberty/memcmp.c head/contrib/binutils/libiberty/memcpy.c head/contrib/binutils/libiberty/memmove.c head/contrib/binutils/libiberty/memset.c head/contrib/binutils/libiberty/mkstemps.c head/contrib/binutils/libiberty/objalloc.c head/contrib/binutils/libiberty/obstack.c head/contrib/binutils/libiberty/partition.c head/contrib/binutils/libiberty/physmem.c head/contrib/binutils/libiberty/putenv.c head/contrib/binutils/libiberty/random.c head/contrib/binutils/libiberty/regex.c head/contrib/binutils/libiberty/rename.c head/contrib/binutils/libiberty/rindex.c head/contrib/binutils/libiberty/safe-ctype.c head/contrib/binutils/libiberty/setenv.c head/contrib/binutils/libiberty/sigsetmask.c head/contrib/binutils/libiberty/sort.c head/contrib/binutils/libiberty/spaces.c head/contrib/binutils/libiberty/splay-tree.c head/contrib/binutils/libiberty/strcasecmp.c head/contrib/binutils/libiberty/strchr.c head/contrib/binutils/libiberty/strdup.c head/contrib/binutils/libiberty/strerror.c head/contrib/binutils/libiberty/strncasecmp.c head/contrib/binutils/libiberty/strncmp.c head/contrib/binutils/libiberty/strrchr.c head/contrib/binutils/libiberty/strsignal.c head/contrib/binutils/libiberty/strstr.c head/contrib/binutils/libiberty/strtod.c head/contrib/binutils/libiberty/strtol.c head/contrib/binutils/libiberty/strtoul.c head/contrib/binutils/libiberty/ternary.c head/contrib/binutils/libiberty/tmpnam.c head/contrib/binutils/libiberty/vasprintf.c head/contrib/binutils/libiberty/vfork.c head/contrib/binutils/libiberty/vfprintf.c head/contrib/binutils/libiberty/vprintf.c head/contrib/binutils/libiberty/vsprintf.c head/contrib/binutils/libiberty/waitpid.c head/contrib/binutils/libiberty/xatexit.c head/contrib/binutils/libiberty/xexit.c head/contrib/binutils/libiberty/xmalloc.c head/contrib/binutils/libiberty/xmemdup.c head/contrib/binutils/libiberty/xstrdup.c head/contrib/binutils/libiberty/xstrerror.c head/contrib/binutils/libtool.m4 head/contrib/binutils/ltmain.sh head/contrib/binutils/missing head/contrib/binutils/mkinstalldirs head/contrib/binutils/move-if-change head/contrib/binutils/opcodes/ChangeLog head/contrib/binutils/opcodes/Makefile.am head/contrib/binutils/opcodes/Makefile.in head/contrib/binutils/opcodes/aclocal.m4 head/contrib/binutils/opcodes/alpha-dis.c head/contrib/binutils/opcodes/alpha-opc.c head/contrib/binutils/opcodes/arc-dis.c head/contrib/binutils/opcodes/arc-dis.h head/contrib/binutils/opcodes/arc-ext.c head/contrib/binutils/opcodes/arc-ext.h head/contrib/binutils/opcodes/arc-opc.c head/contrib/binutils/opcodes/arm-dis.c head/contrib/binutils/opcodes/cgen-asm.c head/contrib/binutils/opcodes/cgen-asm.in head/contrib/binutils/opcodes/cgen-dis.c head/contrib/binutils/opcodes/cgen-dis.in head/contrib/binutils/opcodes/cgen-ibld.in head/contrib/binutils/opcodes/cgen-opc.c head/contrib/binutils/opcodes/cgen.sh head/contrib/binutils/opcodes/config.in head/contrib/binutils/opcodes/configure head/contrib/binutils/opcodes/configure.in head/contrib/binutils/opcodes/dep-in.sed head/contrib/binutils/opcodes/dis-buf.c head/contrib/binutils/opcodes/dis-init.c head/contrib/binutils/opcodes/disassemble.c head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/ia64-asmtab.c head/contrib/binutils/opcodes/ia64-asmtab.h head/contrib/binutils/opcodes/ia64-dis.c head/contrib/binutils/opcodes/ia64-gen.c head/contrib/binutils/opcodes/ia64-ic.tbl head/contrib/binutils/opcodes/ia64-opc-a.c head/contrib/binutils/opcodes/ia64-opc-b.c head/contrib/binutils/opcodes/ia64-opc-d.c head/contrib/binutils/opcodes/ia64-opc-f.c head/contrib/binutils/opcodes/ia64-opc-i.c head/contrib/binutils/opcodes/ia64-opc-m.c head/contrib/binutils/opcodes/ia64-opc-x.c head/contrib/binutils/opcodes/ia64-opc.c head/contrib/binutils/opcodes/ia64-opc.h head/contrib/binutils/opcodes/ia64-raw.tbl head/contrib/binutils/opcodes/ia64-waw.tbl head/contrib/binutils/opcodes/mips-dis.c head/contrib/binutils/opcodes/mips-opc.c head/contrib/binutils/opcodes/mips16-opc.c head/contrib/binutils/opcodes/opintl.h head/contrib/binutils/opcodes/po/Make-in head/contrib/binutils/opcodes/po/POTFILES.in head/contrib/binutils/opcodes/po/opcodes.pot head/contrib/binutils/opcodes/ppc-dis.c head/contrib/binutils/opcodes/ppc-opc.c head/contrib/binutils/opcodes/s390-dis.c head/contrib/binutils/opcodes/s390-mkopc.c head/contrib/binutils/opcodes/s390-opc.c head/contrib/binutils/opcodes/s390-opc.txt head/contrib/binutils/opcodes/sh-dis.c head/contrib/binutils/opcodes/sh-opc.h head/contrib/binutils/opcodes/sparc-dis.c head/contrib/binutils/opcodes/sparc-opc.c head/contrib/binutils/opcodes/sysdep.h head/contrib/binutils/symlink-tree head/contrib/binutils/ylwrap head/contrib/gdb/gdb/dsrec.c head/contrib/gdb/gdb/dwarf2-frame.c head/contrib/gdb/gdb/dwarf2read.c head/contrib/gdb/gdb/elfread.c head/contrib/gdb/gdb/gcore.c head/contrib/gdb/gdb/mipsread.c head/contrib/gdb/gdb/remote-e7000.c head/contrib/gdb/gdb/remote.c head/contrib/gdb/gdb/symfile.c head/contrib/gdb/gdb/tracepoint.c head/gnu/usr.bin/binutils/Makefile.inc0 head/gnu/usr.bin/binutils/addr2line/Makefile head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/as/config.h head/gnu/usr.bin/binutils/doc/Makefile head/gnu/usr.bin/binutils/doc/asconfig.texi head/gnu/usr.bin/binutils/ld/Makefile head/gnu/usr.bin/binutils/ld/Makefile.powerpc head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 head/gnu/usr.bin/binutils/ld/armelf_fbsd.sh head/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh head/gnu/usr.bin/binutils/ld/config.h head/gnu/usr.bin/binutils/ld/genscripts.sh head/gnu/usr.bin/binutils/libbfd/Makefile head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 head/gnu/usr.bin/binutils/libbfd/Makefile.arm head/gnu/usr.bin/binutils/libbfd/Makefile.ia64 head/gnu/usr.bin/binutils/libbfd/Makefile.sparc64 head/gnu/usr.bin/binutils/libbfd/bfd.h head/gnu/usr.bin/binutils/libbfd/config.h.fbsd head/gnu/usr.bin/binutils/libbfd/elf-fbsd-brand.c head/gnu/usr.bin/binutils/libbinutils/Makefile head/gnu/usr.bin/binutils/libbinutils/config.h head/gnu/usr.bin/binutils/libiberty/Makefile head/gnu/usr.bin/binutils/libiberty/config.h head/gnu/usr.bin/binutils/libopcodes/Makefile head/gnu/usr.bin/binutils/libopcodes/config.h head/gnu/usr.bin/binutils/nm/Makefile head/gnu/usr.bin/binutils/objcopy/Makefile head/gnu/usr.bin/binutils/objdump/Makefile head/gnu/usr.bin/binutils/readelf/Makefile head/gnu/usr.bin/binutils/size/Makefile head/gnu/usr.bin/binutils/strings/Makefile head/gnu/usr.bin/binutils/strip/Makefile head/gnu/usr.bin/cc/cc_tools/auto-host.h head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c head/sys/boot/i386/efi/ldscript.amd64 head/sys/boot/ia64/efi/ldscript.ia64 head/sys/boot/ia64/ski/ldscript.ia64 head/sys/boot/powerpc/boot1.chrp/boot1.c head/sys/boot/powerpc/ofw/start.c head/sys/conf/ldscript.amd64 head/sys/conf/ldscript.i386 head/sys/conf/ldscript.ia64 head/sys/conf/ldscript.sparc64 head/sys/sys/param.h head/usr.sbin/ndiscvt/ndiscvt.c Directory Properties: head/contrib/binutils/ (props changed) head/contrib/gdb/ (props changed) head/gnu/lib/ (props changed) head/gnu/usr.bin/binutils/ (props changed) head/gnu/usr.bin/cc/cc_tools/ (props changed) head/gnu/usr.bin/gdb/ (props changed) head/sys/boot/i386/efi/ (props changed) head/sys/boot/ia64/efi/ (props changed) head/sys/boot/ia64/ski/ (props changed) head/sys/boot/powerpc/boot1.chrp/ (props changed) head/sys/boot/powerpc/ofw/ (props changed) head/sys/conf/ (props changed) head/usr.sbin/ndiscvt/ (props changed) Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 18 20:51:13 2011 (r218821) +++ head/UPDATING Fri Feb 18 20:54:12 2011 (r218822) @@ -23,6 +23,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. ln -s aj /etc/malloc.conf.) 20110218: + GNU binutils 2.17.50 (as of 2007-07-03) has been merged to -HEAD. This + is the last available version under GPLv2. It brings a number of new + features, such as support for newer x86 CPU's (with SSE-3, SSSE-3, SSE + 4.1 and SSE 4.2), better support for powerpc64, a number of new + directives, and lots of other small improvements. See the ChangeLog + file in contrib/binutils for the full details. + +20110218: IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 compliant, and will now use half of hash for authentication. This will break interoperability with all stacks (including all Modified: head/contrib/binutils/ChangeLog ============================================================================== --- head/contrib/binutils/ChangeLog Fri Feb 18 20:51:13 2011 (r218821) +++ head/contrib/binutils/ChangeLog Fri Feb 18 20:54:12 2011 (r218822) @@ -1,40 +1,2485 @@ -2004-05-06 Daniel Jacobowitz +2007-06-29 Bernd Schmidt - * src-release (do-tar): Add directories to the tar file. + * configure.ac: Don't add target-libmudflap to noconfigdirs for + uclinux and linux-uclibc targets. + * configure: Regenerate. + +2007-06-28 DJ Delorie + + * configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're + not building newlib. + * configure: Regenerated. + +2007-06-22 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Correct typos. + +2007-06-18 Daniel Jacobowitz + + * Makefile.def: Add dependency from configure-gdb to all-bfd. + * Makefile.in: Regenerated. + +2007-06-14 Paolo Bonzini + + * Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile. + (distclean-stage[+id+]): Possibly delete stage_last. + * Makefile.in: Regenerate. + +2007-06-07 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-06-07 Ben Elliston + + * Makefile.tpl: Fix spelling error. + * Makefile.in: Regenerate. + +2007-06-04 Paolo Bonzini + + Sync with gcc: + 2007-05-30 Jakub Jelinek + + PR bootstrap/29382 + * configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1. + * configure: Rebuilt. + +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + +2007-05-31 Paolo Bonzini + + * ltgcc.m4: Update from GCC. + +2007-05-25 Andreas Tobler + + * ltmain.sh: Fix Darwin verstring, remove ${wl}. + +2007-05-24 Steve Ellcey + + * ltmain.sh: Update from GCC. + * libtool.m4: Update from GCC. + * ltsugar.m4: New. Update from GCC. + * ltversion.m4: New. Update from GCC. + * ltoptions.m4: New. Update from GCC. + * ltconfig: Remove. + * ltcf-c.sh: Remove. + * ltcf-cxx.sh: Remove. + * ltcf-gcj.sh: Remove. + * src-release: Update with new libtool file list. + +2007-05-16 Paolo Bonzini + + * Makefile.def (bootstrap_stage): Replace stage_make_flags with + stage_cflags. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): + Remove CFLAGS/LIBCFLAGS. + (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. + * Makefile.in: Regenerate. + +2007-04-14 Steve Ellcey + + * config-ml.in: Update from GCC. + +2007-04-09 Daniel Jacobowitz + + * src-release (do-proto-toplev): Process the support directories before + the tool directory. + +2007-03-21 Richard Sandiford + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting + of glob. Quote arguments with single quotes too. + * configure: Regenerate. + +2007-03-12 Brooks Moses + + * Makefile.def (fixincludes): Remove unneeded "missing" lines. + * Makefile.in: Regenerate + +2007-03-07 Andreas Schwab + + * configure: Regenerate. + +2007-03-01 Brooks Moses + + * configure.ac: Add "--with-pdfdir" configure option, + which defines pdfdir variable. + * Makefile.def (target=fixincludes): Add install-pdf to + missing targets. + (recursive_targets): Add install-pdf target. + (flags_to_pass): Add pdfdir. + * Makefile.tpl: Add pdfdir handling, add do-install-pdf + target. + * configure: Regenerate + * Makefile.in: Regenerate + +2007-02-28 Eric Christopher + + Revert: + 2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2007-02-27 Matt Kraai + + * configure: Regenerate. + * configure.ac: Move statements after variable declarations. + +2007-02-19 Joseph Myers + + * configure.ac: Adjust for loop syntax. + * configure: Regenerate. + +2007-02-18 Alexandre Oliva + + * configure: Rebuilt. + +2007-02-18 Alexandre Oliva + + * configure.ac: Drop multiple occurrences of --enable-languages, + and fix its quoting. + * configure: Rebuilt. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting. + * configure: Regenerate. + +2007-02-13 Daniel Jacobowitz + + * configure.ac (target_libraries): Move libgcc before libiberty. + * configure: Regenerated. + +2007-02-13 Paolo Bonzini + + * configure: Regenerate again? + +2007-02-13 Paolo Bonzini + + * configure: Reapply PR30748 fix which was lost in the previous commit. + +2007-02-13 Daniel Jacobowitz + Paolo Bonzini + + PR bootstrap/30753 + * configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC + unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix. + * configure: Regenerated. + +2007-02-10 Paolo Bonzini + + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + PR bootstrap/30748 + * configure.ac: Correct syntax for Solaris ksh. + * configure: Regenerated. + +2007-02-09 Paolo Bonzini + + * Makefile.def: Sync with GCC. + * Makefile.tpl: Sync with GCC. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + * Makefile.tpl (build_alias, host_alias, target_alias): Use + noncanonical equivalents. + * configure.in: Rename to... + * configure.ac: ...this. Update AC_PREREQ. Prevent error for + AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and + target_noncanonical. Use them. Rewrite removal of configure + arguments for autoconf 2.59. Discard variable settings. Force + program_transform_name for native tools. + + * Makefile.in: Regenerated. + * configure: Regenerated with autoconf 2.59. + + * src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac. + +2007-02-08 Jeff Johnston + + * COPYING.LIBGLOSS: Reformat default Red Hat + license to fit within 80 columns. + * COPYING.NEWLIB: Ditto. + +2007-02-05 Dave Brolley + + * Contribute the following changes: + 2006-11-28 DJ Delorie + + * configure.in: Fix typo for mep's target_makefile_frag. + * configure: Regenerated. + + 2005-04-22 Richard Sandiford + + * configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET. + * configure: Regenerate. + + 2001-09-19 DJ Delorie + + * configure.in (target_makefile_frag): use mt-mep + + 2001-06-12 Don Howard + + * configure.in: Remove gdb from MeP skip list. + + 2001-04-05 DJ Delorie + + * configure.in (noconfigdirs): Remove gcc from MeP skip list. + + 2001-03-20 Ben Elliston + + * configure.in (noconfigdirs): Add gcc and gdb for MeP. + + 2001-03-19 Ben Elliston + + * config.sub (mep, mep-*): Add. + +2007-01-31 Andreas Schwab + + * Makefile.tpl (LDFLAGS): Substitute it. + * Makefile.in: Regenerate. + +2007-01-11 Paolo Bonzini + + * configure.in: Change == to = in test command. + * configure: Regenerate. + +2007-01-11 Paolo Bonzini + Nick Clifton + Kaveh R. Ghazi + + * configure.in (build_configargs, host_configargs, target_configargs): + Remove build/host/target parameters. + (host_libs): Add gmp and mpfr. + (GMP tests): Reorganize to allow in-tree GMP/MPFR. + * Makefile.def (gmp, mpfr): New. + (gcc): Remove target. + * Makefile.tpl (build_os, build_vendor, host_os, host_vendor, + target_os, target_vendor): New. + (configure): Add host_alias/target_alias arguments. Adjust invocations. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-01-11 Matt Fago + + * configure.in: Try to link to functions only in mpfr 2.2.x + to improve robustness of configure tests. + * configure: Regenerate. + +2007-01-08 Kai Tietz + + * configure.in: Add support for an x86_64-mingw* target. + * configure: Regenerate. + +2007-01-05 Daniel Jacobowitz + + * Makefile.tpl (all-target): Correct @if conditional for target + modules. + * configure.in: Omit libiberty if building only target libgcc. + * configure, Makefile.in: Regenerated. + +2007-01-04 Paolo Bonzini + + * configure.in: Use DEV-PHASE to detect the default for --enable-werror. + * configure: Regenerate. + +2007-01-03 Daniel Jacobowitz + + * Makefile.def (target_modules): Add libgcc. + (lang_env_dependencies): Remove default items. Use no_c and no_gcc. + * Makefile.tpl (clean-target-libgcc): Delete. + (configure-target-[+module+]): Emit --disable-bootstrap dependencies + on gcc even for bootstrapped modules. Rewrite handling of + lang_env_dependencies to loop over target_modules. + * configure.in (target_libraries): Add target-libgcc. + * Makefile.in, configure: Regenerated. + +2006-12-29 Paolo Bonzini + + Sync with gcc: + 2006-12-29 Paolo Bonzini + + * configure.in: Reorganize recognition of languages. Add + --enable-stage1-languages. Show supported languages for the chosen + target rather than all recognized languages. + * configure: Regenerate. + + 2006-12-29 Paolo Bonzini + + * Makefile.tpl (GCC_STRAP_TARGETS, all-prebootstrap): Remove. + * Makefile.in: Regenerate. + + 2006-12-29 Kaveh R. Ghazi + + * configure.in: Warn that MPFR 2.2.0 is buggy. + * configure: Regenerate. + +2006-12-27 Ian Lance Taylor + + * configure.in: When removing Makefiles to force a reconfigure, also + remove prev-DIR*/Makefile. + * configure: Regenerate. + +2006-12-23 Kazu Hirata + + * config.bfd: Recognize fido. + +2006-12-19 Paolo Bonzini + + Sync with gcc: + + 2006-12-19 Paolo Bonzini + + * configure.in: Remove "$build" case for powerpc-*-darwin* since + it only affects bootstrap and could be tested on "$host" as well. + * configure: Regenerate. + * config/mh-ppc-darwin: Add to the stage1 cflags here. + + 2006-12-19 Paolo Bonzini + + PR bootstrap/29544 + * Makefile.def (flags_to_pass): Add STAGE1_CHECKING. + (bootstrap_stage): Add STAGE1_CHECKING to stage1 configure flags, + move here comment from Makefile.tpl. + * Makefile.tpl: Move some definitions higher in the file. + (STAGE1_CHECKING): New. + * configure.in: Add --enable-stage1-checking. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2006-12-03 Kaveh R. Ghazi + + * configure.in: Update error message for missing GMP/MPFR. + + * configure: Regenerate. + + 2006-12-02 Kaveh R. Ghazi + + * configure.in: Update MPFR version in error message. + + * configure: Regenerate. + + 2006-11-26 Kaveh R. Ghazi + + * configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags. + (--with-mpfr-include, --with-mpfr-lib, --with-gmp-include, + --with-gmp-lib): New flags. + + * configure: Regenerate. + +2006-12-12 Andreas Tobler + + PR bootstrap/30134 + * configure.in: Correct x86 darwin support for libjava to powerpc + and i?86 only. + * configure: Regenerate. + +2006-12-11 Alan Modra + + * configure.in: Handle spu makefile frag. + * Makefile.tpl (MAINT): Define + (MAINTAINER_MODE_FALSE, MAINTAINER_MODE_TRUE): Define. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2006-12-11 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-12-11 Ben Elliston + + * configure.in: Sync with GCC (spu-*-*). + * configure: Sync with GCC. + +2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2006-11-16 Paolo Bonzini + + * Makefile.tpl (clean-target-libgcc): Test for gcc Makefile presence. + (unstage): Test for stage_last presence. + + PR bootstrap/29802 + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Add HOST_SUBDIR in STAGE_PREFIX. + * Makefile.in: Regenerate. + +2006-11-14 DJ Delorie + + * Makefile.tpl (clean-stage*): Sync with GCC (clean). + * Makefile.in: Sync with GCC. + * configure.in: Sync with GCC (mpfr, gmp). + * configure: Sync with GCC. + +2006-11-08 Jie Zhang + + * configure.in: Remove target-libgloss from noconfigdirs for + bfin-*-*. + * configure: Regenerated. + +2006-10-27 Jeff Johnston + + * COPYING.NEWLIB: Add spu license. + * COPYING.LIBGLOSS: Ditto. + +2006-10-17 Brooks Moses + + * Makefile.def: Added pdf target handling. + * Makefile.tpl: Added pdf target handling. + * Makefile.in: Regenerated. + +2006-10-11 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2006-09-27 Dave Brolley + + * configure.in (RUNTEST): Look for 'runtest' in the source tree by using + $s instead of $r. + * configure: Regenerated. + +2006-09-26 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-09-20 Thiemo Seufer + + * configure.in: Remove redundant handling of mips*-dec-bsd*. Likewise + for mipstx39-*-*. Disable libgloss for mips64*-*-linux*. + * configure: Regenerate. + +2006-08-30 Corinna Vinschen + + * configure.in: Never build newlib for a Mingw host. + Never build newlib as Mingw target library. + Test the existence of winsup/cygwin for building a Cygwin newlib, + rather than just winsup. + Add winsup/mingw and winsup/w32api paths to FLAGS_FOR_TARGET if + building a Mingw target. + * configure: Regenerate. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.sub: Add support for sde as alias of mipsisa32-sde-elf. + +2006-07-25 Paolo Bonzini + + Sync from GCC: + 2006-07-04 Eric Botcazou + + PR bootstrap/18058 + * configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1 + if the bootstrap compiler is a GCC version that supports it. + * configure: Regenerate. + +2006-07-22 Daniel Jacobowitz + + * configure.in: Allow mingw32 and cygwin targets to build cross-gdb. + * configure: Regenerated. + +2006-07-18 Paolo Bonzini + + * Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir + for stages after the first. + +2006-07-17 Jakub Jelinek + + * Makefile.def: Add dependencies for configure-opcodes + on configure-intl and all-opcodes on all-intl. + * Makefile.in: Regenerated. + +2006-07-04 Peter O'Gorman + + * ltconfig: chmod 644 before ranlib during install. + +2006-07-03 Paolo Bonzini + + * configure.in: Fix thinkos in previous check-in. + * configure: Regenerate. + +2006-07-03 Paolo Bonzini + + Sync from gcc: + + 2007-07-03 Paolo Bonzini + + PR other/27063 + * configure.in: Test subdir_requires and give an appropriate + error message. + * configure: Regenerate. + + 2006-06-16 Rainer Orth + + PR target/27540 + * configure.in: Only enable libgomp on IRIX 6. + * configure: Regenerate. + +2006-06-20 David Ayers + + PR bootstrap/28072 + * configure.in: Add target-boehm-gc to noconfigdirs depending on + whether target-libjava is being configured instead of whether the + java front end is enabled. + * configure: Regenerate. + +2006-06-15 Mark Shinwell + + * include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2} + to R_ARM_LDC_SB_G{0,1,2} respectively. + +2006-06-15 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Export CFLAGS and LDFLAGS + too. + * Makefile.in: Regenerate. + +2006-06-13 John David Anglin + + Sync from gcc: + + 2006-06-12 John David Anglin + * configure.in: Don't enable libgomp on hpux10. + * configure: Rebuilt. + +2006-06-13 David Ayers + + Sync from gcc: + + 2006-06-12 David Ayers + + PR bootstrap/27963 + PR target/19970 + * configure.in: Remove target-boehm-gc from noconfigdirs where + ${libgcj} is specified. + * configure: Regenerate. + +2006-06-08 Jeff Johnston + + Sync from gcc: + + 2005-01-12 David Edelsohn + Andreas Schwab + + PR bootstrap/18033 + * config-ml.in: Eval option if surrounded by single quotes. + +2006-06-07 Carlos O'Donell + + Sync from gcc: + + 2006-06-06 David Ayers + + PR libobjc/13946 + * Makefile.def: Add dependencies for libobjc which boehm-gc. + * Makefile.in: Regenerate. + * configure.in: Add --enable-objc-gc at toplevel and have it + enable boehm-gc for Objective-C. + Remove target-boehm-gc from libgcj. + Add target-boehm-gc to target_libraries. + Add target-boehm-gc to noconfigdirs where ${libgcj} + is specified. + Assert that boehm-gc is supported when requested for Objective-C. + Only build boehm-gc if needed either for Java or Objective-C. + * configure: Regenerate. + + 2006-06-05 Paolo Bonzini + + PR 27674 + * Makefile.tpl (configure-[+prefix+][+module+], + all-[+prefix+][+module+]): Depend on stage_current if bootstrapping. + Remove rule to unstage bootstrapped modules. + (stage_current): New. + * Makefile.in: Regenerate. + + 2006-05-20 John David Anglin + Andreas Tobler + + * configure.in: Enable libgcj for hppa*-hp-hpux11*. + * configure: Rebuilt. + + Revert + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + +2006-06-05 Jeff Johnston + + * config-ml.in: Alter CCASFLAGS to include special + multilib options the same as is done for CFLAGS. + +2006-05-31 Daniel Jacobowitz + + * Makefile.def: Added dependencies from sim and gdb on intl, and + added configure dependencies to everything with an all dependency + on intl. + * gettext.m4: Removed. + * src-release (DEVO_SUPPORT): Don't mention gettext.m4. + (GDB_SUPPORT_DIRS): Add intl. + * Makefile.in: Regenerated. + +2006-05-25 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add config.rpath. + +2006-05-25 Paolo Bonzini + + * Makefile.def (bfd, opcodes): Fix lib_path. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Replace ADAC with ADAFLAGS. + (restrap): Move under "@if gcc-bootstrap". Fix typo. + * Makefile.in: Regenerate. + +2006-05-24 Mark Shinwell + + * configure.in: Enable gprof for cross builds. + * configure: Regenerate. + +2006-05-17 Daniel Jacobowitz + + * src-release (MAKEINFOFLAGS): Define. + (do-proto-toplev): Pass MAKEINFOFLAGS to submakes. + +2006-05-14 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-12 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-04 Steve Ellcey + + * blt, iwidgets, mmalloc: Remove directories. + +2006-05-01 DJ Delorie + + * configure.in: Restore CFLAGS if GMP isn't present. + * configure: Regenerate. + +2006-04-18 DJ Delorie + + * configure.in (m32c): Build libstdc++-v3. Pass flags to + reference libgloss so that libssp can be built in a combined + tree. + * configure: Regenerate. + +2006-04-10 Ben Elliston + + * contrib: Remove directory. + +2006-04-06 Carlos O'Donell + + * Makefile.tpl: Add install-html target. + * Makefile.def: Add install-html target. + * Makefile.in: Regenerate. + * configure.in: Add --with-datarootdir, --with-docdir, + and --with-htmldir options. + * configure: Regenerate. + +2006-03-31 Ben Elliston + + PR binutils/1860 + * configure.in: Require makeinfo 4.4 or higher. + * configure: Regenerate. + +2006-03-14 Paolo Bonzini + + * Makefile.in: Regenerate. + +2006-03-14 Paolo Bonzini + + Sync with gcc: + 2006-03-10 Aldy Hernandez + + * configure.in: Handle --disable- generically. + * configure: Regenerate. + + 2006-02-21 Rafael Avila de Espindola + + * Makefile.tpl (BUILD_CONFIGDIRS): Remove. + (TARGET_CONFIGDIRS): Remove. + * configure.in: Remove AC_SUBST(target_configdirs). + * Makefile.in, configure: Regenerated. + + +2006-03-01 H.J. Lu + + PR libgcj/17311 + * ltmain.sh: Don't use "$finalize_rpath" for compile. + +2006-02-20 Paolo Bonzini + + PR bootstrap/25670 + + * Makefile.tpl ([+compare-target+]): Print explanation messages. + + * Makefile.def (ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES): New flags_to_pass. + * Makefile.tpl (BASE_FLAGS_TO_PASS): Support optional flags_to_pass. + (EXTRA_GCC_FLAGS): Remove ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES, + BUILD_PREFIX, BUILD_PREFIX_1. + * configure.in: (BUILD_PREFIX, BUILD_PREFIX_1): Don't substitute. + + * Makefile.def (bootstrap stage 1): Pass LIBCFLAGS too. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Override LIBCFLAGS too. + + * Makefile.tpl (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+], : Use $(current_stage) instead + of `cat stage_current`. Always provide the `r' and `s' variables. + (clean-stage[+id+]-[+prefix+][+module+]): Likewise, and make it into + a single shell execution. + (configure-[+prefix+][+module+], all-[+prefix+][+module+]): For + bootstrapped modules, make the stage1 module if the build was not + started yet, else build the current stage. + (all-host, all-target): Omit bootstrapped modules (if bootstrapping). + (all-build, all-host, all-target, [+make_target+]-host, + [+make_target+]-target): Do not use \-continued lines. + (target modules): Depend on stage_last, not all-gcc, if bootstrapping. + (current_stage, restrap, stage_last): New. + + * Makefile.in: Regenerate. + * configure: Regenerate. + +2006-02-14 Paolo Bonzini + + Sync from gcc: + + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + * libgcc-math: New toplevel directory. + + 2006-01-18 Richard Henderson + Jakub Jelinek + Diego Novillo + + * libgomp: New directory. + * Makefile.def: Add target_module libgomp. + * Makefile.in: Regenerate. + * configure.in (target_libraries): Add target-libgomp. + * configure: Regenerate. + +2006-02-14 Paolo Bonzini + Andreas Schwab + + * configure: Regenerate. + +2006-01-16 Paolo Bonzini + + * configure.in: Set with_gnu_as, with_gnu_ld, with_newlib earlier. + Set md_exec_prefix. Use ACX_CHECK_INSTALLED_TARGET_TOOL to find + the assembler, linker and binutils. + * configure: Regenerate. + +2006-01-16 Nick Clifton + + * config.sub, config.guess: Sync from config repository. + +2006-01-05 Alexandre Oliva + + * Makefile.tpl (clean-stage[+id+]-[+prefix+][+module+]): Remove + @ from continuation. + * Makefile.in: Rebuilt. + +2006-01-04 Paolo Bonzini + + Sync from gcc: + + 2006-01-04 Paolo Bonzini + + PR bootstrap/24252 + + * Makefile.def (flags_to_pass): Add STAGE1_CFLAGS and STAGE1_LANGUAGES. + * Makefile.tpl (OBJDUMP): New. + (EXTRA_HOST_FLAGS): Add it. + (EXTRA_GCC_FLAGS): Remove flags already specified in flags_to_pass. + + * Makefile.tpl (stage[+id+]-start, stage[+id+]-end): Do not try + to use symbolic links between directories. Avoid race conditions + or make them harmless. + * configure.in: Do not try to use symbolic links between directories. + + * Makefile.def (LEAN): Pass. + * Makefile.tpl (LEAN): Define. + (stage[+id+]-start): Accept that the previous directory does not + exist, if the bootstrap is lean. + (stage[+id+]-bubble): Invoke lean bootstrap commands after + stage[+id+]-start. Use a makefile variable and an `if' instead of a + configure substitution. + ([+compare-target+]): Likewise. + ([+bootstrap-target+]-lean): New. + * configure.in: Remove lean bootstrap support from here. + + * Makefile.in: Regenerate. + * configure: Regenerate. + + 2006-01-02 Andreas Schwab + + * configure.in: When reconfiguring remove Makefile in + all stage directories. + * configure: Regenerate. + +2005-12-27 Leif Ekblad + + * configure.in: Add support for RDOS target. + * configure: Regenerate. + +2005-12-27 Nick Clifton + + PR binutils/1990 + * libtool.m4: Synchronize with version in GCC sources. + +2005-12-20 Paolo Bonzini + + Revert Ada-related part of the previous change. + + * Makefile.def (ADAFLAGS, BOOT_ADAFLAGS, ADAFLAGS_FOR_TARGET): + Do not pass. + * Makefile.tpl (BOOT_ADAFLAGS): Do not define. + * Makefile.in: Regenerate. + * configure.in: Do not include mt-ppc-aix target fragment. + * configure: Regenerate. + +2005-12-19 Paolo Bonzini + + * configure.in: Select appropriate fragments for PowerPC/AIX. + * configure: Regenerate. + + * Makefile.def (flags_to_pass): Add ADAFLAGS, BOOT_ADAFLAGS, + BOOT_CFLAGS, BOOT_LDFLAGS. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Handle BOOT_ADAFLAGS, + BOOT_CFLAGS, BOOT_LDFLAGS. + (TARGET_FLAGS_TO_PASS): Handle ADAFLAGS_FOR_TARGET. + (stage[+id+]-bubble): Pass flags recursively to the comparison target. + (stage): Fail if we cannot complete the work. + * Makefile.in: Regenerate. + +2005-12-16 Jeff Johnston + + * COPYING.NEWLIB: Update copyright year for default + copyright. + +2005-12-15 Paolo Bonzini + + * Makefile.tpl (all, do-[+make_target+], do-check, install, + install-host-nogcc): Don't invoke $(stage) at the end. + * Makefile.in: Regenerate. + +2005-12-14 Paolo Bonzini + + * configure.in: Flip the top-level bootstrap switch. + * configure: Regenerate. + + Merge from gcc: + + 2005-12-14 Daniel Jacobowitz + + * Makefile.tpl: Throughout the file, use : $(MAKE) along with + $(stage) and $(unstage). + (EXTRA_TARGET_FLAGS): Correct double-quoting. + (all): Remove stray semicolon. + (local-distclean): Don't handle multilib.tmp and multilib.out. + (install.all): Set $s for consistency. + (configure-[+prefix+][+module+]): Instead of [+deps+], handle + check_multilibs setting. Always make the install directory. + (configure-stage[+id+]-[+prefix+][+module+]): Likewise. + Correct @if/@endif. + (all-stage[+id+]-[+prefix+][+module+]): Correct @if/@endif. + ($(TARGET_SUBDIR)/[+module+]/multilib.out): Remove. + (stage[+id+]-start, stage[+id+]-end): Stage $(TARGET_SUBDIR). + (multilib.out): Remove. + * Makefile.in: Regenerated. + +2005-12-12 Nathan Sidwell + + * config.sub: Replace ms1 arch with mt. Allow ms1 as alias. + * configure.in: Replace ms1 arch with mt. + * configure: Rebuilt. + +2005-12-05 Paolo Bonzini + + Sync with gcc: + +2005-12-12 Nathan Sidwell + + * config.sub: Replace ms1 arch with mt. Allow ms1 as alias. + * configure.in: Replace ms1 arch with mt. + * configure: Rebuilt. + +2005-12-05 Paolo Bonzini + + Sync with gcc: + + 2005-12-05 Paolo Bonzini + + * configure.in (CONFIGURED_BISON, CONFIGURED_YACC, CONFIGURED_M4, + CONFIGURED_FLEX, CONFIGURED_LEX, CONFIGURED_MAKEINFO): Remove + "CONFIGURED_" from the AC_CHECK_PROGS invocation. Move below. + Find in-tree tools if available. + (EXPECT, RUNTEST, LIPO, STRIP): Find them and substitute them. + (CONFIGURED_*_FOR_TARGET): Don't set nor substitute. + (*_FOR_TARGET): Set them with GCC_TARGET_TOOL. + (COMPILER_*_FOR_TARGET): New. + * Makefile.tpl (HOST_EXPORTS): Add *_FOR_TARGET symbols that gcc needs. + (BASE_TARGET_EXPORTS): Use COMPILER_*_FOR_TARGET symbols. + (CONFIGURED_*, USUAL_*): Remove. + (BISON, YACC, FLEX, LEX, M4, MAKEINFO, EXPECT, RUNTEST, LIPO, + STRIP): Use autoconf substitutions. + (COMPILER_AS_FOR_TARGET, COMPILER_LD_FOR_TARGET, + COMPILER_NM_FOR_TARGET): New. + (EXTRA_HOST_FLAGS): Pass LIPO and STRIP. + + (all): Make all-host and all-target in parallel. + (do-[+make_target+], do-check, install, [+compare-target+]): Ensure + that $$r and $$s are set before invoking a recursive make. + (stage[+id+]-bubble): Likewise, and invoke the comparison at the end. + ([+bootstrap-target+]): Inline most of the `all' target. + + 2005-11-29 Ben Elliston + + * Makefile.tpl (clean-target-libgcc): Invoke clean-target-libgcc + from the gcc build directory. + * Makefile.in: Regenerate. + + 2005-11-29 Ben Elliston + + * Makefile.def: Add new libdecnumber host_module. Make all-gcc + depend on all-libdecnumber. + * configure.in (host_libs): Include libdecnumber. + * Makefile.in: Regenerate. + * configure: Likewise. + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 21:44: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 9DA5E106566B; Fri, 18 Feb 2011 21:44:53 +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 889408FC13; Fri, 18 Feb 2011 21:44:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1ILir5C073548; Fri, 18 Feb 2011 21:44:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1ILirMB073528; Fri, 18 Feb 2011 21:44:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201102182144.p1ILirMB073528@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Feb 2011 21:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218824 - in head: contrib/gcc/config/rs6000 lib/csu/powerpc64 lib/libc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen lib/libc/powerpc64/sys libexec/rtld-elf/powerpc64 sys/conf sys/powe... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Feb 2011 21:44:53 -0000 Author: nwhitehorn Date: Fri Feb 18 21:44:53 2011 New Revision: 218824 URL: http://svn.freebsd.org/changeset/base/218824 Log: Turn off default generation of userland dot symbols on powerpc64 now that we have a binutils that supports it. Kernel dot symbols remain on to assist DDB. Modified: head/contrib/gcc/config/rs6000/freebsd.h head/lib/csu/powerpc64/crti.S head/lib/libc/gen/_thread_init.c head/lib/libc/powerpc64/SYS.h head/lib/libc/powerpc64/gen/_ctx_start.S head/lib/libc/powerpc64/sys/brk.S head/lib/libc/powerpc64/sys/cerror.S head/lib/libc/powerpc64/sys/exect.S head/lib/libc/powerpc64/sys/pipe.S head/lib/libc/powerpc64/sys/ptrace.S head/lib/libc/powerpc64/sys/sbrk.S head/libexec/rtld-elf/powerpc64/rtld_start.S head/sys/conf/kern.mk head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/swtch64.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/asm.h head/sys/powerpc/include/profile.h head/sys/sys/cdefs.h Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Fri Feb 18 21:39:09 2011 (r218823) +++ head/contrib/gcc/config/rs6000/freebsd.h Fri Feb 18 21:44:53 2011 (r218824) @@ -37,6 +37,13 @@ #undef TARGET_AIX #define TARGET_AIX TARGET_64BIT +#ifdef HAVE_LD_NO_DOT_SYMS +/* New ABI uses a local sym for the function entry point. */ +extern int dot_symbols; +#undef DOT_SYMBOLS +#define DOT_SYMBOLS dot_symbols +#endif + #undef FBSD_TARGET_CPU_CPP_BUILTINS #define FBSD_TARGET_CPU_CPP_BUILTINS() \ do \ @@ -196,7 +203,7 @@ #ifdef __powerpc64__ #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n" \ -" bl ." #FUNC "\n" \ +" bl " #FUNC "\n" \ " nop\n" \ " .previous"); #endif Modified: head/lib/csu/powerpc64/crti.S ============================================================================== --- head/lib/csu/powerpc64/crti.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/csu/powerpc64/crti.S Fri Feb 18 21:44:53 2011 (r218824) @@ -32,13 +32,12 @@ __FBSDID("$FreeBSD$"); .section ".opd","aw" .align 3 _init: - .quad ._init,.TOC.@tocbase,0 + .quad .L._init,.TOC.@tocbase,0 .previous + .type _init,@function .align 4 - .global ._init - .type ._init,@function -._init: +.L._init: stdu 1,-48(1) mflr 0 std 0,64(1) @@ -49,13 +48,12 @@ _init: .section ".opd","aw" .align 3 _fini: - .quad ._fini,.TOC.@tocbase,0 + .quad .L._fini,.TOC.@tocbase,0 .previous + .type _fini,@function .align 4 - .global ._fini - .type ._fini,@function -._fini: +.L._fini: stdu 1,-48(1) mflr 0 std 0,64(1) Modified: head/lib/libc/gen/_thread_init.c ============================================================================== --- head/lib/libc/gen/_thread_init.c Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/gen/_thread_init.c Fri Feb 18 21:44:53 2011 (r218824) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); void _thread_init_stub(void); __weak_reference(_thread_init_stub, _thread_init); -__weak_reference_data(_thread_autoinit_dummy_decl_stub, +__weak_reference(_thread_autoinit_dummy_decl_stub, _thread_autoinit_dummy_decl); int _thread_autoinit_dummy_decl_stub = 0; Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/SYS.h Fri Feb 18 21:44:53 2011 (r218824) @@ -45,7 +45,7 @@ 2: mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ @@ -56,10 +56,6 @@ ENTRY(__CONCAT(__sys_,x)); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(.,x)); \ - .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bso 2b @@ -69,14 +65,12 @@ ENTRY(__CONCAT(__sys_,x)); \ ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ @@ -91,17 +85,13 @@ ENTRY(__CONCAT(__sys_,x)); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(.,x)); \ - .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bnslr; \ \ mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ Modified: head/lib/libc/powerpc64/gen/_ctx_start.S ============================================================================== --- head/lib/libc/powerpc64/gen/_ctx_start.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/gen/_ctx_start.S Fri Feb 18 21:44:53 2011 (r218824) @@ -38,12 +38,13 @@ blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ nop - bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ + bl CNAME(_ctx_done) /* branch to ctxt completion func */ /* * we should never return from the * above branch. */ nop - bl PIC_PLT(CNAME(abort)) /* abort */ + bl CNAME(abort) /* abort */ + nop .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/brk.S ============================================================================== --- head/lib/libc/powerpc64/sys/brk.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/brk.S Fri Feb 18 21:44:53 2011 (r218824) @@ -63,7 +63,7 @@ ENTRY(brk) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) Modified: head/lib/libc/powerpc64/sys/cerror.S ============================================================================== --- head/lib/libc/powerpc64/sys/cerror.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/cerror.S Fri Feb 18 21:44:53 2011 (r218824) @@ -45,7 +45,7 @@ ENTRY(HIDENAME(cerror)) std %r31,48(%r1) mr %r31,%r3 /* stash errval in callee-saved register */ - bl PIC_PLT(CNAME(__error)) + bl CNAME(__error) nop stw %r31,0(%r3) /* store errval into &errno */ Modified: head/lib/libc/powerpc64/sys/exect.S ============================================================================== --- head/lib/libc/powerpc64/sys/exect.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/exect.S Fri Feb 18 21:44:53 2011 (r218824) @@ -39,7 +39,7 @@ ENTRY(exect) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) Modified: head/lib/libc/powerpc64/sys/pipe.S ============================================================================== --- head/lib/libc/powerpc64/sys/pipe.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/pipe.S Fri Feb 18 21:44:53 2011 (r218824) @@ -43,7 +43,7 @@ ENTRY(pipe) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) Modified: head/lib/libc/powerpc64/sys/ptrace.S ============================================================================== --- head/lib/libc/powerpc64/sys/ptrace.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/ptrace.S Fri Feb 18 21:44:53 2011 (r218824) @@ -39,7 +39,7 @@ ENTRY(ptrace) std %r5,56(%r1) stw %r6,64(%r1) - bl PIC_PLT(CNAME(__error)) + bl CNAME(__error) nop li %r7,0 stw %r7,0(%r3) @@ -57,7 +57,7 @@ ENTRY(ptrace) blr 1: stdu %r1,-48(%r1) /* lr already saved */ - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) Modified: head/lib/libc/powerpc64/sys/sbrk.S ============================================================================== --- head/lib/libc/powerpc64/sys/sbrk.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/lib/libc/powerpc64/sys/sbrk.S Fri Feb 18 21:44:53 2011 (r218824) @@ -58,7 +58,7 @@ ENTRY(sbrk) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_start.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/libexec/rtld-elf/powerpc64/rtld_start.S Fri Feb 18 21:44:53 2011 (r218824) @@ -65,7 +65,7 @@ _ENTRY(_rtld_start) ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */ subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */ - bl .reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ + bl reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ nop /* @@ -80,7 +80,7 @@ _ENTRY(_rtld_start) addi %r4,%r1,128 /* &exit_proc on stack */ addi %r5,%r1,120 /* &obj_main on stack */ - bl ._rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ + bl _rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ nop ld %r2,8(%r3) ld %r11,16(%r3) @@ -133,7 +133,7 @@ _ENTRY(_rtld_bind_start) ld %r3,0(%r11) ld %r4,8(%r11) - bl ._rtld_bind # target addr = _rtld_bind(obj, reloff) + bl _rtld_bind # target addr = _rtld_bind(obj, reloff) nop ld %r2,8(%r3) Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/conf/kern.mk Fri Feb 18 21:44:53 2011 (r218824) @@ -82,6 +82,13 @@ INLINE_LIMIT?= 15000 .endif # +# Use dot symbols on powerpc64 to make ddb happy +# +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mcall-aixdesc +.endif + +# # For MIPS we also tell gcc to use floating point emulation # .if ${MACHINE_CPUARCH} == "mips" Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/powerpc/aim/locore64.S Fri Feb 18 21:44:53 2011 (r218824) @@ -174,7 +174,7 @@ ASENTRY(__start) insrdi 9,8,1,0 mtmsrd 9 - bl .OF_initial_setup + bl OF_initial_setup nop lis 4,end@ha @@ -188,14 +188,14 @@ ASENTRY(__start) mr 6,20 mr 7,21 - bl .powerpc_init + bl powerpc_init nop mr %r1, %r3 li %r3, 0 std %r3, 0(%r1) - bl .mi_startup + bl mi_startup nop - b .OF_exit + b OF_exit nop /* Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/powerpc/aim/swtch64.S Fri Feb 18 21:44:53 2011 (r218824) @@ -121,7 +121,7 @@ ENTRY(cpu_switch) /* Save FPU context if needed */ andi. %r7, %r7, PCB_FPU beq .L1 - bl .save_fpu + bl save_fpu nop .L1: @@ -130,12 +130,12 @@ ENTRY(cpu_switch) /* Save Altivec context if needed */ andi. %r7, %r7, PCB_VEC beq .L2 - bl .save_vec + bl save_vec nop .L2: mr %r3,%r14 /* restore old thread ptr */ - bl .pmap_deactivate /* Deactivate the current pmap */ + bl pmap_deactivate /* Deactivate the current pmap */ nop addi %r1,%r1,48 @@ -161,7 +161,7 @@ blocked_loop: stdu %r1,-48(%r1) mr %r3,%r15 /* Get new thread ptr */ - bl .pmap_activate /* Activate the new address space */ + bl pmap_activate /* Activate the new address space */ nop lwz %r6, PCB_FLAGS(%r17) @@ -169,7 +169,7 @@ blocked_loop: andi. %r6, %r6, PCB_FPU beq .L3 mr %r3,%r15 /* Pass curthread to enable_fpu */ - bl .enable_fpu + bl enable_fpu nop .L3: @@ -178,7 +178,7 @@ blocked_loop: andi. %r6, %r6, PCB_VEC beq .L4 mr %r3,%r15 /* Pass curthread to enable_vec */ - bl .enable_vec + bl enable_vec nop /* thread to restore is in r3 */ @@ -276,7 +276,7 @@ ENTRY(fork_trampoline) ld %r5,CF_ARG1(%r1) stdu %r1,-48(%r1) - bl .fork_exit + bl fork_exit nop addi %r1,%r1,48+CF_SIZE-FSP /* Allow 8 bytes in front of trapframe to simulate FRAME_SETUP Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/powerpc/aim/trap_subr64.S Fri Feb 18 21:44:53 2011 (r218824) @@ -295,14 +295,14 @@ cpu_reset: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) lis %r3,1@l - bl CNAME(.cpudep_ap_early_bootstrap) /* Set PCPU */ + bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop - bl CNAME(.pmap_cpu_bootstrap) /* Turn on virtual memory */ + bl CNAME(pmap_cpu_bootstrap) /* Turn on virtual memory */ nop - bl CNAME(.cpudep_ap_bootstrap) /* Set up PCPU and stack */ + bl CNAME(cpudep_ap_bootstrap) /* Set up PCPU and stack */ nop mr %r1,%r3 /* Use new stack */ - bl CNAME(.machdep_ap_bootstrap) /* And away! */ + bl CNAME(machdep_ap_bootstrap) /* And away! */ nop /* Should not be reached */ @@ -510,7 +510,7 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.powerpc_interrupt) + bl CNAME(powerpc_interrupt) nop .globl CNAME(trapexit) /* backtrace code sentinel */ @@ -538,7 +538,7 @@ CNAME(trapexit): lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.ast) + bl CNAME(ast) nop .globl CNAME(asttrapexit) /* backtrace code sentinel #2 */ CNAME(asttrapexit): @@ -587,7 +587,7 @@ dbtrap: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.db_trap_glue) + bl CNAME(db_trap_glue) nop or. %r3,%r3,%r3 bne dbleave Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/powerpc/include/asm.h Fri Feb 18 21:44:53 2011 (r218824) @@ -37,7 +37,7 @@ #include -#ifdef PIC +#if defined(PIC) && !defined(__powerpc64__) #define PIC_PROLOGUE XXX #define PIC_EPILOGUE XXX #define PIC_PLT(x) x@plt @@ -53,11 +53,6 @@ #define PIC_GOT(x) x #endif -#ifdef __powerpc64__ -#undef PIC_PLT -#define PIC_PLT(x) __CONCAT(.,x) -#endif - #define CNAME(csym) csym #define ASMNAME(asmsym) asmsym #ifdef __powerpc64__ @@ -73,8 +68,8 @@ #define _ENTRY(x) \ .text; .align 2; .globl x; .section ".opd","aw"; \ .align 3; x: \ - .quad .x,.TOC.@tocbase,0; .previous; \ - .align 4; .globl .x; .type .x,@function; .x: + .quad .L.x,.TOC.@tocbase,0; .size x,24; .previous; \ + .align 4; .type x,@function; .L.x: #else #define _ENTRY(x) \ .text; .align 4; .globl x; .type x,@function; x: Modified: head/sys/powerpc/include/profile.h ============================================================================== --- head/sys/powerpc/include/profile.h Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/powerpc/include/profile.h Fri Feb 18 21:44:53 2011 (r218824) @@ -83,13 +83,12 @@ __asm( " .text \n" \ " .section \".opd\",\"aw\" \n" \ " .align 3 \n" \ "_mcount: \n" \ - " .quad ._mcount,.TOC.@tocbase,0 \n" \ + " .quad .L._mcount,.TOC.@tocbase,0\n" \ " .previous \n" \ + " .type _mcount,@function \n" \ " .align 4 \n" \ - " .globl ._mcount \n" \ - " .type ._mcount,@function \n" \ - "._mcount: \n" \ - " stdu %r1,-(288+120)(%r1) \n" \ + ".L._mcount: \n" \ + " stdu %r1,-(288+128)(%r1) \n" \ " std %r3,48(%r1) \n" \ " std %r4,56(%r1) \n" \ " std %r5,64(%r1) \n" \ @@ -103,7 +102,7 @@ __asm( " .text \n" \ " ld %r3,0(%r1) \n" \ " ld %r3,0(%r3) \n" \ " ld %r3,16(%r3) \n" \ - " bl .__mcount \n" \ + " bl __mcount \n" \ " nop \n" \ " ld %r4,112(%r1) \n" \ " mtlr %r4 \n" \ @@ -115,7 +114,7 @@ __asm( " .text \n" \ " ld %r8,88(%r1) \n" \ " ld %r9,96(%r1) \n" \ " ld %r10,104(%r1) \n" \ - " addi %r1,%r1,(288+120) \n" \ + " addi %r1,%r1,(288+128) \n" \ " blr \n"); #else Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Feb 18 21:39:09 2011 (r218823) +++ head/sys/sys/cdefs.h Fri Feb 18 21:44:53 2011 (r218824) @@ -362,19 +362,8 @@ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) #endif #ifdef __STDC__ -#ifdef __powerpc64__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym); \ - __asm__(".weak ." #alias); \ - __asm__(".equ ." #alias ", ." #sym) -#else -#define __weak_reference(sym,alias) \ - __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym) -#endif -#define __weak_reference_data(sym,alias)\ - __asm__(".weak " #alias); \ __asm__(".equ " #alias ", " #sym) #define __warn_references(sym,msg) \ __asm__(".section .gnu.warning." #sym); \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 22:25: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 0F53B106564A; Fri, 18 Feb 2011 22:25:12 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20728FC14; Fri, 18 Feb 2011 22:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IMPBH1074758; Fri, 18 Feb 2011 22:25:11 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IMPBP6074753; Fri, 18 Feb 2011 22:25:11 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201102182225.p1IMPBP6074753@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 18 Feb 2011 22:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218825 - in head/sys: ddb gdb 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, 18 Feb 2011 22:25:12 -0000 Author: mdf Date: Fri Feb 18 22:25:11 2011 New Revision: 218825 URL: http://svn.freebsd.org/changeset/base/218825 Log: Modify kdb_trap() so that it re-calls the dbbe_trap function as long as the debugger back-end has changed. This means that switching from ddb to gdb no longer requires a "step" which can be dangerous on an already-crashed kernel. Also add a capability to get from the gdb back-end back to ddb, by typing ^C in the console window. While here, simplify kdb_sysctl_available() by using sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the strlcpy semantic is desired. MFC after: 1 month Modified: head/sys/ddb/db_command.c head/sys/gdb/gdb_main.c head/sys/gdb/gdb_packet.c head/sys/kern/subr_kdb.c Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Fri Feb 18 21:44:53 2011 (r218824) +++ head/sys/ddb/db_command.c Fri Feb 18 22:25:11 2011 (r218825) @@ -723,10 +723,16 @@ static void db_gdb(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) { - if (kdb_dbbe_select("gdb") != 0) + if (kdb_dbbe_select("gdb") != 0) { db_printf("The remote GDB backend could not be selected.\n"); - else - db_printf("Step to enter the remote GDB backend.\n"); + return; + } + /* + * Mark that we are done in the debugger. kdb_trap() + * should re-enter with the new backend. + */ + db_cmd_loop_done = 1; + db_printf("(ctrl-c will return control to ddb)\n"); } static void Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Fri Feb 18 21:44:53 2011 (r218824) +++ head/sys/gdb/gdb_main.c Fri Feb 18 22:25:11 2011 (r218825) @@ -95,7 +95,17 @@ gdb_init(void) static int gdb_trap(int type, int code) { + jmp_buf jb; struct thread *thr_iter; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) != 0) { + printf("%s bailing, hopefully back to ddb!\n", __func__); + gdb_listening = 0; + (void)kdb_jmpbuf(prev_jb); + return (1); + } gdb_listening = 0; /* @@ -291,5 +301,6 @@ gdb_trap(int type, int code) break; } } + (void)kdb_jmpbuf(prev_jb); return (0); } Modified: head/sys/gdb/gdb_packet.c ============================================================================== --- head/sys/gdb/gdb_packet.c Fri Feb 18 21:44:53 2011 (r218824) +++ head/sys/gdb/gdb_packet.c Fri Feb 18 22:25:11 2011 (r218825) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,6 +61,17 @@ gdb_getc(void) do c = gdb_cur->gdb_getc(); while (c == -1); + + if (c == CTRL('C')) { + printf("Received ^C; trying to switch back to ddb.\n"); + + if (kdb_dbbe_select("ddb") != 0) + printf("The ddb backend could not be selected.\n"); + else { + printf("using longjmp, hope it works!\n"); + kdb_reenter(); + } + } return (c); } Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Feb 18 21:44:53 2011 (r218824) +++ head/sys/kern/subr_kdb.c Fri Feb 18 22:25:11 2011 (r218825) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,33 +109,17 @@ const char * volatile kdb_why = KDB_WHY_ static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS) { - struct kdb_dbbe *be, **iter; - char *avail, *p; - ssize_t len, sz; + struct kdb_dbbe **iter; + struct sbuf sbuf; int error; - sz = 0; + sbuf_new_for_sysctl(&sbuf, NULL, 64, req); SET_FOREACH(iter, kdb_dbbe_set) { - be = *iter; - if (be->dbbe_active == 0) - sz += strlen(be->dbbe_name) + 1; + if ((*iter)->dbbe_active == 0) + sbuf_printf(&sbuf, "%s ", (*iter)->dbbe_name); } - sz++; - avail = malloc(sz, M_TEMP, M_WAITOK); - p = avail; - *p = '\0'; - - SET_FOREACH(iter, kdb_dbbe_set) { - be = *iter; - if (be->dbbe_active == 0) { - len = snprintf(p, sz, "%s ", be->dbbe_name); - p += len; - sz -= len; - } - } - KASSERT(sz >= 0, ("%s", __func__)); - error = sysctl_handle_string(oidp, avail, 0, req); - free(avail, M_TEMP); + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); return (error); } @@ -144,10 +129,9 @@ kdb_sysctl_current(SYSCTL_HANDLER_ARGS) char buf[16]; int error; - if (kdb_dbbe != NULL) { - strncpy(buf, kdb_dbbe->dbbe_name, sizeof(buf)); - buf[sizeof(buf) - 1] = '\0'; - } else + if (kdb_dbbe != NULL) + strlcpy(buf, kdb_dbbe->dbbe_name, sizeof(buf)); + else *buf = '\0'; error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) @@ -513,13 +497,15 @@ kdb_thr_select(struct thread *thr) int kdb_trap(int type, int code, struct trapframe *tf) { + struct kdb_dbbe *be; register_t intr; #ifdef SMP int did_stop_cpus; #endif int handled; - if (kdb_dbbe == NULL || kdb_dbbe->dbbe_trap == NULL) + be = kdb_dbbe; + if (be == NULL || be->dbbe_trap == NULL) return (0); /* We reenter the debugger through kdb_reenter(). */ @@ -543,7 +529,15 @@ kdb_trap(int type, int code, struct trap makectx(tf, &kdb_pcb); kdb_thr_select(curthread); - handled = kdb_dbbe->dbbe_trap(type, code); + for (;;) { + handled = be->dbbe_trap(type, code); + if (be == kdb_dbbe) + break; + be = kdb_dbbe; + if (be == NULL || be->dbbe_trap == NULL) + break; + printf("Switching to %s back-end\n", be->dbbe_name); + } kdb_active--; From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 22: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 8A9FD106566B; Fri, 18 Feb 2011 22:58: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 7A2EC8FC08; Fri, 18 Feb 2011 22:58:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IMwkrg075627; Fri, 18 Feb 2011 22:58:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IMwkrQ075625; Fri, 18 Feb 2011 22:58:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102182258.p1IMwkrQ075625@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 22:58: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: r218826 - 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: Fri, 18 Feb 2011 22:58:46 -0000 Author: yongari Date: Fri Feb 18 22:58:46 2011 New Revision: 218826 URL: http://svn.freebsd.org/changeset/base/218826 Log: Make sure to clear status word of TX descriptor in dc_list_tx_init(). Do not update if_opackets if the transmission had failed. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 22:25:11 2011 (r218825) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 22:58:46 2011 (r218826) @@ -2466,10 +2466,11 @@ dc_list_tx_init(struct dc_softc *sc) nexti = 0; else nexti = i + 1; + ld->dc_tx_list[i].dc_status = 0; + ld->dc_tx_list[i].dc_ctl = 0; + ld->dc_tx_list[i].dc_data = 0; ld->dc_tx_list[i].dc_next = htole32(DC_TXDESC(sc, nexti)); cd->dc_tx_chain[i] = NULL; - ld->dc_tx_list[i].dc_data = 0; - ld->dc_tx_list[i].dc_ctl = 0; } cd->dc_tx_prod = cd->dc_tx_cons = cd->dc_tx_cnt = 0; @@ -2916,11 +2917,10 @@ dc_txeof(struct dc_softc *sc) dc_init_locked(sc); return; } - } - + } else + ifp->if_opackets++; ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3; - ifp->if_opackets++; if (sc->dc_cdata.dc_tx_chain[idx] != NULL) { bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_tx_map[idx], From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 23:08:05 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 DAD67106566B; Fri, 18 Feb 2011 23:08:05 +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 CA8A68FC0C; Fri, 18 Feb 2011 23:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1IN85XW075875; Fri, 18 Feb 2011 23:08:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1IN85Cn075873; Fri, 18 Feb 2011 23:08:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102182308.p1IN85Cn075873@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 23:08: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: r218827 - 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: Fri, 18 Feb 2011 23:08:05 -0000 Author: yongari Date: Fri Feb 18 23:08:05 2011 New Revision: 218827 URL: http://svn.freebsd.org/changeset/base/218827 Log: There is no need to execute filter configuration when driver is not running. Remove wrong driver state change in dc_setfilt_xircom(). While I'm here nuke unnecessary assignments. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 22:58:46 2011 (r218826) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 23:08:05 2011 (r218827) @@ -1334,7 +1334,6 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); - ifp->if_drv_flags |= IFF_DRV_RUNNING; sframe->dc_status = htole32(DC_TXSTAT_OWN); CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF); @@ -3696,14 +3695,13 @@ dc_ioctl(struct ifnet *ifp, u_long comma } sc->dc_if_flags = ifp->if_flags; DC_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: DC_LOCK(sc); - dc_setfilt(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + dc_setfilt(sc); DC_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Fri Feb 18 23:18: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 7FDA0106566B; Fri, 18 Feb 2011 23:18:08 +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 6FB748FC16; Fri, 18 Feb 2011 23:18:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1INI8IF076249; Fri, 18 Feb 2011 23:18:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1INI8e3076247; Fri, 18 Feb 2011 23:18:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102182318.p1INI8e3076247@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Feb 2011 23:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218828 - 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: Fri, 18 Feb 2011 23:18:08 -0000 Author: yongari Date: Fri Feb 18 23:18:08 2011 New Revision: 218828 URL: http://svn.freebsd.org/changeset/base/218828 Log: Fix a long standing bug where driver handed over RX descriptor ownership to controller before completion of access to the descriptor. Driver is faking up status word so it should not give ownership to controller until it completes RX processing. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 23:08:05 2011 (r218827) +++ head/sys/dev/dc/if_dc.c Fri Feb 18 23:18:08 2011 (r218828) @@ -2671,7 +2671,6 @@ dc_pnic_rx_bug_war(struct dc_softc *sc, * the status word to make it look like a successful * frame reception. */ - dc_newbuf(sc, i, 0); bcopy(ptr, mtod(m, char *), total_len); cur_rx->dc_status = htole32(rxstat | DC_RXSTAT_FIRSTFRAG); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 00:00: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 DD9271065670; Sat, 19 Feb 2011 00:00:32 +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 CD4B48FC18; Sat, 19 Feb 2011 00:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J00Whu077277; Sat, 19 Feb 2011 00:00:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J00Wop077275; Sat, 19 Feb 2011 00:00:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190000.p1J00Wop077275@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 00:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218830 - 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: Sat, 19 Feb 2011 00:00:33 -0000 Author: yongari Date: Sat Feb 19 00:00:32 2011 New Revision: 218830 URL: http://svn.freebsd.org/changeset/base/218830 Log: Send frames only when there is a valid link and driver is running as well as controller has enough free TX descriptors. Remove check for number of queued frames before attempting to transmit. I guess it was added to allow draining queued frames even if there is no link. I'm under the impression this type of check should be done in upper layer. No other drivers in tree do that. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Feb 18 23:47:58 2011 (r218829) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 00:00:32 2011 (r218830) @@ -3375,10 +3375,8 @@ dc_start_locked(struct ifnet *ifp) DC_LOCK_ASSERT(sc); - if (!sc->dc_link && ifp->if_snd.ifq_len < 10) - return; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || sc->dc_link == 0) return; idx = sc->dc_cdata.dc_tx_first = sc->dc_cdata.dc_tx_prod; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 01:11: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 4DA941065674; Sat, 19 Feb 2011 01:11:37 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8CF8FC19; Sat, 19 Feb 2011 01:11:36 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 5BA117E84A; Sat, 19 Feb 2011 12:11:35 +1100 (EST) Message-ID: <4D5F18C7.9000401@freebsd.org> Date: Sat, 19 Feb 2011 12:11:35 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.13) Gecko/20101214 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Matthew D Fleming References: <201102182225.p1IMPBP6074753@svn.freebsd.org> In-Reply-To: <201102182225.p1IMPBP6074753@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r218825 - in head/sys: ddb gdb 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, 19 Feb 2011 01:11:37 -0000 On 02/19/11 09:25, Matthew D Fleming wrote: > Author: mdf > Date: Fri Feb 18 22:25:11 2011 > New Revision: 218825 > URL: http://svn.freebsd.org/changeset/base/218825 > > Log: > Modify kdb_trap() so that it re-calls the dbbe_trap function as long as > the debugger back-end has changed. This means that switching from ddb > to gdb no longer requires a "step" which can be dangerous on an > already-crashed kernel. > > Also add a capability to get from the gdb back-end back to ddb, by > typing ^C in the console window. > > While here, simplify kdb_sysctl_available() by using > sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the > strlcpy semantic is desired. > > MFC after: 1 month Thanks heaps for doing this! It has annoyed me for quite some time but I had no idea where/how to fix it. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 01:37: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 CD27A1065693; Sat, 19 Feb 2011 01:37:28 +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 A15DC8FC12; Sat, 19 Feb 2011 01:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J1bSN2079547; Sat, 19 Feb 2011 01:37:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J1bSLM079545; Sat, 19 Feb 2011 01:37:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190137.p1J1bSLM079545@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 01:37: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: r218831 - 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: Sat, 19 Feb 2011 01:37:28 -0000 Author: yongari Date: Sat Feb 19 01:37:28 2011 New Revision: 218831 URL: http://svn.freebsd.org/changeset/base/218831 Log: Rearrange interrupt handler a bit and remove forever loop. Previously dc(4) always checked whether there is pending interrupts and this consumed a lot of CPU cycles in interrupt handler. Limit the number of processing for TX/RX frames to 16. Also allow sending frames in the loop not to starve TX under high RX load. Reading DC_ISR register should be protected with driver lock, otherwise interrupt handler could be run(e.g. link state change) before the completion of dc_init_locked(). While I'm here remove unneeded code. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Feb 19 00:00:32 2011 (r218830) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 01:37:28 2011 (r218831) @@ -3135,16 +3135,19 @@ dc_intr(void *arg) struct dc_softc *sc; struct ifnet *ifp; u_int32_t status; + int curpkts, n; sc = arg; if (sc->suspended) return; - if ((CSR_READ_4(sc, DC_ISR) & DC_INTRS) == 0) - return; - DC_LOCK(sc); + status = CSR_READ_4(sc, DC_ISR); + if (status == 0xFFFFFFFF || (status & DC_INTRS) == 0) { + DC_UNLOCK(sc); + return; + } ifp = sc->dc_ifp; #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -3152,26 +3155,16 @@ dc_intr(void *arg) return; } #endif - - /* Suppress unwanted interrupts */ - if (!(ifp->if_flags & IFF_UP)) { - if (CSR_READ_4(sc, DC_ISR) & DC_INTRS) - dc_stop(sc); - DC_UNLOCK(sc); - return; - } - /* Disable interrupts. */ CSR_WRITE_4(sc, DC_IMR, 0x00000000); - while (((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) && - status != 0xFFFFFFFF && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - + for (n = 16; n > 0; n--) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + /* Ack interrupts. */ CSR_WRITE_4(sc, DC_ISR, status); if (status & DC_ISR_RX_OK) { - int curpkts; curpkts = ifp->if_ipackets; dc_rxeof(sc); if (curpkts == ifp->if_ipackets) { @@ -3196,7 +3189,6 @@ dc_intr(void *arg) if ((status & DC_ISR_RX_WATDOGTIMEO) || (status & DC_ISR_RX_NOBUF)) { - int curpkts; curpkts = ifp->if_ipackets; dc_rxeof(sc); if (curpkts == ifp->if_ipackets) { @@ -3205,17 +3197,23 @@ dc_intr(void *arg) } } + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + dc_start_locked(ifp); + if (status & DC_ISR_BUS_ERR) { dc_reset(sc); dc_init_locked(sc); + DC_UNLOCK(sc); + return; } + status = CSR_READ_4(sc, DC_ISR); + if (status == 0xFFFFFFFF || (status & DC_INTRS) == 0) + break; } /* Re-enable interrupts. */ - CSR_WRITE_4(sc, DC_IMR, DC_INTRS); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - dc_start_locked(ifp); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + CSR_WRITE_4(sc, DC_IMR, DC_INTRS); DC_UNLOCK(sc); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 02:47: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 3AD03106564A; Sat, 19 Feb 2011 02:47:11 +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 273948FC14; Sat, 19 Feb 2011 02:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J2lBpH081292; Sat, 19 Feb 2011 02:47:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J2lBdK081289; Sat, 19 Feb 2011 02:47:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190247.p1J2lBdK081289@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 02:47: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: r218832 - 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: Sat, 19 Feb 2011 02:47:11 -0000 Author: yongari Date: Sat Feb 19 02:47:10 2011 New Revision: 218832 URL: http://svn.freebsd.org/changeset/base/218832 Log: Split common TX/RX descriptor DMA tag to TX and RX DMA tags respectively and fix all bus_dma(9) issues seen when bounce buffers are used. o Setup frame handling had no bus_dmamap_sync(9) which prevented driver from configuring RX filter. Add missing bus_dmamap_sync(9) in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof(). o Use bus_addr_t for DMA segment instead of using u_int32_t. o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free DMA'able memory. o Create two DMA descriptor list for each TX/RX lists. This change will minimize the size of bounce buffers that would be used in each TX/RX path. Previously driver had to copy both TX/RX lists when bounce buffer is active. o 21143 data sheet says descriptor list requires 4 bytes alignment. Remove PAGE_SIZE alignment restriction and use sizeof(struct dc_dec). o Setup frame requires 4 bytes alignment. Remove PAGE_SIZE alignment restriction and use sizeof(struct dc_dec). o Add missing DMA map unload for both setup frame and TX/RX descriptor list. o Overhaul RX handling logic such that make driver always allocate new RX buffer with dc_newbuf(). Previously driver allowed to copy received frame with m_devget(9) after passing the descriptor ownership to controller. This can lead to passing wrong frame to upper stack. o Introduce dc_discard_rxbuf() which will discard received frame and reuse loaded DMA map and RX mbuf. o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and dc_txeof. The TX/RX descriptor lists are updated by both driver and HW so READ/WRITE semantics should be used. o If driver failed to allocate new RX buffer, update if_iqdrops counter instead of if_ierrors since driver received the frame without errors. o Make sure to unload loaded setup frame DMA map in dc_txeof and clear the mark of setup frame of the TX descriptor in dc_txeof(). o Add check for possible TX descriptor overruns in dc_encap() and move check for free buffer to caller, dc_start_locked(). o Swap the loaded DMA map and the last DMA map for multi-segmented frames. Since dc_txeof() assumes the last descriptor of the frame has the DMA map, driver should swap the first and the last DMA map in dc_encap(). Previously driver tried to unload not-yet-loaded DMA map such that the loaded DMA map was not unloaded at all for multi-segmented frames. o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one. o Remove definition of ETHER_ALIGN, it's already defined in ethernet.h. With this changes, dc(4) works with bounce buffers and it shall also fix issues which might have shown in PAE environments. Tested by: marius Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Feb 19 01:37:28 2011 (r218831) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 02:47:10 2011 (r218832) @@ -233,7 +233,8 @@ static int dc_detach(device_t); static int dc_suspend(device_t); static int dc_resume(device_t); static const struct dc_type *dc_devtype(device_t); -static int dc_newbuf(struct dc_softc *, int, int); +static void dc_discard_rxbuf(struct dc_softc *, int); +static int dc_newbuf(struct dc_softc *, int); static int dc_encap(struct dc_softc *, struct mbuf **); static void dc_pnic_rx_bug_war(struct dc_softc *, int); static int dc_rx_resync(struct dc_softc *); @@ -253,6 +254,10 @@ static int dc_shutdown(device_t); static int dc_ifmedia_upd(struct ifnet *); static void dc_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int dc_dma_alloc(struct dc_softc *); +static void dc_dma_free(struct dc_softc *); +static void dc_dma_map_addr(void *, bus_dma_segment_t *, int, int); + static void dc_delay(struct dc_softc *); static void dc_eeprom_idle(struct dc_softc *); static void dc_eeprom_putbyte(struct dc_softc *, int); @@ -1087,11 +1092,11 @@ dc_setfilt_21143(struct dc_softc *sc) i = sc->dc_cdata.dc_tx_prod; DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT); sc->dc_cdata.dc_tx_cnt++; - sframe = &sc->dc_ldata->dc_tx_list[i]; + sframe = &sc->dc_ldata.dc_tx_list[i]; sp = sc->dc_cdata.dc_sbuf; bzero(sp, DC_SFRAME_LEN); - sframe->dc_data = htole32(sc->dc_saddr); + sframe->dc_data = htole32(DC_ADDR_LO(sc->dc_saddr)); sframe->dc_ctl = htole32(DC_SFRAME_LEN | DC_TXCTL_SETUP | DC_TXCTL_TLINK | DC_FILTER_HASHPERF | DC_TXCTL_FINT); @@ -1130,6 +1135,7 @@ dc_setfilt_21143(struct dc_softc *sc) sp[41] = DC_SP_MAC(eaddr[2]); sframe->dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc->dc_stag, sc->dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF); /* @@ -1290,11 +1296,11 @@ dc_setfilt_xircom(struct dc_softc *sc) i = sc->dc_cdata.dc_tx_prod; DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT); sc->dc_cdata.dc_tx_cnt++; - sframe = &sc->dc_ldata->dc_tx_list[i]; + sframe = &sc->dc_ldata.dc_tx_list[i]; sp = sc->dc_cdata.dc_sbuf; bzero(sp, DC_SFRAME_LEN); - sframe->dc_data = htole32(sc->dc_saddr); + sframe->dc_data = htole32(DC_ADDR_LO(sc->dc_saddr)); sframe->dc_ctl = htole32(DC_SFRAME_LEN | DC_TXCTL_SETUP | DC_TXCTL_TLINK | DC_FILTER_HASHPERF | DC_TXCTL_FINT); @@ -1335,6 +1341,7 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); sframe->dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc->dc_stag, sc->dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF); /* @@ -1806,7 +1813,7 @@ dc_parse_21143_srom(struct dc_softc *sc) static void dc_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - u_int32_t *paddr; + bus_addr_t *paddr; KASSERT(nseg == 1, ("%s: wrong number of segments (%d)", __func__, nseg)); @@ -1814,6 +1821,208 @@ dc_dma_map_addr(void *arg, bus_dma_segme *paddr = segs->ds_addr; } +static int +dc_dma_alloc(struct dc_softc *sc) +{ + int error, i; + + error = bus_dma_tag_create(bus_get_dma_tag(sc->dc_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, + NULL, NULL, &sc->dc_ptag); + if (error) { + device_printf(sc->dc_dev, + "failed to allocate parent DMA tag\n"); + goto fail; + } + + /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ + error = bus_dma_tag_create(sc->dc_ptag, DC_LIST_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, DC_RX_LIST_SZ, 1, + DC_RX_LIST_SZ, 0, NULL, NULL, &sc->dc_rx_ltag); + if (error) { + device_printf(sc->dc_dev, "failed to create RX list DMA tag\n"); + goto fail; + } + + error = bus_dma_tag_create(sc->dc_ptag, DC_LIST_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, DC_TX_LIST_SZ, 1, + DC_TX_LIST_SZ, 0, NULL, NULL, &sc->dc_tx_ltag); + if (error) { + device_printf(sc->dc_dev, "failed to create TX list DMA tag\n"); + goto fail; + } + + /* RX descriptor list. */ + error = bus_dmamem_alloc(sc->dc_rx_ltag, + (void **)&sc->dc_ldata.dc_rx_list, BUS_DMA_NOWAIT | + BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->dc_rx_lmap); + if (error) { + device_printf(sc->dc_dev, + "failed to allocate DMA'able memory for RX list\n"); + goto fail; + } + error = bus_dmamap_load(sc->dc_rx_ltag, sc->dc_rx_lmap, + sc->dc_ldata.dc_rx_list, DC_RX_LIST_SZ, dc_dma_map_addr, + &sc->dc_ldata.dc_rx_list_paddr, BUS_DMA_NOWAIT); + if (error) { + device_printf(sc->dc_dev, + "failed to load DMA'able memory for RX list\n"); + goto fail; + } + /* TX descriptor list. */ + error = bus_dmamem_alloc(sc->dc_tx_ltag, + (void **)&sc->dc_ldata.dc_tx_list, BUS_DMA_NOWAIT | + BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->dc_tx_lmap); + if (error) { + device_printf(sc->dc_dev, + "failed to allocate DMA'able memory for TX list\n"); + goto fail; + } + error = bus_dmamap_load(sc->dc_tx_ltag, sc->dc_tx_lmap, + sc->dc_ldata.dc_tx_list, DC_TX_LIST_SZ, dc_dma_map_addr, + &sc->dc_ldata.dc_tx_list_paddr, BUS_DMA_NOWAIT); + if (error) { + device_printf(sc->dc_dev, + "cannot load DMA'able memory for TX list\n"); + goto fail; + } + + /* + * Allocate a busdma tag and DMA safe memory for the multicast + * setup frame. + */ + error = bus_dma_tag_create(sc->dc_ptag, DC_LIST_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + DC_SFRAME_LEN + DC_MIN_FRAMELEN, 1, DC_SFRAME_LEN + DC_MIN_FRAMELEN, + 0, NULL, NULL, &sc->dc_stag); + if (error) { + device_printf(sc->dc_dev, + "failed to create DMA tag for setup frame\n"); + goto fail; + } + error = bus_dmamem_alloc(sc->dc_stag, (void **)&sc->dc_cdata.dc_sbuf, + BUS_DMA_NOWAIT, &sc->dc_smap); + if (error) { + device_printf(sc->dc_dev, + "failed to allocate DMA'able memory for setup frame\n"); + goto fail; + } + error = bus_dmamap_load(sc->dc_stag, sc->dc_smap, sc->dc_cdata.dc_sbuf, + DC_SFRAME_LEN, dc_dma_map_addr, &sc->dc_saddr, BUS_DMA_NOWAIT); + if (error) { + device_printf(sc->dc_dev, + "cannot load DMA'able memory for setup frame\n"); + goto fail; + } + + /* Allocate a busdma tag for RX mbufs. */ + error = bus_dma_tag_create(sc->dc_ptag, DC_RXBUF_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->dc_rx_mtag); + if (error) { + device_printf(sc->dc_dev, "failed to create RX mbuf tag\n"); + goto fail; + } + + /* Allocate a busdma tag for TX mbufs. */ + error = bus_dma_tag_create(sc->dc_ptag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES * DC_MAXFRAGS, DC_MAXFRAGS, MCLBYTES, + 0, NULL, NULL, &sc->dc_tx_mtag); + if (error) { + device_printf(sc->dc_dev, "failed to create TX mbuf tag\n"); + goto fail; + } + + /* Create the TX/RX busdma maps. */ + for (i = 0; i < DC_TX_LIST_CNT; i++) { + error = bus_dmamap_create(sc->dc_tx_mtag, 0, + &sc->dc_cdata.dc_tx_map[i]); + if (error) { + device_printf(sc->dc_dev, + "failed to create TX mbuf dmamap\n"); + goto fail; + } + } + for (i = 0; i < DC_RX_LIST_CNT; i++) { + error = bus_dmamap_create(sc->dc_rx_mtag, 0, + &sc->dc_cdata.dc_rx_map[i]); + if (error) { + device_printf(sc->dc_dev, + "failed to create RX mbuf dmamap\n"); + goto fail; + } + } + error = bus_dmamap_create(sc->dc_rx_mtag, 0, &sc->dc_sparemap); + if (error) { + device_printf(sc->dc_dev, + "failed to create spare RX mbuf dmamap\n"); + goto fail; + } + +fail: + return (error); +} + +static void +dc_dma_free(struct dc_softc *sc) +{ + int i; + + /* RX buffers. */ + if (sc->dc_rx_mtag != NULL) { + for (i = 0; i < DC_RX_LIST_CNT; i++) { + if (sc->dc_cdata.dc_rx_map[i] != NULL) + bus_dmamap_destroy(sc->dc_rx_mtag, + sc->dc_cdata.dc_rx_map[i]); + } + if (sc->dc_sparemap != NULL) + bus_dmamap_destroy(sc->dc_rx_mtag, sc->dc_sparemap); + bus_dma_tag_destroy(sc->dc_rx_mtag); + } + + /* TX buffers. */ + if (sc->dc_rx_mtag != NULL) { + for (i = 0; i < DC_TX_LIST_CNT; i++) { + if (sc->dc_cdata.dc_tx_map[i] != NULL) + bus_dmamap_destroy(sc->dc_tx_mtag, + sc->dc_cdata.dc_tx_map[i]); + } + bus_dma_tag_destroy(sc->dc_tx_mtag); + } + + /* RX descriptor list. */ + if (sc->dc_rx_ltag) { + if (sc->dc_rx_lmap != NULL) + bus_dmamap_unload(sc->dc_rx_ltag, sc->dc_rx_lmap); + if (sc->dc_rx_lmap != NULL && sc->dc_ldata.dc_rx_list != NULL) + bus_dmamem_free(sc->dc_rx_ltag, sc->dc_ldata.dc_rx_list, + sc->dc_rx_lmap); + bus_dma_tag_destroy(sc->dc_rx_ltag); + } + + /* TX descriptor list. */ + if (sc->dc_tx_ltag) { + if (sc->dc_tx_lmap != NULL) + bus_dmamap_unload(sc->dc_tx_ltag, sc->dc_tx_lmap); + if (sc->dc_tx_lmap != NULL && sc->dc_ldata.dc_tx_list != NULL) + bus_dmamem_free(sc->dc_tx_ltag, sc->dc_ldata.dc_tx_list, + sc->dc_tx_lmap); + bus_dma_tag_destroy(sc->dc_tx_ltag); + } + + /* multicast setup frame. */ + if (sc->dc_stag) { + if (sc->dc_smap != NULL) + bus_dmamap_unload(sc->dc_stag, sc->dc_smap); + if (sc->dc_smap != NULL && sc->dc_cdata.dc_sbuf != NULL) + bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf, + sc->dc_smap); + bus_dma_tag_destroy(sc->dc_stag); + } +} + /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -1827,7 +2036,7 @@ dc_attach(device_t dev) struct ifnet *ifp; struct dc_mediainfo *m; u_int32_t reg, revision; - int error, i, mac_offset, phy, rid, tmp; + int error, mac_offset, phy, rid, tmp; u_int8_t *mac; sc = device_get_softc(dev); @@ -2139,96 +2348,8 @@ dc_attach(device_t dev) error = 0; } - /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ - error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - sizeof(struct dc_list_data), 1, sizeof(struct dc_list_data), - 0, NULL, NULL, &sc->dc_ltag); - if (error) { - device_printf(dev, "failed to allocate busdma tag\n"); - error = ENXIO; - goto fail; - } - error = bus_dmamem_alloc(sc->dc_ltag, (void **)&sc->dc_ldata, - BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->dc_lmap); - if (error) { - device_printf(dev, "failed to allocate DMA safe memory\n"); - error = ENXIO; - goto fail; - } - error = bus_dmamap_load(sc->dc_ltag, sc->dc_lmap, sc->dc_ldata, - sizeof(struct dc_list_data), dc_dma_map_addr, &sc->dc_laddr, - BUS_DMA_NOWAIT); - if (error) { - device_printf(dev, "cannot get address of the descriptors\n"); - error = ENXIO; + if ((error = dc_dma_alloc(sc)) != 0) goto fail; - } - - /* - * Allocate a busdma tag and DMA safe memory for the multicast - * setup frame. - */ - error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - DC_SFRAME_LEN + DC_MIN_FRAMELEN, 1, DC_SFRAME_LEN + DC_MIN_FRAMELEN, - 0, NULL, NULL, &sc->dc_stag); - if (error) { - device_printf(dev, "failed to allocate busdma tag\n"); - error = ENXIO; - goto fail; - } - error = bus_dmamem_alloc(sc->dc_stag, (void **)&sc->dc_cdata.dc_sbuf, - BUS_DMA_NOWAIT, &sc->dc_smap); - if (error) { - device_printf(dev, "failed to allocate DMA safe memory\n"); - error = ENXIO; - goto fail; - } - error = bus_dmamap_load(sc->dc_stag, sc->dc_smap, sc->dc_cdata.dc_sbuf, - DC_SFRAME_LEN, dc_dma_map_addr, &sc->dc_saddr, BUS_DMA_NOWAIT); - if (error) { - device_printf(dev, "cannot get address of the descriptors\n"); - error = ENXIO; - goto fail; - } - - /* Allocate a busdma tag for mbufs. */ - error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - MCLBYTES * DC_MAXFRAGS, DC_MAXFRAGS, MCLBYTES, - 0, NULL, NULL, &sc->dc_mtag); - if (error) { - device_printf(dev, "failed to allocate busdma tag\n"); - error = ENXIO; - goto fail; - } - - /* Create the TX/RX busdma maps. */ - for (i = 0; i < DC_TX_LIST_CNT; i++) { - error = bus_dmamap_create(sc->dc_mtag, 0, - &sc->dc_cdata.dc_tx_map[i]); - if (error) { - device_printf(dev, "failed to init TX ring\n"); - error = ENXIO; - goto fail; - } - } - for (i = 0; i < DC_RX_LIST_CNT; i++) { - error = bus_dmamap_create(sc->dc_mtag, 0, - &sc->dc_cdata.dc_rx_map[i]); - if (error) { - device_printf(dev, "failed to init RX ring\n"); - error = ENXIO; - goto fail; - } - } - error = bus_dmamap_create(sc->dc_mtag, 0, &sc->dc_sparemap); - if (error) { - device_printf(dev, "failed to init RX ring\n"); - error = ENXIO; - goto fail; - } ifp = sc->dc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -2377,7 +2498,6 @@ dc_detach(device_t dev) struct dc_softc *sc; struct ifnet *ifp; struct dc_mediainfo *m; - int i; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->dc_mtx), ("dc mutex not initialized")); @@ -2412,27 +2532,7 @@ dc_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->dc_cdata.dc_sbuf != NULL) - bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf, sc->dc_smap); - if (sc->dc_ldata != NULL) - bus_dmamem_free(sc->dc_ltag, sc->dc_ldata, sc->dc_lmap); - if (sc->dc_mtag) { - for (i = 0; i < DC_TX_LIST_CNT; i++) - if (sc->dc_cdata.dc_tx_map[i] != NULL) - bus_dmamap_destroy(sc->dc_mtag, - sc->dc_cdata.dc_tx_map[i]); - for (i = 0; i < DC_RX_LIST_CNT; i++) - if (sc->dc_cdata.dc_rx_map[i] != NULL) - bus_dmamap_destroy(sc->dc_mtag, - sc->dc_cdata.dc_rx_map[i]); - bus_dmamap_destroy(sc->dc_mtag, sc->dc_sparemap); - } - if (sc->dc_stag) - bus_dma_tag_destroy(sc->dc_stag); - if (sc->dc_mtag) - bus_dma_tag_destroy(sc->dc_mtag); - if (sc->dc_ltag) - bus_dma_tag_destroy(sc->dc_ltag); + dc_dma_free(sc); free(sc->dc_pnic_rx_buf, M_DEVBUF); @@ -2459,7 +2559,7 @@ dc_list_tx_init(struct dc_softc *sc) int i, nexti; cd = &sc->dc_cdata; - ld = sc->dc_ldata; + ld = &sc->dc_ldata; for (i = 0; i < DC_TX_LIST_CNT; i++) { if (i == DC_TX_LIST_CNT - 1) nexti = 0; @@ -2474,7 +2574,7 @@ dc_list_tx_init(struct dc_softc *sc) cd->dc_tx_prod = cd->dc_tx_cons = cd->dc_tx_cnt = 0; cd->dc_tx_pkts = 0; - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, + bus_dmamap_sync(sc->dc_tx_ltag, sc->dc_tx_lmap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return (0); } @@ -2493,10 +2593,10 @@ dc_list_rx_init(struct dc_softc *sc) int i, nexti; cd = &sc->dc_cdata; - ld = sc->dc_ldata; + ld = &sc->dc_ldata; for (i = 0; i < DC_RX_LIST_CNT; i++) { - if (dc_newbuf(sc, i, 1) != 0) + if (dc_newbuf(sc, i) != 0) return (ENOBUFS); if (i == DC_RX_LIST_CNT - 1) nexti = 0; @@ -2506,7 +2606,7 @@ dc_list_rx_init(struct dc_softc *sc) } cd->dc_rx_prod = 0; - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return (0); } @@ -2515,23 +2615,18 @@ dc_list_rx_init(struct dc_softc *sc) * Initialize an RX descriptor and attach an MBUF cluster. */ static int -dc_newbuf(struct dc_softc *sc, int i, int alloc) +dc_newbuf(struct dc_softc *sc, int i) { - struct mbuf *m_new; - bus_dmamap_t tmp; + struct mbuf *m; + bus_dmamap_t map; bus_dma_segment_t segs[1]; int error, nseg; - if (alloc) { - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m_new == NULL) - return (ENOBUFS); - } else { - m_new = sc->dc_cdata.dc_rx_chain[i]; - m_new->m_data = m_new->m_ext.ext_buf; - } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_adj(m_new, sizeof(u_int64_t)); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, sizeof(u_int64_t)); /* * If this is a PNIC chip, zero the buffer. This is part @@ -2539,31 +2634,31 @@ dc_newbuf(struct dc_softc *sc, int i, in * 82c169 chips. */ if (sc->dc_flags & DC_PNIC_RX_BUG_WAR) - bzero(mtod(m_new, char *), m_new->m_len); + bzero(mtod(m, char *), m->m_len); - /* No need to remap the mbuf if we're reusing it. */ - if (alloc) { - error = bus_dmamap_load_mbuf_sg(sc->dc_mtag, sc->dc_sparemap, - m_new, segs, &nseg, 0); - if (error) { - m_freem(m_new); - return (error); - } - KASSERT(nseg == 1, - ("%s: wrong number of segments (%d)", __func__, nseg)); - sc->dc_ldata->dc_rx_list[i].dc_data = htole32(segs->ds_addr); - bus_dmamap_unload(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i]); - tmp = sc->dc_cdata.dc_rx_map[i]; - sc->dc_cdata.dc_rx_map[i] = sc->dc_sparemap; - sc->dc_sparemap = tmp; - sc->dc_cdata.dc_rx_chain[i] = m_new; + error = bus_dmamap_load_mbuf_sg(sc->dc_rx_mtag, sc->dc_sparemap, + m, segs, &nseg, 0); + if (error) { + m_freem(m); + return (error); } - - sc->dc_ldata->dc_rx_list[i].dc_ctl = htole32(DC_RXCTL_RLINK | DC_RXLEN); - sc->dc_ldata->dc_rx_list[i].dc_status = htole32(DC_RXSTAT_OWN); - bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i], + KASSERT(nseg == 1, ("%s: wrong number of segments (%d)", __func__, + nseg)); + if (sc->dc_cdata.dc_rx_chain[i] != NULL) + bus_dmamap_unload(sc->dc_rx_mtag, sc->dc_cdata.dc_rx_map[i]); + + map = sc->dc_cdata.dc_rx_map[i]; + sc->dc_cdata.dc_rx_map[i] = sc->dc_sparemap; + sc->dc_sparemap = map; + sc->dc_cdata.dc_rx_chain[i] = m; + bus_dmamap_sync(sc->dc_rx_mtag, sc->dc_cdata.dc_rx_map[i], BUS_DMASYNC_PREREAD); - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, + + sc->dc_ldata.dc_rx_list[i].dc_ctl = htole32(DC_RXCTL_RLINK | DC_RXLEN); + sc->dc_ldata.dc_rx_list[i].dc_data = + htole32(DC_ADDR_LO(segs[0].ds_addr)); + sc->dc_ldata.dc_rx_list[i].dc_status = htole32(DC_RXSTAT_OWN); + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return (0); } @@ -2632,13 +2727,13 @@ dc_pnic_rx_bug_war(struct dc_softc *sc, u_int32_t rxstat = 0; i = sc->dc_pnic_rx_bug_save; - cur_rx = &sc->dc_ldata->dc_rx_list[idx]; + cur_rx = &sc->dc_ldata.dc_rx_list[idx]; ptr = sc->dc_pnic_rx_buf; bzero(ptr, DC_RXLEN * 5); /* Copy all the bytes from the bogus buffers. */ while (1) { - c = &sc->dc_ldata->dc_rx_list[i]; + c = &sc->dc_ldata.dc_rx_list[i]; rxstat = le32toh(c->dc_status); m = sc->dc_cdata.dc_rx_chain[i]; bcopy(mtod(m, char *), ptr, DC_RXLEN); @@ -2646,7 +2741,7 @@ dc_pnic_rx_bug_war(struct dc_softc *sc, /* If this is the last buffer, break out. */ if (i == idx || rxstat & DC_RXSTAT_LASTFRAG) break; - dc_newbuf(sc, i, 0); + dc_discard_rxbuf(sc, i); DC_INC(i, DC_RX_LIST_CNT); } @@ -2695,7 +2790,9 @@ dc_rx_resync(struct dc_softc *sc) pos = sc->dc_cdata.dc_rx_prod; for (i = 0; i < DC_RX_LIST_CNT; i++) { - cur_rx = &sc->dc_ldata->dc_rx_list[pos]; + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + cur_rx = &sc->dc_ldata.dc_rx_list[pos]; if (!(le32toh(cur_rx->dc_status) & DC_RXSTAT_OWN)) break; DC_INC(pos, DC_RX_LIST_CNT); @@ -2711,6 +2808,22 @@ dc_rx_resync(struct dc_softc *sc) return (EAGAIN); } +static void +dc_discard_rxbuf(struct dc_softc *sc, int i) +{ + struct mbuf *m; + + if (sc->dc_flags & DC_PNIC_RX_BUG_WAR) { + m = sc->dc_cdata.dc_rx_chain[i]; + bzero(mtod(m, char *), m->m_len); + } + + sc->dc_ldata.dc_rx_list[i].dc_ctl = htole32(DC_RXCTL_RLINK | DC_RXLEN); + sc->dc_ldata.dc_rx_list[i].dc_status = htole32(DC_RXSTAT_OWN); + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); +} + /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. @@ -2718,7 +2831,7 @@ dc_rx_resync(struct dc_softc *sc) static int dc_rxeof(struct dc_softc *sc) { - struct mbuf *m, *m0; + struct mbuf *m; struct ifnet *ifp; struct dc_desc *cur_rx; int i, total_len, rx_npkts; @@ -2727,13 +2840,13 @@ dc_rxeof(struct dc_softc *sc) DC_LOCK_ASSERT(sc); ifp = sc->dc_ifp; - i = sc->dc_cdata.dc_rx_prod; - total_len = 0; rx_npkts = 0; - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_POSTREAD); - while (!(le32toh(sc->dc_ldata->dc_rx_list[i].dc_status) & - DC_RXSTAT_OWN)) { + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); + for (i = sc->dc_cdata.dc_rx_prod; + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; + DC_INC(i, DC_RX_LIST_CNT)) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { if (sc->rxcycles <= 0) @@ -2741,10 +2854,12 @@ dc_rxeof(struct dc_softc *sc) sc->rxcycles--; } #endif - cur_rx = &sc->dc_ldata->dc_rx_list[i]; + cur_rx = &sc->dc_ldata.dc_rx_list[i]; rxstat = le32toh(cur_rx->dc_status); + if ((rxstat & DC_RXSTAT_OWN) != 0) + break; m = sc->dc_cdata.dc_rx_chain[i]; - bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i], + bus_dmamap_sync(sc->dc_rx_mtag, sc->dc_cdata.dc_rx_map[i], BUS_DMASYNC_POSTREAD); total_len = DC_RXBYTES(rxstat); @@ -2752,10 +2867,8 @@ dc_rxeof(struct dc_softc *sc) if ((rxstat & DC_WHOLEFRAME) != DC_WHOLEFRAME) { if (rxstat & DC_RXSTAT_FIRSTFRAG) sc->dc_pnic_rx_bug_save = i; - if ((rxstat & DC_RXSTAT_LASTFRAG) == 0) { - DC_INC(i, DC_RX_LIST_CNT); + if ((rxstat & DC_RXSTAT_LASTFRAG) == 0) continue; - } dc_pnic_rx_bug_war(sc, i); rxstat = le32toh(cur_rx->dc_status); total_len = DC_RXBYTES(rxstat); @@ -2777,11 +2890,10 @@ dc_rxeof(struct dc_softc *sc) ifp->if_ierrors++; if (rxstat & DC_RXSTAT_COLLSEEN) ifp->if_collisions++; - dc_newbuf(sc, i, 0); - if (rxstat & DC_RXSTAT_CRCERR) { - DC_INC(i, DC_RX_LIST_CNT); + dc_discard_rxbuf(sc, i); + if (rxstat & DC_RXSTAT_CRCERR) continue; - } else { + else { dc_init_locked(sc); return (rx_npkts); } @@ -2800,23 +2912,27 @@ dc_rxeof(struct dc_softc *sc) * if the allocation fails, then use m_devget and leave the * existing buffer in the receive ring. */ - if (dc_newbuf(sc, i, 1) == 0) { - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = m->m_len = total_len; - DC_INC(i, DC_RX_LIST_CNT); - } else -#endif + if (dc_newbuf(sc, i) != 0) { + dc_discard_rxbuf(sc, i); + ifp->if_iqdrops++; + continue; + } + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = m->m_len = total_len; +#else { + struct mbuf *m0; + m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp, NULL); - dc_newbuf(sc, i, 0); - DC_INC(i, DC_RX_LIST_CNT); + dc_discard_rxbuf(sc, i); if (m0 == NULL) { - ifp->if_ierrors++; + ifp->if_iqdrops++; continue; } m = m0; } +#endif ifp->if_ipackets++; DC_UNLOCK(sc); @@ -2836,9 +2952,9 @@ dc_rxeof(struct dc_softc *sc) static void dc_txeof(struct dc_softc *sc) { - struct dc_desc *cur_tx = NULL; + struct dc_desc *cur_tx; struct ifnet *ifp; - int idx; + int idx, setup; u_int32_t ctl, txstat; if (sc->dc_cdata.dc_tx_cnt == 0) @@ -2850,36 +2966,40 @@ dc_txeof(struct dc_softc *sc) * Go through our tx list and free mbufs for those * frames that have been transmitted. */ - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_POSTREAD); - idx = sc->dc_cdata.dc_tx_cons; - while (idx != sc->dc_cdata.dc_tx_prod) { - - cur_tx = &sc->dc_ldata->dc_tx_list[idx]; + bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_tx_lmap, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); + setup = 0; + for (idx = sc->dc_cdata.dc_tx_cons; idx != sc->dc_cdata.dc_tx_prod; + DC_INC(idx, DC_TX_LIST_CNT), sc->dc_cdata.dc_tx_cnt--) { + cur_tx = &sc->dc_ldata.dc_tx_list[idx]; txstat = le32toh(cur_tx->dc_status); ctl = le32toh(cur_tx->dc_ctl); if (txstat & DC_TXSTAT_OWN) break; - if (!(ctl & DC_TXCTL_LASTFRAG) || ctl & DC_TXCTL_SETUP) { - if (ctl & DC_TXCTL_SETUP) { - /* - * Yes, the PNIC is so brain damaged - * that it will sometimes generate a TX - * underrun error while DMAing the RX - * filter setup frame. If we detect this, - * we have to send the setup frame again, - * or else the filter won't be programmed - * correctly. - */ - if (DC_IS_PNIC(sc)) { - if (txstat & DC_TXSTAT_ERRSUM) - dc_setfilt(sc); - } - sc->dc_cdata.dc_tx_chain[idx] = NULL; + if (sc->dc_cdata.dc_tx_chain[idx] == NULL) + continue; + + if (ctl & DC_TXCTL_SETUP) { + cur_tx->dc_ctl = htole32(ctl & ~DC_TXCTL_SETUP); + setup++; + bus_dmamap_sync(sc->dc_stag, sc->dc_smap, + BUS_DMASYNC_POSTWRITE); + /* + * Yes, the PNIC is so brain damaged + * that it will sometimes generate a TX + * underrun error while DMAing the RX + * filter setup frame. If we detect this, + * we have to send the setup frame again, + * or else the filter won't be programmed + * correctly. + */ + if (DC_IS_PNIC(sc)) { + if (txstat & DC_TXSTAT_ERRSUM) + dc_setfilt(sc); } - sc->dc_cdata.dc_tx_cnt--; - DC_INC(idx, DC_TX_LIST_CNT); + sc->dc_cdata.dc_tx_chain[idx] = NULL; continue; } @@ -2919,26 +3039,22 @@ dc_txeof(struct dc_softc *sc) ifp->if_opackets++; ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3; - if (sc->dc_cdata.dc_tx_chain[idx] != NULL) { - bus_dmamap_sync(sc->dc_mtag, - sc->dc_cdata.dc_tx_map[idx], - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->dc_mtag, - sc->dc_cdata.dc_tx_map[idx]); - m_freem(sc->dc_cdata.dc_tx_chain[idx]); - sc->dc_cdata.dc_tx_chain[idx] = NULL; - } - - sc->dc_cdata.dc_tx_cnt--; - DC_INC(idx, DC_TX_LIST_CNT); + bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx]); + m_freem(sc->dc_cdata.dc_tx_chain[idx]); + sc->dc_cdata.dc_tx_chain[idx] = NULL; } sc->dc_cdata.dc_tx_cons = idx; - if (DC_TX_LIST_CNT - sc->dc_cdata.dc_tx_cnt > DC_TX_LIST_RSVD) + if (sc->dc_cdata.dc_tx_cnt <= DC_TX_LIST_CNT - DC_TX_LIST_RSVD) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - - if (sc->dc_cdata.dc_tx_cnt == 0) - sc->dc_wdog_timer = 0; + if (sc->dc_cdata.dc_tx_cnt == 0) + sc->dc_wdog_timer = 0; + } + if (setup > 0) + bus_dmamap_sync(sc->dc_tx_ltag, sc->dc_tx_lmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } static void @@ -3226,16 +3342,11 @@ static int dc_encap(struct dc_softc *sc, struct mbuf **m_head) { bus_dma_segment_t segs[DC_MAXFRAGS]; + bus_dmamap_t map; struct dc_desc *f; struct mbuf *m; int cur, defragged, error, first, frag, i, idx, nseg; - /* - * If there's no way we can send any packets, return now. - */ - if (DC_TX_LIST_CNT - sc->dc_cdata.dc_tx_cnt <= DC_TX_LIST_RSVD) - return (ENOBUFS); - m = NULL; defragged = 0; if (sc->dc_flags & DC_TX_COALESCE && @@ -3269,7 +3380,7 @@ dc_encap(struct dc_softc *sc, struct mbu } idx = sc->dc_cdata.dc_tx_prod; - error = bus_dmamap_load_mbuf_sg(sc->dc_mtag, + error = bus_dmamap_load_mbuf_sg(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], *m_head, segs, &nseg, 0); if (error == EFBIG) { if (defragged != 0 || (m = m_collapse(*m_head, M_DONTWAIT, @@ -3279,7 +3390,7 @@ dc_encap(struct dc_softc *sc, struct mbu return (defragged != 0 ? error : ENOBUFS); } *m_head = m; - error = bus_dmamap_load_mbuf_sg(sc->dc_mtag, + error = bus_dmamap_load_mbuf_sg(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], *m_head, segs, &nseg, 0); if (error != 0) { m_freem(*m_head); @@ -3296,26 +3407,34 @@ dc_encap(struct dc_softc *sc, struct mbu return (EIO); } + /* Check descriptor overruns. */ + if (sc->dc_cdata.dc_tx_cnt + nseg > DC_TX_LIST_CNT - DC_TX_LIST_RSVD) { + bus_dmamap_unload(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx]); + return (ENOBUFS); + } + bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], + BUS_DMASYNC_PREWRITE); + first = cur = frag = sc->dc_cdata.dc_tx_prod; for (i = 0; i < nseg; i++) { if ((sc->dc_flags & DC_TX_ADMTEK_WAR) && (frag == (DC_TX_LIST_CNT - 1)) && (first != sc->dc_cdata.dc_tx_first)) { - bus_dmamap_unload(sc->dc_mtag, + bus_dmamap_unload(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[first]); m_freem(*m_head); *m_head = NULL; return (ENOBUFS); } - f = &sc->dc_ldata->dc_tx_list[frag]; + f = &sc->dc_ldata.dc_tx_list[frag]; f->dc_ctl = htole32(DC_TXCTL_TLINK | segs[i].ds_len); if (i == 0) { f->dc_status = 0; f->dc_ctl |= htole32(DC_TXCTL_FIRSTFRAG); } else f->dc_status = htole32(DC_TXSTAT_OWN); - f->dc_data = htole32(segs[i].ds_addr); + f->dc_data = htole32(DC_ADDR_LO(segs[i].ds_addr)); cur = frag; DC_INC(frag, DC_TX_LIST_CNT); } @@ -3323,23 +3442,30 @@ dc_encap(struct dc_softc *sc, struct mbu sc->dc_cdata.dc_tx_prod = frag; sc->dc_cdata.dc_tx_cnt += nseg; sc->dc_cdata.dc_tx_chain[cur] = *m_head; - sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_LASTFRAG); + sc->dc_ldata.dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_LASTFRAG); if (sc->dc_flags & DC_TX_INTR_FIRSTFRAG) - sc->dc_ldata->dc_tx_list[first].dc_ctl |= + sc->dc_ldata.dc_tx_list[first].dc_ctl |= htole32(DC_TXCTL_FINT); if (sc->dc_flags & DC_TX_INTR_ALWAYS) - sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); + sc->dc_ldata.dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); if (sc->dc_flags & DC_TX_USE_TX_INTR && ++sc->dc_cdata.dc_tx_pkts >= 8) { sc->dc_cdata.dc_tx_pkts = 0; - sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); + sc->dc_ldata.dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT); } - sc->dc_ldata->dc_tx_list[first].dc_status = htole32(DC_TXSTAT_OWN); + sc->dc_ldata.dc_tx_list[first].dc_status = htole32(DC_TXSTAT_OWN); + + bus_dmamap_sync(sc->dc_tx_ltag, sc->dc_tx_lmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* + * Swap the last and the first dmamaps to ensure the map for + * this transmission is placed at the last descriptor. + */ + map = sc->dc_cdata.dc_tx_map[cur]; + sc->dc_cdata.dc_tx_map[cur] = sc->dc_cdata.dc_tx_map[first]; + sc->dc_cdata.dc_tx_map[first] = map; - bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_tx_map[idx], - BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, - BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return (0); } @@ -3365,9 +3491,8 @@ static void dc_start_locked(struct ifnet *ifp) { struct dc_softc *sc; - struct mbuf *m_head = NULL; - unsigned int queued = 0; - int idx; + struct mbuf *m_head; + int queued; sc = ifp->if_softc; @@ -3377,9 +3502,16 @@ dc_start_locked(struct ifnet *ifp) IFF_DRV_RUNNING || sc->dc_link == 0) return; - idx = sc->dc_cdata.dc_tx_first = sc->dc_cdata.dc_tx_prod; + sc->dc_cdata.dc_tx_first = sc->dc_cdata.dc_tx_prod; - while (sc->dc_cdata.dc_tx_chain[idx] == NULL) { + for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd); ) { + /* + * If there's no way we can send any packets, return now. + */ + if (sc->dc_cdata.dc_tx_cnt > DC_TX_LIST_CNT - DC_TX_LIST_RSVD) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -3391,7 +3523,6 @@ dc_start_locked(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - idx = sc->dc_cdata.dc_tx_prod; queued++; /* @@ -3778,7 +3909,7 @@ dc_stop(struct dc_softc *sc) DC_LOCK_ASSERT(sc); ifp = sc->dc_ifp; - ld = sc->dc_ldata; + ld = &sc->dc_ldata; cd = &sc->dc_cdata; callout_stop(&sc->dc_stat_ch); @@ -3798,11 +3929,17 @@ dc_stop(struct dc_softc *sc) */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 03:01: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 A8053106564A; Sat, 19 Feb 2011 03:01:24 +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 94B598FC15; Sat, 19 Feb 2011 03:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J31Oa5081742; Sat, 19 Feb 2011 03:01:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J31O3g081740; Sat, 19 Feb 2011 03:01:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190301.p1J31O3g081740@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 03:01: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: r218833 - 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: Sat, 19 Feb 2011 03:01:24 -0000 Author: yongari Date: Sat Feb 19 03:01:24 2011 New Revision: 218833 URL: http://svn.freebsd.org/changeset/base/218833 Log: Count how many frames driver lost in interrupt handler. This register is cleared on read so make sure to clear it in driver initialization phase. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Feb 19 02:47:10 2011 (r218832) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:01:24 2011 (r218833) @@ -3250,7 +3250,7 @@ dc_intr(void *arg) { struct dc_softc *sc; struct ifnet *ifp; - u_int32_t status; + u_int32_t r, status; int curpkts, n; sc = arg; @@ -3305,6 +3305,8 @@ dc_intr(void *arg) if ((status & DC_ISR_RX_WATDOGTIMEO) || (status & DC_ISR_RX_NOBUF)) { + r = CSR_READ_4(sc, DC_FRAMESDISCARDED); + ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); curpkts = ifp->if_ipackets; dc_rxeof(sc); if (curpkts == ifp->if_ipackets) { @@ -3723,6 +3725,9 @@ dc_init_locked(struct dc_softc *sc) mii_mediachg(mii); dc_setcfg(sc, sc->dc_if_media); + /* Clear missed frames and overflow counter. */ + CSR_READ_4(sc, DC_FRAMESDISCARDED); + /* Don't start the ticker if this is a homePNA link. */ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1) sc->dc_link = 1; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 03: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 6063B106564A; Sat, 19 Feb 2011 03:23:19 +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 4D57F8FC14; Sat, 19 Feb 2011 03:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J3NJNA082379; Sat, 19 Feb 2011 03:23:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J3NJbe082376; Sat, 19 Feb 2011 03:23:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190323.p1J3NJbe082376@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 03:23: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: r218834 - 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: Sat, 19 Feb 2011 03:23:19 -0000 Author: yongari Date: Sat Feb 19 03:23:19 2011 New Revision: 218834 URL: http://svn.freebsd.org/changeset/base/218834 Log: Consistently use a tab character instead of space after #define. No functional changes. Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Feb 19 03:01:24 2011 (r218833) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:23:19 2011 (r218834) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define DC_USEIOSPACE +#define DC_USEIOSPACE #include @@ -301,11 +301,11 @@ static void dc_apply_fixup(struct dc_sof static int dc_check_multiport(struct dc_softc *); #ifdef DC_USEIOSPACE -#define DC_RES SYS_RES_IOPORT -#define DC_RID DC_PCI_CFBIO +#define DC_RES SYS_RES_IOPORT +#define DC_RID DC_PCI_CFBIO #else -#define DC_RES SYS_RES_MEMORY -#define DC_RID DC_PCI_CFBMA +#define DC_RES SYS_RES_MEMORY +#define DC_RID DC_PCI_CFBMA #endif static device_method_t dc_methods[] = { @@ -341,14 +341,14 @@ static devclass_t dc_devclass; DRIVER_MODULE(dc, pci, dc_driver, dc_devclass, 0, 0); DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0); -#define DC_SETBIT(sc, reg, x) \ +#define DC_SETBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x)) -#define DC_CLRBIT(sc, reg, x) \ +#define DC_CLRBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) & ~(x)) -#define SIO_SET(x) DC_SETBIT(sc, DC_SIO, (x)) -#define SIO_CLR(x) DC_CLRBIT(sc, DC_SIO, (x)) +#define SIO_SET(x) DC_SETBIT(sc, DC_SIO, (x)) +#define SIO_CLR(x) DC_CLRBIT(sc, DC_SIO, (x)) static void dc_delay(struct dc_softc *sc) @@ -1016,9 +1016,9 @@ dc_miibus_mediainit(device_t dev) ifmedia_add(ifm, IFM_ETHER | IFM_HPNA_1, 0, NULL); } -#define DC_BITS_512 9 -#define DC_BITS_128 7 -#define DC_BITS_64 6 +#define DC_BITS_512 9 +#define DC_BITS_128 7 +#define DC_BITS_64 6 static uint32_t dc_mchash_le(struct dc_softc *sc, const uint8_t *addr) @@ -2715,7 +2715,7 @@ dc_newbuf(struct dc_softc *sc, int i) * the time. */ -#define DC_WHOLEFRAME (DC_RXSTAT_FIRSTFRAG | DC_RXSTAT_LASTFRAG) +#define DC_WHOLEFRAME (DC_RXSTAT_FIRSTFRAG | DC_RXSTAT_LASTFRAG) static void dc_pnic_rx_bug_war(struct dc_softc *sc, int idx) { Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Sat Feb 19 03:01:24 2011 (r218833) +++ head/sys/dev/dc/if_dcreg.h Sat Feb 19 03:23:19 2011 (r218834) @@ -36,23 +36,23 @@ * 21143 and clone common register definitions. */ -#define DC_BUSCTL 0x00 /* bus control */ -#define DC_TXSTART 0x08 /* tx start demand */ -#define DC_RXSTART 0x10 /* rx start demand */ -#define DC_RXADDR 0x18 /* rx descriptor list start addr */ -#define DC_TXADDR 0x20 /* tx descriptor list start addr */ -#define DC_ISR 0x28 /* interrupt status register */ -#define DC_NETCFG 0x30 /* network config register */ -#define DC_IMR 0x38 /* interrupt mask */ -#define DC_FRAMESDISCARDED 0x40 /* # of discarded frames */ -#define DC_SIO 0x48 /* MII and ROM/EEPROM access */ -#define DC_ROM 0x50 /* ROM programming address */ -#define DC_TIMER 0x58 /* general timer */ -#define DC_10BTSTAT 0x60 /* SIA status */ -#define DC_SIARESET 0x68 /* SIA connectivity */ -#define DC_10BTCTRL 0x70 /* SIA transmit and receive */ -#define DC_WATCHDOG 0x78 /* SIA and general purpose port */ -#define DC_SIAGP 0x78 /* SIA and general purpose port (X3201) */ +#define DC_BUSCTL 0x00 /* bus control */ +#define DC_TXSTART 0x08 /* tx start demand */ +#define DC_RXSTART 0x10 /* rx start demand */ +#define DC_RXADDR 0x18 /* rx descriptor list start addr */ +#define DC_TXADDR 0x20 /* tx descriptor list start addr */ +#define DC_ISR 0x28 /* interrupt status register */ +#define DC_NETCFG 0x30 /* network config register */ +#define DC_IMR 0x38 /* interrupt mask */ +#define DC_FRAMESDISCARDED 0x40 /* # of discarded frames */ +#define DC_SIO 0x48 /* MII and ROM/EEPROM access */ +#define DC_ROM 0x50 /* ROM programming address */ +#define DC_TIMER 0x58 /* general timer */ +#define DC_10BTSTAT 0x60 /* SIA status */ +#define DC_SIARESET 0x68 /* SIA connectivity */ +#define DC_10BTCTRL 0x70 /* SIA transmit and receive */ +#define DC_WATCHDOG 0x78 /* SIA and general purpose port */ +#define DC_SIAGP 0x78 /* SIA and general purpose port (X3201) */ /* * There are two general 'types' of MX chips that we need to be @@ -64,328 +64,328 @@ * 'magic' numbers we write to CSR16. The PNIC II falls into the * 98713A/98715/98715A/98725 category. */ -#define DC_TYPE_98713 0x1 -#define DC_TYPE_98713A 0x2 -#define DC_TYPE_987x5 0x3 +#define DC_TYPE_98713 0x1 +#define DC_TYPE_98713A 0x2 +#define DC_TYPE_987x5 0x3 /* Other type of supported chips. */ -#define DC_TYPE_21143 0x4 /* Intel 21143 */ -#define DC_TYPE_ASIX 0x5 /* ASIX AX88140A/AX88141 */ -#define DC_TYPE_AL981 0x6 /* ADMtek AL981 Comet */ -#define DC_TYPE_AN983 0x7 /* ADMtek AN983 Centaur */ -#define DC_TYPE_DM9102 0x8 /* Davicom DM9102 */ -#define DC_TYPE_PNICII 0x9 /* 82c115 PNIC II */ -#define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */ +#define DC_TYPE_21143 0x4 /* Intel 21143 */ +#define DC_TYPE_ASIX 0x5 /* ASIX AX88140A/AX88141 */ +#define DC_TYPE_AL981 0x6 /* ADMtek AL981 Comet */ +#define DC_TYPE_AN983 0x7 /* ADMtek AN983 Centaur */ +#define DC_TYPE_DM9102 0x8 /* Davicom DM9102 */ +#define DC_TYPE_PNICII 0x9 /* 82c115 PNIC II */ +#define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */ #define DC_TYPE_XIRCOM 0xB /* Xircom X3201 */ -#define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */ +#define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */ -#define DC_IS_MACRONIX(x) \ +#define DC_IS_MACRONIX(x) \ (x->dc_type == DC_TYPE_98713 || \ x->dc_type == DC_TYPE_98713A || \ x->dc_type == DC_TYPE_987x5) -#define DC_IS_ADMTEK(x) \ +#define DC_IS_ADMTEK(x) \ (x->dc_type == DC_TYPE_AL981 || \ x->dc_type == DC_TYPE_AN983) -#define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143) -#define DC_IS_ASIX(x) (x->dc_type == DC_TYPE_ASIX) -#define DC_IS_COMET(x) (x->dc_type == DC_TYPE_AL981) -#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN983) -#define DC_IS_DAVICOM(x) (x->dc_type == DC_TYPE_DM9102) -#define DC_IS_PNICII(x) (x->dc_type == DC_TYPE_PNICII) -#define DC_IS_PNIC(x) (x->dc_type == DC_TYPE_PNIC) +#define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143) +#define DC_IS_ASIX(x) (x->dc_type == DC_TYPE_ASIX) +#define DC_IS_COMET(x) (x->dc_type == DC_TYPE_AL981) +#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN983) +#define DC_IS_DAVICOM(x) (x->dc_type == DC_TYPE_DM9102) +#define DC_IS_PNICII(x) (x->dc_type == DC_TYPE_PNICII) +#define DC_IS_PNIC(x) (x->dc_type == DC_TYPE_PNIC) #define DC_IS_XIRCOM(x) (x->dc_type == DC_TYPE_XIRCOM) -#define DC_IS_CONEXANT(x) (x->dc_type == DC_TYPE_CONEXANT) +#define DC_IS_CONEXANT(x) (x->dc_type == DC_TYPE_CONEXANT) /* MII/symbol mode port types */ -#define DC_PMODE_MII 0x1 -#define DC_PMODE_SYM 0x2 -#define DC_PMODE_SIA 0x3 +#define DC_PMODE_MII 0x1 +#define DC_PMODE_SYM 0x2 +#define DC_PMODE_SIA 0x3 /* * Bus control bits. */ -#define DC_BUSCTL_RESET 0x00000001 -#define DC_BUSCTL_ARBITRATION 0x00000002 -#define DC_BUSCTL_SKIPLEN 0x0000007C -#define DC_BUSCTL_BUF_BIGENDIAN 0x00000080 -#define DC_BUSCTL_BURSTLEN 0x00003F00 -#define DC_BUSCTL_CACHEALIGN 0x0000C000 -#define DC_BUSCTL_TXPOLL 0x000E0000 -#define DC_BUSCTL_DBO 0x00100000 -#define DC_BUSCTL_MRME 0x00200000 -#define DC_BUSCTL_MRLE 0x00800000 -#define DC_BUSCTL_MWIE 0x01000000 -#define DC_BUSCTL_ONNOW_ENB 0x04000000 - -#define DC_SKIPLEN_1LONG 0x00000004 -#define DC_SKIPLEN_2LONG 0x00000008 -#define DC_SKIPLEN_3LONG 0x00000010 -#define DC_SKIPLEN_4LONG 0x00000020 -#define DC_SKIPLEN_5LONG 0x00000040 - -#define DC_CACHEALIGN_NONE 0x00000000 -#define DC_CACHEALIGN_8LONG 0x00004000 -#define DC_CACHEALIGN_16LONG 0x00008000 -#define DC_CACHEALIGN_32LONG 0x0000C000 - -#define DC_BURSTLEN_USECA 0x00000000 -#define DC_BURSTLEN_1LONG 0x00000100 -#define DC_BURSTLEN_2LONG 0x00000200 -#define DC_BURSTLEN_4LONG 0x00000400 -#define DC_BURSTLEN_8LONG 0x00000800 -#define DC_BURSTLEN_16LONG 0x00001000 -#define DC_BURSTLEN_32LONG 0x00002000 - -#define DC_TXPOLL_OFF 0x00000000 -#define DC_TXPOLL_1 0x00020000 -#define DC_TXPOLL_2 0x00040000 -#define DC_TXPOLL_3 0x00060000 -#define DC_TXPOLL_4 0x00080000 -#define DC_TXPOLL_5 0x000A0000 -#define DC_TXPOLL_6 0x000C0000 -#define DC_TXPOLL_7 0x000E0000 +#define DC_BUSCTL_RESET 0x00000001 +#define DC_BUSCTL_ARBITRATION 0x00000002 +#define DC_BUSCTL_SKIPLEN 0x0000007C +#define DC_BUSCTL_BUF_BIGENDIAN 0x00000080 +#define DC_BUSCTL_BURSTLEN 0x00003F00 +#define DC_BUSCTL_CACHEALIGN 0x0000C000 +#define DC_BUSCTL_TXPOLL 0x000E0000 +#define DC_BUSCTL_DBO 0x00100000 +#define DC_BUSCTL_MRME 0x00200000 +#define DC_BUSCTL_MRLE 0x00800000 +#define DC_BUSCTL_MWIE 0x01000000 +#define DC_BUSCTL_ONNOW_ENB 0x04000000 + +#define DC_SKIPLEN_1LONG 0x00000004 +#define DC_SKIPLEN_2LONG 0x00000008 +#define DC_SKIPLEN_3LONG 0x00000010 +#define DC_SKIPLEN_4LONG 0x00000020 +#define DC_SKIPLEN_5LONG 0x00000040 + +#define DC_CACHEALIGN_NONE 0x00000000 +#define DC_CACHEALIGN_8LONG 0x00004000 +#define DC_CACHEALIGN_16LONG 0x00008000 +#define DC_CACHEALIGN_32LONG 0x0000C000 + +#define DC_BURSTLEN_USECA 0x00000000 +#define DC_BURSTLEN_1LONG 0x00000100 +#define DC_BURSTLEN_2LONG 0x00000200 +#define DC_BURSTLEN_4LONG 0x00000400 +#define DC_BURSTLEN_8LONG 0x00000800 +#define DC_BURSTLEN_16LONG 0x00001000 +#define DC_BURSTLEN_32LONG 0x00002000 + +#define DC_TXPOLL_OFF 0x00000000 +#define DC_TXPOLL_1 0x00020000 +#define DC_TXPOLL_2 0x00040000 +#define DC_TXPOLL_3 0x00060000 +#define DC_TXPOLL_4 0x00080000 +#define DC_TXPOLL_5 0x000A0000 +#define DC_TXPOLL_6 0x000C0000 +#define DC_TXPOLL_7 0x000E0000 /* * Interrupt status bits. */ -#define DC_ISR_TX_OK 0x00000001 -#define DC_ISR_TX_IDLE 0x00000002 -#define DC_ISR_TX_NOBUF 0x00000004 -#define DC_ISR_TX_JABBERTIMEO 0x00000008 -#define DC_ISR_LINKGOOD 0x00000010 -#define DC_ISR_TX_UNDERRUN 0x00000020 -#define DC_ISR_RX_OK 0x00000040 -#define DC_ISR_RX_NOBUF 0x00000080 -#define DC_ISR_RX_READ 0x00000100 -#define DC_ISR_RX_WATDOGTIMEO 0x00000200 -#define DC_ISR_TX_EARLY 0x00000400 -#define DC_ISR_TIMER_EXPIRED 0x00000800 -#define DC_ISR_LINKFAIL 0x00001000 -#define DC_ISR_BUS_ERR 0x00002000 -#define DC_ISR_RX_EARLY 0x00004000 -#define DC_ISR_ABNORMAL 0x00008000 -#define DC_ISR_NORMAL 0x00010000 -#define DC_ISR_RX_STATE 0x000E0000 -#define DC_ISR_TX_STATE 0x00700000 -#define DC_ISR_BUSERRTYPE 0x03800000 -#define DC_ISR_100MBPSLINK 0x08000000 -#define DC_ISR_MAGICKPACK 0x10000000 - -#define DC_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */ -#define DC_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */ -#define DC_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */ -#define DC_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */ -#define DC_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */ -#define DC_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */ -#define DC_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */ -#define DC_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */ +#define DC_ISR_TX_OK 0x00000001 +#define DC_ISR_TX_IDLE 0x00000002 +#define DC_ISR_TX_NOBUF 0x00000004 +#define DC_ISR_TX_JABBERTIMEO 0x00000008 +#define DC_ISR_LINKGOOD 0x00000010 +#define DC_ISR_TX_UNDERRUN 0x00000020 +#define DC_ISR_RX_OK 0x00000040 +#define DC_ISR_RX_NOBUF 0x00000080 +#define DC_ISR_RX_READ 0x00000100 +#define DC_ISR_RX_WATDOGTIMEO 0x00000200 +#define DC_ISR_TX_EARLY 0x00000400 +#define DC_ISR_TIMER_EXPIRED 0x00000800 +#define DC_ISR_LINKFAIL 0x00001000 +#define DC_ISR_BUS_ERR 0x00002000 +#define DC_ISR_RX_EARLY 0x00004000 +#define DC_ISR_ABNORMAL 0x00008000 +#define DC_ISR_NORMAL 0x00010000 +#define DC_ISR_RX_STATE 0x000E0000 +#define DC_ISR_TX_STATE 0x00700000 +#define DC_ISR_BUSERRTYPE 0x03800000 +#define DC_ISR_100MBPSLINK 0x08000000 +#define DC_ISR_MAGICKPACK 0x10000000 + +#define DC_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */ +#define DC_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */ +#define DC_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */ +#define DC_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */ +#define DC_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */ +#define DC_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */ +#define DC_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */ +#define DC_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */ #define DC_HAS_BROKEN_RXSTATE(x) \ (DC_IS_CENTAUR(x) || DC_IS_CONEXANT(x) || (DC_IS_DAVICOM(x) && \ pci_get_revid((x)->dc_dev) >= DC_REVISION_DM9102A)) -#define DC_TXSTATE_RESET 0x00000000 /* 000 - reset */ -#define DC_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */ -#define DC_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */ -#define DC_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */ -#define DC_TXSTATE_RSVD 0x00400000 /* 100 - reserved */ -#define DC_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */ -#define DC_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */ -#define DC_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */ +#define DC_TXSTATE_RESET 0x00000000 /* 000 - reset */ +#define DC_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */ +#define DC_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */ +#define DC_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */ +#define DC_TXSTATE_RSVD 0x00400000 /* 100 - reserved */ +#define DC_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */ +#define DC_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */ +#define DC_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */ /* * Network config bits. */ -#define DC_NETCFG_RX_HASHPERF 0x00000001 -#define DC_NETCFG_RX_ON 0x00000002 -#define DC_NETCFG_RX_HASHONLY 0x00000004 -#define DC_NETCFG_RX_BADFRAMES 0x00000008 -#define DC_NETCFG_RX_INVFILT 0x00000010 -#define DC_NETCFG_BACKOFFCNT 0x00000020 -#define DC_NETCFG_RX_PROMISC 0x00000040 -#define DC_NETCFG_RX_ALLMULTI 0x00000080 -#define DC_NETCFG_FULLDUPLEX 0x00000200 -#define DC_NETCFG_LOOPBACK 0x00000C00 -#define DC_NETCFG_FORCECOLL 0x00001000 -#define DC_NETCFG_TX_ON 0x00002000 -#define DC_NETCFG_TX_THRESH 0x0000C000 -#define DC_NETCFG_TX_BACKOFF 0x00020000 -#define DC_NETCFG_PORTSEL 0x00040000 /* 0 == 10, 1 == 100 */ -#define DC_NETCFG_HEARTBEAT 0x00080000 -#define DC_NETCFG_STORENFWD 0x00200000 -#define DC_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */ -#define DC_NETCFG_PCS 0x00800000 -#define DC_NETCFG_SCRAMBLER 0x01000000 -#define DC_NETCFG_NO_RXCRC 0x02000000 -#define DC_NETCFG_RX_ALL 0x40000000 -#define DC_NETCFG_CAPEFFECT 0x80000000 - -#define DC_OPMODE_NORM 0x00000000 -#define DC_OPMODE_INTLOOP 0x00000400 -#define DC_OPMODE_EXTLOOP 0x00000800 +#define DC_NETCFG_RX_HASHPERF 0x00000001 +#define DC_NETCFG_RX_ON 0x00000002 +#define DC_NETCFG_RX_HASHONLY 0x00000004 +#define DC_NETCFG_RX_BADFRAMES 0x00000008 +#define DC_NETCFG_RX_INVFILT 0x00000010 +#define DC_NETCFG_BACKOFFCNT 0x00000020 +#define DC_NETCFG_RX_PROMISC 0x00000040 +#define DC_NETCFG_RX_ALLMULTI 0x00000080 +#define DC_NETCFG_FULLDUPLEX 0x00000200 +#define DC_NETCFG_LOOPBACK 0x00000C00 +#define DC_NETCFG_FORCECOLL 0x00001000 +#define DC_NETCFG_TX_ON 0x00002000 +#define DC_NETCFG_TX_THRESH 0x0000C000 +#define DC_NETCFG_TX_BACKOFF 0x00020000 +#define DC_NETCFG_PORTSEL 0x00040000 /* 0 == 10, 1 == 100 */ +#define DC_NETCFG_HEARTBEAT 0x00080000 +#define DC_NETCFG_STORENFWD 0x00200000 +#define DC_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */ +#define DC_NETCFG_PCS 0x00800000 +#define DC_NETCFG_SCRAMBLER 0x01000000 +#define DC_NETCFG_NO_RXCRC 0x02000000 +#define DC_NETCFG_RX_ALL 0x40000000 +#define DC_NETCFG_CAPEFFECT 0x80000000 + +#define DC_OPMODE_NORM 0x00000000 +#define DC_OPMODE_INTLOOP 0x00000400 +#define DC_OPMODE_EXTLOOP 0x00000800 #if 0 -#define DC_TXTHRESH_72BYTES 0x00000000 -#define DC_TXTHRESH_96BYTES 0x00004000 -#define DC_TXTHRESH_128BYTES 0x00008000 -#define DC_TXTHRESH_160BYTES 0x0000C000 +#define DC_TXTHRESH_72BYTES 0x00000000 +#define DC_TXTHRESH_96BYTES 0x00004000 +#define DC_TXTHRESH_128BYTES 0x00008000 +#define DC_TXTHRESH_160BYTES 0x0000C000 #endif -#define DC_TXTHRESH_MIN 0x00000000 -#define DC_TXTHRESH_INC 0x00004000 -#define DC_TXTHRESH_MAX 0x0000C000 +#define DC_TXTHRESH_MIN 0x00000000 +#define DC_TXTHRESH_INC 0x00004000 +#define DC_TXTHRESH_MAX 0x0000C000 /* * Interrupt mask bits. */ -#define DC_IMR_TX_OK 0x00000001 -#define DC_IMR_TX_IDLE 0x00000002 -#define DC_IMR_TX_NOBUF 0x00000004 -#define DC_IMR_TX_JABBERTIMEO 0x00000008 -#define DC_IMR_LINKGOOD 0x00000010 -#define DC_IMR_TX_UNDERRUN 0x00000020 -#define DC_IMR_RX_OK 0x00000040 -#define DC_IMR_RX_NOBUF 0x00000080 -#define DC_IMR_RX_READ 0x00000100 -#define DC_IMR_RX_WATDOGTIMEO 0x00000200 -#define DC_IMR_TX_EARLY 0x00000400 -#define DC_IMR_TIMER_EXPIRED 0x00000800 -#define DC_IMR_LINKFAIL 0x00001000 -#define DC_IMR_BUS_ERR 0x00002000 -#define DC_IMR_RX_EARLY 0x00004000 -#define DC_IMR_ABNORMAL 0x00008000 -#define DC_IMR_NORMAL 0x00010000 -#define DC_IMR_100MBPSLINK 0x08000000 -#define DC_IMR_MAGICKPACK 0x10000000 +#define DC_IMR_TX_OK 0x00000001 +#define DC_IMR_TX_IDLE 0x00000002 +#define DC_IMR_TX_NOBUF 0x00000004 +#define DC_IMR_TX_JABBERTIMEO 0x00000008 +#define DC_IMR_LINKGOOD 0x00000010 +#define DC_IMR_TX_UNDERRUN 0x00000020 +#define DC_IMR_RX_OK 0x00000040 +#define DC_IMR_RX_NOBUF 0x00000080 +#define DC_IMR_RX_READ 0x00000100 +#define DC_IMR_RX_WATDOGTIMEO 0x00000200 +#define DC_IMR_TX_EARLY 0x00000400 +#define DC_IMR_TIMER_EXPIRED 0x00000800 +#define DC_IMR_LINKFAIL 0x00001000 +#define DC_IMR_BUS_ERR 0x00002000 +#define DC_IMR_RX_EARLY 0x00004000 +#define DC_IMR_ABNORMAL 0x00008000 +#define DC_IMR_NORMAL 0x00010000 +#define DC_IMR_100MBPSLINK 0x08000000 +#define DC_IMR_MAGICKPACK 0x10000000 -#define DC_INTRS \ +#define DC_INTRS \ (DC_IMR_RX_OK|DC_IMR_TX_OK|DC_IMR_RX_NOBUF|DC_IMR_RX_WATDOGTIMEO|\ DC_IMR_TX_NOBUF|DC_IMR_TX_UNDERRUN|DC_IMR_BUS_ERR| \ DC_IMR_ABNORMAL|DC_IMR_NORMAL/*|DC_IMR_TX_EARLY*/) /* * Serial I/O (EEPROM/ROM) bits. */ -#define DC_SIO_EE_CS 0x00000001 /* EEPROM chip select */ -#define DC_SIO_EE_CLK 0x00000002 /* EEPROM clock */ -#define DC_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */ -#define DC_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */ -#define DC_SIO_ROMDATA4 0x00000010 -#define DC_SIO_ROMDATA5 0x00000020 -#define DC_SIO_ROMDATA6 0x00000040 -#define DC_SIO_ROMDATA7 0x00000080 -#define DC_SIO_EESEL 0x00000800 -#define DC_SIO_ROMSEL 0x00001000 -#define DC_SIO_ROMCTL_WRITE 0x00002000 -#define DC_SIO_ROMCTL_READ 0x00004000 -#define DC_SIO_MII_CLK 0x00010000 /* MDIO clock */ -#define DC_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */ -#define DC_SIO_MII_DIR 0x00040000 /* MDIO dir */ -#define DC_SIO_MII_DATAIN 0x00080000 /* MDIO data in */ - -#define DC_EECMD_WRITE 0x140 -#define DC_EECMD_READ 0x180 -#define DC_EECMD_ERASE 0x1c0 +#define DC_SIO_EE_CS 0x00000001 /* EEPROM chip select */ +#define DC_SIO_EE_CLK 0x00000002 /* EEPROM clock */ +#define DC_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */ +#define DC_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */ +#define DC_SIO_ROMDATA4 0x00000010 +#define DC_SIO_ROMDATA5 0x00000020 +#define DC_SIO_ROMDATA6 0x00000040 +#define DC_SIO_ROMDATA7 0x00000080 +#define DC_SIO_EESEL 0x00000800 +#define DC_SIO_ROMSEL 0x00001000 +#define DC_SIO_ROMCTL_WRITE 0x00002000 +#define DC_SIO_ROMCTL_READ 0x00004000 +#define DC_SIO_MII_CLK 0x00010000 /* MDIO clock */ +#define DC_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */ +#define DC_SIO_MII_DIR 0x00040000 /* MDIO dir */ +#define DC_SIO_MII_DATAIN 0x00080000 /* MDIO data in */ + +#define DC_EECMD_WRITE 0x140 +#define DC_EECMD_READ 0x180 +#define DC_EECMD_ERASE 0x1c0 -#define DC_EE_NODEADDR_OFFSET 0x70 -#define DC_EE_NODEADDR 10 +#define DC_EE_NODEADDR_OFFSET 0x70 +#define DC_EE_NODEADDR 10 /* * General purpose timer register */ -#define DC_TIMER_VALUE 0x0000FFFF -#define DC_TIMER_CONTINUOUS 0x00010000 +#define DC_TIMER_VALUE 0x0000FFFF +#define DC_TIMER_CONTINUOUS 0x00010000 /* * 10baseT status register */ -#define DC_TSTAT_MIIACT 0x00000001 /* MII port activity */ -#define DC_TSTAT_LS100 0x00000002 /* link status of 100baseTX */ -#define DC_TSTAT_LS10 0x00000004 /* link status of 10baseT */ -#define DC_TSTAT_AUTOPOLARITY 0x00000008 -#define DC_TSTAT_AUIACT 0x00000100 /* AUI activity */ -#define DC_TSTAT_10BTACT 0x00000200 /* 10baseT activity */ -#define DC_TSTAT_NSN 0x00000400 /* non-stable FLPs detected */ -#define DC_TSTAT_REMFAULT 0x00000800 -#define DC_TSTAT_ANEGSTAT 0x00007000 -#define DC_TSTAT_LP_CAN_NWAY 0x00008000 /* link partner supports NWAY */ -#define DC_TSTAT_LPCODEWORD 0xFFFF0000 /* link partner's code word */ - -#define DC_ASTAT_DISABLE 0x00000000 -#define DC_ASTAT_TXDISABLE 0x00001000 -#define DC_ASTAT_ABDETECT 0x00002000 -#define DC_ASTAT_ACKDETECT 0x00003000 -#define DC_ASTAT_CMPACKDETECT 0x00004000 -#define DC_ASTAT_AUTONEGCMP 0x00005000 -#define DC_ASTAT_LINKCHECK 0x00006000 +#define DC_TSTAT_MIIACT 0x00000001 /* MII port activity */ +#define DC_TSTAT_LS100 0x00000002 /* link status of 100baseTX */ +#define DC_TSTAT_LS10 0x00000004 /* link status of 10baseT */ +#define DC_TSTAT_AUTOPOLARITY 0x00000008 +#define DC_TSTAT_AUIACT 0x00000100 /* AUI activity */ +#define DC_TSTAT_10BTACT 0x00000200 /* 10baseT activity */ +#define DC_TSTAT_NSN 0x00000400 /* non-stable FLPs detected */ +#define DC_TSTAT_REMFAULT 0x00000800 +#define DC_TSTAT_ANEGSTAT 0x00007000 +#define DC_TSTAT_LP_CAN_NWAY 0x00008000 /* link partner supports NWAY */ +#define DC_TSTAT_LPCODEWORD 0xFFFF0000 /* link partner's code word */ + +#define DC_ASTAT_DISABLE 0x00000000 +#define DC_ASTAT_TXDISABLE 0x00001000 +#define DC_ASTAT_ABDETECT 0x00002000 +#define DC_ASTAT_ACKDETECT 0x00003000 +#define DC_ASTAT_CMPACKDETECT 0x00004000 +#define DC_ASTAT_AUTONEGCMP 0x00005000 +#define DC_ASTAT_LINKCHECK 0x00006000 /* * PHY reset register */ -#define DC_SIA_RESET 0x00000001 -#define DC_SIA_AUI 0x00000008 /* AUI or 10baseT */ +#define DC_SIA_RESET 0x00000001 +#define DC_SIA_AUI 0x00000008 /* AUI or 10baseT */ /* * 10baseT control register */ -#define DC_TCTL_ENCODER_ENB 0x00000001 -#define DC_TCTL_LOOPBACK 0x00000002 -#define DC_TCTL_DRIVER_ENB 0x00000004 -#define DC_TCTL_LNKPULSE_ENB 0x00000008 -#define DC_TCTL_HALFDUPLEX 0x00000040 -#define DC_TCTL_AUTONEGENBL 0x00000080 -#define DC_TCTL_RX_SQUELCH 0x00000100 -#define DC_TCTL_COLL_SQUELCH 0x00000200 -#define DC_TCTL_COLL_DETECT 0x00000400 -#define DC_TCTL_SQE_ENB 0x00000800 -#define DC_TCTL_LINKTEST 0x00001000 -#define DC_TCTL_AUTOPOLARITY 0x00002000 -#define DC_TCTL_SET_POL_PLUS 0x00004000 -#define DC_TCTL_AUTOSENSE 0x00008000 /* 10bt/AUI autosense */ -#define DC_TCTL_100BTXHALF 0x00010000 -#define DC_TCTL_100BTXFULL 0x00020000 -#define DC_TCTL_100BT4 0x00040000 +#define DC_TCTL_ENCODER_ENB 0x00000001 +#define DC_TCTL_LOOPBACK 0x00000002 +#define DC_TCTL_DRIVER_ENB 0x00000004 +#define DC_TCTL_LNKPULSE_ENB 0x00000008 +#define DC_TCTL_HALFDUPLEX 0x00000040 +#define DC_TCTL_AUTONEGENBL 0x00000080 +#define DC_TCTL_RX_SQUELCH 0x00000100 +#define DC_TCTL_COLL_SQUELCH 0x00000200 +#define DC_TCTL_COLL_DETECT 0x00000400 +#define DC_TCTL_SQE_ENB 0x00000800 +#define DC_TCTL_LINKTEST 0x00001000 +#define DC_TCTL_AUTOPOLARITY 0x00002000 +#define DC_TCTL_SET_POL_PLUS 0x00004000 +#define DC_TCTL_AUTOSENSE 0x00008000 /* 10bt/AUI autosense */ +#define DC_TCTL_100BTXHALF 0x00010000 +#define DC_TCTL_100BTXFULL 0x00020000 +#define DC_TCTL_100BT4 0x00040000 /* * Watchdog timer register */ -#define DC_WDOG_JABBERDIS 0x00000001 -#define DC_WDOG_HOSTUNJAB 0x00000002 -#define DC_WDOG_JABBERCLK 0x00000004 -#define DC_WDOG_RXWDOGDIS 0x00000010 -#define DC_WDOG_RXWDOGCLK 0x00000020 -#define DC_WDOG_MUSTBEZERO 0x00000100 -#define DC_WDOG_AUIBNC 0x00100000 -#define DC_WDOG_ACTIVITY 0x00200000 -#define DC_WDOG_RX_MATCH 0x00400000 -#define DC_WDOG_LINK 0x00800000 -#define DC_WDOG_CTLWREN 0x08000000 +#define DC_WDOG_JABBERDIS 0x00000001 +#define DC_WDOG_HOSTUNJAB 0x00000002 +#define DC_WDOG_JABBERCLK 0x00000004 +#define DC_WDOG_RXWDOGDIS 0x00000010 +#define DC_WDOG_RXWDOGCLK 0x00000020 +#define DC_WDOG_MUSTBEZERO 0x00000100 +#define DC_WDOG_AUIBNC 0x00100000 +#define DC_WDOG_ACTIVITY 0x00200000 +#define DC_WDOG_RX_MATCH 0x00400000 +#define DC_WDOG_LINK 0x00800000 +#define DC_WDOG_CTLWREN 0x08000000 /* * SIA and General Purpose Port register (X3201) */ -#define DC_SIAGP_RXMATCH 0x40000000 -#define DC_SIAGP_INT1 0x20000000 -#define DC_SIAGP_INT0 0x10000000 -#define DC_SIAGP_WRITE_EN 0x08000000 -#define DC_SIAGP_RXMATCH_EN 0x04000000 -#define DC_SIAGP_INT1_EN 0x02000000 -#define DC_SIAGP_INT0_EN 0x01000000 -#define DC_SIAGP_LED3 0x00800000 -#define DC_SIAGP_LED2 0x00400000 -#define DC_SIAGP_LED1 0x00200000 -#define DC_SIAGP_LED0 0x00100000 -#define DC_SIAGP_MD_GP3_OUTPUT 0x00080000 -#define DC_SIAGP_MD_GP2_OUTPUT 0x00040000 -#define DC_SIAGP_MD_GP1_OUTPUT 0x00020000 -#define DC_SIAGP_MD_GP0_OUTPUT 0x00010000 +#define DC_SIAGP_RXMATCH 0x40000000 +#define DC_SIAGP_INT1 0x20000000 +#define DC_SIAGP_INT0 0x10000000 +#define DC_SIAGP_WRITE_EN 0x08000000 +#define DC_SIAGP_RXMATCH_EN 0x04000000 +#define DC_SIAGP_INT1_EN 0x02000000 +#define DC_SIAGP_INT0_EN 0x01000000 +#define DC_SIAGP_LED3 0x00800000 +#define DC_SIAGP_LED2 0x00400000 +#define DC_SIAGP_LED1 0x00200000 +#define DC_SIAGP_LED0 0x00100000 +#define DC_SIAGP_MD_GP3_OUTPUT 0x00080000 +#define DC_SIAGP_MD_GP2_OUTPUT 0x00040000 +#define DC_SIAGP_MD_GP1_OUTPUT 0x00020000 +#define DC_SIAGP_MD_GP0_OUTPUT 0x00010000 /* * Size of a setup frame. */ -#define DC_SFRAME_LEN 192 +#define DC_SFRAME_LEN 192 /* * 21x4x TX/RX list structure. @@ -398,93 +398,93 @@ struct dc_desc { u_int32_t dc_ptr2; }; -#define dc_data dc_ptr1 -#define dc_next dc_ptr2 +#define dc_data dc_ptr1 +#define dc_next dc_ptr2 -#define DC_RXSTAT_FIFOOFLOW 0x00000001 -#define DC_RXSTAT_CRCERR 0x00000002 -#define DC_RXSTAT_DRIBBLE 0x00000004 -#define DC_RXSTAT_MIIERE 0x00000008 -#define DC_RXSTAT_WATCHDOG 0x00000010 -#define DC_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */ -#define DC_RXSTAT_COLLSEEN 0x00000040 -#define DC_RXSTAT_GIANT 0x00000080 -#define DC_RXSTAT_LASTFRAG 0x00000100 -#define DC_RXSTAT_FIRSTFRAG 0x00000200 -#define DC_RXSTAT_MULTICAST 0x00000400 -#define DC_RXSTAT_RUNT 0x00000800 -#define DC_RXSTAT_RXTYPE 0x00003000 -#define DC_RXSTAT_DE 0x00004000 -#define DC_RXSTAT_RXERR 0x00008000 -#define DC_RXSTAT_RXLEN 0x3FFF0000 -#define DC_RXSTAT_OWN 0x80000000 - -#define DC_RXBYTES(x) ((x & DC_RXSTAT_RXLEN) >> 16) -#define DC_RXSTAT (DC_RXSTAT_FIRSTFRAG|DC_RXSTAT_LASTFRAG|DC_RXSTAT_OWN) - -#define DC_RXCTL_BUFLEN1 0x00000FFF -#define DC_RXCTL_BUFLEN2 0x00FFF000 -#define DC_RXCTL_RLINK 0x01000000 -#define DC_RXCTL_RLAST 0x02000000 - -#define DC_TXSTAT_DEFER 0x00000001 -#define DC_TXSTAT_UNDERRUN 0x00000002 -#define DC_TXSTAT_LINKFAIL 0x00000003 -#define DC_TXSTAT_COLLCNT 0x00000078 -#define DC_TXSTAT_SQE 0x00000080 -#define DC_TXSTAT_EXCESSCOLL 0x00000100 -#define DC_TXSTAT_LATECOLL 0x00000200 -#define DC_TXSTAT_NOCARRIER 0x00000400 -#define DC_TXSTAT_CARRLOST 0x00000800 -#define DC_TXSTAT_JABTIMEO 0x00004000 -#define DC_TXSTAT_ERRSUM 0x00008000 -#define DC_TXSTAT_OWN 0x80000000 - -#define DC_TXCTL_BUFLEN1 0x000007FF -#define DC_TXCTL_BUFLEN2 0x003FF800 -#define DC_TXCTL_FILTTYPE0 0x00400000 -#define DC_TXCTL_PAD 0x00800000 -#define DC_TXCTL_TLINK 0x01000000 -#define DC_TXCTL_TLAST 0x02000000 -#define DC_TXCTL_NOCRC 0x04000000 -#define DC_TXCTL_SETUP 0x08000000 -#define DC_TXCTL_FILTTYPE1 0x10000000 -#define DC_TXCTL_FIRSTFRAG 0x20000000 -#define DC_TXCTL_LASTFRAG 0x40000000 -#define DC_TXCTL_FINT 0x80000000 - -#define DC_FILTER_PERFECT 0x00000000 -#define DC_FILTER_HASHPERF 0x00400000 -#define DC_FILTER_INVERSE 0x10000000 -#define DC_FILTER_HASHONLY 0x10400000 +#define DC_RXSTAT_FIFOOFLOW 0x00000001 +#define DC_RXSTAT_CRCERR 0x00000002 +#define DC_RXSTAT_DRIBBLE 0x00000004 +#define DC_RXSTAT_MIIERE 0x00000008 +#define DC_RXSTAT_WATCHDOG 0x00000010 +#define DC_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */ +#define DC_RXSTAT_COLLSEEN 0x00000040 +#define DC_RXSTAT_GIANT 0x00000080 +#define DC_RXSTAT_LASTFRAG 0x00000100 +#define DC_RXSTAT_FIRSTFRAG 0x00000200 +#define DC_RXSTAT_MULTICAST 0x00000400 +#define DC_RXSTAT_RUNT 0x00000800 +#define DC_RXSTAT_RXTYPE 0x00003000 +#define DC_RXSTAT_DE 0x00004000 +#define DC_RXSTAT_RXERR 0x00008000 +#define DC_RXSTAT_RXLEN 0x3FFF0000 +#define DC_RXSTAT_OWN 0x80000000 + +#define DC_RXBYTES(x) ((x & DC_RXSTAT_RXLEN) >> 16) +#define DC_RXSTAT (DC_RXSTAT_FIRSTFRAG|DC_RXSTAT_LASTFRAG|DC_RXSTAT_OWN) + +#define DC_RXCTL_BUFLEN1 0x00000FFF +#define DC_RXCTL_BUFLEN2 0x00FFF000 +#define DC_RXCTL_RLINK 0x01000000 +#define DC_RXCTL_RLAST 0x02000000 + +#define DC_TXSTAT_DEFER 0x00000001 +#define DC_TXSTAT_UNDERRUN 0x00000002 +#define DC_TXSTAT_LINKFAIL 0x00000003 +#define DC_TXSTAT_COLLCNT 0x00000078 +#define DC_TXSTAT_SQE 0x00000080 +#define DC_TXSTAT_EXCESSCOLL 0x00000100 +#define DC_TXSTAT_LATECOLL 0x00000200 +#define DC_TXSTAT_NOCARRIER 0x00000400 +#define DC_TXSTAT_CARRLOST 0x00000800 +#define DC_TXSTAT_JABTIMEO 0x00004000 +#define DC_TXSTAT_ERRSUM 0x00008000 +#define DC_TXSTAT_OWN 0x80000000 + +#define DC_TXCTL_BUFLEN1 0x000007FF +#define DC_TXCTL_BUFLEN2 0x003FF800 +#define DC_TXCTL_FILTTYPE0 0x00400000 +#define DC_TXCTL_PAD 0x00800000 +#define DC_TXCTL_TLINK 0x01000000 +#define DC_TXCTL_TLAST 0x02000000 +#define DC_TXCTL_NOCRC 0x04000000 +#define DC_TXCTL_SETUP 0x08000000 +#define DC_TXCTL_FILTTYPE1 0x10000000 +#define DC_TXCTL_FIRSTFRAG 0x20000000 +#define DC_TXCTL_LASTFRAG 0x40000000 +#define DC_TXCTL_FINT 0x80000000 + +#define DC_FILTER_PERFECT 0x00000000 +#define DC_FILTER_HASHPERF 0x00400000 +#define DC_FILTER_INVERSE 0x10000000 +#define DC_FILTER_HASHONLY 0x10400000 -#define DC_MAXFRAGS 16 +#define DC_MAXFRAGS 16 #ifdef DEVICE_POLLING -#define DC_RX_LIST_CNT 192 +#define DC_RX_LIST_CNT 192 #else -#define DC_RX_LIST_CNT 64 +#define DC_RX_LIST_CNT 64 #endif -#define DC_TX_LIST_CNT 256 -#define DC_TX_LIST_RSVD 5 -#define DC_MIN_FRAMELEN 60 -#define DC_RXLEN 1536 +#define DC_TX_LIST_CNT 256 +#define DC_TX_LIST_RSVD 5 +#define DC_MIN_FRAMELEN 60 +#define DC_RXLEN 1536 -#define DC_INC(x, y) (x) = (x + 1) % y +#define DC_INC(x, y) (x) = (x + 1) % y #define DC_LIST_ALIGN (sizeof(struct dc_desc)) #define DC_RXBUF_ALIGN 4 /* Macros to easily get the DMA address of a descriptor. */ #define DC_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF) -#define DC_RXDESC(sc, i) \ +#define DC_RXDESC(sc, i) \ (DC_ADDR_LO(sc->dc_ldata.dc_rx_list_paddr + (sizeof(struct dc_desc) * i))) -#define DC_TXDESC(sc, i) \ +#define DC_TXDESC(sc, i) \ (DC_ADDR_LO(sc->dc_ldata.dc_tx_list_paddr + (sizeof(struct dc_desc) * i))) #if BYTE_ORDER == BIG_ENDIAN -#define DC_SP_MAC(x) ((x) << 16) +#define DC_SP_MAC(x) ((x) << 16) #else -#define DC_SP_MAC(x) (x) +#define DC_SP_MAC(x) (x) #endif struct dc_list_data { @@ -540,10 +540,10 @@ struct dc_mii_frame { /* * MII constants */ -#define DC_MII_STARTDELIM 0x01 -#define DC_MII_READOP 0x02 -#define DC_MII_WRITEOP 0x01 -#define DC_MII_TURNAROUND 0x02 +#define DC_MII_STARTDELIM 0x01 +#define DC_MII_READOP 0x02 +#define DC_MII_WRITEOP 0x01 +#define DC_MII_TURNAROUND 0x02 /* @@ -556,42 +556,42 @@ struct dc_mii_frame { * ADMtek specific registers and constants for the AL981 and AN983. * The AN983 doesn't use the magic PHY registers. */ -#define DC_AL_CR 0x88 /* command register */ -#define DC_AL_PAR0 0xA4 /* station address */ -#define DC_AL_PAR1 0xA8 /* station address */ -#define DC_AL_MAR0 0xAC /* multicast hash filter */ -#define DC_AL_MAR1 0xB0 /* multicast hash filter */ -#define DC_AL_BMCR 0xB4 /* built in PHY control */ -#define DC_AL_BMSR 0xB8 /* built in PHY status */ -#define DC_AL_VENID 0xBC /* built in PHY ID0 */ -#define DC_AL_DEVID 0xC0 /* built in PHY ID1 */ -#define DC_AL_ANAR 0xC4 /* built in PHY autoneg advert */ -#define DC_AL_LPAR 0xC8 /* bnilt in PHY link part. ability */ -#define DC_AL_ANER 0xCC /* built in PHY autoneg expansion */ - -#define DC_AL_CR_ATUR 0x00000001 /* automatic TX underrun recovery */ -#define DC_ADMTEK_PHYADDR 0x1 -#define DC_AL_EE_NODEADDR 4 +#define DC_AL_CR 0x88 /* command register */ +#define DC_AL_PAR0 0xA4 /* station address */ +#define DC_AL_PAR1 0xA8 /* station address */ +#define DC_AL_MAR0 0xAC /* multicast hash filter */ +#define DC_AL_MAR1 0xB0 /* multicast hash filter */ +#define DC_AL_BMCR 0xB4 /* built in PHY control */ +#define DC_AL_BMSR 0xB8 /* built in PHY status */ +#define DC_AL_VENID 0xBC /* built in PHY ID0 */ +#define DC_AL_DEVID 0xC0 /* built in PHY ID1 */ +#define DC_AL_ANAR 0xC4 /* built in PHY autoneg advert */ +#define DC_AL_LPAR 0xC8 /* bnilt in PHY link part. ability */ +#define DC_AL_ANER 0xCC /* built in PHY autoneg expansion */ + +#define DC_AL_CR_ATUR 0x00000001 /* automatic TX underrun recovery */ +#define DC_ADMTEK_PHYADDR 0x1 +#define DC_AL_EE_NODEADDR 4 /* End of ADMtek specific registers */ /* * ASIX specific registers. */ -#define DC_AX_FILTIDX 0x68 /* RX filter index */ -#define DC_AX_FILTDATA 0x70 /* RX filter data */ +#define DC_AX_FILTIDX 0x68 /* RX filter index */ +#define DC_AX_FILTDATA 0x70 /* RX filter data */ /* * Special ASIX-specific bits in the ASIX NETCFG register (CSR6). */ -#define DC_AX_NETCFG_RX_BROAD 0x00000100 +#define DC_AX_NETCFG_RX_BROAD 0x00000100 /* * RX Filter Index Register values */ -#define DC_AX_FILTIDX_PAR0 0x00000000 -#define DC_AX_FILTIDX_PAR1 0x00000001 -#define DC_AX_FILTIDX_MAR0 0x00000002 -#define DC_AX_FILTIDX_MAR1 0x00000003 +#define DC_AX_FILTIDX_PAR0 0x00000000 +#define DC_AX_FILTIDX_PAR1 0x00000001 +#define DC_AX_FILTIDX_MAR0 0x00000002 +#define DC_AX_FILTIDX_MAR1 0x00000003 /* End of ASIX specific registers */ /* @@ -600,22 +600,22 @@ struct dc_mii_frame { * a magic packet register, which we need to tweak a bit per the * Macronix application notes. */ -#define DC_MX_MAGICPACKET 0x80 -#define DC_MX_NWAYSTAT 0xA0 +#define DC_MX_MAGICPACKET 0x80 +#define DC_MX_NWAYSTAT 0xA0 /* * Magic packet register */ -#define DC_MX_MPACK_DISABLE 0x00400000 +#define DC_MX_MPACK_DISABLE 0x00400000 /* * NWAY status register. */ -#define DC_MX_NWAY_10BTHALF 0x08000000 -#define DC_MX_NWAY_10BTFULL 0x10000000 -#define DC_MX_NWAY_100BTHALF 0x20000000 -#define DC_MX_NWAY_100BTFULL 0x40000000 -#define DC_MX_NWAY_100BT4 0x80000000 +#define DC_MX_NWAY_10BTHALF 0x08000000 +#define DC_MX_NWAY_10BTFULL 0x10000000 +#define DC_MX_NWAY_100BTHALF 0x20000000 +#define DC_MX_NWAY_100BTFULL 0x40000000 +#define DC_MX_NWAY_100BT4 0x80000000 /* * These are magic values that must be written into CSR16 @@ -623,10 +623,10 @@ struct dc_mii_frame { * operating mode. The magic numbers are documented in the * Macronix 98715 application notes. */ -#define DC_MX_MAGIC_98713 0x0F370000 -#define DC_MX_MAGIC_98713A 0x0B3C0000 -#define DC_MX_MAGIC_98715 0x0B3C0000 -#define DC_MX_MAGIC_98725 0x0B3C0000 +#define DC_MX_MAGIC_98713 0x0F370000 +#define DC_MX_MAGIC_98713A 0x0B3C0000 +#define DC_MX_MAGIC_98715 0x0B3C0000 +#define DC_MX_MAGIC_98725 0x0B3C0000 /* End of Macronix specific registers */ /* @@ -634,20 +634,20 @@ struct dc_mii_frame { * The PNIC has its own special NWAY support, which doesn't work, * and shortcut ways of reading the EEPROM and MII bus. */ -#define DC_PN_GPIO 0x60 /* general purpose pins control */ -#define DC_PN_PWRUP_CFG 0x90 /* config register, set by EEPROM */ -#define DC_PN_SIOCTL 0x98 /* serial EEPROM control register */ -#define DC_PN_MII 0xA0 /* MII access register */ -#define DC_PN_NWAY 0xB8 /* Internal NWAY register */ +#define DC_PN_GPIO 0x60 /* general purpose pins control */ +#define DC_PN_PWRUP_CFG 0x90 /* config register, set by EEPROM */ +#define DC_PN_SIOCTL 0x98 /* serial EEPROM control register */ +#define DC_PN_MII 0xA0 /* MII access register */ +#define DC_PN_NWAY 0xB8 /* Internal NWAY register */ /* Serial I/O EEPROM register */ -#define DC_PN_SIOCTL_DATA 0x0000003F -#define DC_PN_SIOCTL_OPCODE 0x00000300 -#define DC_PN_SIOCTL_BUSY 0x80000000 - -#define DC_PN_EEOPCODE_ERASE 0x00000300 -#define DC_PN_EEOPCODE_READ 0x00000600 -#define DC_PN_EEOPCODE_WRITE 0x00000100 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 03:32: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 A86AC106564A; Sat, 19 Feb 2011 03:32:10 +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 94DE78FC13; Sat, 19 Feb 2011 03:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J3WAsx082583; Sat, 19 Feb 2011 03:32:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J3WAiU082580; Sat, 19 Feb 2011 03:32:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102190332.p1J3WAiU082580@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Feb 2011 03:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218835 - 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: Sat, 19 Feb 2011 03:32:10 -0000 Author: yongari Date: Sat Feb 19 03:32:10 2011 New Revision: 218835 URL: http://svn.freebsd.org/changeset/base/218835 Log: s/u_intXX_t/uintXX_t/g Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Feb 19 03:23:19 2011 (r218834) +++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:32:10 2011 (r218835) @@ -261,16 +261,16 @@ static void dc_dma_map_addr(void *, bus_ static void dc_delay(struct dc_softc *); static void dc_eeprom_idle(struct dc_softc *); static void dc_eeprom_putbyte(struct dc_softc *, int); -static void dc_eeprom_getword(struct dc_softc *, int, u_int16_t *); -static void dc_eeprom_getword_pnic(struct dc_softc *, int, u_int16_t *); -static void dc_eeprom_getword_xircom(struct dc_softc *, int, u_int16_t *); +static void dc_eeprom_getword(struct dc_softc *, int, uint16_t *); +static void dc_eeprom_getword_pnic(struct dc_softc *, int, uint16_t *); +static void dc_eeprom_getword_xircom(struct dc_softc *, int, uint16_t *); static void dc_eeprom_width(struct dc_softc *); static void dc_read_eeprom(struct dc_softc *, caddr_t, int, int, int); static void dc_mii_writebit(struct dc_softc *, int); static int dc_mii_readbit(struct dc_softc *); static void dc_mii_sync(struct dc_softc *); -static void dc_mii_send(struct dc_softc *, u_int32_t, int); +static void dc_mii_send(struct dc_softc *, uint32_t, int); static int dc_mii_readreg(struct dc_softc *, struct dc_mii_frame *); static int dc_mii_writereg(struct dc_softc *, struct dc_mii_frame *); static int dc_miibus_readreg(device_t, int, int); @@ -495,10 +495,10 @@ dc_eeprom_putbyte(struct dc_softc *sc, i * the EEPROM. */ static void -dc_eeprom_getword_pnic(struct dc_softc *sc, int addr, u_int16_t *dest) +dc_eeprom_getword_pnic(struct dc_softc *sc, int addr, uint16_t *dest) { int i; - u_int32_t r; + uint32_t r; CSR_WRITE_4(sc, DC_PN_SIOCTL, DC_PN_EEOPCODE_READ | addr); @@ -506,7 +506,7 @@ dc_eeprom_getword_pnic(struct dc_softc * DELAY(1); r = CSR_READ_4(sc, DC_SIO); if (!(r & DC_PN_SIOCTL_BUSY)) { - *dest = (u_int16_t)(r & 0xFFFF); + *dest = (uint16_t)(r & 0xFFFF); return; } } @@ -518,17 +518,17 @@ dc_eeprom_getword_pnic(struct dc_softc * * the EEPROM, too. */ static void -dc_eeprom_getword_xircom(struct dc_softc *sc, int addr, u_int16_t *dest) +dc_eeprom_getword_xircom(struct dc_softc *sc, int addr, uint16_t *dest) { SIO_SET(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ); addr *= 2; CSR_WRITE_4(sc, DC_ROM, addr | 0x160); - *dest = (u_int16_t)CSR_READ_4(sc, DC_SIO) & 0xff; + *dest = (uint16_t)CSR_READ_4(sc, DC_SIO) & 0xff; addr += 1; CSR_WRITE_4(sc, DC_ROM, addr | 0x160); - *dest |= ((u_int16_t)CSR_READ_4(sc, DC_SIO) & 0xff) << 8; + *dest |= ((uint16_t)CSR_READ_4(sc, DC_SIO) & 0xff) << 8; SIO_CLR(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ); } @@ -537,10 +537,10 @@ dc_eeprom_getword_xircom(struct dc_softc * Read a word of data stored in the EEPROM at address 'addr.' */ static void -dc_eeprom_getword(struct dc_softc *sc, int addr, u_int16_t *dest) +dc_eeprom_getword(struct dc_softc *sc, int addr, uint16_t *dest) { int i; - u_int16_t word = 0; + uint16_t word = 0; /* Force EEPROM to idle state. */ dc_eeprom_idle(sc); @@ -586,7 +586,7 @@ static void dc_read_eeprom(struct dc_softc *sc, caddr_t dest, int off, int cnt, int be) { int i; - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { if (DC_IS_PNIC(sc)) @@ -595,7 +595,7 @@ dc_read_eeprom(struct dc_softc *sc, cadd dc_eeprom_getword_xircom(sc, off + i, &word); else dc_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (be) *ptr = be16toh(word); else @@ -680,7 +680,7 @@ dc_mii_sync(struct dc_softc *sc) * Clock a series of bits through the MII. */ static void -dc_mii_send(struct dc_softc *sc, u_int32_t bits, int cnt) +dc_mii_send(struct dc_softc *sc, uint32_t bits, int cnt) { int i; @@ -1082,7 +1082,7 @@ dc_setfilt_21143(struct dc_softc *sc) { uint16_t eaddr[(ETHER_ADDR_LEN+1)/2]; struct dc_desc *sframe; - u_int32_t h, *sp; + uint32_t h, *sp; struct ifmultiaddr *ifma; struct ifnet *ifp; int i; @@ -1156,7 +1156,7 @@ dc_setfilt_admtek(struct dc_softc *sc) struct ifnet *ifp; struct ifmultiaddr *ifma; int h = 0; - u_int32_t hashes[2] = { 0, 0 }; + uint32_t hashes[2] = { 0, 0 }; ifp = sc->dc_ifp; @@ -1217,7 +1217,7 @@ dc_setfilt_asix(struct dc_softc *sc) struct ifnet *ifp; struct ifmultiaddr *ifma; int h = 0; - u_int32_t hashes[2] = { 0, 0 }; + uint32_t hashes[2] = { 0, 0 }; ifp = sc->dc_ifp; @@ -1287,7 +1287,7 @@ dc_setfilt_xircom(struct dc_softc *sc) struct ifnet *ifp; struct ifmultiaddr *ifma; struct dc_desc *sframe; - u_int32_t h, *sp; + uint32_t h, *sp; int i; ifp = sc->dc_ifp; @@ -1379,7 +1379,7 @@ static void dc_setcfg(struct dc_softc *sc, int media) { int i, restart = 0, watchdogreg; - u_int32_t isr; + uint32_t isr; if (IFM_SUBTYPE(media) == IFM_NONE) return; @@ -1563,8 +1563,8 @@ static const struct dc_type * dc_devtype(device_t dev) { const struct dc_type *t; - u_int32_t devid; - u_int8_t rev; + uint32_t devid; + uint8_t rev; t = dc_devs; devid = pci_get_devid(dev); @@ -1607,9 +1607,9 @@ static void dc_apply_fixup(struct dc_softc *sc, int media) { struct dc_mediainfo *m; - u_int8_t *p; + uint8_t *p; int i; - u_int32_t reg; + uint32_t reg; m = sc->dc_mi; @@ -1668,11 +1668,11 @@ dc_decode_leaf_sia(struct dc_softc *sc, if (l->dc_sia_code & DC_SIA_CODE_EXT) { m->dc_gp_len = 2; m->dc_gp_ptr = - (u_int8_t *)&l->dc_un.dc_sia_ext.dc_sia_gpio_ctl; + (uint8_t *)&l->dc_un.dc_sia_ext.dc_sia_gpio_ctl; } else { m->dc_gp_len = 2; m->dc_gp_ptr = - (u_int8_t *)&l->dc_un.dc_sia_noext.dc_sia_gpio_ctl; + (uint8_t *)&l->dc_un.dc_sia_noext.dc_sia_gpio_ctl; } m->dc_next = sc->dc_mi; @@ -1699,7 +1699,7 @@ dc_decode_leaf_sym(struct dc_softc *sc, m->dc_media = IFM_100_TX | IFM_FDX; m->dc_gp_len = 2; - m->dc_gp_ptr = (u_int8_t *)&l->dc_sym_gpio_ctl; + m->dc_gp_ptr = (uint8_t *)&l->dc_sym_gpio_ctl; m->dc_next = sc->dc_mi; sc->dc_mi = m; @@ -1712,7 +1712,7 @@ static int dc_decode_leaf_mii(struct dc_softc *sc, struct dc_eblock_mii *l) { struct dc_mediainfo *m; - u_int8_t *p; + uint8_t *p; m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO); if (m == NULL) { @@ -1723,7 +1723,7 @@ dc_decode_leaf_mii(struct dc_softc *sc, m->dc_media = IFM_AUTO; m->dc_gp_len = l->dc_gpr_len; - p = (u_int8_t *)l; + p = (uint8_t *)l; p += sizeof(struct dc_eblock_mii); m->dc_gp_ptr = p; p += 2 * l->dc_gpr_len; @@ -2031,13 +2031,13 @@ static int dc_attach(device_t dev) { uint32_t eaddr[(ETHER_ADDR_LEN+3)/4]; - u_int32_t command; + uint32_t command; struct dc_softc *sc; struct ifnet *ifp; struct dc_mediainfo *m; - u_int32_t reg, revision; + uint32_t reg, revision; int error, mac_offset, phy, rid, tmp; - u_int8_t *mac; + uint8_t *mac; sc = device_get_softc(dev); sc->dc_dev = dev; @@ -2724,7 +2724,7 @@ dc_pnic_rx_bug_war(struct dc_softc *sc, struct mbuf *m = NULL; unsigned char *ptr; int i, total_len; - u_int32_t rxstat = 0; + uint32_t rxstat = 0; i = sc->dc_pnic_rx_bug_save; cur_rx = &sc->dc_ldata.dc_rx_list[idx]; @@ -2835,7 +2835,7 @@ dc_rxeof(struct dc_softc *sc) struct ifnet *ifp; struct dc_desc *cur_rx; int i, total_len, rx_npkts; - u_int32_t rxstat; + uint32_t rxstat; DC_LOCK_ASSERT(sc); @@ -2955,7 +2955,7 @@ dc_txeof(struct dc_softc *sc) struct dc_desc *cur_tx; struct ifnet *ifp; int idx, setup; - u_int32_t ctl, txstat; + uint32_t ctl, txstat; if (sc->dc_cdata.dc_tx_cnt == 0) return; @@ -3063,7 +3063,7 @@ dc_tick(void *xsc) struct dc_softc *sc; struct mii_data *mii; struct ifnet *ifp; - u_int32_t r; + uint32_t r; sc = xsc; DC_LOCK_ASSERT(sc); @@ -3140,7 +3140,7 @@ dc_tick(void *xsc) static void dc_tx_underrun(struct dc_softc *sc) { - u_int32_t isr; + uint32_t isr; int i; if (DC_IS_DAVICOM(sc)) @@ -3207,7 +3207,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd dc_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ - u_int32_t status; + uint32_t status; status = CSR_READ_4(sc, DC_ISR); status &= (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF | @@ -3221,7 +3221,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd CSR_WRITE_4(sc, DC_ISR, status); if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) { - u_int32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED); + uint32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED); ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); if (dc_rx_resync(sc)) @@ -3250,7 +3250,7 @@ dc_intr(void *arg) { struct dc_softc *sc; struct ifnet *ifp; - u_int32_t r, status; + uint32_t r, status; int curpkts, n; sc = arg; @@ -3909,7 +3909,7 @@ dc_stop(struct dc_softc *sc) struct dc_list_data *ld; struct dc_chain_data *cd; int i; - u_int32_t ctl; + uint32_t ctl; DC_LOCK_ASSERT(sc); Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Sat Feb 19 03:23:19 2011 (r218834) +++ head/sys/dev/dc/if_dcreg.h Sat Feb 19 03:32:10 2011 (r218835) @@ -392,10 +392,10 @@ */ struct dc_desc { - u_int32_t dc_status; - u_int32_t dc_ctl; - u_int32_t dc_ptr1; - u_int32_t dc_ptr2; + uint32_t dc_status; + uint32_t dc_ctl; + uint32_t dc_ptr1; + uint32_t dc_ptr2; }; #define dc_data dc_ptr1 @@ -502,8 +502,8 @@ struct dc_chain_data { struct mbuf *dc_tx_chain[DC_TX_LIST_CNT]; bus_dmamap_t dc_rx_map[DC_RX_LIST_CNT]; bus_dmamap_t dc_tx_map[DC_TX_LIST_CNT]; - u_int32_t *dc_sbuf; - u_int8_t dc_pad[DC_MIN_FRAMELEN]; + uint32_t *dc_sbuf; + uint8_t dc_pad[DC_MIN_FRAMELEN]; int dc_tx_pkts; int dc_tx_first; int dc_tx_prod; @@ -514,27 +514,27 @@ struct dc_chain_data { struct dc_mediainfo { int dc_media; - u_int8_t *dc_gp_ptr; - u_int8_t dc_gp_len; - u_int8_t *dc_reset_ptr; - u_int8_t dc_reset_len; + uint8_t *dc_gp_ptr; + uint8_t dc_gp_len; + uint8_t *dc_reset_ptr; + uint8_t dc_reset_len; struct dc_mediainfo *dc_next; }; struct dc_type { - u_int32_t dc_devid; - u_int8_t dc_minrev; + uint32_t dc_devid; + uint8_t dc_minrev; char *dc_name; }; struct dc_mii_frame { - u_int8_t mii_stdelim; - u_int8_t mii_opcode; - u_int8_t mii_phyaddr; - u_int8_t mii_regaddr; - u_int8_t mii_turnaround; - u_int16_t mii_data; + uint8_t mii_stdelim; + uint8_t mii_opcode; + uint8_t mii_phyaddr; + uint8_t mii_regaddr; + uint8_t mii_turnaround; + uint16_t mii_data; }; /* @@ -747,19 +747,19 @@ struct dc_softc { struct resource *dc_res; const struct dc_type *dc_info; /* adapter info */ device_t dc_miibus; - u_int8_t dc_type; - u_int8_t dc_pmode; - u_int8_t dc_link; - u_int8_t dc_cachesize; + uint8_t dc_type; + uint8_t dc_pmode; + uint8_t dc_link; + uint8_t dc_cachesize; int dc_romwidth; int dc_pnic_rx_bug_save; unsigned char *dc_pnic_rx_buf; int dc_if_flags; int dc_if_media; - u_int32_t dc_flags; - u_int32_t dc_txthresh; - u_int32_t dc_eaddr[2]; - u_int8_t *dc_srom; + uint32_t dc_flags; + uint32_t dc_txthresh; + uint32_t dc_eaddr[2]; + uint8_t *dc_srom; struct dc_mediainfo *dc_mi; struct dc_list_data dc_ldata; struct dc_chain_data dc_cdata; @@ -1082,10 +1082,10 @@ struct dc_softc { #define DC_IB_LEAF0_OFFSET 0x1B struct dc_info_leaf { - u_int16_t dc_conntype; - u_int8_t dc_blkcnt; - u_int8_t dc_rsvd; - u_int16_t dc_infoblk; + uint16_t dc_conntype; + uint8_t dc_blkcnt; + uint8_t dc_rsvd; + uint16_t dc_infoblk; }; #define DC_CTYPE_10BT 0x0000 @@ -1116,28 +1116,28 @@ struct dc_info_leaf { #define DC_EBLOCK_PHY_SHUTDOWN 0x0006 struct dc_leaf_hdr { - u_int16_t dc_mtype; - u_int8_t dc_mcnt; - u_int8_t dc_rsvd; + uint16_t dc_mtype; + uint8_t dc_mcnt; + uint8_t dc_rsvd; }; struct dc_eblock_hdr { - u_int8_t dc_len; - u_int8_t dc_type; + uint8_t dc_len; + uint8_t dc_type; }; struct dc_eblock_sia { struct dc_eblock_hdr dc_sia_hdr; - u_int8_t dc_sia_code; + uint8_t dc_sia_code; union { struct dc_sia_ext { /* if (dc_sia_code & DC_SIA_CODE_EXT) */ - u_int8_t dc_sia_mediaspec[6]; /* CSR13, CSR14, CSR15 */ - u_int8_t dc_sia_gpio_ctl[2]; - u_int8_t dc_sia_gpio_dat[2]; + uint8_t dc_sia_mediaspec[6]; /* CSR13, CSR14, CSR15 */ + uint8_t dc_sia_gpio_ctl[2]; + uint8_t dc_sia_gpio_dat[2]; } dc_sia_ext; struct dc_sia_noext { - u_int8_t dc_sia_gpio_ctl[2]; - u_int8_t dc_sia_gpio_dat[2]; + uint8_t dc_sia_gpio_ctl[2]; + uint8_t dc_sia_gpio_dat[2]; } dc_sia_noext; } dc_un; }; @@ -1154,11 +1154,11 @@ struct dc_eblock_sia { */ struct dc_eblock_mii { struct dc_eblock_hdr dc_mii_hdr; - u_int8_t dc_mii_phynum; - u_int8_t dc_gpr_len; -/* u_int16_t dc_gpr_dat[n]; */ -/* u_int8_t dc_reset_len; */ -/* u_int16_t dc_reset_dat[n]; */ + uint8_t dc_mii_phynum; + uint8_t dc_gpr_len; +/* uint16_t dc_gpr_dat[n]; */ +/* uint8_t dc_reset_len; */ +/* uint16_t dc_reset_dat[n]; */ /* There are other fields after these, but we don't * care about them since they can be determined by looking * at the PHY. @@ -1167,10 +1167,10 @@ struct dc_eblock_mii { struct dc_eblock_sym { struct dc_eblock_hdr dc_sym_hdr; - u_int8_t dc_sym_code; - u_int8_t dc_sym_gpio_ctl[2]; - u_int8_t dc_sym_gpio_dat[2]; - u_int8_t dc_sym_cmd[2]; + uint8_t dc_sym_code; + uint8_t dc_sym_gpio_ctl[2]; + uint8_t dc_sym_gpio_dat[2]; + uint8_t dc_sym_cmd[2]; }; #define DC_SYM_CODE_100BT 0x03 @@ -1181,6 +1181,6 @@ struct dc_eblock_sym { struct dc_eblock_reset { struct dc_eblock_hdr dc_reset_hdr; - u_int8_t dc_reset_len; -/* u_int16_t dc_reset_dat[n]; */ + uint8_t dc_reset_len; +/* uint16_t dc_reset_dat[n]; */ }; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 07: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 48FED106564A; Sat, 19 Feb 2011 07:34:40 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id CC9E98FC12; Sat, 19 Feb 2011 07:34:39 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 22ADF45C9F; Sat, 19 Feb 2011 08:34:37 +0100 (CET) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 121C445B36; Sat, 19 Feb 2011 08:34:31 +0100 (CET) Date: Sat, 19 Feb 2011 08:34:12 +0100 From: Pawel Jakub Dawidek To: VANHULLEBUS Yvan Message-ID: <20110219073412.GC2016@garage.freebsd.pl> References: <201102180940.p1I9eD29050530@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E39vaYmALEf/7YXx" Content-Disposition: inline In-Reply-To: <201102180940.p1I9eD29050530@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218794 - in head: . sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 07:34:41 -0000 --E39vaYmALEf/7YXx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 18, 2011 at 09:40:13AM +0000, VANHULLEBUS Yvan wrote: > Author: vanhu > Date: Fri Feb 18 09:40:13 2011 > New Revision: 218794 > URL: http://svn.freebsd.org/changeset/base/218794 >=20 > Log: > Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant. > This will break interoperability with all older versions of > FreeBSD for those algorithms. > > Reviewed by: bz, gnn > Obtained from: NETASQ > MFC after: 1w First of all, I can't see such a change being merged to stable, where going from 8.2 to 8.3 will break IPsec tunnels. Second of all I really think that an UPDATING entry is not enough. We should at least provide sysctl to change it back and if we can detect this based on packet size, it would be best to log a warning that the other side is using old implementation and it (the other side) should be either upgraded or this sysctl should be changed locally to enable old behaviour. I'm happy to remove such sysctl after one full major release, so we won't support tunnels between FreeBSD 8 and FreeBSD 10, but we should IMHO definitely support tunnels between both 8-9 and 9-10. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --E39vaYmALEf/7YXx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk1fcnMACgkQForvXbEpPzTkhQCeKu09gxPHHuHOoPlms6aS8OIq ksgAnj1LJ5HrZOKuWUhC9FYX8Sbd5RoW =YSPB -----END PGP SIGNATURE----- --E39vaYmALEf/7YXx-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 07:47: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 48812106564A; Sat, 19 Feb 2011 07:47:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B578FC13; Sat, 19 Feb 2011 07:47:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J7lQnh088198; Sat, 19 Feb 2011 07:47:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J7lQe6088196; Sat, 19 Feb 2011 07:47:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102190747.p1J7lQe6088196@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Feb 2011 07:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218838 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 07:47:26 -0000 Author: kib Date: Sat Feb 19 07:47:25 2011 New Revision: 218838 URL: http://svn.freebsd.org/changeset/base/218838 Log: v_mountedhere is a member of the union. Check that the vnodes have proper type before using the member. Reported and tested by: Michael Butler Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Feb 19 07:45:17 2011 (r218837) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Feb 19 07:47:25 2011 (r218838) @@ -1295,7 +1295,9 @@ relock: newparent = tdp->i_number; doingdirectory = 1; } - if (fvp->v_mountedhere != NULL || (tvp && tvp->v_mountedhere != NULL)) { + if ((fvp->v_type == VDIR && fvp->v_mountedhere != NULL) || + (tvp != NULL && tvp->v_type == VDIR && + tvp->v_mountedhere != NULL)) { error = EXDEV; goto unlockout; } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 09:08: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 50B991065670; Sat, 19 Feb 2011 09:08:14 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401248FC0A; Sat, 19 Feb 2011 09:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J98EXb090120; Sat, 19 Feb 2011 09:08:14 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J98EFJ090118; Sat, 19 Feb 2011 09:08:14 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102190908.p1J98EFJ090118@svn.freebsd.org> From: Bruce Cran Date: Sat, 19 Feb 2011 09:08: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: r218839 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 09:08:14 -0000 Author: brucec Date: Sat Feb 19 09:08:13 2011 New Revision: 218839 URL: http://svn.freebsd.org/changeset/base/218839 Log: In the distribution list, 'A' is listed as the key to press to select both 'All' and 'Minimal'. Update the keys for Minimal and Custom to avoid the conflict. PR: bin/153809 Submitted by: Janne Snabb MFC after: 3 days Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sat Feb 19 07:47:25 2011 (r218838) +++ head/usr.sbin/sysinstall/menus.c Sat Feb 19 09:08:13 2011 (r218839) @@ -961,9 +961,9 @@ DMenu MenuDistributions = { checkDistKernDeveloper, distSetKernDeveloper }, { "6 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, - { "A Minimal", "The smallest configuration possible", + { "7 Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, - { "B Custom", "Specify your own distribution set", + { "8 Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { NULL } }, }; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 09:24: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 BA174106566C; Sat, 19 Feb 2011 09:24:24 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9AEE8FC16; Sat, 19 Feb 2011 09:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J9OOMR090485; Sat, 19 Feb 2011 09:24:24 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J9OOiQ090483; Sat, 19 Feb 2011 09:24:24 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102190924.p1J9OOiQ090483@svn.freebsd.org> From: Bruce Cran Date: Sat, 19 Feb 2011 09:24: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: r218840 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 09:24:24 -0000 Author: brucec Date: Sat Feb 19 09:24:24 2011 New Revision: 218840 URL: http://svn.freebsd.org/changeset/base/218840 Log: Remove the quotas option from the Startup Services menu. GENERIC has no support for quotas so this option has no effect. PR: bin/123237 Submitted by: Lawrence Mayer MFC after: 3 days Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sat Feb 19 09:08:13 2011 (r218839) +++ head/usr.sbin/sysinstall/menus.c Sat Feb 19 09:24:24 2011 (r218840) @@ -1283,8 +1283,6 @@ DMenu MenuStartup = { { " SVR4", "This host wants to be able to run SVR4 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, #endif - { " quotas", "This host wishes to check quotas on startup.", - dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, }; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 09:33: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 6C9F7106564A; Sat, 19 Feb 2011 09:33:53 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C4048FC13; Sat, 19 Feb 2011 09:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J9Xrbs090722; Sat, 19 Feb 2011 09:33:53 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J9XrxY090720; Sat, 19 Feb 2011 09:33:53 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102190933.p1J9XrxY090720@svn.freebsd.org> From: Bruce Cran Date: Sat, 19 Feb 2011 09:33: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: r218841 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 09:33:53 -0000 Author: brucec Date: Sat Feb 19 09:33:53 2011 New Revision: 218841 URL: http://svn.freebsd.org/changeset/base/218841 Log: Allow users to create ufs1 filesystems via the noninteractive install.cfg system. PR: bin/113979 MFC after: 3 days Modified: head/usr.sbin/sysinstall/label.c Modified: head/usr.sbin/sysinstall/label.c ============================================================================== --- head/usr.sbin/sysinstall/label.c Sat Feb 19 09:24:24 2011 (r218840) +++ head/usr.sbin/sysinstall/label.c Sat Feb 19 09:33:53 2011 (r218841) @@ -1653,6 +1653,8 @@ diskLabelNonInteractive(Device *dev) pi = tmp->private_data = new_part(PART_FILESYSTEM, mpoint, TRUE); tmp->private_free = safe_free; pi->newfs_data.newfs_ufs.softupdates = soft; + if (!strcmp(typ, "ufs1")) + pi->newfs_data.newfs_ufs.ufs1 = TRUE; } } } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 10:32: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 B5E85106566C; Sat, 19 Feb 2011 10:32:12 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A538C8FC08; Sat, 19 Feb 2011 10:32:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JAWCDI092875; Sat, 19 Feb 2011 10:32:12 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JAWC15092873; Sat, 19 Feb 2011 10:32:12 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201102191032.p1JAWC15092873@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Feb 2011 10:32: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: r218842 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 10:32:12 -0000 Author: nyan Date: Sat Feb 19 10:32:12 2011 New Revision: 218842 URL: http://svn.freebsd.org/changeset/base/218842 Log: MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Sat Feb 19 09:33:53 2011 (r218841) +++ head/sys/boot/pc98/boot2/boot2.c Sat Feb 19 10:32:12 2011 (r218842) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 10:36:05 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 A5C22106564A; Sat, 19 Feb 2011 10:36:05 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9517B8FC13; Sat, 19 Feb 2011 10:36:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JAa579093001; Sat, 19 Feb 2011 10:36:05 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JAa51P092999; Sat, 19 Feb 2011 10:36:05 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201102191036.p1JAa51P092999@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Feb 2011 10:36: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: r218843 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 10:36:05 -0000 Author: nyan Date: Sat Feb 19 10:36:05 2011 New Revision: 218843 URL: http://svn.freebsd.org/changeset/base/218843 Log: MFi386: revision 218744 To avoid excessive code duplication create wrapper for fill regs from stack frame. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Feb 19 10:32:12 2011 (r218842) +++ head/sys/pc98/pc98/machdep.c Sat Feb 19 10:36:05 2011 (r218843) @@ -2458,6 +2458,13 @@ fill_regs(struct thread *td, struct reg tp = td->td_frame; pcb = td->td_pcb; + regs->r_gs = pcb->pcb_gs; + return (fill_frame_regs(tp, regs)); +} + +int +fill_frame_regs(struct trapframe *tp, struct reg *regs) +{ regs->r_fs = tp->tf_fs; regs->r_es = tp->tf_es; regs->r_ds = tp->tf_ds; @@ -2473,7 +2480,6 @@ fill_regs(struct thread *td, struct reg regs->r_eflags = tp->tf_eflags; regs->r_esp = tp->tf_esp; regs->r_ss = tp->tf_ss; - regs->r_gs = pcb->pcb_gs; return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 11:06: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 504BC106566B; Sat, 19 Feb 2011 11:06:01 +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 4017A8FC14; Sat, 19 Feb 2011 11:06:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JB61sY093673; Sat, 19 Feb 2011 11:06:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JB611P093671; Sat, 19 Feb 2011 11:06:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201102191106.p1JB611P093671@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Feb 2011 11:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218844 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 11:06:01 -0000 Author: ed Date: Sat Feb 19 11:06:00 2011 New Revision: 218844 URL: http://svn.freebsd.org/changeset/base/218844 Log: Improve 256 color support. - Add screen-256color, - Improve rxvt-256color to set pa and op properly. - Add rxvt-unicode-256color as an alias to rxvt-256color. PR: conf/152713, conf/153164 Submitted by: Alexander Verbod and Frédéric Perrin MFC after: 2 weeks Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sat Feb 19 10:36:05 2011 (r218843) +++ head/share/termcap/termcap.src Sat Feb 19 11:06:00 2011 (r218844) @@ -2784,6 +2784,9 @@ SH|screen-s|VT 100/ANSI X3.64 virtual te :ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen: SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\ :co#132:tc=screen: +screen-256color|VT 100/ANSI X3.64 terminal with 256 colors:\ + :Co#256:pa#32767:\ + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=screen: # $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $ # # Note: @@ -4632,7 +4635,11 @@ rxvt|rxvt terminal emulator (X Window Sy :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono: rxvt-256color|rxvt terminal emulator with 256 colors:\ - :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode: + :Co#256:pa#32767:\ + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:op=\E[39;49m:tc=rxvt-unicode: + +rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System):\ + :tc=rxvt-256color: # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2 Eterm|Eterm Terminal Emulator (X11 Window System):\ From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 11:09: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 C1369106564A; Sat, 19 Feb 2011 11:09:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F1D8FC12; Sat, 19 Feb 2011 11:09:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JB9csf093780; Sat, 19 Feb 2011 11:09:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JB9crL093778; Sat, 19 Feb 2011 11:09:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201102191109.p1JB9crL093778@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Feb 2011 11:09: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: r218845 - 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: Sat, 19 Feb 2011 11:09:38 -0000 Author: nyan Date: Sat Feb 19 11:09:38 2011 New Revision: 218845 URL: http://svn.freebsd.org/changeset/base/218845 Log: Add support to set a slice name. Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sat Feb 19 11:06:00 2011 (r218844) +++ head/sys/geom/part/g_part_pc98.c Sat Feb 19 11:09:38 2011 (r218845) @@ -140,6 +140,20 @@ pc98_parse_type(const char *type, u_char return (EINVAL); } +static int +pc98_set_slicename(const char *label, u_char *dp_name) +{ + int len; + + len = strlen(label); + if (len > sizeof(((struct pc98_partition *)NULL)->dp_name)) + return (EINVAL); + bzero(dp_name, sizeof(((struct pc98_partition *)NULL)->dp_name)); + strncpy(dp_name, label, len); + + return (0); +} + static void pc98_set_chs(struct g_part_table *table, uint32_t lba, u_short *cylp, u_char *hdp, u_char *secp) @@ -164,9 +178,7 @@ g_part_pc98_add(struct g_part_table *bas struct g_part_pc98_entry *entry; struct g_part_pc98_table *table; uint32_t cyl, start, size; - - if (gpp->gpp_parms & G_PART_PARM_LABEL) - return (EINVAL); + int error; cyl = basetable->gpt_heads * basetable->gpt_sectors; @@ -199,8 +211,16 @@ g_part_pc98_add(struct g_part_table *bas &entry->ent.dp_shd, &entry->ent.dp_ssect); pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, &entry->ent.dp_ehd, &entry->ent.dp_esect); - return (pc98_parse_type(gpp->gpp_type, &entry->ent.dp_mid, - &entry->ent.dp_sid)); + + error = pc98_parse_type(gpp->gpp_type, &entry->ent.dp_mid, + &entry->ent.dp_sid); + if (error) + return (error); + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (pc98_set_slicename(gpp->gpp_label, entry->ent.dp_name)); + + return (0); } static int @@ -231,7 +251,7 @@ g_part_pc98_create(struct g_part_table * pp = gpp->gpp_provider; cp = LIST_FIRST(&pp->consumers); - if (pp->sectorsize < SECSIZE || pp->mediasize < 2 * SECSIZE) + if (pp->sectorsize < SECSIZE || pp->mediasize < BOOTSIZE) return (ENOSPC); if (pp->sectorsize > SECSIZE) return (ENXIO); @@ -305,14 +325,20 @@ g_part_pc98_modify(struct g_part_table * struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_pc98_entry *entry; + int error; + + entry = (struct g_part_pc98_entry *)baseentry; + + if (gpp->gpp_parms & G_PART_PARM_TYPE) { + error = pc98_parse_type(gpp->gpp_type, &entry->ent.dp_mid, + &entry->ent.dp_sid); + if (error) + return (error); + } if (gpp->gpp_parms & G_PART_PARM_LABEL) - return (EINVAL); + return (pc98_set_slicename(gpp->gpp_label, entry->ent.dp_name)); - entry = (struct g_part_pc98_entry *)baseentry; - if (gpp->gpp_parms & G_PART_PARM_TYPE) - return (pc98_parse_type(gpp->gpp_type, &entry->ent.dp_mid, - &entry->ent.dp_sid)); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 11:31: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 6E3D9106564A; Sat, 19 Feb 2011 11:31:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8158FC0C; Sat, 19 Feb 2011 11:31:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JBVulY094306; Sat, 19 Feb 2011 11:31:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JBVuKb094301; Sat, 19 Feb 2011 11:31:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201102191131.p1JBVuKb094301@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Feb 2011 11:31: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: r218846 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 11:31:56 -0000 Author: ed Date: Sat Feb 19 11:31:56 2011 New Revision: 218846 URL: http://svn.freebsd.org/changeset/base/218846 Log: Properly styleify utmpx code and document error codes in man page. Submitted by: Garrett Cooper Modified: head/lib/libc/gen/getutxent.3 head/lib/libc/gen/getutxent.c head/lib/libc/gen/pututxline.c head/lib/libc/gen/utxdb.c Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Sat Feb 19 11:09:38 2011 (r218845) +++ head/lib/libc/gen/getutxent.3 Sat Feb 19 11:31:56 2011 (r218846) @@ -367,16 +367,15 @@ It returns .Dv NULL when the provided .Vt utmpx -is invalid. -This may be because -.Fa ut_type -is invalid or +is invalid, or .Fa ut_type has a value of .Dv DEAD_PROCESS and an entry with an identifier with a value equal to the field .Fa ut_id -was not found. +was not found; the global variable +.Va errno +is set to indicate the error. .Pp The .Fn setutxdb @@ -387,6 +386,24 @@ Otherwise, -1 is returned and the global is set to indicate the error. .Sh ERRORS In addition to the error conditions described in +.Xr fdopen 3 , +.Xr fopen 3 , +.Xr fseek 3 , +.Xr open 3 , +the +.Fn pututxline +function can generate the following errors: +.Bl -tag -width Er +.It Bq Er ESRCH +The value of +.Fa ut_type +is DEAD_PROCESS, and the process entry could not be found. +.It Bq Er EINVAL +The value of +.Fa ut_type +is not supported by this implementation. +.El +In addition to the error conditions described in .Xr fopen 3 , the .Fn setutxdb Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Sat Feb 19 11:09:38 2011 (r218845) +++ head/lib/libc/gen/getutxent.c Sat Feb 19 11:31:56 2011 (r218846) @@ -112,22 +112,22 @@ getfutxent(struct futx *fu) if (udb == UTXDB_LOG) { uint16_t len; - if (fread(&len, sizeof len, 1, uf) != 1) + if (fread(&len, sizeof(len), 1, uf) != 1) return (-1); len = be16toh(len); if (len > sizeof *fu) { /* Forward compatibility. */ - if (fread(fu, sizeof *fu, 1, uf) != 1) + if (fread(fu, sizeof(*fu), 1, uf) != 1) return (-1); - fseek(uf, len - sizeof *fu, SEEK_CUR); + fseek(uf, len - sizeof(*fu), SEEK_CUR); } else { /* Partial record. */ - memset(fu, 0, sizeof *fu); + memset(fu, 0, sizeof(*fu)); if (fread(fu, len, 1, uf) != 1) return (-1); } } else { - if (fread(fu, sizeof *fu, 1, uf) != 1) + if (fread(fu, sizeof(*fu), 1, uf) != 1) return (-1); } return (0); @@ -163,7 +163,8 @@ getutxid(const struct utmpx *id) case LOGIN_PROCESS: case DEAD_PROCESS: if (memcmp(fu.fu_id, id->ut_id, - MIN(sizeof fu.fu_id, sizeof id->ut_id)) == 0) + MIN(sizeof(fu.fu_id), sizeof(id->ut_id))) == + 0) goto found; } break; @@ -191,7 +192,8 @@ getutxline(const struct utmpx *line) case USER_PROCESS: case LOGIN_PROCESS: if (strncmp(fu.fu_line, line->ut_line, - MIN(sizeof fu.fu_line, sizeof line->ut_line)) == 0) + MIN(sizeof(fu.fu_line), sizeof(line->ut_line))) == + 0) goto found; break; } @@ -212,7 +214,7 @@ getutxuser(const char *user) switch (fu.fu_type) { case USER_PROCESS: - if (strncmp(fu.fu_user, user, sizeof fu.fu_user) == 0) + if (strncmp(fu.fu_user, user, sizeof(fu.fu_user)) == 0) goto found; break; } Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Sat Feb 19 11:09:38 2011 (r218845) +++ head/lib/libc/gen/pututxline.c Sat Feb 19 11:31:56 2011 (r218846) @@ -43,9 +43,9 @@ __FBSDID("$FreeBSD$"); static FILE * futx_open(const char *file) { - int fd; - FILE *fp; struct stat sb; + FILE *fp; + int fd; fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK, 0644); if (fd < 0) @@ -54,7 +54,7 @@ futx_open(const char *file) /* Safety check: never use broken files. */ if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) { _close(fd); - errno = EINVAL; + errno = EFTYPE; return (NULL); } @@ -63,16 +63,16 @@ futx_open(const char *file) _close(fd); return (NULL); } - return (fp); } static int utx_active_add(const struct futx *fu) { - FILE *fp; struct futx fe; + FILE *fp; off_t partial = -1; + int error, ret; /* * Register user login sessions. Overwrite entries of sessions @@ -80,16 +80,17 @@ utx_active_add(const struct futx *fu) */ fp = futx_open(_PATH_UTX_ACTIVE); if (fp == NULL) - return (1); - while (fread(&fe, sizeof fe, 1, fp) == 1) { + return (-1); + while (fread(&fe, sizeof(fe), 1, fp) == 1) { switch (fe.fu_type) { case USER_PROCESS: case INIT_PROCESS: case LOGIN_PROCESS: case DEAD_PROCESS: /* Overwrite when ut_id matches. */ - if (memcmp(fu->fu_id, fe.fu_id, sizeof fe.fu_id) == 0) { - fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); + if (memcmp(fu->fu_id, fe.fu_id, sizeof(fe.fu_id)) == + 0) { + ret = fseeko(fp, -(off_t)sizeof(fe), SEEK_CUR); goto exact; } if (fe.fu_type != DEAD_PROCESS) @@ -97,55 +98,73 @@ utx_active_add(const struct futx *fu) /* FALLTHROUGH */ default: /* Allow us to overwrite unused records. */ - if (partial == -1) - partial = ftello(fp) - (off_t)sizeof fe; + if (partial == -1) { + partial = ftello(fp); + /* + * Distinguish errors from valid values so we + * don't overwrite good data by accident. + */ + if (partial != -1) + partial -= (off_t)sizeof(fe); + } break; } } - + /* * No exact match found. Use the partial match. If no partial * match was found, just append a new record. */ if (partial != -1) - fseeko(fp, partial, SEEK_SET); + ret = fseeko(fp, partial, SEEK_SET); exact: - fwrite(fu, sizeof *fu, 1, fp); + if (ret == -1) + error = errno; + else if (fwrite(fu, sizeof(*fu), 1, fp) < 1) + error = errno; + else + error = 0; fclose(fp); - return (0); + errno = error; + return (error == 0 ? 0 : 1); } static int utx_active_remove(struct futx *fu) { - FILE *fp; struct futx fe; + FILE *fp; + int error, ret; /* * Remove user login sessions, having the same ut_id. */ fp = futx_open(_PATH_UTX_ACTIVE); if (fp == NULL) - return (1); - while (fread(&fe, sizeof fe, 1, fp) == 1) { + return (-1); + error = ESRCH; + ret = -1; + while (fread(&fe, sizeof(fe), 1, fp) == 1 && ret != 0) switch (fe.fu_type) { case USER_PROCESS: case INIT_PROCESS: case LOGIN_PROCESS: - if (memcmp(fu->fu_id, fe.fu_id, sizeof fe.fu_id) != 0) + if (memcmp(fu->fu_id, fe.fu_id, sizeof(fe.fu_id)) != 0) continue; /* Terminate session. */ - fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); - fwrite(fu, sizeof *fu, 1, fp); - fclose(fp); - return (0); + if (fseeko(fp, -(off_t)sizeof(fe), SEEK_CUR) == -1) + error = errno; + else if (fwrite(fu, sizeof(*fu), 1, fp) < 1) + error = errno; + else + ret = 0; + } - } fclose(fp); - errno = ESRCH; - return (1); + errno = error; + return (ret); } static void @@ -158,8 +177,11 @@ utx_active_purge(void) static int utx_lastlogin_add(const struct futx *fu) { - FILE *fp; struct futx fe; + FILE *fp; + int error, ret; + + ret = 0; /* * Write an entry to lastlogin. Overwrite the entry if the @@ -168,25 +190,31 @@ utx_lastlogin_add(const struct futx *fu) */ fp = futx_open(_PATH_UTX_LASTLOGIN); if (fp == NULL) - return (1); + return (-1); while (fread(&fe, sizeof fe, 1, fp) == 1) { if (strncmp(fu->fu_user, fe.fu_user, sizeof fe.fu_user) != 0) continue; - + /* Found a previous lastlogin entry for this user. */ - fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); + ret = fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); break; } - fwrite(fu, sizeof *fu, 1, fp); + if (ret == -1) + error = errno; + else if (fwrite(fu, sizeof *fu, 1, fp) < 1) { + error = errno; + ret = -1; + } fclose(fp); - return (0); + errno = error; + return (ret); } static void utx_lastlogin_upgrade(void) { - int fd; struct stat sb; + int fd; fd = _open(_PATH_UTX_LASTLOGIN, O_RDWR, 0644); if (fd < 0) @@ -205,9 +233,9 @@ utx_lastlogin_upgrade(void) static int utx_log_add(const struct futx *fu) { - int fd; - uint16_t l; struct iovec vec[2]; + int error, fd; + uint16_t l; /* * Append an entry to the log file. We only need to append @@ -215,19 +243,23 @@ utx_log_add(const struct futx *fu) * zero-bytes. Prepend a length field, indicating the length of * the record, excluding the length field itself. */ - for (l = sizeof *fu; l > 0 && ((const char *)fu)[l - 1] == '\0'; l--); + for (l = sizeof(*fu); l > 0 && ((const char *)fu)[l - 1] == '\0'; l--) ; vec[0].iov_base = &l; - vec[0].iov_len = sizeof l; + vec[0].iov_len = sizeof(l); vec[1].iov_base = __DECONST(void *, fu); vec[1].iov_len = l; l = htobe16(l); fd = _open(_PATH_UTX_LOG, O_CREAT|O_WRONLY|O_APPEND, 0644); if (fd < 0) - return (1); - _writev(fd, vec, 2); + return (-1); + if (_writev(fd, vec, 2) == -1) + error = errno; + else + error = 0; _close(fd); - return (0); + errno = error; + return (error == 0 ? 0 : 1); } struct utmpx * @@ -237,7 +269,7 @@ pututxline(const struct utmpx *utmpx) int bad = 0; utx_to_futx(utmpx, &fu); - + switch (fu.fu_type) { case BOOT_TIME: case SHUTDOWN_TIME: @@ -267,6 +299,7 @@ pututxline(const struct utmpx *utmpx) return (NULL); break; default: + errno = EINVAL; return (NULL); } Modified: head/lib/libc/gen/utxdb.c ============================================================================== --- head/lib/libc/gen/utxdb.c Sat Feb 19 11:09:38 2011 (r218845) +++ head/lib/libc/gen/utxdb.c Sat Feb 19 11:31:56 2011 (r218846) @@ -132,9 +132,8 @@ futx_to_utx(const struct futx *fu) ut = calloc(1, sizeof *ut); if (ut == NULL) return (NULL); - } else { + } else memset(ut, 0, sizeof *ut); - } switch (fu->fu_type) { case BOOT_TIME: From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 11:44:05 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 553C0106566B; Sat, 19 Feb 2011 11:44:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42D598FC0C; Sat, 19 Feb 2011 11:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JBi51t094628; Sat, 19 Feb 2011 11:44:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JBi5tH094622; Sat, 19 Feb 2011 11:44:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201102191144.p1JBi5tH094622@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Feb 2011 11: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: r218847 - in head: lib/libc/gen usr.sbin usr.sbin/utxrm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 11:44:05 -0000 Author: ed Date: Sat Feb 19 11:44:04 2011 New Revision: 218847 URL: http://svn.freebsd.org/changeset/base/218847 Log: Add a utility, utxrm(8). Most of the ports I broke when I imported utmpx, were simple management utilities for the utmp database, allowing you to add/remove entries manually. Add a small tool called utxrm(8), which allows you to remove an entry from the utmpx database by hand. This is useful when a login daemon crashes or fails to remove the entry during shutdown. Added: head/usr.sbin/utxrm/ head/usr.sbin/utxrm/Makefile (contents, props changed) head/usr.sbin/utxrm/utxrm.8 (contents, props changed) head/usr.sbin/utxrm/utxrm.c (contents, props changed) Modified: head/lib/libc/gen/getutxent.3 head/usr.sbin/Makefile Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Sat Feb 19 11:31:56 2011 (r218846) +++ head/lib/libc/gen/getutxent.3 Sat Feb 19 11:44:04 2011 (r218847) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd February 19, 2011 .Dt GETUTXENT 3 .Os .Sh NAME @@ -424,7 +424,8 @@ The file format is invalid. .Xr gettimeofday 2 , .Xr tty 4 , .Xr ac 8 , -.Xr newsyslog 8 +.Xr newsyslog 8 , +.Xr utxrm 8 .Sh STANDARDS The .Fn endutxent , Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Feb 19 11:31:56 2011 (r218846) +++ head/usr.sbin/Makefile Sat Feb 19 11:44:04 2011 (r218847) @@ -89,6 +89,7 @@ SUBDIR= adduser \ trpt \ tzsetup \ ugidfw \ + utxrm \ vipw \ wake \ watch \ Added: head/usr.sbin/utxrm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/utxrm/Makefile Sat Feb 19 11:44:04 2011 (r218847) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= utxrm +MAN= utxrm.8 + +.include Added: head/usr.sbin/utxrm/utxrm.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/utxrm/utxrm.8 Sat Feb 19 11:44:04 2011 (r218847) @@ -0,0 +1,72 @@ +.\" Copyright (c) 2011 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 19, 2011 +.Dt UTXRM 8 +.Os +.Sh NAME +.Nm utxrm +.Nd remove sessions from the user accounting database +.Sh SYNOPSIS +.Nm +.Ar identifier +.Ar ... +.Sh DESCRIPTION +The +.Nm +utility can be used to remove stale sessions from the user accounting +database, by referring to their +.Ar identifier . +Stale sessions can occur if a login service exits prematurely or fails +to remove the session from the accounting database. +.Pp +Utilities such as +.Xr w 1 +will not display the identifier corresponding with a login session, +since its value is typically only of use by the process managing the +record. +The following command can be used to obtain all records from the user +accounting database's active session table, including its identifiers: +.Pp +.Dl getent utmpx active +.Pp +Identifiers can either be supplied in hexadecimal form as displayed by +.Xr getent 1 , +or as a string if the identifier allows such a representation. +.Pp +Because this utility requires write-access to the user accounting +database, its use is limited to the super-user. +.Sh SEE ALSO +.Xr getent 1 , +.Xr w 1 , +.Xr pututxline 3 . +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/usr.sbin/utxrm/utxrm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/utxrm/utxrm.c Sat Feb 19 11:44:04 2011 (r218847) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2011 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +static int +b16_pton(const char *in, char *out, size_t len) +{ + size_t i; + + for (i = 0; i < len * 2; i++) + if (!isxdigit((unsigned char)in[i])) + return (1); + for (i = 0; i < len; i++) + sscanf(&in[i * 2], "%02hhx", &out[i]); + return (0); +} + +int +main(int argc, char *argv[]) +{ + struct utmpx utx = { .ut_type = DEAD_PROCESS }; + size_t len; + int i, ret = 0; + + if (argc < 2) { + fprintf(stderr, "usage: utxrm identifier ...\n"); + return (1); + } + + gettimeofday(&utx.ut_tv, NULL); + for (i = 1; i < argc; i++) { + len = strlen(argv[i]); + if (len <= sizeof(utx.ut_id)) { + /* Identifier as string. */ + strncpy(utx.ut_id, argv[i], sizeof(utx.ut_id)); + } else if (len != sizeof(utx.ut_id) * 2 || + b16_pton(argv[i], utx.ut_id, sizeof(utx.ut_id)) != 0) { + /* Also not hexadecimal. */ + fprintf(stderr, "%s: Invalid identifier format\n", + argv[i]); + ret = 1; + continue; + } + + /* Zap the entry. */ + if (pututxline(&utx) == NULL) { + perror(argv[i]); + ret = 1; + } + } + return (ret); +} From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 13:22: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 77FEB106564A; Sat, 19 Feb 2011 13:22:18 +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 6762D8FC0A; Sat, 19 Feb 2011 13:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JDMICD097390; Sat, 19 Feb 2011 13:22:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JDMIT9097388; Sat, 19 Feb 2011 13:22:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102191322.p1JDMIT9097388@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Feb 2011 13:22: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: r218850 - 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: Sat, 19 Feb 2011 13:22:18 -0000 Author: jilles Date: Sat Feb 19 13:22:18 2011 New Revision: 218850 URL: http://svn.freebsd.org/changeset/base/218850 Log: sh: Make execution/fork1.0 work even if the basename of ${SH} is not "sh". Modified: head/tools/regression/bin/sh/execution/fork1.0 Modified: head/tools/regression/bin/sh/execution/fork1.0 ============================================================================== --- head/tools/regression/bin/sh/execution/fork1.0 Sat Feb 19 11:47:48 2011 (r218849) +++ head/tools/regression/bin/sh/execution/fork1.0 Sat Feb 19 13:22:18 2011 (r218850) @@ -1,7 +1,10 @@ # $FreeBSD$ +shname=${SH%% *} +shname=${shname##*/} + result=$(${SH} -c 'ps -p $$ -o comm=') test "$result" = "ps" || exit 1 result=$(${SH} -c 'ps -p $$ -o comm=; :') -test "$result" = "sh" || exit 1 +test "$result" = "$shname" || exit 1 From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 13:23: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 5D79F106566B; Sat, 19 Feb 2011 13:23:13 +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 4D4908FC0C; Sat, 19 Feb 2011 13:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JDNDXO097442; Sat, 19 Feb 2011 13:23:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JDNDkm097440; Sat, 19 Feb 2011 13:23:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102191323.p1JDNDkm097440@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Feb 2011 13:23: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: r218851 - head/tools/regression/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: Sat, 19 Feb 2011 13:23:13 -0000 Author: jilles Date: Sat Feb 19 13:23:13 2011 New Revision: 218851 URL: http://svn.freebsd.org/changeset/base/218851 Log: sh: Do not use "local" in the test runner as POSIX and ksh93 do not have it. Modified: head/tools/regression/bin/sh/regress.sh Modified: head/tools/regression/bin/sh/regress.sh ============================================================================== --- head/tools/regression/bin/sh/regress.sh Sat Feb 19 13:22:18 2011 (r218850) +++ head/tools/regression/bin/sh/regress.sh Sat Feb 19 13:23:13 2011 (r218851) @@ -9,7 +9,6 @@ export SH=${SH} COUNTER=1 do_test() { - local c c=${COUNTER} COUNTER=$((COUNTER+1)) ${SH} $1 > tmp.stdout 2> tmp.stderr From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 14:27: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 EF1311065673; Sat, 19 Feb 2011 14:27:14 +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 DE9038FC1C; Sat, 19 Feb 2011 14:27:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JEREDX098802; Sat, 19 Feb 2011 14:27:14 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JEREFY098800; Sat, 19 Feb 2011 14:27:14 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201102191427.p1JEREFY098800@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 19 Feb 2011 14:27: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: r218852 - 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, 19 Feb 2011 14:27:15 -0000 Author: jh Date: Sat Feb 19 14:27:14 2011 New Revision: 218852 URL: http://svn.freebsd.org/changeset/base/218852 Log: Don't restore old mount options and flags if VFS_MOUNT(9) succeeds but vfs_export() fails. Restoring old options and flags after successful VFS_MOUNT(9) call may cause the file system internal state to become inconsistent with mount options and flags. Specifically the FFS super block fs_ronly field and the MNT_RDONLY flag may get out of sync. PR: kern/133614 Discussed on: freebsd-hackers Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Feb 19 13:23:13 2011 (r218851) +++ head/sys/kern/vfs_mount.c Sat Feb 19 14:27:14 2011 (r218852) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) static int vfs_domount(struct thread *td, const char *fstype, - char *fspath, int fsflags, void *fsdata); + char *fspath, int fsflags, struct vfsoptlist **optlist); static void free_mntarg(struct mntarg *ma); static int usermount = 0; @@ -667,7 +667,7 @@ vfs_donmount(struct thread *td, int fsfl goto bail; } - error = vfs_domount(td, fstype, fspath, fsflags, optlist); + error = vfs_domount(td, fstype, fspath, fsflags, &optlist); bail: /* copyout the errmsg */ if (errmsg_pos != -1 && ((2 * errmsg_pos + 1) < fsoptions->uio_iovcnt) @@ -683,7 +683,7 @@ bail: } } - if (error != 0) + if (optlist != NULL) vfs_freeopts(optlist); return (error); } @@ -762,12 +762,12 @@ mount(td, uap) */ static int vfs_domount_first( - struct thread *td, /* Calling thread. */ - struct vfsconf *vfsp, /* File system type. */ - char *fspath, /* Mount path. */ - struct vnode *vp, /* Vnode to be covered. */ - int fsflags, /* Flags common to all filesystems. */ - void *fsdata /* Options local to the filesystem. */ + struct thread *td, /* Calling thread. */ + struct vfsconf *vfsp, /* File system type. */ + char *fspath, /* Mount path. */ + struct vnode *vp, /* Vnode to be covered. */ + int fsflags, /* Flags common to all filesystems. */ + struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct vattr va; @@ -807,7 +807,7 @@ vfs_domount_first( /* Allocate and initialize the filesystem. */ mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); /* XXXMAC: pass to vfs_mount_alloc? */ - mp->mnt_optnew = fsdata; + mp->mnt_optnew = *optlist; /* Set the mount level flags. */ mp->mnt_flag = (fsflags & (MNT_UPDATEMASK | MNT_ROOTFS | MNT_RDONLY)); @@ -830,6 +830,7 @@ vfs_domount_first( if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; + *optlist = NULL; (void)VFS_STATFS(mp, &mp->mnt_stat); /* @@ -872,16 +873,16 @@ vfs_domount_first( */ static int vfs_domount_update( - struct thread *td, /* Calling thread. */ - struct vnode *vp, /* Mount point vnode. */ - int fsflags, /* Flags common to all filesystems. */ - void *fsdata /* Options local to the filesystem. */ + struct thread *td, /* Calling thread. */ + struct vnode *vp, /* Mount point vnode. */ + int fsflags, /* Flags common to all filesystems. */ + struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct oexport_args oexport; struct export_args export; struct mount *mp; - int error, flag; + int error, export_error, flag; mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); @@ -932,7 +933,7 @@ vfs_domount_update( if ((mp->mnt_flag & MNT_ASYNC) == 0) mp->mnt_kern_flag &= ~MNTK_ASYNC; MNT_IUNLOCK(mp); - mp->mnt_optnew = fsdata; + mp->mnt_optnew = *optlist; vfs_mergeopts(mp->mnt_optnew, mp->mnt_opt); /* @@ -942,11 +943,12 @@ vfs_domount_update( */ error = VFS_MOUNT(mp); + export_error = 0; if (error == 0) { /* Process the export option. */ if (vfs_copyopt(mp->mnt_optnew, "export", &export, sizeof(export)) == 0) { - error = vfs_export(mp, &export); + export_error = vfs_export(mp, &export); } else if (vfs_copyopt(mp->mnt_optnew, "export", &oexport, sizeof(oexport)) == 0) { export.ex_flags = oexport.ex_flags; @@ -958,7 +960,7 @@ vfs_domount_update( export.ex_masklen = oexport.ex_masklen; export.ex_indexfile = oexport.ex_indexfile; export.ex_numsecflavors = 0; - error = vfs_export(mp, &export); + export_error = vfs_export(mp, &export); } } @@ -988,6 +990,7 @@ vfs_domount_update( if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; + *optlist = NULL; (void)VFS_STATFS(mp, &mp->mnt_stat); /* * Prevent external consumers of mount options from reading @@ -1005,7 +1008,7 @@ end: vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); vrele(vp); - return (error); + return (error != 0 ? error : export_error); } /* @@ -1013,11 +1016,11 @@ end: */ static int vfs_domount( - struct thread *td, /* Calling thread. */ - const char *fstype, /* Filesystem type. */ - char *fspath, /* Mount path. */ - int fsflags, /* Flags common to all filesystems. */ - void *fsdata /* Options local to the filesystem. */ + struct thread *td, /* Calling thread. */ + const char *fstype, /* Filesystem type. */ + char *fspath, /* Mount path. */ + int fsflags, /* Flags common to all filesystems. */ + struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct vfsconf *vfsp; @@ -1087,9 +1090,9 @@ vfs_domount( vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { error = vfs_domount_first(td, vfsp, fspath, vp, fsflags, - fsdata); + optlist); } else { - error = vfs_domount_update(td, vp, fsflags, fsdata); + error = vfs_domount_update(td, vp, fsflags, optlist); } mtx_unlock(&Giant); From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 14:49: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 78C07106564A; Sat, 19 Feb 2011 14:49:49 +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 680B28FC14; Sat, 19 Feb 2011 14:49:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JEnnpl099373; Sat, 19 Feb 2011 14:49:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JEnn2v099371; Sat, 19 Feb 2011 14:49:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201102191449.p1JEnn2v099371@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Feb 2011 14:49: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: r218853 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 14:49:49 -0000 Author: nwhitehorn Date: Sat Feb 19 14:49:49 2011 New Revision: 218853 URL: http://svn.freebsd.org/changeset/base/218853 Log: The PC98 gpart module supports labels now. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Feb 19 14:27:14 2011 (r218852) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Feb 19 14:49:49 2011 (r218853) @@ -65,6 +65,19 @@ gpart_show_error(const char *title, cons dialog_msgbox(title, message, 0, 0, TRUE); } +static int +scheme_supports_labels(const char *scheme) +{ + if (strcmp(scheme, "APM") == 0) + return (1); + if (strcmp(scheme, "GPT") == 0) + return (1); + if (strcmp(scheme, "PC98") == 0) + return (1); + + return (0); +} + int gpart_partition(const char *lg_name, const char *scheme) { @@ -389,11 +402,7 @@ gpart_edit(struct gprovider *pp) } } - /* Labels only supported on GPT and APM */ - if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) - nitems = 4; - else - nitems = 3; + nitems = scheme_supports_labels(scheme) ? 4 : 3; /* Edit editable parameters of a partition */ hadlabel = 0; @@ -738,11 +747,7 @@ gpart_create(struct gprovider *pp, char if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) items[0].text = "freebsd"; - /* Labels only supported on GPT and APM */ - if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) - nitems = 4; - else - nitems = 3; + nitems = scheme_supports_labels(scheme) ? 4 : 3; if (default_type != NULL) items[0].text = default_type; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 14:57: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 24C041065670; Sat, 19 Feb 2011 14:57:01 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 149538FC12; Sat, 19 Feb 2011 14:57:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JEv0qn099568; Sat, 19 Feb 2011 14:57:00 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JEv0oS099566; Sat, 19 Feb 2011 14:57:00 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102191457.p1JEv0oS099566@svn.freebsd.org> From: Bruce Cran Date: Sat, 19 Feb 2011 14:57: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: r218854 - head/share/examples/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 14:57:01 -0000 Author: brucec Date: Sat Feb 19 14:57:00 2011 New Revision: 218854 URL: http://svn.freebsd.org/changeset/base/218854 Log: Update the icmp example to show allowing only the safe types. Suggested by: Tom Judge MFC after: 3 days Modified: head/share/examples/pf/pf.conf Modified: head/share/examples/pf/pf.conf ============================================================================== --- head/share/examples/pf/pf.conf Sat Feb 19 14:49:49 2011 (r218853) +++ head/share/examples/pf/pf.conf Sat Feb 19 14:57:00 2011 (r218854) @@ -32,4 +32,4 @@ #pass in on $ext_if proto tcp to ($ext_if) port ssh #pass in log on $ext_if proto tcp to ($ext_if) port smtp #pass out log on $ext_if proto tcp from ($ext_if) to port smtp -#pass in on $ext_if proto icmp to ($ext_if) +#pass in on $ext_if inet proto icmp from any to ($ext_if) icmp-type { unreach, redir, timex } From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 15:22: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 C5A40106564A; Sat, 19 Feb 2011 15:22:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4F7D8FC12; Sat, 19 Feb 2011 15:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JFM6Vm000404; Sat, 19 Feb 2011 15:22:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JFM6s8000402; Sat, 19 Feb 2011 15:22:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201102191522.p1JFM6s8000402@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Feb 2011 15:22: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: r218855 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 15:22:06 -0000 Author: nwhitehorn Date: Sat Feb 19 15:22:06 2011 New Revision: 218855 URL: http://svn.freebsd.org/changeset/base/218855 Log: Don't present the user with spurious errors when overwriting a disk with a deleted, but uncommitted, gpart. Reported by: brucec Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/part_wizard.c Sat Feb 19 14:57:00 2011 (r218854) +++ head/usr.sbin/bsdinstall/partedit/part_wizard.c Sat Feb 19 15:22:06 2011 (r218855) @@ -213,6 +213,10 @@ wizard_partition(struct gmesh *mesh, con } } + /* Treat uncommitted scheme deletions as no scheme */ + if (scheme != NULL && strcmp(scheme, "(none)") == 0) + scheme = NULL; + query: dialog_vars.yes_label = "Entire Disk"; dialog_vars.no_label = "Partition"; @@ -247,8 +251,9 @@ query: scheme = default_scheme(); } - if (scheme == NULL || strcmp(scheme, "(none)") == 0 || choice == 0) { - if (gpart != NULL) { /* Erase partitioned disk */ + if (scheme == NULL || choice == 0) { + if (gpart != NULL && scheme != NULL) { + /* Erase partitioned disk */ choice = dialog_yesno("Confirmation", "This will erase " "the disk. Are you sure you want to proceed?", 0, 0); if (choice != 0) From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 17: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 25F83106566C; Sat, 19 Feb 2011 17:38:52 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157D88FC12; Sat, 19 Feb 2011 17:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JHcpjP004291; Sat, 19 Feb 2011 17:38:51 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JHcpjJ004289; Sat, 19 Feb 2011 17:38:51 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201102191738.p1JHcpjJ004289@svn.freebsd.org> From: Martin Wilke Date: Sat, 19 Feb 2011 17:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218861 - head/sys/dev/ppc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 17:38:52 -0000 Author: miwi Date: Sat Feb 19 17:38:51 2011 New Revision: 218861 URL: http://svn.freebsd.org/changeset/base/218861 Log: - Add support for MosChip 9865 Single 1284 Printer port PR: kern/152663 Submitted by: Jonathan Chen Approved by: rwatson (mentor) Modified: head/sys/dev/ppc/ppc_pci.c Modified: head/sys/dev/ppc/ppc_pci.c ============================================================================== --- head/sys/dev/ppc/ppc_pci.c Sat Feb 19 17:14:03 2011 (r218860) +++ head/sys/dev/ppc/ppc_pci.c Sat Feb 19 17:38:51 2011 (r218861) @@ -89,6 +89,7 @@ static struct pci_id pci_ids[] = { { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, + { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xffff } }; From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 17:49: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 EC0E7106566C; Sat, 19 Feb 2011 17:49:12 +0000 (UTC) (envelope-from unixmania@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 6A62D8FC12; Sat, 19 Feb 2011 17:49:12 +0000 (UTC) Received: by qwj9 with SMTP id 9so3971308qwj.13 for ; Sat, 19 Feb 2011 09:49:11 -0800 (PST) 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=SeuVcPAMWY0hqVIkhsVZOtUQBSkEbIAZjt8jMJnouWU=; b=ZJg5k3nSDG9XhfSrw2EfHOEbOMTVY3FaQhFaAzEmGH1+AYwfIIm0i1whXhIyMJs5nx 7DcI07f6xVNpLC7IY1+reOCv2aAhg97oaeTxG8ET0aTceoPFBHsh7PuXQKvw+Zb6SMSS +hwkve+BirjoUYCee8xHHH59z65tVlPYfFL9s= 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=Yf2fg9A2kkRpb9cQtRjPsJlAzbCQHE+cOH3hevp+F3iAWpf5OQHcq0PCp0tB0lWPLG 8iZn1bEv7Vzay8tObvaPyLMDOByZR1kkZwdZsdWZtjF6fFWvHelFlSaVLNNKndEUSBE7 suk92YB9lEek/TY0lbAcFAJQ4d6jbGvfVay8E= MIME-Version: 1.0 Received: by 10.224.19.130 with SMTP id a2mr1717224qab.33.1298136332062; Sat, 19 Feb 2011 09:25:32 -0800 (PST) Received: by 10.229.70.134 with HTTP; Sat, 19 Feb 2011 09:25:32 -0800 (PST) In-Reply-To: <201102131818.p1DIIuLL046962@svn.freebsd.org> References: <201102131818.p1DIIuLL046962@svn.freebsd.org> Date: Sat, 19 Feb 2011 15:25:32 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Bruce Cran 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: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 17:49:13 -0000 On Sun, Feb 13, 2011 at 4:18 PM, Bruce Cran wrote: > Author: brucec > Date: Sun Feb 13 18:18:56 2011 > New Revision: 218650 > URL: http://svn.freebsd.org/changeset/base/218650 > > Log: > =A0Move potentially offensive fortune to fortunes-o. Did anybody complain about this? If not, would you mid either revert this commit or just go ahead and move all "potentially" offensive jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will probably qualify. > --- head/games/fortune/datfiles/fortunes =A0 =A0 =A0 =A0Sun Feb 13 18:08:= 53 2011 =A0 =A0 =A0 =A0(r218649) > +++ head/games/fortune/datfiles/fortunes =A0 =A0 =A0 =A0Sun Feb 13 18:18:= 56 2011 =A0 =A0 =A0 =A0(r218650) > @@ -38136,10 +38136,6 @@ couldn't compete successfully with poets > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Kilgore Trout (Philip J. Farmer) "Venus= on the Half > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Shell" > =A0% > -PLATONIC FRIENDSHIP: > - =A0 =A0 =A0 What develops when two people get > - =A0 =A0 =A0 tired of making love to each other. From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 19:29: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 EF3D7106566C; Sat, 19 Feb 2011 19:29:37 +0000 (UTC) (envelope-from brucec@freebsd.org) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 89D5E8FC0C; Sat, 19 Feb 2011 19:29:37 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 5019AE81CA; Sat, 19 Feb 2011 19:29:34 +0000 (GMT) Received: from core.nessbank (client-86-31-177-138.oxfd.adsl.virginmedia.com [86.31.177.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 37218E8189; Sat, 19 Feb 2011 19:29:34 +0000 (GMT) From: Bruce Cran To: "Carlos A. M. dos Santos" Date: Sat, 19 Feb 2011 19:29:11 +0000 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.5; amd64; ; ) References: <201102131818.p1DIIuLL046962@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102191929.11510.brucec@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 19:29:38 -0000 On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > Did anybody complain about this? If not, would you mid either revert > this commit or just go ahead and move all "potentially" offensive > jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will > probably qualify. Yes, someone complained. From bin/137702: "A coworker pointed out a borderline offensive fortune that appeared in my email signature which is partially generated from `fortune -s` output. [...] I agree that it's probably not appropriate in a professional setting." -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 19: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 A4D22106566B; Sat, 19 Feb 2011 19:33:55 +0000 (UTC) (envelope-from juli@clockworksquid.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 41E3A8FC0A; Sat, 19 Feb 2011 19:33:54 +0000 (UTC) Received: by qyk35 with SMTP id 35so342362qyk.13 for ; Sat, 19 Feb 2011 11:33:54 -0800 (PST) Received: by 10.229.95.19 with SMTP id b19mr1567153qcn.179.1298144034307; Sat, 19 Feb 2011 11:33:54 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.229.74.70 with HTTP; Sat, 19 Feb 2011 11:33:34 -0800 (PST) In-Reply-To: <201102191929.11510.brucec@freebsd.org> References: <201102131818.p1DIIuLL046962@svn.freebsd.org> <201102191929.11510.brucec@freebsd.org> From: Juli Mallett Date: Sat, 19 Feb 2011 11:33:34 -0800 X-Google-Sender-Auth: E8gBXoANcoq-NLLunCFE7vXosX0 Message-ID: To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "Carlos A. M. dos Santos" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 19:33:55 -0000 On Sat, Feb 19, 2011 at 11:29, Bruce Cran wrote: > On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > >> Did anybody complain about this? If not, would you mid either revert >> this commit or just go ahead and move all "potentially" offensive >> jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will >> probably qualify. > > Yes, someone complained. From =A0bin/137702: > > "A coworker pointed out a borderline offensive fortune that appeared in m= y > email signature which is partially generated from `fortune -s` output. > > [...] > > I agree that it's probably not appropriate in a professional setting." Professionally-appropriate is not the same as offensive, and such standards vary considerably more than ones for offensiveness. I don't think professionally-appropriate is the right standard for fortune. Certainly there's not really anything very professional about having a random E-Mail signature that's meant to amuse, for that matter. From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 20: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 B671710656B0; Sat, 19 Feb 2011 20:08:00 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4888FC14; Sat, 19 Feb 2011 20:08:00 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id F0BF1E81CA; Sat, 19 Feb 2011 20:07:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=from:to :subject:date:cc:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; s=mail; bh=D r8CZqHngiIlj9IAIOfuswaFiPk=; b=GZ1ShEpvGDJFMtIPnf0cKOAzi9LfCYST7 zHwoGccBj0y1ijF0Ai1f5XLOw2xXNMXc1wbG3mX9EGRPy9xXmCY/4/TrqQJTak5F X2O/LE9TVSSr8QqpD5jcZW8wZR6mP+T4Udh7UBngrhjHzkYuFzRxpP3+AFluASTi BRs0WSVEkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=from:to :subject:date:cc:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; q=dns; s= mail; b=OrvuXLow1uOC3fOcCOFviuxKFHoH00O9Z4eBH6O5hVr74XVR0UhTctkc blEwN1XgECGUt9k9nVJNQTa/WD0udt8j9eYEAAVESR1Dd41B3/Y8cqH7n9eJ4xqZ 0mcGD93Xv9AVjHU3oRk734hohNTLsr8L9lawYl8CYWEhs+8DDXE= Received: from core.nessbank (client-86-31-177-138.oxfd.adsl.virginmedia.com [86.31.177.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id D70C1E8189; Sat, 19 Feb 2011 20:07:55 +0000 (GMT) From: Bruce Cran To: "Carlos A. M. dos Santos" Date: Sat, 19 Feb 2011 20:07:32 +0000 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.5; amd64; ; ) References: <201102131818.p1DIIuLL046962@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102192007.32979.bruce@cran.org.uk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 20:08:00 -0000 On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > Did anybody complain about this? If not, would you mid either revert > this commit or just go ahead and move all "potentially" offensive > jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will > probably qualify. I'm happy to revert the checkin if you think the fortune should be in the main file, since it appears the PR submitter was complaining just as much about being unprofessional as offensive. Would you like me to go ahead and revert the move? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 21:04: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 4377E1065670; Sat, 19 Feb 2011 21:04:37 +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 33A848FC1A; Sat, 19 Feb 2011 21:04:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JL4bLr009105; Sat, 19 Feb 2011 21:04:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JL4bcD009103; Sat, 19 Feb 2011 21:04:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201102192104.p1JL4bcD009103@svn.freebsd.org> From: Alan Cox Date: Sat, 19 Feb 2011 21:04: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: r218863 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 21:04:37 -0000 Author: alc Date: Sat Feb 19 21:04:36 2011 New Revision: 218863 URL: http://svn.freebsd.org/changeset/base/218863 Log: tmpfs_remove() isn't modifying the file's data, so it shouldn't set TMPFS_NODE_MODIFIED on the node. PR: 152488 Submitted by: Anton Yuzhaninov Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 19 17:44:13 2011 (r218862) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 19 21:04:36 2011 (r218863) @@ -853,8 +853,7 @@ tmpfs_remove(struct vop_remove_args *v) tmpfs_free_dirent(tmp, de, TRUE); if (node->tn_links > 0) - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ - TMPFS_NODE_MODIFIED; + node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED; error = 0; out: From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 22:40: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 A4C17106564A; Sat, 19 Feb 2011 22:40:31 +0000 (UTC) (envelope-from unixmania@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 0DBA78FC14; Sat, 19 Feb 2011 22:40:30 +0000 (UTC) Received: by qyk35 with SMTP id 35so398859qyk.13 for ; Sat, 19 Feb 2011 14:40:30 -0800 (PST) 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=U7sheVJIwcDDroaWo0GxAjY904EPVAbkT5fAcMStIsw=; b=eBabWo8Gp1w495MDCmJ2M2TMkNbDNTji2PDfBaKP1O0/cfrEsNWoWqw0Si45bFE0L5 sJUBHrn/1UI/xXM3DnLg9CgSsx3lEgHVZag8L0l7sFHTT5SsZV+nfgO/TQWgrbzI0x08 riedHHIOFlh5i98TpWE+eR2FhOaMWAr9m+l6U= 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=bnIGp3K2TerrE093ponyfmEnC7SFB/cESAsV4gYwwFLuBpImLwt/bAFOxLwKKgs5B/ cB2qicyDSnY98l9wVpTwZ5V7b4fCQwUcB9tXpN3vdG2Bf5yoVstRhrXshP43ZMoP8jmY MDi5FZV64CCJdpvZADNcfe2gP7UGcvRlh3zD8= MIME-Version: 1.0 Received: by 10.229.81.206 with SMTP id y14mr1715935qck.127.1298155229989; Sat, 19 Feb 2011 14:40:29 -0800 (PST) Received: by 10.229.70.134 with HTTP; Sat, 19 Feb 2011 14:40:29 -0800 (PST) In-Reply-To: <201102191929.11510.brucec@freebsd.org> References: <201102131818.p1DIIuLL046962@svn.freebsd.org> <201102191929.11510.brucec@freebsd.org> Date: Sat, 19 Feb 2011 20:40:29 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Bruce Cran 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: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 22:40:31 -0000 On Sat, Feb 19, 2011 at 5:29 PM, Bruce Cran wrote: > On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > >> Did anybody complain about this? If not, would you mid either revert >> this commit or just go ahead and move all "potentially" offensive >> jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will >> probably qualify. > > Yes, someone complained. From =A0bin/137702: > > "A coworker pointed out a borderline offensive fortune that appeared in m= y > email signature which is partially generated from `fortune -s` output. So the PR submitter should stop using random fortunes in email signatures instead of asking FreeBSD to make fortunes compliant to the moral standards of his/her coworkers. How long do you think it will take until somebody else find a a borderline offensive fortune? > [...] > > I agree that it's probably not appropriate in a professional setting." Sure. People must understand that fortunes are an optional feature whose use has unpredictable consequences. Blaming FreeBSD for the possible inconveniences. From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 22:43: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 4CB701065673; Sat, 19 Feb 2011 22:43:27 +0000 (UTC) (envelope-from unixmania@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 B16548FC13; Sat, 19 Feb 2011 22:43:26 +0000 (UTC) Received: by qwj9 with SMTP id 9so4062331qwj.13 for ; Sat, 19 Feb 2011 14:43:26 -0800 (PST) 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=igcj0M959rYDdNgSBIOd6/oAlrD2LNqWQgPKwzEFzzI=; b=nBBlBAtwtBGt2ddyaeNg+vNzcXszxVw2dMebQ3C8CQ9kj88cZ6VFxwk4KTOEJ6w4Iy nOGko6WxGseYysliEc7cznMZFxxWeS7oVjFVCTgQxo7Ik/ZgXUp34qSgz1GtHSv/USSL GwHqxUrAVNoOEKQskBkfHHkRZYtzSBSCjX69w= 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=jPY8TNYNBOgy0VqmjgKSXlC74j9sWy1Ie2RbJNcuzksBVUeh5FFVTmsqUU7bQFzOsx Q1FS71eYy3FeUxGKX3Cc3t7dYp50IzhnT+vbepc5sQ/YSS4+LFN+6+IoDlOjbyyZmXPa D5yvL4PyiaTt10VBQmMC5becFpcaPGtnCkrzE= MIME-Version: 1.0 Received: by 10.229.84.3 with SMTP id h3mr1718416qcl.89.1298155405248; Sat, 19 Feb 2011 14:43:25 -0800 (PST) Received: by 10.229.70.134 with HTTP; Sat, 19 Feb 2011 14:43:25 -0800 (PST) In-Reply-To: References: <201102131818.p1DIIuLL046962@svn.freebsd.org> <201102191929.11510.brucec@freebsd.org> Date: Sat, 19 Feb 2011 20:43:25 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 22:43:27 -0000 On Sat, Feb 19, 2011 at 8:40 PM, Carlos A. M. dos Santos wrote: > On Sat, Feb 19, 2011 at 5:29 PM, Bruce Cran wrote: > Sure. People must understand that fortunes are an optional feature > whose use has unpredictable consequences. Blaming FreeBSD for the > possible inconveniences... ... is a big mistake. From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 22:53: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 6D2B0106564A; Sat, 19 Feb 2011 22:53:51 +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 418D78FC0C; Sat, 19 Feb 2011 22:53:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1JMrpeO011567; Sat, 19 Feb 2011 22:53:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1JMrpKc011564; Sat, 19 Feb 2011 22:53:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102192253.p1JMrpKc011564@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Feb 2011 22:53: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: r218864 - 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: Sat, 19 Feb 2011 22:53:51 -0000 Author: hselasky Date: Sat Feb 19 22:53:50 2011 New Revision: 218864 URL: http://svn.freebsd.org/changeset/base/218864 Log: Add more udav device ID's. Submitted by: Rick van der Zwet MFC after: 7 days Approved by: thompsa (mentor) 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 Sat Feb 19 21:04:36 2011 (r218863) +++ head/sys/dev/usb/net/if_udav.c Sat Feb 19 22:53:50 2011 (r218864) @@ -206,6 +206,10 @@ static const struct usb_device_id udav_d {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ST268, 0)}, /* Corega USB-TXC */ {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXC, 0)}, + /* ShanTou AMD8515 USB NIC */ + {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, + /* Kontron AG USB Ethernet */ + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, }; static void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Feb 19 21:04:36 2011 (r218863) +++ head/sys/dev/usb/usbdevs Sat Feb 19 22:53:50 2011 (r218864) @@ -551,6 +551,7 @@ vendor VTECH 0x0f88 VTech vendor FALCOM 0x0f94 Falcom Wireless Communications GmbH vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations +vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer vendor MOTOROLA4 0x100d Motorola @@ -2008,6 +2009,9 @@ product KODAK DC290 0x0112 Digital Scie product KODAK DC240 0x0120 Digital Science DC240 product KODAK DC280 0x0130 Digital Science DC280 +/* Kontron AG products */ +product KONTRON DM9601 0x8101 USB Ethernet + /* Konica Corp. Products */ product KONICA CAMERA 0x0720 Digital Color Camera @@ -2843,6 +2847,7 @@ product SENAO RT3072_5 0x9801 RT3072 /* ShanTou products */ product SHANTOU ST268 0x0268 ST268 product SHANTOU DM9601 0x9601 DM 9601 +product SHANTOU ADM8515 0x8515 ADM8515 /* Shark products */ product SHARK PA 0x0400 Pocket Adapter From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 23:13: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 82A2A106566B; Sat, 19 Feb 2011 23:13:01 +0000 (UTC) (envelope-from unixmania@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 028CA8FC0A; Sat, 19 Feb 2011 23:13:00 +0000 (UTC) Received: by qyk35 with SMTP id 35so407605qyk.13 for ; Sat, 19 Feb 2011 15:13:00 -0800 (PST) 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=9y8uWcBUXleG3ep8iZDtDLrOq8+B+igVSqKaG7MmFfg=; b=nK+FOeegtBVjrerkK6zj1tobrjN3W7SlacK4QR8PXoqMCn5W+MMMDSJR0VRVF24WKE 5s5gwo4qhMklXYJmg7xI04oEU846GNx9XC/l2vhXmfvH9pT+hBYLrxm2R27n8Q7EYNfr q4IUlcWkQ/F+LtOWf8HMQIFv24IsF+2NY5BUA= 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=svVASuTlFOufqCpaAg7UvBM6Kv7CNppSCcNJi72CM39jLo1QJt4ZYPgCQGaNgEYnH/ Uu2KkTeLPA/9k4Nd81NEIrWNWr1G1fJTaZJlRoDf5WLPkigGzmewr8Q6CpODsPRmHGOm GZZETRo2dqvshnASLteopMiAhctsYuR8u3hoc= MIME-Version: 1.0 Received: by 10.229.81.206 with SMTP id y14mr1727914qck.127.1298157179997; Sat, 19 Feb 2011 15:12:59 -0800 (PST) Received: by 10.229.70.134 with HTTP; Sat, 19 Feb 2011 15:12:59 -0800 (PST) In-Reply-To: <201102192007.32979.bruce@cran.org.uk> References: <201102131818.p1DIIuLL046962@svn.freebsd.org> <201102192007.32979.bruce@cran.org.uk> Date: Sat, 19 Feb 2011 21:12:59 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Bruce Cran 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: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 23:13:01 -0000 On Sat, Feb 19, 2011 at 6:07 PM, Bruce Cran wrote: > On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > >> Did anybody complain about this? If not, would you mid either revert >> this commit or just go ahead and move all "potentially" offensive >> jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will >> probably qualify. > > I'm happy to revert the checkin if you think the fortune should be in the= main > file, since it appears the PR submitter was complaining just as much abou= t > being unprofessional as offensive. =A0Would you like me to go ahead and r= evert > the move? I suggest you to revert the commit and add a prominent note to fortune(1) explaining that the interpretation of a joke ever depends on people's point of view. So the next time somebody comes with a vague complaint about offensiveness you can just answer "you have been warned". From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 23:27: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 4BC3E106564A for ; Sat, 19 Feb 2011 23:27:19 +0000 (UTC) (envelope-from dougb@dougbarton.us) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id E5A6B8FC0A for ; Sat, 19 Feb 2011 23:27:18 +0000 (UTC) Received: (qmail 31394 invoked by uid 399); 19 Feb 2011 23:27:14 -0000 Received: from router.ka9q.net (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@75.60.237.91) by mail2.fluidhosting.com with ESMTPAM; 19 Feb 2011 23:27:14 -0000 X-Originating-IP: 75.60.237.91 X-Sender: dougb@dougbarton.us Message-ID: <4D6051D0.8050704@dougbarton.us> Date: Sat, 19 Feb 2011 15:27:12 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110129 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Carlos A. M. dos Santos" References: <201102131818.p1DIIuLL046962@svn.freebsd.org> <201102192007.32979.bruce@cran.org.uk> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218650 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Feb 2011 23:27:19 -0000 On 02/19/2011 15:12, Carlos A. M. dos Santos wrote: > On Sat, Feb 19, 2011 at 6:07 PM, Bruce Cran wrote: >> On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: >> >>> Did anybody complain about this? If not, would you mid either revert >>> this commit or just go ahead and move all "potentially" offensive >>> jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will >>> probably qualify. >> >> I'm happy to revert the checkin if you think the fortune should be in the main >> file, since it appears the PR submitter was complaining just as much about >> being unprofessional as offensive. Would you like me to go ahead and revert >> the move? > > I suggest you to revert the commit Serious overkill, particularly since: 1. The commit has already been MFC'ed, and 2. The fortune in question actually _is_ potentially offensive And let me save you another loop through the arguments you've already put forward. I realize that this fortune does not offend _you_, that's not the issue. I also heard your argument that "If you're going to do this one, you have to do them all!" Which I reject with the standard error code, ENOTINTHIRDGRADE. The nerderati community likes to demonstrate how cool and sophisticated we are at least in part by showing how un-offended we get by things in fortune. Well, that's great for you. The problem with diving into editing the fortune databases is that you run right into the mother of all bikesheds with everyone trying to _prove_ how hip and sophisticated they are. For this reason in addition to the note that I sent to this list I spoke privately to Bruce about the fact that what we have now is a sort of detente, where the people who would like to move some of the fortunes into fortunes-o do not do that, but we apply a stricter standard to _new_ fortunes. This "works" in the sense that nothing is really made worse by it, and everyone is a little unhappy because no one is getting everything they want. Bruce did what he thought was the right thing in an effort to close a PR. There is no reason to castigate him for it, and there is certainly no reason to revert the commit. Every once in a while someone has to come along and step on this particular land mine, it was just Bruce's turn. Everyone can now move along and find more productive things to work on. 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/ -- 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/