From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 00:13:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0CC1065670; Sun, 13 Dec 2009 00:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8D988FC13; Sun, 13 Dec 2009 00:13: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 nBD0DLOQ068109; Sun, 13 Dec 2009 00:13:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD0DL9F068105; Sun, 13 Dec 2009 00:13:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912130013.nBD0DL9F068105@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 00:13: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: r200459 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 00:13:22 -0000 Author: marius Date: Sun Dec 13 00:13:21 2009 New Revision: 200459 URL: http://svn.freebsd.org/changeset/base/200459 Log: Unbreak the ata_atapi() usage. Since r200171 the mode setting functions get a ata_device type device passed instead of a ata_channel one, thus ata_atapi() has to be adjusted accordingly. Reviewed by: mav MFC after: 3 days Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/chipsets/ata-ite.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/ata-all.c Sun Dec 13 00:13:21 2009 (r200459) @@ -1150,12 +1150,11 @@ ata_satarev2str(int rev) } int -ata_atapi(device_t dev) +ata_atapi(device_t dev, int target) { - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(dev); - return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); + return (ch->devices & (ATA_ATAPI_MASTER << target)); } int Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/ata-all.h Sun Dec 13 00:13:21 2009 (r200459) @@ -622,7 +622,7 @@ void ata_udelay(int interval); char *ata_unit2str(struct ata_device *atadev); const char *ata_mode2str(int mode); const char *ata_satarev2str(int rev); -int ata_atapi(device_t dev); +int ata_atapi(device_t dev, int target); int ata_pmode(struct ata_params *ap); int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/chipsets/ata-ite.c Sun Dec 13 00:13:21 2009 (r200459) @@ -212,12 +212,12 @@ ata_ite_8213_setmode(device_t dev, int t reg40 |= 0x4033; /* Set PIO/WDMA timings. */ if (target == 0) { - reg40 |= (ata_atapi(dev) ? 0x04 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x04 : 0x00); mask40 = 0x3300; new40 = timings[ata_mode2idx(piomode)] << 8; } else { - reg40 |= (ata_atapi(dev) ? 0x40 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x40 : 0x00); mask44 = 0x0f; new44 = ((timings[ata_mode2idx(piomode)] & 0x30) >> 2) | (timings[ata_mode2idx(piomode)] & 0x03); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 01:20:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0BE1065692; Sun, 13 Dec 2009 01:20:33 +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 EF9378FC1C; Sun, 13 Dec 2009 01:20: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 nBD1KWWV069435; Sun, 13 Dec 2009 01:20:32 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD1KWF6069432; Sun, 13 Dec 2009 01:20:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912130120.nBD1KWF6069432@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Dec 2009 01:20: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: r200460 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 01:20:33 -0000 Author: marcel Date: Sun Dec 13 01:20:32 2009 New Revision: 200460 URL: http://svn.freebsd.org/changeset/base/200460 Log: Add support for memory disk (md). The size of the memory disk is determined by MD_IMAGE_SIZE. A file system can be embedded into the loader with /sys/tools/embed_mfs.sh. Note that md.c is not included when MD_IMAGE_SIZE is not set. Added: head/sys/boot/common/md.c (contents, props changed) Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Sun Dec 13 00:13:21 2009 (r200459) +++ head/sys/boot/common/Makefile.inc Sun Dec 13 01:20:32 2009 (r200460) @@ -23,6 +23,11 @@ SRCS+= dev_net.c SRCS+= bcache.c .endif +.if defined(MD_IMAGE_SIZE) +CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE} +SRCS+= md.c +.endif + # Machine-independant ISA PnP .if defined(HAVE_ISABUS) SRCS+= isapnp.c Added: head/sys/boot/common/md.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/md.c Sun Dec 13 01:20:32 2009 (r200460) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 "bootstrap.h" + +#define MD_BLOCK_SIZE 512 + +#ifndef MD_IMAGE_SIZE +#error Must be compiled with MD_IMAGE_SIZE defined +#endif +#if (MD_IMAGE_SIZE == 0 || MD_IMAGE_SIZE % MD_BLOCK_SIZE) +#error Image size must be a multiple of 512. +#endif + +/* + * Preloaded image gets put here. + * Applications that patch the object with the image can determine + * the size looking at the start and end markers (strings), + * so we want them contiguous. + */ +static struct { + u_char start[MD_IMAGE_SIZE]; + u_char end[128]; +} md_image = { + .start = "MFS Filesystem goes here", + .end = "MFS Filesystem had better STOP here", +}; + +/* devsw I/F */ +static int md_init(void); +static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int md_open(struct open_file *, ...); +static int md_close(struct open_file *); +static void md_print(int); + +struct devsw md_dev = { + "md", + DEVT_DISK, + md_init, + md_strategy, + md_open, + md_close, + noioctl, + md_print +}; + +static int +md_init(void) +{ + + return (0); +} + +static int +md_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, + size_t *rsize) +{ + struct devdesc *dev = (struct devdesc *)devdata; + size_t ofs; + + if (dev->d_unit != 0) + return (ENXIO); + + if (blk < 0 || blk >= (MD_IMAGE_SIZE / MD_BLOCK_SIZE)) + return (EIO); + + if (size % MD_BLOCK_SIZE) + return (EIO); + + ofs = blk * MD_BLOCK_SIZE; + if ((ofs + size) > MD_IMAGE_SIZE) + size = MD_IMAGE_SIZE - ofs; + + if (rsize != 0) + *rsize = size; + + switch (rw) { + case F_READ: + bcopy(md_image.start + ofs, buf, size); + return (0); + case F_WRITE: + bcopy(buf, md_image.start + ofs, size); + return (0); + } + + return (ENODEV); +} + +static int +md_open(struct open_file *f, ...) +{ + va_list ap; + struct devdesc *dev; + + va_start(ap, f); + dev = va_arg(ap, struct devdesc *); + va_end(ap); + + if (dev->d_unit != 0) + return (ENXIO); + + return (0); +} + +static int +md_close(struct open_file *f) +{ + struct devdesc *dev; + + dev = (struct devdesc *)(f->f_devdata); + return ((dev->d_unit != 0) ? ENXIO : 0); +} + +static void +md_print(int verbose) +{ + + printf("MD (%u bytes)\n", MD_IMAGE_SIZE); +} From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 01:58:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9AA106566B; Sun, 13 Dec 2009 01:58:18 +0000 (UTC) (envelope-from will@firepipe.net) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.211.172]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF128FC16; Sun, 13 Dec 2009 01:58:17 +0000 (UTC) Received: by ywh2 with SMTP id 2so2112177ywh.27 for ; Sat, 12 Dec 2009 17:58:17 -0800 (PST) Received: by 10.101.6.14 with SMTP id j14mr604952ani.135.1260669497193; Sat, 12 Dec 2009 17:58:17 -0800 (PST) Received: from cephei.firepipe.net (c-98-245-40-5.hsd1.co.comcast.net [98.245.40.5]) by mx.google.com with ESMTPS id 21sm2426751iwn.6.2009.12.12.17.58.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 17:58:16 -0800 (PST) Date: Sat, 12 Dec 2009 18:59:11 -0700 From: Will Andrews To: Maxim Sobolev Message-ID: <20091213015909.GB27552@cephei.firepipe.net> References: <200912102351.nBANpOKc078607@svn.freebsd.org> <4B21A4B9.3070005@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <4B21A4B9.3070005@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@FreeBSD.org, Alexander Motin , src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn: stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 01:58:18 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 10, 2009 at 05:47:37PM -0800, Maxim Sobolev wrote: > Alexander Motin wrote: > > Author: mav > > Date: Thu Dec 10 23:51:24 2009 > > New Revision: 200373 > > URL: http://svn.freebsd.org/changeset/base/200373 > >=20 > > Log: > > MFC r200282, r200290: > > Change gmirror default balance algorithm from "split" to improved "lo= ad". > > "split" is very ineffective for devices with rotating media as HDDs. > > To be effective, it needs that transfer time reduction due to block > > splitting was bigger then access time increase due to non-sequential > > access. For modern HDDs I was able to reproduce it only with read siz= es > > of 2MB and above, which is almost not applicable in real life. > > "load" algorithm same time is more universal and effective now. >=20 > The other problem with real hard drives is that they usually read much=20 > more data than requested. Some suggest that they read as much as one=20 > track each time the data is not in cache even if one sector has been=20 > requested, therefore splitting request of any reasonable size is=20 > meaningless, as it would simply cause both drives to load essentially=20 > the same data, wasting half of available I/O bandwidth and in addition=20 > you cause both heads to do seek, which makes it even worse. Indeed. I think the benchmarks speak for themselves. The new algorithm results in much lower average I/O service time, due to the seek time reduction by dispatching read requests to providers according to the known distance from the request, and also reduced by taking advantage of the disk cache. The disk cache size probably affects how close the requests need to be for optimal selection, so perhaps a sysctl is warranted to allow administrative adjustment of this value from mav@'s default of 1MB. Regards, --=20 wca --/04w6evG8XlLl3ft Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLJEpsF47idPgWcsURAr+TAJ9w2xTaZbGnaaHgxyU+skbbgO9tJwCeKpQr ezdqYqoywQehKVEpCwuJa2w= =LdnI -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 02:20:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B21B11065670; Sun, 13 Dec 2009 02:20:49 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 992488FC25; Sun, 13 Dec 2009 02:20:48 +0000 (UTC) Received: by fxm28 with SMTP id 28so468010fxm.13 for ; Sat, 12 Dec 2009 18:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=SHdI51NWEUx5dfd3YibMxYoPBJ7SfAl4VxtsUNIhgUk=; b=pAO98V3S2jJvhGefViD/nt98MwW6+MNPGlZ916HAfTIfqY11mBXjj7QZ2y+9gfq2ge C0zPZjiu69+qmb2Lto+uouUKYNQwIG2nc83JvvnNyjGO/9Qlxufr0W2NLbZh+slUxegu LU8IVRO6nvDPQUCdKeLIU7c9wNYbHRZsf7A60= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=uXVpCWXbucrIsU9IcllitTqI/h1p5wu5E9pSAfRjmE9He33ks1V4Sqf0BYScRTOIfS ZTi2udVTh/LAgQHtkdwQCYPpIbkRlAOgeHNT97/H++0XbPhy4htFmGFF5FQd9zU+s3am mFFhPdJfHgrhUS6P1vIy36Kn1VZKmadS+mJVs= Received: by 10.223.14.145 with SMTP id g17mr3577675faa.51.1260670847345; Sat, 12 Dec 2009 18:20:47 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm1126065fxm.0.2009.12.12.18.20.45 (version=SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 18:20:46 -0800 (PST) Sender: Alexander Motin Message-ID: <4B244F7C.1070205@FreeBSD.org> Date: Sun, 13 Dec 2009 04:20:44 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Will Andrews References: <200912102351.nBANpOKc078607@svn.freebsd.org> <4B21A4B9.3070005@FreeBSD.org> <20091213015909.GB27552@cephei.firepipe.net> In-Reply-To: <20091213015909.GB27552@cephei.firepipe.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn: stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 02:20:49 -0000 Will Andrews wrote: > On Thu, Dec 10, 2009 at 05:47:37PM -0800, Maxim Sobolev wrote: >> Alexander Motin wrote: >>> Author: mav >>> Date: Thu Dec 10 23:51:24 2009 >>> New Revision: 200373 >>> URL: http://svn.freebsd.org/changeset/base/200373 >>> >>> Log: >>> MFC r200282, r200290: >>> Change gmirror default balance algorithm from "split" to improved "load". >>> "split" is very ineffective for devices with rotating media as HDDs. >>> To be effective, it needs that transfer time reduction due to block >>> splitting was bigger then access time increase due to non-sequential >>> access. For modern HDDs I was able to reproduce it only with read sizes >>> of 2MB and above, which is almost not applicable in real life. >>> "load" algorithm same time is more universal and effective now. >> The other problem with real hard drives is that they usually read much >> more data than requested. Some suggest that they read as much as one >> track each time the data is not in cache even if one sector has been >> requested, therefore splitting request of any reasonable size is >> meaningless, as it would simply cause both drives to load essentially >> the same data, wasting half of available I/O bandwidth and in addition >> you cause both heads to do seek, which makes it even worse. > > Indeed. I think the benchmarks speak for themselves. The new algorithm > results in much lower average I/O service time, due to the seek time > reduction by dispatching read requests to providers according to the known > distance from the request, and also reduced by taking advantage of the disk > cache. The disk cache size probably affects how close the requests need to > be for optimal selection, so perhaps a sysctl is warranted to allow > administrative adjustment of this value from mav@'s default of 1MB. I've took 1MB not from cache, but from track size. I've divided read speed of modern drive on number of RPMs. I doubt that disk will read more then one track ahead, and same time it is quite probable to read whole current track, as head is already there and caches are quite large now. Sure it can be made tunable, but I think it is not very important, if you won't build mirror of floppy disks. Even in worst case current algorithm will give load disbalance no more then 1 request, as distance is only a hint, not a strict rule. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 03:14:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D275D106566C; Sun, 13 Dec 2009 03:14:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC8308FC0C; Sun, 13 Dec 2009 03: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 nBD3E7h9072031; Sun, 13 Dec 2009 03:14:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3E6pO071938; Sun, 13 Dec 2009 03:14:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130314.nBD3E6pO071938@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:14:08 -0000 Author: delphij Date: Sun Dec 13 03:14:06 2009 New Revision: 200462 URL: http://svn.freebsd.org/changeset/base/200462 Log: Revert most part of 200420 as requested, as more review and polish is needed. Modified: head/usr.bin/ar/util.c head/usr.bin/c89/c89.c head/usr.bin/calendar/calendar.c head/usr.bin/calendar/day.c head/usr.bin/calendar/ostern.c head/usr.bin/calendar/paskha.c head/usr.bin/cksum/Makefile head/usr.bin/cksum/crc.c head/usr.bin/cksum/crc32.c head/usr.bin/cksum/sum1.c head/usr.bin/cksum/sum2.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/colcrt/colcrt.c head/usr.bin/colrm/colrm.c head/usr.bin/compress/zopen.c head/usr.bin/cpuset/cpuset.c head/usr.bin/expand/expand.c head/usr.bin/fetch/fetch.c head/usr.bin/file2c/file2c.c head/usr.bin/find/find.c head/usr.bin/find/getdate.y head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/option.c head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/util.c head/usr.bin/fmt/fmt.c head/usr.bin/fold/fold.c head/usr.bin/gcore/gcore.c head/usr.bin/getopt/getopt.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.c head/usr.bin/jot/jot.c head/usr.bin/killall/killall.c head/usr.bin/ktrace/subr.c head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/readrec.c head/usr.bin/limits/limits.c head/usr.bin/lock/lock.c head/usr.bin/login/login.c head/usr.bin/login/login_fbtab.c head/usr.bin/login/pathnames.h head/usr.bin/mesg/mesg.c head/usr.bin/mkfifo/mkfifo.c head/usr.bin/mklocale/yacc.y head/usr.bin/mktemp/mktemp.c head/usr.bin/ncal/ncal.c head/usr.bin/netstat/atalk.c head/usr.bin/netstat/bpf.c head/usr.bin/netstat/if.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/ipx.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mbuf.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c head/usr.bin/newgrp/newgrp.c head/usr.bin/newkey/update.c head/usr.bin/nfsstat/nfsstat.c head/usr.bin/nohup/nohup.c head/usr.bin/passwd/passwd.c head/usr.bin/paste/paste.c head/usr.bin/pr/egetopt.c head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_vm.c head/usr.bin/rev/rev.c head/usr.bin/rlogin/rlogin.c head/usr.bin/rpcgen/rpc_clntout.c head/usr.bin/rpcgen/rpc_hout.c head/usr.bin/rpcgen/rpc_tblout.c head/usr.bin/rpcgen/rpc_util.c head/usr.bin/ruptime/ruptime.c head/usr.bin/rwall/rwall.c head/usr.bin/sed/main.c head/usr.bin/sed/misc.c head/usr.bin/showmount/showmount.c head/usr.bin/su/su.c head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/main.c head/usr.bin/systat/mbufs.c head/usr.bin/systat/mode.c head/usr.bin/systat/netstat.c head/usr.bin/systat/swap.c head/usr.bin/systat/tcp.c head/usr.bin/systat/vmstat.c head/usr.bin/tar/getdate.c head/usr.bin/tee/tee.c head/usr.bin/time/time.c head/usr.bin/tput/tput.c head/usr.bin/tr/cmap.c head/usr.bin/tr/cmap.h head/usr.bin/tr/cset.c head/usr.bin/tr/cset.h head/usr.bin/tr/str.c head/usr.bin/tr/tr.c head/usr.bin/truss/main.c head/usr.bin/truss/setup.c head/usr.bin/tsort/tsort.c head/usr.bin/ul/ul.c head/usr.bin/unexpand/unexpand.c head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/vis/foldit.c head/usr.bin/w/pr_time.c head/usr.bin/w/w.c head/usr.bin/wall/ttymsg.c head/usr.bin/who/who.c head/usr.bin/xinstall/xinstall.c head/usr.bin/ypcat/ypcat.c head/usr.bin/ypmatch/ypmatch.c head/usr.bin/ypwhich/ypwhich.c Modified: head/usr.bin/ar/util.c ============================================================================== --- head/usr.bin/ar/util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ar/util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/c89/c89.c ============================================================================== --- head/usr.bin/c89/c89.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/c89/c89.c Sun Dec 13 03:14:06 2009 (r200462) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/calendar.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pathnames.h" #include "calendar.h" struct passwd *pw; Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/day.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pathnames.h" #include "calendar.h" struct tm *tp; Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/ostern.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "calendar.h" Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/paskha.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "calendar.h" Modified: head/usr.bin/cksum/Makefile ============================================================================== --- head/usr.bin/cksum/Makefile Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/Makefile Sun Dec 13 03:14:06 2009 (r200462) @@ -5,6 +5,5 @@ PROG= cksum SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c LINKS= ${BINDIR}/cksum ${BINDIR}/sum MLINKS= cksum.1 sum.1 -WARNS?= 6 .include Modified: head/usr.bin/cksum/crc.c ============================================================================== --- head/usr.bin/cksum/crc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/crc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "extern.h" Modified: head/usr.bin/cksum/crc32.c ============================================================================== --- head/usr.bin/cksum/crc32.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/crc32.c Sun Dec 13 03:14:06 2009 (r200462) @@ -17,6 +17,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "extern.h" Modified: head/usr.bin/cksum/sum1.c ============================================================================== --- head/usr.bin/cksum/sum1.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/sum1.c Sun Dec 13 03:14:06 2009 (r200462) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "extern.h" Modified: head/usr.bin/cksum/sum2.c ============================================================================== --- head/usr.bin/cksum/sum2.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/sum2.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "extern.h" Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cmp/regular.c Sun Dec 13 03:14:06 2009 (r200462) @@ -45,10 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include "extern.h" Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cmp/special.c Sun Dec 13 03:14:06 2009 (r200462) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" Modified: head/usr.bin/colcrt/colcrt.c ============================================================================== --- head/usr.bin/colcrt/colcrt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/colcrt/colcrt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/colrm/colrm.c ============================================================================== --- head/usr.bin/colrm/colrm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/colrm/colrm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,9 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include +#include #include #include Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/compress/zopen.c Sun Dec 13 03:14:06 2009 (r200462) @@ -67,11 +67,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include "zopen.h" #define BITS 16 /* Default bits. */ Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cpuset/cpuset.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include int cflag; int gflag; Modified: head/usr.bin/expand/expand.c ============================================================================== --- head/usr.bin/expand/expand.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/expand/expand.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * expand - expand tabs to equivalent spaces Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fetch/fetch.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/file2c/file2c.c ============================================================================== --- head/usr.bin/file2c/file2c.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/file2c/file2c.c Sun Dec 13 03:14:06 2009 (r200462) @@ -10,6 +10,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/find.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "find.h" Modified: head/usr.bin/find/getdate.y ============================================================================== --- head/usr.bin/find/getdate.y Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/getdate.y Sun Dec 13 03:14:06 2009 (r200462) @@ -15,6 +15,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include /* The code at the top of get_date which figures out the offset of the Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/ls.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/misc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/option.c Sun Dec 13 03:14:06 2009 (r200462) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/finger/lprint.c ============================================================================== --- head/usr.bin/finger/lprint.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/lprint.c Sun Dec 13 03:14:06 2009 (r200462) @@ -310,7 +310,7 @@ show_text(const char *directory, const c return(0); /* If short enough, and no newlines, show it on a single line.*/ - if (sb.st_size <= (int)(LINE_LEN - strlen(header) - 5)) { + if (sb.st_size <= LINE_LEN - strlen(header) - 5) { nr = read(fd, tbuf, sizeof(tbuf)); if (nr <= 0) { (void)close(fd); Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/net.c Sun Dec 13 03:14:06 2009 (r200462) @@ -230,7 +230,7 @@ trying(const struct addrinfo *ai) printf("Trying %s...\n", buf); } -static void +void cleanup(int sig __unused) { #define ERRSTR "Timed out.\n" Modified: head/usr.bin/finger/util.c ============================================================================== --- head/usr.bin/finger/util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -120,7 +120,7 @@ enter_lastlog(PERSON *pn) } if (fd == -1 || lseek(fd, (long)pn->uid * sizeof(ll), SEEK_SET) != - (off_t)(pn->uid * sizeof(ll)) || + (long)pn->uid * sizeof(ll) || read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) { /* as if never logged in */ ll.ll_line[0] = ll.ll_host[0] = '\0'; Modified: head/usr.bin/fmt/fmt.c ============================================================================== --- head/usr.bin/fmt/fmt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fmt/fmt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -180,6 +180,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/fold/fold.c ============================================================================== --- head/usr.bin/fold/fold.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fold/fold.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/gcore/gcore.c ============================================================================== --- head/usr.bin/gcore/gcore.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/gcore/gcore.c Sun Dec 13 03:14:06 2009 (r200462) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "extern.h" Modified: head/usr.bin/getopt/getopt.c ============================================================================== --- head/usr.bin/getopt/getopt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/getopt/getopt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -7,6 +7,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include int Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/hexdump/display.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "hexdump.h" enum _vflag vflag = FIRST; Modified: head/usr.bin/hexdump/hexdump.c ============================================================================== --- head/usr.bin/hexdump/hexdump.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/hexdump/hexdump.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "hexdump.h" Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/jot/jot.c Sun Dec 13 03:14:06 2009 (r200462) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Defaults */ Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/killall/killall.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/usr.bin/ktrace/subr.c ============================================================================== --- head/usr.bin/ktrace/subr.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ktrace/subr.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "ktrace.h" void timevaladd(struct timeval *, struct timeval *); Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lastcomm/lastcomm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include Modified: head/usr.bin/lastcomm/readrec.c ============================================================================== --- head/usr.bin/lastcomm/readrec.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lastcomm/readrec.c Sun Dec 13 03:14:06 2009 (r200462) @@ -33,9 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include #include #include +#include #include int readrec_forward(FILE *f, struct acctv2 *av2); Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/limits/limits.c Sun Dec 13 03:14:06 2009 (r200462) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lock/lock.c Sun Dec 13 03:14:06 2009 (r200462) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/login/login.c ============================================================================== --- head/usr.bin/login/login.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/login.c Sun Dec 13 03:14:06 2009 (r200462) @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include #include Modified: head/usr.bin/login/login_fbtab.c ============================================================================== --- head/usr.bin/login/login_fbtab.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/login_fbtab.c Sun Dec 13 03:14:06 2009 (r200462) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "login.h" #include "pathnames.h" static void login_protect(const char *, char *, int, uid_t, gid_t); Modified: head/usr.bin/login/pathnames.h ============================================================================== --- head/usr.bin/login/pathnames.h Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/pathnames.h Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + #define _PATH_HUSHLOGIN ".hushlogin" #define _PATH_MOTDFILE "/etc/motd" #define _PATH_FBTAB "/etc/fbtab" Modified: head/usr.bin/mesg/mesg.c ============================================================================== --- head/usr.bin/mesg/mesg.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mesg/mesg.c Sun Dec 13 03:14:06 2009 (r200462) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void usage(void); Modified: head/usr.bin/mkfifo/mkfifo.c ============================================================================== --- head/usr.bin/mkfifo/mkfifo.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mkfifo/mkfifo.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \ Modified: head/usr.bin/mklocale/yacc.y ============================================================================== --- head/usr.bin/mklocale/yacc.y Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mklocale/yacc.y Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/mktemp/mktemp.c ============================================================================== --- head/usr.bin/mktemp/mktemp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -143,7 +143,7 @@ main(int argc, char **argv) } static void -usage(void) +usage() { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ncal/ncal.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include #include Modified: head/usr.bin/netstat/atalk.c ============================================================================== --- head/usr.bin/netstat/atalk.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/atalk.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include Modified: head/usr.bin/netstat/bpf.c ============================================================================== --- head/usr.bin/netstat/bpf.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/bpf.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/if.c Sun Dec 13 03:14:06 2009 (r200462) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/ipsec.c Sun Dec 13 03:14:06 2009 (r200462) @@ -111,6 +111,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/ipx.c ============================================================================== --- head/usr.bin/netstat/ipx.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/ipx.c Sun Dec 13 03:14:06 2009 (r200462) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #define SANAMES #include +#include +#include #include #include #include Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,10 +60,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include #include Modified: head/usr.bin/netstat/mbuf.c ============================================================================== --- head/usr.bin/netstat/mbuf.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/mbuf.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "netstat.h" /* Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/netgraph.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,9 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include "netstat.h" Modified: head/usr.bin/netstat/pfkey.c ============================================================================== --- head/usr.bin/netstat/pfkey.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/pfkey.c Sun Dec 13 03:14:06 2009 (r200462) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/route.c Sun Dec 13 03:14:06 2009 (r200462) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "netstat.h" Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/sctp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,10 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include +#include #include "netstat.h" #ifdef SCTP Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/newgrp/newgrp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include #include Modified: head/usr.bin/newkey/update.c ============================================================================== --- head/usr.bin/newkey/update.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/newkey/update.c Sun Dec 13 03:14:06 2009 (r200462) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #endif /* YP */ +#include #include #include #include Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/nfsstat/nfsstat.c Sun Dec 13 03:14:06 2009 (r200462) @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -70,6 +71,7 @@ static const char rcsid[] = #include #include #include +#include #include struct nlist nl[] = { Modified: head/usr.bin/nohup/nohup.c ============================================================================== --- head/usr.bin/nohup/nohup.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/nohup/nohup.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void dofile(void); Modified: head/usr.bin/passwd/passwd.c ============================================================================== --- head/usr.bin/passwd/passwd.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/passwd/passwd.c Sun Dec 13 03:14:06 2009 (r200462) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/paste/paste.c ============================================================================== --- head/usr.bin/paste/paste.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/paste/paste.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,9 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include +#include #include #include Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/pr/egetopt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -46,8 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include "extern.h" + /* * egetopt: get option letter from argument vector (an extended * version of getopt). Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_args.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "procstat.h" Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_basic.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ #include #include +#include #include #include Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_files.c Sun Dec 13 03:14:06 2009 (r200462) @@ -36,6 +36,7 @@ #include +#include #include #include #include Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_vm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ #include #include +#include #include #include #include Modified: head/usr.bin/rev/rev.c ============================================================================== --- head/usr.bin/rev/rev.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rev/rev.c Sun Dec 13 03:14:06 2009 (r200462) @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rlogin/rlogin.c Sun Dec 13 03:14:06 2009 (r200462) @@ -72,7 +72,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include Modified: head/usr.bin/rpcgen/rpc_clntout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_clntout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_clntout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsytsems, Inc. */ #include +#include #include #include "rpc_parse.h" #include "rpc_scan.h" Modified: head/usr.bin/rpcgen/rpc_hout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_hout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_hout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsystems, Inc. */ #include +#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_tblout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_tblout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_tblout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_util.c ============================================================================== --- head/usr.bin/rpcgen/rpc_util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1989, Sun Microsystems, Inc. */ #include +#include #include #include #include Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ruptime/ruptime.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/rwall/rwall.c ============================================================================== --- head/usr.bin/rwall/rwall.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rwall/rwall.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/sed/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -51,10 +51,12 @@ static const char sccsid[] = "@(#)main.c #include #include +#include #include #include #include #include +#include #include #include #include Modified: head/usr.bin/sed/misc.c ============================================================================== --- head/usr.bin/sed/misc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/sed/misc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -41,8 +41,14 @@ static const char sccsid[] = "@(#)misc.c #include #include +#include #include +#include #include +#include + +#include "defs.h" +#include "extern.h" /* * Return a string for a regular expression error passed. This is overkill, Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/showmount/showmount.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,7 @@ static const char rcsid[] = #include #include +#include #include #include #include Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/su/su.c Sun Dec 13 03:14:06 2009 (r200462) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/fetch.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ static const char sccsid[] = "@(#)fetch. #include #include +#include #include #include #include Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/icmp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,7 +54,9 @@ static char sccsid[] = "@(#)mbufs.c 8.1 #include #include +#include #include +#include #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/iostat.c Sun Dec 13 03:14:06 2009 (r200462) @@ -73,6 +73,7 @@ static const char sccsid[] = "@(#)iostat #include #include #include +#include #include #include Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/ip.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,10 @@ static const char sccsid[] = "@(#)mbufs. #include #include +#include +#include +#include + #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -53,6 +53,7 @@ static const char copyright[] = #include #include #include +#include #include #include #include Modified: head/usr.bin/systat/mbufs.c ============================================================================== --- head/usr.bin/systat/mbufs.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/mbufs.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)mbufs. #include #include #include +#include #include "systat.h" #include "extern.h" Modified: head/usr.bin/systat/mode.c ============================================================================== --- head/usr.bin/systat/mode.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/mode.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 03:18:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB8A1065693; Sun, 13 Dec 2009 03:18:38 +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 345F38FC0A; Sun, 13 Dec 2009 03:18: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 nBD3Icfw072179; Sun, 13 Dec 2009 03:18:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3IcBL072177; Sun, 13 Dec 2009 03:18:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130318.nBD3IcBL072177@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:18: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: r200463 - head/usr.bin/mktemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:18:38 -0000 Author: delphij Date: Sun Dec 13 03:18:37 2009 New Revision: 200463 URL: http://svn.freebsd.org/changeset/base/200463 Log: Use prototype for usage(). Modified: head/usr.bin/mktemp/mktemp.c Modified: head/usr.bin/mktemp/mktemp.c ============================================================================== --- head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:14:06 2009 (r200462) +++ head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:18:37 2009 (r200463) @@ -143,7 +143,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 03:29:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32120106566B; Sun, 13 Dec 2009 03:29:06 +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 209688FC13; Sun, 13 Dec 2009 03:29: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 nBD3T6nQ072394; Sun, 13 Dec 2009 03:29:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3T6R8072392; Sun, 13 Dec 2009 03:29:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130329.nBD3T6R8072392@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:29: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: r200464 - head/lib/libexpat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:29:06 -0000 Author: delphij Date: Sun Dec 13 03:29:05 2009 New Revision: 200464 URL: http://svn.freebsd.org/changeset/base/200464 Log: Explicitly say that this is an internal library which is intended to be used within FreeBSD base system only, and discourage user applications from using it. User applications should use the expat version from the ports/package collection. Reviewed by: simon (earlier version) MFC after: 2 weeks Modified: head/lib/libexpat/libbsdxml.3 Modified: head/lib/libexpat/libbsdxml.3 ============================================================================== --- head/lib/libexpat/libbsdxml.3 Sun Dec 13 03:18:37 2009 (r200463) +++ head/lib/libexpat/libbsdxml.3 Sun Dec 13 03:29:05 2009 (r200464) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 5, 2008 +.Dd December 12, 2009 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -38,6 +38,15 @@ The .Nm library is a verbatim copy of the eXpat XML library version 2.0.1. .Pp +The +.Nm +library is intended to use within the +.Fx +base system only. +Use of the +.Nm +library for other purposes is not supported and discouraged. +.Pp To avoid version and autoconfiguration issues, the library has been renamed to .Nm From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 03:34:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29B11065672; Sun, 13 Dec 2009 03:34:19 +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 B0F7C8FC13; Sun, 13 Dec 2009 03:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3YJ66072558; Sun, 13 Dec 2009 03:34:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3YJbO072556; Sun, 13 Dec 2009 03:34:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130334.nBD3YJbO072556@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:34: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: r200465 - head/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:34:19 -0000 Author: delphij Date: Sun Dec 13 03:34:19 2009 New Revision: 200465 URL: http://svn.freebsd.org/changeset/base/200465 Log: Staticify internal functions and make usage() a prototype. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:29:05 2009 (r200464) +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) @@ -86,16 +86,16 @@ int dobackup, docompare, dodir, dopreser mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; const char *suffix = BACKUP_SUFFIX; -void copy(int, const char *, int, const char *, off_t); -int compare(int, const char *, size_t, int, const char *, size_t); -int create_newfile(const char *, int, struct stat *); -int create_tempfile(const char *, char *, size_t); -void install(const char *, const char *, u_long, u_int); -void install_dir(char *); -u_long numeric_id(const char *, const char *); -void strip(const char *); -int trymmap(int); -void usage(void); +static void copy(int, const char *, int, const char *, off_t); +static int compare(int, const char *, size_t, int, const char *, size_t); +static int create_newfile(const char *, int, struct stat *); +static int create_tempfile(const char *, char *, size_t); +static void install(const char *, const char *, u_long, u_int); +static void install_dir(char *); +static u_long numeric_id(const char *, const char *); +static void strip(const char *); +static int trymmap(int); +static void usage(void); int main(int argc, char *argv[]) @@ -771,7 +771,7 @@ install_dir(char *path) * print a usage message and die */ void -usage() +usage(void) { (void)fprintf(stderr, "usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 03:53:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C303F106566C; Sun, 13 Dec 2009 03:53:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13608FC0C; Sun, 13 Dec 2009 03:53:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3rFkS072916; Sun, 13 Dec 2009 03:53:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3rFon072914; Sun, 13 Dec 2009 03:53:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130353.nBD3rFon072914@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:53: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: r200466 - head/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:53:15 -0000 Author: delphij Date: Sun Dec 13 03:53:15 2009 New Revision: 200466 URL: http://svn.freebsd.org/changeset/base/200466 Log: xinstall.c does not require ctype functions, so ctype.h is not necessary here. Note: this would change the md5 checksum due to change caused by different register layout. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:53:15 2009 (r200466) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 04:08:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452E71065670; Sun, 13 Dec 2009 04:08:05 +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 1A8498FC1A; Sun, 13 Dec 2009 04: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 nBD485fw073259; Sun, 13 Dec 2009 04:08:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD484B8073258; Sun, 13 Dec 2009 04:08:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130408.nBD484B8073258@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:08: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: r200467 - head/usr.sbin/ndp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:08:05 -0000 Author: delphij Date: Sun Dec 13 04:08:04 2009 New Revision: 200467 URL: http://svn.freebsd.org/changeset/base/200467 Log: We use gmt2local code from tcpdump and gnuc.h is no longer being used there, so remove this dummy header. Deleted: head/usr.sbin/ndp/gnuc.h From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 04:14:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09D00106566C; Sun, 13 Dec 2009 04:14:56 +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 EC8EA8FC0C; Sun, 13 Dec 2009 04:14: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 nBD4EtpV073429; Sun, 13 Dec 2009 04:14:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4Et64073427; Sun, 13 Dec 2009 04:14:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130414.nBD4Et64073427@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:14: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: r200468 - head/usr.bin/vis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:14:56 -0000 Author: delphij Date: Sun Dec 13 04:14:55 2009 New Revision: 200468 URL: http://svn.freebsd.org/changeset/base/200468 Log: Use ANSI prototype for foldit(). Modified: head/usr.bin/vis/foldit.c Modified: head/usr.bin/vis/foldit.c ============================================================================== --- head/usr.bin/vis/foldit.c Sun Dec 13 04:08:04 2009 (r200467) +++ head/usr.bin/vis/foldit.c Sun Dec 13 04:14:55 2009 (r200468) @@ -44,9 +44,7 @@ static const char sccsid[] = "@(#)foldit #include "extern.h" int -foldit(chunk, col, max) - char *chunk; - int col, max; +foldit(char *chunk, int col, int max) { char *cp; From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 04:34:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C1C1065679; Sun, 13 Dec 2009 04:34:52 +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 37F008FC17; Sun, 13 Dec 2009 04:34: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 nBD4YqYF073860; Sun, 13 Dec 2009 04:34:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4Yqn0073858; Sun, 13 Dec 2009 04:34:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130434.nBD4Yqn0073858@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200469 - head/usr.bin/pr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:34:52 -0000 Author: delphij Date: Sun Dec 13 04:34:51 2009 New Revision: 200469 URL: http://svn.freebsd.org/changeset/base/200469 Log: egetopt.c does not use any stdlib.h definations, nor it referenced any symbol from other module, so remove reference of stdlib.h and extern.h. Verified with: md5(1) Modified: head/usr.bin/pr/egetopt.c Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Sun Dec 13 04:14:55 2009 (r200468) +++ head/usr.bin/pr/egetopt.c Sun Dec 13 04:34:51 2009 (r200469) @@ -46,11 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include "extern.h" - /* * egetopt: get option letter from argument vector (an extended * version of getopt). From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 04:50:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7FC106566B; Sun, 13 Dec 2009 04:50:12 +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 1476C8FC1A; Sun, 13 Dec 2009 04:50: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 nBD4oBoG074249; Sun, 13 Dec 2009 04:50:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4oBmm074244; Sun, 13 Dec 2009 04:50:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130450.nBD4oBmm074244@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:50: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: r200470 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:50:12 -0000 Author: delphij Date: Sun Dec 13 04:50:11 2009 New Revision: 200470 URL: http://svn.freebsd.org/changeset/base/200470 Log: - Remove times.h from C programs that does not manipulate with time at all. - Remove pathnames.h from all but io.c since it's the only module that used these definations. Modified: head/usr.bin/calendar/calendar.c head/usr.bin/calendar/day.c head/usr.bin/calendar/ostern.c head/usr.bin/calendar/paskha.c Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/calendar.c Sun Dec 13 04:50:11 2009 (r200470) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct passwd *pw; Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/day.c Sun Dec 13 04:50:11 2009 (r200470) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct tm *tp; Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/ostern.c Sun Dec 13 04:50:11 2009 (r200470) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/paskha.c Sun Dec 13 04:50:11 2009 (r200470) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 08:49:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1181065670; Sun, 13 Dec 2009 08:49:10 +0000 (UTC) (envelope-from netch@segfault.kiev.ua) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE2E8FC17; Sun, 13 Dec 2009 08:49:09 +0000 (UTC) Received: from segfault.kiev.ua (localhost.segfault.kiev.ua [127.0.0.1]) by segfault.kiev.ua (8.14.3/8.14.3/8.Who.Cares) with ESMTP id nBD8bUFb076678; Sun, 13 Dec 2009 10:37:30 +0200 (EET) (envelope-from netch@segfault.kiev.ua) Received: (from netch@localhost) by segfault.kiev.ua (8.14.3/8.14.3/Submit) id nBD8bPuH076675; Sun, 13 Dec 2009 10:37:25 +0200 (EET) (envelope-from netch) Date: Sun, 13 Dec 2009 10:37:25 +0200 From: Valentin Nechayev To: Garrett Wollman Message-ID: <20091213083725.GH1260@netch.kiev.ua> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> X-42: On Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: netch@netch.kiev.ua List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 08:49:10 -0000 Sat, Dec 12, 2009 at 00:24:08, wollman wrote about "Re: svn commit: r200369 - in head: etc share/termcap": > > It's great, thank!! > > I believe that our xterm entry was modified not to clear screen when > > applications such as less(1) are terminated. Are there any chance to > > back to the behavior? > > > > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. I also vote for old variant. If anybody wants to keep previous screen contents, there are many ways for this (another xterm, screen, less, etc.), and all they are more predictable and controllable than alternate screen which isn't loggable and isn't provided by many terminal implementations. -netch- From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 11:06:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8141065672; Sun, 13 Dec 2009 11:06:40 +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 1B75A8FC19; Sun, 13 Dec 2009 11:06: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 nBDB6ere084722; Sun, 13 Dec 2009 11:06:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDB6dOb084717; Sun, 13 Dec 2009 11:06:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912131106.nBDB6dOb084717@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 11:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200471 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 11:06:40 -0000 Author: bz Date: Sun Dec 13 11:06:39 2009 New Revision: 200471 URL: http://svn.freebsd.org/changeset/base/200471 Log: Add a few more V_hacks to nfsclient to allow machines with a VIMAGE kernel to boot from NFS. [1] Note: this is not a full virtualization of nfsclient. It is only does what advertised above and nothing more. Requested by: public demand [1] Tested by: kris, .. MFC after: 5 days Modified: head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/krpc_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/bootp_subr.c Sun Dec 13 11:06:39 2009 (r200471) @@ -584,6 +584,8 @@ bootpc_call(struct bootpc_globalcontext int retry; const char *s; + CURVNET_SET(TD_TO_VNET(td)); + /* * Create socket and set its recieve timeout. */ @@ -960,6 +962,7 @@ gotreply: out: soclose(so); out0: + CURVNET_RESTORE(); return error; } @@ -974,6 +977,8 @@ 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); @@ -1048,6 +1053,8 @@ bootpc_fakeup_interface(struct bootpc_if ifctx->ireq.ifr_name); ifctx->sdl = sdl; + CURVNET_RESTORE(); + return error; } Modified: head/sys/nfsclient/krpc_subr.c ============================================================================== --- head/sys/nfsclient/krpc_subr.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/krpc_subr.c Sun Dec 13 11:06:39 2009 (r200471) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -213,6 +215,8 @@ 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. */ @@ -425,6 +429,7 @@ 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_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/nfs_vfsops.c Sun Dec 13 11:06:39 2009 (r200471) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -825,6 +827,8 @@ nfs_mount(struct mount *mp) has_fh_opt = 0; has_hostname_opt = 0; + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); + if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -1124,6 +1128,7 @@ out: mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED); MNT_IUNLOCK(mp); } + CURVNET_RESTORE(); return (error); } Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/nfs_vnops.c Sun Dec 13 11:06:39 2009 (r200471) @@ -1555,14 +1555,21 @@ nfs_create(struct vop_create_args *ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); + /* * Oops, not for me.. */ - if (vap->va_type == VSOCK) - return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); + if (vap->va_type == VSOCK) { + error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap); + CURVNET_RESTORE(); + return (error); + } - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) { + CURVNET_RESTORE(); return (error); + } if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= O_EXCL; again: @@ -1658,6 +1665,7 @@ nfsmout: KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } mtx_unlock(&(VTONFS(dvp))->n_mtx); + CURVNET_RESTORE(); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 12:00:50 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6640210656AC; Sun, 13 Dec 2009 12:00:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 22DC38FC1D; Sun, 13 Dec 2009 12:00:50 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4CB8F6D41B; Sun, 13 Dec 2009 12:00:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1EE1A84530; Sun, 13 Dec 2009 13:00:49 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Wollman References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> Date: Sun, 13 Dec 2009 13:00:49 +0100 In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> (Garrett Wollman's message of "Sat, 12 Dec 2009 00:24:08 -0500") Message-ID: <86tyvvjd72.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hajimu UMEMOTO Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:00:50 -0000 Garrett Wollman writes: > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. Lots of people think it's useful. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 12:03:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08A0C1065697; Sun, 13 Dec 2009 12:03:44 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B56A78FC12; Sun, 13 Dec 2009 12:03:43 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 9D2AC6D41C; Sun, 13 Dec 2009 12:03:42 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7E2E3844E9; Sun, 13 Dec 2009 13:03:42 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> Date: Sun, 13 Dec 2009 13:03:42 +0100 In-Reply-To: <4B23F090.10207@FreeBSD.org> (Doug Barton's message of "Sat, 12 Dec 2009 11:35:44 -0800") Message-ID: <86pr6jjd29.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , Ronald Klop , svn-src-head@freebsd.org, Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:03:44 -0000 Doug Barton writes: > To be clear, I am NOT asking for a backout ... IIRC in the thread that > discussed this issue there were quite a few people who thought that > FreeBSD not clearing the screen was a POLA violation since that's what > linux does, and it's what most people are used to. It's not "what Linux does", it's what xterm does. Xterm did not originate with Linux; in fact, it predates Linux by about ten years. FreeBSD's xterm entry was deliberately crippled to lie about xterm's capabilities. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 12:04:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6EF106566B; Sun, 13 Dec 2009 12:04:42 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 08C8C8FC0C; Sun, 13 Dec 2009 12:04:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4091E6D450; Sun, 13 Dec 2009 12:04:41 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 22383844E9; Sun, 13 Dec 2009 13:04:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: netch@netch.kiev.ua References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <20091213083725.GH1260@netch.kiev.ua> Date: Sun, 13 Dec 2009 13:04:41 +0100 In-Reply-To: <20091213083725.GH1260@netch.kiev.ua> (Valentin Nechayev's message of "Sun, 13 Dec 2009 10:37:25 +0200") Message-ID: <86ljh7jd0m.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:04:42 -0000 Valentin Nechayev writes: > I also vote for old variant. If anybody wants to keep previous screen > contents, there are many ways for this (another xterm, screen, less, > etc.), and all they are more predictable and controllable than > alternate screen which isn't loggable and isn't provided by many terminal > implementations. That last part is simply untrue. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 12:13:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D390B1065670; Sun, 13 Dec 2009 12:13:41 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 917788FC15; Sun, 13 Dec 2009 12:13:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 8D0376D41D; Sun, 13 Dec 2009 12:13:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 4A705844E9; Sun, 13 Dec 2009 13:13:40 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200912130314.nBD3E6pO071938@svn.freebsd.org> Date: Sun, 13 Dec 2009 13:13:40 +0100 In-Reply-To: <200912130314.nBD3E6pO071938@svn.freebsd.org> (Xin LI's message of "Sun, 13 Dec 2009 03:14:06 +0000 (UTC)") Message-ID: <86hbrvjcln.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:13:41 -0000 Xin LI writes: > Author: delphij > Date: Sun Dec 13 03:14:06 2009 > New Revision: 200462 > URL: http://svn.freebsd.org/changeset/base/200462 > > Log: > Revert most part of 200420 as requested, as more review and polish is > needed. It's a good idea, but it's also very hard to get right. I skimmed through the patch, and some of it is obviously correct (e.g. removing "pathnames.h" in one case) but some of it is almost certainly incorrect (e.g. removing which is actually required even if you don't notice it due to pollution from other headers). Is anybody working on POSIXizing our headers? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 13:57:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FAB106566C; Sun, 13 Dec 2009 13:57:33 +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 812858FC21; Sun, 13 Dec 2009 13:57:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDDvX6l088065; Sun, 13 Dec 2009 13:57:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDDvXVT088059; Sun, 13 Dec 2009 13:57:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912131357.nBDDvXVT088059@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 13:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200473 - in head/sys: kern net netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 13:57:33 -0000 Author: bz Date: Sun Dec 13 13:57:32 2009 New Revision: 200473 URL: http://svn.freebsd.org/changeset/base/200473 Log: Throughout the network stack we have a few places of if (jailed(cred)) left. If you are running with a vnet (virtual network stack) those will return true and defer you to classic IP-jails handling and thus things will be "denied" or returned with an error. Work around this problem by introducing another "jailed()" function, jailed_without_vnet(), that also takes vnets into account, and permits the calls, should the jail from the given cred have its own virtual network stack. We cannot change the classic jailed() call to do that, as it is used outside the network stack as well. Discussed with: julian, zec, jamie, rwatson (back in Sept) MFC after: 5 days Modified: head/sys/kern/kern_jail.c head/sys/net/rtsock.c head/sys/netinet/raw_ip.c head/sys/netinet6/raw_ip6.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/kern/kern_jail.c Sun Dec 13 13:57:32 2009 (r200473) @@ -3161,7 +3161,7 @@ prison_check_af(struct ucred *cred, int pr = cred->cr_prison; #ifdef VIMAGE /* Prisons with their own network stack are not limited. */ - if (pr->pr_flags & PR_VNET) + if (prison_owns_vnet(cred)) return (0); #endif @@ -3222,6 +3222,11 @@ prison_if(struct ucred *cred, struct soc KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); KASSERT(sa != NULL, ("%s: sa is NULL", __func__)); +#ifdef VIMAGE + if (prison_owns_vnet(cred)) + return (0); +#endif + error = 0; switch (sa->sa_family) { @@ -3279,6 +3284,24 @@ jailed(struct ucred *cred) } /* + * Return 1 if the passed credential is in a jail and that jail does not + * have its own virtual network stack, otherwise 0. + */ +int +jailed_without_vnet(struct ucred *cred) +{ + + if (!jailed(cred)) + return (0); +#ifdef VIMAGE + if (prison_owns_vnet(cred)) + return (0); +#endif + + return (1); +} + +/* * Return the correct hostname (domainname, et al) for the passed credential. */ void Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/net/rtsock.c Sun Dec 13 13:57:32 2009 (r200473) @@ -651,7 +651,7 @@ route_output(struct mbuf *m, struct sock report: RT_LOCK_ASSERT(rt); if ((rt->rt_flags & RTF_HOST) == 0 - ? jailed(curthread->td_ucred) + ? jailed_without_vnet(curthread->td_ucred) : prison_if(curthread->td_ucred, rt_key(rt)) != 0) { RT_UNLOCK(rt); @@ -1312,7 +1312,7 @@ sysctl_dumpentry(struct radix_node *rn, if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; if ((rt->rt_flags & RTF_HOST) == 0 - ? jailed(w->w_req->td->td_ucred) + ? jailed_without_vnet(w->w_req->td->td_ucred) : prison_if(w->w_req->td->td_ucred, rt_key(rt)) != 0) return (0); bzero((caddr_t)&info, sizeof(info)); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/netinet/raw_ip.c Sun Dec 13 13:57:32 2009 (r200473) @@ -291,7 +291,7 @@ rip_input(struct mbuf *m, int off) continue; if (inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * XXX: If faddr was bound to multicast group, * jailed raw socket will drop datagram. @@ -325,7 +325,7 @@ rip_input(struct mbuf *m, int off) if (!in_nullhost(inp->inp_faddr) && !in_hosteq(inp->inp_faddr, ip->ip_src)) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * Allow raw socket in jail to receive multicast; * assume process had PRIV_NETINET_RAW at attach, Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/netinet6/raw_ip6.c Sun Dec 13 13:57:32 2009 (r200473) @@ -184,7 +184,7 @@ rip6_input(struct mbuf **mp, int *offp, if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src)) continue; - if (jailed(in6p->inp_cred)) { + if (jailed_without_vnet(in6p->inp_cred)) { /* * Allow raw socket in jail to receive multicast; * assume process had PRIV_NETINET_RAW at attach, Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/sys/jail.h Sun Dec 13 13:57:32 2009 (r200473) @@ -335,6 +335,7 @@ struct mount; struct sockaddr; struct statfs; int jailed(struct ucred *cred); +int jailed_without_vnet(struct ucred *); void getcredhostname(struct ucred *, char *, size_t); void getcreddomainname(struct ucred *, char *, size_t); void getcredhostuuid(struct ucred *, char *, size_t); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 14:55:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1921065679; Sun, 13 Dec 2009 14:55:51 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B78C8FC18; Sun, 13 Dec 2009 14:55: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 nBDEtp3v089378; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDEtpfG089376; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131455.nBDEtpfG089376@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 14:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200474 - stable/8/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 14:55:51 -0000 Author: rnoland Date: Sun Dec 13 14:55:50 2009 New Revision: 200474 URL: http://svn.freebsd.org/changeset/base/200474 Log: MFC 198332 Check pointer for NULL before dereferencing it, not after. Originally committed by: brueffer Modified: stable/8/sys/dev/drm/mach64_state.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/mach64_state.c ============================================================================== --- stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 13:57:32 2009 (r200473) +++ stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 14:55:50 2009 (r200474) @@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device struct drm_file *file_priv) { drm_mach64_private_t *dev_priv = dev->dev_private; - drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv; + drm_mach64_sarea_t *sarea_priv; drm_mach64_vertex_t *vertex = data; LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device DRM_ERROR("called with no initialization\n"); return -EINVAL; } + sarea_priv = dev_priv->sarea_priv; DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n", DRM_CURRENTPID, From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 15:03:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE897106566C; Sun, 13 Dec 2009 15:03:54 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4978FC15; Sun, 13 Dec 2009 15:03: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 nBDF3sB7089631; Sun, 13 Dec 2009 15:03:54 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDF3sFC089629; Sun, 13 Dec 2009 15:03:54 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131503.nBDF3sFC089629@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 15:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200475 - stable/8/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:03:54 -0000 Author: rnoland Date: Sun Dec 13 15:03:54 2009 New Revision: 200475 URL: http://svn.freebsd.org/changeset/base/200475 Log: MFC r198694,r198697 Some general cleanup of scatter/gather memory allocation - We don't need to check malloc return values with M_WAITOK - remove variables that we don't really need - cleanup the error paths by just calling drm_sg_cleanup() - fix drm_sg_cleanup() to be safe to call at any time Modified: stable/8/sys/dev/drm/drm_scatter.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/8/sys/dev/drm/drm_scatter.c Sun Dec 13 14:55:50 2009 (r200474) +++ stable/8/sys/dev/drm/drm_scatter.c Sun Dec 13 15:03:54 2009 (r200475) @@ -47,79 +47,50 @@ drm_sg_alloc(struct drm_device *dev, str { struct drm_sg_mem *entry; struct drm_dma_handle *dmah; - unsigned long pages; int ret; if (dev->sg) return EINVAL; entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); - if (!entry) - return ENOMEM; - - pages = round_page(request->size) / PAGE_SIZE; - DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages); - - entry->pages = pages; - - entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES, - M_WAITOK | M_ZERO); - if (!entry->busaddr) { - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + entry->pages = round_page(request->size) / PAGE_SIZE; + DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages); + entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), + DRM_MEM_PAGES, M_WAITOK | M_ZERO); dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA, - M_ZERO | M_NOWAIT); - if (dmah == NULL) { - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + M_WAITOK | M_ZERO); + entry->dmah = dmah; ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ - request->size, pages, /* maxsize, nsegs */ + request->size, entry->pages, /* maxsize, nsegs */ PAGE_SIZE, 0, /* maxsegsize, flags */ NULL, NULL, /* lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } + entry->handle = (unsigned long)dmah->vaddr; + entry->virtual = dmah->vaddr; + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT); if (ret != 0) { - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } - entry->dmah = dmah; - entry->handle = (unsigned long)dmah->vaddr; - - DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); - - entry->virtual = (void *)entry->handle; - request->handle = entry->handle; - DRM_LOCK(); if (dev->sg) { DRM_UNLOCK(); @@ -129,6 +100,11 @@ drm_sg_alloc(struct drm_device *dev, str dev->sg = entry; DRM_UNLOCK(); + DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle, + entry->virtual, *(unsigned long *)entry->virtual); + + request->handle = entry->handle; + return 0; } @@ -143,6 +119,8 @@ drm_sg_alloc_cb(void *arg, bus_dma_segme for(i = 0 ; i < nsegs ; i++) { entry->busaddr[i] = segs[i].ds_addr; + DRM_DEBUG("segment %d @ 0x%016lx\n", i, + (unsigned long)segs[i].ds_addr); } } @@ -162,9 +140,12 @@ drm_sg_cleanup(struct drm_sg_mem *entry) { struct drm_dma_handle *dmah = entry->dmah; - bus_dmamap_unload(dmah->tag, dmah->map); - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); + if (dmah->map != NULL) + bus_dmamap_unload(dmah->tag, dmah->map); + if (dmah->vaddr != NULL) + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + if (dmah->tag != NULL) + bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); free(entry->busaddr, DRM_MEM_PAGES); free(entry, DRM_MEM_SGLISTS); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 15:08:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB4B1065672; Sun, 13 Dec 2009 15:08:26 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490418FC1B; Sun, 13 Dec 2009 15:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDF8PPu089760; Sun, 13 Dec 2009 15:08:25 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDF8PRh089758; Sun, 13 Dec 2009 15:08:25 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131508.nBDF8PRh089758@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 15:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200476 - stable/7/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:08:26 -0000 Author: rnoland Date: Sun Dec 13 15:08:25 2009 New Revision: 200476 URL: http://svn.freebsd.org/changeset/base/200476 Log: MFC 198332 Check pointer for NULL before dereferencing it, not after. Originally committed by: brueffer Modified: stable/7/sys/dev/drm/mach64_state.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/drm/mach64_state.c ============================================================================== --- stable/7/sys/dev/drm/mach64_state.c Sun Dec 13 15:03:54 2009 (r200475) +++ stable/7/sys/dev/drm/mach64_state.c Sun Dec 13 15:08:25 2009 (r200476) @@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device struct drm_file *file_priv) { drm_mach64_private_t *dev_priv = dev->dev_private; - drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv; + drm_mach64_sarea_t *sarea_priv; drm_mach64_vertex_t *vertex = data; LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device DRM_ERROR("called with no initialization\n"); return -EINVAL; } + sarea_priv = dev_priv->sarea_priv; DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n", DRM_CURRENTPID, From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 15:12:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19AF9106566C; Sun, 13 Dec 2009 15:12:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0789E8FC08; Sun, 13 Dec 2009 15:12: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 nBDFCemp089916; Sun, 13 Dec 2009 15:12:40 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDFCekX089914; Sun, 13 Dec 2009 15:12:40 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131512.nBDFCekX089914@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 15:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200477 - stable/7/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:12:41 -0000 Author: rnoland Date: Sun Dec 13 15:12:40 2009 New Revision: 200477 URL: http://svn.freebsd.org/changeset/base/200477 Log: MFC r198694,r198697 Some general cleanup of scatter/gather memory allocation - We don't need to check malloc return values with M_WAITOK - remove variables that we don't really need - cleanup the error paths by just calling drm_sg_cleanup() - fix drm_sg_cleanup() to be safe to call at any time Modified: stable/7/sys/dev/drm/drm_scatter.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/7/sys/dev/drm/drm_scatter.c Sun Dec 13 15:08:25 2009 (r200476) +++ stable/7/sys/dev/drm/drm_scatter.c Sun Dec 13 15:12:40 2009 (r200477) @@ -47,79 +47,50 @@ drm_sg_alloc(struct drm_device *dev, str { struct drm_sg_mem *entry; struct drm_dma_handle *dmah; - unsigned long pages; int ret; if (dev->sg) return EINVAL; entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); - if (!entry) - return ENOMEM; - - pages = round_page(request->size) / PAGE_SIZE; - DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages); - - entry->pages = pages; - - entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES, - M_WAITOK | M_ZERO); - if (!entry->busaddr) { - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + entry->pages = round_page(request->size) / PAGE_SIZE; + DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages); + entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), + DRM_MEM_PAGES, M_WAITOK | M_ZERO); dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA, - M_ZERO | M_NOWAIT); - if (dmah == NULL) { - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + M_WAITOK | M_ZERO); + entry->dmah = dmah; ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ - request->size, pages, /* maxsize, nsegs */ + request->size, entry->pages, /* maxsize, nsegs */ PAGE_SIZE, 0, /* maxsegsize, flags */ NULL, NULL, /* lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } + entry->handle = (unsigned long)dmah->vaddr; + entry->virtual = dmah->vaddr; + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT); if (ret != 0) { - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } - entry->dmah = dmah; - entry->handle = (unsigned long)dmah->vaddr; - - DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); - - entry->virtual = (void *)entry->handle; - request->handle = entry->handle; - DRM_LOCK(); if (dev->sg) { DRM_UNLOCK(); @@ -129,6 +100,11 @@ drm_sg_alloc(struct drm_device *dev, str dev->sg = entry; DRM_UNLOCK(); + DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle, + entry->virtual, *(unsigned long *)entry->virtual); + + request->handle = entry->handle; + return 0; } @@ -143,6 +119,8 @@ drm_sg_alloc_cb(void *arg, bus_dma_segme for(i = 0 ; i < nsegs ; i++) { entry->busaddr[i] = segs[i].ds_addr; + DRM_DEBUG("segment %d @ 0x%016lx\n", i, + (unsigned long)segs[i].ds_addr); } } @@ -162,9 +140,12 @@ drm_sg_cleanup(struct drm_sg_mem *entry) { struct drm_dma_handle *dmah = entry->dmah; - bus_dmamap_unload(dmah->tag, dmah->map); - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); + if (dmah->map != NULL) + bus_dmamap_unload(dmah->tag, dmah->map); + if (dmah->vaddr != NULL) + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + if (dmah->tag != NULL) + bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); free(entry->busaddr, DRM_MEM_PAGES); free(entry, DRM_MEM_SGLISTS); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 15:19:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CC81065670; Sun, 13 Dec 2009 15:19:02 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9CA8FC08; Sun, 13 Dec 2009 15:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDFJ2FW090062; Sun, 13 Dec 2009 15:19:02 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDFJ2bT090059; Sun, 13 Dec 2009 15:19:02 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200912131519.nBDFJ2bT090059@svn.freebsd.org> From: Hiroki Sato Date: Sun, 13 Dec 2009 15:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200478 - head/usr.sbin/ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:19:02 -0000 Author: hrs Date: Sun Dec 13 15:19:01 2009 New Revision: 200478 URL: http://svn.freebsd.org/changeset/base/200478 Log: - Fix main() to use two separated sockets for the two transports when "-P port" is specified. It invoked svc{tcp,udp}_create() for only one of the two allocated sockets, and prevented the TCP socket from binding to as the result. - Use TI-RPC functions and handle sockets in a transport-independent way. At this moment only AF_INET ("udp" and "tcp") is supported because others need rewrites of ACL handling and yp clients. - Add '-h addr' to specify addresses to bind to. - Convert _msgout() to use variable argument lists and remove asprintf() for error strings. - Remove register storage class specifier. Discussed with: kuriyama MFC after: 1 week Modified: head/usr.sbin/ypserv/yp_main.c head/usr.sbin/ypserv/ypserv.8 Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Sun Dec 13 15:12:40 2009 (r200477) +++ head/usr.sbin/ypserv/yp_main.c Sun Dec 13 15:19:01 2009 (r200478) @@ -40,25 +40,30 @@ __FBSDID("$FreeBSD$"); * rpcgen.new, and later modified. */ +#include +#include +#include +#include #include "yp.h" #include #include #include #include #include +#include #include /* getenv, exit */ #include /* strcmp */ #include #include -#include /* for pmap_unset */ #ifdef __cplusplus #include /* getdtablesize, open */ #endif /* __cplusplus */ -#include #include -#include +#include #include "yp_extern.h" +#include #include +#include #ifndef SIG_PF #define SIG_PF void(*)(int) @@ -68,14 +73,17 @@ __FBSDID("$FreeBSD$"); int _rpcpmstart; /* Started by a port monitor ? */ static int _rpcfdtype; /* Whether Stream or Datagram ? */ +static int _rpcaf; +static int _rpcfd; + /* States a server can be in wrt request */ #define _IDLE 0 #define _SERVED 1 #define _SERVING 2 -extern void ypprog_1(struct svc_req *, register SVCXPRT *); -extern void ypprog_2(struct svc_req *, register SVCXPRT *); +extern void ypprog_1(struct svc_req *, SVCXPRT *); +extern void ypprog_2(struct svc_req *, SVCXPRT *); extern int _rpc_dtablesize(void); extern int _rpcsvcstate; /* Set when a request is serviced */ char *progname = "ypserv"; @@ -84,26 +92,37 @@ char *yp_dir = _PATH_YP; int do_dns = 0; int resfd; -struct socktype { - const char *st_name; - int st_type; +struct socklistent { + int sle_sock; + struct sockaddr_storage sle_ss; + SLIST_ENTRY(socklistent) sle_next; }; -static struct socktype stlist[] = { - { "tcp", SOCK_STREAM }, - { "udp", SOCK_DGRAM }, - { NULL, 0 } +static SLIST_HEAD(, socklistent) sle_head = + SLIST_HEAD_INITIALIZER(&sle_head); + +struct bindaddrlistent { + const char *ble_hostname; + SLIST_ENTRY(bindaddrlistent) ble_next; }; +static SLIST_HEAD(, bindaddrlistent) ble_head = + SLIST_HEAD_INITIALIZER(&ble_head); + +static char *servname = "0"; static -void _msgout(char* msg) +void _msgout(char* msg, ...) { + va_list ap; + + va_start(ap, msg); if (debug) { if (_rpcpmstart) - syslog(LOG_ERR, "%s", msg); + vsyslog(LOG_ERR, msg, ap); else - warnx("%s", msg); + vwarnx(msg, ap); } else - syslog(LOG_ERR, "%s", msg); + vsyslog(LOG_ERR, msg, ap); + va_end(ap); } pid_t yp_pid; @@ -162,8 +181,8 @@ yp_svc_run(void) static void unregister(void) { - (void) pmap_unset(YPPROG, YPVERS); - (void) pmap_unset(YPPROG, YPOLDVERS); + (void)svc_unreg(YPPROG, YPVERS); + (void)svc_unreg(YPPROG, YPOLDVERS); } static void @@ -231,24 +250,222 @@ closedown(int sig) (void) alarm(_RPCSVC_CLOSEDOWN/2); } +static int +create_service(const int sock, const struct netconfig *nconf, + const struct __rpc_sockinfo *si) +{ + int error; + + SVCXPRT *transp; + struct addrinfo hints, *res, *res0; + struct socklistent *slep; + struct bindaddrlistent *blep; + struct netbuf svcaddr; + + SLIST_INIT(&sle_head); + memset(&hints, 0, sizeof(hints)); + memset(&svcaddr, 0, sizeof(svcaddr)); + + hints.ai_family = si->si_af; + hints.ai_socktype = si->si_socktype; + hints.ai_protocol = si->si_proto; + + /* + * Build socketlist from bindaddrlist. + */ + if (sock == RPC_ANYFD) { + SLIST_FOREACH(blep, &ble_head, ble_next) { + if (blep->ble_hostname == NULL) + hints.ai_flags = AI_PASSIVE; + else + hints.ai_flags = 0; + error = getaddrinfo(blep->ble_hostname, servname, + &hints, &res0); + if (error) { + _msgout("getaddrinfo(): %s", + gai_strerror(error)); + return -1; + } + for (res = res0; res; res = res->ai_next) { + int s; + + s = __rpc_nconf2fd(nconf); + if (s < 0) { + if (errno == EPROTONOSUPPORT) + _msgout("unsupported" + " transport: %s", + nconf->nc_netid); + else + _msgout("cannot create" + " %s socket: %s", + nconf->nc_netid, + strerror(errno)); + freeaddrinfo(res0); + return -1; + } + if (bind(s, res->ai_addr, + res->ai_addrlen) == -1) { + _msgout("cannot bind %s socket: %s", + nconf->nc_netid, strerror(errno)); + freeaddrinfo(res0); + close(sock); + return -1; + } + if (nconf->nc_semantics != NC_TPI_CLTS) + listen(s, SOMAXCONN); + + slep = malloc(sizeof(*slep)); + if (slep == NULL) { + _msgout("malloc failed: %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + memset(slep, 0, sizeof(*slep)); + memcpy(&slep->sle_ss, + (struct sockaddr *)(res->ai_addr), + sizeof(res->ai_addr)); + slep->sle_sock = s; + SLIST_INSERT_HEAD(&sle_head, slep, sle_next); + + /* + * If servname == "0", redefine it by using + * the bound socket. + */ + if (strncmp("0", servname, 1) == 0) { + struct sockaddr *sap; + socklen_t slen; + char *sname; + + sname = malloc(NI_MAXSERV); + if (sname == NULL) { + _msgout("malloc(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + memset(sname, 0, NI_MAXSERV); + + sap = (struct sockaddr *)&slep->sle_ss; + slen = sizeof(*sap); + error = getsockname(s, sap, &slen); + if (error) { + _msgout("getsockname(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + error = getnameinfo(sap, slen, + NULL, 0, + sname, NI_MAXSERV, + NI_NUMERICHOST | NI_NUMERICSERV); + if (error) { + _msgout("getnameinfo(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + servname = sname; + } + } + freeaddrinfo(res0); + } + } else { + slep = malloc(sizeof(*slep)); + if (slep == NULL) { + _msgout("malloc failed: %s", strerror(errno)); + return -1; + } + memset(slep, 0, sizeof(*slep)); + slep->sle_sock = sock; + SLIST_INSERT_HEAD(&sle_head, slep, sle_next); + } + + /* + * Traverse socketlist and create rpc service handles for each socket. + */ + SLIST_FOREACH(slep, &sle_head, sle_next) { + if (nconf->nc_semantics == NC_TPI_CLTS) + transp = svc_dg_create(slep->sle_sock, 0, 0); + else + transp = svc_vc_create(slep->sle_sock, RPC_MAXDATASIZE, + RPC_MAXDATASIZE); + if (transp == NULL) { + _msgout("unable to create service: %s", + nconf->nc_netid); + continue; + } + if (!svc_reg(transp, YPPROG, YPOLDVERS, ypprog_1, NULL)) { + svc_destroy(transp); + close(slep->sle_sock); + _msgout("unable to register (YPPROG, YPOLDVERS, %s):" + " %s", nconf->nc_netid, strerror(errno)); + continue; + } + if (!svc_reg(transp, YPPROG, YPVERS, ypprog_2, NULL)) { + svc_destroy(transp); + close(slep->sle_sock); + _msgout("unable to register (YPPROG, YPVERS, %s): %s", + nconf->nc_netid, strerror(errno)); + continue; + } + } + while(!(SLIST_EMPTY(&sle_head))) + SLIST_REMOVE_HEAD(&sle_head, sle_next); + + /* + * Register RPC service to rpcbind by using AI_PASSIVE address. + */ + hints.ai_flags = AI_PASSIVE; + error = getaddrinfo(NULL, servname, &hints, &res0); + if (error) { + _msgout("getaddrinfo(): %s", gai_strerror(error)); + return -1; + } + svcaddr.buf = res0->ai_addr; + svcaddr.len = res0->ai_addrlen; + + if (si->si_af == AF_INET) { + /* XXX: ignore error intentionally */ + rpcb_set(YPPROG, YPOLDVERS, nconf, &svcaddr); + } + /* XXX: ignore error intentionally */ + rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); + + freeaddrinfo(res0); + return 0; +} + int main(int argc, char *argv[]) { - register SVCXPRT *transp = NULL; - int sock; - int proto = 0; - struct sockaddr_in saddr; - socklen_t asize = sizeof (saddr); int ch; - in_port_t yp_port = 0; - char *errstr; - struct socktype *st; + int error; + + void *nc_handle; + struct netconfig *nconf; + struct __rpc_sockinfo si; + struct bindaddrlistent *blep; + + memset(&si, 0, sizeof(si)); + SLIST_INIT(&ble_head); - while ((ch = getopt(argc, argv, "hdnp:P:")) != -1) { + while ((ch = getopt(argc, argv, "dh:np:P:")) != -1) { switch (ch) { case 'd': debug = ypdb_debug = 1; break; + case 'h': + blep = malloc(sizeof(*blep)); + if (blep == NULL) + err(1, "malloc() failed: -h %s", optarg); + blep->ble_hostname = optarg; + SLIST_INSERT_HEAD(&ble_head, blep, ble_next); + break; case 'n': do_dns = 1; break; @@ -256,121 +473,79 @@ main(int argc, char *argv[]) yp_dir = optarg; break; case 'P': - yp_port = (in_port_t)strtonum(optarg, 1, 65535, - (const char **)&errstr); - if (yp_port == 0 && errstr != NULL) { - _msgout("invalid port number provided"); - exit(1); - } + servname = optarg; break; - case 'h': default: usage(); } } + /* + * Add "anyaddr" entry if no -h is specified. + */ + if (SLIST_EMPTY(&ble_head)) { + blep = malloc(sizeof(*blep)); + if (blep == NULL) + err(1, "malloc() failed"); + memset(blep, 0, sizeof(*blep)); + SLIST_INSERT_HEAD(&ble_head, blep, ble_next); + } load_securenets(); yp_init_resolver(); #ifdef DB_CACHE yp_init_dbs(); #endif - if (getsockname(0, (struct sockaddr *)&saddr, &asize) == 0) { - int ssize = sizeof (int); - - if (saddr.sin_family != AF_INET) - exit(1); - if (getsockopt(0, SOL_SOCKET, SO_TYPE, - (char *)&_rpcfdtype, &ssize) == -1) - exit(1); - sock = 0; + nc_handle = setnetconfig(); + if (nc_handle == NULL) + err(1, "cannot read %s", NETCONFIG); + if (__rpc_fd2sockinfo(0, &si) != 0) { + /* invoked from inetd */ _rpcpmstart = 1; - proto = 0; + _rpcfdtype = si.si_socktype; + _rpcaf = si.si_af; + _rpcfd = 0; openlog("ypserv", LOG_PID, LOG_DAEMON); } else { + /* standalone mode */ if (!debug) { if (daemon(0,0)) { err(1,"cannot fork"); } openlog("ypserv", LOG_PID, LOG_DAEMON); } - sock = RPC_ANYSOCK; - (void) pmap_unset(YPPROG, YPVERS); - (void) pmap_unset(YPPROG, YPOLDVERS); + _rpcpmstart = 0; + _rpcaf = AF_INET; + _rpcfd = RPC_ANYFD; + unregister(); } /* - * Initialize TCP/UDP sockets. + * Create RPC service for each transport. */ - memset((char *)&saddr, 0, sizeof(saddr)); - saddr.sin_family = AF_INET; - saddr.sin_addr.s_addr = htonl(INADDR_ANY); - saddr.sin_port = htons(yp_port); - for (st = stlist; st->st_name != NULL; st++) { - /* Do not bind the socket if the user didn't specify a port */ - if (yp_port == 0) - break; - - sock = socket(AF_INET, st->st_type, 0); - if (sock == -1) { - if ((asprintf(&errstr, "cannot create a %s socket", - st->st_name)) == -1) - err(1, "unexpected failure in asprintf()"); - _msgout(errstr); - free((void *)errstr); - exit(1); - } - if (bind(sock, (struct sockaddr *) &saddr, sizeof(saddr)) - == -1) { - if ((asprintf(&errstr, "cannot bind %s socket", - st->st_name)) == -1) - err(1, "unexpected failure in asprintf()"); - _msgout(errstr); - free((void *)errstr); - exit(1); - } - errstr = NULL; - } - - if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) { - transp = svcudp_create(sock); - if (transp == NULL) { - _msgout("cannot create udp service"); - exit(1); - } - if (!_rpcpmstart) - proto = IPPROTO_UDP; - if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) { - _msgout("unable to register (YPPROG, YPOLDVERS, udp)"); - exit(1); - } - if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) { - _msgout("unable to register (YPPROG, YPVERS, udp)"); - exit(1); - } - } - - if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_STREAM)) { - transp = svctcp_create(sock, 0, 0); - if (transp == NULL) { - _msgout("cannot create tcp service"); - exit(1); - } - if (!_rpcpmstart) - proto = IPPROTO_TCP; - if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) { - _msgout("unable to register (YPPROG, YPOLDVERS, tcp)"); - exit(1); - } - if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) { - _msgout("unable to register (YPPROG, YPVERS, tcp)"); - exit(1); + while((nconf = getnetconfig(nc_handle))) { + if ((nconf->nc_flag & NC_VISIBLE)) { + if (__rpc_nconf2sockinfo(nconf, &si) == 0) { + _msgout("cannot get information for %s", + nconf->nc_netid); + exit(1); + } + if (_rpcpmstart) { + if (si.si_socktype != _rpcfdtype || + si.si_af != _rpcaf) + continue; + } else if (si.si_af != _rpcaf) + continue; + error = create_service(_rpcfd, nconf, &si); + if (error) { + endnetconfig(nc_handle); + exit(1); + } } } + endnetconfig(nc_handle); + while(!(SLIST_EMPTY(&ble_head))) + SLIST_REMOVE_HEAD(&ble_head, ble_next); - if (transp == (SVCXPRT *)NULL) { - _msgout("could not create a handle"); - exit(1); - } if (_rpcpmstart) { (void) signal(SIGALRM, (SIG_PF) closedown); (void) alarm(_RPCSVC_CLOSEDOWN/2); Modified: head/usr.sbin/ypserv/ypserv.8 ============================================================================== --- head/usr.sbin/ypserv/ypserv.8 Sun Dec 13 15:12:40 2009 (r200477) +++ head/usr.sbin/ypserv/ypserv.8 Sun Dec 13 15:19:01 2009 (r200478) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 13, 2009 .Dt YPSERV 8 .Os .Sh NAME @@ -408,6 +408,15 @@ in subprocesses, allowing the parent ser other requests.) This makes it easier to trace the server with a debugging tool. +.It Fl h Ar addr +Specify a specific address to bind to for requests. This option may be +specified multiple times. If no +.Fl h +option is specified, +.Nm +will bind to default passive address +.Pq e.g. INADDR_ANY for IPv4 +for each transport. .It Fl P Ar port Force ypserv to bind to a specific TCP/UDP port, rather than selecting its own. From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 16:04:47 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F781065672; Sun, 13 Dec 2009 16:04:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 5285E8FC0C; Sun, 13 Dec 2009 16:04:47 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBDG4hI4004213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 03:04:45 +1100 Date: Mon, 14 Dec 2009 03:04:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Xin LI In-Reply-To: <200912130314.nBD3E6pO071938@svn.freebsd.org> Message-ID: <20091214025232.H33073@delplex.bde.org> References: <200912130314.nBD3E6pO071938@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: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 16:04:47 -0000 On Sun, 13 Dec 2009, Xin LI wrote: > Log: > Revert most part of 200420 as requested, as more review and polish is > needed. Thanks. Look at removing includes of time.h last -- the nesting and pollution of time.h, sys/time.h, sys/[_]timespec.h, sys/[_]timeval.h, and headers for other APIs using timevals and/or timespecs is most convoluted, starting with sys/time.h vs time.h being mostly backwards (sys/time.h includes time.h if !_KERNEL...). Bruce From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 16:45:46 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E71C1065670; Sun, 13 Dec 2009 16:45:46 +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 144798FC15; Sun, 13 Dec 2009 16:45:45 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBDGjgW6005647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 03:45:43 +1100 Date: Mon, 14 Dec 2009 03:45:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Xin LI In-Reply-To: <200912130334.nBD3YJbO072556@svn.freebsd.org> Message-ID: <20091214031938.E33347@delplex.bde.org> References: <200912130334.nBD3YJbO072556@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: r200465 - head/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 16:45:46 -0000 On Sun, 13 Dec 2009, Xin LI wrote: > Log: > Staticify internal functions and make usage() a prototype. Please actually declare them static. > Modified: head/usr.bin/xinstall/xinstall.c > ============================================================================== > --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:29:05 2009 (r200464) > +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) > @@ -86,16 +86,16 @@ int dobackup, docompare, dodir, dopreser > mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > const char *suffix = BACKUP_SUFFIX; > > -void copy(int, const char *, int, const char *, off_t); > -int compare(int, const char *, size_t, int, const char *, size_t); > -int create_newfile(const char *, int, struct stat *); > -int create_tempfile(const char *, char *, size_t); > -void install(const char *, const char *, u_long, u_int); > -void install_dir(char *); > -u_long numeric_id(const char *, const char *); > -void strip(const char *); > -int trymmap(int); > -void usage(void); > +static void copy(int, const char *, int, const char *, off_t); > +static int compare(int, const char *, size_t, int, const char *, size_t); Sorting errors like copy < compare could be fixed when making changes to all the prototypes like this. > +static int create_newfile(const char *, int, struct stat *); > +static int create_tempfile(const char *, char *, size_t); > +static void install(const char *, const char *, u_long, u_int); > +static void install_dir(char *); > +static u_long numeric_id(const char *, const char *); > +static void strip(const char *); > +static int trymmap(int); > +static void usage(void); > > int > main(int argc, char *argv[]) > @@ -771,7 +771,7 @@ install_dir(char *path) > * print a usage message and die > */ > void > -usage() > +usage(void) > { > (void)fprintf(stderr, > "usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" It is a good obfuscation to declare functions as static only in the prototype, so that you can't see the static for the actual function. The reverse obfuscation (with static only in the function definition) would make more sense, but is a constraint error. (C99 allows building up a declaration by accumulating type or linkage details in some cases but not here. Last time I checked, gcc didn't understand this, and warns about "redundant redeclarations" for non-redundant non-re declarations.) With C90 function definitions (not prototypes!) and almost all functions staticized, most of foward declarations involving prototypes are unnecessary. We couldn't agree if style requires having them (it is sometimes useful to have a complete list of static functions as prototypes near the top of the file). We should agree before large staicization sweeps. The bad style of having everything extern, combined prototyping all extern functions, left us many thousands of lines of non-static prototypes near the tops of files. (In 4.4BSD, prototypes had to be done like that, using __P(()), even for static functions, since that was the only reasonable way to ifdef prototypes. After use of __P(()) was removed, extern prototypes still had to be done like that since -Wmissing-prototypes forces it at high WARNS even for functions that should be static and are defined before they are called. But static prototypes don't have to be done like that.) Bruce From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 16:53:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06681065679; Sun, 13 Dec 2009 16:53:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB48A8FC15; Sun, 13 Dec 2009 16:53: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 nBDGr6kp091956; Sun, 13 Dec 2009 16:53:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDGr6NR091945; Sun, 13 Dec 2009 16:53:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912131653.nBDGr6NR091945@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 16:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200479 - in stable/7: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/lindev sys/i386/conf sys/modules sys/modules/lindev sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 16:53:06 -0000 Author: bz Date: Sun Dec 13 16:53:06 2009 New Revision: 200479 URL: http://svn.freebsd.org/changeset/base/200479 Log: MFC r197518: lindev(4) [1] is supposed to be a collection of linux-specific pseudo devices that we also support, just not by default (thus only LINT or module builds by default). While currently there is only "/dev/full" [2], we are planning to see more in the future. We may decide to change the module/dependency logic in the future should the list grow too long. This is not part of linux.ko as also non-linux binaries like kFreeBSD userland or ports can make use of this as well. Suggested by: rwatson [1] (name) Submitted by: ed [2] Discussed with: markm, ed, rwatson, kib (weeks ago) Reviewed by: rwatson, brueffer (prev. version) PR: kern/68961 Added: stable/7/share/man/man4/lindev.4 - copied unchanged from r197518, head/share/man/man4/lindev.4 stable/7/sys/dev/lindev/ - copied from r197518, head/sys/dev/lindev/ stable/7/sys/modules/lindev/ - copied from r197518, head/sys/modules/lindev/ Modified: stable/7/share/man/man4/Makefile stable/7/sys/amd64/conf/NOTES stable/7/sys/boot/forth/loader.conf stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/conf/files.pc98 stable/7/sys/i386/conf/NOTES stable/7/sys/modules/Makefile stable/7/sys/pc98/conf/NOTES Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/share/man/man4/Makefile Sun Dec 13 16:53:06 2009 (r200479) @@ -156,6 +156,7 @@ MAN= aac.4 \ le.4 \ led.4 \ lge.4 \ + ${_lindev.4} \ lmc.4 \ lo.4 \ lp.4 \ @@ -571,6 +572,7 @@ _if_nxge.4= if_nxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _k8temp.4= k8temp.4 +_lindev.4= lindev.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nve.4= nve.4 @@ -579,6 +581,8 @@ _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 _wpi.4= wpi.4 + +MLINKS+=lindev.4 full.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_ARCH}) Copied: stable/7/share/man/man4/lindev.4 (from r197518, head/share/man/man4/lindev.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/lindev.4 Sun Dec 13 16:53:06 2009 (r200479, copy of r197518, head/share/man/man4/lindev.4) @@ -0,0 +1,73 @@ +.\"- +.\" Copyright (c) 2009 "Bjoern A. Zeeb" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 26, 2009 +.Dt LINDEV 4 +.Os +.Sh NAME +.Nm lindev +.Nd the lindev module +.Sh SYNOPSIS +To compile this collection of linux-specific pseudo devices into the kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device lindev" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +lindev_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +module provides a collection of linux-specific pseudo devices. +.Sh DEVICES +.Bl -tag -width /dev/full +.It Pa /dev/full +The +.Xr full +device always returns +.Er ENOSPC +on write attempts. +For reads it emulates +.Xr zero 4 . +.El +.Sh FILES +.Bl -tag -width /dev/full +.It Pa /dev/full +.El +.Sh SEE ALSO +.Xr null 4 , +.Xr zero 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 9.0 . Modified: stable/7/sys/amd64/conf/NOTES ============================================================================== --- stable/7/sys/amd64/conf/NOTES Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/amd64/conf/NOTES Sun Dec 13 16:53:06 2009 (r200479) @@ -681,3 +681,6 @@ options VM_KMEM_SIZE_SCALE # Enable NDIS binary driver support options NDISAPI device ndis + +# Linux-specific pseudo devices support +device lindev Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/boot/forth/loader.conf Sun Dec 13 16:53:06 2009 (r200479) @@ -178,6 +178,7 @@ screensave_name="green_saver" # Set to t ibcs2_load="NO" # IBCS2 (SCO) emulation ibcs2_coff_load="NO" linux_load="NO" # Linux emulation +lindev_load="NO" # Linux-specific pseudo devices (see lindev(4)) svr4_load="NO" # SystemV R4 emulation streams_load="NO" # System V streams module Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/conf/files.amd64 Sun Dec 13 16:53:06 2009 (r200479) @@ -187,6 +187,8 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/conf/files.i386 Sun Dec 13 16:53:06 2009 (r200479) @@ -205,6 +205,8 @@ dev/ipmi/ipmi_ssif.c optional ipmi smbu dev/ipmi/ipmi_pci.c optional ipmi pci dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_isa.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa Modified: stable/7/sys/conf/files.pc98 ============================================================================== --- stable/7/sys/conf/files.pc98 Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/conf/files.pc98 Sun Dec 13 16:53:06 2009 (r200479) @@ -113,6 +113,8 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/i386/conf/NOTES Sun Dec 13 16:53:06 2009 (r200479) @@ -1189,6 +1189,9 @@ device streams # STREAMS network drive options NDISAPI device ndis +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/modules/Makefile Sun Dec 13 16:53:06 2009 (r200479) @@ -155,6 +155,7 @@ SUBDIR= ${_3dfx} \ libiconv \ libmbpool \ libmchain \ + ${_lindev} \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ @@ -413,6 +414,7 @@ _ie= ie _if_ndis= if_ndis _igb= igb _io= io +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux @@ -548,6 +550,7 @@ _ips= ips _ipw= ipw _ipwfw= ipwfw _ixgb= ixgb +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux Modified: stable/7/sys/pc98/conf/NOTES ============================================================================== --- stable/7/sys/pc98/conf/NOTES Sun Dec 13 15:19:01 2009 (r200478) +++ stable/7/sys/pc98/conf/NOTES Sun Dec 13 16:53:06 2009 (r200479) @@ -717,6 +717,9 @@ options COMPAT_SVR4 # build emulator st options DEBUG_SVR4 # enable verbose debugging device streams # STREAMS network driver (required for svr4). +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 17:31:52 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443D5106566B; Sun, 13 Dec 2009 17:31:52 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id DCBFE8FC0C; Sun, 13 Dec 2009 17:31:51 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.3/8.14.3) with ESMTP id nBDHVmrm033982; Sun, 13 Dec 2009 12:31:48 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.3/8.14.3/Submit) id nBDHVmGZ033978; Sun, 13 Dec 2009 12:31:48 -0500 (EST) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <19237.9476.489430.11780@hergotha.csail.mit.edu> Date: Sun, 13 Dec 2009 12:31:48 -0500 From: Garrett Wollman To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86pr6jjd29.fsf@ds4.des.no> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> X-Mailer: VM 7.17 under 21.4 (patch 21) "Educational Television" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Sun, 13 Dec 2009 12:31:49 -0500 (EST) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 17:31:52 -0000 < said: > It's not "what Linux does", it's what xterm does. It's also, not to put too fine a point on it, obnoxious and stupid. Let's please have the useful behavior. There's a good reason why our "xterm" termcap entry has never had this bogus behavior enabled (except for brief periods after someone "updates" termcap). -GAWollman From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 18:19:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9FB106566B; Sun, 13 Dec 2009 18:19:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2588FC16; Sun, 13 Dec 2009 18:19:41 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 88EED1CC5D; Sun, 13 Dec 2009 19:19:40 +0100 (CET) Date: Sun, 13 Dec 2009 19:19:40 +0100 From: Ed Schouten To: Andriy Gapon Message-ID: <20091213181940.GR64905@hoeg.nl> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B236520.7040204@freebsd.org> <20091212095118.GN64905@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xGBdya926SPBMGqW" Content-Disposition: inline In-Reply-To: <20091212095118.GN64905@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Christoph Mallon , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:19:42 -0000 --xGBdya926SPBMGqW Content-Type: multipart/mixed; boundary="jphhXT5dWBdc8q08" Content-Disposition: inline --jphhXT5dWBdc8q08 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > * Andriy Gapon wrote: > > Seriously, I think that this change is a mild POLA violation, which > > neither was discussed nor welcome as it seems. Perhaps, not even > > planned. So I believe that termcap should be changed back to > > traditional behavior for FreeBSD. At least for now. >=20 > Sure. It wasn't planned to do so. >=20 > I can't fix it right now (sitting at a conference, as we speak), but > I'll try to get a patch into SVN tomorrow. I've attached a patch that fixes at least the TERM=3Dxterm and TERM=3Dxterm-color entries. Comments? --=20 Ed Schouten WWW: http://80386.nl/ --jphhXT5dWBdc8q08 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="termcap.diff" Index: share/termcap/termcap.src =================================================================== --- share/termcap/termcap.src (revision 200435) +++ share/termcap/termcap.src (working copy) @@ -2862,7 +2862,7 @@ # be painted in spots. xterm-color|generic "ANSI" color xterm:\ :Co#8:NC@:pa#64:\ - :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:tc=xterm-r6: + :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:te@:ti@:tc=xterm-r6: # # These aliases are for compatibility with the terminfo; termcap cannot provide # the extra features such as color initialization, but termcap applications @@ -2985,7 +2985,7 @@ # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. xterm|X11 terminal emulator:\ - :tc=xterm-new: + :te@:ti@:tc=xterm-new: # :tc=xterm-r6: # dtterm termcap entry - Obtained from Xinside's CDE with permission # from Thomas Roell Index: etc/termcap.small =================================================================== --- etc/termcap.small (revision 200435) +++ etc/termcap.small (working copy) @@ -319,4 +319,4 @@ # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. xterm|X11 terminal emulator:\ - :tc=xterm-new: + :te@:ti@:tc=xterm-new: --jphhXT5dWBdc8q08-- --xGBdya926SPBMGqW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkslMDwACgkQ52SDGA2eCwU+1wCeIsrQxGfFKnDkjE6R9qYsquMe XrYAni/P6j8m2jJTsqC8WOUAbncAycms =OYc4 -----END PGP SIGNATURE----- --xGBdya926SPBMGqW-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 18:24:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C9B31065679 for ; Sun, 13 Dec 2009 18:24:20 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id F373F8FC1A for ; Sun, 13 Dec 2009 18:24:19 +0000 (UTC) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:54954 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1NJt5w-00035D-7v for svn-src-all@freebsd.org; Sun, 13 Dec 2009 19:23:02 +0100 Received: (qmail 4190 invoked by uid 1001); 13 Dec 2009 19:22:57 +0100 Date: Sun, 13 Dec 2009 19:22:56 +0100 From: Erik Trulsson To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091213182256.GA4117@falcon.midgard.homeip.net> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <86pr6jjd29.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1NJt5w-00035D-7v. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1NJt5w-00035D-7v 072d6c16e5ac9fbed74b28ce4955a645 Cc: Doug Barton , Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , src-committers@freebsd.org, Ronald Klop , svn-src-head@freebsd.org, Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:24:20 -0000 On Sun, Dec 13, 2009 at 01:03:42PM +0100, Dag-Erling Sm=F8rgrav wrote: > Doug Barton writes: > > To be clear, I am NOT asking for a backout ... IIRC in the thread that > > discussed this issue there were quite a few people who thought that > > FreeBSD not clearing the screen was a POLA violation since that's what > > linux does, and it's what most people are used to. >=20 > It's not "what Linux does", it's what xterm does. Xterm did not > originate with Linux; in fact, it predates Linux by about ten years. > FreeBSD's xterm entry was deliberately crippled to lie about xterm's > capabilities. Actually it is when the 'ti'/'te' termcap entries are *provided* that one lies about xterm's capabilities. The presence of the 'ti'/'te' termcap capabilities implies that programs must use them when entering/leaving full-screen mode. (Some terminal types need to be in some special mode to allow you to move around the cursor to arbitrary positions.) This is not needed for xterm, and therefore those capabilities should not appear in the termcap entry for xterm. --=20 Erik Trulsson ertr1013@student.uu.se From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 18:26:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8B44106566B; Sun, 13 Dec 2009 18:26:19 +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 C7CF88FC16; Sun, 13 Dec 2009 18:26: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 nBDIQJmV093848; Sun, 13 Dec 2009 18:26:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDIQJWa093845; Sun, 13 Dec 2009 18:26:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912131826.nBDIQJWa093845@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 18:26: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: r200481 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:26:19 -0000 Author: marius Date: Sun Dec 13 18:26:19 2009 New Revision: 200481 URL: http://svn.freebsd.org/changeset/base/200481 Log: Specify the capability and media bits of the capabilities page in native, i.e. big-endian, format and convert as appropriate like we also do with the multibyte fields of the other pages. This fixes the output of acd_describe() to match reality on big-endian machines without breaking it on little-endian ones. While at it, also convert the remaining multibyte fields of the pages read although they are currently unused for consistency and in order to prevent possible similar bugs in the future. MFC after: 1 week Modified: head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-cd.h Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) +++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) @@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), ATA_R_READ, 30))) return error; + info->data_length = ntohs(info->data_length); info->track_start_addr = ntohl(info->track_start_addr); info->next_writeable_addr = ntohl(info->next_writeable_addr); info->free_blocks = ntohl(info->free_blocks); @@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) for (count = 0 ; count < 5 ; count++) { if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), ATA_R_READ | ATA_R_QUIET, 5)) { + cdp->cap.data_length = ntohs(cdp->cap.data_length); + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); + cdp->cap.media = ntohs(cdp->cap.media); + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); } } } Modified: head/sys/dev/ata/atapi-cd.h ============================================================================== --- head/sys/dev/ata/atapi-cd.h Sun Dec 13 17:49:22 2009 (r200480) +++ head/sys/dev/ata/atapi-cd.h Sun Dec 13 18:26:19 2009 (r200481) @@ -112,34 +112,34 @@ struct cappage { u_int8_t param_len; u_int16_t media; -#define MST_READ_CDR 0x0001 -#define MST_READ_CDRW 0x0002 -#define MST_READ_PACKET 0x0004 -#define MST_READ_DVDROM 0x0008 -#define MST_READ_DVDR 0x0010 -#define MST_READ_DVDRAM 0x0020 -#define MST_WRITE_CDR 0x0100 -#define MST_WRITE_CDRW 0x0200 -#define MST_WRITE_TEST 0x0400 -#define MST_WRITE_DVDR 0x1000 -#define MST_WRITE_DVDRAM 0x2000 +#define MST_READ_CDR 0x0100 +#define MST_READ_CDRW 0x0200 +#define MST_READ_PACKET 0x0400 +#define MST_READ_DVDROM 0x0800 +#define MST_READ_DVDR 0x1000 +#define MST_READ_DVDRAM 0x2000 +#define MST_WRITE_CDR 0x0001 +#define MST_WRITE_CDRW 0x0002 +#define MST_WRITE_TEST 0x0004 +#define MST_WRITE_DVDR 0x0010 +#define MST_WRITE_DVDRAM 0x0020 u_int16_t capabilities; -#define MST_AUDIO_PLAY 0x0001 -#define MST_COMPOSITE 0x0002 -#define MST_AUDIO_P1 0x0004 -#define MST_AUDIO_P2 0x0008 -#define MST_MODE2_f1 0x0010 -#define MST_MODE2_f2 0x0020 -#define MST_MULTISESSION 0x0040 -#define MST_BURNPROOF 0x0080 -#define MST_READ_CDDA 0x0100 -#define MST_CDDA_STREAM 0x0200 -#define MST_COMBINED_RW 0x0400 -#define MST_CORRECTED_RW 0x0800 -#define MST_SUPPORT_C2 0x1000 -#define MST_ISRC 0x2000 -#define MST_UPC 0x4000 +#define MST_AUDIO_PLAY 0x0100 +#define MST_COMPOSITE 0x0200 +#define MST_AUDIO_P1 0x0400 +#define MST_AUDIO_P2 0x0800 +#define MST_MODE2_f1 0x1000 +#define MST_MODE2_f2 0x2000 +#define MST_MULTISESSION 0x4000 +#define MST_BURNPROOF 0x8000 +#define MST_READ_CDDA 0x0001 +#define MST_CDDA_STREAM 0x0002 +#define MST_COMBINED_RW 0x0004 +#define MST_CORRECTED_RW 0x0008 +#define MST_SUPPORT_C2 0x0010 +#define MST_ISRC 0x0020 +#define MST_UPC 0x0040 u_int8_t mechanism; #define MST_LOCKABLE 0x01 From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 18:32:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37DC51065693; Sun, 13 Dec 2009 18:32:08 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id DEFAD8FC13; Sun, 13 Dec 2009 18:32:07 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id nBDIA1LF028473; Sun, 13 Dec 2009 13:10:01 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Sun, 13 Dec 2009 13:10:01 -0500 (EST) Date: Sun, 13 Dec 2009 13:10:01 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Garrett Wollman In-Reply-To: <19237.9476.489430.11780@hergotha.csail.mit.edu> Message-ID: References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> <19237.9476.489430.11780@hergotha.csail.mit.edu> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-1260727801=:11994" Cc: svn-src-head@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:32:08 -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. ---559023410-1804928587-1260727801=:11994 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 13 Dec 2009, Garrett Wollman wrote: > < said: > >> It's not "what Linux does", it's what xterm does. > > It's also, not to put too fine a point on it, obnoxious and stupid. > > Let's please have the useful behavior. There's a good reason why > our "xterm" termcap entry has never had this bogus behavior enabled > (except for brief periods after someone "updates" termcap). I agree. Please, please, keep the useful behavior. I think Solaris must also have similar xterm entries, as I haven't had the silly clear screen behavior on Solaris 2.4 through Solaris 10. --=20 DE ---559023410-1804928587-1260727801=:11994-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 18:42:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADF93106568B; Sun, 13 Dec 2009 18:42:06 +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 839A28FC08; Sun, 13 Dec 2009 18:42: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 nBDIg65X094159; Sun, 13 Dec 2009 18:42:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDIg67B094157; Sun, 13 Dec 2009 18:42:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912131842.nBDIg67B094157@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 18:42: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: r200482 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:42:06 -0000 Author: marius Date: Sun Dec 13 18:42:06 2009 New Revision: 200482 URL: http://svn.freebsd.org/changeset/base/200482 Log: Properly support M5229 revision 0xc7 and 0xc8: - These revisions no longer have cable detection capability. - The UDMA support bit of register 0x4b has been dropped without an replacement. - According to Linux it's crucial for working ATAPI DMA support to also set the reserved bit 1 of regsiter 0x53 with these revisions. MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 18:26:19 2009 (r200481) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 18:42:06 2009 (r200482) @@ -141,11 +141,14 @@ ata_ali_chipinit(device_t dev) /* use device interrupt as byte count end */ pci_write_config(dev, 0x4a, pci_read_config(dev, 0x4a, 1) | 0x20, 1); - /* enable cable detection and UDMA support on newer chips */ - pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1); - - /* enable ATAPI UDMA mode */ - pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x01, 1); + /* enable cable detection and UDMA support on revisions < 0xc7 */ + if (ctlr->chip->chiprev < 0xc7) + pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | + 0x09, 1); + + /* enable ATAPI UDMA mode (even if we are going to do PIO) */ + pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | + (ctlr->chip->chiprev >= 0xc7 ? 0x03 : 0x01), 1); /* only chips with revision > 0xc4 can do 48bit DMA */ if (ctlr->chip->chiprev <= 0xc4) @@ -276,7 +279,7 @@ ata_ali_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); - if (ctlr->chip->cfg2 & ALI_NEW) { + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) { if (mode > ATA_UDMA2 && pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) { ata_print_cable(dev, "controller"); From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 19:44:14 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A42106566B; Sun, 13 Dec 2009 19:44:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 260728FC0C; Sun, 13 Dec 2009 19:44:13 +0000 (UTC) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id nBDJiDYU041792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Dec 2009 11:44:13 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <4B25440D.3050107@errno.com> Date: Sun, 13 Dec 2009 11:44:13 -0800 From: Sam Leffler User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Marius Strobl References: <200912131826.nBDIQJWa093845@svn.freebsd.org> In-Reply-To: <200912131826.nBDIQJWa093845@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200481 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 19:44:14 -0000 Marius Strobl wrote: > Author: marius > Date: Sun Dec 13 18:26:19 2009 > New Revision: 200481 > URL: http://svn.freebsd.org/changeset/base/200481 > > Log: > Specify the capability and media bits of the capabilities page in > native, i.e. big-endian, format and convert as appropriate like we > also do with the multibyte fields of the other pages. This fixes > the output of acd_describe() to match reality on big-endian machines > without breaking it on little-endian ones. While at it, also convert > the remaining multibyte fields of the pages read although they are > currently unused for consistency and in order to prevent possible > similar bugs in the future. > > MFC after: 1 week > > Modified: > head/sys/dev/ata/atapi-cd.c > head/sys/dev/ata/atapi-cd.h > > Modified: head/sys/dev/ata/atapi-cd.c > ============================================================================== > --- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) > +++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) > @@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ > if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), > ATA_R_READ, 30))) > return error; > + info->data_length = ntohs(info->data_length); > info->track_start_addr = ntohl(info->track_start_addr); > info->next_writeable_addr = ntohl(info->next_writeable_addr); > info->free_blocks = ntohl(info->free_blocks); > @@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) > for (count = 0 ; count < 5 ; count++) { > if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), > ATA_R_READ | ATA_R_QUIET, 5)) { > + cdp->cap.data_length = ntohs(cdp->cap.data_length); > + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); > + cdp->cap.media = ntohs(cdp->cap.media); > + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); > cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); > + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); > cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); > cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); > - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); > } > } > } I don't think this should use ntoh* but instead use le*/be* macros. Separately the ata code was very broken in it's handling of big-endian byte order; e.g. for arm I had to supply wrong bus space methods as a workaround. Do these changes take this byte-order confusion into account? Sam From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:16:51 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0B01065692; Sun, 13 Dec 2009 20:16:51 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2308FC0A; Sun, 13 Dec 2009 20:16:50 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id nBDKGiTK063772; Sun, 13 Dec 2009 21:16:44 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id nBDKGiZD063771; Sun, 13 Dec 2009 21:16:44 +0100 (CET) (envelope-from marius) Date: Sun, 13 Dec 2009 21:16:43 +0100 From: Marius Strobl To: Sam Leffler Message-ID: <20091213201643.GH74529@alchemy.franken.de> References: <200912131826.nBDIQJWa093845@svn.freebsd.org> <4B25440D.3050107@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B25440D.3050107@errno.com> 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: r200481 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:16:51 -0000 On Sun, Dec 13, 2009 at 11:44:13AM -0800, Sam Leffler wrote: > Marius Strobl wrote: > >Author: marius > >Date: Sun Dec 13 18:26:19 2009 > >New Revision: 200481 > >URL: http://svn.freebsd.org/changeset/base/200481 > > > >Log: > > Specify the capability and media bits of the capabilities page in > > native, i.e. big-endian, format and convert as appropriate like we > > also do with the multibyte fields of the other pages. This fixes > > the output of acd_describe() to match reality on big-endian machines > > without breaking it on little-endian ones. While at it, also convert > > the remaining multibyte fields of the pages read although they are > > currently unused for consistency and in order to prevent possible > > similar bugs in the future. > > > > MFC after: 1 week > > > >Modified: > > head/sys/dev/ata/atapi-cd.c > > head/sys/dev/ata/atapi-cd.h > > > >Modified: head/sys/dev/ata/atapi-cd.c > >============================================================================== > >--- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) > >+++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) > >@@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ > > if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), > > ATA_R_READ, 30))) > > return error; > >+ info->data_length = ntohs(info->data_length); > > info->track_start_addr = ntohl(info->track_start_addr); > > info->next_writeable_addr = ntohl(info->next_writeable_addr); > > info->free_blocks = ntohl(info->free_blocks); > >@@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) > > for (count = 0 ; count < 5 ; count++) { > > if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), > > ATA_R_READ | ATA_R_QUIET, 5)) { > >+ cdp->cap.data_length = ntohs(cdp->cap.data_length); > >+ cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); > >+ cdp->cap.media = ntohs(cdp->cap.media); > >+ cdp->cap.capabilities = ntohs(cdp->cap.capabilities); > > cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); > >+ cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > >+ cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > > cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); > > cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); > > cdp->cap.cur_write_speed = > > max(ntohs(cdp->cap.cur_write_speed),177); > >- cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > >- cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > >+ cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); > > } > > } > > } > > I don't think this should use ntoh* but instead use le*/be* macros. > I agree but ata(4) uses hton*(9) and ntoh*(9) throughout its source so changing it to use bytorder(9) functions instead should be a separate style change. > Separately the ata code was very broken in it's handling of big-endian > byte order; e.g. for arm I had to supply wrong bus space methods as a > workaround. Do these changes take this byte-order confusion into account? > At least on sparc64 I haven't seen such problems. There all ATA controllers are PCI which uses little-endian bus space accessors. AFAICT at least atapi-cd(4) now does the right things as the native byteorder of the pages indeed is big-endian as explicitly mentioned in MMC-5. Marius From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:27:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A70F1065679; Sun, 13 Dec 2009 20:27:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682E78FC15; Sun, 13 Dec 2009 20:27: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 nBDKRkwV096325; Sun, 13 Dec 2009 20:27:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKRkhM096316; Sun, 13 Dec 2009 20:27:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912132027.nBDKRkhM096316@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Dec 2009 20:27: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: r200483 - head/tools/regression/kqueue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:27:46 -0000 Author: rwatson Date: Sun Dec 13 20:27:46 2009 New Revision: 200483 URL: http://svn.freebsd.org/changeset/base/200483 Log: Add Mark Heily's libkqueue test suite as a general kqueue test suite to tools/regression. It tests a number of aspects of kqueue behavior, although not all currently pass (possibly bugs in the test suite?). Submitted by: Mark Heily Obtained from: svn://mark.heily.com/libkqueue/trunk/test (r114) Added: head/tools/regression/kqueue/ head/tools/regression/kqueue/Makefile (contents, props changed) head/tools/regression/kqueue/common.h (contents, props changed) head/tools/regression/kqueue/config.h (contents, props changed) head/tools/regression/kqueue/main.c (contents, props changed) head/tools/regression/kqueue/proc.c (contents, props changed) head/tools/regression/kqueue/read.c (contents, props changed) head/tools/regression/kqueue/signal.c (contents, props changed) head/tools/regression/kqueue/timer.c (contents, props changed) head/tools/regression/kqueue/user.c (contents, props changed) head/tools/regression/kqueue/vnode.c (contents, props changed) Added: head/tools/regression/kqueue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/Makefile Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# +# svn://mark.heily.com/libkqueue/trunk/test +# Last update: r114 +# +# libkqueue and test suite by Mark Heily +# + +PROG=kqtest +SRCS= \ + main.c \ + read.c \ + timer.c \ + vnode.c \ + proc.c \ + signal.c \ + user.c +NO_MAN= +WARNS=2 + +.include "bsd.prog.mk" Added: head/tools/regression/kqueue/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/common.h Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * 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$ + */ + +#ifndef _COMMON_H +#define _COMMON_H + + +#if HAVE_ERR_H +# include +#else +# define err(rc,msg,...) do { perror(msg); exit(rc); } while (0) +# define errx(rc,msg,...) do { puts(msg); exit(rc); } while (0) +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "config.h" + +extern char *cur_test_id; +int vnode_fd; + +extern const char * kevent_to_str(struct kevent *); +struct kevent * kevent_get(int); + + +void kevent_cmp(struct kevent *, struct kevent *); + +void +kevent_add(int kqfd, struct kevent *kev, + uintptr_t ident, + short filter, + u_short flags, + u_int fflags, + intptr_t data, + void *udata); + +/* DEPRECATED: */ +#define KEV_CMP(kev,_ident,_filter,_flags) do { \ + if (kev.ident != (_ident) || \ + kev.filter != (_filter) || \ + kev.flags != (_flags)) \ + err(1, "kevent mismatch: got [%d,%d,%d] but expecting [%d,%d,%d]", \ + (int)_ident, (int)_filter, (int)_flags,\ + (int)kev.ident, kev.filter, kev.flags);\ +} while (0); + +/* Checks if any events are pending, which is an error. */ +extern void test_no_kevents(void); + +extern void test_begin(const char *); +extern void success(void); + +#endif /* _COMMON_H */ Added: head/tools/regression/kqueue/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/config.h Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,12 @@ +/* AUTOMATICALLY GENERATED -- DO NOT EDIT */ +/* $FreeBSD$ */ +#define HAVE_SYS_EVENT_H +#define HAVE_EV_DISPATCH 1 +#define HAVE_EV_RECEIPT 1 +#undef HAVE_NOTE_TRUNCATE +#define HAVE_EVFILT_TIMER 1 +#define HAVE_EVFILT_USER 1 +#define PROGRAM "libkqueue-test" +#define VERSION "0.1" +#define TARGET "freebsd" +#define CFLAGS "-g -O0 -Wall -Werror" Added: head/tools/regression/kqueue/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/main.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * 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$ + */ + +#include + +#include "common.h" + +int testnum = 1; +char *cur_test_id = NULL; +int kqfd; + +extern void test_evfilt_read(); +extern void test_evfilt_signal(); +extern void test_evfilt_vnode(); +extern void test_evfilt_timer(); +extern void test_evfilt_proc(); +#if HAVE_EVFILT_USER +extern void test_evfilt_user(); +#endif + +/* Checks if any events are pending, which is an error. */ +void +test_no_kevents(void) +{ + int nfds; + struct timespec timeo; + struct kevent kev; + + puts("confirming that there are no events pending"); + memset(&timeo, 0, sizeof(timeo)); + nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); + if (nfds != 0) { + puts("\nUnexpected event:"); + puts(kevent_to_str(&kev)); + errx(1, "%d event(s) pending, but none expected:", nfds); + } +} + +/* Retrieve a single kevent */ +struct kevent * +kevent_get(int kqfd) +{ + int nfds; + struct kevent *kev; + + if ((kev = calloc(1, sizeof(*kev))) == NULL) + err(1, "out of memory"); + + nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); + if (nfds < 1) + err(1, "kevent(2)"); + + return (kev); +} + +char * +kevent_fflags_dump(struct kevent *kev) +{ + char *buf; + +#define KEVFFL_DUMP(attrib) \ + if (kev->fflags & attrib) \ + strncat(buf, #attrib" ", 64); + + if ((buf = calloc(1, 1024)) == NULL) + abort(); + + /* Not every filter has meaningful fflags */ + if (kev->filter != EVFILT_VNODE) { + snprintf(buf, 1024, "fflags = %d", kev->fflags); + return (buf); + } + + snprintf(buf, 1024, "fflags = %d (", kev->fflags); + KEVFFL_DUMP(NOTE_DELETE); + KEVFFL_DUMP(NOTE_WRITE); + KEVFFL_DUMP(NOTE_EXTEND); +#if HAVE_NOTE_TRUNCATE + KEVFFL_DUMP(NOTE_TRUNCATE); +#endif + KEVFFL_DUMP(NOTE_ATTRIB); + KEVFFL_DUMP(NOTE_LINK); + KEVFFL_DUMP(NOTE_RENAME); +#if HAVE_NOTE_REVOKE + KEVFFL_DUMP(NOTE_REVOKE); +#endif + buf[strlen(buf) - 1] = ')'; + + return (buf); +} + +char * +kevent_flags_dump(struct kevent *kev) +{ + char *buf; + +#define KEVFL_DUMP(attrib) \ + if (kev->flags & attrib) \ + strncat(buf, #attrib" ", 64); + + if ((buf = calloc(1, 1024)) == NULL) + abort(); + + snprintf(buf, 1024, "flags = %d (", kev->flags); + KEVFL_DUMP(EV_ADD); + KEVFL_DUMP(EV_ENABLE); + KEVFL_DUMP(EV_DISABLE); + KEVFL_DUMP(EV_DELETE); + KEVFL_DUMP(EV_ONESHOT); + KEVFL_DUMP(EV_CLEAR); + KEVFL_DUMP(EV_EOF); + KEVFL_DUMP(EV_ERROR); +#if HAVE_EV_DISPATCH + KEVFL_DUMP(EV_DISPATCH); +#endif +#if HAVE_EV_RECEIPT + KEVFL_DUMP(EV_RECEIPT); +#endif + buf[strlen(buf) - 1] = ')'; + + return (buf); +} + +/* Copied from ../kevent.c kevent_dump() and improved */ +const char * +kevent_to_str(struct kevent *kev) +{ + char buf[512]; + + snprintf(&buf[0], sizeof(buf), + "[ident=%d, filter=%d, %s, %s, data=%d, udata=%p]", + (u_int) kev->ident, + kev->filter, + kevent_flags_dump(kev), + kevent_fflags_dump(kev), + (int) kev->data, + kev->udata); + + return (strdup(buf)); +} + +void +kevent_add(int kqfd, struct kevent *kev, + uintptr_t ident, + short filter, + u_short flags, + u_int fflags, + intptr_t data, + void *udata) +{ + EV_SET(kev, ident, filter, flags, fflags, data, NULL); + if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { + printf("Unable to add the following kevent:\n%s\n", + kevent_to_str(kev)); + err(1, "kevent(): %s", strerror(errno)); + } +} + +void +kevent_cmp(struct kevent *k1, struct kevent *k2) +{ +/* XXX- + Workaround for inconsistent implementation of kevent(2) + */ +#ifdef __FreeBSD__ + if (k1->flags & EV_ADD) + k2->flags |= EV_ADD; +#endif + if (memcmp(k1, k2, sizeof(*k1)) != 0) { + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", + kevent_to_str(k1), kevent_to_str(k2)); + abort(); + } +} + +void +test_begin(const char *func) +{ + if (cur_test_id) + free(cur_test_id); + cur_test_id = strdup(func); + if (!cur_test_id) + err(1, "strdup failed"); + + printf("\n\nTest %d: %s\n", testnum++, func); +} + +void +success(void) +{ + printf("%-70s %s\n", cur_test_id, "passed"); + free(cur_test_id); + cur_test_id = NULL; +} + +void +test_kqueue(void) +{ + test_begin("kqueue()"); + if ((kqfd = kqueue()) < 0) + err(1, "kqueue()"); + test_no_kevents(); + success(); +} + +void +test_kqueue_close(void) +{ + test_begin("close(kq)"); + if (close(kqfd) < 0) + err(1, "close()"); + success(); +} + +int +main(int argc, char **argv) +{ + int test_proc = 0; /* XXX-FIXME */ + int test_socket = 1; + int test_signal = 1; + int test_vnode = 1; + int test_timer = 1; + int test_user = 1; + + while (argc) { + if (strcmp(argv[0], "--no-proc") == 0) + test_proc = 0; + if (strcmp(argv[0], "--no-socket") == 0) + test_socket = 0; + if (strcmp(argv[0], "--no-timer") == 0) + test_timer = 0; + if (strcmp(argv[0], "--no-signal") == 0) + test_signal = 0; + if (strcmp(argv[0], "--no-vnode") == 0) + test_vnode = 0; + if (strcmp(argv[0], "--no-user") == 0) + test_user = 0; + argv++; + argc--; + } + + test_kqueue(); + test_kqueue_close(); + + if (test_socket) + test_evfilt_read(); + if (test_signal) + test_evfilt_signal(); + if (test_vnode) + test_evfilt_vnode(); +#if HAVE_EVFILT_USER + if (test_user) + test_evfilt_user(); +#endif + if (test_timer) + test_evfilt_timer(); + if (test_proc) + test_evfilt_proc(); + + printf("\n---\n" + "+OK All %d tests completed.\n", testnum - 1); + return (0); +} Added: head/tools/regression/kqueue/proc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/proc.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * 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$ + */ + +#include "common.h" + +static int sigusr1_caught = 0; + +int kqfd; + +static void +sig_handler(int signum) +{ + sigusr1_caught = 1; +} + +static void +add_and_delete(void) +{ + struct kevent kev; + pid_t pid; + + /* Create a child that waits to be killed and then exits */ + pid = fork(); + if (pid == 0) { + pause(); + exit(2); + } + printf(" -- child created (pid %d)\n", (int) pid); + + test_begin("kevent(EVFILT_PROC, EV_ADD)"); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD, 0, 0, NULL); + test_no_kevents(); + + success(); + + test_begin("kevent(EVFILT_PROC, EV_DELETE)"); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_DELETE, 0, 0, NULL); + if (kill(pid, SIGKILL) < 0) + err(1, "kill"); + sleep(1); + test_no_kevents(); + + success(); + +} + +static void +event_trigger(void) +{ + struct kevent kev; + pid_t pid; + + test_begin("kevent(EVFILT_PROC, wait)"); + + /* Create a child that waits to be killed and then exits */ + pid = fork(); + if (pid == 0) { + pause(); + printf(" -- child caught signal, exiting\n"); + exit(2); + } + printf(" -- child created (pid %d)\n", (int) pid); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD, 0, 0, NULL); + + /* Cause the child to exit, then retrieve the event */ + printf(" -- killing process %d\n", (int) pid); + if (kill(pid, SIGUSR1) < 0) + err(1, "kill"); + kevent_cmp(&kev, kevent_get(kqfd)); + test_no_kevents(); + + success(); +} + +#ifdef TODO +void +test_kevent_signal_disable(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_DISABLE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_DISABLE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGKILL) < 0) + err(1, "kill"); + + test_no_kevents(); + + success(); +} + +void +test_kevent_signal_enable(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_ENABLE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_ENABLE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + kev.flags = EV_ADD | EV_CLEAR; +#if LIBKQUEUE + kev.data = 1; /* WORKAROUND */ +#else + kev.data = 2; // one extra time from test_kevent_signal_disable() +#endif + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Delete the watch */ + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_signal_del(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_DELETE)"; + struct kevent kev; + + test_begin(test_id); + + /* Delete the kevent */ + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_DELETE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + test_no_kevents(); + success(); +} + +void +test_kevent_signal_oneshot(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_ONESHOT)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_ADD | EV_ONESHOT, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + kev.flags |= EV_CLEAR; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Send another one and make sure we get no events */ + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + test_no_kevents(); + + success(); +} +#endif + +void +test_evfilt_proc() +{ + kqfd = kqueue(); + + signal(SIGUSR1, sig_handler); + + add_and_delete(); + event_trigger(); + + signal(SIGUSR1, SIG_DFL); + +#if TODO + test_kevent_signal_add(); + test_kevent_signal_del(); + test_kevent_signal_get(); + test_kevent_signal_disable(); + test_kevent_signal_enable(); + test_kevent_signal_oneshot(); +#endif + close(kqfd); +} Added: head/tools/regression/kqueue/read.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/read.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * 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$ + */ + +#include "common.h" + +int kqfd; +int sockfd[2]; + +static void +kevent_socket_drain(void) +{ + char buf[1]; + + /* Drain the read buffer, then make sure there are no more events. */ + puts("draining the read buffer"); + if (read(sockfd[0], &buf[0], 1) < 1) + err(1, "read(2)"); +} + +static void +kevent_socket_fill(void) +{ + puts("filling the read buffer"); + if (write(sockfd[1], ".", 1) < 1) + err(1, "write(2)"); +} + + +void +test_kevent_socket_add(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_ADD)"; + struct kevent kev; + + test_begin(test_id); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_get(void) +{ + const char *test_id = "kevent(EVFILT_READ) wait"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + kevent_socket_drain(); + test_no_kevents(); + + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_clear(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_CLEAR)"; + struct kevent kev; + + test_begin(test_id); + + test_no_kevents(); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + kevent_socket_fill(); + + kev.data = 2; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* We filled twice, but drain once. Edge-triggered would not generate + additional events. + */ + kevent_socket_drain(); + test_no_kevents(); + + kevent_socket_drain(); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_disable_and_enable(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DISABLE)"; + struct kevent kev; + + test_begin(test_id); + + /* Add an event, then disable it. */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DISABLE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + test_no_kevents(); + + /* Re-enable the knote, then see if an event is generated */ + kev.flags = EV_ENABLE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + kev.flags = EV_ADD; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + kevent_socket_drain(); + + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_del(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DELETE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + test_no_kevents(); + kevent_socket_drain(); + + success(); +} + +void +test_kevent_socket_oneshot(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_ONESHOT)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + puts("-- getting one event"); + kevent_socket_fill(); + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + puts("-- checking knote disabled"); + test_no_kevents(); + + /* Try to delete the knote, it should already be deleted */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) == 0) + err(1, "%s", test_id); + + kevent_socket_drain(); + + success(); +} + + +#if HAVE_EV_DISPATCH +void +test_kevent_socket_dispatch(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DISPATCH)"; + + test_begin(test_id); + + struct kevent kev; + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_DISPATCH, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + /* The event will occur only once, even though EV_CLEAR is not + specified. */ + kevent_socket_fill(); + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + test_no_kevents(); + + /* Since the knote is disabled, the EV_DELETE operation succeeds. */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_drain(); + + success(); +} +#endif /* HAVE_EV_DISPATCH */ + +#if BROKEN +void +test_kevent_socket_lowat(void) +{ + const char *test_id = "kevent(EVFILT_READ, NOTE_LOWAT)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote, setting low watermark to 2 bytes"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_ONESHOT, NOTE_LOWAT, 2, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + puts("-- checking that one byte does not trigger an event.."); + kevent_socket_fill(); + test_no_kevents(); + + puts("-- checking that two bytes triggers an event.."); + kevent_socket_fill(); + if (kevent(kqfd, NULL, 0, &kev, 1, NULL) != 1) + err(1, "%s", test_id); + KEV_CMP(kev, sockfd[0], EVFILT_READ, 0); + test_no_kevents(); + + kevent_socket_drain(); + kevent_socket_drain(); + + success(); +} +#endif + +void +test_kevent_socket_eof(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_EOF)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + if (close(sockfd[1]) < 0) + err(1, "close(2)"); + + kev.flags |= EV_EOF; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Delete the watch */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_evfilt_read() +{ + /* Create a connected pair of full-duplex sockets for testing socket events */ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockfd) < 0) + abort(); + + kqfd = kqueue(); + test_kevent_socket_add(); + test_kevent_socket_del(); + test_kevent_socket_get(); + test_kevent_socket_disable_and_enable(); + test_kevent_socket_oneshot(); + test_kevent_socket_clear(); +#if HAVE_EV_DISPATCH + test_kevent_socket_dispatch(); +#endif + test_kevent_socket_eof(); + close(kqfd); +} Added: head/tools/regression/kqueue/signal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/signal.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * 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$ + */ + +#include "common.h" + +int kqfd; + +void +test_kevent_signal_add(void) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:27:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D64381065780; Sun, 13 Dec 2009 20:27:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64A88FC1B; Sun, 13 Dec 2009 20:27: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 nBDKRxxS096364; Sun, 13 Dec 2009 20:27:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKRxHp096362; Sun, 13 Dec 2009 20:27:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912132027.nBDKRxHp096362@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 20:27: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: r200484 - head/sys/mips/adm5120 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:27:59 -0000 Author: bz Date: Sun Dec 13 20:27:59 2009 New Revision: 200484 URL: http://svn.freebsd.org/changeset/base/200484 Log: Make admsw(4) compile again fixing typos and adding the missing variable after r199762. Modified: head/sys/mips/adm5120/if_admsw.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Sun Dec 13 20:27:46 2009 (r200483) +++ head/sys/mips/adm5120/if_admsw.c Sun Dec 13 20:27:59 2009 (r200484) @@ -745,10 +745,11 @@ static void admsw_watchdog(void *arg) { struct admsw_softc *sc = arg; + struct ifnet *ifp; int vlan; - callout_reset(&sc->watchdog, hz, admsw_watchdog, sc); - if (sc->sc_timer == 0 || --sc->timer > 0) + callout_reset(&sc->sc_watchdog, hz, admsw_watchdog, sc); + if (sc->sc_timer == 0 || --sc->sc_timer > 0) return; /* Check if an interrupt was lost. */ @@ -775,6 +776,8 @@ admsw_watchdog(void *arg) admsw_stop(sc->sc_ifnet[vlan], 0); admsw_init(sc); + ifp = sc->sc_ifnet[0]; + /* Try to get more packets going. */ admsw_start(ifp); } From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:36:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FBE7106566B; Sun, 13 Dec 2009 20:36:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F26F8FC0C; Sun, 13 Dec 2009 20:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDKahSs096566; Sun, 13 Dec 2009 20:36:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKahGa096564; Sun, 13 Dec 2009 20:36:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912132036.nBDKahGa096564@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 20:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200485 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:36:43 -0000 Author: marius Date: Sun Dec 13 20:36:42 2009 New Revision: 200485 URL: http://svn.freebsd.org/changeset/base/200485 Log: Only set ATA_CHECKS_CABLE for chip versions that actually support cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions >= 0xc7. MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 20:27:59 2009 (r200484) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 20:36:42 2009 (r200485) @@ -180,7 +180,8 @@ ata_ali_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - ch->flags |= ATA_CHECKS_CABLE; + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) + ch->flags |= ATA_CHECKS_CABLE; /* older chips can't do 48bit DMA transfers */ if (ctlr->chip->chiprev <= 0xc4) ch->flags |= ATA_NO_48BIT_DMA; From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:52:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE29F106568D for ; Sun, 13 Dec 2009 20:52:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 648BB8FC17 for ; Sun, 13 Dec 2009 20:52:37 +0000 (UTC) Received: (qmail 24881 invoked by uid 399); 13 Dec 2009 20:52:36 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 13 Dec 2009 20:52:36 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B255419.3090301@FreeBSD.org> Date: Sun, 13 Dec 2009 12:52:41 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:52:37 -0000 Erik Trulsson wrote: > On Sun, Dec 13, 2009 at 01:03:42PM +0100, Dag-Erling Smørgrav wrote: >> Doug Barton writes: >>> To be clear, I am NOT asking for a backout ... IIRC in the thread that >>> discussed this issue there were quite a few people who thought that >>> FreeBSD not clearing the screen was a POLA violation since that's what >>> linux does, and it's what most people are used to. >> It's not "what Linux does", it's what xterm does. Xterm did not >> originate with Linux; in fact, it predates Linux by about ten years. >> FreeBSD's xterm entry was deliberately crippled to lie about xterm's >> capabilities. > > Actually it is when the 'ti'/'te' termcap entries are *provided* that one > lies about xterm's capabilities. Thanks for the lesson in terminal history. :) What I meant by "what linux does" is "the default behavior in linux is to clear the screen, which is what users coming from a linux background are accustomed to." Who is lying about xterm's capabilities is not relevant here (although I'm serious that it's kind of interesting). Ed, what I had in mind for a fix was something more like this: http://people.freebsd.org/~dougb/termcap.src-diff.txt That restores the default behavior and gives our linuxy friends an easy way to get the behavior they are familiar with. If folks agree that this is the right way to go I can also write up a section for termcap.5. I did not change the xterm-clone definitions since I'm not sure what the previous default for them was, but that can easily be done as well. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 23:56:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDCD106566B; Sun, 13 Dec 2009 23:56:46 +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 5CC498FC15; Sun, 13 Dec 2009 23:56: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 nBDNuk9l001036; Sun, 13 Dec 2009 23:56:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDNukx7001034; Sun, 13 Dec 2009 23:56:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912132356.nBDNukx7001034@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Dec 2009 23:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200487 - stable/8/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 23:56:46 -0000 Author: dougb Date: Sun Dec 13 23:56:46 2009 New Revision: 200487 URL: http://svn.freebsd.org/changeset/base/200487 Log: MFC r200377: Update to the December 12, 2008 version of this file. The one substantive change is to add the IPv6 address of L. The other changes are all CAPS LOCK related. Modified: stable/8/etc/namedb/named.root Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/namedb/named.root ============================================================================== --- stable/8/etc/namedb/named.root Sun Dec 13 23:27:08 2009 (r200486) +++ stable/8/etc/namedb/named.root Sun Dec 13 23:56:46 2009 (r200487) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 +; last update: Dec 12, 2008 +; related version of root zone: 2008121200 ; ; formerly NS.INTERNIC.NET ; @@ -22,68 +22,69 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; -; formerly NS1.ISI.EDU +; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; -; formerly C.PSI.NET +; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; -; formerly TERP.UMD.EDU +; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; -; formerly NS.NASA.GOV +; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; -; formerly NS.ISC.ORG +; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; -; formerly NS.NIC.DDN.MIL +; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; -; formerly AOS.ARL.ARMY.MIL +; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; -; formerly NIC.NORDU.NET +; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; -; operated by RIPE NCC +; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; -; operated by ICANN +; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; -; operated by WIDE +; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 23:58:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FC4D106566B; Sun, 13 Dec 2009 23:58:05 +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 2D9E68FC18; Sun, 13 Dec 2009 23:58: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 nBDNw5lH001119; Sun, 13 Dec 2009 23:58:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDNw5hn001117; Sun, 13 Dec 2009 23:58:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912132358.nBDNw5hn001117@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Dec 2009 23:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200488 - stable/7/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 23:58:05 -0000 Author: dougb Date: Sun Dec 13 23:58:04 2009 New Revision: 200488 URL: http://svn.freebsd.org/changeset/base/200488 Log: MFC r200377: Update to the December 12, 2008 version of this file. The one substantive change is to add the IPv6 address of L. The other changes are all CAPS LOCK related. Modified: stable/7/etc/namedb/named.root Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/namedb/named.root ============================================================================== --- stable/7/etc/namedb/named.root Sun Dec 13 23:56:46 2009 (r200487) +++ stable/7/etc/namedb/named.root Sun Dec 13 23:58:04 2009 (r200488) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 +; last update: Dec 12, 2008 +; related version of root zone: 2008121200 ; ; formerly NS.INTERNIC.NET ; @@ -22,68 +22,69 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; -; formerly NS1.ISI.EDU +; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; -; formerly C.PSI.NET +; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; -; formerly TERP.UMD.EDU +; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; -; formerly NS.NASA.GOV +; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; -; formerly NS.ISC.ORG +; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; -; formerly NS.NIC.DDN.MIL +; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; -; formerly AOS.ARL.ARMY.MIL +; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; -; formerly NIC.NORDU.NET +; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; -; operated by RIPE NCC +; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; -; operated by ICANN +; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; -; operated by WIDE +; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 00:12:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E33BB1065670; Mon, 14 Dec 2009 00:12:07 +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 D170C8FC15; Mon, 14 Dec 2009 00:12: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 nBE0C75E001539; Mon, 14 Dec 2009 00:12:07 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0C7Pc001538; Mon, 14 Dec 2009 00:12:07 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912140012.nBE0C7Pc001538@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 00:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200489 - stable/6/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:12:08 -0000 Author: dougb Date: Mon Dec 14 00:12:07 2009 New Revision: 200489 URL: http://svn.freebsd.org/changeset/base/200489 Log: Mergeinfo for these files has already been included in etc/ so forcibly delete it from the files themselves. Modified: Directory Properties: stable/6/etc/Makefile (props changed) stable/6/etc/amd.map (props changed) stable/6/etc/apmd.conf (props changed) stable/6/etc/auth.conf (props changed) stable/6/etc/bluetooth/ (props changed) stable/6/etc/crontab (props changed) stable/6/etc/csh.cshrc (props changed) stable/6/etc/csh.login (props changed) stable/6/etc/csh.logout (props changed) stable/6/etc/defaults/ (props changed) stable/6/etc/devd.conf (props changed) stable/6/etc/devfs.conf (props changed) stable/6/etc/dhclient.conf (props changed) stable/6/etc/disktab (props changed) stable/6/etc/etc.alpha/ (props changed) stable/6/etc/etc.amd64/ (props changed) stable/6/etc/etc.arm/ (props changed) stable/6/etc/etc.i386/ (props changed) stable/6/etc/etc.ia64/ (props changed) stable/6/etc/etc.powerpc/ (props changed) stable/6/etc/etc.sparc64/ (props changed) stable/6/etc/fbtab (props changed) stable/6/etc/freebsd-update.conf (props changed) stable/6/etc/ftpusers (props changed) stable/6/etc/gettytab (props changed) stable/6/etc/group (props changed) stable/6/etc/hosts (props changed) stable/6/etc/hosts.allow (props changed) stable/6/etc/hosts.equiv (props changed) stable/6/etc/hosts.lpd (props changed) stable/6/etc/inetd.conf (props changed) stable/6/etc/isdn/ (props changed) stable/6/etc/login.access (props changed) stable/6/etc/login.conf (props changed) stable/6/etc/mac.conf (props changed) stable/6/etc/mail/ (props changed) stable/6/etc/man.alias (props changed) stable/6/etc/master.passwd (props changed) stable/6/etc/minfree (props changed) stable/6/etc/motd (props changed) stable/6/etc/mtree/ (props changed) stable/6/etc/namedb/ (props changed) stable/6/etc/netconfig (props changed) stable/6/etc/netstart (props changed) stable/6/etc/network.subr (props changed) stable/6/etc/networks (props changed) stable/6/etc/newsyslog.conf (props changed) stable/6/etc/nls.alias (props changed) stable/6/etc/nsmb.conf (props changed) stable/6/etc/opieaccess (props changed) stable/6/etc/pam.d/ (props changed) stable/6/etc/pccard_ether (props changed) stable/6/etc/periodic/ (props changed) stable/6/etc/pf.conf (props changed) stable/6/etc/pf.os (props changed) stable/6/etc/phones (props changed) stable/6/etc/portsnap.conf (props changed) stable/6/etc/ppp/ (props changed) stable/6/etc/printcap (props changed) stable/6/etc/profile (props changed) stable/6/etc/protocols (props changed) stable/6/etc/rc (props changed) stable/6/etc/rc.bsdextended (props changed) stable/6/etc/rc.d/ (props changed) stable/6/etc/rc.firewall (props changed) stable/6/etc/rc.firewall6 (props changed) stable/6/etc/rc.initdiskless (props changed) stable/6/etc/rc.resume (props changed) stable/6/etc/rc.sendmail (props changed) stable/6/etc/rc.shutdown (props changed) stable/6/etc/rc.subr (props changed) stable/6/etc/rc.suspend (props changed) stable/6/etc/remote (props changed) stable/6/etc/root/ (props changed) stable/6/etc/rpc (props changed) stable/6/etc/sendmail/ (props changed) stable/6/etc/services (props changed) stable/6/etc/shells (props changed) stable/6/etc/snmpd.config (props changed) stable/6/etc/sysctl.conf (props changed) stable/6/etc/syslog.conf (props changed) stable/6/etc/termcap.small (props changed) stable/6/etc/usbd.conf (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 00:15:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741E61065670; Mon, 14 Dec 2009 00:15:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629258FC17; Mon, 14 Dec 2009 00:15: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 nBE0FufE001687; Mon, 14 Dec 2009 00:15:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0Fups001685; Mon, 14 Dec 2009 00:15:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140015.nBE0Fups001685@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200490 - stable/8/sys/bsm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:15:56 -0000 Author: rwatson Date: Mon Dec 14 00:15:56 2009 New Revision: 200490 URL: http://svn.freebsd.org/changeset/base/200490 Log: Merge r197624 from head to stable/8: Add audit events for process descriptor system calls, which will appear in a future OpenBSM release. Sponsored by: Google Obtained from: TrustedBSD Project Modified: stable/8/sys/bsm/audit_kevents.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/bsm/audit_kevents.h ============================================================================== --- stable/8/sys/bsm/audit_kevents.h Mon Dec 14 00:12:07 2009 (r200489) +++ stable/8/sys/bsm/audit_kevents.h Mon Dec 14 00:15:56 2009 (r200490) @@ -598,6 +598,10 @@ #define AUE_FSCTL 43194 /* Darwin. */ #define AUE_FFSCTL 43195 /* Darwin. */ #define AUE_LPATHCONF 43196 /* FreeBSD. */ +#define AUE_PDFORK 43197 /* FreeBSD. */ +#define AUE_PDKILL 43198 /* FreeBSD. */ +#define AUE_PDGETPID 43199 /* FreeBSD. */ +#define AUE_PDWAIT 43200 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 00:19:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66D71065670; Mon, 14 Dec 2009 00:19:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB0018FC17; Mon, 14 Dec 2009 00:19: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 nBE0JVv4001798; Mon, 14 Dec 2009 00:19:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0JV2U001795; Mon, 14 Dec 2009 00:19:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140019.nBE0JV2U001795@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200491 - in stable/8/sys: compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:19:32 -0000 Author: rwatson Date: Mon Dec 14 00:19:31 2009 New Revision: 200491 URL: http://svn.freebsd.org/changeset/base/200491 Log: Merge r197636 from head to stable/8: Reserve system call numbers for Capsicum security framework capabilities, capability mode, and process descriptors: cap_new, cap_getrights, cap_enter, cap_getmode, pdfork, pdkill, pdgetpid, and pdwait. Obtained from: TrustedBSD Project Sponsored by: Google Modified: stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/syscalls.master Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Mon Dec 14 00:15:56 2009 (r200490) +++ stable/8/sys/compat/freebsd32/syscalls.master Mon Dec 14 00:19:31 2009 (r200491) @@ -905,3 +905,11 @@ 512 AUE_SHMCTL STD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } +514 AUE_CAP_NEW UNIMPL cap_new +515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights +516 AUE_CAP_ENTER UNIMPL cap_enter +517 AUE_CAP_GETMODE UNIMPL cap_getmode +518 AUE_PDFORK UNIMPL pdfork +519 AUE_PDKILL UNIMPL pdkill +520 AUE_PDGETPID UNIMPL pdgetpid +521 AUE_PDWAIT UNIMPL pdwait Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Mon Dec 14 00:15:56 2009 (r200490) +++ stable/8/sys/kern/syscalls.master Mon Dec 14 00:19:31 2009 (r200491) @@ -911,5 +911,13 @@ 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } +514 AUE_CAP_NEW UNIMPL cap_new +515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights +516 AUE_CAP_ENTER UNIMPL cap_enter +517 AUE_CAP_GETMODE UNIMPL cap_getmode +518 AUE_PDFORK UNIMPL pdfork +519 AUE_PDKILL UNIMPL pdkill +520 AUE_PDGETPID UNIMPL pdgetpid +521 AUE_PDWAIT UNIMPL pdwait ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 00:20:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5791C106566C; Mon, 14 Dec 2009 00:20:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446D38FC17; Mon, 14 Dec 2009 00:20: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 nBE0KnYG001880; Mon, 14 Dec 2009 00:20:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0KmH9001870; Mon, 14 Dec 2009 00:20:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140020.nBE0KmH9001870@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200492 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:20:49 -0000 Author: rwatson Date: Mon Dec 14 00:20:48 2009 New Revision: 200492 URL: http://svn.freebsd.org/changeset/base/200492 Log: Regenerate sysent files after r200491. Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #define FREEBSD32_SYS_syscall 0 @@ -386,4 +386,4 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 -#define FREEBSD32_SYS_MAXSYSCALL 514 +#define FREEBSD32_SYS_MAXSYSCALL 522 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ const char *freebsd32_syscallnames[] = { @@ -521,4 +521,12 @@ const char *freebsd32_syscallnames[] = { "freebsd32_msgctl", /* 511 = freebsd32_msgctl */ "freebsd32_shmctl", /* 512 = freebsd32_shmctl */ "lpathconf", /* 513 = lpathconf */ + "#514", /* 514 = cap_new */ + "#515", /* 515 = cap_getrights */ + "#516", /* 516 = cap_enter */ + "#517", /* 517 = cap_getmode */ + "#518", /* 518 = pdfork */ + "#519", /* 519 = pdkill */ + "#520", /* 520 = pdgetpid */ + "#521", /* 521 = pdwait */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #include "opt_compat.h" @@ -558,4 +558,12 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0, 0 }, /* 511 = freebsd32_msgctl */ { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0, 0 }, /* 512 = freebsd32_shmctl */ { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 }, /* 513 = lpathconf */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 514 = cap_new */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 515 = cap_getrights */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 516 = cap_enter */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 518 = pdfork */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/kern/init_sysent.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #include "opt_compat.h" @@ -548,4 +548,12 @@ struct sysent sysent[] = { { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 511 = msgctl */ { AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 512 = shmctl */ { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 }, /* 513 = lpathconf */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 514 = cap_new */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 515 = cap_getrights */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 516 = cap_enter */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 518 = pdfork */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/kern/syscalls.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ const char *syscallnames[] = { @@ -521,4 +521,12 @@ const char *syscallnames[] = { "msgctl", /* 511 = msgctl */ "shmctl", /* 512 = shmctl */ "lpathconf", /* 513 = lpathconf */ + "#514", /* 514 = cap_new */ + "#515", /* 515 = cap_getrights */ + "#516", /* 516 = cap_enter */ + "#517", /* 517 = cap_getmode */ + "#518", /* 518 = pdfork */ + "#519", /* 519 = pdkill */ + "#520", /* 520 = pdgetpid */ + "#521", /* 521 = pdwait */ }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/syscall.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #define SYS_syscall 0 @@ -428,4 +428,4 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 -#define SYS_MAXSYSCALL 514 +#define SYS_MAXSYSCALL 522 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/syscall.mk Mon Dec 14 00:20:48 2009 (r200492) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz +# created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson MIASM = \ syscall.o \ exit.o \ Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/sysproto.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:05:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1D81065679; Mon, 14 Dec 2009 01:05:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187868FC31; Mon, 14 Dec 2009 01:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE14xNC002991; Mon, 14 Dec 2009 01:04:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE14xPp002988; Mon, 14 Dec 2009 01:04:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912140104.nBE14xPp002988@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 01:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200493 - stable/7/contrib/expat/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:05:00 -0000 Author: delphij Date: Mon Dec 14 01:04:59 2009 New Revision: 200493 URL: http://svn.freebsd.org/changeset/base/200493 Log: MFC r200392: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 Modified: stable/7/contrib/expat/lib/xmlparse.c stable/7/contrib/expat/lib/xmltok_impl.c Directory Properties: stable/7/contrib/expat/ (props changed) Modified: stable/7/contrib/expat/lib/xmlparse.c ============================================================================== --- stable/7/contrib/expat/lib/xmlparse.c Mon Dec 14 00:20:48 2009 (r200492) +++ stable/7/contrib/expat/lib/xmlparse.c Mon Dec 14 01:04:59 2009 (r200493) @@ -3168,7 +3168,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: stable/7/contrib/expat/lib/xmltok_impl.c ============================================================================== --- stable/7/contrib/expat/lib/xmltok_impl.c Mon Dec 14 00:20:48 2009 (r200492) +++ stable/7/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:04:59 2009 (r200493) @@ -1741,7 +1741,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:05:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C1610656A3; Mon, 14 Dec 2009 01:05:40 +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 C810D8FC30; Mon, 14 Dec 2009 01:05: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 nBE15eWM003068; Mon, 14 Dec 2009 01:05:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE15eY3003065; Mon, 14 Dec 2009 01:05:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912140105.nBE15eY3003065@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 01:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200494 - stable/8/contrib/expat/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:05:41 -0000 Author: delphij Date: Mon Dec 14 01:05:40 2009 New Revision: 200494 URL: http://svn.freebsd.org/changeset/base/200494 Log: MFC r200392: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 Modified: stable/8/contrib/expat/lib/xmlparse.c stable/8/contrib/expat/lib/xmltok_impl.c Directory Properties: stable/8/contrib/expat/ (props changed) Modified: stable/8/contrib/expat/lib/xmlparse.c ============================================================================== --- stable/8/contrib/expat/lib/xmlparse.c Mon Dec 14 01:04:59 2009 (r200493) +++ stable/8/contrib/expat/lib/xmlparse.c Mon Dec 14 01:05:40 2009 (r200494) @@ -3725,7 +3725,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: stable/8/contrib/expat/lib/xmltok_impl.c ============================================================================== --- stable/8/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:04:59 2009 (r200493) +++ stable/8/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:05:40 2009 (r200494) @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:06:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2626E106568D; Mon, 14 Dec 2009 01:06:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 142678FC3A; Mon, 14 Dec 2009 01:06: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 nBE16LeM003140; Mon, 14 Dec 2009 01:06:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE16LoZ003137; Mon, 14 Dec 2009 01:06:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912140106.nBE16LoZ003137@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 01:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200495 - stable/6/contrib/expat/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:06:22 -0000 Author: delphij Date: Mon Dec 14 01:06:21 2009 New Revision: 200495 URL: http://svn.freebsd.org/changeset/base/200495 Log: MFC r200392: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 Modified: stable/6/contrib/expat/lib/xmlparse.c stable/6/contrib/expat/lib/xmltok_impl.c Directory Properties: stable/6/contrib/expat/ (props changed) Modified: stable/6/contrib/expat/lib/xmlparse.c ============================================================================== --- stable/6/contrib/expat/lib/xmlparse.c Mon Dec 14 01:05:40 2009 (r200494) +++ stable/6/contrib/expat/lib/xmlparse.c Mon Dec 14 01:06:21 2009 (r200495) @@ -3168,7 +3168,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: stable/6/contrib/expat/lib/xmltok_impl.c ============================================================================== --- stable/6/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:05:40 2009 (r200494) +++ stable/6/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:06:21 2009 (r200495) @@ -1741,7 +1741,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:06:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6882C106566C; Mon, 14 Dec 2009 01:06:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568838FC22; Mon, 14 Dec 2009 01:06: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 nBE16ttW003215; Mon, 14 Dec 2009 01:06:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE16tn5003212; Mon, 14 Dec 2009 01:06:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912140106.nBE16tn5003212@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 01:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200496 - stable/5/contrib/expat/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:06:55 -0000 Author: delphij Date: Mon Dec 14 01:06:55 2009 New Revision: 200496 URL: http://svn.freebsd.org/changeset/base/200496 Log: MFC r200392: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 Modified: stable/5/contrib/expat/lib/xmlparse.c stable/5/contrib/expat/lib/xmltok_impl.c Directory Properties: stable/5/contrib/expat/ (props changed) Modified: stable/5/contrib/expat/lib/xmlparse.c ============================================================================== --- stable/5/contrib/expat/lib/xmlparse.c Mon Dec 14 01:06:21 2009 (r200495) +++ stable/5/contrib/expat/lib/xmlparse.c Mon Dec 14 01:06:55 2009 (r200496) @@ -3168,7 +3168,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: stable/5/contrib/expat/lib/xmltok_impl.c ============================================================================== --- stable/5/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:06:21 2009 (r200495) +++ stable/5/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:06:55 2009 (r200496) @@ -1741,7 +1741,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:10:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA51106566C; Mon, 14 Dec 2009 01:10: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 7872A8FC1D; Mon, 14 Dec 2009 01:10: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 nBE1A5EK003330; Mon, 14 Dec 2009 01:10:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1A5d3003328; Mon, 14 Dec 2009 01:10:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912140110.nBE1A5d3003328@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 01:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200497 - stable/8/contrib/bind9/lib/isc/ia64/include/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:10:05 -0000 Author: marcel Date: Mon Dec 14 01:10:05 2009 New Revision: 200497 URL: http://svn.freebsd.org/changeset/base/200497 Log: MFC rev 200202: Fix Read-After-Write (RAW) dependency violation for ar.ccv in isc_atomic_xadd() and isc_atomic_cmpxchg(). Approved by: dougb@ Modified: stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h ============================================================================== --- stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 14 01:06:55 2009 (r200496) +++ stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 14 01:10:05 2009 (r200497) @@ -41,7 +41,7 @@ isc_atomic_xadd(isc_int32_t *p, isc_int3 for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (swapped), "=m" (*p) : "r" (prev), "r" (swapped), "m" (*p) @@ -84,7 +84,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_i isc_int32_t ret; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (ret), "=m" (*p) : "r" (cmpval), "r" (val), "m" (*p) From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:26:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3D651065670; Mon, 14 Dec 2009 01:26:01 +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 A281C8FC08; Mon, 14 Dec 2009 01:26: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 nBE1Q1Hk003703; Mon, 14 Dec 2009 01:26:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1Q1Zv003701; Mon, 14 Dec 2009 01:26:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912140126.nBE1Q1Zv003701@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 01:26: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: r200498 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:26:01 -0000 Author: marcel Date: Mon Dec 14 01:26:01 2009 New Revision: 200498 URL: http://svn.freebsd.org/changeset/base/200498 Log: Work-around a race condition on ia64 while unlocking a contested lock. The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64, we simply go to the kernel to unlock. The big question is why this is only a race condition on ia64... MFC after: 3 days Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Mon Dec 14 01:10:05 2009 (r200497) +++ head/lib/libthr/thread/thr_umtx.c Mon Dec 14 01:26:01 2009 (r200498) @@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { +#ifndef __ia64__ + /* XXX this logic has a race-condition on ia64. */ if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); } +#endif /* __ia64__ */ return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 01:51:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2A31065693; Mon, 14 Dec 2009 01:51:23 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C26C8FC16; Mon, 14 Dec 2009 01:51: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 nBE1pNFd004341; Mon, 14 Dec 2009 01:51:23 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1pNLA004339; Mon, 14 Dec 2009 01:51:23 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200912140151.nBE1pNLA004339@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 14 Dec 2009 01:51: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: r200499 - head/gnu/lib/libgcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:51:23 -0000 Author: kan Date: Mon Dec 14 01:51:23 2009 New Revision: 200499 URL: http://svn.freebsd.org/changeset/base/200499 Log: Fix one spelling and one copy&paste error in comments. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Mon Dec 14 01:26:01 2009 (r200498) +++ head/gnu/lib/libgcc/Makefile Mon Dec 14 01:51:23 2009 (r200499) @@ -297,7 +297,7 @@ CLEANFILES += cs-*.h option* #----------------------------------------------------------------------- # -# Build additional static libgcc_eh[_p].a librarries. +# Build symbol version map # SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = @@ -316,7 +316,7 @@ CLEANFILES += libgcc.map #----------------------------------------------------------------------- # -# Build additional static libgcc_eh[_p].a librarries. +# Build additional static libgcc_eh[_p].a libraries. # lib${LIB}_eh.a: ${EH_OBJS_T} @${ECHO} building static ${LIB}_eh library From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 02:50:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E38DD106566C; Mon, 14 Dec 2009 02:50:04 +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 D0FFB8FC12; Mon, 14 Dec 2009 02:50:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE2o4oS005609; Mon, 14 Dec 2009 02:50:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE2o4cR005607; Mon, 14 Dec 2009 02:50:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912140250.nBE2o4cR005607@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 02:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200500 - stable/6/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 02:50:05 -0000 Author: dougb Date: Mon Dec 14 02:50:04 2009 New Revision: 200500 URL: http://svn.freebsd.org/changeset/base/200500 Log: MFC r200377: Update to the December 12, 2008 version of this file. The one substantive change is to add the IPv6 address of L. The other changes are all CAPS LOCK related. Modified: stable/6/etc/namedb/named.root Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/namedb/named.root ============================================================================== --- stable/6/etc/namedb/named.root Mon Dec 14 01:51:23 2009 (r200499) +++ stable/6/etc/namedb/named.root Mon Dec 14 02:50:04 2009 (r200500) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 +; last update: Dec 12, 2008 +; related version of root zone: 2008121200 ; ; formerly NS.INTERNIC.NET ; @@ -22,68 +22,69 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; -; formerly NS1.ISI.EDU +; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; -; formerly C.PSI.NET +; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; -; formerly TERP.UMD.EDU +; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; -; formerly NS.NASA.GOV +; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; -; formerly NS.ISC.ORG +; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; -; formerly NS.NIC.DDN.MIL +; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; -; formerly AOS.ARL.ARMY.MIL +; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; -; formerly NIC.NORDU.NET +; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; -; operated by RIPE NCC +; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; -; operated by ICANN +; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; -; operated by WIDE +; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 04:50:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BB6E1065670; Mon, 14 Dec 2009 04:50:07 +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 8E8168FC13; Mon, 14 Dec 2009 04:50:06 +0000 (UTC) Received: from lstewart-laptop.caia.swin.edu.au (lstewart-laptop.caia.swin.edu.au [136.186.229.148]) (authenticated bits=0) by lauren.room52.net (8.14.3/8.14.3) with ESMTP id nBE4nv9r024671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 15:49:58 +1100 (EST) (envelope-from lstewart@freebsd.org) Message-ID: <4B25C3EF.5010009@freebsd.org> Date: Mon, 14 Dec 2009 15:49:51 +1100 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: Jack F Vogel References: <200912081854.nB8IsbrP096592@svn.freebsd.org> In-Reply-To: <200912081854.nB8IsbrP096592@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lauren.room52.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 04:50:07 -0000 [picking a recent e1000 commit] Hi Jack, I'm getting the following panic on head r200376 on my HP DC7800 work desktop: mtx_lock() of spin mutex &dev_spec->swflag_mutex @ /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 I don't experience the panic with an 8.0-RELEASE kernel. Anything obviously wrong with that line of code as far as you're concerned, or do I need to dig some more detail out? Debugging with this system is painful, hence the initial hand transcribed minimal detail, but if you need more info I'll try figure out how to get you what you need. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sun Dec 13 20:51:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00251065676; Sun, 13 Dec 2009 20:51:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5BF8FC16; Sun, 13 Dec 2009 20:51:59 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id CE9411CC5D; Sun, 13 Dec 2009 21:51:58 +0100 (CET) Date: Sun, 13 Dec 2009 21:51:58 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20091213205158.GT64905@hoeg.nl> References: <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> <20091213182256.GA4117@falcon.midgard.homeip.net> <4B255253.9020904@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WXyDHq/2XkIy2Hyf" Content-Disposition: inline In-Reply-To: <4B255253.9020904@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Mon, 14 Dec 2009 05:29:24 +0000 Cc: Erik Trulsson , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , Ronald Klop , svn-src-head@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:51:59 -0000 --WXyDHq/2XkIy2Hyf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Doug Barton wrote: > what I had in mind for a fix was something more like this: > http://people.freebsd.org/~dougb/termcap.src-diff.txt Looks okay. Unfortunately it causes us to massively deviate from the version shipped with xterm, but I guess that's the only solution. Could you write a similar patch for termcap.small and commit it to SVN? Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --WXyDHq/2XkIy2Hyf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkslU+4ACgkQ52SDGA2eCwVxMgCdFyimeLzC0jhtw1NomxOpJkO2 i+8AniyDgnnOhOtUL4We0iyLyni0hFpz =Gmau -----END PGP SIGNATURE----- --WXyDHq/2XkIy2Hyf-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 07:18:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9141B1065693; Mon, 14 Dec 2009 07:18:31 +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 8050F8FC17; Mon, 14 Dec 2009 07:18: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 nBE7IVx9012139; Mon, 14 Dec 2009 07:18:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE7IVQP012135; Mon, 14 Dec 2009 07:18:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912140718.nBE7IVQP012135@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 07:18: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: r200503 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 07:18:31 -0000 Author: dougb Date: Mon Dec 14 07:18:31 2009 New Revision: 200503 URL: http://svn.freebsd.org/changeset/base/200503 Log: Revert the xterm terminal behavior to NOT clear the screen after exiting a pager, vi, etc. Add some example xterm*-clear entries to the termcap files to make it easier for people to enable that behavior. Document the examples in the man page to make them easier to find. Modified: head/etc/termcap.small head/share/termcap/termcap.5 head/share/termcap/termcap.src Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Mon Dec 14 03:54:47 2009 (r200502) +++ head/etc/termcap.small Mon Dec 14 07:18:31 2009 (r200503) @@ -312,7 +312,7 @@ xterm-basic|modern xterm common:\ :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ - :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :so=\E[7m:sr=\EM:st=\EH:\ :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # # This is the only entry which you should have to customize, since "xterm" @@ -320,3 +320,8 @@ xterm-basic|modern xterm common:\ # color_xterm and rxvt. xterm|X11 terminal emulator:\ :tc=xterm-new: +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +xterm-clear:\ + :te=\E[?1049l:ti=\E[?1049h:\ + :tc=xterm-new: Modified: head/share/termcap/termcap.5 ============================================================================== --- head/share/termcap/termcap.5 Mon Dec 14 03:54:47 2009 (r200502) +++ head/share/termcap/termcap.5 Mon Dec 14 07:18:31 2009 (r200503) @@ -53,7 +53,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 16, 1994 +.Dd December 13, 2009 .Dt TERMCAP 5 .Os .Sh NAME @@ -1999,6 +1999,22 @@ Unfortunately, due to lack of a definiti only .Xr terminfo 5 supports these capabilities. +.Pp +For the +.Xr xterm 1 +terminal emulator the traditional behavior in +FreeBSD when exiting a pager such as +.Xr less 1 +or +.Xr more 1 , +or an editor such as +.Xr vi 1 +is NOT to clear the screen after the program exits. +If you prefer to clear the screen there are a number of +.Dq xterm-clear +entries that add this capability in the +.Nm +file that you can use directly, or as examples. .Ss Glitches and Braindamage Hazeltine terminals, which do not allow `~' characters to be displayed, should indicate @@ -2105,6 +2121,7 @@ Hash database file containing terminal d .Xr tset 1 , .Xr ul 1 , .Xr vi 1 , +.Xr xterm 1 , .Xr ncurses 3 , .Xr printf 3 , .Xr termcap 3 , Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Mon Dec 14 03:54:47 2009 (r200502) +++ head/share/termcap/termcap.src Mon Dec 14 07:18:31 2009 (r200503) @@ -2800,7 +2800,12 @@ SW|screen-w|VT 100/ANSI X3.64 virtual te # # I checked the limits using ncurses "captoinfo -CrTUvx", which prints # the resolved length of each entry in a comment at the end - T.Dickey + +# Add the capability to "clear the screen" after exiting vi, more/less, etc. # +xterm-clear:\ + :te=\E[?1049l:ti=\E[?1049h:\ + :tc=xterm-new: xterm-new|modern xterm:\ :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ @@ -2820,7 +2825,7 @@ xterm-basic|modern xterm common:\ :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ - :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :so=\E[7m:sr=\EM:st=\EH:\ :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # The xterm-new description has all of the features, but is not completely @@ -2886,6 +2891,12 @@ xterm-xmc|xterm alias 6:\ # # An 8-bit description is doable with termcap, but there are probably no # termcap (or BSD curses) applications that are able to use it. +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-8bit-clear:\ + :te=\233?1049l:ti=\233?1049h:ue=\23324m:\ + :tc=xterm-8bit: xterm-8bit|xterm terminal emulator 8-bit controls (X Window System):\ :am:km:mi:ms:xn:\ :co#80:it#8:li#24:\ @@ -2902,7 +2913,7 @@ xterm-8bit|xterm terminal emulator 8-bit :ke=\233?1l\E>:kh=\2331~:kl=\217D:kr=\217C:ks=\233?1h\E=:\ :ku=\217A:le=^H:mb=\2335m:md=\2331m:me=\233m:mr=\2337m:\ :nd=\233C:rc=\E8:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:\ - :st=\210:ta=^I:te=\233?1049l:ti=\233?1049h:ue=\23324m:\ + :st=\210:ta=^I:ue=\23324m:\ :up=\233A:us=\2334m:vb=\233?5h\233?5l:ve=\233?25l\233?25h:\ :vs=\233?12;25h:vi=\233?25l: # @@ -2941,6 +2952,12 @@ xterm-ic|xterm-vi|xterm with insert char :IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm: # # Compatible with the X11R6.3 xterm +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-r6-clear:\ + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\ + :tc=xterm-r6: xterm-r6|xterm-old|X11R6 xterm:\ :am:bs:km:mi:ms:pt:xn:\ :co#80:kn#20:li#24:\ @@ -2958,10 +2975,16 @@ xterm-r6|xterm-old|X11R6 xterm:\ :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ :ku=\EOA:md=\E[1m:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:\ :rc=\E8:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ - :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ - :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\ + :ue=\E[m:up=\E[A:us=\E[4m: # # Compatible with the R5 xterm +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-r5-clear:\ + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\ + :tc=xterm-r5: xterm-r5|X11R5 xterm X11R5:\ :am:bs:km:mi:ms:pt:xn:\ :co#80:kn#4:li#24:\ @@ -2974,8 +2997,8 @@ xterm-r5|X11R5 xterm X11R5:\ :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ :ku=\EOA:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:\ :rs=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H:\ - :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ - :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\ + :up=\E[A:us=\E[4m: # # Customization begins here. xterm-xfree86|xterm terminal emulator (XFree86):\ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 07:34:31 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DC106566C; Mon, 14 Dec 2009 07:34:31 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 38AFA8FC16; Mon, 14 Dec 2009 07:34:31 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:cYA7EL/adAjUkbddPdY01rXRj68CYxDzHofK/+FWBlGgBkQjiFbJ4/ok1glbLYh2@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nBE7YJH6070062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 16:34:23 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 14 Dec 2009 16:34:19 +0900 Message-ID: From: Hajimu UMEMOTO To: Doug Barton In-Reply-To: <200912140718.nBE7IVQP012135@svn.freebsd.org> References: <200912140718.nBE7IVQP012135@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE-p1 X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Mon, 14 Dec 2009 16:34:23 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200503 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 07:34:31 -0000 Hi, >>>>> On Mon, 14 Dec 2009 07:18:31 +0000 (UTC) >>>>> Doug Barton said: dougb> Author: dougb dougb> Date: Mon Dec 14 07:18:31 2009 dougb> New Revision: 200503 dougb> URL: http://svn.freebsd.org/changeset/base/200503 dougb> Log: dougb> Revert the xterm terminal behavior to NOT clear the screen after dougb> exiting a pager, vi, etc. dougb> dougb> Add some example xterm*-clear entries to the termcap files to make dougb> it easier for people to enable that behavior. dougb> dougb> Document the examples in the man page to make them easier to find. Thank you! Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 10:48:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C891065692; Mon, 14 Dec 2009 10:48:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377D98FC12; Mon, 14 Dec 2009 10:48: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 nBEAmKFs024008; Mon, 14 Dec 2009 10:48:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEAmKSH024006; Mon, 14 Dec 2009 10:48:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141048.nBEAmKSH024006@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 10:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200504 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 10:48:20 -0000 Author: rwatson Date: Mon Dec 14 10:48:19 2009 New Revision: 200504 URL: http://svn.freebsd.org/changeset/base/200504 Log: Merge r197720 from head to stable/8: Don't comment on stream socket handling in sosend_dgram, since that's not handled. Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Mon Dec 14 07:18:31 2009 (r200503) +++ stable/8/sys/kern/uipc_socket.c Mon Dec 14 10:48:19 2009 (r200504) @@ -961,9 +961,6 @@ sosend_dgram(struct socket *so, struct s * must use a signed comparison of space and resid. On the other * hand, a negative resid causes us to loop sending 0-length * segments to the protocol. - * - * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM - * type sockets since that's an error. */ if (resid < 0) { error = EINVAL; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 11:15:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88501065670; Mon, 14 Dec 2009 11:15:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B75F18FC16; Mon, 14 Dec 2009 11:15: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 nBEBFllN024691; Mon, 14 Dec 2009 11:15:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBFlMO024689; Mon, 14 Dec 2009 11:15:47 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141115.nBEBFlMO024689@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200506 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:15:47 -0000 Author: rwatson Date: Mon Dec 14 11:15:47 2009 New Revision: 200506 URL: http://svn.freebsd.org/changeset/base/200506 Log: Merge r198393 from head to stable/8: Improve grammar in ip_input comment while attempting to maintain what might be its meaning. (Note, merge of the revision correcting a spelling error in this commit will follow as well!) Modified: stable/8/sys/netinet/ip_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Mon Dec 14 11:08:21 2009 (r200505) +++ stable/8/sys/netinet/ip_input.c Mon Dec 14 11:15:47 2009 (r200506) @@ -530,8 +530,8 @@ tooshort: } if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* - * Directly ship on the packet. This allows to forward - * packets that were destined for us to some other directly + * Directly ship the packet on. This allows forwarding + * packets originally destined to us to ome other directly * connected host. */ ip_forward(m, dchg); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 11:45:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474F61065670; Mon, 14 Dec 2009 11:45:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 362698FC17; Mon, 14 Dec 2009 11:45: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 nBEBjsmb025356; Mon, 14 Dec 2009 11:45:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBjsLs025354; Mon, 14 Dec 2009 11:45:54 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141145.nBEBjsLs025354@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200507 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:45:54 -0000 Author: rwatson Date: Mon Dec 14 11:45:53 2009 New Revision: 200507 URL: http://svn.freebsd.org/changeset/base/200507 Log: Merge r198417 from head to stable/8: Remove unneeded blank line from bpf_drvinit(). Modified: stable/8/sys/net/bpf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Mon Dec 14 11:15:47 2009 (r200506) +++ stable/8/sys/net/bpf.c Mon Dec 14 11:45:53 2009 (r200507) @@ -2035,7 +2035,6 @@ bpf_drvinit(void *unused) dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf"); /* For compatibility */ make_dev_alias(dev, "bpf0"); - } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 11:53:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D5F106566B; Mon, 14 Dec 2009 11:53:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 917A98FC26; Mon, 14 Dec 2009 11:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEBr2oQ025590; Mon, 14 Dec 2009 11:53:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBr2CB025588; Mon, 14 Dec 2009 11:53:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141153.nBEBr2CB025588@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200508 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:53:02 -0000 Author: rwatson Date: Mon Dec 14 11:53:02 2009 New Revision: 200508 URL: http://svn.freebsd.org/changeset/base/200508 Log: Merge r198438 from head to stable/8: Correct spelling typo in ip_input comment. Pointed out by: N.J. Mann , John Nielsen , julian (!), lstewart Modified: stable/8/sys/netinet/ip_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Mon Dec 14 11:45:53 2009 (r200507) +++ stable/8/sys/netinet/ip_input.c Mon Dec 14 11:53:02 2009 (r200508) @@ -531,7 +531,7 @@ tooshort: if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* * Directly ship the packet on. This allows forwarding - * packets originally destined to us to ome other directly + * packets originally destined to us to some other directly * connected host. */ ip_forward(m, dchg); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 12:19:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842FA1065670; Mon, 14 Dec 2009 12:19:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72A538FC20; Mon, 14 Dec 2009 12:19: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 nBECJLLl026166; Mon, 14 Dec 2009 12:19:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBECJLfJ026164; Mon, 14 Dec 2009 12:19:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141219.nBECJLfJ026164@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 12:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200509 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 12:19:21 -0000 Author: rwatson Date: Mon Dec 14 12:19:21 2009 New Revision: 200509 URL: http://svn.freebsd.org/changeset/base/200509 Log: Merge r197808 from head to stable/8: In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. Sponsored by: Google Modified: stable/8/libexec/rtld-elf/map_object.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/map_object.c ============================================================================== --- stable/8/libexec/rtld-elf/map_object.c Mon Dec 14 11:53:02 2009 (r200508) +++ stable/8/libexec/rtld-elf/map_object.c Mon Dec 14 12:19:21 2009 (r200509) @@ -273,7 +273,7 @@ get_elf_header (int fd, const char *path } u; ssize_t nbytes; - if ((nbytes = read(fd, u.buf, PAGE_SIZE)) == -1) { + if ((nbytes = pread(fd, u.buf, PAGE_SIZE, 0)) == -1) { _rtld_error("%s: read error: %s", path, strerror(errno)); return NULL; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 12:23:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D8CB106566B; Mon, 14 Dec 2009 12:23:47 +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 5CD848FC12; Mon, 14 Dec 2009 12:23: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 nBECNlsA026383; Mon, 14 Dec 2009 12:23:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBECNlDZ026381; Mon, 14 Dec 2009 12:23:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912141223.nBECNlDZ026381@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 14 Dec 2009 12:23: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: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 12:23:47 -0000 Author: luigi Date: Mon Dec 14 12:23:46 2009 New Revision: 200510 URL: http://svn.freebsd.org/changeset/base/200510 Log: Properly fix callout handling by putting all the per-cpu info in struct callout_cpu. From the comment in the file: + * There is one struct callout_cpu per cpu, holding all relevant + * state for the callout processing thread on the individual CPU. + * In particular: + * cc_ticks is incremented once per tick in callout_cpu(). + * It tracks the global 'ticks' but in a way that the individual + * threads should not worry about races in the order in which + * hardclock() and hardclock_cpu() run on the various CPUs. + * cc_softclock is advanced in callout_cpu() to point to the + * first entry in cc_callwheel that may need handling. In turn, + * a softclock() is scheduled so it can serve the various entries i + * such that cc_softclock <= i <= cc_ticks . Together with a smaller patch committed in september, this fixes a bug that affects 8.0 with apps that rely on callouts to fire exactly in the number of ticks specified (qemu among them). Right now, callouts in 8.0 fire one tick late. This was discussed in september with JeffR and jhb MFC after: 3 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Dec 14 12:19:21 2009 (r200509) +++ head/sys/kern/kern_timeout.c Mon Dec 14 12:23:46 2009 (r200510) @@ -82,6 +82,23 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca */ int callwheelsize, callwheelbits, callwheelmask; +/* + * There is one struct callout_cpu per cpu, holding all relevant + * state for the callout processing thread on the individual CPU. + * In particular: + * cc_ticks is incremented once per tick in callout_cpu(). + * It tracks the global 'ticks' but in a way that the individual + * threads should not worry about races in the order in which + * hardclock() and hardclock_cpu() run on the various CPUs. + * cc_softclock is advanced in callout_cpu() to point to the + * first entry in cc_callwheel that may need handling. In turn, + * a softclock() is scheduled so it can serve the various entries i + * such that cc_softclock <= i <= cc_ticks . + * XXX maybe cc_softclock and cc_ticks should be volatile ? + * + * cc_ticks is also used in callout_reset_cpu() to determine + * when the callout should be served. + */ struct callout_cpu { struct mtx cc_lock; struct callout *cc_callout; @@ -90,6 +107,7 @@ struct callout_cpu { struct callout *cc_next; struct callout *cc_curr; void *cc_cookie; + int cc_ticks; int cc_softticks; int cc_cancel; int cc_waiting; @@ -244,7 +262,8 @@ callout_tick(void) need_softclock = 0; cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); - for (; (cc->cc_softticks - ticks) <= 0; cc->cc_softticks++) { + cc->cc_ticks++; + for (; (cc->cc_softticks - cc->cc_ticks) <= 0; cc->cc_softticks++) { bucket = cc->cc_softticks & callwheelmask; if (!TAILQ_EMPTY(&cc->cc_callwheel[bucket])) { need_softclock = 1; @@ -323,7 +342,7 @@ softclock(void *arg) steps = 0; cc = (struct callout_cpu *)arg; CC_LOCK(cc); - while (cc->cc_softticks - 1 != ticks) { + while (cc->cc_softticks - 1 != cc->cc_ticks) { /* * cc_softticks may be modified by hard clock, so cache * it while we work on a given bucket. @@ -622,7 +641,7 @@ retry: c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); c->c_func = ftn; - c->c_time = ticks + to_ticks; + c->c_time = cc->cc_ticks + to_ticks; TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], c, c_links.tqe); CTR5(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d", From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 13:13:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0C171065676; Mon, 14 Dec 2009 13:13:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEAA78FC1B; Mon, 14 Dec 2009 13:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDDhYn027410; Mon, 14 Dec 2009 13:13:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDDh8Z027406; Mon, 14 Dec 2009 13:13:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141313.nBEDDh8Z027406@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200511 - in stable/8: lib/libc/gen lib/libc/sys sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:13:44 -0000 Author: rwatson Date: Mon Dec 14 13:13:43 2009 New Revision: 200511 URL: http://svn.freebsd.org/changeset/base/200511 Log: Merge r197841 from head to stable/8: Add a new errno, ENOTCAPABLE, to be returned when a process requests an operation on a file descriptor that is not authorized by the descriptor's capability flags. Sponsored by: Google Modified: stable/8/lib/libc/gen/errlst.c stable/8/lib/libc/sys/intro.2 stable/8/sys/sys/errno.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libc/gen/errlst.c ============================================================================== --- stable/8/lib/libc/gen/errlst.c Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/lib/libc/gen/errlst.c Mon Dec 14 13:13:43 2009 (r200511) @@ -150,5 +150,6 @@ const char *const sys_errlist[] = { "Multihop attempted", /* 90 - EMULTIHOP */ "Link has been severed", /* 91 - ENOLINK */ "Protocol error", /* 92 - EPROTO */ + "Capabilities insufficient", /* 93 - ENOTCAPABLE */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: stable/8/lib/libc/sys/intro.2 ============================================================================== --- stable/8/lib/libc/sys/intro.2 Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/lib/libc/sys/intro.2 Mon Dec 14 13:13:43 2009 (r200511) @@ -456,6 +456,9 @@ The specified extended attribute does no .It Er 88 EDOOFUS Em "Programming error" . A function or API is being abused in a way which could only be detected at run-time. +.It Er 93 ENOTCAPABLE Em "Capabilities insufficient" . +An operation on a capability file descriptor requires greater privilege than +the capability allows. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: stable/8/sys/sys/errno.h ============================================================================== --- stable/8/sys/sys/errno.h Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/sys/sys/errno.h Mon Dec 14 13:13:43 2009 (r200511) @@ -174,7 +174,11 @@ __END_DECLS #define EPROTO 92 /* Protocol error */ #ifndef _POSIX_SOURCE -#define ELAST 92 /* Must be equal largest errno */ +#define ENOTCAPABLE 93 /* Capabilities insufficient */ +#endif /* _POSIX_SOURCE */ + +#ifndef _POSIX_SOURCE +#define ELAST 93 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 13:16:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B9A1065672; Mon, 14 Dec 2009 13:16:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1888FC0C; Mon, 14 Dec 2009 13:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDGoLF027524; Mon, 14 Dec 2009 13:16:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDGoSp027522; Mon, 14 Dec 2009 13:16:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141316.nBEDGoSp027522@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200512 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:16:51 -0000 Author: rwatson Date: Mon Dec 14 13:16:50 2009 New Revision: 200512 URL: http://svn.freebsd.org/changeset/base/200512 Log: Merge r199270 from head to stable/8: Fix white space in rtld runtime error printf. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Mon Dec 14 13:13:43 2009 (r200511) +++ stable/8/libexec/rtld-elf/rtld.c Mon Dec 14 13:16:50 2009 (r200512) @@ -3425,7 +3425,7 @@ locate_dependency(const Obj_Entry *obj, if (object_match_name(needed->obj, name)) return needed->obj; } - _rtld_error("%s: Unexpected inconsistency: dependency %s not found", + _rtld_error("%s: Unexpected inconsistency: dependency %s not found", obj->path, name); die(); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 13:23:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD1AF1065670; Mon, 14 Dec 2009 13:23:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB328FC1D; Mon, 14 Dec 2009 13:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDNX8u027734; Mon, 14 Dec 2009 13:23:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDNXJe027732; Mon, 14 Dec 2009 13:23:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141323.nBEDNXJe027732@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200513 - stable/8/sys/dev/fe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:23:34 -0000 Author: rwatson Date: Mon Dec 14 13:23:33 2009 New Revision: 200513 URL: http://svn.freebsd.org/changeset/base/200513 Log: Merge r199798 from head to stable/8: Fix comment typo. Submitted by: Marc Balmer Modified: stable/8/sys/dev/fe/if_fe_pccard.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/fe/if_fe_pccard.c ============================================================================== --- stable/8/sys/dev/fe/if_fe_pccard.c Mon Dec 14 13:16:50 2009 (r200512) +++ stable/8/sys/dev/fe/if_fe_pccard.c Mon Dec 14 13:23:33 2009 (r200513) @@ -306,7 +306,7 @@ fe_pccard_xircom_mac(const struct pccard * Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface. * by MASUI Kenji * - * (Contec uses TDK Ethenet chip -- hosokawa) + * (Contec uses TDK Ethernet chip -- hosokawa) * * This version of fe_probe_tdk has been rewrote to handle * *generic* PC Card implementation of Fujitsu MB8696x family. The From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 14:18:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A109106566B; Mon, 14 Dec 2009 14:18:43 +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 565398FC0C; Mon, 14 Dec 2009 14:18:43 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id ED85B46B2E; Mon, 14 Dec 2009 09:18:42 -0500 (EST) Date: Mon, 14 Dec 2009 14:18:42 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <200912141223.nBECNlDZ026381@svn.freebsd.org> Message-ID: References: <200912141223.nBECNlDZ026381@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: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 14:18:43 -0000 On Mon, 14 Dec 2009, Luigi Rizzo wrote: > Properly fix callout handling by putting all the per-cpu info in > struct callout_cpu. From the comment in the file: > > + * There is one struct callout_cpu per cpu, holding all relevant > + * state for the callout processing thread on the individual CPU. > + * In particular: > + * cc_ticks is incremented once per tick in callout_cpu(). > + * It tracks the global 'ticks' but in a way that the individual > + * threads should not worry about races in the order in which > + * hardclock() and hardclock_cpu() run on the various CPUs. > + * cc_softclock is advanced in callout_cpu() to point to the > + * first entry in cc_callwheel that may need handling. In turn, > + * a softclock() is scheduled so it can serve the various entries i > + * such that cc_softclock <= i <= cc_ticks . > > Together with a smaller patch committed in september, this fixes a > bug that affects 8.0 with apps that rely on callouts to fire exactly > in the number of ticks specified (qemu among them). > Right now, callouts in 8.0 fire one tick late. > > This was discussed in september with JeffR and jhb Once this has burned in, is it something you would consider appropriate to be an errata note candidate? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 14:39:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E5CA1065670; Mon, 14 Dec 2009 14:39:14 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF9D8FC0A; Mon, 14 Dec 2009 14:39:13 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 8872973098; Mon, 14 Dec 2009 15:46:35 +0100 (CET) Date: Mon, 14 Dec 2009 15:46:35 +0100 From: Luigi Rizzo To: Robert Watson Message-ID: <20091214144635.GA91618@onelab2.iet.unipi.it> References: <200912141223.nBECNlDZ026381@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 14:39:14 -0000 On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > On Mon, 14 Dec 2009, Luigi Rizzo wrote: ... > > Together with a smaller patch committed in september, this fixes a > > bug that affects 8.0 with apps that rely on callouts to fire exactly > > in the number of ticks specified (qemu among them). > > Right now, callouts in 8.0 fire one tick late. > > > > This was discussed in september with JeffR and jhb > > Once this has burned in, is it something you would consider appropriate to > be an errata note candidate? i have no objection, but at the time someone commented that callouts do not _guarantee_ when they will run so strictly speaking this is not a bug (i do think that being always a tick late _is_ a bug). cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 15:32:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F91E1065670; Mon, 14 Dec 2009 15:32:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DAD58FC08; Mon, 14 Dec 2009 15:32: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 nBEFWYQn030448; Mon, 14 Dec 2009 15:32:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEFWY2o030446; Mon, 14 Dec 2009 15:32:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912141532.nBEFWY2o030446@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Dec 2009 15:32: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: r200514 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 15:32:35 -0000 Author: jhb Date: Mon Dec 14 15:32:32 2009 New Revision: 200514 URL: http://svn.freebsd.org/changeset/base/200514 Log: Remove comment claiming that building acpi into the kernel is deprecated. PR: docs/141353 Submitted by: Bruce Cran MFC after: 1 week Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Dec 14 13:23:33 2009 (r200513) +++ head/sys/i386/conf/NOTES Mon Dec 14 15:32:32 2009 (r200514) @@ -469,9 +469,6 @@ device tdfx_linux # Enable Linuxulator # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). -# -# Note that building ACPI into the kernel is deprecated; the module is -# normally loaded automatically by the loader. device acpi options ACPI_DEBUG From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 16:08:44 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16C31065670; Mon, 14 Dec 2009 16:08:44 +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 319228FC08; Mon, 14 Dec 2009 16:08:43 +0000 (UTC) Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBEG8fhW007959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Dec 2009 03:08:42 +1100 Date: Tue, 15 Dec 2009 03:08:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Robert Watson In-Reply-To: <200912141219.nBECJLfJ026164@svn.freebsd.org> Message-ID: <20091215013718.D984@besplex.bde.org> References: <200912141219.nBECJLfJ026164@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200509 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:08:44 -0000 On Mon, 14 Dec 2009, Robert Watson wrote: > Log: > Merge r197808 from head to stable/8: > > In rtld's map_object(), use pread(..., 0) rather than read() to read the > ELF header from the front of the file. As all other I/O on the binary > is done using mmap(), this avoids the need for seek privileges on the > file descriptor during run-time linking. Doesn't/shouldn't pread() require seek privileges? It certainly uses them. BTW, its man page contradicts and/or is incomplete about what happens for unseekable files: % On objects capable of seeking, the read() starts at a position given by ^^^^^^^^^^^^^^^^^^^^^^ Should say "read() and readv() start at the" % the pointer associated with d (see lseek(2)). Upon return from read(), ... or readv() % the pointer is incremented by the number of bytes actually read. % % Objects that are not capable of seeking always read from the current % position. The value of the pointer associated with such an object is % undefined. The second paragraph applies to all members of the read() family (though perhaps it was only intended intended to apply to read() and readv() like it did before pread() existed), and is wrong for pread() and preadv(). Instead, pread() attemps to determine seekability using the DFLAG_SEEKABLE flag in the same way as lseek(); if this is set, then pread() correctly determines non-seekability and returns ESPIPE, but if this is not set the pread() assumes that the file is seekable even if it isn't, and I think the error is not detected later. (For the corresponding bug in lseek(2), the error is certainly not detected later, since there is no "later". pread() is presumably bug for bug compatible with this and reads from the current non-position for unseekable files when the error is not detected.) % ERRORS % The read(), readv(), pread() and preadv() system calls will succeed % unless: % ... % The pread() and preadv() system calls may also return the following % errors: % % [EINVAL] The offset value was negative. % % [ESPIPE] The file descriptor is associated with a pipe, socket, % or FIFO. This says that pread() may work correctly for some non-seekable files. Since it only says "may", it doesn't quite contradict the above. Also, the list of file types for which it may work correctly is incomplete. It is unclear exactly which file types work correctly, since DFLAG_SEEKABLE is set for all files of type "vnop" (see struct fileops vnops). I think this covers lots of unseekable irregular regular files in weird file systems like procfs. It is also set for all device files, but most devices aren't seekable. It is not set for uipc shm and sem files, so I think ESPIPE can be returned for these file types, contradicting the above and the corresponding list in lseek.2, but this is unimportant since pread[v] would fail with EOPNOTSUPP if it got past the ESPIPE. Similarly for write.2 and lseek.2. Extra for lseek.2: it says "some devices are incapable of seeking" where it should say "some files are incapable of seeking" and/or give more details as above (even current man page for pread gives more details relevant to lseek than does lseek's man page!). Extra for write.2 (unrelated): where read.2 gives some details for short reads (it says that they don't happen for "normal" files, write.2 says less and doesn't mention "normal" files, but it should say more because "normal" operation is more important. Which files are normal is undocumented and unclear. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 16:46:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD02810656AE; Mon, 14 Dec 2009 16:46:55 +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 8CD888FC1E; Mon, 14 Dec 2009 16:46:55 +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 2B93246B38; Mon, 14 Dec 2009 11:46:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 5AF718A025; Mon, 14 Dec 2009 11:46:54 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Mon, 14 Dec 2009 10:13:32 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912122131.nBCLV71f064304@svn.freebsd.org> In-Reply-To: <200912122131.nBCLV71f064304@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141013.32839.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 11:46:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:46:55 -0000 On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: > Author: attilio > Date: Sat Dec 12 21:31:07 2009 > New Revision: 200447 > URL: http://svn.freebsd.org/changeset/base/200447 > > Log: > In current code, threads performing an interruptible sleep (on both > sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will > leave the waiters flag on forcing the owner to do a wakeup even when if > the waiter queue is empty. > That operation may lead to a deadlock in the case of doing a fake wakeup > on the "preferred" (based on the wakeup algorithm) queue while the other > queue has real waiters on it, because nobody is going to wakeup the 2nd > queue waiters and they will sleep indefinitively. > > A similar bug, is present, for lockmgr in the case the waiters are > sleeping with LK_SLEEPFAIL on. In this case, even if the waiters queue > is not empty, the waiters won't progress after being awake but they will > just fail, still not taking care of the 2nd queue waiters (as instead the > lock owned doing the wakeup would expect). > > In order to fix this bug in a cheap way (without adding too much locking > and complicating too much the semantic) add a sleepqueue interface which > does report the actual number of waiters on a specified queue of a > waitchannel (sleepq_sleepcnt()) and use it in order to determine if the > exclusive waiters (or shared waiters) are actually present on the lockmgr > (or sx) before to give them precedence in the wakeup algorithm. > This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to > cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters > a lockmgr has and if all the waiters on the exclusive waiters queue are > LK_SLEEPFAIL just wake both queues. > > The sleepq_sleepcnt() introduction and ABI breakage require > __FreeBSD_version bumping. Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' (similar to turnstile_empty()) method be sufficient? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 16:54:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7599E1065670; Mon, 14 Dec 2009 16:54:39 +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 631148FC13; Mon, 14 Dec 2009 16:54:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEGsdV2032118; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEGsdWk032116; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912141654.nBEGsdWk032116@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 16:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200515 - head/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:54:39 -0000 Author: delphij Date: Mon Dec 14 16:54:39 2009 New Revision: 200515 URL: http://svn.freebsd.org/changeset/base/200515 Log: Style improvements: - Sort function prototypes; - Apply static on all function bodies. To quote bde@: > It is a good obfuscation to declare functions as static only in the > prototype, so that you can't see the static for the actual function. > The reverse obfuscation (with static only in the function definition) > would make more sense, but is a constraint error. Reviewed by: bde Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Mon Dec 14 15:32:32 2009 (r200514) +++ head/usr.bin/xinstall/xinstall.c Mon Dec 14 16:54:39 2009 (r200515) @@ -85,8 +85,8 @@ int dobackup, docompare, dodir, dopreser mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; const char *suffix = BACKUP_SUFFIX; -static void copy(int, const char *, int, const char *, off_t); static int compare(int, const char *, size_t, int, const char *, size_t); +static void copy(int, const char *, int, const char *, off_t); static int create_newfile(const char *, int, struct stat *); static int create_tempfile(const char *, char *, size_t); static void install(const char *, const char *, u_long, u_int); @@ -246,7 +246,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -u_long +static u_long numeric_id(const char *name, const char *type) { u_long val; @@ -269,7 +269,7 @@ numeric_id(const char *name, const char * install -- * build a path name and install the file */ -void +static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; @@ -523,7 +523,7 @@ install(const char *from_name, const cha * compare -- * compare two files; non-zero means files differ */ -int +static int compare(int from_fd, const char *from_name __unused, size_t from_len, int to_fd, const char *to_name __unused, size_t to_len) { @@ -587,7 +587,7 @@ compare(int from_fd, const char *from_na * create_tempfile -- * create a temporary file based on path and open it */ -int +static int create_tempfile(const char *path, char *temp, size_t tsize) { char *p; @@ -607,7 +607,7 @@ create_tempfile(const char *path, char * * create_newfile -- * create a new file, overwriting an existing one if necessary */ -int +static int create_newfile(const char *path, int target, struct stat *sbp) { char backup[MAXPATHLEN]; @@ -650,7 +650,7 @@ create_newfile(const char *path, int tar * copy -- * copy from one file to another */ -void +static void copy(int from_fd, const char *from_name, int to_fd, const char *to_name, off_t size) { @@ -703,7 +703,7 @@ copy(int from_fd, const char *from_name, * strip -- * use strip(1) to strip the target file */ -void +static void strip(const char *to_name) { const char *stripbin; @@ -735,7 +735,7 @@ strip(const char *to_name) * install_dir -- * build directory heirarchy */ -void +static void install_dir(char *path) { char *p; @@ -769,7 +769,7 @@ install_dir(char *path) * usage -- * print a usage message and die */ -void +static void usage(void) { (void)fprintf(stderr, @@ -786,7 +786,7 @@ usage(void) * trymmap -- * return true (1) if mmap should be tried, false (0) if not. */ -int +static int trymmap(int fd) { /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 17:02:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49ED81065670; Mon, 14 Dec 2009 17:02:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 579168FC0C; Mon, 14 Dec 2009 17:02:54 +0000 (UTC) Received: by fxm28 with SMTP id 28so1564120fxm.13 for ; Mon, 14 Dec 2009 09:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=W2xRpXMey+cd37jIZyWYza8uUQCBzPYZBhEfk5ymopQ=; b=wEtbrsBPbgokXHcIE85NHiCJgBO6Pgj5Ij0d3PCZadyw92ZW5DQMArBxu5lPe7o6jT hLXY2L88HumZrCXtgOY/4hj7AkjY3sn54lz5anK6Tv83QAVxnJRjBlYDIz4nrDsW+G6C YirgV/izcy7eqGX5dDByzewFyhid6+vJ5qdAA= 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=MxVBbD8sp5+pEhAIHahXpB5TxpbU8vfwrKzkJ5hYtNWnv9mX+b5fREkYNTdSt2pqFs JdPPFc3nOD+YT/PCe/MVcG9CspRNEIqAUAu0+/buaypGnpr7h8+e/613gDnkK6xLIpLV bWXL/lVoBiM0FlRjhfgfaEdp12JMdVUcu7LYg= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.29.193 with SMTP id r1mr475972fac.29.1260810174202; Mon, 14 Dec 2009 09:02:54 -0800 (PST) In-Reply-To: <200912141013.32839.jhb@freebsd.org> References: <200912122131.nBCLV71f064304@svn.freebsd.org> <200912141013.32839.jhb@freebsd.org> Date: Mon, 14 Dec 2009 18:02:54 +0100 X-Google-Sender-Auth: f0750340a242f4b8 Message-ID: <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:02:56 -0000 2009/12/14 John Baldwin : > On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: >> Author: attilio >> Date: Sat Dec 12 21:31:07 2009 >> New Revision: 200447 >> URL: http://svn.freebsd.org/changeset/base/200447 >> >> Log: >> =C2=A0 In current code, threads performing an interruptible sleep (on bo= th >> =C2=A0 sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr),= will >> =C2=A0 leave the waiters flag on forcing the owner to do a wakeup even w= hen if >> =C2=A0 the waiter queue is empty. >> =C2=A0 That operation may lead to a deadlock in the case of doing a fake= wakeup >> =C2=A0 on the "preferred" (based on the wakeup algorithm) queue while th= e other >> =C2=A0 queue has real waiters on it, because nobody is going to wakeup t= he 2nd >> =C2=A0 queue waiters and they will sleep indefinitively. >> >> =C2=A0 A similar bug, is present, for lockmgr in the case the waiters ar= e >> =C2=A0 sleeping with LK_SLEEPFAIL on. =C2=A0In this case, even if the wa= iters queue >> =C2=A0 is not empty, the waiters won't progress after being awake but th= ey will >> =C2=A0 just fail, still not taking care of the 2nd queue waiters (as ins= tead the >> =C2=A0 lock owned doing the wakeup would expect). >> >> =C2=A0 In order to fix this bug in a cheap way (without adding too much = locking >> =C2=A0 and complicating too much the semantic) add a sleepqueue interfac= e which >> =C2=A0 does report the actual number of waiters on a specified queue of = a >> =C2=A0 waitchannel (sleepq_sleepcnt()) and use it in order to determine = if the >> =C2=A0 exclusive waiters (or shared waiters) are actually present on the= lockmgr >> =C2=A0 (or sx) before to give them precedence in the wakeup algorithm. >> =C2=A0 This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In or= der to >> =C2=A0 cope with it, add the tracking of how many exclusive LK_SLEEPFAIL= waiters >> =C2=A0 a lockmgr has and if all the waiters on the exclusive waiters que= ue are >> =C2=A0 LK_SLEEPFAIL just wake both queues. >> >> =C2=A0 The sleepq_sleepcnt() introduction and ABI breakage require >> =C2=A0 __FreeBSD_version bumping. > > Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' > (similar to turnstile_empty()) method be sufficient? I need the count in order to fix properly LK_SLEEPFAIL case (the idea is: track exclusive waiters with LK_SLEEPFAIL on; if the number is equal to the actual sleepers on the queue then wake up both queues, otherwise nobody is going to take care of the shared waiters queue). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 17:04:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 156AE1065670; Mon, 14 Dec 2009 17:04:45 +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 ED7588FC12; Mon, 14 Dec 2009 17:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEH4iuE032381; Mon, 14 Dec 2009 17:04:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEH4imp032377; Mon, 14 Dec 2009 17:04:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912141704.nBEH4imp032377@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 17:04: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: r200516 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:04:45 -0000 Author: delphij Date: Mon Dec 14 17:04:44 2009 New Revision: 200516 URL: http://svn.freebsd.org/changeset/base/200516 Log: Add an option to specify that the received ZFS should not be automatically mounted (receive -u). Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944) Approved by: pjd Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2457,7 +2457,7 @@ zfs_do_receive(int argc, char **argv) bzero(&flags, sizeof (recvflags_t)); /* check options */ - while ((c = getopt(argc, argv, ":dnvF")) != -1) { + while ((c = getopt(argc, argv, ":dnuvF")) != -1) { switch (c) { case 'd': flags.isprefix = B_TRUE; @@ -2465,6 +2465,9 @@ zfs_do_receive(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'u': + flags.nomount = B_TRUE; + break; case 'v': flags.verbose = B_TRUE; break; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -457,6 +457,9 @@ typedef struct recvflags { /* byteswap flag is used internally; callers need not specify */ int byteswap : 1; + + /* do not mount file systems as they are extracted (private) */ + int nomount : 1; } recvflags_t; extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2080,7 +2080,7 @@ zfs_receive(libzfs_handle_t *hdl, const err = zfs_receive_impl(hdl, tosnap, flags, infd, stream_avl, &top_zfs); - if (err == 0 && top_zfs) { + if (err == 0 && !flags.nomount && top_zfs) { zfs_handle_t *zhp; prop_changelist_t *clp; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 17:42:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C1C5106566C; Mon, 14 Dec 2009 17:42:41 +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 191128FC1B; Mon, 14 Dec 2009 17:42: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 nBEHgeHu033133; Mon, 14 Dec 2009 17:42:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEHgeFZ033132; Mon, 14 Dec 2009 17:42:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912141742.nBEHgeFZ033132@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 17:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200517 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:42:41 -0000 Author: marcel Date: Mon Dec 14 17:42:40 2009 New Revision: 200517 URL: http://svn.freebsd.org/changeset/base/200517 Log: MFC rev 200397: Fix interrupt handling. PR: kern/140947 Modified: stable/8/sys/dev/puc/puc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/puc/puc.c ============================================================================== --- stable/8/sys/dev/puc/puc.c Mon Dec 14 17:04:44 2009 (r200516) +++ stable/8/sys/dev/puc/puc.c Mon Dec 14 17:42:40 2009 (r200517) @@ -129,62 +129,78 @@ puc_intr(void *arg) { struct puc_port *port; struct puc_softc *sc = arg; - u_long dev, devs; - int i, idx, ipend, isrc; + u_long ds, dev, devs; + int i, idx, ipend, isrc, nints; uint8_t ilr; - devs = sc->sc_serdevs; - if (sc->sc_ilr == PUC_ILR_DIGI) { - idx = 0; - while (devs & (0xfful << idx)) { - ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); - devs &= ~0ul ^ ((u_long)ilr << idx); - idx += 8; - } - } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + nints = 0; + while (1) { /* - * Don't trust the value if it's the same as the option - * register. It may mean that the ILR is not active and - * we're reading the option register instead. This may - * lead to false positives on 8-port boards. + * Obtain the set of devices with pending interrupts. */ - ilr = bus_read_1(sc->sc_port[0].p_rres, 7); - if (ilr != (sc->sc_cfg_data & 0xff)) - devs &= (u_long)ilr; - } - - ipend = 0; - idx = 0, dev = 1UL; - while (devs != 0UL) { - while ((devs & dev) == 0UL) - idx++, dev <<= 1; - devs &= ~dev; - port = &sc->sc_port[idx]; - port->p_ipend = SERDEV_IPEND(port->p_dev); - ipend |= port->p_ipend; - } + devs = sc->sc_serdevs; + if (sc->sc_ilr == PUC_ILR_DIGI) { + idx = 0; + while (devs & (0xfful << idx)) { + ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); + devs &= ~0ul ^ ((u_long)ilr << idx); + idx += 8; + } + } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + /* + * Don't trust the value if it's the same as the option + * register. It may mean that the ILR is not active and + * we're reading the option register instead. This may + * lead to false positives on 8-port boards. + */ + ilr = bus_read_1(sc->sc_port[0].p_rres, 7); + if (ilr != (sc->sc_cfg_data & 0xff)) + devs &= (u_long)ilr; + } + if (devs == 0UL) + break; - i = 0, isrc = SER_INT_OVERRUN; - while (ipend) { - while (i < PUC_ISRCCNT && !(ipend & isrc)) - i++, isrc <<= 1; - KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); - ipend &= ~isrc; + /* + * Obtain the set of interrupt sources from those devices + * that have pending interrupts. + */ + ipend = 0; idx = 0, dev = 1UL; - devs = sc->sc_serdevs; - while (devs != 0UL) { - while ((devs & dev) == 0UL) + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) idx++, dev <<= 1; - devs &= ~dev; + ds &= ~dev; port = &sc->sc_port[idx]; - if (!(port->p_ipend & isrc)) - continue; - if (port->p_ihsrc[i] != NULL) - (*port->p_ihsrc[i])(port->p_iharg); + port->p_ipend = SERDEV_IPEND(port->p_dev); + ipend |= port->p_ipend; + } + if (ipend == 0) + break; + + i = 0, isrc = SER_INT_OVERRUN; + while (ipend) { + while (i < PUC_ISRCCNT && !(ipend & isrc)) + i++, isrc <<= 1; + KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); + ipend &= ~isrc; + idx = 0, dev = 1UL; + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) + idx++, dev <<= 1; + ds &= ~dev; + port = &sc->sc_port[idx]; + if (!(port->p_ipend & isrc)) + continue; + if (port->p_ihsrc[i] != NULL) + (*port->p_ihsrc[i])(port->p_iharg); + nints++; + } } - return (FILTER_HANDLED); } - return (FILTER_STRAY); + + return ((nints > 0) ? FILTER_HANDLED : FILTER_STRAY); } int From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 17:45:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47707106566C; Mon, 14 Dec 2009 17:45:17 +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 348138FC21; Mon, 14 Dec 2009 17:45: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 nBEHjHw9033246; Mon, 14 Dec 2009 17:45:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEHjHPk033244; Mon, 14 Dec 2009 17:45:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912141745.nBEHjHPk033244@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 17:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200518 - stable/7/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:45:17 -0000 Author: marcel Date: Mon Dec 14 17:45:16 2009 New Revision: 200518 URL: http://svn.freebsd.org/changeset/base/200518 Log: MFC rev 200397: Fix interrupt handling. PR: kern/140947 Modified: stable/7/sys/dev/puc/puc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/puc/puc.c ============================================================================== --- stable/7/sys/dev/puc/puc.c Mon Dec 14 17:42:40 2009 (r200517) +++ stable/7/sys/dev/puc/puc.c Mon Dec 14 17:45:16 2009 (r200518) @@ -129,62 +129,78 @@ puc_intr(void *arg) { struct puc_port *port; struct puc_softc *sc = arg; - u_long dev, devs; - int i, idx, ipend, isrc; + u_long ds, dev, devs; + int i, idx, ipend, isrc, nints; uint8_t ilr; - devs = sc->sc_serdevs; - if (sc->sc_ilr == PUC_ILR_DIGI) { - idx = 0; - while (devs & (0xfful << idx)) { - ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); - devs &= ~0ul ^ ((u_long)ilr << idx); - idx += 8; - } - } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + nints = 0; + while (1) { /* - * Don't trust the value if it's the same as the option - * register. It may mean that the ILR is not active and - * we're reading the option register instead. This may - * lead to false positives on 8-port boards. + * Obtain the set of devices with pending interrupts. */ - ilr = bus_read_1(sc->sc_port[0].p_rres, 7); - if (ilr != (sc->sc_cfg_data & 0xff)) - devs &= (u_long)ilr; - } - - ipend = 0; - idx = 0, dev = 1UL; - while (devs != 0UL) { - while ((devs & dev) == 0UL) - idx++, dev <<= 1; - devs &= ~dev; - port = &sc->sc_port[idx]; - port->p_ipend = SERDEV_IPEND(port->p_dev); - ipend |= port->p_ipend; - } + devs = sc->sc_serdevs; + if (sc->sc_ilr == PUC_ILR_DIGI) { + idx = 0; + while (devs & (0xfful << idx)) { + ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); + devs &= ~0ul ^ ((u_long)ilr << idx); + idx += 8; + } + } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + /* + * Don't trust the value if it's the same as the option + * register. It may mean that the ILR is not active and + * we're reading the option register instead. This may + * lead to false positives on 8-port boards. + */ + ilr = bus_read_1(sc->sc_port[0].p_rres, 7); + if (ilr != (sc->sc_cfg_data & 0xff)) + devs &= (u_long)ilr; + } + if (devs == 0UL) + break; - i = 0, isrc = SER_INT_OVERRUN; - while (ipend) { - while (i < PUC_ISRCCNT && !(ipend & isrc)) - i++, isrc <<= 1; - KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); - ipend &= ~isrc; + /* + * Obtain the set of interrupt sources from those devices + * that have pending interrupts. + */ + ipend = 0; idx = 0, dev = 1UL; - devs = sc->sc_serdevs; - while (devs != 0UL) { - while ((devs & dev) == 0UL) + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) idx++, dev <<= 1; - devs &= ~dev; + ds &= ~dev; port = &sc->sc_port[idx]; - if (!(port->p_ipend & isrc)) - continue; - if (port->p_ihsrc[i] != NULL) - (*port->p_ihsrc[i])(port->p_iharg); + port->p_ipend = SERDEV_IPEND(port->p_dev); + ipend |= port->p_ipend; + } + if (ipend == 0) + break; + + i = 0, isrc = SER_INT_OVERRUN; + while (ipend) { + while (i < PUC_ISRCCNT && !(ipend & isrc)) + i++, isrc <<= 1; + KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); + ipend &= ~isrc; + idx = 0, dev = 1UL; + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) + idx++, dev <<= 1; + ds &= ~dev; + port = &sc->sc_port[idx]; + if (!(port->p_ipend & isrc)) + continue; + if (port->p_ihsrc[i] != NULL) + (*port->p_ihsrc[i])(port->p_iharg); + nints++; + } } - return (FILTER_HANDLED); } - return (FILTER_STRAY); + + return ((nints > 0) ? FILTER_HANDLED : FILTER_STRAY); } int From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 17:53:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70306106568F; Mon, 14 Dec 2009 17:53: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 5E47D8FC15; Mon, 14 Dec 2009 17:53: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 nBEHrArI033433; Mon, 14 Dec 2009 17:53:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEHrATZ033431; Mon, 14 Dec 2009 17:53:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141753.nBEHrATZ033431@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 17:53: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: r200519 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:53:10 -0000 Author: yongari Date: Mon Dec 14 17:53:10 2009 New Revision: 200519 URL: http://svn.freebsd.org/changeset/base/200519 Log: Remove register keyword. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 17:45:16 2009 (r200518) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 17:53:10 2009 (r200519) @@ -233,7 +233,7 @@ vge_eeprom_getword(sc, addr, dest) int addr; u_int16_t *dest; { - register int i; + int i; u_int16_t word = 0; /* @@ -602,7 +602,7 @@ static void vge_reset(sc) struct vge_softc *sc; { - register int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -2261,7 +2261,7 @@ static void vge_stop(sc) struct vge_softc *sc; { - register int i; + int i; struct ifnet *ifp; VGE_LOCK_ASSERT(sc); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:00:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7628106566C; Mon, 14 Dec 2009 18:00: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 A95498FC1E; Mon, 14 Dec 2009 18:00: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 nBEI08qC033623; Mon, 14 Dec 2009 18:00:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEI08I3033621; Mon, 14 Dec 2009 18:00:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141800.nBEI08I3033621@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:00: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: r200520 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:00:09 -0000 Author: yongari Date: Mon Dec 14 18:00:08 2009 New Revision: 200520 URL: http://svn.freebsd.org/changeset/base/200520 Log: Prefer device_printf(9) to printf(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 17:53:10 2009 (r200519) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:00:08 2009 (r200520) @@ -918,10 +918,9 @@ vge_attach(dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int unit, error = 0, rid; + int error = 0, rid; sc = device_get_softc(dev); - unit = device_get_unit(dev); sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -938,7 +937,7 @@ vge_attach(dev) 0, ~0, 1, RF_ACTIVE); if (sc->vge_res == NULL) { - printf ("vge%d: couldn't map ports/memory\n", unit); + device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } @@ -949,7 +948,7 @@ vge_attach(dev) 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { - printf("vge%d: couldn't map interrupt\n", unit); + device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; goto fail; } @@ -1027,7 +1026,7 @@ vge_attach(dev) NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { - printf("vge%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); goto fail; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:19:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32E11065676; Mon, 14 Dec 2009 18:19:56 +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 A1DFB8FC1C; Mon, 14 Dec 2009 18:19: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 nBEIJu7D034033; Mon, 14 Dec 2009 18:19:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIJuxQ034031; Mon, 14 Dec 2009 18:19:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141819.nBEIJuxQ034031@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:19: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: r200521 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:19:56 -0000 Author: yongari Date: Mon Dec 14 18:19:56 2009 New Revision: 200521 URL: http://svn.freebsd.org/changeset/base/200521 Log: Fix spelling in comment. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:00:08 2009 (r200520) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:19:56 2009 (r200521) @@ -536,7 +536,7 @@ fail: /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, - * we use the hash filter insted. + * we use the hash filter instead. */ static void vge_setmulti(sc) @@ -1178,7 +1178,7 @@ vge_newbuf(sc, idx, m) /* * Note: the manual fails to document the fact that for - * proper opration, the driver needs to replentish the RX + * proper operation, the driver needs to replenish the RX * DMA ring 4 descriptors at a time (rather than one at a * time, like most chips). We can allocate the new buffers * but we should not set the OWN bits until we're ready @@ -1970,7 +1970,7 @@ vge_init_locked(struct vge_softc *sc) /* * Configure one-shot timer for microsecond - * resulution and load it for 500 usecs. + * resolution and load it for 500 usecs. */ CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); CSR_WRITE_2(sc, VGE_SSTIMER, 400); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:27:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6C0106566B; Mon, 14 Dec 2009 18:27:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293038FC18; Mon, 14 Dec 2009 18:27: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 nBEIRZPe034245; Mon, 14 Dec 2009 18:27:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIRZEQ034243; Mon, 14 Dec 2009 18:27:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141827.nBEIRZEQ034243@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:27: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: r200522 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:27:35 -0000 Author: yongari Date: Mon Dec 14 18:27:34 2009 New Revision: 200522 URL: http://svn.freebsd.org/changeset/base/200522 Log: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:19:56 2009 (r200521) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:27:34 2009 (r200522) @@ -933,8 +933,8 @@ vge_attach(dev) pci_enable_busmaster(dev); rid = VGE_PCI_LOMEM; - sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->vge_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -944,8 +944,8 @@ vge_attach(dev) /* Allocate interrupt */ rid = 0; - sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:43:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90B7106566B; Mon, 14 Dec 2009 18:43:18 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82A68FC0C; Mon, 14 Dec 2009 18:43: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 nBEIhIIQ034644; Mon, 14 Dec 2009 18:43:18 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIhIsA034642; Mon, 14 Dec 2009 18:43:18 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912141843.nBEIhIsA034642@svn.freebsd.org> From: Jack F Vogel Date: Mon, 14 Dec 2009 18:43: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: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:43:18 -0000 Author: jfv Date: Mon Dec 14 18:43:18 2009 New Revision: 200523 URL: http://svn.freebsd.org/changeset/base/200523 Log: Remove the MTX_SPIN flag to the shared code MUTEX as it was causing a panic, also took the opportunity to rename the lock for clarity. Modified: head/sys/dev/e1000/e1000_osdep.h Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 (r200522) +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 (r200523) @@ -82,8 +82,7 @@ /* Mutex used in the shared code */ #define E1000_MUTEX struct mtx #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ - MTX_NETWORK_LOCK, \ - MTX_DEF | MTX_SPIN) + "E1000 Shared Lock", MTX_DEF) #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:43:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80A9F106566B; Mon, 14 Dec 2009 18:43:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8288FC14; Mon, 14 Dec 2009 18:43: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 nBEIhRmc034683; Mon, 14 Dec 2009 18:43:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIhRUo034681; Mon, 14 Dec 2009 18:43:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912141843.nBEIhRUo034681@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 18:43: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: r200524 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:43:27 -0000 Author: rpaulo Date: Mon Dec 14 18:43:27 2009 New Revision: 200524 URL: http://svn.freebsd.org/changeset/base/200524 Log: Pass all IEs to net80211. PR: 141376 Submitted by: Paul MFC after: 1 week Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Dec 14 18:43:18 2009 (r200523) +++ head/sys/dev/if_ndis/if_ndis.c Mon Dec 14 18:43:27 2009 (r200524) @@ -3299,24 +3299,11 @@ ndis_scan_results(struct ndis_softc *sc) efrm = frm + wb->nwbx_ielen; if (efrm - frm < 12) goto done; - sp.tstamp = frm; - frm += 8; - sp.bintval = le16toh(*(uint16_t *)frm); - frm += 2; - sp.capinfo = le16toh(*(uint16_t *)frm); - frm += 2; - - /* Grab variable length ies */ - while (efrm - frm > 1) { - if (efrm - frm < frm[1] + 2) - break; - switch (*frm) { - case IEEE80211_ELEMID_RSN: - sp.rsn = frm; - break; - } - frm += frm[1] + 2; - } + sp.tstamp = frm; frm += 8; + sp.bintval = le16toh(*(uint16_t *)frm); frm += 2; + sp.capinfo = le16toh(*(uint16_t *)frm); frm += 2; + sp.ies = frm; + sp.ies_len = efrm - frm; } done: DPRINTF(("scan: bssid %s chan %dMHz (%d/%d) rssi %d\n", From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:44:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B7C106568F; Mon, 14 Dec 2009 18:44: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 1F8818FC1A; Mon, 14 Dec 2009 18:44: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 nBEIiOPr034752; Mon, 14 Dec 2009 18:44:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIiOZa034749; Mon, 14 Dec 2009 18:44:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141844.nBEIiOZa034749@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:44: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: r200525 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:44:24 -0000 Author: yongari Date: Mon Dec 14 18:44:23 2009 New Revision: 200525 URL: http://svn.freebsd.org/changeset/base/200525 Log: Overhaul bus_dma(9) usage and fix various things. o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag. o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA tag has different restriction compared to TX DMA tag. o Add 40bit DMA address support. o Adjust TX/RX descriptor ring alignment to 64 bytes from 256 bytes as documented in datasheet. o Added check to ensure TX/RX ring reside within a 4GB boundary. Since TX/RX ring shares the same high address register they should have the same high address. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Add lock assertion to vge_setmulti(). o Add RX spare DMA map to recover from DMA map load failure. o Add optimized RX buffer handler, vge_discard_rxbuf which is activated when vge(4) sees bad frames. o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet says the register should be updated only when number of available RX descriptors are multiple of 4. o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which is only set for i386 architecture. Previously vge(4) also performed expensive copy operation to align IP header on amd64. This change should give RX performance boost on amd64 architecture. o Don't reinitialize controller if driver is already running. This should reduce number of link state flipping. o Since vge(4) drops a driver lock before passing received frame to upper layer, make sure vge(4) is still running after re-acquiring driver lock. o Add second argument count to vge_rxeof(). The argument will limit number of packets could be processed in RX handler. o Rearrange vge_rxeof() not to allocate RX buffer if received frame was bad packet. o Removed if_printf that prints DMA map failure. This type of message shouldn't be used in fast path of driver. o Reduce number of allowed TX buffer fragments to 6 from 7. A TX descriptor allows 7 fragments of a frame. However the CMZ field of descriptor has just 3bits and the controller wants to see fragment + 1 in the field. So if we have 7 fragments the field value would be 0 which seems to cause unexpected results under certain conditions. This change should fix occasional TX hang observed on vge(4). o Simplify vge_stat_locked() and add number of available TX descriptor check. o vge(4) controllers lack padding short frames. Make sure to fill zero for the padded bytes. This closes unintended information disclosure. o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether this bit should be set by driver or write-back status bit after transmission. At least vendor's driver does not set this bit so remove it. Without this bit vge(4) still can send jumbo frames. o Don't start driver when vge(4) know there are not enough RX buffers. o Remove volatile keyword in RX descriptor structure. This should be handled by bus_dma(9). o Collapse two 16bits member of TX/RX descriptor into single 32bits member. o Reduce number of RX descriptors to 252 from 256. The VGE_RXDESCNUM is 16bits register but only lower 8bits are valid. So the maximum number of RX descriptors would be 255. However the number of should be multiple of 4 as controller wants to update 4 RX descriptors at a time. This limits the maximum number of RX descriptor to be 252. Tested by: Dewayne Geraghty (dewayne.geraghty <> heuristicsystems dot com dot au) Carey Jones (m.carey.jones <> gmail dot com) Yoshiaki Kasahara (kasahara <> nc dor kyushu-u dot ac dotjp) Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:43:27 2009 (r200524) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:44:23 2009 (r200525) @@ -140,22 +140,21 @@ static int vge_probe (device_t); static int vge_attach (device_t); static int vge_detach (device_t); -static int vge_encap (struct vge_softc *, struct mbuf *, int); +static int vge_encap (struct vge_softc *, struct mbuf **); -static void vge_dma_map_addr (void *, bus_dma_segment_t *, int, int); -static void vge_dma_map_rx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static void vge_dma_map_tx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static int vge_allocmem (device_t, struct vge_softc *); -static int vge_newbuf (struct vge_softc *, int, struct mbuf *); +static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); +static int vge_dma_alloc (struct vge_softc *); +static void vge_dma_free (struct vge_softc *); +static void vge_discard_rxbuf (struct vge_softc *, int); +static int vge_newbuf (struct vge_softc *, int); static int vge_rx_list_init (struct vge_softc *); static int vge_tx_list_init (struct vge_softc *); -#ifdef VGE_FIXUP_RX +static void vge_freebufs (struct vge_softc *); +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx (struct mbuf *); #endif -static int vge_rxeof (struct vge_softc *); +static int vge_rxeof (struct vge_softc *, int); static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); @@ -547,6 +546,8 @@ vge_setmulti(sc) struct ifmultiaddr *ifma; u_int32_t h, hashes[2] = { 0, 0 }; + VGE_LOCK_ASSERT(sc); + ifp = sc->vge_ifp; /* First, zot all the multicast entries. */ @@ -662,249 +663,326 @@ vge_probe(dev) return (ENXIO); } -static void -vge_dma_map_rx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - - struct vge_dmaload_arg *ctx; - struct vge_rx_desc *d = NULL; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* - * Map the segment array into descriptors. - */ - - d = &ctx->sc->vge_ldata.vge_rx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_RDSTS_OWN) { - device_printf(ctx->sc->vge_dev, - "tried to map busy descriptor\n"); - ctx->vge_maxsegs = 0; - return; - } - - d->vge_buflen = htole16(VGE_BUFLEN(segs[0].ds_len) | VGE_RXDESC_I); - d->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - d->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - d->vge_sts = 0; - d->vge_ctl = 0; - - ctx->vge_maxsegs = 1; - - return; -} - -static void -vge_dma_map_tx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - struct vge_dmaload_arg *ctx; - struct vge_tx_desc *d = NULL; - struct vge_tx_frag *f; - int i = 0; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* Map the segment array into descriptors. */ - - d = &ctx->sc->vge_ldata.vge_tx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_TDSTS_OWN) { - ctx->vge_maxsegs = 0; - return; - } - - for (i = 0; i < nseg; i++) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(segs[i].ds_len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[i].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[i].ds_addr) & 0xFFFF); - } - - /* Argh. This chip does not autopad short frames */ - - if (ctx->vge_m0->m_pkthdr.len < VGE_MIN_FRAMELEN) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(VGE_MIN_FRAMELEN - - ctx->vge_m0->m_pkthdr.len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - ctx->vge_m0->m_pkthdr.len = VGE_MIN_FRAMELEN; - i++; - } - - /* - * When telling the chip how many segments there are, we - * must use nsegs + 1 instead of just nsegs. Darned if I - * know why. - */ - i++; - - d->vge_sts = ctx->vge_m0->m_pkthdr.len << 16; - d->vge_ctl = ctx->vge_flags|(i << 28)|VGE_TD_LS_NORM; - - if (ctx->vge_m0->m_pkthdr.len > ETHERMTU + ETHER_HDR_LEN) - d->vge_ctl |= VGE_TDCTL_JUMBO; - - ctx->vge_maxsegs = nseg; - - return; -} - /* * Map a single buffer address. */ +struct vge_dmamap_arg { + bus_addr_t vge_busaddr; +}; + static void -vge_dma_map_addr(arg, segs, nseg, error) +vge_dmamap_cb(arg, segs, nsegs, error) void *arg; bus_dma_segment_t *segs; - int nseg; + int nsegs; int error; { - bus_addr_t *addr; + struct vge_dmamap_arg *ctx; - if (error) + if (error != 0) return; - KASSERT(nseg == 1, ("too many DMA segments, %d should be 1", nseg)); - addr = arg; - *addr = segs->ds_addr; + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - return; + ctx = (struct vge_dmamap_arg *)arg; + ctx->vge_busaddr = segs[0].ds_addr; } static int -vge_allocmem(dev, sc) - device_t dev; - struct vge_softc *sc; +vge_dma_alloc(sc) + struct vge_softc *sc; { - int error; - int nseg; - int i; - - /* - * Allocate map for RX mbufs. - */ - nseg = 32; - error = bus_dma_tag_create(sc->vge_parent_tag, ETHER_ALIGN, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * nseg, nseg, MCLBYTES, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_mtag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; + + lowaddr = BUS_SPACE_MAXADDR; + +again: + /* Create parent ring tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent DMA tag.\n"); + goto fail; } - /* - * Allocate map for TX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_tx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Tx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_TX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Tx ring DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the TX ring */ - - error = bus_dmamem_alloc(sc->vge_ldata.vge_tx_list_tag, - (void **)&sc->vge_ldata.vge_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_tx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_RX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Rx ring DMA tag.\n"); + goto fail; + } - /* Load the map for the TX ring. */ + /* Allocate DMA'able memory and load the DMA map for Tx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_tx_ring_tag, + (void **)&sc->vge_rdata.vge_tx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_tx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Tx ring.\n"); + goto fail; + } - error = bus_dmamap_load(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, sc->vge_ldata.vge_tx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_tx_list_addr, BUS_DMA_NOWAIT); + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, sc->vge_rdata.vge_tx_ring, + VGE_TX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Tx ring.\n"); + goto fail; + } + sc->vge_rdata.vge_tx_ring_paddr = ctx.vge_busaddr; - /* Create DMA maps for TX buffers */ + /* Allocate DMA'able memory and load the DMA map for Rx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_rx_ring_tag, + (void **)&sc->vge_rdata.vge_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_rx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Rx ring.\n"); + goto fail; + } - for (i = 0; i < VGE_TX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_tx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for TX\n"); - return (ENOMEM); - } + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, sc->vge_rdata.vge_rx_ring, + VGE_RX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Rx ring.\n"); + goto fail; } + sc->vge_rdata.vge_rx_ring_paddr = ctx.vge_busaddr; - /* - * Allocate map for RX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_rx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->vge_rdata.vge_tx_ring_paddr + VGE_TX_LIST_SZ; + rx_ring_end = sc->vge_rdata.vge_rx_ring_paddr + VGE_RX_LIST_SZ; + if ((VGE_ADDR_HI(tx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_tx_ring_paddr)) || + (VGE_ADDR_HI(rx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_rx_ring_paddr)) || + VGE_ADDR_HI(tx_ring_end) != VGE_ADDR_HI(rx_ring_end)) { + device_printf(sc->vge_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + vge_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + + /* Create parent buffer tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + VGE_BUF_DMA_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_buffer_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent buffer DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the RX ring */ + /* Create tag for Tx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * VGE_MAXTXSEGS, /* maxsize */ + VGE_MAXTXSEGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - error = bus_dmamem_alloc(sc->vge_ldata.vge_rx_list_tag, - (void **)&sc->vge_ldata.vge_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_rx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + VGE_RX_BUF_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Rx DMA tag.\n"); + goto fail; + } - /* Load the map for the RX ring. */ + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_tx_tag, 0, + &txd->tx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &sc->vge_cdata.vge_rx_sparemap)) != 0) { + device_printf(sc->vge_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &rxd->rx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Rx dmamap.\n"); + goto fail; + } + } - error = bus_dmamap_load(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, sc->vge_ldata.vge_rx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_rx_list_addr, BUS_DMA_NOWAIT); +fail: + return (error); +} - /* Create DMA maps for RX buffers */ +static void +vge_dma_free(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; - for (i = 0; i < VGE_RX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_rx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for RX\n"); - return (ENOMEM); + /* Tx ring. */ + if (sc->vge_cdata.vge_tx_ring_tag != NULL) { + if (sc->vge_cdata.vge_tx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map); + if (sc->vge_cdata.vge_tx_ring_map && + sc->vge_rdata.vge_tx_ring) + bus_dmamem_free(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_rdata.vge_tx_ring, + sc->vge_cdata.vge_tx_ring_map); + sc->vge_rdata.vge_tx_ring = NULL; + sc->vge_cdata.vge_tx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_ring_tag); + sc->vge_cdata.vge_tx_ring_tag = NULL; + } + /* Rx ring. */ + if (sc->vge_cdata.vge_rx_ring_tag != NULL) { + if (sc->vge_cdata.vge_rx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map); + if (sc->vge_cdata.vge_rx_ring_map && + sc->vge_rdata.vge_rx_ring) + bus_dmamem_free(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_rdata.vge_rx_ring, + sc->vge_cdata.vge_rx_ring_map); + sc->vge_rdata.vge_rx_ring = NULL; + sc->vge_cdata.vge_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_ring_tag); + sc->vge_cdata.vge_rx_ring_tag = NULL; + } + /* Tx buffers. */ + if (sc->vge_cdata.vge_tx_tag != NULL) { + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + txd->tx_dmamap = NULL; + } } + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_tag); + sc->vge_cdata.vge_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->vge_cdata.vge_rx_tag != NULL) { + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; + } + } + if (sc->vge_cdata.vge_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap); + sc->vge_cdata.vge_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_tag); + sc->vge_cdata.vge_rx_tag = NULL; + } + + if (sc->vge_cdata.vge_buffer_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_buffer_tag); + sc->vge_cdata.vge_buffer_tag = NULL; + } + if (sc->vge_cdata.vge_ring_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_ring_tag); + sc->vge_cdata.vge_ring_tag = NULL; } - - return (0); } /* @@ -961,25 +1039,7 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define VGE_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, VGE_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->vge_parent_tag); - if (error) - goto fail; - - error = vge_allocmem(dev, sc); - + error = vge_dma_alloc(sc); if (error) goto fail; @@ -1051,7 +1111,6 @@ vge_detach(dev) { struct vge_softc *sc; struct ifnet *ifp; - int i; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1084,97 +1143,93 @@ vge_detach(dev) if (ifp) if_free(ifp); - /* Unload and free the RX DMA ring memory and map */ + vge_dma_free(sc); + mtx_destroy(&sc->vge_mtx); - if (sc->vge_ldata.vge_rx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list, - sc->vge_ldata.vge_rx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_rx_list_tag); - } - - /* Unload and free the TX DMA ring memory and map */ - - if (sc->vge_ldata.vge_tx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list, - sc->vge_ldata.vge_tx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_tx_list_tag); - } - - /* Destroy all the RX and TX buffer maps */ - - if (sc->vge_ldata.vge_mtag) { - for (i = 0; i < VGE_TX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_tx_dmamap[i]); - for (i = 0; i < VGE_RX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[i]); - bus_dma_tag_destroy(sc->vge_ldata.vge_mtag); - } + return (0); +} - if (sc->vge_parent_tag) - bus_dma_tag_destroy(sc->vge_parent_tag); +static void +vge_discard_rxbuf(sc, prod) + struct vge_softc *sc; + int prod; +{ + struct vge_rxdesc *rxd; + int i; - mtx_destroy(&sc->vge_mtx); + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; - return (0); + /* + * Note: the manual fails to document the fact that for + * proper opration, the driver needs to replentish the RX + * DMA ring 4 descriptors at a time (rather than one at a + * time, like most chips). We can allocate the new buffers + * but we should not set the OWN bits until we're ready + * to hand back 4 of them in one shot. + */ + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; + } } static int -vge_newbuf(sc, idx, m) +vge_newbuf(sc, prod) struct vge_softc *sc; - int idx; - struct mbuf *m; + int prod; { - struct vge_dmaload_arg arg; - struct mbuf *n = NULL; - int i, error; - - if (m == NULL) { - n = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (n == NULL) - return (ENOBUFS); - m = n; - } else - m->m_data = m->m_ext.ext_buf; - - -#ifdef VGE_FIXUP_RX - /* - * This is part of an evil trick to deal with non-x86 platforms. - * The VIA chip requires RX buffers to be aligned on 32-bit - * boundaries, but that will hose non-x86 machines. To get around - * this, we leave some empty space at the start of each buffer - * and for non-x86 hosts, we copy the buffer back two bytes - * to achieve word alignment. This is slightly more efficient - * than allocating a new buffer, copying the contents, and - * discarding the old buffer. + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + /* + * This is part of an evil trick to deal with strict-alignment + * architectures. The VIA chip requires RX buffers to be aligned + * on 32-bit boundaries, but that will hose strict-alignment + * architectures. To get around this, we leave some empty space + * at the start of each buffer and for non-strict-alignment hosts, + * we copy the buffer back two bytes to achieve word alignment. + * This is slightly more efficient than allocating a new buffer, + * copying the contents, and discarding the old buffer. */ - m->m_len = m->m_pkthdr.len = MCLBYTES - VGE_ETHER_ALIGN; - m_adj(m, VGE_ETHER_ALIGN); -#else m->m_len = m->m_pkthdr.len = MCLBYTES; -#endif + m_adj(m, VGE_RX_BUF_ALIGN); - arg.sc = sc; - arg.vge_idx = idx; - arg.vge_maxsegs = 1; - arg.vge_flags = 0; - - error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], m, vge_dma_map_rx_desc, - &arg, BUS_DMA_NOWAIT); - if (error || arg.vge_maxsegs != 1) { - if (n != NULL) - m_freem(n); - return (ENOMEM); + if (bus_dmamap_load_mbuf_sg(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap, m, segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->vge_cdata.vge_rx_sparemap; + sc->vge_cdata.vge_rx_sparemap = map; + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; + rxd->rx_desc->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->vge_addrhi = htole32(VGE_ADDR_HI(segs[0].ds_addr) | + (VGE_BUFLEN(segs[0].ds_len) << 16) | VGE_RXDESC_I); /* * Note: the manual fails to document the fact that for @@ -1184,73 +1239,127 @@ vge_newbuf(sc, idx, m) * but we should not set the OWN bits until we're ready * to hand back 4 of them in one shot. */ - -#define VGE_RXCHUNK 4 - sc->vge_rx_consumed++; - if (sc->vge_rx_consumed == VGE_RXCHUNK) { - for (i = idx; i != idx - sc->vge_rx_consumed; i--) - sc->vge_ldata.vge_rx_list[i].vge_sts |= - htole32(VGE_RDSTS_OWN); - sc->vge_rx_consumed = 0; + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; } - sc->vge_ldata.vge_rx_mbuf[idx] = m; - - bus_dmamap_sync(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], - BUS_DMASYNC_PREREAD); - return (0); } static int vge_tx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { - bzero ((char *)sc->vge_ldata.vge_tx_list, VGE_TX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_tx_mbuf, - (VGE_TX_DESC_CNT * sizeof(struct mbuf *))); - - bus_dmamap_sync(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, BUS_DMASYNC_PREWRITE); - sc->vge_ldata.vge_tx_prodidx = 0; - sc->vge_ldata.vge_tx_considx = 0; - sc->vge_ldata.vge_tx_free = VGE_TX_DESC_CNT; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; + + VGE_LOCK_ASSERT(sc); + + sc->vge_cdata.vge_tx_prodidx = 0; + sc->vge_cdata.vge_tx_considx = 0; + sc->vge_cdata.vge_tx_cnt = 0; + + rd = &sc->vge_rdata; + bzero(rd->vge_tx_ring, VGE_TX_LIST_SZ); + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_desc = &rd->vge_tx_ring[i]; + } + + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } static int vge_rx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; int i; - bzero ((char *)sc->vge_ldata.vge_rx_list, VGE_RX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_rx_mbuf, - (VGE_RX_DESC_CNT * sizeof(struct mbuf *))); + VGE_LOCK_ASSERT(sc); - sc->vge_rx_consumed = 0; + sc->vge_cdata.vge_rx_prodidx = 0; + sc->vge_cdata.vge_head = NULL; + sc->vge_cdata.vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; + rd = &sc->vge_rdata; + bzero(rd->vge_rx_ring, VGE_RX_LIST_SZ); for (i = 0; i < VGE_RX_DESC_CNT; i++) { - if (vge_newbuf(sc, i, NULL) == ENOBUFS) + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_desc = &rd->vge_rx_ring[i]; + if (i == 0) + rxd->rxd_prev = + &sc->vge_cdata.vge_rxdesc[VGE_RX_DESC_CNT - 1]; + else + rxd->rxd_prev = &sc->vge_cdata.vge_rxdesc[i - 1]; + if (vge_newbuf(sc, i) != 0) return (ENOBUFS); } - /* Flush the RX descriptors */ + bus_dmamap_sync(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD); - - sc->vge_ldata.vge_rx_prodidx = 0; - sc->vge_rx_consumed = 0; - sc->vge_head = sc->vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; return (0); } -#ifdef VGE_FIXUP_RX +static void +vge_freebufs(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + /* + * Free RX and TX mbufs still in the queues. + */ + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; + } + } + + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + ifp->if_oerrors++; + } + } +} + +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx(m) struct mbuf *m; @@ -1265,8 +1374,6 @@ vge_fixup_rx(m) *dst++ = *src++; m->m_data -= ETHER_ALIGN; - - return; } #endif @@ -1275,49 +1382,39 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc) +vge_rxeof(sc, count) struct vge_softc *sc; + int count; { struct mbuf *m; struct ifnet *ifp; - int i, total_len; - int lim = 0; + int prod, prog, total_len; + struct vge_rxdesc *rxd; struct vge_rx_desc *cur_rx; - u_int32_t rxstat, rxctl; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - i = sc->vge_ldata.vge_rx_prodidx; - - /* Invalidate the descriptor memory */ - - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_POSTREAD); - - while (!VGE_OWN(&sc->vge_ldata.vge_rx_list[i])) { -#ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) - break; - sc->rxcycles--; - } -#endif + ifp = sc->vge_ifp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:45:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33001106568F; Mon, 14 Dec 2009 18:45:48 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2168FC1F; Mon, 14 Dec 2009 18:45:46 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so944919eye.9 for ; Mon, 14 Dec 2009 10:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Rz/4De+R6pBOk7jcJA2DJoEOQK6evu6SAgj0dvVjqXU=; b=YGlvjD3Co+vQ5xU4Ty3c+z9yaiwVES4CE0ppxOU6AxTjoqULraSLh3TSoqnGNaBTSs fW07IgrG4Jtcelg4SSTZs7Al6u6g9ZkH1+5Z3bXxVJE7pOcw1zFOJCvfdIP/ysjxsuTn sQdlzdkG7Q74BZ2Nq3zdEZxn9P7ORpLUCxh0o= 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=bZkl46wYgMDTgsjf0QaqvxRUNKGKK7d5idiCQ16q+xZ2hrH5a3atNczp3L6Eptrx2w OQXY1WfNSA/97A0qGi1S0M0NP8gndbvB7aOApoXPig35shmssoDET9Pt1AXCTtiVhe/s Wt0ZDos5sNv7wD2/f3/wRVeZKpGXr/RAbqtWE= MIME-Version: 1.0 Received: by 10.216.85.130 with SMTP id u2mr2168668wee.135.1260816346014; Mon, 14 Dec 2009 10:45:46 -0800 (PST) In-Reply-To: <4B25C3EF.5010009@freebsd.org> References: <200912081854.nB8IsbrP096592@svn.freebsd.org> <4B25C3EF.5010009@freebsd.org> Date: Mon, 14 Dec 2009 10:45:45 -0800 Message-ID: <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> From: Jack Vogel To: Lawrence Stewart Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:45:48 -0000 Fixed in the commit today. Test again please. Jack On Sun, Dec 13, 2009 at 8:49 PM, Lawrence Stewart wrote: > [picking a recent e1000 commit] > > Hi Jack, > > I'm getting the following panic on head r200376 on my HP DC7800 work > desktop: > > mtx_lock() of spin mutex &dev_spec->swflag_mutex @ > /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 > > I don't experience the panic with an 8.0-RELEASE kernel. > > Anything obviously wrong with that line of code as far as you're concerned, > or do I need to dig some more detail out? Debugging with this system is > painful, hence the initial hand transcribed minimal detail, but if you need > more info I'll try figure out how to get you what you need. > > Cheers, > Lawrence > From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:49:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8CB71065672; Mon, 14 Dec 2009 18:49:16 +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 A7EB28FC13; Mon, 14 Dec 2009 18:49: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 nBEInGaC034941; Mon, 14 Dec 2009 18:49:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEInGB7034939; Mon, 14 Dec 2009 18:49:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141849.nBEInGB7034939@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:49: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: r200526 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:49:16 -0000 Author: yongari Date: Mon Dec 14 18:49:16 2009 New Revision: 200526 URL: http://svn.freebsd.org/changeset/base/200526 Log: Use PCIR_BAR instead of hard-coded value. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:44:23 2009 (r200525) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:49:16 2009 (r200526) @@ -187,9 +187,6 @@ static int vge_cam_set (struct vge_soft static void vge_setmulti (struct vge_softc *); static void vge_reset (struct vge_softc *); -#define VGE_PCI_LOIO 0x10 -#define VGE_PCI_LOMEM 0x14 - static device_method_t vge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vge_probe), @@ -1010,7 +1007,7 @@ vge_attach(dev) */ pci_enable_busmaster(dev); - rid = VGE_PCI_LOMEM; + rid = PCIR_BAR(1); sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1139,7 +1136,7 @@ vge_detach(dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, - VGE_PCI_LOMEM, sc->vge_res); + PCIR_BAR(1), sc->vge_res); if (ifp) if_free(ifp); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 18:50:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47521065692; Mon, 14 Dec 2009 18:50:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF4FD8FC14; Mon, 14 Dec 2009 18:50: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 nBEIoQo9035006; Mon, 14 Dec 2009 18:50:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIoQwA035004; Mon, 14 Dec 2009 18:50:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141850.nBEIoQwA035004@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:50: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: r200527 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:50:27 -0000 Author: yongari Date: Mon Dec 14 18:50:26 2009 New Revision: 200527 URL: http://svn.freebsd.org/changeset/base/200527 Log: Fix typo in register definition. Modified: head/sys/dev/vge/if_vgereg.h Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Mon Dec 14 18:49:16 2009 (r200526) +++ head/sys/dev/vge/if_vgereg.h Mon Dec 14 18:50:26 2009 (r200527) @@ -339,19 +339,19 @@ #define VGE_TXQCSR_RUN0 0x0001 /* Enable TX queue 0 */ #define VGE_TXQCSR_ACT0 0x0002 /* queue 0 active indicator */ #define VGE_TXQCSR_WAK0 0x0004 /* Wake up (poll) queue 0 */ -#define VGE_TXQCST_DEAD0 0x0008 /* queue 0 dead indicator */ +#define VGE_TXQCSR_DEAD0 0x0008 /* queue 0 dead indicator */ #define VGE_TXQCSR_RUN1 0x0010 /* Enable TX queue 1 */ #define VGE_TXQCSR_ACT1 0x0020 /* queue 1 active indicator */ #define VGE_TXQCSR_WAK1 0x0040 /* Wake up (poll) queue 1 */ -#define VGE_TXQCST_DEAD1 0x0080 /* queue 1 dead indicator */ +#define VGE_TXQCSR_DEAD1 0x0080 /* queue 1 dead indicator */ #define VGE_TXQCSR_RUN2 0x0100 /* Enable TX queue 2 */ #define VGE_TXQCSR_ACT2 0x0200 /* queue 2 active indicator */ #define VGE_TXQCSR_WAK2 0x0400 /* Wake up (poll) queue 2 */ -#define VGE_TXQCST_DEAD2 0x0800 /* queue 2 dead indicator */ +#define VGE_TXQCSR_DEAD2 0x0800 /* queue 2 dead indicator */ #define VGE_TXQCSR_RUN3 0x1000 /* Enable TX queue 3 */ #define VGE_TXQCSR_ACT3 0x2000 /* queue 3 active indicator */ #define VGE_TXQCSR_WAK3 0x4000 /* Wake up (poll) queue 3 */ -#define VGE_TXQCST_DEAD3 0x8000 /* queue 3 dead indicator */ +#define VGE_TXQCSR_DEAD3 0x8000 /* queue 3 dead indicator */ /* RX descriptor queue control/status register */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:05:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EE811065670; Mon, 14 Dec 2009 19:05:17 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24E3A8FC0A; Mon, 14 Dec 2009 19:05: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 nBEJ5HGL035336; Mon, 14 Dec 2009 19:05:17 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJ5HuS035334; Mon, 14 Dec 2009 19:05:17 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912141905.nBEJ5HuS035334@svn.freebsd.org> From: Jack F Vogel Date: Mon, 14 Dec 2009 19:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200528 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:05:17 -0000 Author: jfv Date: Mon Dec 14 19:05:16 2009 New Revision: 200528 URL: http://svn.freebsd.org/changeset/base/200528 Log: Add old read_mac_addr routine to this module since a customer report of an Invalid MAC Address has occurred. Modified: head/sys/dev/e1000/e1000_82543.c Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Mon Dec 14 18:50:26 2009 (r200527) +++ head/sys/dev/e1000/e1000_82543.c Mon Dec 14 19:05:16 2009 (r200528) @@ -75,6 +75,8 @@ static void e1000_shift_out_mdi_bits_825 u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); +static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); + /** * e1000_init_phy_params_82543 - Init PHY func ptrs. @@ -246,6 +248,8 @@ static s32 e1000_init_mac_params_82543(s mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_82543; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82543; /* turn on/off LED */ mac->ops.led_on = e1000_led_on_82543; mac->ops.led_off = e1000_led_off_82543; @@ -1600,3 +1604,41 @@ static void e1000_clear_hw_cntrs_82543(s E1000_READ_REG(hw, E1000_TSCTC); E1000_READ_REG(hw, E1000_TSCTFC); } + +/** + * e1000_read_mac_addr_82543 - Read device MAC address + * @hw: pointer to the HW structure + * + * Reads the device MAC address from the EEPROM and stores the value. + * Since devices with two ports use the same EEPROM, we increment the + * last bit in the MAC address for the second port. + * + **/ +s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) { + offset = i >> 1; + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); + } + + /* Flip last bit of mac address if we're on second port */ + if (hw->bus.func == E1000_FUNC_1) + hw->mac.perm_addr[5] ^= 1; + + for (i = 0; i < ETH_ADDR_LEN; i++) + hw->mac.addr[i] = hw->mac.perm_addr[i]; + +out: + return ret_val; +} From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:08:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81C5F106566B; Mon, 14 Dec 2009 19:08: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 70FE78FC13; Mon, 14 Dec 2009 19:08: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 nBEJ8BJN035429; Mon, 14 Dec 2009 19:08:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJ8BUA035427; Mon, 14 Dec 2009 19:08:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141908.nBEJ8BUA035427@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:08: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: r200529 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:08:11 -0000 Author: yongari Date: Mon Dec 14 19:08:11 2009 New Revision: 200529 URL: http://svn.freebsd.org/changeset/base/200529 Log: Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit seems to work like a tag that indicates 'not list end' of queued frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So the last frame of multiple queued frames has no VGE_TXDESC_Q bit. The hardware has peculiar behavior for VGE_TXDESC_Q bit handling. If the VGE_TXDESC_Q bit of descriptor was set the controller would fetch next descriptor. However if next descriptor's OWN bit was cleared but VGE_TXDESC_Q was set, it could confuse controller. Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct behavior. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:05:16 2009 (r200528) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:08:11 2009 (r200529) @@ -1596,8 +1596,11 @@ vge_txeof(sc) __func__)); m_freem(txd->tx_m); txd->tx_m = NULL; + txd->tx_desc->vge_frag[0].vge_addrhi = 0; } - + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:18:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2F51065670; Mon, 14 Dec 2009 19:18:02 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC0A8FC14; Mon, 14 Dec 2009 19:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJI2jL035668; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJI2AS035666; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912141918.nBEJI2AS035666@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 14 Dec 2009 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200530 - head/sys/dev/wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:18:02 -0000 Author: gavin Date: Mon Dec 14 19:18:02 2009 New Revision: 200530 URL: http://svn.freebsd.org/changeset/base/200530 Log: Don't panic on failure to attach if we fail before or during the if_alloc() of ifp. This fixes the panic reported in the PR, but not the attach failure. PR: kern/139079 Tested by: Steven Noonan Reviewed by: thompsa Approved by: ed (mentor) MFC after: 2 weeks` Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:08:11 2009 (r200529) +++ head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:18:02 2009 (r200530) @@ -713,13 +713,14 @@ wpi_detach(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; int ac; - ieee80211_draintask(ic, &sc->sc_restarttask); - ieee80211_draintask(ic, &sc->sc_radiotask); - if (ifp != NULL) { + ic = ifp->if_l2com; + + ieee80211_draintask(ic, &sc->sc_restarttask); + ieee80211_draintask(ic, &sc->sc_radiotask); wpi_stop(sc); callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:44:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A4F5106566C; Mon, 14 Dec 2009 19:44:55 +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 38FBC8FC19; Mon, 14 Dec 2009 19:44: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 nBEJitpD036219; Mon, 14 Dec 2009 19:44:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJitH6036217; Mon, 14 Dec 2009 19:44:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141944.nBEJitH6036217@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:44: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: r200531 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:44:55 -0000 Author: yongari Date: Mon Dec 14 19:44:54 2009 New Revision: 200531 URL: http://svn.freebsd.org/changeset/base/200531 Log: Use ANSI function definations. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:18:02 2009 (r200530) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:44:54 2009 (r200531) @@ -224,10 +224,7 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(sc, addr, dest) - struct vge_softc *sc; - int addr; - u_int16_t *dest; +vge_eeprom_getword(struct vge_softc *sc, int addr, u_int16_t *dest) { int i; u_int16_t word = 0; @@ -275,12 +272,7 @@ vge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -vge_read_eeprom(sc, dest, off, cnt, swap) - struct vge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; #ifdef VGE_EEPROM @@ -301,8 +293,7 @@ vge_read_eeprom(sc, dest, off, cnt, swap } static void -vge_miipoll_stop(sc) - struct vge_softc *sc; +vge_miipoll_stop(struct vge_softc *sc) { int i; @@ -321,8 +312,7 @@ vge_miipoll_stop(sc) } static void -vge_miipoll_start(sc) - struct vge_softc *sc; +vge_miipoll_start(struct vge_softc *sc) { int i; @@ -361,9 +351,7 @@ vge_miipoll_start(sc) } static int -vge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +vge_miibus_readreg(device_t dev, int phy, int reg) { struct vge_softc *sc; int i; @@ -400,9 +388,7 @@ vge_miibus_readreg(dev, phy, reg) } static int -vge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +vge_miibus_writereg(device_t dev, int phy, int reg, int data) { struct vge_softc *sc; int i, rval = 0; @@ -441,8 +427,7 @@ vge_miibus_writereg(dev, phy, reg, data) } static void -vge_cam_clear(sc) - struct vge_softc *sc; +vge_cam_clear(struct vge_softc *sc) { int i; @@ -474,9 +459,7 @@ vge_cam_clear(sc) } static int -vge_cam_set(sc, addr) - struct vge_softc *sc; - uint8_t *addr; +vge_cam_set(struct vge_softc *sc, uint8_t *addr) { int i, error = 0; @@ -535,8 +518,7 @@ fail: * we use the hash filter instead. */ static void -vge_setmulti(sc) - struct vge_softc *sc; +vge_setmulti(struct vge_softc *sc) { struct ifnet *ifp; int error = 0/*, h = 0*/; @@ -597,8 +579,7 @@ vge_setmulti(sc) } static void -vge_reset(sc) - struct vge_softc *sc; +vge_reset(struct vge_softc *sc) { int i; @@ -641,8 +622,7 @@ vge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -vge_probe(dev) - device_t dev; +vge_probe(device_t dev) { struct vge_type *t; @@ -669,11 +649,7 @@ struct vge_dmamap_arg { }; static void -vge_dmamap_cb(arg, segs, nsegs, error) - void *arg; - bus_dma_segment_t *segs; - int nsegs; - int error; +vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { struct vge_dmamap_arg *ctx; @@ -687,8 +663,7 @@ vge_dmamap_cb(arg, segs, nsegs, error) } static int -vge_dma_alloc(sc) - struct vge_softc *sc; +vge_dma_alloc(struct vge_softc *sc) { struct vge_dmamap_arg ctx; struct vge_txdesc *txd; @@ -903,8 +878,7 @@ fail: } static void -vge_dma_free(sc) - struct vge_softc *sc; +vge_dma_free(struct vge_softc *sc) { struct vge_txdesc *txd; struct vge_rxdesc *rxd; @@ -987,8 +961,7 @@ vge_dma_free(sc) * setup and ethernet/BPF attach. */ static int -vge_attach(dev) - device_t dev; +vge_attach(device_t dev) { u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; @@ -1103,8 +1076,7 @@ fail: * allocated. */ static int -vge_detach(dev) - device_t dev; +vge_detach(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; @@ -1147,9 +1119,7 @@ vge_detach(dev) } static void -vge_discard_rxbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_discard_rxbuf(struct vge_softc *sc, int prod) { struct vge_rxdesc *rxd; int i; @@ -1176,9 +1146,7 @@ vge_discard_rxbuf(sc, prod) } static int -vge_newbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_newbuf(struct vge_softc *sc, int prod) { struct vge_rxdesc *rxd; struct mbuf *m; @@ -1248,8 +1216,7 @@ vge_newbuf(sc, prod) } static int -vge_tx_list_init(sc) - struct vge_softc *sc; +vge_tx_list_init(struct vge_softc *sc) { struct vge_ring_data *rd; struct vge_txdesc *txd; @@ -1277,8 +1244,7 @@ vge_tx_list_init(sc) } static int -vge_rx_list_init(sc) - struct vge_softc *sc; +vge_rx_list_init(struct vge_softc *sc) { struct vge_ring_data *rd; struct vge_rxdesc *rxd; @@ -1316,8 +1282,7 @@ vge_rx_list_init(sc) } static void -vge_freebufs(sc) - struct vge_softc *sc; +vge_freebufs(struct vge_softc *sc) { struct vge_txdesc *txd; struct vge_rxdesc *rxd; @@ -1358,8 +1323,7 @@ vge_freebufs(sc) #ifndef __NO_STRICT_ALIGNMENT static __inline void -vge_fixup_rx(m) - struct mbuf *m; +vge_fixup_rx(struct mbuf *m) { int i; uint16_t *src, *dst; @@ -1379,9 +1343,7 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc, count) - struct vge_softc *sc; - int count; +vge_rxeof(struct vge_softc *sc, int count) { struct mbuf *m; struct ifnet *ifp; @@ -1553,8 +1515,7 @@ vge_rxeof(sc, count) } static void -vge_txeof(sc) - struct vge_softc *sc; +vge_txeof(struct vge_softc *sc) { struct ifnet *ifp; struct vge_tx_desc *cur_tx; @@ -1616,8 +1577,7 @@ vge_txeof(sc) } static void -vge_tick(xsc) - void *xsc; +vge_tick(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1698,8 +1658,7 @@ done: #endif /* DEVICE_POLLING */ static void -vge_intr(arg) - void *arg; +vge_intr(void *arg) { struct vge_softc *sc; struct ifnet *ifp; @@ -1775,9 +1734,7 @@ vge_intr(arg) } static int -vge_encap(sc, m_head) - struct vge_softc *sc; - struct mbuf **m_head; +vge_encap(struct vge_softc *sc, struct mbuf **m_head) { struct vge_txdesc *txd; struct vge_tx_frag *frag; @@ -1904,8 +1861,7 @@ vge_encap(sc, m_head) */ static void -vge_start(ifp) - struct ifnet *ifp; +vge_start(struct ifnet *ifp) { struct vge_softc *sc; @@ -1917,8 +1873,7 @@ vge_start(ifp) static void -vge_start_locked(ifp) - struct ifnet *ifp; +vge_start_locked(struct ifnet *ifp) { struct vge_softc *sc; struct vge_txdesc *txd; @@ -1991,8 +1946,7 @@ vge_start_locked(ifp) } static void -vge_init(xsc) - void *xsc; +vge_init(void *xsc) { struct vge_softc *sc = xsc; @@ -2182,8 +2136,7 @@ vge_init_locked(struct vge_softc *sc) * Set media options. */ static int -vge_ifmedia_upd(ifp) - struct ifnet *ifp; +vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; @@ -2201,9 +2154,7 @@ vge_ifmedia_upd(ifp) * Report current media status. */ static void -vge_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { struct vge_softc *sc; struct mii_data *mii; @@ -2221,8 +2172,7 @@ vge_ifmedia_sts(ifp, ifmr) } static void -vge_miibus_statchg(dev) - device_t dev; +vge_miibus_statchg(device_t dev) { struct vge_softc *sc; struct mii_data *mii; @@ -2271,10 +2221,7 @@ vge_miibus_statchg(dev) } static int -vge_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; +vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; @@ -2403,8 +2350,7 @@ vge_watchdog(void *arg) * RX and TX lists. */ static void -vge_stop(sc) - struct vge_softc *sc; +vge_stop(struct vge_softc *sc) { struct ifnet *ifp; @@ -2433,8 +2379,7 @@ vge_stop(sc) * resume. */ static int -vge_suspend(dev) - device_t dev; +vge_suspend(device_t dev) { struct vge_softc *sc; @@ -2455,8 +2400,7 @@ vge_suspend(dev) * appropriate. */ static int -vge_resume(dev) - device_t dev; +vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; @@ -2485,8 +2429,7 @@ vge_resume(dev) * get confused by errant DMAs when rebooting. */ static int -vge_shutdown(dev) - device_t dev; +vge_shutdown(device_t dev) { struct vge_softc *sc; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:49:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2A8E1065693; Mon, 14 Dec 2009 19:49:20 +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 C8D618FC13; Mon, 14 Dec 2009 19:49: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 nBEJnK9L036340; Mon, 14 Dec 2009 19:49:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJnKmH036338; Mon, 14 Dec 2009 19:49:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141949.nBEJnKmH036338@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:49: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: r200532 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:49:21 -0000 Author: yongari Date: Mon Dec 14 19:49:20 2009 New Revision: 200532 URL: http://svn.freebsd.org/changeset/base/200532 Log: Remove unnecessary return statement. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:44:54 2009 (r200531) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:49:20 2009 (r200532) @@ -263,8 +263,6 @@ vge_eeprom_getword(struct vge_softc *sc, CSR_CLRBIT_1(sc, VGE_CHIPCFG2, VGE_CHIPCFG2_EELOAD); *dest = word; - - return; } #endif @@ -307,8 +305,6 @@ vge_miipoll_stop(struct vge_softc *sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to idle MII autopoll\n"); - - return; } static void @@ -346,8 +342,6 @@ vge_miipoll_start(struct vge_softc *sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to start MII autopoll\n"); - - return; } static int @@ -454,8 +448,6 @@ vge_cam_clear(struct vge_softc *sc) CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); sc->vge_camidx = 0; - - return; } static int @@ -574,8 +566,6 @@ vge_setmulti(struct vge_softc *sc) CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); - - return; } static void @@ -613,8 +603,6 @@ vge_reset(struct vge_softc *sc) } CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); - - return; } /* @@ -1605,8 +1593,6 @@ vge_tick(void *xsc) vge_start_locked(ifp); } } - - return; } #ifdef DEVICE_POLLING @@ -1729,8 +1715,6 @@ vge_intr(void *arg) vge_start_locked(ifp); VGE_UNLOCK(sc); - - return; } static int @@ -2167,8 +2151,6 @@ vge_ifmedia_sts(struct ifnet *ifp, struc VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - - return; } static void @@ -2216,8 +2198,6 @@ vge_miibus_statchg(device_t dev) IFM_SUBTYPE(ife->ifm_media)); break; } - - return; } static int @@ -2341,8 +2321,6 @@ vge_watchdog(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); - - return; } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:49:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CD7106568D; Mon, 14 Dec 2009 19:49:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DB5B68FC19; Mon, 14 Dec 2009 19:49:56 +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 88D4046B37; Mon, 14 Dec 2009 14:49:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 3CF828A025; Mon, 14 Dec 2009 14:49:55 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Mon, 14 Dec 2009 14:18:33 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912122131.nBCLV71f064304@svn.freebsd.org> <200912141013.32839.jhb@freebsd.org> <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> In-Reply-To: <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141418.33255.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:49:57 -0000 On Monday 14 December 2009 12:02:54 pm Attilio Rao wrote: > 2009/12/14 John Baldwin : > > On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: > >> Author: attilio > >> Date: Sat Dec 12 21:31:07 2009 > >> New Revision: 200447 > >> URL: http://svn.freebsd.org/changeset/base/200447 > >> > >> Log: > >> In current code, threads performing an interruptible sleep (on both > >> sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will > >> leave the waiters flag on forcing the owner to do a wakeup even when if > >> the waiter queue is empty. > >> That operation may lead to a deadlock in the case of doing a fake wakeup > >> on the "preferred" (based on the wakeup algorithm) queue while the other > >> queue has real waiters on it, because nobody is going to wakeup the 2nd > >> queue waiters and they will sleep indefinitively. > >> > >> A similar bug, is present, for lockmgr in the case the waiters are > >> sleeping with LK_SLEEPFAIL on. In this case, even if the waiters queue > >> is not empty, the waiters won't progress after being awake but they will > >> just fail, still not taking care of the 2nd queue waiters (as instead the > >> lock owned doing the wakeup would expect). > >> > >> In order to fix this bug in a cheap way (without adding too much locking > >> and complicating too much the semantic) add a sleepqueue interface which > >> does report the actual number of waiters on a specified queue of a > >> waitchannel (sleepq_sleepcnt()) and use it in order to determine if the > >> exclusive waiters (or shared waiters) are actually present on the lockmgr > >> (or sx) before to give them precedence in the wakeup algorithm. > >> This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to > >> cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters > >> a lockmgr has and if all the waiters on the exclusive waiters queue are > >> LK_SLEEPFAIL just wake both queues. > >> > >> The sleepq_sleepcnt() introduction and ABI breakage require > >> __FreeBSD_version bumping. > > > > Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' > > (similar to turnstile_empty()) method be sufficient? > > I need the count in order to fix properly LK_SLEEPFAIL case (the idea > is: track exclusive waiters with LK_SLEEPFAIL on; if the number is > equal to the actual sleepers on the queue then wake up both queues, > otherwise nobody is going to take care of the shared waiters queue). Ok. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:49:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA3611065694; Mon, 14 Dec 2009 19:49:59 +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 AC1538FC14; Mon, 14 Dec 2009 19:49:59 +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 4FEA946B37; Mon, 14 Dec 2009 14:49:59 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id EAD218A021; Mon, 14 Dec 2009 14:49:57 -0500 (EST) From: John Baldwin To: Jack F Vogel Date: Mon, 14 Dec 2009 14:31:10 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912141843.nBEIhIsA034642@svn.freebsd.org> In-Reply-To: <200912141843.nBEIhIsA034642@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141431.10603.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:58 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:50:00 -0000 On Monday 14 December 2009 1:43:18 pm Jack F Vogel wrote: > Author: jfv > Date: Mon Dec 14 18:43:18 2009 > New Revision: 200523 > URL: http://svn.freebsd.org/changeset/base/200523 > > Log: > Remove the MTX_SPIN flag to the shared code MUTEX > as it was causing a panic, also took the opportunity > to rename the lock for clarity. > > Modified: > head/sys/dev/e1000/e1000_osdep.h > > Modified: head/sys/dev/e1000/e1000_osdep.h > ============================================================================== > --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 (r200522) > +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 (r200523) > @@ -82,8 +82,7 @@ > /* Mutex used in the shared code */ > #define E1000_MUTEX struct mtx > #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ > - MTX_NETWORK_LOCK, \ > - MTX_DEF | MTX_SPIN) > + "E1000 Shared Lock", MTX_DEF) > #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) > #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) > #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) Hmm, most NIC drivers use MTX_NETWORK_LOCK so that WITNESS will report LORs that happen if any two NIC drivers locks "cross" (e.g. if one driver leaked a lock while passing a packet up the stack that was forwarded to another interface). Not sure if that is relevant to this particular lock though. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:50:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CABAB1065697; Mon, 14 Dec 2009 19:50:01 +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 9C67F8FC13; Mon, 14 Dec 2009 19:50:01 +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 42EFB46B39; Mon, 14 Dec 2009 14:50:01 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 546E48A024; Mon, 14 Dec 2009 14:49:59 -0500 (EST) From: John Baldwin To: Pyun YongHyeon Date: Mon, 14 Dec 2009 14:49:12 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912120006.nBC06iQ9024485@svn.freebsd.org> In-Reply-To: <200912120006.nBC06iQ9024485@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141449.12347.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200422 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:50:01 -0000 On Friday 11 December 2009 7:06:44 pm Pyun YongHyeon wrote: > Author: yongari > Date: Sat Dec 12 00:06:43 2009 > New Revision: 200422 > URL: http://svn.freebsd.org/changeset/base/200422 > > Log: > Remove driver lock assertion in MII register access. This change > was made in r199543 to remove MTX_RECURSE. These routines can be > called in device attach phase(e.g. mii_phy_probe()) so checking > assertion here is not right as caller does not hold a driver lock. Thanks for fixing this. Have you been able to test my other vge(4) changes such as removing the task for TX? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:51:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93DD7106566B; Mon, 14 Dec 2009 19:51:50 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 7748C8FC22; Mon, 14 Dec 2009 19:51:49 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so102117fgg.13 for ; Mon, 14 Dec 2009 11:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ScDIKovZmvnENA/NZ002xGlhjafgxrs3gi9HdgQ0ANA=; b=Ym+STE6Ilta3T1D+oFcV/iFfWfRgr3fOsq3agoS4yserWBpHnRApeugCf2NnGIFSX6 eNowOz/lOf4oaUiH+IJ20sQcPiV9gYSlITcF8B4KTwTw+mziEdnhQcaRX65o/9Vj6UbU bdKEt+//0qR+yEeUDim9J9LLODxA0Y5z20Gyk= 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=v/lCz8jTL4YimeBzrbmy48A8kL10vzvwwdsvKyxoveF1O8WaBIIWBrJurOuYKLXwUS MxFJxjsEtgNKJtBvIKBGsGPDvYaC9YU0qtW74OdTLOHtV9wGiLKWuegJH9gNBIrLw1Co 15+Ilb+xBmUY1cYdzTpQqLkCJ1TTnikMNlHXE= MIME-Version: 1.0 Received: by 10.216.88.208 with SMTP id a58mr847782wef.115.1260820307726; Mon, 14 Dec 2009 11:51:47 -0800 (PST) In-Reply-To: <200912141431.10603.jhb@freebsd.org> References: <200912141843.nBEIhIsA034642@svn.freebsd.org> <200912141431.10603.jhb@freebsd.org> Date: Mon, 14 Dec 2009 11:51:47 -0800 Message-ID: <2a41acea0912141151p5d596118h6900ea8e2731256f@mail.gmail.com> From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:51:50 -0000 Well, its a unique lock in the shared code, and I was already naming the other em locks, if there is some big loss in my doing that I don't have any big emotional investment in them being that way :) Jack On Mon, Dec 14, 2009 at 11:31 AM, John Baldwin wrote: > On Monday 14 December 2009 1:43:18 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Dec 14 18:43:18 2009 > > New Revision: 200523 > > URL: http://svn.freebsd.org/changeset/base/200523 > > > > Log: > > Remove the MTX_SPIN flag to the shared code MUTEX > > as it was causing a panic, also took the opportunity > > to rename the lock for clarity. > > > > Modified: > > head/sys/dev/e1000/e1000_osdep.h > > > > Modified: head/sys/dev/e1000/e1000_osdep.h > > > > ============================================================================== > > --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 > (r200522) > > +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 > (r200523) > > @@ -82,8 +82,7 @@ > > /* Mutex used in the shared code */ > > #define E1000_MUTEX struct mtx > > #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ > > - MTX_NETWORK_LOCK, \ > > - MTX_DEF | MTX_SPIN) > > + "E1000 Shared Lock", MTX_DEF) > > #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) > > #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) > > #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) > > Hmm, most NIC drivers use MTX_NETWORK_LOCK so that WITNESS will report LORs > that happen if any two NIC drivers locks "cross" (e.g. if one driver leaked > a > lock while passing a packet up the stack that was forwarded to another > interface). Not sure if that is relevant to this particular lock though. > > -- > John Baldwin > From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:53:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D75106566B; Mon, 14 Dec 2009 19:53:58 +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 3FBC58FC13; Mon, 14 Dec 2009 19:53: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 nBEJrwUM036461; Mon, 14 Dec 2009 19:53:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJrwpE036458; Mon, 14 Dec 2009 19:53:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141953.nBEJrwpE036458@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200533 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:53:58 -0000 Author: yongari Date: Mon Dec 14 19:53:57 2009 New Revision: 200533 URL: http://svn.freebsd.org/changeset/base/200533 Log: s/u_intXX_t/uintXX_t/g Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:49:20 2009 (r200532) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:53:57 2009 (r200533) @@ -172,7 +172,7 @@ static int vge_ifmedia_upd (struct ifnet static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, u_int16_t *); +static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); #endif static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); @@ -224,10 +224,10 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(struct vge_softc *sc, int addr, u_int16_t *dest) +vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { int i; - u_int16_t word = 0; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -274,11 +274,11 @@ vge_read_eeprom(struct vge_softc *sc, ca { int i; #ifdef VGE_EEPROM - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -349,7 +349,7 @@ vge_miibus_readreg(device_t dev, int phy { struct vge_softc *sc; int i; - u_int16_t rval = 0; + uint16_t rval = 0; sc = device_get_softc(dev); @@ -515,7 +515,7 @@ vge_setmulti(struct vge_softc *sc) struct ifnet *ifp; int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - u_int32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -1613,7 +1613,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_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, VGE_ISR); if (status == 0xFFFFFFFF) goto done; @@ -1648,7 +1648,7 @@ vge_intr(void *arg) { struct vge_softc *sc; struct ifnet *ifp; - u_int32_t status; + uint32_t status; sc = arg; Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 19:49:20 2009 (r200532) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 19:53:57 2009 (r200533) @@ -139,7 +139,7 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - u_int8_t vge_type; + uint8_t vge_type; int vge_if_flags; int vge_link; int vge_camidx; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 19:57:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 920111065670; Mon, 14 Dec 2009 19:57:58 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id E4D118FC1C; Mon, 14 Dec 2009 19:57:57 +0000 (UTC) Received: by qyk6 with SMTP id 6so1666430qyk.3 for ; Mon, 14 Dec 2009 11:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=R7r+6klZqZCjsU5AdOzTlFAGZNpSm1Rj8bVseWLjWUU=; b=VJs8zeTSqWgPDWdefkK1dhShXD8X/+Dq6GQH7ts325zIkPxTGpkVXgjxPYA3iOmJFb 1mUYsB1AO0x3kg3RzPd02mY3IXKokmEZORR+T9jhkC68M5+oLUCSkXnJKZ1xYrRRShZz QZnMftkdP8IZmHPOtfptGjUhPwlPpHGvF+kAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ZJ+9/ayiT3xW6x94SbUMj/Iud6++3JmUlod96PRV82MetFkT8Kc2OsMEX/dp8jKrd2 JB0C1/DY/5907kO8DhXuKr2yH2KsKl2LoO38N365eWTrtZT+FtTrZZ3YOhzu6DbOEJ/d IexeycG9E8H2e0LhASuhNDb1eB7pvLaSvMS/o= Received: by 10.224.35.101 with SMTP id o37mr3291181qad.25.1260820677010; Mon, 14 Dec 2009 11:57:57 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 7sm12763957qwb.32.2009.12.14.11.57.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Dec 2009 11:57:56 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 14 Dec 2009 11:57:42 -0800 From: Pyun YongHyeon Date: Mon, 14 Dec 2009 11:57:42 -0800 To: John Baldwin Message-ID: <20091214195742.GA1122@michelle.cdnetworks.com> References: <200912120006.nBC06iQ9024485@svn.freebsd.org> <200912141449.12347.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912141449.12347.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r200422 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:57:58 -0000 On Mon, Dec 14, 2009 at 02:49:12PM -0500, John Baldwin wrote: > On Friday 11 December 2009 7:06:44 pm Pyun YongHyeon wrote: > > Author: yongari > > Date: Sat Dec 12 00:06:43 2009 > > New Revision: 200422 > > URL: http://svn.freebsd.org/changeset/base/200422 > > > > Log: > > Remove driver lock assertion in MII register access. This change > > was made in r199543 to remove MTX_RECURSE. These routines can be > > called in device attach phase(e.g. mii_phy_probe()) so checking > > assertion here is not right as caller does not hold a driver lock. > > Thanks for fixing this. Have you been able to test my other vge(4) changes > such as removing the task for TX? > Yes, it works as expected. From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:04:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D7DC106568B; Mon, 14 Dec 2009 20:04:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0BF8FC12; Mon, 14 Dec 2009 20:04: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 nBEK468u036728; Mon, 14 Dec 2009 20:04:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK462J036724; Mon, 14 Dec 2009 20:04:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142004.nBEK462J036724@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:04: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: r200534 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:04:06 -0000 Author: rpaulo Date: Mon Dec 14 20:04:06 2009 New Revision: 200534 URL: http://svn.freebsd.org/changeset/base/200534 Log: Simplify partition type parsing by using a data-oriented model. While there add more Apple and Linux partition types. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part.c Mon Dec 14 20:04:06 2009 (r200534) @@ -69,7 +69,13 @@ struct g_part_alias_list { const char *lexeme; enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { + { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, + { "apple-label", G_PART_ALIAS_APPLE_LABEL }, + { "apple-raid", G_PART_ALIAS_APPLE_RAID }, + { "apple-raid-offline", G_PART_ALIAS_APPLE_RAID_OFFLINE }, + { "apple-tv-recovery", G_PART_ALIAS_APPLE_TV_RECOVERY }, + { "apple-ufs", G_PART_ALIAS_APPLE_UFS }, { "efi", G_PART_ALIAS_EFI }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, @@ -77,6 +83,10 @@ struct g_part_alias_list { { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, { "freebsd-zfs", G_PART_ALIAS_FREEBSD_ZFS }, + { "linux-data", G_PART_ALIAS_LINUX_DATA }, + { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, + { "linux-raid", G_PART_ALIAS_LINUX_RAID }, + { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part.h Mon Dec 14 20:04:06 2009 (r200534) @@ -36,7 +36,13 @@ #define G_PART_PROBE_PRI_HIGH 0 enum g_part_alias { - G_PART_ALIAS_APPLE_HFS, /* An HFS file system entry. */ + G_PART_ALIAS_APPLE_BOOT, /* An Apple boot partition entry. */ + G_PART_ALIAS_APPLE_HFS, /* An HFS+ file system entry. */ + G_PART_ALIAS_APPLE_LABEL, /* An Apple label partition entry. */ + G_PART_ALIAS_APPLE_RAID, /* An Apple RAID partition entry. */ + G_PART_ALIAS_APPLE_RAID_OFFLINE,/* An Apple RAID (offline) part entry.*/ + G_PART_ALIAS_APPLE_TV_RECOVERY, /* An Apple TV recovery part entry. */ + G_PART_ALIAS_APPLE_UFS, /* An Apple UFS partition entry. */ G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ @@ -45,6 +51,10 @@ enum g_part_alias { G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ G_PART_ALIAS_FREEBSD_ZFS, /* A ZFS file system entry. */ G_PART_ALIAS_MBR, /* A MBR (extended) partition entry. */ + G_PART_ALIAS_LINUX_DATA, /* A Linux data partition entry. */ + G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ + G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ + G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:04:06 2009 (r200534) @@ -131,7 +131,13 @@ static struct g_part_scheme g_part_gpt_s }; G_PART_SCHEME_DECLARE(g_part_gpt); +static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; static struct uuid gpt_uuid_apple_hfs = GPT_ENT_TYPE_APPLE_HFS; +static struct uuid gpt_uuid_apple_label = GPT_ENT_TYPE_APPLE_LABEL; +static struct uuid gpt_uuid_apple_raid = GPT_ENT_TYPE_APPLE_RAID; +static struct uuid gpt_uuid_apple_raid_offline = GPT_ENT_TYPE_APPLE_RAID_OFFLINE; +static struct uuid gpt_uuid_apple_tv_recovery = GPT_ENT_TYPE_APPLE_TV_RECOVERY; +static struct uuid gpt_uuid_apple_ufs = GPT_ENT_TYPE_APPLE_UFS; static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; @@ -139,10 +145,39 @@ static struct uuid gpt_uuid_freebsd_swap static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; +static struct uuid gpt_uuid_linux_data = GPT_ENT_TYPE_LINUX_DATA; +static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; +static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct g_part_uuid_alias { + struct uuid *uuid; + int alias; +} gpt_uuid_alias_match[] = { + { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT }, + { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS }, + { &gpt_uuid_apple_label, G_PART_ALIAS_APPLE_LABEL }, + { &gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID }, + { &gpt_uuid_apple_raid_offline, G_PART_ALIAS_APPLE_RAID_OFFLINE }, + { &gpt_uuid_apple_tv_recovery, G_PART_ALIAS_APPLE_TV_RECOVERY }, + { &gpt_uuid_apple_ufs, G_PART_ALIAS_APPLE_UFS }, + { &gpt_uuid_efi, G_PART_ALIAS_EFI }, + { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD }, + { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT }, + { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP }, + { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS }, + { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM }, + { &gpt_uuid_freebsd_zfs, G_PART_ALIAS_FREEBSD_ZFS }, + { &gpt_uuid_linux_data, G_PART_ALIAS_LINUX_DATA }, + { &gpt_uuid_linux_lvm, G_PART_ALIAS_LINUX_LVM }, + { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, + { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, + { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { NULL, 0 } +}; + static struct gpt_hdr * gpt_read_hdr(struct g_part_gpt_table *table, struct g_consumer *cp, enum gpt_elt elt) @@ -305,6 +340,7 @@ gpt_parse_type(const char *type, struct struct uuid tmp; const char *alias; int error; + struct g_part_uuid_alias *uap; if (type[0] == '!') { error = parse_uuid(type + 1, &tmp); @@ -315,50 +351,12 @@ gpt_parse_type(const char *type, struct *uuid = tmp; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_EFI); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_efi; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_boot; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_swap; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_ufs; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_vinum; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_zfs; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_MBR); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_mbr; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_APPLE_HFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_apple_hfs; - return (0); + for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + uuid = uap->uuid; + return (0); + } } return (EINVAL); } @@ -717,29 +715,16 @@ g_part_gpt_type(struct g_part_table *bas { struct g_part_gpt_entry *entry; struct uuid *type; + struct g_part_uuid_alias *uap; entry = (struct g_part_gpt_entry *)baseentry; type = &entry->ent.ent_type; - if (EQUUID(type, &gpt_uuid_efi)) - return (g_part_alias_name(G_PART_ALIAS_EFI)); - if (EQUUID(type, &gpt_uuid_freebsd)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); - if (EQUUID(type, &gpt_uuid_freebsd_boot)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT)); - if (EQUUID(type, &gpt_uuid_freebsd_swap)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); - if (EQUUID(type, &gpt_uuid_freebsd_ufs)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS)); - if (EQUUID(type, &gpt_uuid_freebsd_vinum)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM)); - if (EQUUID(type, &gpt_uuid_freebsd_zfs)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS)); - if (EQUUID(type, &gpt_uuid_mbr)) - return (g_part_alias_name(G_PART_ALIAS_MBR)); - if (EQUUID(type, &gpt_uuid_apple_hfs)) - return (g_part_alias_name(G_PART_ALIAS_APPLE_HFS)); + for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) + if (EQUUID(type, uap->uuid)) + return (g_part_alias_name(uap->alias)); buf[0] = '!'; snprintf_uuid(buf + 1, bufsz - 1, type); + return (buf); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:04:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9321E10656C0; Mon, 14 Dec 2009 20:04:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F358FC0C; Mon, 14 Dec 2009 20:04: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 nBEK4SB7036771; Mon, 14 Dec 2009 20:04:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK4Slb036769; Mon, 14 Dec 2009 20:04:28 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142004.nBEK4Slb036769@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:04: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: r200535 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:04:28 -0000 Author: rpaulo Date: Mon Dec 14 20:04:28 2009 New Revision: 200535 URL: http://svn.freebsd.org/changeset/base/200535 Log: Add more Apple partition types. Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Mon Dec 14 20:04:06 2009 (r200534) +++ head/sys/sys/gpt.h Mon Dec 14 20:04:28 2009 (r200535) @@ -117,6 +117,8 @@ struct gpt_ent { #define GPT_ENT_TYPE_LINUX_LVM \ {0xe6d6d379,0xf507,0x44c2,0xa2,0x3c,{0x23,0x8f,0x2a,0x3d,0xf9,0x28}} +#define GPT_ENT_TYPE_APPLE_BOOT \ + {0x426F6F74,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_HFS \ {0x48465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_UFS \ @@ -127,6 +129,10 @@ struct gpt_ent { {0x52414944,0x0000,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_RAID_OFFLINE \ {0x52414944,0x5f4f,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_LABEL \ + {0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_TV_RECOVERY \ + {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:07:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170181065672; Mon, 14 Dec 2009 20:07:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05CA88FC17; Mon, 14 Dec 2009 20:07: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 nBEK7P4E036869; Mon, 14 Dec 2009 20:07:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK7PdT036868; Mon, 14 Dec 2009 20:07:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142007.nBEK7PdT036868@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:07: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: r200536 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:07:26 -0000 Author: yongari Date: Mon Dec 14 20:07:25 2009 New Revision: 200536 URL: http://svn.freebsd.org/changeset/base/200536 Log: style(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:04:28 2009 (r200535) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:07:25 2009 (r200536) @@ -226,8 +226,8 @@ DRIVER_MODULE(miibus, vge, miibus_driver static void vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { - int i; - uint16_t word = 0; + int i; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -272,9 +272,9 @@ vge_eeprom_getword(struct vge_softc *sc, static void vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int i; + int i; #ifdef VGE_EEPROM - uint16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); @@ -293,7 +293,7 @@ vge_read_eeprom(struct vge_softc *sc, ca static void vge_miipoll_stop(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_MIICMD, 0); @@ -310,7 +310,7 @@ vge_miipoll_stop(struct vge_softc *sc) static void vge_miipoll_start(struct vge_softc *sc) { - int i; + int i; /* First, make sure we're idle. */ @@ -347,14 +347,14 @@ vge_miipoll_start(struct vge_softc *sc) static int vge_miibus_readreg(device_t dev, int phy, int reg) { - struct vge_softc *sc; - int i; - uint16_t rval = 0; + struct vge_softc *sc; + int i; + uint16_t rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -384,13 +384,13 @@ vge_miibus_readreg(device_t dev, int phy static int vge_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct vge_softc *sc; - int i, rval = 0; + struct vge_softc *sc; + int i, rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -423,7 +423,7 @@ vge_miibus_writereg(device_t dev, int ph static void vge_cam_clear(struct vge_softc *sc) { - int i; + int i; /* * Turn off all the mask bits. This tells the chip @@ -453,10 +453,10 @@ vge_cam_clear(struct vge_softc *sc) static int vge_cam_set(struct vge_softc *sc, uint8_t *addr) { - int i, error = 0; + int i, error = 0; if (sc->vge_camidx == VGE_CAM_MAXADDRS) - return(ENOSPC); + return (ENOSPC); /* Select the CAM data page. */ CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); @@ -512,10 +512,10 @@ fail: static void vge_setmulti(struct vge_softc *sc) { - struct ifnet *ifp; - int error = 0/*, h = 0*/; - struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + struct ifnet *ifp; + int error = 0/*, h = 0*/; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -571,7 +571,7 @@ vge_setmulti(struct vge_softc *sc) static void vge_reset(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -612,7 +612,7 @@ vge_reset(struct vge_softc *sc) static int vge_probe(device_t dev) { - struct vge_type *t; + struct vge_type *t; t = vge_devs; @@ -639,7 +639,7 @@ struct vge_dmamap_arg { static void vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - struct vge_dmamap_arg *ctx; + struct vge_dmamap_arg *ctx; if (error != 0) return; @@ -653,11 +653,11 @@ vge_dmamap_cb(void *arg, bus_dma_segment static int vge_dma_alloc(struct vge_softc *sc) { - struct vge_dmamap_arg ctx; - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - bus_addr_t lowaddr, tx_ring_end, rx_ring_end; - int error, i; + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; lowaddr = BUS_SPACE_MAXADDR; @@ -868,9 +868,9 @@ fail: static void vge_dma_free(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; /* Tx ring. */ if (sc->vge_cdata.vge_tx_ring_tag != NULL) { @@ -951,10 +951,10 @@ vge_dma_free(struct vge_softc *sc) static int vge_attach(device_t dev) { - u_char eaddr[ETHER_ADDR_LEN]; - struct vge_softc *sc; - struct ifnet *ifp; - int error = 0, rid; + u_char eaddr[ETHER_ADDR_LEN]; + struct vge_softc *sc; + struct ifnet *ifp; + int error = 0, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1066,8 +1066,8 @@ fail: static int vge_detach(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1109,8 +1109,8 @@ vge_detach(device_t dev) static void vge_discard_rxbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - int i; + struct vge_rxdesc *rxd; + int i; rxd = &sc->vge_cdata.vge_rxdesc[prod]; rxd->rx_desc->vge_sts = 0; @@ -1136,11 +1136,11 @@ vge_discard_rxbuf(struct vge_softc *sc, static int vge_newbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - struct mbuf *m; - bus_dma_segment_t segs[1]; - bus_dmamap_t map; - int i, nsegs; + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1206,9 +1206,9 @@ vge_newbuf(struct vge_softc *sc, int pro static int vge_tx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_txdesc *txd; - int i; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; VGE_LOCK_ASSERT(sc); @@ -1234,9 +1234,9 @@ vge_tx_list_init(struct vge_softc *sc) static int vge_rx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_rxdesc *rxd; - int i; + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; + int i; VGE_LOCK_ASSERT(sc); @@ -1272,10 +1272,10 @@ vge_rx_list_init(struct vge_softc *sc) static void vge_freebufs(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - struct ifnet *ifp; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; VGE_LOCK_ASSERT(sc); @@ -1313,8 +1313,8 @@ vge_freebufs(struct vge_softc *sc) static __inline void vge_fixup_rx(struct mbuf *m) { - int i; - uint16_t *src, *dst; + int i; + uint16_t *src, *dst; src = mtod(m, uint16_t *); dst = src - 1; @@ -1333,12 +1333,12 @@ vge_fixup_rx(struct mbuf *m) static int vge_rxeof(struct vge_softc *sc, int count) { - struct mbuf *m; - struct ifnet *ifp; - int prod, prog, total_len; - struct vge_rxdesc *rxd; - struct vge_rx_desc *cur_rx; - uint32_t rxstat, rxctl; + struct mbuf *m; + struct ifnet *ifp; + int prod, prog, total_len; + struct vge_rxdesc *rxd; + struct vge_rx_desc *cur_rx; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); @@ -1505,11 +1505,11 @@ vge_rxeof(struct vge_softc *sc, int coun static void vge_txeof(struct vge_softc *sc) { - struct ifnet *ifp; - struct vge_tx_desc *cur_tx; - struct vge_txdesc *txd; - uint32_t txstat; - int cons, prod; + struct ifnet *ifp; + struct vge_tx_desc *cur_tx; + struct vge_txdesc *txd; + uint32_t txstat; + int cons, prod; VGE_LOCK_ASSERT(sc); @@ -1567,9 +1567,9 @@ vge_txeof(struct vge_softc *sc) static void vge_tick(void *xsc) { - struct vge_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct vge_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; ifp = sc->vge_ifp; @@ -1646,9 +1646,9 @@ done: static void vge_intr(void *arg) { - struct vge_softc *sc; - struct ifnet *ifp; - uint32_t status; + struct vge_softc *sc; + struct ifnet *ifp; + uint32_t status; sc = arg; @@ -1720,12 +1720,12 @@ vge_intr(void *arg) static int vge_encap(struct vge_softc *sc, struct mbuf **m_head) { - struct vge_txdesc *txd; - struct vge_tx_frag *frag; - struct mbuf *m; - bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; - int error, i, nsegs, padlen; - uint32_t cflags; + struct vge_txdesc *txd; + struct vge_tx_frag *frag; + struct mbuf *m; + bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; + int error, i, nsegs, padlen; + uint32_t cflags; VGE_LOCK_ASSERT(sc); @@ -1847,7 +1847,7 @@ vge_encap(struct vge_softc *sc, struct m static void vge_start(struct ifnet *ifp) { - struct vge_softc *sc; + struct vge_softc *sc; sc = ifp->if_softc; VGE_LOCK(sc); @@ -1859,10 +1859,10 @@ vge_start(struct ifnet *ifp) static void vge_start_locked(struct ifnet *ifp) { - struct vge_softc *sc; - struct vge_txdesc *txd; - struct mbuf *m_head; - int enq, idx; + struct vge_softc *sc; + struct vge_txdesc *txd; + struct mbuf *m_head; + int enq, idx; sc = ifp->if_softc; @@ -1932,7 +1932,7 @@ vge_start_locked(struct ifnet *ifp) static void vge_init(void *xsc) { - struct vge_softc *sc = xsc; + struct vge_softc *sc = xsc; VGE_LOCK(sc); vge_init_locked(sc); @@ -1942,9 +1942,9 @@ vge_init(void *xsc) static void vge_init_locked(struct vge_softc *sc) { - struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; - int error, i; + struct ifnet *ifp = sc->vge_ifp; + struct mii_data *mii; + int error, i; VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); @@ -2122,8 +2122,8 @@ vge_init_locked(struct vge_softc *sc) static int vge_ifmedia_upd(struct ifnet *ifp) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; VGE_LOCK(sc); @@ -2140,8 +2140,8 @@ vge_ifmedia_upd(struct ifnet *ifp) static void vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); @@ -2156,9 +2156,9 @@ vge_ifmedia_sts(struct ifnet *ifp, struc static void vge_miibus_statchg(device_t dev) { - struct vge_softc *sc; - struct mii_data *mii; - struct ifmedia_entry *ife; + struct vge_softc *sc; + struct mii_data *mii; + struct ifmedia_entry *ife; sc = device_get_softc(dev); mii = device_get_softc(sc->vge_miibus); @@ -2203,10 +2203,10 @@ vge_miibus_statchg(device_t dev) static int vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct vge_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *) data; - struct mii_data *mii; - int error = 0; + struct vge_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *) data; + struct mii_data *mii; + int error = 0; switch (command) { case SIOCSIFMTU: @@ -2258,7 +2258,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(vge_poll, ifp); if (error) - return(error); + return (error); VGE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, VGE_IMR, 0); @@ -2330,7 +2330,7 @@ vge_watchdog(void *arg) static void vge_stop(struct vge_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; @@ -2359,7 +2359,7 @@ vge_stop(struct vge_softc *sc) static int vge_suspend(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); @@ -2380,8 +2380,8 @@ vge_suspend(device_t dev) static int vge_resume(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); ifp = sc->vge_ifp; @@ -2409,7 +2409,7 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:12:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 000D91065676; Mon, 14 Dec 2009 20:12:51 +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 D92A88FC0A; Mon, 14 Dec 2009 20:12: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 nBEKCpgC037013; Mon, 14 Dec 2009 20:12:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKCpdn037009; Mon, 14 Dec 2009 20:12:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912142012.nBEKCpdn037009@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 14 Dec 2009 20:12: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: r200537 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:12:52 -0000 Author: luigi Date: Mon Dec 14 20:12:51 2009 New Revision: 200537 URL: http://svn.freebsd.org/changeset/base/200537 Log: Move the scan for max_keylen into route.c::route_init(), and make max_keylen an argument for rn_init(). This removes an unnecessary dependency on domain.h from radix.c MFC after: 7 days Modified: head/sys/net/radix.c head/sys/net/radix.h head/sys/net/route.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/radix.c Mon Dec 14 20:12:51 2009 (r200537) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include "opt_mpath.h" @@ -1163,16 +1162,11 @@ rn_inithead(head, off) } void -rn_init() +rn_init(int maxk) { char *cp, *cplim; -#ifdef _KERNEL - struct domain *dom; - for (dom = domains; dom; dom = dom->dom_next) - if (dom->dom_maxrtkey > max_keylen) - max_keylen = dom->dom_maxrtkey; -#endif + max_keylen = maxk; if (max_keylen == 0) { log(LOG_ERR, "rn_init: radix functions require max_keylen be set\n"); @@ -1189,19 +1183,3 @@ rn_init() if (rn_inithead((void **)(void *)&mask_rnhead, 0) == 0) panic("rn_init 2"); } - -#ifndef _KERNEL -/* - * A simple function to make the code usable from userland. - * A proper fix (maybe later) would be to change rn_init() so that it - * takes maxkeylen as an argument, and move the scan of - * domains into net/route.c::route_init(). - */ -void rn_init2(int maxk); -void -rn_init2(int maxk) -{ - max_keylen = maxk; - rn_init(); -} -#endif /* !_KERNEL */ Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/radix.h Mon Dec 14 20:12:51 2009 (r200537) @@ -160,7 +160,7 @@ struct radix_node_head { #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ -void rn_init(void); +void rn_init(int); int rn_inithead(void **, int); int rn_refines(void *, void *); struct radix_node Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/route.c Mon Dec 14 20:12:51 2009 (r200537) @@ -171,13 +171,20 @@ rt_tables_get_rnh(int table, int fam) static void route_init(void) { + struct domain *dom; + int max_keylen = 0; /* whack the tunable ints into line. */ if (rt_numfibs > RT_MAXFIBS) rt_numfibs = RT_MAXFIBS; if (rt_numfibs == 0) rt_numfibs = 1; - rn_init(); /* initialize all zeroes, all ones, mask table */ + + for (dom = domains; dom; dom = dom->dom_next) + if (dom->dom_maxrtkey > max_keylen) + max_keylen = dom->dom_maxrtkey; + + rn_init(max_keylen); /* init all zeroes, all ones, mask table */ } SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:17:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B201065692; Mon, 14 Dec 2009 20:17: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 A9A318FC1D; Mon, 14 Dec 2009 20:17: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 nBEKHrjb037147; Mon, 14 Dec 2009 20:17:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKHrRE037144; Mon, 14 Dec 2009 20:17:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142017.nBEKHrRE037144@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:17: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: r200538 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:17:53 -0000 Author: yongari Date: Mon Dec 14 20:17:53 2009 New Revision: 200538 URL: http://svn.freebsd.org/changeset/base/200538 Log: Introduce vge_flags member in softc. The vge_flags member will record device specific bits. Remove vge_link and use vge_flags. While here, move clearing link state before mii_mediachg() as mii_mediachg() may affect link state. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:12:51 2009 (r200537) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:17:53 2009 (r200538) @@ -1577,16 +1577,16 @@ vge_tick(void *xsc) mii = device_get_softc(sc->vge_miibus); mii_tick(mii); - if (sc->vge_link) { + if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { - sc->vge_link = 0; + sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); } } else { if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->vge_link = 1; + sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1868,7 +1868,7 @@ vge_start_locked(struct ifnet *ifp) VGE_LOCK_ASSERT(sc); - if (sc->vge_link == 0 || + if ((sc->vge_flags & VGE_FLAG_LINK) == 0 || (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; @@ -2107,13 +2107,12 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } + sc->vge_flags &= ~VGE_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); - - sc->vge_link = 0; } /* Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:12:51 2009 (r200537) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:17:53 2009 (r200538) @@ -141,7 +141,8 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; - int vge_link; + int vge_flags; +#define VGE_FLAG_LINK 0x8000 int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:26:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4B06106566C; Mon, 14 Dec 2009 20:26:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B878FC0C; Mon, 14 Dec 2009 20:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKQRse037373; Mon, 14 Dec 2009 20:26:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKQRD9037369; Mon, 14 Dec 2009 20:26:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142026.nBEKQRD9037369@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200539 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:26:27 -0000 Author: rpaulo Date: Mon Dec 14 20:26:27 2009 New Revision: 200539 URL: http://svn.freebsd.org/changeset/base/200539 Log: Add Microsoft and NetBSD partition types handling. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part.c Mon Dec 14 20:26:27 2009 (r200539) @@ -87,6 +87,16 @@ struct g_part_alias_list { { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, { "linux-raid", G_PART_ALIAS_LINUX_RAID }, { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, + { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA }, + { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, + { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, + { "ms-reserved", G_PART_ALIAS_MS_RESERVED }, + { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD }, + { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD }, + { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS }, + { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS }, + { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID }, + { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part.h Mon Dec 14 20:26:27 2009 (r200539) @@ -55,6 +55,16 @@ enum g_part_alias { G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ + G_PART_ALIAS_MS_BASIC_DATA, /* A Microsoft Data part. entry. */ + G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ + G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ + G_PART_ALIAS_MS_RESERVED, /* A Microsoft Reserved part. entry. */ + G_PART_ALIAS_NETBSD_CCD, /* A NetBSD CCD partition entry. */ + G_PART_ALIAS_NETBSD_CGD, /* A NetBSD CGD partition entry. */ + G_PART_ALIAS_NETBSD_FFS, /* A NetBSD FFS partition entry. */ + G_PART_ALIAS_NETBSD_RAID, /* A NetBSD RAID partition entry. */ + G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ + G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:26:27 2009 (r200539) @@ -149,6 +149,16 @@ static struct uuid gpt_uuid_linux_data = static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; +static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED; +static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA; +static struct uuid gpt_uuid_ms_ldm_metadata = GPT_ENT_TYPE_MS_LDM_METADATA; +static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; +static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; +static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; +static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; +static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; +static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; @@ -175,6 +185,17 @@ static struct g_part_uuid_alias { { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA }, + { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA }, + { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA }, + { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED }, + { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD }, + { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD }, + { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS }, + { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS }, + { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID }, + { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP }, + { NULL, 0 } }; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:39:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6D551065670; Mon, 14 Dec 2009 20:39:42 +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 8CC3C8FC12; Mon, 14 Dec 2009 20:39: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 nBEKdg3x037675; Mon, 14 Dec 2009 20:39:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKdgvT037672; Mon, 14 Dec 2009 20:39:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142039.nBEKdgvT037672@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:39: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: r200540 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:39:42 -0000 Author: yongari Date: Mon Dec 14 20:39:42 2009 New Revision: 200540 URL: http://svn.freebsd.org/changeset/base/200540 Log: Save PHY address by reading VGE_MIICFG register. For PCIe controllers(VT613x), we assume the PHY address is 1. Use the saved PHY address in MII register access routines and remove accessing VGE_MIICFG register. While I'm here save PCI express capability register which will be used in near future. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:26:27 2009 (r200539) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:39:42 2009 (r200540) @@ -353,7 +353,7 @@ vge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -389,7 +389,7 @@ vge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -954,7 +954,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, rid; + int error = 0, cap, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -978,6 +978,11 @@ vge_attach(device_t dev) goto fail; } + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PCIE; + sc->vge_expcap = cap; + } + /* Allocate interrupt */ rid = 0; sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -996,7 +1001,17 @@ vge_attach(device_t dev) * Get station address from the EEPROM. */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - + /* + * Save configured PHY address. + * It seems the PHY address of PCIe controllers just + * reflects media jump strapping status so we assume the + * internal PHY address of PCIe controller is at 1. + */ + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + sc->vge_phyaddr = 1; + else + sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & + VGE_MIICFG_PHYADDR; error = vge_dma_alloc(sc); if (error) goto fail; Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:26:27 2009 (r200539) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:39:42 2009 (r200540) @@ -141,8 +141,11 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; + int vge_phyaddr; int vge_flags; +#define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_LINK 0x8000 + int vge_expcap; int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:49:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF776106568F; Mon, 14 Dec 2009 20:49:50 +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 C55E78FC0A; Mon, 14 Dec 2009 20:49: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 nBEKnodl037899; Mon, 14 Dec 2009 20:49:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKnoAo037896; Mon, 14 Dec 2009 20:49:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142049.nBEKnoAo037896@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:49: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: r200541 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:49:51 -0000 Author: yongari Date: Mon Dec 14 20:49:50 2009 New Revision: 200541 URL: http://svn.freebsd.org/changeset/base/200541 Log: Add MSI support for VT613x controllers. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:39:42 2009 (r200540) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:49:50 2009 (r200541) @@ -127,6 +127,10 @@ MODULE_DEPEND(vge, miibus, 1, 1, 1); #define VGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) +/* Tunables */ +static int msi_disable = 0; +TUNABLE_INT("hw.vge.msi_disable", &msi_disable); + /* * Various supported device vendors/types and their names. */ @@ -954,7 +958,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, cap, rid; + int error = 0, cap, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -982,12 +986,24 @@ vge_attach(device_t dev) sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; } + rid = 0; + msic = pci_msi_count(dev); + if (msi_disable == 0 && msic > 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + sc->vge_flags |= VGE_FLAG_MSI; + device_printf(dev, "Using %d MSI message\n", + msic); + rid = 1; + } else + pci_release_msi(dev); + } + } /* Allocate interrupt */ - rid = 0; sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - + ((sc->vge_flags & VGE_FLAG_MSI) ? 0 : RF_SHAREABLE) | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; @@ -1108,7 +1124,10 @@ vge_detach(device_t dev) if (sc->vge_intrhand) bus_teardown_intr(dev, sc->vge_irq, sc->vge_intrhand); if (sc->vge_irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); + bus_release_resource(dev, SYS_RES_IRQ, + sc->vge_flags & VGE_FLAG_MSI ? 1 : 0, sc->vge_irq); + if (sc->vge_flags & VGE_FLAG_MSI) + pci_release_msi(dev); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(1), sc->vge_res); Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:39:42 2009 (r200540) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:49:50 2009 (r200541) @@ -144,6 +144,7 @@ struct vge_softc { int vge_phyaddr; int vge_flags; #define VGE_FLAG_PCIE 0x0001 +#define VGE_FLAG_MSI 0x0002 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:59:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034E81065676; Mon, 14 Dec 2009 20:59:02 +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 E57BF8FC08; Mon, 14 Dec 2009 20:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKx1FL038161; Mon, 14 Dec 2009 20:59:01 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKx1M3038159; Mon, 14 Dec 2009 20:59:01 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912142059.nBEKx1M3038159@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 20:59: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: r200542 - head/share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:59:02 -0000 Author: dougb Date: Mon Dec 14 20:59:01 2009 New Revision: 200542 URL: http://svn.freebsd.org/changeset/base/200542 Log: Improve the markup Submitted by: ru Modified: head/share/termcap/termcap.5 Modified: head/share/termcap/termcap.5 ============================================================================== --- head/share/termcap/termcap.5 Mon Dec 14 20:49:50 2009 (r200541) +++ head/share/termcap/termcap.5 Mon Dec 14 20:59:01 2009 (r200542) @@ -2003,13 +2003,16 @@ supports these capabilities. For the .Xr xterm 1 terminal emulator the traditional behavior in -FreeBSD when exiting a pager such as +.Fx +when exiting a pager such as .Xr less 1 or .Xr more 1 , or an editor such as .Xr vi 1 -is NOT to clear the screen after the program exits. +is +.Em NOT +to clear the screen after the program exits. If you prefer to clear the screen there are a number of .Dq xterm-clear entries that add this capability in the From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 20:59:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE3B1065740; Mon, 14 Dec 2009 20:59: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 0F8128FC15; Mon, 14 Dec 2009 20:59: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 nBEKxIB6038204; Mon, 14 Dec 2009 20:59:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKxIIx038201; Mon, 14 Dec 2009 20:59:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142059.nBEKxIIx038201@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200543 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:59:19 -0000 Author: yongari Date: Mon Dec 14 20:59:18 2009 New Revision: 200543 URL: http://svn.freebsd.org/changeset/base/200543 Log: Increase output queue size from 64 to 255. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:59:01 2009 (r200542) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:59:18 2009 (r200543) @@ -1061,8 +1061,8 @@ vge_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif ifp->if_init = vge_init; - IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, VGE_TX_DESC_CNT - 1); + ifp->if_snd.ifq_drv_maxlen = VGE_TX_DESC_CNT - 1; IFQ_SET_READY(&ifp->if_snd); /* Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:59:01 2009 (r200542) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:59:18 2009 (r200543) @@ -34,8 +34,6 @@ #define VGE_JUMBO_MTU 9000 -#define VGE_IFQ_MAXLEN 64 - #define VGE_TX_DESC_CNT 256 #define VGE_RX_DESC_CNT 252 /* Must be a multiple of 4!! */ #define VGE_TX_RING_ALIGN 64 From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 21:02:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA811065692; Mon, 14 Dec 2009 21:02:17 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id A31578FC15; Mon, 14 Dec 2009 21:02:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KUN00FSNUFJ9060@asmtp029.mac.com>; Mon, 14 Dec 2009 13:02:08 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200912142004.nBEK462J036724@svn.freebsd.org> Date: Mon, 14 Dec 2009 13:02:07 -0800 Message-id: <4888543E-3E2A-4630-AB03-DD2C5C6224E0@mac.com> References: <200912142004.nBEK462J036724@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200534 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:02:17 -0000 On Dec 14, 2009, at 12:04 PM, Rui Paulo wrote: > Author: rpaulo > Date: Mon Dec 14 20:04:06 2009 > New Revision: 200534 > URL: http://svn.freebsd.org/changeset/base/200534 > > Log: > Simplify partition type parsing by using a data-oriented model. > While there add more Apple and Linux partition types. If you add new aliases, you should update *all* schemes (where applicable). "apple-hfs" is known to APM as well (the scheme- specific type is "Apple_HFS"). I'm sure Linux and MS Windows partition types exist for MBR and EBR. Linux partitition types exist also for VTOC8 and APM. NetBSD partition types can be found on pretty much all schemes. Please update the other schemes as well. Thanks, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 21:11:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D55106566C; Mon, 14 Dec 2009 21:11:50 +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 834598FC14; Mon, 14 Dec 2009 21:11: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 nBELBomi038551; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELBogp038549; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912142111.nBELBogp038549@svn.freebsd.org> From: Marius Strobl Date: Mon, 14 Dec 2009 21:11: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: r200544 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:11:50 -0000 Author: marius Date: Mon Dec 14 21:11:50 2009 New Revision: 200544 URL: http://svn.freebsd.org/changeset/base/200544 Log: Set ATA_CHECKS_CABLE when appropriate. Reviewed by: mav MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-amd.c Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 20:59:18 2009 (r200543) +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 21:11:50 2009 (r200544) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ +static int ata_amd_ch_attach(device_t dev); static int ata_amd_chipinit(device_t dev); static int ata_amd_setmode(device_t dev, int target, int mode); @@ -59,7 +60,6 @@ static int ata_amd_setmode(device_t dev, #define AMD_BUG 0x01 #define AMD_CABLE 0x02 - /* * American Micro Devices (AMD) chipset support functions */ @@ -100,6 +100,7 @@ ata_amd_chipinit(device_t dev) else pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1); + ctlr->ch_attach = ata_amd_ch_attach; ctlr->setmode = ata_amd_setmode; return 0; } @@ -137,4 +138,19 @@ ata_amd_setmode(device_t dev, int target return (mode); } +static int +ata_amd_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + int error; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + error = ata_pci_ch_attach(dev); + if (ctlr->chip->cfg1 & AMD_CABLE) + ch->flags |= ATA_CHECKS_CABLE; + return (error); +} + ATA_DECLARE_DRIVER(ata_amd); From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 21:16:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C392F106566C; Mon, 14 Dec 2009 21:16:02 +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 99A208FC17; Mon, 14 Dec 2009 21:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBELG2gB038706; Mon, 14 Dec 2009 21:16:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELG2uh038704; Mon, 14 Dec 2009 21:16:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142116.nBELG2uh038704@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 21:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200545 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:16:02 -0000 Author: yongari Date: Mon Dec 14 21:16:02 2009 New Revision: 200545 URL: http://svn.freebsd.org/changeset/base/200545 Log: We don't have to reload EEPROM in vge_reset(). Because vge_reset() is called in vge_init_lock(), vge(4) always used to reload EEPROM. Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit. While I'm here add missing new line in vge_reset(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 21:11:50 2009 (r200544) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 21:16:02 2009 (r200545) @@ -586,27 +586,12 @@ vge_reset(struct vge_softc *sc) } if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "soft reset timed out"); + device_printf(sc->vge_dev, "soft reset timed out\n"); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_STOP_FORCE); DELAY(2000); } DELAY(5000); - - CSR_SETBIT_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); - - for (i = 0; i < VGE_TIMEOUT; i++) { - DELAY(5); - if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) - break; - } - - if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "EEPROM reload timed out\n"); - return; - } - - CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); } /* @@ -958,7 +943,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, cap, msic, rid; + int error = 0, cap, i, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1012,6 +997,21 @@ vge_attach(device_t dev) /* Reset the adapter. */ vge_reset(sc); + /* Reload EEPROM. */ + CSR_WRITE_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); + for (i = 0; i < VGE_TIMEOUT; i++) { + DELAY(5); + if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) + break; + } + if (i == VGE_TIMEOUT) + device_printf(dev, "EEPROM reload timed out\n"); + /* + * Clear PACPI as EEPROM reload will set the bit. Otherwise + * MAC will receive magic packet which in turn confuses + * controller. + */ + CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); /* * Get station address from the EEPROM. From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 21:50:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DF91065672; Mon, 14 Dec 2009 21:50:35 +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 22AEB8FC14; Mon, 14 Dec 2009 21:50: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 nBELoZS1039479; Mon, 14 Dec 2009 21:50:35 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELoZRH039477; Mon, 14 Dec 2009 21:50:35 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912142150.nBELoZRH039477@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 21:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200546 - stable/8/contrib/bind9/bin/dig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:50:35 -0000 Author: dougb Date: Mon Dec 14 21:50:34 2009 New Revision: 200546 URL: http://svn.freebsd.org/changeset/base/200546 Log: Wrap some socket handling code in a !NULL bow This patch or something similar will likely be included in a future BIND release. PR: bin/138061 Submitted by: Michael Baker Original patch submitted by: Volker Patch reviewed and tweaked by: ISC Modified: stable/8/contrib/bind9/bin/dig/dighost.c Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/bin/dig/dighost.c ============================================================================== --- stable/8/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:16:02 2009 (r200545) +++ stable/8/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:50:34 2009 (r200546) @@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event if (sevent->result == ISC_R_CANCELED) { debug("in cancel handler"); - isc_socket_detach(&query->sock); - sockcount--; - INSIST(sockcount >= 0); - debug("sockcount=%d", sockcount); + if (query->sock != NULL) { + isc_socket_detach(&query->sock); + sockcount--; + INSIST(sockcount >= 0); + debug("sockcount=%d", sockcount); + } query->waiting_connect = ISC_FALSE; isc_event_free(&event); l = query->lookup; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 21:51:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C851065697; Mon, 14 Dec 2009 21:51:36 +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 C4C2C8FC1B; Mon, 14 Dec 2009 21:51: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 nBELpaUo039549; Mon, 14 Dec 2009 21:51:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELpa6f039547; Mon, 14 Dec 2009 21:51:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912142151.nBELpa6f039547@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 21:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200547 - stable/7/contrib/bind9/bin/dig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:51:36 -0000 Author: dougb Date: Mon Dec 14 21:51:36 2009 New Revision: 200547 URL: http://svn.freebsd.org/changeset/base/200547 Log: Wrap some socket handling code in a !NULL bow This patch or something similar will likely be included in a future BIND release. PR: bin/138061 Submitted by: Michael Baker Original patch submitted by: Volker Patch reviewed and tweaked by: ISC Modified: stable/7/contrib/bind9/bin/dig/dighost.c Directory Properties: stable/7/contrib/bind9/ (props changed) Modified: stable/7/contrib/bind9/bin/dig/dighost.c ============================================================================== --- stable/7/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:50:34 2009 (r200546) +++ stable/7/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:51:36 2009 (r200547) @@ -2539,10 +2539,12 @@ connect_done(isc_task_t *task, isc_event if (sevent->result == ISC_R_CANCELED) { debug("in cancel handler"); - isc_socket_detach(&query->sock); - sockcount--; - INSIST(sockcount >= 0); - debug("sockcount=%d", sockcount); + if (query->sock != NULL) { + isc_socket_detach(&query->sock); + sockcount--; + INSIST(sockcount >= 0); + debug("sockcount=%d", sockcount); + } query->waiting_connect = ISC_FALSE; isc_event_free(&event); l = query->lookup; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:00:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF66E1065676; Mon, 14 Dec 2009 22:00: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 AE8138FC15; Mon, 14 Dec 2009 22:00: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 nBEM0B07039840; Mon, 14 Dec 2009 22:00:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEM0Bj5039838; Mon, 14 Dec 2009 22:00:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142200.nBEM0Bj5039838@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:00: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: r200548 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:00:12 -0000 Author: yongari Date: Mon Dec 14 22:00:11 2009 New Revision: 200548 URL: http://svn.freebsd.org/changeset/base/200548 Log: Sort function prototyes. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 21:51:36 2009 (r200547) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:00:11 2009 (r200548) @@ -140,56 +140,52 @@ static struct vge_type vge_devs[] = { { 0, 0, NULL } }; -static int vge_probe (device_t); -static int vge_attach (device_t); -static int vge_detach (device_t); - -static int vge_encap (struct vge_softc *, struct mbuf **); - -static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); -static int vge_dma_alloc (struct vge_softc *); -static void vge_dma_free (struct vge_softc *); -static void vge_discard_rxbuf (struct vge_softc *, int); -static int vge_newbuf (struct vge_softc *, int); -static int vge_rx_list_init (struct vge_softc *); -static int vge_tx_list_init (struct vge_softc *); -static void vge_freebufs (struct vge_softc *); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void vge_fixup_rx - (struct mbuf *); -#endif -static int vge_rxeof (struct vge_softc *, int); -static void vge_txeof (struct vge_softc *); -static void vge_intr (void *); -static void vge_tick (void *); -static void vge_start (struct ifnet *); -static void vge_start_locked (struct ifnet *); -static int vge_ioctl (struct ifnet *, u_long, caddr_t); -static void vge_init (void *); -static void vge_init_locked (struct vge_softc *); -static void vge_stop (struct vge_softc *); -static void vge_watchdog (void *); -static int vge_suspend (device_t); -static int vge_resume (device_t); -static int vge_shutdown (device_t); -static int vge_ifmedia_upd (struct ifnet *); -static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); - +static int vge_attach(device_t); +static int vge_detach(device_t); +static int vge_probe(device_t); +static int vge_resume(device_t); +static int vge_shutdown(device_t); +static int vge_suspend(device_t); + +static void vge_cam_clear(struct vge_softc *); +static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_discard_rxbuf(struct vge_softc *, int); +static int vge_dma_alloc(struct vge_softc *); +static void vge_dma_free(struct vge_softc *); +static void vge_dmamap_cb(void *, bus_dma_segment_t *, int, int); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); +static void vge_eeprom_getword(struct vge_softc *, int, uint16_t *); #endif -static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); - -static void vge_miipoll_start (struct vge_softc *); -static void vge_miipoll_stop (struct vge_softc *); -static int vge_miibus_readreg (device_t, int, int); -static int vge_miibus_writereg (device_t, int, int, int); -static void vge_miibus_statchg (device_t); - -static void vge_cam_clear (struct vge_softc *); -static int vge_cam_set (struct vge_softc *, uint8_t *); -static void vge_setmulti (struct vge_softc *); -static void vge_reset (struct vge_softc *); +static int vge_encap(struct vge_softc *, struct mbuf **); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void + vge_fixup_rx(struct mbuf *); +#endif +static void vge_freebufs(struct vge_softc *); +static void vge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int vge_ifmedia_upd(struct ifnet *); +static void vge_init(void *); +static void vge_init_locked(struct vge_softc *); +static void vge_intr(void *); +static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static int vge_miibus_readreg(device_t, int, int); +static void vge_miibus_statchg(device_t); +static int vge_miibus_writereg(device_t, int, int, int); +static void vge_miipoll_start(struct vge_softc *); +static void vge_miipoll_stop(struct vge_softc *); +static int vge_newbuf(struct vge_softc *, int); +static void vge_read_eeprom(struct vge_softc *, caddr_t, int, int, int); +static void vge_reset(struct vge_softc *); +static int vge_rx_list_init(struct vge_softc *); +static int vge_rxeof(struct vge_softc *, int); +static void vge_setmulti(struct vge_softc *); +static void vge_start(struct ifnet *); +static void vge_start_locked(struct ifnet *); +static void vge_stop(struct vge_softc *); +static void vge_tick(void *); +static int vge_tx_list_init(struct vge_softc *); +static void vge_txeof(struct vge_softc *); +static void vge_watchdog(void *); static device_method_t vge_methods[] = { /* Device interface */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:07:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF0A106568D; Mon, 14 Dec 2009 22:07:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6EDB8FC15; Mon, 14 Dec 2009 22:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEM7XC2040052; Mon, 14 Dec 2009 22:07:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEM7Xn3040028; Mon, 14 Dec 2009 22:07:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142207.nBEM7Xn3040028@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200549 - in vendor-sys/acpica/dist: . compiler debugger disassembler dispatcher events executer include namespace parser resources tools/acpiexec utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:07:34 -0000 Author: jkim Date: Mon Dec 14 22:07:33 2009 New Revision: 200549 URL: http://svn.freebsd.org/changeset/base/200549 Log: Import ACPICA 20091214. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/compiler/aslcompile.c vendor-sys/acpica/dist/debugger/dbutils.c vendor-sys/acpica/dist/disassembler/dmwalk.c vendor-sys/acpica/dist/dispatcher/dsmethod.c vendor-sys/acpica/dist/dispatcher/dswload.c vendor-sys/acpica/dist/events/evregion.c vendor-sys/acpica/dist/events/evrgnini.c vendor-sys/acpica/dist/events/evxface.c vendor-sys/acpica/dist/events/evxfevnt.c vendor-sys/acpica/dist/events/evxfregn.c vendor-sys/acpica/dist/executer/exmutex.c vendor-sys/acpica/dist/include/acnamesp.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acoutput.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/namespace/nsaccess.c vendor-sys/acpica/dist/namespace/nsdump.c vendor-sys/acpica/dist/namespace/nseval.c vendor-sys/acpica/dist/namespace/nsnames.c vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsrepair.c vendor-sys/acpica/dist/namespace/nsrepair2.c vendor-sys/acpica/dist/namespace/nsutils.c vendor-sys/acpica/dist/namespace/nsxfeval.c vendor-sys/acpica/dist/namespace/nsxfname.c vendor-sys/acpica/dist/namespace/nsxfobj.c vendor-sys/acpica/dist/parser/psxface.c vendor-sys/acpica/dist/resources/rsxface.c vendor-sys/acpica/dist/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/tools/acpiexec/aemain.c vendor-sys/acpica/dist/utilities/utcopy.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/changes.txt Mon Dec 14 22:07:33 2009 (r200549) @@ -1,4 +1,71 @@ ---------------------------------------- +14 December 2009. Summary of changes for version 20091214: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Enhanced automatic data type conversions for predefined name repairs. This +change expands the automatic repairs/conversions for predefined name return +values to make Integers, Strings, and Buffers fully interchangeable. Also, a +Buffer can be converted to a Package of Integers if necessary. The nsrepair.c +module was completely restructured. Lin Ming, Bob Moore. + +Implemented automatic removal of null package elements during predefined name +repairs. This change will automatically remove embedded and trailing NULL +package elements from returned package objects that are defined to contain a +variable number of sub-packages. The driver is then presented with a package +with no null elements to deal with. ACPICA BZ 819. + +Implemented a repair for the predefined _FDE and _GTM names. The expected +return value for both names is a Buffer of 5 DWORDs. This repair fixes two +possible problems (both seen in the field), where a package of integers is +returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. + +Implemented additional module-level code support. This change will properly +execute module-level code that is not at the root of the namespace (under a +Device object, etc.). Now executes the code within the current scope instead +of the root. ACPICA BZ 762. Lin Ming. + +Fixed possible mutex acquisition errors when running _REG methods. Fixes a +problem where mutex errors can occur when running a _REG method that is in +the same scope as a method-defined operation region or an operation region +under a module-level IF block. This type of code is rare, so the problem has +not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. + +Fixed a possible memory leak during module-level code execution. An object +could be leaked for each block of executed module-level code if the +interpreter slack mode is enabled This change deletes any implicitly returned +object from the module-level code block. Lin Ming. + +Removed messages for successful predefined repair(s). The repair mechanism +was considered too wordy. Now, messages are only unconditionally emitted if +the return object cannot be repaired. Existing messages for successful +repairs were converted to ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + Current Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression introduced in 20091112 where intermediate .SRC files +were no longer automatically removed at the termination of the compile. + +acpiexec: Implemented the -f option to specify default region fill value. +This option specifies the value used to initialize buffers that simulate +operation regions. Default value is zero. Useful for debugging problems that +depend on a specific initial value for a region or field. + +---------------------------------------- 12 November 2009. Summary of changes for version 20091112: This release is available at www.acpica.org/downloads Modified: vendor-sys/acpica/dist/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompile.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/compiler/aslcompile.c Mon Dec 14 22:07:33 2009 (r200549) @@ -895,20 +895,6 @@ CmCleanupAndExit ( 10) / Gbl_NsLookupCount); } - /* - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? - */ - if (!Gbl_SourceOutputFlag) - { - remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - - /* Delete AML file if there are errors */ - - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) - { - remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { @@ -923,6 +909,27 @@ CmCleanupAndExit ( { FlCloseFile (i); } + + /* Delete AML file if there are errors */ + + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + { + remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); + } + + /* + * Delete intermediate ("combined") source file (if -ls flag not set) + * + * TBD: SourceOutput should be .TMP, then rename if we want to keep it? + */ + if (!Gbl_SourceOutputFlag) + { + if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) + { + printf ("Could not remove SRC file, %s\n", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + } } Modified: vendor-sys/acpica/dist/debugger/dbutils.c ============================================================================== --- vendor-sys/acpica/dist/debugger/dbutils.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/debugger/dbutils.c Mon Dec 14 22:07:33 2009 (r200549) @@ -275,6 +275,10 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { + if (ObjDesc->Buffer.Length > 16) + { + AcpiOsPrintf ("\n"); + } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } Modified: vendor-sys/acpica/dist/disassembler/dmwalk.c ============================================================================== --- vendor-sys/acpica/dist/disassembler/dmwalk.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/disassembler/dmwalk.c Mon Dec 14 22:07:33 2009 (r200549) @@ -160,7 +160,6 @@ AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); - /******************************************************************************* * * FUNCTION: AcpiDmDisassemble Modified: vendor-sys/acpica/dist/dispatcher/dsmethod.c ============================================================================== --- vendor-sys/acpica/dist/dispatcher/dsmethod.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/dispatcher/dsmethod.c Mon Dec 14 22:07:33 2009 (r200549) @@ -519,7 +519,7 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = ObjDesc->Method.Implementation (NextWalkState); + Status = ObjDesc->Method.Extra.Implementation (NextWalkState); if (Status == AE_OK) { Status = AE_CTRL_TERMINATE; Modified: vendor-sys/acpica/dist/dispatcher/dswload.c ============================================================================== --- vendor-sys/acpica/dist/dispatcher/dswload.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/dispatcher/dswload.c Mon Dec 14 22:07:33 2009 (r200549) @@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report - * a warning + * Note: silently change the type here. On the second pass, + * we will report a warning */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", - Path, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", - AcpiUtGetTypeName (Node->Type), Path)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -794,15 +796,16 @@ AcpiDsLoad2BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ ACPI_WARNING ((AE_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", - BufferPtr, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -813,8 +816,9 @@ AcpiDsLoad2BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s]", - AcpiUtGetTypeName (Node->Type), BufferPtr)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return (AE_AML_OPERAND_TYPE); } @@ -1154,33 +1158,40 @@ AcpiDsLoad2EndOp ( } /* - * If we are executing a method, initialize the region + * The OpRegion is not fully parsed at this time. The only valid + * argument is the SpaceId. (We must save the address of the + * AML of the address and length operands) + * + * If we have a valid region, initialize it. The namespace is + * unlocked at this point. + * + * Need to unlock interpreter if it is locked (if we are running + * a control method), in order to allow _REG methods to be run + * during AcpiEvInitializeRegion. */ if (WalkState->MethodNode) { + /* + * Executing a method: initialize the region and unlock + * the interpreter + */ Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { return (Status); } - } - /* - * The OpRegion is not fully parsed at this time. Only valid - * argument is the SpaceId. (We must save the address of the - * AML of the address and length operands) - */ + AcpiExExitInterpreter (); + } - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - * - * TBD: need to unlock interpreter if it is locked, in order - * to allow _REG methods to be run. - */ Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node), FALSE); + if (WalkState->MethodNode) + { + AcpiExEnterInterpreter (); + } + if (ACPI_FAILURE (Status)) { /* Modified: vendor-sys/acpica/dist/events/evregion.c ============================================================================== --- vendor-sys/acpica/dist/events/evregion.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/events/evregion.c Mon Dec 14 22:07:33 2009 (r200549) @@ -845,7 +845,7 @@ AcpiEvInstallHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1243,7 +1243,7 @@ AcpiEvRegRun ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); Modified: vendor-sys/acpica/dist/events/evrgnini.c ============================================================================== --- vendor-sys/acpica/dist/events/evrgnini.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/events/evrgnini.c Mon Dec 14 22:07:33 2009 (r200549) @@ -716,6 +716,20 @@ AcpiEvInitializeRegion ( HandlerObj = ObjDesc->ThermalZone.Handler; break; + case ACPI_TYPE_METHOD: + /* + * If we are executing module level code, the original + * Node's object was replaced by this Method object and we + * saved the handler in the method object. + * + * See AcpiNsExecModuleCode + */ + if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + HandlerObj = ObjDesc->Method.Extra.Handler; + } + break; + default: /* Ignore other objects */ break; Modified: vendor-sys/acpica/dist/events/evxface.c ============================================================================== --- vendor-sys/acpica/dist/events/evxface.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/events/evxface.c Mon Dec 14 22:07:33 2009 (r200549) @@ -368,7 +368,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; Modified: vendor-sys/acpica/dist/events/evxfevnt.c ============================================================================== --- vendor-sys/acpica/dist/events/evxfevnt.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/events/evxfevnt.c Mon Dec 14 22:07:33 2009 (r200549) @@ -805,7 +805,7 @@ AcpiInstallGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ AcpiRemoveGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; Modified: vendor-sys/acpica/dist/events/evxfregn.c ============================================================================== --- vendor-sys/acpica/dist/events/evxfregn.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/events/evxfregn.c Mon Dec 14 22:07:33 2009 (r200549) @@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && Modified: vendor-sys/acpica/dist/executer/exmutex.c ============================================================================== --- vendor-sys/acpica/dist/executer/exmutex.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/executer/exmutex.c Mon Dec 14 22:07:33 2009 (r200549) @@ -490,6 +490,15 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } + /* Must have a valid thread ID */ + + if (!WalkState->Thread) + { + ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", + AcpiUtGetNodeName (ObjDesc->Mutex.Node))); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + /* * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release @@ -505,15 +514,6 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_NOT_OWNER); } - /* Must have a valid thread ID */ - - if (!WalkState->Thread) - { - ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", - AcpiUtGetNodeName (ObjDesc->Mutex.Node))); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - /* * The sync level of the mutex must be equal to the current sync level. In * other words, the current level means that at least one mutex at that Modified: vendor-sys/acpica/dist/include/acnamesp.h ============================================================================== --- vendor-sys/acpica/dist/include/acnamesp.h Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/include/acnamesp.h Mon Dec 14 22:07:33 2009 (r200549) @@ -456,6 +456,11 @@ AcpiNsComplexRepairs ( ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); /* * nssearch - Namespace searching and entry @@ -542,13 +547,9 @@ AcpiNsExternalizeName ( char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); Modified: vendor-sys/acpica/dist/include/acobject.h ============================================================================== --- vendor-sys/acpica/dist/include/acobject.h Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/include/acobject.h Mon Dec 14 22:07:33 2009 (r200549) @@ -288,7 +288,12 @@ typedef struct acpi_object_method UINT8 SyncLevel; union acpi_operand_object *Mutex; UINT8 *AmlStart; - ACPI_INTERNAL_METHOD Implementation; + union + { + ACPI_INTERNAL_METHOD Implementation; + union acpi_operand_object *Handler; + } Extra; + UINT32 AmlLength; UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; Modified: vendor-sys/acpica/dist/include/acoutput.h ============================================================================== --- vendor-sys/acpica/dist/include/acoutput.h Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/include/acoutput.h Mon Dec 14 22:07:33 2009 (r200549) @@ -158,7 +158,8 @@ #define ACPI_LV_INIT 0x00000001 #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 -#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 +#define ACPI_LV_REPAIR 0x00000008 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -217,6 +218,7 @@ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) +#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ @@ -248,8 +250,8 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) Modified: vendor-sys/acpica/dist/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/include/acpixf.h Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/include/acpixf.h Mon Dec 14 22:07:33 2009 (r200549) @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20091112 +#define ACPI_CA_VERSION 0x20091214 #include "actypes.h" #include "actbl.h" Modified: vendor-sys/acpica/dist/namespace/nsaccess.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nsaccess.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nsaccess.c Mon Dec 14 22:07:33 2009 (r200549) @@ -251,7 +251,7 @@ AcpiNsRootInitialize ( /* Mark this as a very SPECIAL method */ ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY; - ObjDesc->Method.Implementation = AcpiUtOsiImplementation; + ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation; #endif break; Modified: vendor-sys/acpica/dist/namespace/nsdump.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nsdump.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nsdump.c Mon Dec 14 22:07:33 2009 (r200549) @@ -286,7 +286,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - ThisNode = AcpiNsMapHandleToNode (ObjHandle); + ThisNode = AcpiNsValidateHandle (ObjHandle); if (!ThisNode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", Modified: vendor-sys/acpica/dist/namespace/nseval.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nseval.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nseval.c Mon Dec 14 22:07:33 2009 (r200549) @@ -477,6 +477,19 @@ AcpiNsExecModuleCode ( MethodObj->Method.NextObject); Type = AcpiNsGetType (ParentNode); + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) + { + MethodObj->Method.Extra.Handler = + ParentNode->Object->Device.Handler; + } + /* Must clear NextObject (AcpiNsAttachObject needs the field) */ MethodObj->Method.NextObject = NULL; @@ -513,6 +526,13 @@ AcpiNsExecModuleCode ( ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); + /* Delete a possible implicit return value (in slack mode) */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + } + /* Detach the temporary method object */ AcpiNsDetachObject (ParentNode); Modified: vendor-sys/acpica/dist/namespace/nsnames.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nsnames.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nsnames.c Mon Dec 14 22:07:33 2009 (r200549) @@ -337,7 +337,7 @@ AcpiNsHandleToPathname ( ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); Modified: vendor-sys/acpica/dist/namespace/nspredef.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nspredef.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nspredef.c Mon Dec 14 22:07:33 2009 (r200549) @@ -313,31 +313,40 @@ AcpiNsCheckPredefinedNames ( Data->Pathname = Pathname; /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { - goto CheckValidationStatus; + goto Exit; } - /* For returned Package objects, check the type of all sub-objects */ - - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) + /* + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } } /* - * Perform additional, more complicated repairs on a per-name - * basis. + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. */ Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); - -CheckValidationStatus: +Exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning @@ -349,7 +358,6 @@ CheckValidationStatus: } ACPI_FREE (Data); - Cleanup: ACPI_FREE (Pathname); return (Status); @@ -544,6 +552,12 @@ AcpiNsCheckPackage ( "%s Validating return Package of Type %X, Count %X\n", Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); + /* Extract package count and elements array */ Elements = ReturnObject->Package.Elements; @@ -582,9 +596,10 @@ AcpiNsCheckPackage ( } else if (Count > ExpectedCount) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is larger than needed - " - "found %u, expected %u", Count, ExpectedCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ @@ -800,56 +815,20 @@ AcpiNsCheckPackageList ( ACPI_OPERAND_OBJECT *SubPackage; ACPI_OPERAND_OBJECT **SubElements; ACPI_STATUS Status; - BOOLEAN NonTrailingNull = FALSE; UINT32 ExpectedCount; UINT32 i; UINT32 j; - /* Validate each sub-Package in the parent Package */ - + /* + * Validate each sub-Package in the parent Package + * + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ for (i = 0; i < Count; i++) { - /* - * Handling for NULL package elements. For now, we will simply allow - * a parent package with trailing NULL elements. This can happen if - * the package was defined to be longer than the initializer list. - * This is legal as per the ACPI specification. It is often used - * to allow for dynamic initialization of a Package. - * - * A future enhancement may be to simply truncate the package to - * remove the trailing NULL elements. - */ - if (!(*Elements)) - { - if (!NonTrailingNull) - { - /* Ensure the remaining elements are all NULL */ - - for (j = 1; j < (Count - i + 1); j++) - { - if (Elements[j]) - { - NonTrailingNull = TRUE; - } - } - - if (!NonTrailingNull) - { - /* Ignore the trailing NULL elements */ - - return (AE_OK); - } - } - - /* There are trailing non-null elements, issue warning */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Found NULL element at package index %u", i)); - Elements++; - continue; - } - SubPackage = *Elements; SubElements = SubPackage->Package.Elements; Modified: vendor-sys/acpica/dist/namespace/nsrepair.c ============================================================================== --- vendor-sys/acpica/dist/namespace/nsrepair.c Mon Dec 14 22:00:11 2009 (r200548) +++ vendor-sys/acpica/dist/namespace/nsrepair.c Mon Dec 14 22:07:33 2009 (r200549) @@ -119,7 +119,6 @@ #include "accommon.h" #include "acnamesp.h" #include "acinterp.h" -#include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -127,6 +126,54 @@ /******************************************************************************* * + * This module attempts to repair or convert objects returned by the + * predefined methods to an object type that is expected, as per the ACPI + * specification. The need for this code is dictated by the many machines that + * return incorrect types for the standard predefined methods. Performing these + * conversions here, in one place, eliminates the need for individual ACPI + * device drivers to do the same. Note: Most of these conversions are different + * than the internal object conversion routines used for implicit object + * conversion. + * + * The following conversions can be performed as necessary: + * + * Integer -> String + * Integer -> Buffer + * String -> Integer + * String -> Buffer + * Buffer -> Integer + * Buffer -> String + * Buffer -> Package of Integers + * Package -> Package of one Package + * + ******************************************************************************/ + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + +/******************************************************************************* + * * FUNCTION: AcpiNsRepairObject * * PARAMETERS: Data - Pointer to validation data structure @@ -153,35 +200,230 @@ AcpiNsRepairObject ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsRepairObject); + + /* * At this point, we know that the type of the returned object was not * one of the expected types for this predefined name. Attempt to - * repair the object. Only a limited number of repairs are possible. + * repair the object by converting it to one of the expected object + * types for this predefined name. */ - switch (ReturnObject->Common.Type) + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) + { + Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + Status = AcpiNsConvertToString (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + + /* We cannot repair this object */ + + return (AE_AML_OPERAND_TYPE); + + +ObjectRepaired: + + /* Object was successfully repaired */ + + /* + * If the original object is a package element, we need to: + * 1. Set the reference count of the new object to match the + * reference count of the old object. + * 2. Decrement the reference count of the original object. + */ + if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + { + NewObject->Common.ReferenceCount = + ReturnObject->Common.ReferenceCount; + + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject))); + } + + /* Delete old object, install the new return object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + case ACPI_TYPE_BUFFER: - /* Does the method/object legally return a string? */ + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + if (OriginalObject->Buffer.Length > 8) { return (AE_AML_OPERAND_TYPE); } + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: /* - * Have a Buffer, expected a String, convert. Use a ToString + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:08:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF8B106568B; Mon, 14 Dec 2009 22:08:36 +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 016CA8FC1E; Mon, 14 Dec 2009 22:08: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 nBEM8ZA0040111; Mon, 14 Dec 2009 22:08:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEM8ZU2040110; Mon, 14 Dec 2009 22:08:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142208.nBEM8ZU2040110@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200550 - vendor-sys/acpica/20091214 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:08:36 -0000 Author: jkim Date: Mon Dec 14 22:08:35 2009 New Revision: 200550 URL: http://svn.freebsd.org/changeset/base/200550 Log: Tag ACPICA 20091214. Added: vendor-sys/acpica/20091214/ - copied from r200549, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:20:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8446D106566B; Mon, 14 Dec 2009 22:20: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 250738FC08; Mon, 14 Dec 2009 22:20: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 nBEMK6cB040418; Mon, 14 Dec 2009 22:20:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMK6VO040416; Mon, 14 Dec 2009 22:20:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142220.nBEMK6VO040416@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:20: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: r200551 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:20:06 -0000 Author: yongari Date: Mon Dec 14 22:20:05 2009 New Revision: 200551 URL: http://svn.freebsd.org/changeset/base/200551 Log: Whenever link state change interrupt is raised, vge_tick() is called and vge(4) used to drive auto-negotiation timer(mii_tick) in vge_tick(). Therefore the mii_tick was not called for every hz such that auto-negotiation complete was never handled in vge(4). Use mii_pollstat to extract current negotiated speed/duplex instead of mii_tick. The latter is valid only for auto-negotiation case. While I'm here change the confusing function name vge_tick() to vge_link_statchg(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:08:35 2009 (r200550) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:20:05 2009 (r200551) @@ -168,6 +168,7 @@ static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); @@ -182,7 +183,6 @@ static void vge_setmulti(struct vge_soft static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); -static void vge_tick(void *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1595,7 +1595,7 @@ vge_txeof(struct vge_softc *sc) } static void -vge_tick(void *xsc) +vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1606,7 +1606,7 @@ vge_tick(void *xsc) VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); - mii_tick(mii); + mii_pollstat(mii); if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { sc->vge_flags &= ~VGE_FLAG_LINK; @@ -1735,7 +1735,7 @@ vge_intr(void *arg) } if (status & VGE_ISR_LINKSTS) - vge_tick(sc); + vge_link_statchg(sc); } /* Re-enable interrupts */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:23:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9040E1065670; Mon, 14 Dec 2009 22:23: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 803218FC18; Mon, 14 Dec 2009 22:23: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 nBEMN6JF040524; Mon, 14 Dec 2009 22:23:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMN6hq040522; Mon, 14 Dec 2009 22:23:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142223.nBEMN6hq040522@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:23: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: r200552 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:23:06 -0000 Author: yongari Date: Mon Dec 14 22:23:06 2009 New Revision: 200552 URL: http://svn.freebsd.org/changeset/base/200552 Log: Report media change result to caller instead of returning success without regard to the result. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:20:05 2009 (r200551) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:23:06 2009 (r200552) @@ -2153,14 +2153,15 @@ vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; VGE_LOCK(sc); mii = device_get_softc(sc->vge_miibus); - mii_mediachg(mii); + error = mii_mediachg(mii); VGE_UNLOCK(sc); - return (0); + return (error); } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:24:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7BE106566C; Mon, 14 Dec 2009 22:24:05 +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 293078FC08; Mon, 14 Dec 2009 22: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 nBEMO5LW040600; Mon, 14 Dec 2009 22:24:05 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMO4rC040576; Mon, 14 Dec 2009 22:24:04 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142224.nBEMO4rC040576@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22: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: r200553 - in head/sys/contrib/dev/acpica: . compiler debugger disassembler dispatcher events executer include namespace parser resources tools/acpiexec utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:24:05 -0000 Author: jkim Date: Mon Dec 14 22:24:04 2009 New Revision: 200553 URL: http://svn.freebsd.org/changeset/base/200553 Log: Merge ACPICA 20091214. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/debugger/dbutils.c head/sys/contrib/dev/acpica/disassembler/dmwalk.c head/sys/contrib/dev/acpica/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/dispatcher/dswload.c head/sys/contrib/dev/acpica/events/evregion.c head/sys/contrib/dev/acpica/events/evrgnini.c head/sys/contrib/dev/acpica/events/evxface.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/events/evxfregn.c head/sys/contrib/dev/acpica/executer/exmutex.c head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/namespace/nsaccess.c head/sys/contrib/dev/acpica/namespace/nsdump.c head/sys/contrib/dev/acpica/namespace/nseval.c head/sys/contrib/dev/acpica/namespace/nsnames.c head/sys/contrib/dev/acpica/namespace/nspredef.c head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/namespace/nsrepair2.c head/sys/contrib/dev/acpica/namespace/nsutils.c head/sys/contrib/dev/acpica/namespace/nsxfeval.c head/sys/contrib/dev/acpica/namespace/nsxfname.c head/sys/contrib/dev/acpica/namespace/nsxfobj.c head/sys/contrib/dev/acpica/parser/psxface.c head/sys/contrib/dev/acpica/resources/rsxface.c head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h head/sys/contrib/dev/acpica/utilities/utcopy.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/changes.txt Mon Dec 14 22:24:04 2009 (r200553) @@ -1,4 +1,71 @@ ---------------------------------------- +14 December 2009. Summary of changes for version 20091214: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Enhanced automatic data type conversions for predefined name repairs. This +change expands the automatic repairs/conversions for predefined name return +values to make Integers, Strings, and Buffers fully interchangeable. Also, a +Buffer can be converted to a Package of Integers if necessary. The nsrepair.c +module was completely restructured. Lin Ming, Bob Moore. + +Implemented automatic removal of null package elements during predefined name +repairs. This change will automatically remove embedded and trailing NULL +package elements from returned package objects that are defined to contain a +variable number of sub-packages. The driver is then presented with a package +with no null elements to deal with. ACPICA BZ 819. + +Implemented a repair for the predefined _FDE and _GTM names. The expected +return value for both names is a Buffer of 5 DWORDs. This repair fixes two +possible problems (both seen in the field), where a package of integers is +returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. + +Implemented additional module-level code support. This change will properly +execute module-level code that is not at the root of the namespace (under a +Device object, etc.). Now executes the code within the current scope instead +of the root. ACPICA BZ 762. Lin Ming. + +Fixed possible mutex acquisition errors when running _REG methods. Fixes a +problem where mutex errors can occur when running a _REG method that is in +the same scope as a method-defined operation region or an operation region +under a module-level IF block. This type of code is rare, so the problem has +not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. + +Fixed a possible memory leak during module-level code execution. An object +could be leaked for each block of executed module-level code if the +interpreter slack mode is enabled This change deletes any implicitly returned +object from the module-level code block. Lin Ming. + +Removed messages for successful predefined repair(s). The repair mechanism +was considered too wordy. Now, messages are only unconditionally emitted if +the return object cannot be repaired. Existing messages for successful +repairs were converted to ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + Current Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression introduced in 20091112 where intermediate .SRC files +were no longer automatically removed at the termination of the compile. + +acpiexec: Implemented the -f option to specify default region fill value. +This option specifies the value used to initialize buffers that simulate +operation regions. Default value is zero. Useful for debugging problems that +depend on a specific initial value for a region or field. + +---------------------------------------- 12 November 2009. Summary of changes for version 20091112: This release is available at www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Mon Dec 14 22:24:04 2009 (r200553) @@ -895,20 +895,6 @@ CmCleanupAndExit ( 10) / Gbl_NsLookupCount); } - /* - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? - */ - if (!Gbl_SourceOutputFlag) - { - remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - - /* Delete AML file if there are errors */ - - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) - { - remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { @@ -923,6 +909,27 @@ CmCleanupAndExit ( { FlCloseFile (i); } + + /* Delete AML file if there are errors */ + + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + { + remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); + } + + /* + * Delete intermediate ("combined") source file (if -ls flag not set) + * + * TBD: SourceOutput should be .TMP, then rename if we want to keep it? + */ + if (!Gbl_SourceOutputFlag) + { + if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) + { + printf ("Could not remove SRC file, %s\n", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + } } Modified: head/sys/contrib/dev/acpica/debugger/dbutils.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbutils.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/debugger/dbutils.c Mon Dec 14 22:24:04 2009 (r200553) @@ -275,6 +275,10 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { + if (ObjDesc->Buffer.Length > 16) + { + AcpiOsPrintf ("\n"); + } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } Modified: head/sys/contrib/dev/acpica/disassembler/dmwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Dec 14 22:24:04 2009 (r200553) @@ -160,7 +160,6 @@ AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); - /******************************************************************************* * * FUNCTION: AcpiDmDisassemble Modified: head/sys/contrib/dev/acpica/dispatcher/dsmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/dispatcher/dsmethod.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/dispatcher/dsmethod.c Mon Dec 14 22:24:04 2009 (r200553) @@ -519,7 +519,7 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = ObjDesc->Method.Implementation (NextWalkState); + Status = ObjDesc->Method.Extra.Implementation (NextWalkState); if (Status == AE_OK) { Status = AE_CTRL_TERMINATE; Modified: head/sys/contrib/dev/acpica/dispatcher/dswload.c ============================================================================== --- head/sys/contrib/dev/acpica/dispatcher/dswload.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/dispatcher/dswload.c Mon Dec 14 22:24:04 2009 (r200553) @@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report - * a warning + * Note: silently change the type here. On the second pass, + * we will report a warning */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", - Path, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", - AcpiUtGetTypeName (Node->Type), Path)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -794,15 +796,16 @@ AcpiDsLoad2BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ ACPI_WARNING ((AE_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", - BufferPtr, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -813,8 +816,9 @@ AcpiDsLoad2BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s]", - AcpiUtGetTypeName (Node->Type), BufferPtr)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return (AE_AML_OPERAND_TYPE); } @@ -1154,33 +1158,40 @@ AcpiDsLoad2EndOp ( } /* - * If we are executing a method, initialize the region + * The OpRegion is not fully parsed at this time. The only valid + * argument is the SpaceId. (We must save the address of the + * AML of the address and length operands) + * + * If we have a valid region, initialize it. The namespace is + * unlocked at this point. + * + * Need to unlock interpreter if it is locked (if we are running + * a control method), in order to allow _REG methods to be run + * during AcpiEvInitializeRegion. */ if (WalkState->MethodNode) { + /* + * Executing a method: initialize the region and unlock + * the interpreter + */ Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { return (Status); } - } - /* - * The OpRegion is not fully parsed at this time. Only valid - * argument is the SpaceId. (We must save the address of the - * AML of the address and length operands) - */ + AcpiExExitInterpreter (); + } - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - * - * TBD: need to unlock interpreter if it is locked, in order - * to allow _REG methods to be run. - */ Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node), FALSE); + if (WalkState->MethodNode) + { + AcpiExEnterInterpreter (); + } + if (ACPI_FAILURE (Status)) { /* Modified: head/sys/contrib/dev/acpica/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evregion.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evregion.c Mon Dec 14 22:24:04 2009 (r200553) @@ -845,7 +845,7 @@ AcpiEvInstallHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1243,7 +1243,7 @@ AcpiEvRegRun ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); Modified: head/sys/contrib/dev/acpica/events/evrgnini.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evrgnini.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evrgnini.c Mon Dec 14 22:24:04 2009 (r200553) @@ -716,6 +716,20 @@ AcpiEvInitializeRegion ( HandlerObj = ObjDesc->ThermalZone.Handler; break; + case ACPI_TYPE_METHOD: + /* + * If we are executing module level code, the original + * Node's object was replaced by this Method object and we + * saved the handler in the method object. + * + * See AcpiNsExecModuleCode + */ + if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + HandlerObj = ObjDesc->Method.Extra.Handler; + } + break; + default: /* Ignore other objects */ break; Modified: head/sys/contrib/dev/acpica/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxface.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxface.c Mon Dec 14 22:24:04 2009 (r200553) @@ -368,7 +368,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; Modified: head/sys/contrib/dev/acpica/events/evxfevnt.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxfevnt.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxfevnt.c Mon Dec 14 22:24:04 2009 (r200553) @@ -805,7 +805,7 @@ AcpiInstallGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ AcpiRemoveGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; Modified: head/sys/contrib/dev/acpica/events/evxfregn.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxfregn.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxfregn.c Mon Dec 14 22:24:04 2009 (r200553) @@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && Modified: head/sys/contrib/dev/acpica/executer/exmutex.c ============================================================================== --- head/sys/contrib/dev/acpica/executer/exmutex.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/executer/exmutex.c Mon Dec 14 22:24:04 2009 (r200553) @@ -490,6 +490,15 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } + /* Must have a valid thread ID */ + + if (!WalkState->Thread) + { + ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", + AcpiUtGetNodeName (ObjDesc->Mutex.Node))); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + /* * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release @@ -505,15 +514,6 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_NOT_OWNER); } - /* Must have a valid thread ID */ - - if (!WalkState->Thread) - { - ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", - AcpiUtGetNodeName (ObjDesc->Mutex.Node))); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - /* * The sync level of the mutex must be equal to the current sync level. In * other words, the current level means that at least one mutex at that Modified: head/sys/contrib/dev/acpica/include/acnamesp.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acnamesp.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acnamesp.h Mon Dec 14 22:24:04 2009 (r200553) @@ -456,6 +456,11 @@ AcpiNsComplexRepairs ( ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); /* * nssearch - Namespace searching and entry @@ -542,13 +547,9 @@ AcpiNsExternalizeName ( char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); Modified: head/sys/contrib/dev/acpica/include/acobject.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acobject.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acobject.h Mon Dec 14 22:24:04 2009 (r200553) @@ -288,7 +288,12 @@ typedef struct acpi_object_method UINT8 SyncLevel; union acpi_operand_object *Mutex; UINT8 *AmlStart; - ACPI_INTERNAL_METHOD Implementation; + union + { + ACPI_INTERNAL_METHOD Implementation; + union acpi_operand_object *Handler; + } Extra; + UINT32 AmlLength; UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; Modified: head/sys/contrib/dev/acpica/include/acoutput.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acoutput.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acoutput.h Mon Dec 14 22:24:04 2009 (r200553) @@ -158,7 +158,8 @@ #define ACPI_LV_INIT 0x00000001 #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 -#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 +#define ACPI_LV_REPAIR 0x00000008 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -217,6 +218,7 @@ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) +#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ @@ -248,8 +250,8 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acpixf.h Mon Dec 14 22:24:04 2009 (r200553) @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20091112 +#define ACPI_CA_VERSION 0x20091214 #include #include Modified: head/sys/contrib/dev/acpica/namespace/nsaccess.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsaccess.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsaccess.c Mon Dec 14 22:24:04 2009 (r200553) @@ -251,7 +251,7 @@ AcpiNsRootInitialize ( /* Mark this as a very SPECIAL method */ ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY; - ObjDesc->Method.Implementation = AcpiUtOsiImplementation; + ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation; #endif break; Modified: head/sys/contrib/dev/acpica/namespace/nsdump.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsdump.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsdump.c Mon Dec 14 22:24:04 2009 (r200553) @@ -286,7 +286,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - ThisNode = AcpiNsMapHandleToNode (ObjHandle); + ThisNode = AcpiNsValidateHandle (ObjHandle); if (!ThisNode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", Modified: head/sys/contrib/dev/acpica/namespace/nseval.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nseval.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nseval.c Mon Dec 14 22:24:04 2009 (r200553) @@ -477,6 +477,19 @@ AcpiNsExecModuleCode ( MethodObj->Method.NextObject); Type = AcpiNsGetType (ParentNode); + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) + { + MethodObj->Method.Extra.Handler = + ParentNode->Object->Device.Handler; + } + /* Must clear NextObject (AcpiNsAttachObject needs the field) */ MethodObj->Method.NextObject = NULL; @@ -513,6 +526,13 @@ AcpiNsExecModuleCode ( ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); + /* Delete a possible implicit return value (in slack mode) */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + } + /* Detach the temporary method object */ AcpiNsDetachObject (ParentNode); Modified: head/sys/contrib/dev/acpica/namespace/nsnames.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsnames.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsnames.c Mon Dec 14 22:24:04 2009 (r200553) @@ -337,7 +337,7 @@ AcpiNsHandleToPathname ( ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); Modified: head/sys/contrib/dev/acpica/namespace/nspredef.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nspredef.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nspredef.c Mon Dec 14 22:24:04 2009 (r200553) @@ -313,31 +313,40 @@ AcpiNsCheckPredefinedNames ( Data->Pathname = Pathname; /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { - goto CheckValidationStatus; + goto Exit; } - /* For returned Package objects, check the type of all sub-objects */ - - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) + /* + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } } /* - * Perform additional, more complicated repairs on a per-name - * basis. + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. */ Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); - -CheckValidationStatus: +Exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning @@ -349,7 +358,6 @@ CheckValidationStatus: } ACPI_FREE (Data); - Cleanup: ACPI_FREE (Pathname); return (Status); @@ -544,6 +552,12 @@ AcpiNsCheckPackage ( "%s Validating return Package of Type %X, Count %X\n", Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); + /* Extract package count and elements array */ Elements = ReturnObject->Package.Elements; @@ -582,9 +596,10 @@ AcpiNsCheckPackage ( } else if (Count > ExpectedCount) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is larger than needed - " - "found %u, expected %u", Count, ExpectedCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ @@ -800,56 +815,20 @@ AcpiNsCheckPackageList ( ACPI_OPERAND_OBJECT *SubPackage; ACPI_OPERAND_OBJECT **SubElements; ACPI_STATUS Status; - BOOLEAN NonTrailingNull = FALSE; UINT32 ExpectedCount; UINT32 i; UINT32 j; - /* Validate each sub-Package in the parent Package */ - + /* + * Validate each sub-Package in the parent Package + * + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ for (i = 0; i < Count; i++) { - /* - * Handling for NULL package elements. For now, we will simply allow - * a parent package with trailing NULL elements. This can happen if - * the package was defined to be longer than the initializer list. - * This is legal as per the ACPI specification. It is often used - * to allow for dynamic initialization of a Package. - * - * A future enhancement may be to simply truncate the package to - * remove the trailing NULL elements. - */ - if (!(*Elements)) - { - if (!NonTrailingNull) - { - /* Ensure the remaining elements are all NULL */ - - for (j = 1; j < (Count - i + 1); j++) - { - if (Elements[j]) - { - NonTrailingNull = TRUE; - } - } - - if (!NonTrailingNull) - { - /* Ignore the trailing NULL elements */ - - return (AE_OK); - } - } - - /* There are trailing non-null elements, issue warning */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Found NULL element at package index %u", i)); - Elements++; - continue; - } - SubPackage = *Elements; SubElements = SubPackage->Package.Elements; Modified: head/sys/contrib/dev/acpica/namespace/nsrepair.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsrepair.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsrepair.c Mon Dec 14 22:24:04 2009 (r200553) @@ -119,7 +119,6 @@ #include #include #include -#include #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -127,6 +126,54 @@ /******************************************************************************* * + * This module attempts to repair or convert objects returned by the + * predefined methods to an object type that is expected, as per the ACPI + * specification. The need for this code is dictated by the many machines that + * return incorrect types for the standard predefined methods. Performing these + * conversions here, in one place, eliminates the need for individual ACPI + * device drivers to do the same. Note: Most of these conversions are different + * than the internal object conversion routines used for implicit object + * conversion. + * + * The following conversions can be performed as necessary: + * + * Integer -> String + * Integer -> Buffer + * String -> Integer + * String -> Buffer + * Buffer -> Integer + * Buffer -> String + * Buffer -> Package of Integers + * Package -> Package of one Package + * + ******************************************************************************/ + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + +/******************************************************************************* + * * FUNCTION: AcpiNsRepairObject * * PARAMETERS: Data - Pointer to validation data structure @@ -153,35 +200,230 @@ AcpiNsRepairObject ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsRepairObject); + + /* * At this point, we know that the type of the returned object was not * one of the expected types for this predefined name. Attempt to - * repair the object. Only a limited number of repairs are possible. + * repair the object by converting it to one of the expected object + * types for this predefined name. */ - switch (ReturnObject->Common.Type) + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) + { + Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + Status = AcpiNsConvertToString (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + + /* We cannot repair this object */ + + return (AE_AML_OPERAND_TYPE); + + +ObjectRepaired: + + /* Object was successfully repaired */ + + /* + * If the original object is a package element, we need to: + * 1. Set the reference count of the new object to match the + * reference count of the old object. + * 2. Decrement the reference count of the original object. + */ + if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + { + NewObject->Common.ReferenceCount = + ReturnObject->Common.ReferenceCount; + + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject))); + } + + /* Delete old object, install the new return object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + case ACPI_TYPE_BUFFER: - /* Does the method/object legally return a string? */ + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + if (OriginalObject->Buffer.Length > 8) { return (AE_AML_OPERAND_TYPE); } + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: /* - * Have a Buffer, expected a String, convert. Use a ToString + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:28:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACE01065670; Mon, 14 Dec 2009 22:28:32 +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 910AF8FC18; Mon, 14 Dec 2009 22:28: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 nBEMSWub040718; Mon, 14 Dec 2009 22:28:32 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMSW1s040716; Mon, 14 Dec 2009 22:28:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142228.nBEMSW1s040716@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22:28: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: r200554 - head/sys/dev/fdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:28:32 -0000 Author: jkim Date: Mon Dec 14 22:28:32 2009 New Revision: 200554 URL: http://svn.freebsd.org/changeset/base/200554 Log: Remove _FDE quirk handling as these quirks are automatically repaired by ACPICA layer since ACPICA 20091214. Modified: head/sys/dev/fdc/fdc_acpi.c Modified: head/sys/dev/fdc/fdc_acpi.c ============================================================================== --- head/sys/dev/fdc/fdc_acpi.c Mon Dec 14 22:24:04 2009 (r200553) +++ head/sys/dev/fdc/fdc_acpi.c Mon Dec 14 22:28:32 2009 (r200554) @@ -97,9 +97,7 @@ fdc_acpi_attach(device_t dev) struct fdc_data *sc; ACPI_BUFFER buf; device_t bus; - int error, fde_count, i; - ACPI_OBJECT *obj, *pkg; - uint32_t fde[ACPI_FDC_MAXDEVS]; + int error; /* Get our softc and use the same accessor as ISA. */ sc = device_get_softc(dev); @@ -128,63 +126,12 @@ fdc_acpi_attach(device_t dev) */ bus = device_get_parent(dev); if (ACPI_FAILURE(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) { - error = ENXIO; - goto out_hintsprobe; - } - - /* Parse the output of _FDE in various ways. */ - obj = pkg = (ACPI_OBJECT *)buf.Pointer; - switch (obj->Type) { - case ACPI_TYPE_BUFFER: - /* - * The spec says _FDE should be a buffer of five 32-bit - * integers. In violation of the spec, some systems use - * five bytes instead. - */ - switch (obj->Buffer.Length) { - case ACPI_FDC_FDE_LEN: - bcopy(obj->Buffer.Pointer, fde, ACPI_FDC_FDE_LEN); - break; - case ACPI_FDC_MAXDEVS: - for (i = 0; i < ACPI_FDC_MAXDEVS; i++) - fde[i] = ((uint8_t *)obj->Buffer.Pointer)[i]; - break; - default: - device_printf(dev, "_FDE wrong length: %d\n", - obj->Buffer.Length); - error = ENXIO; - goto out_hintsprobe; - } - break; - case ACPI_TYPE_PACKAGE: - /* - * In violation of the spec, systems including the ASUS - * K8V return a package of five integers instead of a - * buffer of five 32-bit integers. - */ - fde_count = min(ACPI_FDC_MAXDEVS, pkg->Package.Count); - for (i = 0; i < fde_count; i++) { - obj = &pkg->Package.Elements[i]; - if (obj->Type == ACPI_TYPE_INTEGER) - fde[i] = (uint32_t)obj->Integer.Value; - } - break; - default: - device_printf(dev, "invalid _FDE type %d\n", obj->Type); - error = ENXIO; - goto out_hintsprobe; + error = fdc_hints_probe(dev); + goto out; } /* Add fd child devices as specified. */ - error = fdc_acpi_probe_children(bus, dev, fde); - -out_hintsprobe: - /* - * If there was a problem with the _FDE drive enumeration, fall - * back to the hints-based probe. - */ - if (error) - error = fdc_hints_probe(dev); + error = fdc_acpi_probe_children(bus, dev, buf.Pointer); out: if (buf.Pointer) From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:30:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A790106566C; Mon, 14 Dec 2009 22:30:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3FF8FC13; Mon, 14 Dec 2009 22:30: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 nBEMU7rj040811; Mon, 14 Dec 2009 22:30:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMU7L6040809; Mon, 14 Dec 2009 22:30:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142230.nBEMU7L6040809@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:30: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: r200555 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:30:07 -0000 Author: yongari Date: Mon Dec 14 22:30:07 2009 New Revision: 200555 URL: http://svn.freebsd.org/changeset/base/200555 Log: Don't report current link status if interface is not UP. If interface is not UP, the current link status wouldn't reflect the negotiated status. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:28:32 2009 (r200554) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:30:07 2009 (r200555) @@ -2177,6 +2177,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->vge_miibus); VGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VGE_UNLOCK(sc); + return; + } mii_pollstat(mii); VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:38:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 064621065695; Mon, 14 Dec 2009 22:38:52 +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 E96A48FC1D; Mon, 14 Dec 2009 22:38:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMcplP041042; Mon, 14 Dec 2009 22:38:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMcpxF041040; Mon, 14 Dec 2009 22:38:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912142238.nBEMcpxF041040@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 22:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200556 - stable/8/contrib/ee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:38:52 -0000 Author: delphij Date: Mon Dec 14 22:38:51 2009 New Revision: 200556 URL: http://svn.freebsd.org/changeset/base/200556 Log: MFC r199123: Add a minimal change to prevent NULL deference in ee(1). To repeat the problem, one can press "Ctrl+C" and then enter "0". Submitted by: Alexander Best PR: bin/137707 Modified: stable/8/contrib/ee/ee.c Directory Properties: stable/8/contrib/ee/ (props changed) Modified: stable/8/contrib/ee/ee.c ============================================================================== --- stable/8/contrib/ee/ee.c Mon Dec 14 22:30:07 2009 (r200555) +++ stable/8/contrib/ee/ee.c Mon Dec 14 22:38:51 2009 (r200556) @@ -1993,7 +1993,7 @@ char *cmd_str; int number; int i; char *ptr; - char *direction = NULL; + char *direction = "d"; struct text *t_line; ptr = cmd_str; From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:47:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C721065679; Mon, 14 Dec 2009 22:47:10 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06B218FC18; Mon, 14 Dec 2009 22:47: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 nBEMl9Ig041256; Mon, 14 Dec 2009 22:47:09 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMl91u041254; Mon, 14 Dec 2009 22:47:09 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142247.nBEMl91u041254@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 22:47: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: r200557 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:47:10 -0000 Author: rpaulo Date: Mon Dec 14 22:47:09 2009 New Revision: 200557 URL: http://svn.freebsd.org/changeset/base/200557 Log: Add apple-boot and apple-ufs. Submitted by: nwhitehorn Modified: head/sys/sys/apm.h Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Mon Dec 14 22:38:51 2009 (r200556) +++ head/sys/sys/apm.h Mon Dec 14 22:47:09 2009 (r200557) @@ -61,6 +61,8 @@ struct apm_ent { #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" #define APM_ENT_TYPE_FREEBSD_ZFS "FreeBSD-ZFS" +#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" #define APM_ENT_TYPE_APPLE_HFS "Apple_HFS" +#define APM_ENT_TYPE_APPLE_UFS "Apple_UNIX_SVR2" #endif /* _SYS_APM_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 14 22:55:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22AC51065693; Mon, 14 Dec 2009 22:55:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2DF8FC19; Mon, 14 Dec 2009 22:55: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 nBEMtKht041453; Mon, 14 Dec 2009 22:55:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMtKTp041451; Mon, 14 Dec 2009 22:55:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142255.nBEMtKTp041451@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:55: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: r200558 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:55:21 -0000 Author: yongari Date: Mon Dec 14 22:55:20 2009 New Revision: 200558 URL: http://svn.freebsd.org/changeset/base/200558 Log: Tell upper layer vge(4) supports long frames. This should be done after ether_ifattach(), as ether_ifattach() initializes it with ETHER_HDR_LEN. While I'm here remove setting if_mtu, it's already handled in ether_ifattach(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:47:09 2009 (r200557) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:55:20 2009 (r200558) @@ -1045,7 +1045,6 @@ vge_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = vge_ioctl; ifp->if_capabilities = IFCAP_VLAN_MTU; @@ -1066,6 +1065,9 @@ vge_attach(device_t dev) */ ether_ifattach(ifp, eaddr); + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE, NULL, vge_intr, sc, &sc->vge_intrhand); From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 00:26:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87811106568B; Tue, 15 Dec 2009 00:26:42 +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 6D4CC8FC0C; Tue, 15 Dec 2009 00:26:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF0Qgc5043464; Tue, 15 Dec 2009 00:26:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF0Qgxp043460; Tue, 15 Dec 2009 00:26:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150026.nBF0Qgxp043460@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 00:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200560 - in stable/8/release/picobsd: bridge build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 00:26:42 -0000 Author: luigi Date: Tue Dec 15 00:26:42 2009 New Revision: 200560 URL: http://svn.freebsd.org/changeset/base/200560 Log: sync with head Modified: stable/8/release/picobsd/bridge/PICOBSD stable/8/release/picobsd/bridge/crunch.conf stable/8/release/picobsd/build/picobsd Modified: stable/8/release/picobsd/bridge/PICOBSD ============================================================================== --- stable/8/release/picobsd/bridge/PICOBSD Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/bridge/PICOBSD Tue Dec 15 00:26:42 2009 (r200560) @@ -11,11 +11,14 @@ hints "PICOBSD.hints" # values accessible through getenv() # env "PICOBSD.env" -cpu I486_CPU +#cpu I486_CPU cpu I586_CPU cpu I686_CPU ident PICOBSD +options SMP +device apic + options SCHED_4BSD # mandatory to have one scheduler #options MATH_EMULATE #Support for x87 emulation options INET #InterNETworking @@ -43,7 +46,7 @@ options IPDIVERT # divert (for natd) # Support for bridging and bandwidth limiting options DUMMYNET device if_bridge -options HZ=1000 +#options HZ=1000 device random # used by ssh device pci Modified: stable/8/release/picobsd/bridge/crunch.conf ============================================================================== --- stable/8/release/picobsd/bridge/crunch.conf Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/bridge/crunch.conf Tue Dec 15 00:26:42 2009 (r200560) @@ -98,13 +98,15 @@ progs cat tail tee progs test ln test [ +progs less +ln less more progs mount progs minigzip ln minigzip gzip progs kill progs df progs ps -progs ns # this is the +progs ns # this is the picobsd version ln ns netstat progs vm progs hostname @@ -178,3 +180,4 @@ libs_so -lkvm libs_so -lz libs_so -lbsdxml libs_so -lsbuf +libs_so -ljail # used by ifconfig Modified: stable/8/release/picobsd/build/picobsd ============================================================================== --- stable/8/release/picobsd/build/picobsd Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/build/picobsd Tue Dec 15 00:26:42 2009 (r200560) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -587,8 +587,9 @@ find_progs() { # programs local i u_progs="`find_progs_helper $*`" local o=${o_objdir:-${_SHLIBDIRPREFIX}} + log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" [ -z "${u_progs}" ] && return 1 # not found, error - i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" + i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" u_libs="`find_progs_helper $i`" return 0 } @@ -719,8 +720,7 @@ populate_mfs_tree() { (cd ${dst}; chown -R root . ) fi - # If we are building a shared 'crunch', take the libraries - # and the dynamic loader as well + log "for a shared 'crunch' take libraries and dynamic loader as well" find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 01:14:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9955106566B; Tue, 15 Dec 2009 01:14:33 +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 D898A8FC13; Tue, 15 Dec 2009 01:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF1EXeq044559; Tue, 15 Dec 2009 01:14:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF1EX8T044557; Tue, 15 Dec 2009 01:14:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912150114.nBF1EX8T044557@svn.freebsd.org> From: Xin LI Date: Tue, 15 Dec 2009 01:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200562 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 01:14:34 -0000 Author: delphij Date: Tue Dec 15 01:14:33 2009 New Revision: 200562 URL: http://svn.freebsd.org/changeset/base/200562 Log: MFC r200287: Allow using IPv6 in nfsrvd_sentcache() callback. PR: kern/141289 Submitted by: Petr Lampa Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 15 00:44:33 2009 (r200561) +++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 15 01:14:33 2009 (r200562) @@ -522,8 +522,9 @@ nfsrvd_sentcache(struct nfsrvcache *rp, if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); if (!err) { - if (so->so_proto->pr_domain->dom_family != AF_INET || - so->so_proto->pr_protocol != IPPROTO_TCP) + if ((so->so_proto->pr_domain->dom_family != AF_INET && + so->so_proto->pr_domain->dom_family != AF_INET6) || + so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) rp->rc_flag |= RC_TCPSEQ; From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 05:14:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B15D1065670; Tue, 15 Dec 2009 05:14:40 +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 281F28FC0C; Tue, 15 Dec 2009 05:14: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 nBF5Eenn050813; Tue, 15 Dec 2009 05:14:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF5Eej4050810; Tue, 15 Dec 2009 05:14:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912150514.nBF5Eej4050810@svn.freebsd.org> From: Doug Barton Date: Tue, 15 Dec 2009 05:14: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: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 05:14:40 -0000 Author: dougb Date: Tue Dec 15 05:14:39 2009 New Revision: 200563 URL: http://svn.freebsd.org/changeset/base/200563 Log: The named process needs to have a "working directory" that it can write to. This is specified in "options { directory }" in named.conf. So, create /etc/namedb/working with appropriate permissions, and update the entry in named.conf to match. In addition to specifying the working directory, file and path names in named.conf can be specified relative to the directory listed. However, since that directory is now different from /etc/namedb (where the configuration, zone, rndc.*, and other files are located) further update named.conf to specify all file names with fully qualified paths. Also update the comment about file and path names so users know this should be done for all file/path names in the file. This change will eliminate the 'working directory is not writable' messages at boot time without sacrificing security. It will also allow for features in newer versions of BIND (9.7+) to work as designed. Modified: head/etc/mtree/BIND.chroot.dist head/etc/namedb/named.conf Modified: head/etc/mtree/BIND.chroot.dist ============================================================================== --- head/etc/mtree/BIND.chroot.dist Tue Dec 15 01:14:33 2009 (r200562) +++ head/etc/mtree/BIND.chroot.dist Tue Dec 15 05:14:39 2009 (r200563) @@ -15,6 +15,8 @@ .. slave uname=bind .. + working uname=bind + .. .. .. /set type=dir uname=bind gname=wheel mode=0755 Modified: head/etc/namedb/named.conf ============================================================================== --- head/etc/namedb/named.conf Tue Dec 15 01:14:33 2009 (r200562) +++ head/etc/namedb/named.conf Tue Dec 15 05:14:39 2009 (r200563) @@ -9,8 +9,9 @@ // or cause huge amounts of useless Internet traffic. options { - // Relative to the chroot directory, if any - directory "/etc/namedb"; + // All file and path names are relative to the chroot directory, + // if any, and should be fully qualified. + directory "/etc/namedb/working"; pid-file "/var/run/named/pid"; dump-file "/var/dump/named_dump.db"; statistics-file "/var/stats/named.stats"; @@ -74,7 +75,7 @@ options { // Also, make sure to enable it in /etc/rc.conf. // The traditional root hints mechanism. Use this, OR the slave zones below. -zone "." { type hint; file "named.root"; }; +zone "." { type hint; file "/etc/namedb/named.root"; }; /* Slaving the following zones from the root name servers has some significant advantages: @@ -94,7 +95,7 @@ zone "." { type hint; file "named.root"; /* zone "." { type slave; - file "slave/root.slave"; + file "/etc/namedb/slave/root.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -102,7 +103,7 @@ zone "." { }; zone "arpa" { type slave; - file "slave/arpa.slave"; + file "/etc/namedb/slave/arpa.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -110,7 +111,7 @@ zone "arpa" { }; zone "in-addr.arpa" { type slave; - file "slave/in-addr.arpa.slave"; + file "/etc/namedb/slave/in-addr.arpa.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -125,116 +126,116 @@ zone "in-addr.arpa" { 2. No spurious traffic will be sent from your network to the roots */ // RFC 1912 -zone "localhost" { type master; file "master/localhost-forward.db"; }; -zone "127.in-addr.arpa" { type master; file "master/localhost-reverse.db"; }; -zone "255.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "localhost" { type master; file "/etc/namedb/master/localhost-forward.db"; }; +zone "127.in-addr.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; +zone "255.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // RFC 1912-style zone for IPv6 localhost address -zone "0.ip6.arpa" { type master; file "master/localhost-reverse.db"; }; +zone "0.ip6.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; // "This" Network (RFCs 1912 and 3330) -zone "0.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "0.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Private Use Networks (RFC 1918) -zone "10.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "16.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "17.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "18.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "19.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "20.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "21.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "22.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "23.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "24.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "25.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "26.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "27.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "28.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "29.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "30.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "31.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "168.192.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "10.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "16.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "17.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "18.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "19.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "20.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "21.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "22.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "23.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "24.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "25.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "26.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "27.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "28.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "29.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "30.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Link-local/APIPA (RFCs 3330 and 3927) -zone "254.169.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // TEST-NET for Documentation (RFC 3330) -zone "2.0.192.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "2.0.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Router Benchmark Testing (RFC 3330) -zone "18.198.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "19.198.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "18.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "19.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IANA Reserved - Old Class E Space -zone "240.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "241.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "242.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "243.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "244.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "245.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "246.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "247.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "248.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "249.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "250.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "251.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "252.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "253.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "254.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "240.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "241.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "242.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "243.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "244.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "245.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "246.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "247.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "248.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "249.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "250.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "251.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "252.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "253.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "254.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Unassigned Addresses (RFC 4291) -zone "1.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.ip6.arpa" { type master; file "master/empty.db"; }; -zone "8.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.ip6.arpa" { type master; file "master/empty.db"; }; -zone "c.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.ip6.arpa" { type master; file "master/empty.db"; }; -zone "e.ip6.arpa" { type master; file "master/empty.db"; }; -zone "0.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "1.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "2.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "8.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "0.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "1.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "2.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "1.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "8.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "c.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "e.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "0.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "1.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "2.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "8.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "0.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "1.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "2.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 ULA (RFC 4193) -zone "c.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "c.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Link Local (RFC 4291) -zone "8.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "8.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Deprecated Site-Local Addresses (RFC 3879) -zone "c.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "e.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "f.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "c.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "e.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "f.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IP6.INT is Deprecated (RFC 4159) -zone "ip6.int" { type master; file "master/empty.db"; }; +zone "ip6.int" { type master; file "/etc/namedb/master/empty.db"; }; // NB: Do not use the IP addresses below, they are faked, and only // serve demonstration/documentation purposes! @@ -265,17 +266,16 @@ zone "example.org" { allow-update { key "exampleorgkey"; }; - file "dynamic/example.org"; + file "/etc/namedb/dynamic/example.org"; }; */ /* Example of a slave reverse zone zone "1.168.192.in-addr.arpa" { type slave; - file "slave/1.168.192.in-addr.arpa"; + file "/etc/namedb/slave/1.168.192.in-addr.arpa"; masters { 192.168.1.1; }; }; */ - From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 07:04:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8B71065672; Tue, 15 Dec 2009 07:04:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD91D8FC1F; Tue, 15 Dec 2009 07:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF74KiQ053540; Tue, 15 Dec 2009 07:04:20 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF74KUv053538; Tue, 15 Dec 2009 07:04:20 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150704.nBF74KUv053538@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 07:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200564 - stable/7/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 07:04:21 -0000 Author: luigi Date: Tue Dec 15 07:04:20 2009 New Revision: 200564 URL: http://svn.freebsd.org/changeset/base/200564 Log: MFC r200301 when calling ldd, use the cross libraries and not the host version Modified: stable/7/release/picobsd/build/picobsd Modified: stable/7/release/picobsd/build/picobsd ============================================================================== --- stable/7/release/picobsd/build/picobsd Tue Dec 15 05:14:39 2009 (r200563) +++ stable/7/release/picobsd/build/picobsd Tue Dec 15 07:04:20 2009 (r200564) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -587,8 +587,9 @@ find_progs() { # programs local i u_progs="`find_progs_helper $*`" local o=${o_objdir:-${_SHLIBDIRPREFIX}} + log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" [ -z "${u_progs}" ] && return 1 # not found, error - i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" + i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" u_libs="`find_progs_helper $i`" return 0 } @@ -719,8 +720,7 @@ populate_mfs_tree() { (cd ${dst}; chown -R root . ) fi - # If we are building a shared 'crunch', take the libraries - # and the dynamic loader as well + log "for a shared 'crunch' take libraries and dynamic loader as well" find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 07:32:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4935D10656A5; Tue, 15 Dec 2009 07:32:09 +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 3766A8FC15; Tue, 15 Dec 2009 07:32: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 nBF7W93r054075; Tue, 15 Dec 2009 07:32:09 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF7W984054073; Tue, 15 Dec 2009 07:32:09 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150732.nBF7W984054073@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 07:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200565 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 07:32:09 -0000 Author: luigi Date: Tue Dec 15 07:32:08 2009 New Revision: 200565 URL: http://svn.freebsd.org/changeset/base/200565 Log: MFC: expose only bio_cmd and bio_flags values to userland Modified: stable/8/sys/sys/bio.h Modified: stable/8/sys/sys/bio.h ============================================================================== --- stable/8/sys/sys/bio.h Tue Dec 15 07:04:20 2009 (r200564) +++ stable/8/sys/sys/bio.h Tue Dec 15 07:32:08 2009 (r200565) @@ -40,6 +40,22 @@ #include +/* bio_cmd */ +#define BIO_READ 0x01 +#define BIO_WRITE 0x02 +#define BIO_DELETE 0x04 +#define BIO_GETATTR 0x08 +#define BIO_FLUSH 0x10 +#define BIO_CMD0 0x20 /* Available for local hacks */ +#define BIO_CMD1 0x40 /* Available for local hacks */ +#define BIO_CMD2 0x80 /* Available for local hacks */ + +/* bio_flags */ +#define BIO_ERROR 0x01 +#define BIO_DONE 0x02 +#define BIO_ONQUEUE 0x04 + +#ifdef _KERNEL struct disk; struct bio; @@ -95,23 +111,6 @@ struct bio { daddr_t bio_pblkno; /* physical block number */ }; -/* bio_cmd */ -#define BIO_READ 0x01 -#define BIO_WRITE 0x02 -#define BIO_DELETE 0x04 -#define BIO_GETATTR 0x08 -#define BIO_FLUSH 0x10 -#define BIO_CMD0 0x20 /* Available for local hacks */ -#define BIO_CMD1 0x40 /* Available for local hacks */ -#define BIO_CMD2 0x80 /* Available for local hacks */ - -/* bio_flags */ -#define BIO_ERROR 0x01 -#define BIO_DONE 0x02 -#define BIO_ONQUEUE 0x04 - -#ifdef _KERNEL - struct uio; struct devstat; From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 09:32:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6B21065754; Tue, 15 Dec 2009 09:32:36 +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 EF0408FC22; Tue, 15 Dec 2009 09:32: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 nBF9WZW1056613; Tue, 15 Dec 2009 09:32:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF9WZCL056611; Tue, 15 Dec 2009 09:32:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150932.nBF9WZCL056611@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 09:32: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: r200566 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 09:32:36 -0000 Author: luigi Date: Tue Dec 15 09:32:35 2009 New Revision: 200566 URL: http://svn.freebsd.org/changeset/base/200566 Log: fix the indentation for addr: values MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Dec 15 07:32:08 2009 (r200565) +++ head/sbin/ipfw/ipfw.8 Tue Dec 15 09:32:35 2009 (r200566) @@ -1002,6 +1002,7 @@ The second format with multiple addresses) is provided for convenience only and its use is discouraged. .It Ar addr : Oo Cm not Oc Bro +.Bl -tag -width indent .Cm any | me | me6 | .Cm table Ns Pq Ar number Ns Op , Ns Ar value .Ar | addr-list | addr-set @@ -1023,6 +1024,7 @@ is also specified, an entry will match o See the .Sx LOOKUP TABLES section below for more information on lookup tables. +.El .It Ar addr-list : ip-addr Ns Op Ns , Ns Ar addr-list .It Ar ip-addr : A host or subnet address specified in one of the following ways: From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 09:46:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 134361065676; Tue, 15 Dec 2009 09:46:28 +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 0255E8FC15; Tue, 15 Dec 2009 09:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF9kRU3056944; Tue, 15 Dec 2009 09:46:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF9kRHE056939; Tue, 15 Dec 2009 09:46:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150946.nBF9kRHE056939@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 09:46: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: r200567 - in head: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 09:46:28 -0000 Author: luigi Date: Tue Dec 15 09:46:27 2009 New Revision: 200567 URL: http://svn.freebsd.org/changeset/base/200567 Log: implement a new match option, lookup {dst-ip|src-ip|dst-port|src-port|uid|jail} N which searches the specified field in table N and sets tablearg accordingly. With dst-ip or src-ip the option replicates two existing options. When used with other arguments, the option can be useful to quickly dispatch traffic based on other fields. Work supported by the Onelab project. MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sys/netinet/ipfw/ip_fw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw.8 Tue Dec 15 09:46:27 2009 (r200567) @@ -1391,6 +1391,20 @@ of source and destination addresses and specified. Currently, only IPv4 flows are supported. +.It Cm lookup Bro Cm dst-ip | dst-port | src-ip | src-port | uid | jail Brc Ar N +Search an entry in lookup table +.Ar N +that matches the field specified as argument. +If not found, the match fails. +Otherwise, the match succeeds and +.Cm tablearg +is set to the value extracted from the table. +.Br +This option can be useful to quickly dispatch traffic based on +certain packet fields. +See the +.Sx LOOKUP TABLES +section below for more information on lookup tables. .It Cm { MAC | mac } Ar dst-mac src-mac Match packets with a given .Ar dst-mac Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw2.c Tue Dec 15 09:46:27 2009 (r200567) @@ -224,6 +224,15 @@ static struct _s_x rule_action_params[] { NULL, 0 } /* terminator */ }; +/* + * The 'lookup' instruction accepts one of the following arguments. + * -1 is a terminator for the list. + * Arguments are passed as v[1] in O_DST_LOOKUP options. + */ +static int lookup_key[] = { + TOK_DSTIP, TOK_SRCIP, TOK_DSTPORT, TOK_SRCPORT, + TOK_UID, TOK_JAIL, -1 }; + static struct _s_x rule_options[] = { { "tagged", TOK_TAGGED }, { "uid", TOK_UID }, @@ -290,6 +299,7 @@ static struct _s_x rule_options[] = { { "dst-ip6", TOK_DSTIP6}, { "src-ipv6", TOK_SRCIP6}, { "src-ip6", TOK_SRCIP6}, + { "lookup", TOK_LOOKUP}, { "//", TOK_COMMENT }, { "not", TOK_NOT }, /* pseudo option */ @@ -742,6 +752,16 @@ print_ip(ipfw_insn_ip *cmd, char const * int len = F_LEN((ipfw_insn *)cmd); uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; + if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { + uint32_t d = a[1]; + const char *arg = ""; + + if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) + arg = match_value(rule_options, lookup_key[d]); + printf("%s lookup %s %d", cmd->o.len & F_NOT ? " not": "", + arg, cmd->o.arg1); + return; + } printf("%s%s ", cmd->o.len & F_NOT ? " not": "", s); if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { @@ -3479,6 +3499,31 @@ read_options: ac--; av++; break; + case TOK_LOOKUP: { + ipfw_insn_u32 *c = (ipfw_insn_u32 *)cmd; + char *p; + int j; + + if (ac < 2) + errx(EX_USAGE, "format: lookup argument tablenum"); + cmd->opcode = O_IP_DST_LOOKUP; + cmd->len |= F_INSN_SIZE(ipfw_insn) + 2; + i = match_token(rule_options, *av); + for (j = 0; lookup_key[j] >= 0 ; j++) { + if (i == lookup_key[j]) + break; + } + if (lookup_key[j] <= 0) + errx(EX_USAGE, "format: cannot lookup on %s", *av); + c->d[1] = j; // i converted to option + ac--; av++; + cmd->arg1 = strtoul(*av, &p, 0); + if (p && *p) + errx(EX_USAGE, "format: lookup argument tablenum"); + ac--; av++; + } + break; + default: errx(EX_USAGE, "unrecognised option [%d] %s\n", i, s); } Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw2.h Tue Dec 15 09:46:27 2009 (r200567) @@ -186,6 +186,7 @@ enum tokens { TOK_FIB, TOK_SETFIB, + TOK_LOOKUP, }; /* * the following macro returns an error message if we run out of Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 09:32:35 2009 (r200566) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 09:46:27 2009 (r200567) @@ -2819,6 +2819,36 @@ do { \ dst_ip.s_addr : src_ip.s_addr; uint32_t v = 0; + if (cmdlen > F_INSN_SIZE(ipfw_insn_u32)) { + /* generic lookup */ + v = ((ipfw_insn_u32 *)cmd)->d[1]; + if (v == 0) + a = dst_ip.s_addr; + else if (v == 1) + a = src_ip.s_addr; + else if (offset != 0) + break; + else if (proto != IPPROTO_TCP && + proto != IPPROTO_UDP) + break; + else if (v == 2) + a = dst_port; + else if (v == 3) + a = src_port; + else if (v == 4 || v == 5) { + check_uidgid( + (ipfw_insn_u32 *)cmd, + proto, oif, + dst_ip, dst_port, + src_ip, src_port, &ucred_cache, + &ucred_lookup, args->inp); + if (v == 4 /* O_UID */) + a = ucred_cache->cr_uid; + else if (v == 5 /* O_JAIL */) + a = ucred_cache->cr_prison->pr_id; + } else + break; + } match = lookup_table(chain, cmd->arg1, a, &v); if (!match) @@ -4160,6 +4190,7 @@ check_ipfw_struct(struct ip_fw *rule, in return (EINVAL); } if (cmdlen != F_INSN_SIZE(ipfw_insn) && + cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1 && cmdlen != F_INSN_SIZE(ipfw_insn_u32)) goto bad_size; break; From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:00:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE6B1106568D; Tue, 15 Dec 2009 10:00:00 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B703A8FC1D; Tue, 15 Dec 2009 10:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFA00iQ057258; Tue, 15 Dec 2009 10:00:00 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFA002F057254; Tue, 15 Dec 2009 10:00:00 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151000.nBFA002F057254@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200568 - in stable/8: share/man/man4 sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:00:01 -0000 Author: stas Date: Tue Dec 15 10:00:00 2009 New Revision: 200568 URL: http://svn.freebsd.org/changeset/base/200568 Log: - MFC r197832, r197834, r197837: - Add support for new BGE chips (5761, 5784 and 57780). These chips uses new BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision. - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS). - Add IDs for Fujitsu-branded Broadcom adapters. Modified: stable/8/share/man/man4/bge.4 stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/bge.4 ============================================================================== --- stable/8/share/man/man4/bge.4 Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/share/man/man4/bge.4 Tue Dec 15 10:00:00 2009 (r200568) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 21, 2009 +.Dd December 15, 2009 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet -controller chips. +5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families +of Gigabit Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:00:00 2009 (r200568) @@ -170,6 +170,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -184,12 +185,21 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5782 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5784 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785F }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785G }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5786 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5787F }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5788 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5789 }, @@ -198,11 +208,19 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5903M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57788 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57790 }, { SK_VENDORID, SK_DEVICEID_ALTIMA }, { TC_VENDORID, TC_DEVICEID_3C996 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE4 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE5 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PP250450 }, + { 0, 0 } }; @@ -216,6 +234,7 @@ static const struct bge_vendor { { BCOM_VENDORID, "Broadcom" }, { SK_VENDORID, "SysKonnect" }, { TC_VENDORID, "3Com" }, + { FJTSU_VENDORID, "Fujitsu" }, { 0, NULL } }; @@ -271,12 +290,18 @@ static const struct bge_revision { { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, + { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, + { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, + { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, { BGE_CHIPID_BCM5906_A2, "BCM5906 A2" }, + { BGE_CHIPID_BCM57780_A0, "BCM57780 A0" }, + { BGE_CHIPID_BCM57780_A1, "BCM57780 A1" }, { 0, NULL } }; @@ -297,9 +322,13 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5780, "unknown BCM5780" }, { BGE_ASICREV_BCM5714, "unknown BCM5714" }, { BGE_ASICREV_BCM5755, "unknown BCM5755" }, + { BGE_ASICREV_BCM5761, "unknown BCM5761" }, + { BGE_ASICREV_BCM5784, "unknown BCM5784" }, + { BGE_ASICREV_BCM5785, "unknown BCM5785" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, + { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { 0, NULL } }; @@ -309,6 +338,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) +#define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -1758,9 +1788,8 @@ bge_blockinit(struct bge_softc *sc) val = BGE_WDMAMODE_ENABLE | BGE_WDMAMODE_ALL_ATTNS; /* Enable host coalescing bug fix. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) - val |= 1 << 29; + if (BGE_IS_5755_PLUS(sc)) + val |= BGE_WDMAMODE_STATUS_TAG_FIX; /* Turn on write DMA state machine */ CSR_WRITE_4(sc, BGE_WDMA_MODE, val); @@ -1768,6 +1797,12 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_BD_SBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -1790,7 +1825,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); /* Turn on send data completion state machine */ - CSR_WRITE_4(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); + val = BGE_SDCMODE_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + val |= BGE_SDCMODE_CDELAY; + CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -1897,8 +1935,11 @@ bge_probe(device_t dev) const struct bge_vendor *v; uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -1915,8 +1956,8 @@ bge_probe(device_t dev) br != NULL ? br->br_name : "NetXtreme Ethernet Controller"); } - snprintf(buf, 96, "%s, %sASIC rev. %#04x", model, - br != NULL ? "" : "unknown ", id >> 16); + snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, + br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); if (pci_get_subvendor(dev) == DELL_VENDORID) sc->bge_flags |= BGE_FLAG_NO_3LED; @@ -2411,8 +2452,11 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) + sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, + 4); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -2431,6 +2475,15 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5755: + case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5784: + case BGE_ASICREV_BCM5785: + case BGE_ASICREV_BCM5787: + case BGE_ASICREV_BCM57780: + sc->bge_flags |= BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | + BGE_FLAG_5705_PLUS; + break; case BGE_ASICREV_BCM5700: case BGE_ASICREV_BCM5701: case BGE_ASICREV_BCM5703: @@ -2444,8 +2497,6 @@ bge_attach(device_t dev) /* FALLTHROUGH */ case BGE_ASICREV_BCM5750: case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5755: - case BGE_ASICREV_BCM5787: case BGE_ASICREV_BCM5906: sc->bge_flags |= BGE_FLAG_575X_PLUS; /* FALLTHROUGH */ @@ -2466,6 +2517,8 @@ bge_attach(device_t dev) if (BGE_IS_5705_PLUS(sc) && !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) sc->bge_flags |= BGE_FLAG_JITTER_BUG; @@ -2873,8 +2926,7 @@ bge_reset(struct bge_softc *sc) /* Disable fastboot on controllers that support it. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || - sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { + BGE_IS_5755_PLUS(sc)) { if (bootverbose) device_printf(sc->bge_dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); @@ -4689,6 +4741,8 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG } printf("Hardware Flags:\n"); + if (BGE_IS_5755_PLUS(sc)) + printf(" - 5755 Plus\n"); if (BGE_IS_575X_PLUS(sc)) printf(" - 575X Plus\n"); if (BGE_IS_5705_PLUS(sc)) Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/sys/dev/bge/if_bgereg.h Tue Dec 15 10:00:00 2009 (r200568) @@ -218,6 +218,7 @@ #define BGE_PCI_UNDI_TX_BD_PRODIDX_LO 0xAC #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 +#define BGE_PCI_PRODID_ASICREV 0xBC /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +230,7 @@ #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 +#define BGE_PCIMISCCTL_ASICREV_SHIFT 16 #define BGE_HIF_SWAP_OPTIONS (BGE_PCIMISCCTL_ENDIAN_WORDSWAP) #if BYTE_ORDER == LITTLE_ENDIAN @@ -245,66 +247,72 @@ (BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_CLEAR_INTA| \ BGE_PCIMISCCTL_MASK_PCI_INTR|BGE_PCIMISCCTL_INDIRECT_ACCESS) -#define BGE_CHIPID_TIGON_I 0x40000000 -#define BGE_CHIPID_TIGON_II 0x60000000 -#define BGE_CHIPID_BCM5700_A0 0x70000000 -#define BGE_CHIPID_BCM5700_A1 0x70010000 -#define BGE_CHIPID_BCM5700_B0 0x71000000 -#define BGE_CHIPID_BCM5700_B1 0x71010000 -#define BGE_CHIPID_BCM5700_B2 0x71020000 -#define BGE_CHIPID_BCM5700_B3 0x71030000 -#define BGE_CHIPID_BCM5700_ALTIMA 0x71040000 -#define BGE_CHIPID_BCM5700_C0 0x72000000 -#define BGE_CHIPID_BCM5701_A0 0x00000000 /* grrrr */ -#define BGE_CHIPID_BCM5701_B0 0x01000000 -#define BGE_CHIPID_BCM5701_B2 0x01020000 -#define BGE_CHIPID_BCM5701_B5 0x01050000 -#define BGE_CHIPID_BCM5703_A0 0x10000000 -#define BGE_CHIPID_BCM5703_A1 0x10010000 -#define BGE_CHIPID_BCM5703_A2 0x10020000 -#define BGE_CHIPID_BCM5703_A3 0x10030000 -#define BGE_CHIPID_BCM5703_B0 0x11000000 -#define BGE_CHIPID_BCM5704_A0 0x20000000 -#define BGE_CHIPID_BCM5704_A1 0x20010000 -#define BGE_CHIPID_BCM5704_A2 0x20020000 -#define BGE_CHIPID_BCM5704_A3 0x20030000 -#define BGE_CHIPID_BCM5704_B0 0x21000000 -#define BGE_CHIPID_BCM5705_A0 0x30000000 -#define BGE_CHIPID_BCM5705_A1 0x30010000 -#define BGE_CHIPID_BCM5705_A2 0x30020000 -#define BGE_CHIPID_BCM5705_A3 0x30030000 -#define BGE_CHIPID_BCM5750_A0 0x40000000 -#define BGE_CHIPID_BCM5750_A1 0x40010000 -#define BGE_CHIPID_BCM5750_A3 0x40030000 -#define BGE_CHIPID_BCM5750_B0 0x41000000 -#define BGE_CHIPID_BCM5750_B1 0x41010000 -#define BGE_CHIPID_BCM5750_C0 0x42000000 -#define BGE_CHIPID_BCM5750_C1 0x42010000 -#define BGE_CHIPID_BCM5750_C2 0x42020000 -#define BGE_CHIPID_BCM5714_A0 0x50000000 -#define BGE_CHIPID_BCM5752_A0 0x60000000 -#define BGE_CHIPID_BCM5752_A1 0x60010000 -#define BGE_CHIPID_BCM5752_A2 0x60020000 -#define BGE_CHIPID_BCM5714_B0 0x80000000 -#define BGE_CHIPID_BCM5714_B3 0x80030000 -#define BGE_CHIPID_BCM5715_A0 0x90000000 -#define BGE_CHIPID_BCM5715_A1 0x90010000 -#define BGE_CHIPID_BCM5715_A3 0x90030000 -#define BGE_CHIPID_BCM5755_A0 0xa0000000 -#define BGE_CHIPID_BCM5755_A1 0xa0010000 -#define BGE_CHIPID_BCM5755_A2 0xa0020000 -#define BGE_CHIPID_BCM5722_A0 0xa2000000 -#define BGE_CHIPID_BCM5754_A0 0xb0000000 -#define BGE_CHIPID_BCM5754_A1 0xb0010000 -#define BGE_CHIPID_BCM5754_A2 0xb0020000 -#define BGE_CHIPID_BCM5787_A0 0xb0000000 -#define BGE_CHIPID_BCM5787_A1 0xb0010000 -#define BGE_CHIPID_BCM5787_A2 0xb0020000 -#define BGE_CHIPID_BCM5906_A1 0xc0010000 -#define BGE_CHIPID_BCM5906_A2 0xc0020000 +#define BGE_CHIPID_TIGON_I 0x4000 +#define BGE_CHIPID_TIGON_II 0x6000 +#define BGE_CHIPID_BCM5700_A0 0x7000 +#define BGE_CHIPID_BCM5700_A1 0x7001 +#define BGE_CHIPID_BCM5700_B0 0x7100 +#define BGE_CHIPID_BCM5700_B1 0x7101 +#define BGE_CHIPID_BCM5700_B2 0x7102 +#define BGE_CHIPID_BCM5700_B3 0x7103 +#define BGE_CHIPID_BCM5700_ALTIMA 0x7104 +#define BGE_CHIPID_BCM5700_C0 0x7200 +#define BGE_CHIPID_BCM5701_A0 0x0000 /* grrrr */ +#define BGE_CHIPID_BCM5701_B0 0x0100 +#define BGE_CHIPID_BCM5701_B2 0x0102 +#define BGE_CHIPID_BCM5701_B5 0x0105 +#define BGE_CHIPID_BCM5703_A0 0x1000 +#define BGE_CHIPID_BCM5703_A1 0x1001 +#define BGE_CHIPID_BCM5703_A2 0x1002 +#define BGE_CHIPID_BCM5703_A3 0x1003 +#define BGE_CHIPID_BCM5703_B0 0x1100 +#define BGE_CHIPID_BCM5704_A0 0x2000 +#define BGE_CHIPID_BCM5704_A1 0x2001 +#define BGE_CHIPID_BCM5704_A2 0x2002 +#define BGE_CHIPID_BCM5704_A3 0x2003 +#define BGE_CHIPID_BCM5704_B0 0x2100 +#define BGE_CHIPID_BCM5705_A0 0x3000 +#define BGE_CHIPID_BCM5705_A1 0x3001 +#define BGE_CHIPID_BCM5705_A2 0x3002 +#define BGE_CHIPID_BCM5705_A3 0x3003 +#define BGE_CHIPID_BCM5750_A0 0x4000 +#define BGE_CHIPID_BCM5750_A1 0x4001 +#define BGE_CHIPID_BCM5750_A3 0x4000 +#define BGE_CHIPID_BCM5750_B0 0x4100 +#define BGE_CHIPID_BCM5750_B1 0x4101 +#define BGE_CHIPID_BCM5750_C0 0x4200 +#define BGE_CHIPID_BCM5750_C1 0x4201 +#define BGE_CHIPID_BCM5750_C2 0x4202 +#define BGE_CHIPID_BCM5714_A0 0x5000 +#define BGE_CHIPID_BCM5752_A0 0x6000 +#define BGE_CHIPID_BCM5752_A1 0x6001 +#define BGE_CHIPID_BCM5752_A2 0x6002 +#define BGE_CHIPID_BCM5714_B0 0x8000 +#define BGE_CHIPID_BCM5714_B3 0x8003 +#define BGE_CHIPID_BCM5715_A0 0x9000 +#define BGE_CHIPID_BCM5715_A1 0x9001 +#define BGE_CHIPID_BCM5715_A3 0x9003 +#define BGE_CHIPID_BCM5755_A0 0xa000 +#define BGE_CHIPID_BCM5755_A1 0xa001 +#define BGE_CHIPID_BCM5755_A2 0xa002 +#define BGE_CHIPID_BCM5722_A0 0xa200 +#define BGE_CHIPID_BCM5754_A0 0xb000 +#define BGE_CHIPID_BCM5754_A1 0xb001 +#define BGE_CHIPID_BCM5754_A2 0xb002 +#define BGE_CHIPID_BCM5761_A0 0x5761000 +#define BGE_CHIPID_BCM5761_A1 0x5761100 +#define BGE_CHIPID_BCM5784_A0 0x5784000 +#define BGE_CHIPID_BCM5784_A1 0x5784100 +#define BGE_CHIPID_BCM5787_A0 0xb000 +#define BGE_CHIPID_BCM5787_A1 0xb001 +#define BGE_CHIPID_BCM5787_A2 0xb002 +#define BGE_CHIPID_BCM5906_A1 0xc001 +#define BGE_CHIPID_BCM5906_A2 0xc002 +#define BGE_CHIPID_BCM57780_A0 0x57780000 +#define BGE_CHIPID_BCM57780_A1 0x57780001 /* shorthand one */ -#define BGE_ASICREV(x) ((x) >> 28) +#define BGE_ASICREV(x) ((x) >> 12) #define BGE_ASICREV_BCM5701 0x00 #define BGE_ASICREV_BCM5703 0x01 #define BGE_ASICREV_BCM5704 0x02 @@ -319,9 +327,16 @@ #define BGE_ASICREV_BCM5754 0x0b #define BGE_ASICREV_BCM5787 0x0b #define BGE_ASICREV_BCM5906 0x0c +/* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ +#define BGE_ASICREV_USE_PRODID_REG 0x0f +/* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5761 0x5761 +#define BGE_ASICREV_BCM5784 0x5784 +#define BGE_ASICREV_BCM5785 0x5785 +#define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ -#define BGE_CHIPREV(x) ((x) >> 24) +#define BGE_CHIPREV(x) ((x) >> 8) #define BGE_CHIPREV_5700_AX 0x70 #define BGE_CHIPREV_5700_BX 0x71 #define BGE_CHIPREV_5700_CX 0x72 @@ -331,6 +346,9 @@ #define BGE_CHIPREV_5704_BX 0x21 #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 +/* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5761_AX 0x57611 +#define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF @@ -861,6 +879,7 @@ #define BGE_SDCMODE_RESET 0x00000001 #define BGE_SDCMODE_ENABLE 0x00000002 #define BGE_SDCMODE_ATTN 0x00000004 +#define BGE_SDCMODE_CDELAY 0x00000010 /* Send Data completion status register */ #define BGE_SDCSTAT_ATTN 0x00000004 @@ -1378,6 +1397,9 @@ #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMAMODE_LOCWRITE_TOOBIG 0x00000200 #define BGE_RDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_RDMAMODE_BD_SBD_CRPT_ATTN 0x00000800 +#define BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN 0x00001000 +#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 @@ -1409,6 +1431,7 @@ #define BGE_WDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_WDMAMODE_LOCREAD_TOOBIG 0x00000200 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000 /* Write DMA status register */ #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -2101,6 +2124,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A +#define BCOM_DEVICEID_BCM5723 0x165B #define BCOM_DEVICEID_BCM5750 0x1676 #define BCOM_DEVICEID_BCM5750M 0x167C #define BCOM_DEVICEID_BCM5751 0x1677 @@ -2115,13 +2139,22 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5761 0x1681 +#define BCOM_DEVICEID_BCM5761E 0x1680 +#define BCOM_DEVICEID_BCM5761S 0x1688 +#define BCOM_DEVICEID_BCM5761SE 0x1689 +#define BCOM_DEVICEID_BCM5764 0x1684 #define BCOM_DEVICEID_BCM5780 0x166A #define BCOM_DEVICEID_BCM5780S 0x166B #define BCOM_DEVICEID_BCM5781 0x16DD #define BCOM_DEVICEID_BCM5782 0x1696 +#define BCOM_DEVICEID_BCM5784 0x1698 +#define BCOM_DEVICEID_BCM5785F 0x16a0 +#define BCOM_DEVICEID_BCM5785G 0x1699 #define BCOM_DEVICEID_BCM5786 0x169A #define BCOM_DEVICEID_BCM5787 0x169B #define BCOM_DEVICEID_BCM5787M 0x1693 +#define BCOM_DEVICEID_BCM5787F 0x167f #define BCOM_DEVICEID_BCM5788 0x169C #define BCOM_DEVICEID_BCM5789 0x169D #define BCOM_DEVICEID_BCM5901 0x170D @@ -2129,6 +2162,10 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5903M 0x16FF #define BCOM_DEVICEID_BCM5906 0x1712 #define BCOM_DEVICEID_BCM5906M 0x1713 +#define BCOM_DEVICEID_BCM57760 0x1690 +#define BCOM_DEVICEID_BCM57780 0x1692 +#define BCOM_DEVICEID_BCM57788 0x1691 +#define BCOM_DEVICEID_BCM57790 0x1694 /* * Alteon AceNIC PCI vendor/device ID. @@ -2179,6 +2216,14 @@ struct bge_status_block { #define SUN_VENDORID 0x108e /* + * Fujitsu vendor/device IDs + */ +#define FJTSU_VENDORID 0x10cf +#define FJTSU_DEVICEID_PW008GE5 0x11a1 +#define FJTSU_DEVICEID_PW008GE4 0x11a2 +#define FJTSU_DEVICEID_PP250450 0x11cc /* PRIMEPOWER250/450 LAN */ + +/* * Offset of MAC address inside EEPROM. */ #define BGE_EE_MAC_OFFSET 0x7C @@ -2558,6 +2603,7 @@ struct bge_softc { #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 +#define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 @@ -2568,8 +2614,8 @@ struct bge_softc { #define BGE_FLAG_CRC_BUG 0x08000000 #define BGE_FLAG_5788 0x20000000 uint32_t bge_chipid; - uint8_t bge_asicrev; - uint8_t bge_chiprev; + uint32_t bge_asicrev; + uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; struct bge_ring_data bge_ldata; /* rings */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:16:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3FD1065670; Tue, 15 Dec 2009 10:16:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916BD8FC1A; Tue, 15 Dec 2009 10:16: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 nBFAGvLq057714; Tue, 15 Dec 2009 10:16:57 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAGvuk057712; Tue, 15 Dec 2009 10:16:57 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151016.nBFAGvuk057712@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200569 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:16:57 -0000 Author: stas Date: Tue Dec 15 10:16:57 2009 New Revision: 200569 URL: http://svn.freebsd.org/changeset/base/200569 Log: MFC r198318: - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag instead of POSTREAD: the hardware do not touch this memory (CPU updates it). It is already synchronized as PREWRITE after the processing is done. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:00:00 2009 (r200568) +++ stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:16:57 2009 (r200569) @@ -3122,10 +3122,10 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); if (BGE_IS_JUMBO_CAPABLE(sc)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); while (rx_cons != rx_prod) { struct bge_rx_bd *cur_rx; @@ -3251,6 +3251,8 @@ bge_rxeof(struct bge_softc *sc) return (rx_npkts); } + bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, + sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_PREREAD); if (stdcnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); @@ -3423,8 +3425,6 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3445,6 +3445,9 @@ bge_intr(void *xsc) !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + BGE_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:34:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BAB6106566B; Tue, 15 Dec 2009 10:34:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592158FC13; Tue, 15 Dec 2009 10:34: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 nBFAY5xl060815; Tue, 15 Dec 2009 10:34:05 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAY57e060811; Tue, 15 Dec 2009 10:34:05 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151034.nBFAY57e060811@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200570 - in stable/7: share/man/man4 sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:34:05 -0000 Author: stas Date: Tue Dec 15 10:34:05 2009 New Revision: 200570 URL: http://svn.freebsd.org/changeset/base/200570 Log: - MFC r197832, r197834, r197837: - Add support for new BGE chips (5761, 5784 and 57780). These chips uses new BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision. - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS). - Add IDs for Fujitsu-branded Broadcom adapters. > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. _M 7/share/man/man4 M 7/share/man/man4/bge.4 _M 7/sys M 7/sys/dev/bge/if_bgereg.h M 7/sys/dev/bge/if_bge.c _M 7/sys/contrib/pf _M 7/sys/contrib/dev/acpica _M 7/sys/cddl/contrib/opensolaris Modified: stable/7/share/man/man4/bge.4 stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/share/man/man4/bge.4 ============================================================================== --- stable/7/share/man/man4/bge.4 Tue Dec 15 10:16:57 2009 (r200569) +++ stable/7/share/man/man4/bge.4 Tue Dec 15 10:34:05 2009 (r200570) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2009 +.Dd December 15, 2009 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet -controller chips. +5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families +of Gigabit Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Tue Dec 15 10:16:57 2009 (r200569) +++ stable/7/sys/dev/bge/if_bge.c Tue Dec 15 10:34:05 2009 (r200570) @@ -170,6 +170,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -184,12 +185,21 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5782 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5784 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785F }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785G }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5786 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5787F }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5788 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5789 }, @@ -198,11 +208,19 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5903M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57788 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57790 }, { SK_VENDORID, SK_DEVICEID_ALTIMA }, { TC_VENDORID, TC_DEVICEID_3C996 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE4 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE5 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PP250450 }, + { 0, 0 } }; @@ -216,6 +234,7 @@ static const struct bge_vendor { { BCOM_VENDORID, "Broadcom" }, { SK_VENDORID, "SysKonnect" }, { TC_VENDORID, "3Com" }, + { FJTSU_VENDORID, "Fujitsu" }, { 0, NULL } }; @@ -271,12 +290,18 @@ static const struct bge_revision { { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, + { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, + { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, + { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, { BGE_CHIPID_BCM5906_A2, "BCM5906 A2" }, + { BGE_CHIPID_BCM57780_A0, "BCM57780 A0" }, + { BGE_CHIPID_BCM57780_A1, "BCM57780 A1" }, { 0, NULL } }; @@ -297,9 +322,13 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5780, "unknown BCM5780" }, { BGE_ASICREV_BCM5714, "unknown BCM5714" }, { BGE_ASICREV_BCM5755, "unknown BCM5755" }, + { BGE_ASICREV_BCM5761, "unknown BCM5761" }, + { BGE_ASICREV_BCM5784, "unknown BCM5784" }, + { BGE_ASICREV_BCM5785, "unknown BCM5785" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, + { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { 0, NULL } }; @@ -309,6 +338,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) +#define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -1758,9 +1788,8 @@ bge_blockinit(struct bge_softc *sc) val = BGE_WDMAMODE_ENABLE | BGE_WDMAMODE_ALL_ATTNS; /* Enable host coalescing bug fix. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) - val |= 1 << 29; + if (BGE_IS_5755_PLUS(sc)) + val |= BGE_WDMAMODE_STATUS_TAG_FIX; /* Turn on write DMA state machine */ CSR_WRITE_4(sc, BGE_WDMA_MODE, val); @@ -1768,6 +1797,12 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_BD_SBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -1790,7 +1825,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); /* Turn on send data completion state machine */ - CSR_WRITE_4(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); + val = BGE_SDCMODE_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + val |= BGE_SDCMODE_CDELAY; + CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -1897,8 +1935,11 @@ bge_probe(device_t dev) const struct bge_vendor *v; uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -1915,8 +1956,8 @@ bge_probe(device_t dev) br != NULL ? br->br_name : "NetXtreme Ethernet Controller"); } - snprintf(buf, 96, "%s, %sASIC rev. %#04x", model, - br != NULL ? "" : "unknown ", id >> 16); + snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, + br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); if (pci_get_subvendor(dev) == DELL_VENDORID) sc->bge_flags |= BGE_FLAG_NO_3LED; @@ -2411,8 +2452,11 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) + sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, + 4); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -2431,6 +2475,15 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5755: + case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5784: + case BGE_ASICREV_BCM5785: + case BGE_ASICREV_BCM5787: + case BGE_ASICREV_BCM57780: + sc->bge_flags |= BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | + BGE_FLAG_5705_PLUS; + break; case BGE_ASICREV_BCM5700: case BGE_ASICREV_BCM5701: case BGE_ASICREV_BCM5703: @@ -2444,8 +2497,6 @@ bge_attach(device_t dev) /* FALLTHRU */ case BGE_ASICREV_BCM5750: case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5755: - case BGE_ASICREV_BCM5787: case BGE_ASICREV_BCM5906: sc->bge_flags |= BGE_FLAG_575X_PLUS; /* FALLTHRU */ @@ -2466,6 +2517,8 @@ bge_attach(device_t dev) if (BGE_IS_5705_PLUS(sc) && !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) sc->bge_flags |= BGE_FLAG_JITTER_BUG; @@ -2873,8 +2926,7 @@ bge_reset(struct bge_softc *sc) /* Disable fastboot on controllers that support it. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || - sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { + BGE_IS_5755_PLUS(sc)) { if (bootverbose) device_printf(sc->bge_dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); @@ -4684,6 +4736,8 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG } printf("Hardware Flags:\n"); + if (BGE_IS_5755_PLUS(sc)) + printf(" - 5755 Plus\n"); if (BGE_IS_575X_PLUS(sc)) printf(" - 575X Plus\n"); if (BGE_IS_5705_PLUS(sc)) Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Tue Dec 15 10:16:57 2009 (r200569) +++ stable/7/sys/dev/bge/if_bgereg.h Tue Dec 15 10:34:05 2009 (r200570) @@ -218,6 +218,7 @@ #define BGE_PCI_UNDI_TX_BD_PRODIDX_LO 0xAC #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 +#define BGE_PCI_PRODID_ASICREV 0xBC /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +230,7 @@ #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 +#define BGE_PCIMISCCTL_ASICREV_SHIFT 16 #define BGE_HIF_SWAP_OPTIONS (BGE_PCIMISCCTL_ENDIAN_WORDSWAP) #if BYTE_ORDER == LITTLE_ENDIAN @@ -245,66 +247,72 @@ (BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_CLEAR_INTA| \ BGE_PCIMISCCTL_MASK_PCI_INTR|BGE_PCIMISCCTL_INDIRECT_ACCESS) -#define BGE_CHIPID_TIGON_I 0x40000000 -#define BGE_CHIPID_TIGON_II 0x60000000 -#define BGE_CHIPID_BCM5700_A0 0x70000000 -#define BGE_CHIPID_BCM5700_A1 0x70010000 -#define BGE_CHIPID_BCM5700_B0 0x71000000 -#define BGE_CHIPID_BCM5700_B1 0x71010000 -#define BGE_CHIPID_BCM5700_B2 0x71020000 -#define BGE_CHIPID_BCM5700_B3 0x71030000 -#define BGE_CHIPID_BCM5700_ALTIMA 0x71040000 -#define BGE_CHIPID_BCM5700_C0 0x72000000 -#define BGE_CHIPID_BCM5701_A0 0x00000000 /* grrrr */ -#define BGE_CHIPID_BCM5701_B0 0x01000000 -#define BGE_CHIPID_BCM5701_B2 0x01020000 -#define BGE_CHIPID_BCM5701_B5 0x01050000 -#define BGE_CHIPID_BCM5703_A0 0x10000000 -#define BGE_CHIPID_BCM5703_A1 0x10010000 -#define BGE_CHIPID_BCM5703_A2 0x10020000 -#define BGE_CHIPID_BCM5703_A3 0x10030000 -#define BGE_CHIPID_BCM5703_B0 0x11000000 -#define BGE_CHIPID_BCM5704_A0 0x20000000 -#define BGE_CHIPID_BCM5704_A1 0x20010000 -#define BGE_CHIPID_BCM5704_A2 0x20020000 -#define BGE_CHIPID_BCM5704_A3 0x20030000 -#define BGE_CHIPID_BCM5704_B0 0x21000000 -#define BGE_CHIPID_BCM5705_A0 0x30000000 -#define BGE_CHIPID_BCM5705_A1 0x30010000 -#define BGE_CHIPID_BCM5705_A2 0x30020000 -#define BGE_CHIPID_BCM5705_A3 0x30030000 -#define BGE_CHIPID_BCM5750_A0 0x40000000 -#define BGE_CHIPID_BCM5750_A1 0x40010000 -#define BGE_CHIPID_BCM5750_A3 0x40030000 -#define BGE_CHIPID_BCM5750_B0 0x41000000 -#define BGE_CHIPID_BCM5750_B1 0x41010000 -#define BGE_CHIPID_BCM5750_C0 0x42000000 -#define BGE_CHIPID_BCM5750_C1 0x42010000 -#define BGE_CHIPID_BCM5750_C2 0x42020000 -#define BGE_CHIPID_BCM5714_A0 0x50000000 -#define BGE_CHIPID_BCM5752_A0 0x60000000 -#define BGE_CHIPID_BCM5752_A1 0x60010000 -#define BGE_CHIPID_BCM5752_A2 0x60020000 -#define BGE_CHIPID_BCM5714_B0 0x80000000 -#define BGE_CHIPID_BCM5714_B3 0x80030000 -#define BGE_CHIPID_BCM5715_A0 0x90000000 -#define BGE_CHIPID_BCM5715_A1 0x90010000 -#define BGE_CHIPID_BCM5715_A3 0x90030000 -#define BGE_CHIPID_BCM5755_A0 0xa0000000 -#define BGE_CHIPID_BCM5755_A1 0xa0010000 -#define BGE_CHIPID_BCM5755_A2 0xa0020000 -#define BGE_CHIPID_BCM5722_A0 0xa2000000 -#define BGE_CHIPID_BCM5754_A0 0xb0000000 -#define BGE_CHIPID_BCM5754_A1 0xb0010000 -#define BGE_CHIPID_BCM5754_A2 0xb0020000 -#define BGE_CHIPID_BCM5787_A0 0xb0000000 -#define BGE_CHIPID_BCM5787_A1 0xb0010000 -#define BGE_CHIPID_BCM5787_A2 0xb0020000 -#define BGE_CHIPID_BCM5906_A1 0xc0010000 -#define BGE_CHIPID_BCM5906_A2 0xc0020000 +#define BGE_CHIPID_TIGON_I 0x4000 +#define BGE_CHIPID_TIGON_II 0x6000 +#define BGE_CHIPID_BCM5700_A0 0x7000 +#define BGE_CHIPID_BCM5700_A1 0x7001 +#define BGE_CHIPID_BCM5700_B0 0x7100 +#define BGE_CHIPID_BCM5700_B1 0x7101 +#define BGE_CHIPID_BCM5700_B2 0x7102 +#define BGE_CHIPID_BCM5700_B3 0x7103 +#define BGE_CHIPID_BCM5700_ALTIMA 0x7104 +#define BGE_CHIPID_BCM5700_C0 0x7200 +#define BGE_CHIPID_BCM5701_A0 0x0000 /* grrrr */ +#define BGE_CHIPID_BCM5701_B0 0x0100 +#define BGE_CHIPID_BCM5701_B2 0x0102 +#define BGE_CHIPID_BCM5701_B5 0x0105 +#define BGE_CHIPID_BCM5703_A0 0x1000 +#define BGE_CHIPID_BCM5703_A1 0x1001 +#define BGE_CHIPID_BCM5703_A2 0x1002 +#define BGE_CHIPID_BCM5703_A3 0x1003 +#define BGE_CHIPID_BCM5703_B0 0x1100 +#define BGE_CHIPID_BCM5704_A0 0x2000 +#define BGE_CHIPID_BCM5704_A1 0x2001 +#define BGE_CHIPID_BCM5704_A2 0x2002 +#define BGE_CHIPID_BCM5704_A3 0x2003 +#define BGE_CHIPID_BCM5704_B0 0x2100 +#define BGE_CHIPID_BCM5705_A0 0x3000 +#define BGE_CHIPID_BCM5705_A1 0x3001 +#define BGE_CHIPID_BCM5705_A2 0x3002 +#define BGE_CHIPID_BCM5705_A3 0x3003 +#define BGE_CHIPID_BCM5750_A0 0x4000 +#define BGE_CHIPID_BCM5750_A1 0x4001 +#define BGE_CHIPID_BCM5750_A3 0x4000 +#define BGE_CHIPID_BCM5750_B0 0x4100 +#define BGE_CHIPID_BCM5750_B1 0x4101 +#define BGE_CHIPID_BCM5750_C0 0x4200 +#define BGE_CHIPID_BCM5750_C1 0x4201 +#define BGE_CHIPID_BCM5750_C2 0x4202 +#define BGE_CHIPID_BCM5714_A0 0x5000 +#define BGE_CHIPID_BCM5752_A0 0x6000 +#define BGE_CHIPID_BCM5752_A1 0x6001 +#define BGE_CHIPID_BCM5752_A2 0x6002 +#define BGE_CHIPID_BCM5714_B0 0x8000 +#define BGE_CHIPID_BCM5714_B3 0x8003 +#define BGE_CHIPID_BCM5715_A0 0x9000 +#define BGE_CHIPID_BCM5715_A1 0x9001 +#define BGE_CHIPID_BCM5715_A3 0x9003 +#define BGE_CHIPID_BCM5755_A0 0xa000 +#define BGE_CHIPID_BCM5755_A1 0xa001 +#define BGE_CHIPID_BCM5755_A2 0xa002 +#define BGE_CHIPID_BCM5722_A0 0xa200 +#define BGE_CHIPID_BCM5754_A0 0xb000 +#define BGE_CHIPID_BCM5754_A1 0xb001 +#define BGE_CHIPID_BCM5754_A2 0xb002 +#define BGE_CHIPID_BCM5761_A0 0x5761000 +#define BGE_CHIPID_BCM5761_A1 0x5761100 +#define BGE_CHIPID_BCM5784_A0 0x5784000 +#define BGE_CHIPID_BCM5784_A1 0x5784100 +#define BGE_CHIPID_BCM5787_A0 0xb000 +#define BGE_CHIPID_BCM5787_A1 0xb001 +#define BGE_CHIPID_BCM5787_A2 0xb002 +#define BGE_CHIPID_BCM5906_A1 0xc001 +#define BGE_CHIPID_BCM5906_A2 0xc002 +#define BGE_CHIPID_BCM57780_A0 0x57780000 +#define BGE_CHIPID_BCM57780_A1 0x57780001 /* shorthand one */ -#define BGE_ASICREV(x) ((x) >> 28) +#define BGE_ASICREV(x) ((x) >> 12) #define BGE_ASICREV_BCM5701 0x00 #define BGE_ASICREV_BCM5703 0x01 #define BGE_ASICREV_BCM5704 0x02 @@ -319,9 +327,16 @@ #define BGE_ASICREV_BCM5754 0x0b #define BGE_ASICREV_BCM5787 0x0b #define BGE_ASICREV_BCM5906 0x0c +/* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ +#define BGE_ASICREV_USE_PRODID_REG 0x0f +/* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5761 0x5761 +#define BGE_ASICREV_BCM5784 0x5784 +#define BGE_ASICREV_BCM5785 0x5785 +#define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ -#define BGE_CHIPREV(x) ((x) >> 24) +#define BGE_CHIPREV(x) ((x) >> 8) #define BGE_CHIPREV_5700_AX 0x70 #define BGE_CHIPREV_5700_BX 0x71 #define BGE_CHIPREV_5700_CX 0x72 @@ -331,6 +346,9 @@ #define BGE_CHIPREV_5704_BX 0x21 #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 +/* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5761_AX 0x57611 +#define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF @@ -861,6 +879,7 @@ #define BGE_SDCMODE_RESET 0x00000001 #define BGE_SDCMODE_ENABLE 0x00000002 #define BGE_SDCMODE_ATTN 0x00000004 +#define BGE_SDCMODE_CDELAY 0x00000010 /* Send Data completion status register */ #define BGE_SDCSTAT_ATTN 0x00000004 @@ -1378,6 +1397,9 @@ #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMAMODE_LOCWRITE_TOOBIG 0x00000200 #define BGE_RDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_RDMAMODE_BD_SBD_CRPT_ATTN 0x00000800 +#define BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN 0x00001000 +#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 @@ -1409,6 +1431,7 @@ #define BGE_WDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_WDMAMODE_LOCREAD_TOOBIG 0x00000200 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000 /* Write DMA status register */ #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -2101,6 +2124,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A +#define BCOM_DEVICEID_BCM5723 0x165B #define BCOM_DEVICEID_BCM5750 0x1676 #define BCOM_DEVICEID_BCM5750M 0x167C #define BCOM_DEVICEID_BCM5751 0x1677 @@ -2115,13 +2139,22 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5761 0x1681 +#define BCOM_DEVICEID_BCM5761E 0x1680 +#define BCOM_DEVICEID_BCM5761S 0x1688 +#define BCOM_DEVICEID_BCM5761SE 0x1689 +#define BCOM_DEVICEID_BCM5764 0x1684 #define BCOM_DEVICEID_BCM5780 0x166A #define BCOM_DEVICEID_BCM5780S 0x166B #define BCOM_DEVICEID_BCM5781 0x16DD #define BCOM_DEVICEID_BCM5782 0x1696 +#define BCOM_DEVICEID_BCM5784 0x1698 +#define BCOM_DEVICEID_BCM5785F 0x16a0 +#define BCOM_DEVICEID_BCM5785G 0x1699 #define BCOM_DEVICEID_BCM5786 0x169A #define BCOM_DEVICEID_BCM5787 0x169B #define BCOM_DEVICEID_BCM5787M 0x1693 +#define BCOM_DEVICEID_BCM5787F 0x167f #define BCOM_DEVICEID_BCM5788 0x169C #define BCOM_DEVICEID_BCM5789 0x169D #define BCOM_DEVICEID_BCM5901 0x170D @@ -2129,6 +2162,10 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5903M 0x16FF #define BCOM_DEVICEID_BCM5906 0x1712 #define BCOM_DEVICEID_BCM5906M 0x1713 +#define BCOM_DEVICEID_BCM57760 0x1690 +#define BCOM_DEVICEID_BCM57780 0x1692 +#define BCOM_DEVICEID_BCM57788 0x1691 +#define BCOM_DEVICEID_BCM57790 0x1694 /* * Alteon AceNIC PCI vendor/device ID. @@ -2179,6 +2216,14 @@ struct bge_status_block { #define SUN_VENDORID 0x108e /* + * Fujitsu vendor/device IDs + */ +#define FJTSU_VENDORID 0x10cf +#define FJTSU_DEVICEID_PW008GE5 0x11a1 +#define FJTSU_DEVICEID_PW008GE4 0x11a2 +#define FJTSU_DEVICEID_PP250450 0x11cc /* PRIMEPOWER250/450 LAN */ + +/* * Offset of MAC address inside EEPROM. */ #define BGE_EE_MAC_OFFSET 0x7C @@ -2558,6 +2603,7 @@ struct bge_softc { #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 +#define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 @@ -2568,8 +2614,8 @@ struct bge_softc { #define BGE_FLAG_CRC_BUG 0x08000000 #define BGE_FLAG_5788 0x20000000 uint32_t bge_chipid; - uint8_t bge_asicrev; - uint8_t bge_chiprev; + uint32_t bge_asicrev; + uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; struct bge_ring_data bge_ldata; /* rings */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:36:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 112611065696; Tue, 15 Dec 2009 10:36:09 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAC3E8FC21; Tue, 15 Dec 2009 10:36: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 nBFAa8Ww060899; Tue, 15 Dec 2009 10:36:08 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAa8h5060897; Tue, 15 Dec 2009 10:36:08 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151036.nBFAa8h5060897@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200571 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:36:09 -0000 Author: stas Date: Tue Dec 15 10:36:08 2009 New Revision: 200571 URL: http://svn.freebsd.org/changeset/base/200571 Log: - MFC r198318: - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag instead of POSTREAD: the hardware do not touch this memory (CPU updates it). It is already synchronized as PREWRITE after the processing is done. - Synchronize RX return ring memory in rx_eof. This is needed as the deviced updates this memory when receives packets. - Decouple the synchronization of BGE status block in the interrupt service routine: perfrom PREREAD synchronization only all accesses to this block are finished. This seems to be more natural. Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Tue Dec 15 10:34:05 2009 (r200570) +++ stable/7/sys/dev/bge/if_bge.c Tue Dec 15 10:36:08 2009 (r200571) @@ -3120,10 +3120,10 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); if (BGE_IS_JUMBO_CAPABLE(sc)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); while(sc->bge_rx_saved_considx != sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) { @@ -3250,6 +3250,8 @@ bge_rxeof(struct bge_softc *sc) return; } + bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, + sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_PREREAD); if (stdcnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); @@ -3418,8 +3420,6 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3440,6 +3440,9 @@ bge_intr(void *xsc) !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + BGE_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:40:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1979B1065679; Tue, 15 Dec 2009 10:40:41 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07F658FC16; Tue, 15 Dec 2009 10:40: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 nBFAeeUJ061026; Tue, 15 Dec 2009 10:40:40 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAeexh061025; Tue, 15 Dec 2009 10:40:40 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200912151040.nBFAeexh061025@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 15 Dec 2009 10:40: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: r200572 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:40:41 -0000 Author: bms Date: Tue Dec 15 10:40:40 2009 New Revision: 200572 URL: http://svn.freebsd.org/changeset/base/200572 Log: Add missing #include . Submitted by: Hideki Yamamoto MFC after: 1 week Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Dec 15 10:36:08 2009 (r200571) +++ head/sys/netinet6/mld6.c Tue Dec 15 10:40:40 2009 (r200572) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:43:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13B9D106568F; Tue, 15 Dec 2009 10:43:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02B328FC15; Tue, 15 Dec 2009 10:43: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 nBFAhKRo061114; Tue, 15 Dec 2009 10:43:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAhKHR061110; Tue, 15 Dec 2009 10:43:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912151043.nBFAhKHR061110@svn.freebsd.org> From: Robert Watson Date: Tue, 15 Dec 2009 10:43: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: r200573 - head/tools/regression/kqueue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:43:21 -0000 Author: rwatson Date: Tue Dec 15 10:43:20 2009 New Revision: 200573 URL: http://svn.freebsd.org/changeset/base/200573 Log: Merge libkqueue test suite through r119 Submitted by: Mark Heily Modified: head/tools/regression/kqueue/config.h head/tools/regression/kqueue/main.c head/tools/regression/kqueue/user.c Modified: head/tools/regression/kqueue/config.h ============================================================================== --- head/tools/regression/kqueue/config.h Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/config.h Tue Dec 15 10:43:20 2009 (r200573) @@ -1,5 +1,6 @@ /* AUTOMATICALLY GENERATED -- DO NOT EDIT */ /* $FreeBSD$ */ +#define HAVE_ERR_H #define HAVE_SYS_EVENT_H #define HAVE_EV_DISPATCH 1 #define HAVE_EV_RECEIPT 1 Modified: head/tools/regression/kqueue/main.c ============================================================================== --- head/tools/regression/kqueue/main.c Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/main.c Tue Dec 15 10:43:20 2009 (r200573) @@ -235,7 +235,12 @@ main(int argc, char **argv) int test_signal = 1; int test_vnode = 1; int test_timer = 1; +#ifdef __FreeBSD__ int test_user = 1; +#else + /* XXX-FIXME temporary */ + int test_user = 0; +#endif while (argc) { if (strcmp(argv[0], "--no-proc") == 0) Modified: head/tools/regression/kqueue/user.c ============================================================================== --- head/tools/regression/kqueue/user.c Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/user.c Tue Dec 15 10:43:20 2009 (r200573) @@ -45,12 +45,15 @@ event_wait(void) test_begin(test_id); + test_no_kevents(); + /* Add the event, and then trigger it */ - kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL); + kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; + kev.flags = EV_CLEAR; kevent_cmp(&kev, kevent_get(kqfd)); test_no_kevents(); @@ -66,6 +69,8 @@ disable_and_enable(void) test_begin(test_id); + test_no_kevents(); + kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_DISABLE, 0, 0, NULL); @@ -76,7 +81,7 @@ disable_and_enable(void) kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ENABLE, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); - kev.flags = 0; + kev.flags = EV_CLEAR; kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; kevent_cmp(&kev, kevent_get(kqfd)); @@ -92,26 +97,18 @@ oneshot(void) test_begin(test_id); - kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL); + test_no_kevents(); + + kevent_add(kqfd, &kev, 2, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL); puts(" -- event 1"); - kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); + kevent_add(kqfd, &kev, 2, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); - kev.flags = 0; + kev.flags = EV_ONESHOT; kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; kevent_cmp(&kev, kevent_get(kqfd)); - /* Try to trigger the event again. It is deleted, so that - should be an error. However, on FreeBSD 8 it is not an error, - so the event is ignored. - */ - puts(" -- triggering an event that will be ignored"); - kev.flags = 0; - kev.fflags |= NOTE_TRIGGER; - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); - test_no_kevents(); success(); From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:49:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 389A61065670; Tue, 15 Dec 2009 10:49:59 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDC18FC28; Tue, 15 Dec 2009 10:49:57 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so304960fgg.13 for ; Tue, 15 Dec 2009 02:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=wES1hhaFpER+V5OROC9CejtExnuroyx0jmi0SOV48BY=; b=GNxd7RyIGu7AZh+W/cetcrerOATdN+ikMcUKhvLfTS43NiWdmqDRaLzYG/IFGwYhBf 9HrQxGYLlKlye/jTKwH8xI4iPpWqJnVYX4xteMiXNPhN/gETxN6J8Dxuuqtae0EX/JQr VBzlg34YwjKUlK+TmwSP1UaaY3v9gS/cFOx0A= 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=k10WXhcibDKedfDOiWye8yCCIUHXu1gVpzPmMhyeUB5k0hrY76BX1jUR91IMbjfu5R Vwu3FYm5NlLppamZzOnn1e9rERlWc6aPP7N3r1AOj3YnC9atRTfdco1v4AAR+ZH5J+4d LWGZT6X383rZNiNAEYO7fOLjAmFkyzlDpOUsk= MIME-Version: 1.0 Received: by 10.102.183.10 with SMTP id g10mr2726345muf.78.1260874196890; Tue, 15 Dec 2009 02:49:56 -0800 (PST) In-Reply-To: <200912150704.nBF74KUv053538@svn.freebsd.org> References: <200912150704.nBF74KUv053538@svn.freebsd.org> Date: Tue, 15 Dec 2009 10:49:56 +0000 Message-ID: <6101e8c40912150249x7ddbf920r21e2232f0b9b471@mail.gmail.com> From: Oliver Pinter To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r200564 - stable/7/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:49:59 -0000 On 12/15/09, Luigi Rizzo wrote: > Author: luigi > Date: Tue Dec 15 07:04:20 2009 > New Revision: 200564 > URL: http://svn.freebsd.org/changeset/base/200564 > > Log: > MFC r200301 > when calling ldd, use the cross libraries and not the host version > > Modified: > stable/7/release/picobsd/build/picobsd > > Modified: stable/7/release/picobsd/build/picobsd > ============================================================================== > --- stable/7/release/picobsd/build/picobsd Tue Dec 15 05:14:39 > 2009 (r200563) > +++ stable/7/release/picobsd/build/picobsd Tue Dec 15 07:04:20 > 2009 (r200564) > @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt > local no > log "create_includes_and_libraries2() for ${SRC}" > if [ ${OSVERSION} -ge 600000 ] ; then > - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" > + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" is this not WITHOUT_CDDL with H ? > else > no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" > fi > @@ -587,8 +587,9 @@ find_progs() { # programs > local i > u_progs="`find_progs_helper $*`" > local o=${o_objdir:-${_SHLIBDIRPREFIX}} > + log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" > [ -z "${u_progs}" ] && return 1 # not found, error > - i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" > + i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print > $1}' | sort | uniq`" > u_libs="`find_progs_helper $i`" > return 0 > } > @@ -719,8 +720,7 @@ populate_mfs_tree() { > (cd ${dst}; chown -R root . ) > fi > > - # If we are building a shared 'crunch', take the libraries > - # and the dynamic loader as well > + log "for a shared 'crunch' take libraries and dynamic loader as well" > find_progs ${dst}/stand/crunch > if [ -n "${u_libs}" ] ; then > mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 10:58:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27873106568F; Tue, 15 Dec 2009 10:58:07 +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 02C618FC17; Tue, 15 Dec 2009 10:58:07 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8A9EC46B39; Tue, 15 Dec 2009 05:58:06 -0500 (EST) Date: Tue, 15 Dec 2009 10:58:06 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Doug Barton In-Reply-To: <200912150514.nBF5Eej4050810@svn.freebsd.org> Message-ID: References: <200912150514.nBF5Eej4050810@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: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:58:07 -0000 On Tue, 15 Dec 2009, Doug Barton wrote: > The named process needs to have a "working directory" that it can > write to. This is specified in "options { directory }" in named.conf. > So, create /etc/namedb/working with appropriate permissions, and > update the entry in named.conf to match. > > In addition to specifying the working directory, file and path names > in named.conf can be specified relative to the directory listed. > However, since that directory is now different from /etc/namedb > (where the configuration, zone, rndc.*, and other files are located) > further update named.conf to specify all file names with fully > qualified paths. Also update the comment about file and path names > so users know this should be done for all file/path names in the file. > > This change will eliminate the 'working directory is not writable' > messages at boot time without sacrificing security. It will also > allow for features in newer versions of BIND (9.7+) to work as > designed. On a couple of occasions, I've found myself trying to help people get BIND to core dump on a bug, which is a bit tricky in practice. It involves setting appropriate sysctls so that sugid processes generate cores, arranging for a writable core dump directory in the chroot and setting a sysctl so it is found, etc. Does this change simplify that process down to "enable core dump for sugid processes"? If not, are there other things we could do to make this easier? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 11:55:35 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00FD1065693; Tue, 15 Dec 2009 11:55:35 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8DD8FC3E; Tue, 15 Dec 2009 11:55:31 +0000 (UTC) Received: by people.fsn.hu (Postfix, from userid 1001) id D97A21C8DBE; Tue, 15 Dec 2009 12:55:29 +0100 (CET) X-CRM114-Version: 20090423-BlameSteveJobs ( TRE 0.7.6 (BSD) ) MF-ACE0E1EA [pR: 21.8841] X-CRM114-CacheID: sfid-20091215_12552_303E3674 X-CRM114-Status: Good ( pR: 21.8841 ) Message-ID: <4B27792F.4050403@fsn.hu> Date: Tue, 15 Dec 2009 12:55:27 +0100 From: Attila Nagy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090817 Thunderbird/2.0.0.23 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> <4B159540.9000503@fsn.hu> <4B162C8E.3090507@FreeBSD.org> In-Reply-To: <4B162C8E.3090507@FreeBSD.org> X-Stationery: 0.4.10 Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (people.fsn.hu); Tue, 15 Dec 2009 12:55:28 +0100 (CET) Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-stable-7@FreeBSD.org, Tom Judge Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 11:55:36 -0000 Maxim Sobolev wrote: > Attila Nagy wrote: >> Maxim Sobolev wrote: >>> Stanislav Sedov wrote: >>>> On Mon, 30 Nov 2009 13:25:03 -0800 >>>> Maxim Sobolev mentioned: >>>> >>>>> Can we change the name then? We've seen the similar issue without >>>>> the jumbo frames, which made me wonder. >>>> >>>> It's strange, because 'normal' frames are less than a page size in >>>> length, >>>> so the issue I was experiencing should not be reproducable with >>>> jumbo frames >>>> disabled. Can you describe a bit more what kind of problem you're >>>> experiencing? >>> >>> The traffic through interface abruptly halts randomly when under a >>> load, without any signs of a problem. What is interesting is that >>> the communication through unix domain sockets appears to be down >>> too, since some scripts that connect to database not able to >>> complete as well, so whatever this problem is it affect the whole >>> network subsystem. We tried to replace hardware and it did not help. >>> Only after we replaced bce(4) with IntelPro card (em) the problem >>> has went away. >> Sorry, I've just noticed this thread and did not read the earlier >> posts. I can see similar, although only (at least for now) on version >> 8 (running something around RC2), also with bce interfaces and >> "heavy" -in terms of pps, this is a DNS server- network load. >> >> Everything which involves network halts for some minutes, but the >> machine is completely usable from the console. top shows some >> processes (I don't have an output, but as far as I can remember they >> were only that which did network IO) in the "keglim" state. >> Then something happens and the machine starts to work again. >> >> Can this be the same, or is it completely different? > > It really looks like the same issue. Those boxes are heavy-duty VoIP > switches, so that they are handling high PPS as well in our case. > This is what I can see when the machine freezes (and in this case restarted, sadly this is a diskless machine): last pid: 86028; load averages: 0.53, 0.35, 0.27 up 0+05:23:37 12:49:15 47 processes: 2 running, 43 sleeping, 1 zombie, 1 lock CPU: 0.1% user, 0.0% nice, 0.1% system, 27.3% interrupt, 72.6% idle Mem: 3200M Active, 21M Inact, 221M Wired, 228K Cache, 43M Buf, 4471M Free Swap: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 720 bind 1 64 0 3153M 3154M RUN 0 63:40 0.83% unbound 85972 root 1 60 0 37428K 10936K *udp 1 0:00 0.15% python 721 bind 3 44 0 70892K 24328K uwait 2 7:38 0.00% python2.6 2575 root 1 76 0 8212K 2376K pause 1 0:06 0.00% csh 556 root 1 44 0 14972K 1848K select 3 0:05 0.00% syslog-ng I can't type on already established ssh connections, and nothing comes out from the machine (for example via syslog). This is on 8-STABLE from yesterday... Thanks, From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 12:32:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70928106566B; Tue, 15 Dec 2009 12:32:01 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4671C8FC0A; Tue, 15 Dec 2009 12:32: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 nBFCW10x063427; Tue, 15 Dec 2009 12:32:01 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFCW1qG063425; Tue, 15 Dec 2009 12:32:01 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200912151232.nBFCW1qG063425@svn.freebsd.org> From: Philip Paeps Date: Tue, 15 Dec 2009 12:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200574 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 12:32:01 -0000 Author: philip Date: Tue Dec 15 12:32:00 2009 New Revision: 200574 URL: http://svn.freebsd.org/changeset/base/200574 Log: Take jb's commit bit into safekeeping. Rest in peace. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Dec 15 10:43:20 2009 (r200573) +++ svnadmin/conf/access Tue Dec 15 12:32:00 2009 (r200574) @@ -98,7 +98,6 @@ ivoras iwasaki jamie jasone -jb jeff jfv jh From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 13:29:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2EF11065679; Tue, 15 Dec 2009 13:29:04 +0000 (UTC) (envelope-from pdegoeje@service2media.com) Received: from s2m-is-001.service2media.com (rev-130-102.virtu.nl [217.114.102.130]) by mx1.freebsd.org (Postfix) with ESMTP id 66C4C8FC08; Tue, 15 Dec 2009 13:29:03 +0000 (UTC) Received: from pieter-dev-linux.localnet ([10.0.1.18] RDNS failed) by s2m-is-001.service2media.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Dec 2009 14:16:56 +0100 From: Pieter de Goeje Organization: Service2Media To: svn-src-all@freebsd.org Date: Tue, 15 Dec 2009 14:16:56 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <20091214144635.GA91618@onelab2.iet.unipi.it> In-Reply-To: <20091214144635.GA91618@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912151416.56348.pieter@service2media.com> X-OriginalArrivalTime: 15 Dec 2009 13:16:56.0977 (UTC) FILETIME=[E08BE810:01CA7D88] Cc: svn-src-head@freebsd.org, Robert Watson , Luigi Rizzo , src-committers@freebsd.org, Luigi Rizzo Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 13:29:04 -0000 On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: > On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > > On Mon, 14 Dec 2009, Luigi Rizzo wrote: > > ... > > > > Together with a smaller patch committed in september, this fixes a > > > bug that affects 8.0 with apps that rely on callouts to fire exactly > > > in the number of ticks specified (qemu among them). > > > Right now, callouts in 8.0 fire one tick late. > > > > > > This was discussed in september with JeffR and jhb > > > > Once this has burned in, is it something you would consider appropriate > > to be an errata note candidate? > > i have no objection, but at the time someone commented that > callouts do not _guarantee_ when they will run so strictly speaking > this is not a bug (i do think that being always a tick late _is_ a bug). As a person running a couple of game servers which rely on nanosleep to get a fixed number of frames per second, I'd say that it is a bug. This might also affect video players which want to show their frames on time. The default HZ of 1000 mitigates the problem somewhat, but on for example a laptop running at HZ=100 the error is noticeable. To illustrate my point, calling usleep(1) 100 times in a loop results in a running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec 9th), which is 3 times as long as one might reasonably expect. This suggests that the callout fires 2 ticks late ... - Pieter de Goeje From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 14:38:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D145106568D; Tue, 15 Dec 2009 14:38:08 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030408FC08; Tue, 15 Dec 2009 14:38: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 nBFEc719066135; Tue, 15 Dec 2009 14:38:07 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFEc7BV066134; Tue, 15 Dec 2009 14:38:07 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151438.nBFEc7BV066134@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:38: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: r200575 - head/contrib/ntp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:38:08 -0000 Author: roberto Date: Tue Dec 15 14:38:07 2009 New Revision: 200575 URL: http://svn.freebsd.org/changeset/base/200575 Log: Bootstrap mergeinfo (thanks des@). Modified: Directory Properties: head/contrib/ntp/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 14:58:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9E0106566C; Tue, 15 Dec 2009 14:58:11 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D018FC15; Tue, 15 Dec 2009 14:58: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 nBFEwBRv066634; Tue, 15 Dec 2009 14:58:11 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFEwBjW066629; Tue, 15 Dec 2009 14:58:11 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151458.nBFEwBjW066629@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:58: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: r200576 - in head/contrib/ntp: . adjtimed arlib clockstuff html html/build/hints html/drivers include include/isc kernel kernel/sys libntp libopts libparse ntpd ntpdate ntpdc ntpq parse... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:58:11 -0000 Author: roberto Date: Tue Dec 15 14:58:10 2009 New Revision: 200576 URL: http://svn.freebsd.org/changeset/base/200576 Log: Merge 4.2.4p8 into contrib (r200452 & r200454). Subversion is being difficult here so take a hammer and get it in. MFC after: 2 weeks Security: CVE-2009-3563 Added: head/contrib/ntp/html/build/hints/solaris.xtra.4095849 - copied unchanged from r200575, vendor/ntp/dist/html/build/hints/solaris.xtra.4095849 Modified: head/contrib/ntp/COPYRIGHT head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/README head/contrib/ntp/README.bk head/contrib/ntp/README.patches head/contrib/ntp/WHERE-TO-START head/contrib/ntp/aclocal.m4 head/contrib/ntp/adjtimed/Makefile.in head/contrib/ntp/arlib/Makefile.in head/contrib/ntp/arlib/aclocal.m4 head/contrib/ntp/arlib/configure head/contrib/ntp/build head/contrib/ntp/clockstuff/Makefile.in head/contrib/ntp/config.h.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/flock-build head/contrib/ntp/html/copyright.html head/contrib/ntp/html/drivers/driver40.html head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/copyright.def head/contrib/ntp/include/isc/Makefile.in head/contrib/ntp/include/ntp_debug.h head/contrib/ntp/include/version.def head/contrib/ntp/kernel/Makefile.in head/contrib/ntp/kernel/sys/Makefile.in head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libopts/Makefile.in head/contrib/ntp/libparse/Makefile.am head/contrib/ntp/libparse/Makefile.in head/contrib/ntp/libparse/clk_rawdcf.c head/contrib/ntp/ntpd/Makefile.in head/contrib/ntp/ntpd/cmd_args.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_intres.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_request.c head/contrib/ntp/ntpd/ntp_timer.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd-opts.texi head/contrib/ntp/ntpd/ntpd.1 head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpdsim-opts.c head/contrib/ntp/ntpd/ntpdsim-opts.h head/contrib/ntp/ntpd/ntpdsim-opts.texi head/contrib/ntp/ntpd/ntpdsim.1 head/contrib/ntp/ntpd/refclock_dumbclock.c head/contrib/ntp/ntpd/refclock_hopfser.c head/contrib/ntp/ntpd/refclock_jjy.c head/contrib/ntp/ntpd/refclock_nmea.c head/contrib/ntp/ntpd/refclock_palisade.c head/contrib/ntp/ntpdate/Makefile.in head/contrib/ntp/ntpdc/Makefile.in head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc-opts.texi head/contrib/ntp/ntpdc/ntpdc.1 head/contrib/ntp/ntpq/Makefile.in head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-opts.texi head/contrib/ntp/ntpq/ntpq.1 head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/packageinfo.sh head/contrib/ntp/parseutil/Makefile.in head/contrib/ntp/scripts/Makefile.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/aclocal.m4 head/contrib/ntp/sntp/config.h.in head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/configure.ac head/contrib/ntp/sntp/libopts/Makefile.in head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.def head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp-opts.texi head/contrib/ntp/sntp/sntp.1 head/contrib/ntp/sntp/version.def head/contrib/ntp/util/Makefile.in head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen-opts.texi head/contrib/ntp/util/ntp-keygen.1 head/contrib/ntp/version head/contrib/ntp/version.m4 Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/COPYRIGHT ============================================================================== --- head/contrib/ntp/COPYRIGHT Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/COPYRIGHT Tue Dec 15 14:58:10 2009 (r200576) @@ -13,7 +13,7 @@ This file is automatically generated fro applies as if the text was explicitly included in the file. *********************************************************************** * * -* Copyright (c) David L. Mills 1992-2008 * +* Copyright (c) David L. Mills 1992-2009 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/ChangeLog Tue Dec 15 14:58:10 2009 (r200576) @@ -1,6 +1,85 @@ -(4.2.4p5) 2008/08/17 Released by Harlan Stenn --- -(4.2.4p5) 2008/08/17 Released by Harlan Stenn +(4.2.4p8) 2009/12/08 Released by Harlan Stenn + +* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. + +--- +(4.2.4p7) 2009/05/18 Released by Harlan Stenn + +* [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252. +* [Bug 1187] Update the copyright date. +* [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. + +--- +(4.2.4p7-RC7) 2009/05/12 Released by Harlan Stenn + +* ntp.isc.org -> ntp.org cleanup. +* [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime, + add configure --enable-ignore-dns-errors to be even more stubborn + +--- +(4.2.4p7-RC6) 2009/05/08 Released by Harlan Stenn + +* [Bug 784] Make --enable-linuxcaps the default when available +* [Bug 1179] error messages for -u/--user and -i lacking droproot +* Updated JJY reference clock driver from Takao Abe +* [Bug 1071] Log a message and exit before trying to use FD_SET with a + descriptor larger than FD_SETSIZE, which will corrupt memory +* On corruption of the iface list head in add_interface, log and exit + +--- +(4.2.4p7-RC5) 2009/05/02 Released by Harlan Stenn + +* [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux. +* flock-build script unportable 'set -m' use removed + +--- +(4.2.4p7-RC4) 2009/04/29 Released by Harlan Stenn + +* [Bug 1167] use gcc -Winit-self only if it is understood + +--- +(4.2.4p7-RC3) 2009/04/22 Released by Harlan Stenn + +* [Bug 787] Bug fixes for 64-bit time_t on Windows +* [Bug 813] Conditional naming of Event +* [Bug 1147] System errors should be logged to msyslog() +* [Bug 1155] Fix compile problem on Windows with VS2005 +* [Bug 1156] lock_thread_to_processor() should be declared in header +* [Bug 1157] quiet OpenSSL warnings, clean up configure.ac +* [Bug 1158] support for aix6.1 +* [Bug 1160] MacOS X is like BSD regarding F_SETOWN + +--- +(4.2.4p7-RC2) 2009/04/09 Released by Harlan Stenn + +* [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 +* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows + +--- +(4.2.4p7-RC1) 2009/03/30 Released by Harlan Stenn + +* [Bug 1131] UDP sockets should not use SIGPOLL on Solaris. +* build system email address cleanup +* [Bug 774] parsesolaris.c does not compile under the new Solaris +* [Bug 873] Windows serial refclock proper TTY line discipline emulation +* [Bug 1014] Enable building with VC9 (in Visual Studio 2008, + Visual C++ 2008, or SDK) +* [Bug 1117] Deferred interface binding under Windows works only correctly + if FORCE_DNSRETRY is defined +* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU +* DPRINTF macro made safer, always evaluates to a statement and will not + misassociate an else which follows the macro. + +--- +(4.2.4p6) 2009/01/08 Released by Harlan Stenn + +* [Bug 1113] Fixed build errors with recent versions of openSSL. +* [Sec 1111] Fix incorrect check of EVP_VerifyFinal()'s return value. +* Update the copyright year. + +--- (4.2.4p5) 2008/08/17 Released by Harlan Stenn * [BUG 1051] Month off by one in leap second message written to clockstats Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/CommitLog Tue Dec 15 14:58:10 2009 (r200576) @@ -1,1772 +1,3496 @@ -ChangeSet@1.1541, 2008-08-17 05:30:47-04:00, stenn@whimsy.udel.edu +26 -0 - NTP_4_2_4P5 - TAG: NTP_4_2_4P5 +ChangeSet@1.1612, 2009-12-08 08:30:54-05:00, stenn@whimsy.udel.edu +1 -0 + ChangeLog: + typo - ChangeLog@1.44, 2008-08-17 05:30:27-04:00, stenn@whimsy.udel.edu +3 -0 - NTP_4_2_4P5 + ChangeLog@1.95, 2009-12-08 08:30:44-05:00, stenn@whimsy.udel.edu +0 -1 + typo - ntpd/ntpd-opts.c@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 +ChangeSet@1.1611, 2009-12-08 08:23:12-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P8 + TAG: NTP_4_2_4P8 - ntpd/ntpd-opts.h@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ChangeLog@1.94, 2009-12-08 08:23:01-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P8 - ntpd/ntpd-opts.texi@1.73, 2008-08-17 05:30:29-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpd-opts.c@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpd.1@1.72, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.h@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.c@1.74, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.texi@1.85, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.h@1.74, 2008-08-17 05:30:31-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpd.1@1.84, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.texi@1.72, 2008-08-17 05:30:32-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.c@1.86, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim.1@1.72, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.h@1.86, 2009-12-08 08:23:04-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.c@1.74, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.texi@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.h@1.74, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpdsim.1@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.texi@1.72, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.c@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc.1@1.72, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.h@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpq/ntpq-opts.c@1.76, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.texi@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpq/ntpq-opts.h@1.76, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpdc/ntpdc.1@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq-opts.texi@1.73, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpq/ntpq-opts.c@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq.1@1.72, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.h@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - packageinfo.sh@1.101, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.texi@1.85, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - sntp/sntp-opts.c@1.72, 2008-08-17 05:30:38-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq.1@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp-opts.h@1.72, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + packageinfo.sh@1.118, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P8 - sntp/sntp-opts.texi@1.69, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + sntp/sntp-opts.c@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp.1@1.72, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.h@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - util/ntp-keygen-opts.c@1.73, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.texi@1.81, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - util/ntp-keygen-opts.h@1.73, 2008-08-17 05:30:41-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + sntp/sntp.1@1.84, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen-opts.texi@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + util/ntp-keygen-opts.c@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen.1@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + util/ntp-keygen-opts.h@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 -ChangeSet@1.1540, 2008-08-17 05:29:47-04:00, stenn@whimsy.udel.edu +1 -0 - typo + util/ntp-keygen-opts.texi@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - scripts/addChangeLogTag@1.2, 2008-08-17 05:29:37-04:00, stenn@whimsy.udel.edu +1 -1 - typo + util/ntp-keygen.1@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 -ChangeSet@1.1539, 2008-08-17 03:28:53-04:00, stenn@whimsy.udel.edu +5 -0 - 4.2.4p5 prep +ChangeSet@1.1610, 2009-12-08 07:45:28-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P9_RC1 + TAG: NTP_4_2_4P9_RC1 - .point-changed-filelist@1.2, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +1 -0 - 4.2.4p5 prep + ChangeLog@1.93, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P9_RC1 - NEWS@1.99, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +17 -0 - 4.2.4p5 prep + ntpd/ntpd-opts.c@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - packageinfo.sh@1.100, 2008-08-17 03:27:43-04:00, stenn@whimsy.udel.edu +1 -1 - 4.2.4p5 prep + ntpd/ntpd-opts.h@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +27 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/addChangeLogTag + ntpd/ntpd-opts.texi@1.84, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +13 -6 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpd.1@1.83, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +6 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLogTag + ntpd/ntpdsim-opts.c@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpdsim-opts.h@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 -ChangeSet@1.1538, 2008-08-16 22:42:08-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +61 -2 + NTP_4_2_4P9_RC1 - ChangeLog@1.43, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim.1@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/refclock_oncore.c@1.63, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +1 -1 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpdc/ntpdc-opts.c@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 -ChangeSet@1.1537, 2008-08-10 07:44:31-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC2 - TAG: NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.h@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.c@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +7 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.h@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc.1@1.83, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.texi@1.72, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.c@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpd/ntpd.1@1.71, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.h@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.c@1.73, 2008-08-10 07:44:11-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.texi@1.84, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +8 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.h@1.73, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpq/ntpq.1@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.texi@1.71, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.117, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim.1@1.71, 2008-08-10 07:44:13-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.c@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.c@1.73, 2008-08-10 07:44:14-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.h@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.h@1.73, 2008-08-10 07:44:15-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.texi@1.80, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +54 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.texi@1.71, 2008-08-10 07:44:16-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + sntp/sntp.1@1.83, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc.1@1.71, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.c@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.c@1.75, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.h@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.h@1.75, 2008-08-10 07:44:18-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.texi@1.82, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.texi@1.72, 2008-08-10 07:44:19-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + util/ntp-keygen.1@1.82, 2009-12-08 07:45:25-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpq/ntpq.1@1.71, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1609, 2009-12-08 05:36:47-05:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - packageinfo.sh@1.99, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + NEWS@1.102, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +34 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.c@1.71, 2008-08-10 07:44:22-04:00, stenn@whimsy.udel.edu +4 -5 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.116, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +2 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.h@1.71, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC2 +ChangeSet@1.1608, 2009-10-07 01:33:22+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp-opts.texi@1.68, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +2 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.92, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp.1@1.71, 2008-08-10 07:44:24-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpd/ntp_request.c@1.68, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +9 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - util/ntp-keygen-opts.c@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1607, 2009-05-18 05:04:41-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7 + TAG: NTP_4_2_4P7 - util/ntp-keygen-opts.h@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.91, 2009-05-18 05:04:18-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7 - util/ntp-keygen-opts.texi@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.c@1.84, 2009-05-18 05:04:19-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - util/ntp-keygen.1@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.h@1.84, 2009-05-18 05:04:20-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.3.1, 2008-08-10 02:22:22-04:00, stenn@whimsy.udel.edu +1 -0 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd-opts.texi@1.83, 2009-05-18 05:04:21-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - BitKeeper/triggers/triggert@1.5, 2008-08-10 02:22:11-04:00, stenn@whimsy.udel.edu +3 -2 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd.1@1.82, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 -ChangeSet@1.1534, 2008-08-09 20:05:06-04:00, stenn@whimsy.udel.edu +2 -0 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.c@1.84, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/Makefile.am@1.23, 2008-08-09 20:04:56-04:00, stenn@whimsy.udel.edu +2 -2 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.h@1.84, 2009-05-18 05:04:23-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/sntp-opts.menu@1.3, 2008-08-09 20:04:10-04:00, stenn@whimsy.udel.edu +0 -0 - Change mode to -rw-rw-r-- + ntpd/ntpdsim-opts.texi@1.82, 2009-05-18 05:04:24-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.2.1, 2008-08-07 20:44:31+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpd/ntpdsim.1@1.82, 2009-05-18 05:04:25-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.39.2.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.c@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.99.1.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +10 -2 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.h@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ports/winnt/ntpd/ntservice.c@1.11, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +8 -1 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.texi@1.82, 2009-05-18 05:04:27-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.1.2, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +1 -0 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpdc/ntpdc.1@1.82, 2009-05-18 05:04:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ports/winnt/ntpd/ntp_iocompletionport.c@1.26, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +0 -8 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpq/ntpq-opts.c@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +10 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.h@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ChangeLog@1.39.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.texi@1.83, 2009-05-18 05:04:30-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - html/confopt.html@1.36, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -2 - Bug 841: Obsolete the "dynamic" keyword. + ntpq/ntpq.1@1.82, 2009-05-18 05:04:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - html/ntpdc.html@1.27, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +2 -3 - Bug 841: Obsolete the "dynamic" keyword. + packageinfo.sh@1.115, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp.h@1.129, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.c@1.82, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp_request.h@1.31, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.h@1.82, 2009-05-18 05:04:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7 - ntpd/ntp_config.c@1.144, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +4 -2 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + sntp/sntp-opts.texi@1.79, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - ntpd/ntp_intres.c@1.52, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp.1@1.82, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.100, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +5 -25 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.c@1.83, 2009-05-18 05:04:35-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_request.c@1.66, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + util/ntp-keygen-opts.h@1.83, 2009-05-18 05:04:36-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpdc/ntpdc_ops.c@1.50, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -3 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.texi@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1532, 2008-07-22 11:41:26+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + util/ntp-keygen.1@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.40, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +1 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. +ChangeSet@1.1606, 2009-05-18 03:14:59-04:00, stenn@whimsy.udel.edu +2 -0 + 4.2.4p7 - libntp/machines.c@1.19, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +2 -2 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + NEWS@1.101, 2009-05-18 03:14:49-04:00, stenn@whimsy.udel.edu +38 -0 + 4.2.4p7 -ChangeSet@1.1531, 2008-05-20 03:51:01-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC1 - TAG: NTP_4_2_4P5_RC1 + packageinfo.sh@1.114, 2009-05-18 03:14:50-04:00, stenn@whimsy.udel.edu +1 -1 + 4.2.4p7 - ntpd/ntpd-opts.c@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1605, 2009-05-18 02:56:36-04:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.h@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.90, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +1 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.texi@1.71, 2008-05-20 03:50:38-04:00, stenn@whimsy.udel.edu +8 -11 - NTP_4_2_4P5_RC1 + ntpd/ntp_crypto.c@1.110, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +22 -17 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd.1@1.70, 2008-05-20 03:50:39-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1604, 2009-05-18 02:24:31-04:00, stenn@whimsy.udel.edu +2 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.c@1.72, 2008-05-20 03:50:40-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.89, 2009-05-18 02:24:21-04:00, stenn@whimsy.udel.edu +1 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.h@1.72, 2008-05-20 03:50:41-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + include/copyright.def@1.8, 2009-05-18 02:24:22-04:00, stenn@whimsy.udel.edu +1 -1 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.texi@1.70, 2008-05-20 03:50:42-04:00, stenn@whimsy.udel.edu +3 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1603, 2009-05-17 08:59:06+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpd/ntpdsim.1@1.70, 2008-05-20 03:50:43-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 + ChangeLog@1.88, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +5 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.c@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntp_io.c@1.261, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +45 -34 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.h@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1602, 2009-05-14 04:42:10+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + fix error from BitKeeper/triggers/pre-resolve.licfix triggered (ahem) + by recent BitKeeper/etc/config delta updating repologs email address - ntpdc/ntpdc-opts.texi@1.70, 2008-05-20 03:50:45-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + BitKeeper/triggers/pre-resolve.licfix@1.5, 2009-05-14 04:42:09+00:00, davehart@shiny.ad.hartbrothers.com +4 -1 + bk sccscat has been removed, replaced by bk annotate -R + -q grep -> grep -q (untested until recent BitKeeper/etc/config commit + changing repologs@ntp.isc.org to repologs@ntp.org - ntpdc/ntpdc.1@1.70, 2008-05-20 03:50:46-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 +ChangeSet@1.1601, 2009-05-12 02:41:56-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC7 + TAG: NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.c@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.87, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.h@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.c@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.texi@1.71, 2008-05-20 03:50:48-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.h@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq.1@1.70, 2008-05-20 03:50:49-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.texi@1.82, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.98, 2008-05-20 03:50:50-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpd.1@1.81, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.c@1.70, 2008-05-20 03:50:51-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.c@1.83, 2009-05-12 02:41:36-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.h@1.70, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.h@1.83, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.texi@1.67, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.texi@1.81, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - sntp/sntp.1@1.70, 2008-05-20 03:50:53-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim.1@1.81, 2009-05-12 02:41:38-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.c@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.c@1.83, 2009-05-12 02:41:39-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.h@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.h@1.83, 2009-05-12 02:41:40-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.texi@1.69, 2008-05-20 03:50:55-04:00, stenn@whimsy.udel.edu +7 -9 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.texi@1.81, 2009-05-12 02:41:41-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - util/ntp-keygen.1@1.69, 2008-05-20 03:50:56-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc.1@1.81, 2009-05-12 02:41:42-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1530, 2008-05-18 05:14:37-04:00, stenn@whimsy.udel.edu +1 -0 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.c@1.85, 2009-05-12 02:41:43-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.97, 2008-05-18 05:14:27-04:00, stenn@whimsy.udel.edu +1 -1 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.h@1.85, 2009-05-12 02:41:44-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1529, 2008-04-11 18:41:57-04:00, stenn@whimsy.udel.edu +1 -0 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq-opts.texi@1.82, 2009-05-12 02:41:45-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - configure.ac@1.401, 2008-04-11 18:41:47-04:00, stenn@whimsy.udel.edu +5 -1 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq.1@1.81, 2009-05-12 02:41:46-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.3, 2008-04-10 02:09:52-04:00, stenn@pogo.udel.edu +1 -0 - Changelog cleanup + packageinfo.sh@1.113, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.2, 2008-04-10 02:08:57-04:00, stenn@pogo.udel.edu +2 -1 + sntp/sntp-opts.c@1.81, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.2, 2008-04-08 12:20:22+02:00, burnicki@pogo.udel.edu +1 -0 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.h@1.81, 2009-05-12 02:41:48-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.51, 2008-04-08 12:20:21+02:00, burnicki@pogo.udel.edu +5 -6 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.texi@1.78, 2009-05-12 02:41:49-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.1, 2008-04-03 10:19:03-04:00, burnicki@pogo.udel.edu +5 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + sntp/sntp.1@1.81, 2009-05-12 02:41:50-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.1, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +1 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + util/ntp-keygen-opts.c@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - include/ntpd.h@1.98, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +5 -0 - Added vars used to wake up the resolver process/thread. + util/ntp-keygen-opts.h@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_config.c@1.143, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +34 -1 - Initialize synchronization variables when the resolver process/thread is started. + util/ntp-keygen-opts.texi@1.80, 2009-05-12 02:41:52-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.50, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +64 -65 - Enable the resolver to be woken up when a new interface has become available. + util/ntp-keygen.1@1.80, 2009-05-12 02:41:53-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_io.c@1.256, 2008-04-03 10:19:00-04:00, burnicki@pogo.udel.edu +25 -5 - Wake up the resolver thread/process when a new interface has become available. +ChangeSet@1.1600, 2009-05-12 01:07:37-04:00, stenn@whimsy.udel.edu +9 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1527, 2008-03-24 22:12:42-04:00, mayer@pogo.udel.edu +1 -0 - bugs 993 a d 959 + BitKeeper/etc/config@1.10, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.38, 2008-03-24 22:12:26-04:00, mayer@pogo.udel.edu +2 -0 - bugs 993 a d 959 + ChangeLog@1.86, 2009-05-12 01:06:01-04:00, stenn@whimsy.udel.edu +1 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1526, 2008-03-24 21:41:55-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README@1.23, 2009-05-12 01:06:02-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/ntpd/ntp_iocompletionport.c@1.25, 2008-03-24 21:41:37-04:00, mayer@pogo.udel.edu +25 -13 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README.bk@1.19, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1525, 2008-03-24 21:40:32-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 993] Windows: Fix memory leak when fetching system messages + README.patches@1.4, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/libisc/isc_strerror.c@1.5, 2008-03-24 21:40:07-04:00, mayer@pogo.udel.edu +78 -18 - [Bug 993] Windows: Fix memory leak when fetching system messages + WHERE-TO-START@1.7, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.5, 2008-03-22 02:12:10-05:00, stenn@whimsy.udel.edu +2 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + configure.ac@1.418, 2009-05-12 01:06:04-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.35.3.4, 2008-03-22 02:11:57-05:00, stenn@whimsy.udel.edu +1 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + include/copyright.def@1.7, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - libisc/net.c@1.9, 2008-03-22 02:11:58-05:00, stenn@whimsy.udel.edu +1 -1 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + sntp/sntp-opts.def@1.11, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.4, 2008-03-22 02:02:36-05:00, stenn@whimsy.udel.edu +3 -0 - Update the copyright year +ChangeSet@1.1597.1.1, 2009-05-08 18:11:36+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + configure.ac: + correct help text - ChangeLog@1.35.3.3, 2008-03-22 02:02:24-05:00, stenn@whimsy.udel.edu +8 -6 - Update the copyright year + configure.ac@1.415.1.1, 2009-05-08 18:11:24+00:00, davehart@shiny.ad.hartbrothers.com +11 -5 + correct help text - html/copyright.html@1.37, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year +ChangeSet@1.1598, 2009-05-08 17:50:37+00:00, davehart@shiny.ad.hartbrothers.com +3 -0 + add configure --enable-ignore-dns-errors to retry on any failure - include/copyright.def@1.6, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year + ChangeLog@1.85, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -1 + add configure --enable-ignore-dns-errors to retry on any failure -ChangeSet@1.1520.3.3, 2008-03-22 01:58:52-05:00, stenn@whimsy.udel.edu +5 -0 - Make autogen-generated files writable + configure.ac@1.416, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +26 -4 + add configure --enable-ignore-dns-errors to retry on any failure - ntpd/Makefile.am@1.54, 2008-03-22 01:57:08-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.55, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + add configure --enable-ignore-dns-errors to retry on any failure - ntpdc/Makefile.am@1.35, 2008-03-22 01:57:09-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable +ChangeSet@1.1597, 2009-05-08 15:34:46+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + Do not exceed FD_SETSIZE in ntp_intres.c + --- + ntp_intres.c: + typo + --- + ntp_intres.c: + missing comma typo + --- + ntp_intres.c: + typo - ntpq/Makefile.am@1.27, 2008-03-22 01:57:10-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.54, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +64 -33 + fix typos, refine "host name not found" log message, stay under FD_SETSIZE - sntp/Makefile.am@1.22, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_request.c@1.67, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +21 -3 + after ntp_intres adds a server entry, rescan interfaces, to notice the + return of connectivity sooner. - util/Makefile.am@1.36, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_timer.c@1.34, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +3 -5 + indent cleanup -ChangeSet@1.1520.4.1, 2008-03-16 09:15:13-04:00, burnicki@pogo.udel.edu +2 -0 - [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ports/winnt/include/config.h@1.52, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +4 -10 + remove FORCE_DNSRETRY, no longer used + indent cleanup - ChangeLog@1.35.4.1, 2008-03-16 09:15:10-04:00, burnicki@pogo.udel.edu +3 -0 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. +ChangeSet@1.1587.1.1, 2009-05-08 11:24:43+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ports/winnt/ntpd/ntservice.c@1.10, 2008-03-16 09:15:11-04:00, burnicki@pogo.udel.edu +11 -2 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ChangeLog@1.76.1.1, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime -ChangeSet@1.1520.3.1, 2008-03-03 11:50:50+01:00, martin@pc-martin.py.meinberg.de +2 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ntpd/ntp_intres.c@1.53, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +53 -55 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ChangeLog@1.35.3.1, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +10 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). +ChangeSet@1.1595, 2009-05-08 04:42:52-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC6 + TAG: NTP_4_2_4P7_RC6 - ntpdate/ntpdate.c@1.62, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +101 -82 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ChangeLog@1.83, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.7, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.c@1.82, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.3, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +1 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.h@1.82, 2009-05-08 04:42:29-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/include/config.h@1.47, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.texi@1.81, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.6, 2008-02-19 11:08:55-05:00, burnicki@pogo.udel.edu +1 -0 - Fixed indentation. + ntpd/ntpd.1@1.80, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ntpd/ntp_io.c@1.255, 2008-02-19 11:08:52-05:00, burnicki@pogo.udel.edu +1 -1 - Fixed indentation. + ntpd/ntpdsim-opts.c@1.82, 2009-05-08 04:42:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.5, 2008-02-18 09:30:34-05:00, burnicki@pogo.udel.edu +1 -0 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.h@1.82, 2009-05-08 04:42:32-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/ntpd/ntp_iocompletionport.c@1.24, 2008-02-18 09:30:31-05:00, burnicki@pogo.udel.edu +4 -4 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.texi@1.80, 2009-05-08 04:42:33-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.4, 2008-02-17 17:48:29+00:00, kardel@pogo.udel.edu +1 -0 - recvbuff.c: - Bug 1000: add some pico optimizations + ntpd/ntpdsim.1@1.80, 2009-05-08 04:42:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - libntp/recvbuff.c@1.29, 2008-02-17 17:42:21+00:00, kardel@pogo.udel.edu +5 -8 - Bug 1000: add some pico optimizations + ntpdc/ntpdc-opts.c@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.3, 2008-02-17 08:38:07+00:00, kardel@pogo.udel.edu +2 -0 - ntpd.c: - Bug 1000: avoid timer() starvation during high load conditions - ChangeLog: - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.h@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.2, 2008-02-17 08:37:20+00:00, kardel@pogo.udel.edu +1 -0 - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.texi@1.80, 2009-05-08 04:42:36-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 14:59:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87A3106566C; Tue, 15 Dec 2009 14:59:58 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A751E8FC14; Tue, 15 Dec 2009 14:59: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 nBFExwD1066720; Tue, 15 Dec 2009 14:59:58 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFExwN7066718; Tue, 15 Dec 2009 14:59:58 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151459.nBFExwN7066718@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:59: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: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:59:58 -0000 Author: roberto Date: Tue Dec 15 14:59:58 2009 New Revision: 200577 URL: http://svn.freebsd.org/changeset/base/200577 Log: ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. Security: CVE-2009-3563 Deleted: head/usr.sbin/ntp/ntptrace/Makefile Modified: head/usr.sbin/ntp/Makefile Modified: head/usr.sbin/ntp/Makefile ============================================================================== --- head/usr.sbin/ntp/Makefile Tue Dec 15 14:58:10 2009 (r200576) +++ head/usr.sbin/ntp/Makefile Tue Dec 15 14:59:58 2009 (r200577) @@ -1,7 +1,7 @@ # Makefile for ntpd. # $FreeBSD$ -SUBDIR= libopts libntp libparse ntpd ntpdc ntpq ntpdate ntptrace \ +SUBDIR= libopts libntp libparse ntpd ntpdc ntpq ntpdate \ ntptime ntp-keygen sntp SUBDIR+= doc From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 15:01:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10B7106566B; Tue, 15 Dec 2009 15:01:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85E9E8FC28; Tue, 15 Dec 2009 15:01: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 nBFF1qB9066854; Tue, 15 Dec 2009 15:01:52 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFF1qhX066852; Tue, 15 Dec 2009 15:01:52 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912151501.nBFF1qhX066852@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 15 Dec 2009 15:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200578 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:01:52 -0000 Author: ume Date: Tue Dec 15 15:01:52 2009 New Revision: 200578 URL: http://svn.freebsd.org/changeset/base/200578 Log: MFC r199995: Don't try to bind to an anycast address. The KAME IPv6 stack doesn't allow bind to an anycast address. It does away with an annoying message. Modified: stable/8/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 14:59:58 2009 (r200577) +++ stable/8/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 15:01:52 2009 (r200578) @@ -65,6 +65,12 @@ #endif /* IPV6 Multicast Support */ #endif /* IPv6 Support */ +#ifdef INCLUDE_IPV6_SUPPORT +#include +#include +#include +#endif /* !INCLUDE_IPV6_SUPPORT */ + extern int listen_to_virtual_ips; extern const char *specific_interface; @@ -1137,6 +1143,36 @@ set_wildcard_reuse(int family, int on) } #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */ +#ifdef INCLUDE_IPV6_SUPPORT +static isc_boolean_t +is_anycast(struct sockaddr *sa, char *name) +{ +#if defined(SIOCGIFAFLAG_IN6) && defined(IN6_IFF_ANYCAST) + struct in6_ifreq ifr6; + int fd; + u_int32_t flags6; + + if (sa->sa_family != AF_INET6) + return ISC_FALSE; + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) + return ISC_FALSE; + memset(&ifr6, 0, sizeof(ifr6)); + memcpy(&ifr6.ifr_addr, (struct sockaddr_in6 *)sa, + sizeof(struct sockaddr_in6)); + strlcpy(ifr6.ifr_name, name, IF_NAMESIZE); + if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + close(fd); + return ISC_FALSE; + } + close(fd); + flags6 = ifr6.ifr_ifru.ifru_flags6; + if ((flags6 & IN6_IFF_ANYCAST) != 0) + return ISC_TRUE; +#endif /* !SIOCGIFAFLAG_IN6 || !IN6_IFF_ANYCAST */ + return ISC_FALSE; +} +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * update_interface strategy * @@ -1276,6 +1312,11 @@ update_interfaces( if (is_wildcard_addr(&interface.sin)) continue; +#ifdef INCLUDE_IPV6_SUPPORT + if (is_anycast((struct sockaddr *)&interface.sin, isc_if.name)) + continue; +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * map to local *address* in order * to map all duplicate interfaces to an interface structure From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 15:13:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7051065672; Tue, 15 Dec 2009 15:13:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1FD8FC16; Tue, 15 Dec 2009 15:13: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 nBFFDfq0067173; Tue, 15 Dec 2009 15:13:41 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFFDf9Y067171; Tue, 15 Dec 2009 15:13:41 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912151513.nBFFDf9Y067171@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 15 Dec 2009 15:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200579 - stable/7/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:13:42 -0000 Author: ume Date: Tue Dec 15 15:13:41 2009 New Revision: 200579 URL: http://svn.freebsd.org/changeset/base/200579 Log: MFC r199995: Don't try to bind to an anycast address. The KAME IPv6 stack doesn't allow bind to an anycast address. It does away with an annoying message. Modified: stable/7/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/7/contrib/ntp/ (props changed) Modified: stable/7/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 15:01:52 2009 (r200578) +++ stable/7/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 15:13:41 2009 (r200579) @@ -65,6 +65,12 @@ #endif /* IPV6 Multicast Support */ #endif /* IPv6 Support */ +#ifdef INCLUDE_IPV6_SUPPORT +#include +#include +#include +#endif /* !INCLUDE_IPV6_SUPPORT */ + extern int listen_to_virtual_ips; extern const char *specific_interface; @@ -1137,6 +1143,36 @@ set_wildcard_reuse(int family, int on) } #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */ +#ifdef INCLUDE_IPV6_SUPPORT +static isc_boolean_t +is_anycast(struct sockaddr *sa, char *name) +{ +#if defined(SIOCGIFAFLAG_IN6) && defined(IN6_IFF_ANYCAST) + struct in6_ifreq ifr6; + int fd; + u_int32_t flags6; + + if (sa->sa_family != AF_INET6) + return ISC_FALSE; + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) + return ISC_FALSE; + memset(&ifr6, 0, sizeof(ifr6)); + memcpy(&ifr6.ifr_addr, (struct sockaddr_in6 *)sa, + sizeof(struct sockaddr_in6)); + strlcpy(ifr6.ifr_name, name, IF_NAMESIZE); + if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + close(fd); + return ISC_FALSE; + } + close(fd); + flags6 = ifr6.ifr_ifru.ifru_flags6; + if ((flags6 & IN6_IFF_ANYCAST) != 0) + return ISC_TRUE; +#endif /* !SIOCGIFAFLAG_IN6 || !IN6_IFF_ANYCAST */ + return ISC_FALSE; +} +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * update_interface strategy * @@ -1276,6 +1312,11 @@ update_interfaces( if (is_wildcard_addr(&interface.sin)) continue; +#ifdef INCLUDE_IPV6_SUPPORT + if (is_anycast((struct sockaddr *)&interface.sin, isc_if.name)) + continue; +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * map to local *address* in order * to map all duplicate interfaces to an interface structure From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 15:46:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29BE11065693; Tue, 15 Dec 2009 15:46:12 +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 ACB3D8FC08; Tue, 15 Dec 2009 15:46:11 +0000 (UTC) Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBFFk79K027238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 02:46:08 +1100 Date: Wed, 16 Dec 2009 02:46:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pieter de Goeje In-Reply-To: <200912151416.56348.pieter@service2media.com> Message-ID: <20091216014431.U1425@besplex.bde.org> References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <20091214144635.GA91618@onelab2.iet.unipi.it> <200912151416.56348.pieter@service2media.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Robert Watson , svn-src-head@freebsd.org, Luigi Rizzo Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:46:12 -0000 On Tue, 15 Dec 2009, Pieter de Goeje wrote: > On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: >> On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: >>> On Mon, 14 Dec 2009, Luigi Rizzo wrote: >> >> ... >> >>>> Together with a smaller patch committed in september, this fixes a >>>> bug that affects 8.0 with apps that rely on callouts to fire exactly >>>> in the number of ticks specified (qemu among them). >>>> Right now, callouts in 8.0 fire one tick late. >>>> >>>> This was discussed in september with JeffR and jhb >>> >>> Once this has burned in, is it something you would consider appropriate >>> to be an errata note candidate? >> >> i have no objection, but at the time someone commented that >> callouts do not _guarantee_ when they will run so strictly speaking >> this is not a bug (i do think that being always a tick late _is_ a bug). > > As a person running a couple of game servers which rely on nanosleep to get a > fixed number of frames per second, I'd say that it is a bug. Being a tick late is certainly a bug. Relying on nanosleep to get a fixed number of frames per second is another bug. If you want a periodic timer, setitimer(2) with a nonzero it_value (so that the timer repeats automatically) must be used. > This might also > affect video players which want to show their frames on time. The default HZ > of 1000 mitigates the problem somewhat, but on for example a laptop running at > HZ=100 the error is noticeable. > To illustrate my point, calling usleep(1) 100 times in a loop results in a > running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec 9th), > which is 3 times as long as one might reasonably expect. This suggests that > the callout fires 2 ticks late ... Only 1 tick late. I get a running time of 2 seconds with hz = 100 under FreeBSD-~5.2, presumably because 5.2 didn't have the 1-tick-late bug. The time is expected to be 2 seconds instead of 1 because nanosleep() adds an extra 1 tick though it would work right (but slower) with other small changes (also pessimizations) if it didn't. To sleep for 1 microsecond, it is always necessary to wait until the next tick for obvious reasons. The next tick might occur in less than a microsecond (when the timeout happens to be set up just before the tick), so nanosleep() can't just return when the tick occurs. It should check if the timeout has expired (in real time, not ticks) and wait for another tick if not. In fact, it already does this in order to be reasonably accurate for long timeouts. However, to be simple and efficient, it just waits for an extra tick initially, using generic code that adds 1 to the tick count. Other uses of the generic code don't check that the timeout has expired so they need this extra 1 for correctness, but nanosleep() only needs it for efficiency. This optimization for efficiency is more historical than intentional. nanosleep() also uses a fuzzy check (getnanouptime() instead of nanouptime() for the expiry, which can give an error of about 1 tick With the fuzzy check, the extra 1 might still be needed for correctness Thus when hz = 100, 100 nanosleeps for 1 microsecond (or even 1 nanosecond) take between about 1 and 2 seconds, with an average of 1.5 seconds for random calls and an average of 2 seconds for synchronized calls. Sequential calls with no other system activity give synchronized calls. The time of 2/hz for synchronized calls can be depended on if there is no other system activity, but it is better to use setitimer() as above -- then cases with other system activity have a better chance of working, and you can also get a time of 1/hz. nanosleep() is correct but very sloppy for for long sleeps. E.g., with hz = 1000 on i386(i8254), the average absolute error for a set of perfectly calibrated i8254 ticks is about 0.02%, so for sleeps of 1 year the error will be at best 1.82 hours on average. If the hz clock runs faster than real time, then nanosleep() wakes up early and does shorter sleeps to reach the correct real time, but if the hz clock runs slow then nanosleep() normally wakes up hours per year late. This is easy to fix at a cost of efficiency by intentionally underestimating the timeout in ticks, which goes well with not adding 1. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 16:15:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7B53106566B; Tue, 15 Dec 2009 16:15:14 +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 A4A708FC12; Tue, 15 Dec 2009 16:15: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 nBFGFEI9068607; Tue, 15 Dec 2009 16:15:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFGFEOq068598; Tue, 15 Dec 2009 16:15:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912151615.nBFGFEOq068598@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 16:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 16:15:14 -0000 Author: luigi Date: Tue Dec 15 16:15:14 2009 New Revision: 200580 URL: http://svn.freebsd.org/changeset/base/200580 Log: Start splitting ip_fw2.c and ip_fw.h into smaller components. At this time we pull out from ip_fw2.c the logging functions, and support for dynamic rules, and move kernel-only stuff into netinet/ipfw/ip_fw_private.h No ABI change involved in this commit, unless I made some mistake. ip_fw.h has changed, though not in the userland-visible part. Files touched by this commit: conf/files now references the two new source files netinet/ip_fw.h remove kernel-only definitions gone into netinet/ipfw/ip_fw_private.h. netinet/ipfw/ip_fw_private.h new file with kernel-specific ipfw definitions netinet/ipfw/ip_fw_log.c ipfw_log and related functions netinet/ipfw/ip_fw_dynamic.c code related to dynamic rules netinet/ipfw/ip_fw2.c removed the pieces that goes in the new files netinet/ipfw/ip_fw_nat.c minor rearrangement to remove LOOKUP_NAT from the main headers. This require a new function pointer. A bunch of other kernel files that included netinet/ip_fw.h now require netinet/ipfw/ip_fw_private.h as well. Not 100% sure i caught all of them. MFC after: 1 month Added: head/sys/netinet/ipfw/ip_fw_dynamic.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_log.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_private.h (contents, props changed) Modified: head/sys/conf/files head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fw.h head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/conf/files Tue Dec 15 16:15:14 2009 (r200580) @@ -2427,6 +2427,8 @@ netinet/ip_encap.c optional inet | inet netinet/ip_fastfwd.c optional inet netinet/ipfw/ip_fw2.c optional inet ipfirewall \ compile-with "${NORMAL_C} -I$S/contrib/pf" +netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netinet/ipfw/ip_fw_log.c optional inet ipfirewall netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/net/if_bridge.c Tue Dec 15 16:15:14 2009 (r200580) @@ -134,6 +134,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/net/if_ethersubr.c Tue Dec 15 16:15:14 2009 (r200580) @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #endif Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ip_divert.c Tue Dec 15 16:15:14 2009 (r200580) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SCTP #include #endif Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ip_fw.h Tue Dec 15 16:15:14 2009 (r200580) @@ -571,133 +571,4 @@ typedef struct _ipfw_table { ipfw_table_entry ent[0]; /* entries */ } ipfw_table; -/* - * Main firewall chains definitions and global var's definitions. - */ -#ifdef _KERNEL - -#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ - -/* Return values from ipfw_chk() */ -enum { - IP_FW_PASS = 0, - IP_FW_DENY, - IP_FW_DIVERT, - IP_FW_TEE, - IP_FW_DUMMYNET, - IP_FW_NETGRAPH, - IP_FW_NGTEE, - IP_FW_NAT, - IP_FW_REASS, -}; - -/* flags for divert mtag */ -#define IP_FW_DIVERT_LOOPBACK_FLAG 0x00080000 -#define IP_FW_DIVERT_OUTPUT_FLAG 0x00100000 - -/* - * Structure for collecting parameters to dummynet for ip6_output forwarding - */ -struct _ip6dn_args { - struct ip6_pktopts *opt_or; - struct route_in6 ro_or; - int flags_or; - struct ip6_moptions *im6o_or; - struct ifnet *origifp_or; - struct ifnet *ifp_or; - struct sockaddr_in6 dst_or; - u_long mtu_or; - struct route_in6 ro_pmtu_or; -}; - -/* - * Arguments for calling ipfw_chk() and dummynet_io(). We put them - * all into a structure because this way it is easier and more - * efficient to pass variables around and extend the interface. - */ -struct ip_fw_args { - struct mbuf *m; /* the mbuf chain */ - struct ifnet *oif; /* output interface */ - struct sockaddr_in *next_hop; /* forward address */ - struct ip_fw *rule; /* matching rule */ - uint32_t rule_id; /* matching rule id */ - uint32_t chain_id; /* ruleset id */ - struct ether_header *eh; /* for bridged packets */ - - struct ipfw_flow_id f_id; /* grabbed from IP header */ - uint32_t cookie; /* a cookie depending on rule action */ - struct inpcb *inp; - - struct _ip6dn_args dummypar; /* dummynet->ip6_output */ - struct sockaddr_in hopstore; /* store here if cannot use a pointer */ -}; - -/* - * Function definitions. - */ - -/* Firewall hooks */ -struct sockopt; -struct dn_flow_set; - -int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); - -int ipfw_chk(struct ip_fw_args *); - -int ipfw_hook(void); -int ipfw6_hook(void); -int ipfw_unhook(void); -int ipfw6_unhook(void); -#ifdef NOTYET -void ipfw_nat_destroy(void); -#endif - -VNET_DECLARE(int, fw_one_pass); -VNET_DECLARE(int, fw_enable); -#define V_fw_one_pass VNET(fw_one_pass) -#define V_fw_enable VNET(fw_enable) - -#ifdef INET6 -VNET_DECLARE(int, fw6_enable); -#define V_fw6_enable VNET(fw6_enable) -#endif - -struct ip_fw_chain { - struct ip_fw *rules; /* list of rules */ - struct ip_fw *reap; /* list of rules to reap */ - LIST_HEAD(, cfg_nat) nat; /* list of nat entries */ - struct radix_node_head *tables[IPFW_TABLES_MAX]; - struct rwlock rwmtx; - uint32_t id; /* ruleset id */ -}; - -#ifdef IPFW_INTERNAL - -#define IPFW_LOCK_INIT(_chain) \ - rw_init(&(_chain)->rwmtx, "IPFW static rules") -#define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx) -#define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED) - -#define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx) -#define IPFW_RUNLOCK(p) rw_runlock(&(p)->rwmtx) -#define IPFW_WLOCK(p) rw_wlock(&(p)->rwmtx) -#define IPFW_WUNLOCK(p) rw_wunlock(&(p)->rwmtx) - -#define LOOKUP_NAT(l, i, p) do { \ - LIST_FOREACH((p), &(l.nat), _next) { \ - if ((p)->id == (i)) { \ - break; \ - } \ - } \ - } while (0) - -typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *); -typedef int ipfw_nat_cfg_t(struct sockopt *); -#endif - -VNET_DECLARE(struct ip_fw_chain, layer3_chain); -#define V_layer3_chain VNET(layer3_chain) - -#endif /* _KERNEL */ #endif /* _IPFW2_H */ Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ipfw/ip_dummynet.c Tue Dec 15 16:15:14 2009 (r200580) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_len, ip_off */ #include +#include #include #include /* ip_output(), IP_FORWARDING */ Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 16:15:14 2009 (r200580) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ - #include #include #include @@ -79,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,13 +113,9 @@ static VNET_DEFINE(int, ipfw_vnet_ready) * Rules in set RESVD_SET can only be deleted explicitly. */ static VNET_DEFINE(u_int32_t, set_disable); -static VNET_DEFINE(int, fw_verbose); -static VNET_DEFINE(struct callout, ipfw_timeout); -static VNET_DEFINE(int, verbose_limit); +VNET_DEFINE(int, fw_verbose); #define V_set_disable VNET(set_disable) -#define V_fw_verbose VNET(fw_verbose) -#define V_ipfw_timeout VNET(ipfw_timeout) #define V_verbose_limit VNET(verbose_limit) #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT @@ -128,7 +123,6 @@ static int default_to_accept = 1; #else static int default_to_accept; #endif -static uma_zone_t ipfw_dyn_rule_zone; struct ip_fw *ip_fw_default_rule; @@ -141,6 +135,7 @@ MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "Ip MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); #define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) ipfw_nat_t *ipfw_nat_ptr = NULL; +struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; ipfw_nat_cfg_t *ipfw_nat_del_ptr; ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; @@ -157,6 +152,10 @@ static VNET_DEFINE(int, autoinc_step); static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) +static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ +static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ +#define V_static_count VNET(static_count) +#define V_static_len VNET(static_len) extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE @@ -198,146 +197,12 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A "Deny packets with unknown IPv6 Extension Headers"); #endif /* INET6 */ -#endif /* SYSCTL_NODE */ - -/* - * Description of dynamic rules. - * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. - * - * XXX currently there is only one list, ipfw_dyn. - * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: - * + stateful rules; - * + enforcing limits on the number of sessions; - * + in-kernel NAT (not implemented yet) - * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, - * measured in seconds and depending on the flags. - * - * The total number of dynamic rules is stored in dyn_count. - * The max number of dynamic rules is dyn_max. When we reach - * the maximum number of rules we do not create anymore. This is - * done to avoid consuming too much memory, but also too much - * time when searching on each packet (ideally, we should try instead - * to put a limit on the length of the list on each bucket...). - * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. XXX we should make them survive. - * - * There are some limitations with dynamic rules -- we do not - * obey the 'randomized match', and we do not do multiple - * passes through the firewall. XXX check the latter!!! - */ -static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); - -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets VNET(dyn_buckets) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) - -static struct mtx ipfw_dyn_mtx; /* mutex guarding dynamic rules */ -#define IPFW_DYN_LOCK_INIT() \ - mtx_init(&ipfw_dyn_mtx, "IPFW dynamic rules", NULL, MTX_DEF) -#define IPFW_DYN_LOCK_DESTROY() mtx_destroy(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK() mtx_lock(&ipfw_dyn_mtx) -#define IPFW_DYN_UNLOCK() mtx_unlock(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK_ASSERT() mtx_assert(&ipfw_dyn_mtx, MA_OWNED) - -static struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, - u_int32_t, u_int32_t, int); - - -/* - * Timeouts for various events in handing dynamic rules. - */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); - -#define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) -#define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) -#define V_dyn_fin_lifetime VNET(dyn_fin_lifetime) -#define V_dyn_rst_lifetime VNET(dyn_rst_lifetime) -#define V_dyn_udp_lifetime VNET(dyn_udp_lifetime) -#define V_dyn_short_lifetime VNET(dyn_short_lifetime) - -/* - * Keepalives are sent if dyn_keepalive is set. They are sent every - * dyn_keepalive_period seconds, in the last dyn_keepalive_interval - * seconds of lifetime of a rule. - * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower - * than dyn_keepalive_period. - */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); - -#define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) -#define V_dyn_keepalive_period VNET(dyn_keepalive_period) -#define V_dyn_keepalive VNET(dyn_keepalive) - -static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ -static VNET_DEFINE(u_int32_t, dyn_count); /* # of dynamic rules */ -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define V_static_count VNET(static_count) -#define V_static_len VNET(static_len) -#define V_dyn_count VNET(dyn_count) -#define V_dyn_max VNET(dyn_max) - -#ifdef SYSCTL_NODE -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_RW, &VNET_NAME(dyn_buckets), 0, - "Number of dyn. buckets"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, - CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_RD, &VNET_NAME(dyn_count), 0, - "Number of dyn. rules"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_RW, &VNET_NAME(dyn_max), 0, - "Max number of dyn. rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, CTLFLAG_RD, &VNET_NAME(static_count), 0, "Number of static rules"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, - CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); #endif /* SYSCTL_NODE */ + /* * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T * Other macros just cast void * into the appropriate type @@ -681,18 +546,6 @@ verify_path6(struct in6_addr *src, struc return 1; } -static __inline int -hash_packet6(struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->dst_port) ^ (id->src_port); - return i; -} - static int is_icmp6_query(int icmp6_type) { @@ -749,1072 +602,6 @@ send_reject6(struct ip_fw_args *args, in #endif /* INET6 */ -/* counter for ipfw_log(NULL...) */ -static VNET_DEFINE(u_int64_t, norule_counter); -#define V_norule_counter VNET(norule_counter) - -#define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 -#define SNP(buf) buf, sizeof(buf) - -/* - * We enter here when we have a rule with O_LOG. - * XXX this function alone takes about 2Kbytes of code! - */ -static void -ipfw_log(struct ip_fw *f, u_int hlen, struct ip_fw_args *args, - struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, - struct ip *ip) -{ - struct ether_header *eh = args->eh; - char *action; - int limit_reached = 0; - char action2[40], proto[128], fragment[32]; - - fragment[0] = '\0'; - proto[0] = '\0'; - - if (f == NULL) { /* bogus pkt */ - if (V_verbose_limit != 0 && V_norule_counter >= V_verbose_limit) - return; - V_norule_counter++; - if (V_norule_counter == V_verbose_limit) - limit_reached = V_verbose_limit; - action = "Refuse"; - } else { /* O_LOG is the first action, find the real one */ - ipfw_insn *cmd = ACTION_PTR(f); - ipfw_insn_log *l = (ipfw_insn_log *)cmd; - - if (l->max_log != 0 && l->log_left == 0) - return; - l->log_left--; - if (l->log_left == 0) - limit_reached = l->max_log; - cmd += F_LEN(cmd); /* point to first action */ - if (cmd->opcode == O_ALTQ) { - ipfw_insn_altq *altq = (ipfw_insn_altq *)cmd; - - snprintf(SNPARGS(action2, 0), "Altq %d", - altq->qid); - cmd += F_LEN(cmd); - } - if (cmd->opcode == O_PROB) - cmd += F_LEN(cmd); - - if (cmd->opcode == O_TAG) - cmd += F_LEN(cmd); - - action = action2; - switch (cmd->opcode) { - case O_DENY: - action = "Deny"; - break; - - case O_REJECT: - if (cmd->arg1==ICMP_REJECT_RST) - action = "Reset"; - else if (cmd->arg1==ICMP_UNREACH_HOST) - action = "Reject"; - else - snprintf(SNPARGS(action2, 0), "Unreach %d", - cmd->arg1); - break; - - case O_UNREACH6: - if (cmd->arg1==ICMP6_UNREACH_RST) - action = "Reset"; - else - snprintf(SNPARGS(action2, 0), "Unreach %d", - cmd->arg1); - break; - - case O_ACCEPT: - action = "Accept"; - break; - case O_COUNT: - action = "Count"; - break; - case O_DIVERT: - snprintf(SNPARGS(action2, 0), "Divert %d", - cmd->arg1); - break; - case O_TEE: - snprintf(SNPARGS(action2, 0), "Tee %d", - cmd->arg1); - break; - case O_SETFIB: - snprintf(SNPARGS(action2, 0), "SetFib %d", - cmd->arg1); - break; - case O_SKIPTO: - snprintf(SNPARGS(action2, 0), "SkipTo %d", - cmd->arg1); - break; - case O_PIPE: - snprintf(SNPARGS(action2, 0), "Pipe %d", - cmd->arg1); - break; - case O_QUEUE: - snprintf(SNPARGS(action2, 0), "Queue %d", - cmd->arg1); - break; - case O_FORWARD_IP: { - ipfw_insn_sa *sa = (ipfw_insn_sa *)cmd; - int len; - struct in_addr dummyaddr; - if (sa->sa.sin_addr.s_addr == INADDR_ANY) - dummyaddr.s_addr = htonl(tablearg); - else - dummyaddr.s_addr = sa->sa.sin_addr.s_addr; - - len = snprintf(SNPARGS(action2, 0), "Forward to %s", - inet_ntoa(dummyaddr)); - - if (sa->sa.sin_port) - snprintf(SNPARGS(action2, len), ":%d", - sa->sa.sin_port); - } - break; - case O_NETGRAPH: - snprintf(SNPARGS(action2, 0), "Netgraph %d", - cmd->arg1); - break; - case O_NGTEE: - snprintf(SNPARGS(action2, 0), "Ngtee %d", - cmd->arg1); - break; - case O_NAT: - action = "Nat"; - break; - case O_REASS: - action = "Reass"; - break; - default: - action = "UNKNOWN"; - break; - } - } - - if (hlen == 0) { /* non-ip */ - snprintf(SNPARGS(proto, 0), "MAC"); - - } else { - int len; -#ifdef INET6 - char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; -#else - char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; -#endif - struct icmphdr *icmp; - struct tcphdr *tcp; - struct udphdr *udp; -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; - struct icmp6_hdr *icmp6; -#endif - src[0] = '\0'; - dst[0] = '\0'; -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(args->f_id))) { - char ip6buf[INET6_ADDRSTRLEN]; - snprintf(src, sizeof(src), "[%s]", - ip6_sprintf(ip6buf, &args->f_id.src_ip6)); - snprintf(dst, sizeof(dst), "[%s]", - ip6_sprintf(ip6buf, &args->f_id.dst_ip6)); - - ip6 = (struct ip6_hdr *)ip; - tcp = (struct tcphdr *)(((char *)ip) + hlen); - udp = (struct udphdr *)(((char *)ip) + hlen); - } else -#endif - { - tcp = L3HDR(struct tcphdr, ip); - udp = L3HDR(struct udphdr, ip); - - inet_ntoa_r(ip->ip_src, src); - inet_ntoa_r(ip->ip_dst, dst); - } - - switch (args->f_id.proto) { - case IPPROTO_TCP: - len = snprintf(SNPARGS(proto, 0), "TCP %s", src); - if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", - ntohs(tcp->th_sport), - dst, - ntohs(tcp->th_dport)); - else - snprintf(SNPARGS(proto, len), " %s", dst); - break; - - case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP %s", src); - if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", - ntohs(udp->uh_sport), - dst, - ntohs(udp->uh_dport)); - else - snprintf(SNPARGS(proto, len), " %s", dst); - break; - - case IPPROTO_ICMP: - icmp = L3HDR(struct icmphdr, ip); - if (offset == 0) - len = snprintf(SNPARGS(proto, 0), - "ICMP:%u.%u ", - icmp->icmp_type, icmp->icmp_code); - else - len = snprintf(SNPARGS(proto, 0), "ICMP "); - len += snprintf(SNPARGS(proto, len), "%s", src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; -#ifdef INET6 - case IPPROTO_ICMPV6: - icmp6 = (struct icmp6_hdr *)(((char *)ip) + hlen); - if (offset == 0) - len = snprintf(SNPARGS(proto, 0), - "ICMPv6:%u.%u ", - icmp6->icmp6_type, icmp6->icmp6_code); - else - len = snprintf(SNPARGS(proto, 0), "ICMPv6 "); - len += snprintf(SNPARGS(proto, len), "%s", src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; -#endif - default: - len = snprintf(SNPARGS(proto, 0), "P:%d %s", - args->f_id.proto, src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; - } - -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(args->f_id))) { - if (offset & (IP6F_OFF_MASK | IP6F_MORE_FRAG)) - snprintf(SNPARGS(fragment, 0), - " (frag %08x:%d@%d%s)", - args->f_id.frag_id6, - ntohs(ip6->ip6_plen) - hlen, - ntohs(offset & IP6F_OFF_MASK) << 3, - (offset & IP6F_MORE_FRAG) ? "+" : ""); - } else -#endif - { - int ip_off, ip_len; - if (eh != NULL) { /* layer 2 packets are as on the wire */ - ip_off = ntohs(ip->ip_off); - ip_len = ntohs(ip->ip_len); - } else { - ip_off = ip->ip_off; - ip_len = ip->ip_len; - } - if (ip_off & (IP_MF | IP_OFFMASK)) - snprintf(SNPARGS(fragment, 0), - " (frag %d:%d@%d%s)", - ntohs(ip->ip_id), ip_len - (ip->ip_hl << 2), - offset << 3, - (ip_off & IP_MF) ? "+" : ""); - } - } - if (oif || m->m_pkthdr.rcvif) - log(LOG_SECURITY | LOG_INFO, - "ipfw: %d %s %s %s via %s%s\n", - f ? f->rulenum : -1, - action, proto, oif ? "out" : "in", - oif ? oif->if_xname : m->m_pkthdr.rcvif->if_xname, - fragment); - else - log(LOG_SECURITY | LOG_INFO, - "ipfw: %d %s %s [no if info]%s\n", - f ? f->rulenum : -1, - action, proto, fragment); - if (limit_reached) - log(LOG_SECURITY | LOG_NOTICE, - "ipfw: limit %d reached on entry %d\n", - limit_reached, f ? f->rulenum : -1); -} - -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(struct ipfw_flow_id *id) -{ - u_int32_t i; - -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else -#endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); - i &= (V_curr_dyn_buckets - 1); - return i; -} - -static __inline void -unlink_dyn_rule_print(struct ipfw_flow_id *id) -{ - struct in_addr da; -#ifdef INET6 - char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN]; -#else - char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; -#endif - -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) { - ip6_sprintf(src, &id->src_ip6); - ip6_sprintf(dst, &id->dst_ip6); - } else -#endif - { - da.s_addr = htonl(id->src_ip); - inet_ntoa_r(da, src); - da.s_addr = htonl(id->dst_ip); - inet_ntoa_r(da, dst); - } - printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", - src, id->src_port, dst, id->dst_port, V_dyn_count - 1); -} - -/** - * unlink a dynamic rule from a chain. prev is a pointer to - * the previous one, q is a pointer to the rule to delete, - * head is a pointer to the head of the queue. - * Modifies q and potentially also head. - */ -#define UNLINK_DYN_RULE(prev, head, q) { \ - ipfw_dyn_rule *old_q = q; \ - \ - /* remove a refcount to the parent */ \ - if (q->dyn_type == O_LIMIT) \ - q->parent->count--; \ - DEB(unlink_dyn_rule_print(&q->id);) \ - if (prev != NULL) \ - prev->next = q = q->next; \ - else \ - head = q = q->next; \ - V_dyn_count--; \ - uma_zfree(ipfw_dyn_rule_zone, old_q); } - -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) - -/** - * Remove dynamic rules pointing to "rule", or all of them if rule == NULL. - * - * If keep_me == NULL, rules are deleted even if not expired, - * otherwise only expired rules are removed. - * - * The value of the second parameter is also used to point to identify - * a rule we absolutely do not want to remove (e.g. because we are - * holding a reference to it -- this is the case with O_LIMIT_PARENT - * rules). The pointer is only used for comparison, so any non-null - * value will do. - */ -static void -remove_dyn_rule(struct ip_fw *rule, ipfw_dyn_rule *keep_me) -{ - static u_int32_t last_remove = 0; - -#define FORCE (keep_me == NULL) - - ipfw_dyn_rule *prev, *q; - int i, pass = 0, max_pass = 0; - - IPFW_DYN_LOCK_ASSERT(); - - if (V_ipfw_dyn_v == NULL || V_dyn_count == 0) - return; - /* do not expire more than once per second, it is useless */ - if (!FORCE && last_remove == time_uptime) - return; - last_remove = time_uptime; - - /* - * because O_LIMIT refer to parent rules, during the first pass only - * remove child and mark any pending LIMIT_PARENT, and remove - * them in a second pass. - */ -next_pass: - for (i = 0 ; i < V_curr_dyn_buckets ; i++) { - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q ; ) { - /* - * Logic can become complex here, so we split tests. - */ - if (q == keep_me) - goto next; - if (rule != NULL && rule != q->rule) - goto next; /* not the one we are looking for */ - if (q->dyn_type == O_LIMIT_PARENT) { - /* - * handle parent in the second pass, - * record we need one. - */ - max_pass = 1; - if (pass == 0) - goto next; - if (FORCE && q->count != 0 ) { - /* XXX should not happen! */ - printf("ipfw: OUCH! cannot remove rule," - " count %d\n", q->count); - } - } else { - if (!FORCE && - !TIME_LEQ( q->expire, time_uptime )) - goto next; - } - if (q->dyn_type != O_LIMIT_PARENT || !q->count) { - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); - continue; - } -next: - prev=q; - q=q->next; - } - } - if (pass++ < max_pass) - goto next_pass; -} - - -/** - * lookup a dynamic rule. - */ -static ipfw_dyn_rule * -lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp) -{ - /* - * stateful ipfw extensions. - * Lookup into dynamic session queue - */ -#define MATCH_REVERSE 0 -#define MATCH_FORWARD 1 -#define MATCH_NONE 2 -#define MATCH_UNKNOWN 3 - int i, dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q=NULL; - - IPFW_DYN_LOCK_ASSERT(); - - if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet( pkt ); - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { - if (q->dyn_type == O_LIMIT_PARENT && q->count) - goto next; - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); - continue; - } - if (pkt->proto == q->id.proto && - q->dyn_type != O_LIMIT_PARENT) { - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6)) && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.dst_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.src_ip6)) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } - } -next: - prev = q; - q = q->next; - } - if (q == NULL) - goto done; /* q = NULL, not found */ - - if ( prev != NULL) { /* found and not in front */ - prev->next = q->next; - q->next = V_ipfw_dyn_v[i]; - V_ipfw_dyn_v[i] = q; - } - if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - u_char flags = pkt->flags & (TH_FIN|TH_SYN|TH_RST); - -#define BOTH_SYN (TH_SYN | (TH_SYN << 8)) -#define BOTH_FIN (TH_FIN | (TH_FIN << 8)) - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); - switch (q->state) { - case TH_SYN: /* opening */ - q->expire = time_uptime + V_dyn_syn_lifetime; - break; - - case BOTH_SYN: /* move to established */ - case BOTH_SYN | TH_FIN : /* one side tries to close */ - case BOTH_SYN | (TH_FIN << 8) : - if (tcp) { -#define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - u_int32_t ack = ntohl(tcp->th_ack); - if (dir == MATCH_FORWARD) { - if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) - q->ack_fwd = ack; - else { /* ignore out-of-sequence */ - break; - } - } else { - if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) - q->ack_rev = ack; - else { /* ignore out-of-sequence */ - break; - } - } - } - q->expire = time_uptime + V_dyn_ack_lifetime; - break; - - case BOTH_SYN | BOTH_FIN: /* both sides closed */ - if (V_dyn_fin_lifetime >= V_dyn_keepalive_period) - V_dyn_fin_lifetime = V_dyn_keepalive_period - 1; - q->expire = time_uptime + V_dyn_fin_lifetime; - break; - - default: -#if 0 - /* - * reset or some invalid combination, but can also - * occur if we use keep-state the wrong way. - */ - if ( (q->state & ((TH_RST << 8)|TH_RST)) == 0) - printf("invalid state: 0x%x\n", q->state); -#endif - if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) - V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; - q->expire = time_uptime + V_dyn_rst_lifetime; - break; - } - } else if (pkt->proto == IPPROTO_UDP) { - q->expire = time_uptime + V_dyn_udp_lifetime; - } else { - /* other protocols */ - q->expire = time_uptime + V_dyn_short_lifetime; - } -done: - if (match_direction) - *match_direction = dir; - return q; -} - -static ipfw_dyn_rule * -lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 17:39:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C35E81065695; Tue, 15 Dec 2009 17:39:14 +0000 (UTC) (envelope-from pdegoeje@service2media.com) Received: from s2m-is-001.service2media.com (rev-130-102.virtu.nl [217.114.102.130]) by mx1.freebsd.org (Postfix) with ESMTP id 463588FC16; Tue, 15 Dec 2009 17:39:13 +0000 (UTC) Received: from pieter-dev-linux.localnet ([10.0.1.18] RDNS failed) by s2m-is-001.service2media.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Dec 2009 18:39:11 +0100 From: Pieter de Goeje Organization: Service2Media To: Bruce Evans Date: Tue, 15 Dec 2009 18:39:10 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <200912151416.56348.pieter@service2media.com> <20091216014431.U1425@besplex.bde.org> In-Reply-To: <20091216014431.U1425@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912151839.11024.pieter@service2media.com> X-OriginalArrivalTime: 15 Dec 2009 17:39:11.0793 (UTC) FILETIME=[833A4A10:01CA7DAD] Cc: Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Robert Watson , "svn-src-head@freebsd.org" , Luigi Rizzo , Pieter de Goeje Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 17:39:14 -0000 On Tuesday 15 December 2009 16:46:07 Bruce Evans wrote: > On Tue, 15 Dec 2009, Pieter de Goeje wrote: > > On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: > >> On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > >>> On Mon, 14 Dec 2009, Luigi Rizzo wrote: > >> > >> ... > >> > >>>> Together with a smaller patch committed in september, this fixes a > >>>> bug that affects 8.0 with apps that rely on callouts to fire exactly > >>>> in the number of ticks specified (qemu among them). > >>>> Right now, callouts in 8.0 fire one tick late. > >>>> > >>>> This was discussed in september with JeffR and jhb > >>> > >>> Once this has burned in, is it something you would consider appropriate > >>> to be an errata note candidate? > >> > >> i have no objection, but at the time someone commented that > >> callouts do not _guarantee_ when they will run so strictly speaking > >> this is not a bug (i do think that being always a tick late _is_ a bug). > > > > As a person running a couple of game servers which rely on nanosleep to > > get a fixed number of frames per second, I'd say that it is a bug. > > Being a tick late is certainly a bug. Relying on nanosleep to get a > fixed number of frames per second is another bug. If you want a > periodic timer, setitimer(2) with a nonzero it_value (so that the timer > repeats automatically) must be used. > > > This might also > > affect video players which want to show their frames on time. The > > default HZ of 1000 mitigates the problem somewhat, but on for example a > > laptop running at HZ=100 the error is noticeable. > > To illustrate my point, calling usleep(1) 100 times in a loop results in > > a running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec > > 9th), which is 3 times as long as one might reasonably expect. This > > suggests that the callout fires 2 ticks late ... > > Only 1 tick late. I get a running time of 2 seconds with hz = 100 under > FreeBSD-~5.2, presumably because 5.2 didn't have the 1-tick-late bug. > > The time is expected to be 2 seconds instead of 1 because nanosleep() > adds an extra 1 tick though it would work right (but slower) with other > small changes (also pessimizations) if it didn't. To sleep for 1 > microsecond, it is always necessary to wait until the next tick for > obvious reasons. The next tick might occur in less than a microsecond > (when the timeout happens to be set up just before the tick), so > nanosleep() can't just return when the tick occurs. It should check > if the timeout has expired (in real time, not ticks) and wait for > another tick if not. In fact, it already does this in order to be > reasonably accurate for long timeouts. However, to be simple and > efficient, it just waits for an extra tick initially, using generic > code that adds 1 to the tick count. Other uses of the generic code > don't check that the timeout has expired so they need this extra 1 > for correctness, but nanosleep() only needs it for efficiency. This > optimization for efficiency is more historical than intentional. > nanosleep() also uses a fuzzy check (getnanouptime() instead of > nanouptime() for the expiry, which can give an error of about 1 tick > With the fuzzy check, the extra 1 might still be needed for correctness > > Thus when hz = 100, 100 nanosleeps for 1 microsecond (or even 1 > nanosecond) take between about 1 and 2 seconds, with an average of 1.5 > seconds for random calls and an average of 2 seconds for synchronized > calls. Sequential calls with no other system activity give synchronized > calls. The time of 2/hz for synchronized calls can be depended on if > there is no other system activity, but it is better to use setitimer() > as above -- then cases with other system activity have a better chance > of working, and you can also get a time of 1/hz. > > nanosleep() is correct but very sloppy for for long sleeps. E.g., with > hz = 1000 on i386(i8254), the average absolute error for a set of perfectly > calibrated i8254 ticks is about 0.02%, so for sleeps of 1 year the error > will be at best 1.82 hours on average. If the hz clock runs faster than > real time, then nanosleep() wakes up early and does shorter sleeps to > reach the correct real time, but if the hz clock runs slow then nanosleep() > normally wakes up hours per year late. This is easy to fix at a cost of > efficiency by intentionally underestimating the timeout in ticks, which > goes well with not adding 1. > > Bruce > Thank you for your very thorough explanation. To recap, nanosleep() will always be one tick too late in the synchronous case unless a check of sleep time left is implemented in addition to not blindly adding 1 to the amount of ticks to wait. To get the minimum latency of 1/hz with the current implementation nanosleep() should be called right before the next tick fires. - Pieter From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 18:03:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A20106566B; Tue, 15 Dec 2009 18:03:59 +0000 (UTC) (envelope-from kwm@rainbow-runner.nl) Received: from viefep16-int.chello.at (viefep16-int.chello.at [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id 69A528FC15; Tue, 15 Dec 2009 18:03:57 +0000 (UTC) Received: from edge05.upc.biz ([192.168.13.212]) by viefep20-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091215174706.LDBX23910.viefep20-int.chello.at@edge05.upc.biz>; Tue, 15 Dec 2009 18:47:06 +0100 Received: from [192.168.0.105] ([80.56.73.45]) by edge05.upc.biz with edge id HVn21d05C0ydU7k05Vn3bf; Tue, 15 Dec 2009 18:47:06 +0100 X-SourceIP: 80.56.73.45 From: Koop Mast To: Ollivier Robert In-Reply-To: <200912151459.nBFExwN7066718@svn.freebsd.org> References: <200912151459.nBFExwN7066718@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 15 Dec 2009 18:50:37 +0100 Message-ID: <1260899437.73150.645.camel@headache.rainbow-runner.nl> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:03:59 -0000 On Tue, 2009-12-15 at 14:59 +0000, Ollivier Robert wrote: > Author: roberto > Date: Tue Dec 15 14:59:58 2009 > New Revision: 200577 > URL: http://svn.freebsd.org/changeset/base/200577 > > Log: > ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. > > Security: CVE-2009-3563 > Shouldn't ntptrace be added to ObsoleteFiles.inc now? -Koop From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 18:09:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AFFB1065672; Tue, 15 Dec 2009 18:09:08 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E67FD8FC13; Tue, 15 Dec 2009 18:09: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 nBFI97Wf070931; Tue, 15 Dec 2009 18:09:07 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFI97g1070920; Tue, 15 Dec 2009 18:09:07 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200912151809.nBFI97g1070920@svn.freebsd.org> From: Roman Divacky Date: Tue, 15 Dec 2009 18:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200581 - in vendor/llvm/dist: . autoconf cmake/modules docs include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/Bitcode include/llvm/CodeGen include/llvm/CompilerDriver in... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:09:08 -0000 Author: rdivacky Date: Tue Dec 15 18:09:07 2009 New Revision: 200581 URL: http://svn.freebsd.org/changeset/base/200581 Log: Update LLVM to 91430. Added: vendor/llvm/dist/include/llvm/ADT/DeltaAlgorithm.h vendor/llvm/dist/include/llvm/Analysis/PHITransAddr.h vendor/llvm/dist/include/llvm/CodeGen/CalcSpillWeights.h vendor/llvm/dist/include/llvm/CodeGen/MachineSSAUpdater.h vendor/llvm/dist/lib/Analysis/PHITransAddr.cpp vendor/llvm/dist/lib/CodeGen/CalcSpillWeights.cpp vendor/llvm/dist/lib/CodeGen/MachineSSAUpdater.cpp vendor/llvm/dist/lib/CodeGen/MaxStackAlignment.cpp vendor/llvm/dist/lib/Support/DeltaAlgorithm.cpp vendor/llvm/dist/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll vendor/llvm/dist/test/CodeGen/ARM/inlineasm3.ll vendor/llvm/dist/test/CodeGen/MSP430/bit.ll vendor/llvm/dist/test/CodeGen/MSP430/setcc.ll vendor/llvm/dist/test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll vendor/llvm/dist/test/CodeGen/X86/2009-12-01-EarlyClobberBug.ll vendor/llvm/dist/test/CodeGen/X86/2009-12-11-TLSNoRedZone.ll vendor/llvm/dist/test/CodeGen/X86/2009-12-12-CoalescerBug.ll vendor/llvm/dist/test/CodeGen/X86/3addr-16bit.ll vendor/llvm/dist/test/CodeGen/X86/fastcc3struct.ll vendor/llvm/dist/test/CodeGen/X86/select-aggregate.ll vendor/llvm/dist/test/CodeGen/X86/setcc.ll vendor/llvm/dist/test/CodeGen/X86/splat-scalar-load.ll vendor/llvm/dist/test/CodeGen/X86/vec-trunc-store.ll vendor/llvm/dist/test/CodeGen/X86/vec_compare-2.ll vendor/llvm/dist/test/CodeGen/X86/vec_ext_inreg.ll vendor/llvm/dist/test/CodeGen/X86/zext-shl.ll vendor/llvm/dist/test/DebugInfo/2009-12-01-CurrentFn.ll vendor/llvm/dist/test/FrontendC++/weak-external.cpp vendor/llvm/dist/test/FrontendC/2009-12-07-BitFieldAlignment.c vendor/llvm/dist/test/LLVMC/AppendCmdHook.td vendor/llvm/dist/test/LLVMC/ForwardTransformedValue.td vendor/llvm/dist/test/LLVMC/ForwardValue.td vendor/llvm/dist/test/LLVMC/HookWithInFile.td vendor/llvm/dist/test/LLVMC/Init.td vendor/llvm/dist/test/LLVMC/OutputSuffixHook.td vendor/llvm/dist/test/Transforms/GVN/crash-no-aa.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/indirectbr.ll vendor/llvm/dist/test/Transforms/InstCombine/sext.ll vendor/llvm/dist/test/Transforms/LICM/2009-12-10-LICM-Indbr-Crash.ll vendor/llvm/dist/tools/llvmc/plugins/Base/Hooks.cpp vendor/llvm/dist/unittests/ADT/DeltaAlgorithmTest.cpp Deleted: vendor/llvm/dist/include/llvm/CodeGen/BreakCriticalMachineEdge.h vendor/llvm/dist/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll vendor/llvm/dist/test/DebugInfo/2008-10-17-C++DebugCrash.ll vendor/llvm/dist/test/DebugInfo/2008-11-05-InlinedFuncStart.ll vendor/llvm/dist/test/DebugInfo/2009-01-15-RecordVariableCrash.ll vendor/llvm/dist/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll vendor/llvm/dist/test/DebugInfo/2009-06-12-Inline.ll vendor/llvm/dist/test/DebugInfo/2009-06-12-InlineFuncStart.ll vendor/llvm/dist/test/DebugInfo/2009-06-15-InlineFuncStart.ll vendor/llvm/dist/test/DebugInfo/2009-06-15-abstract_origin.ll vendor/llvm/dist/test/Transforms/DeadStoreElimination/lifetime-simple.ll vendor/llvm/dist/test/Transforms/GVN/rle-dominated.ll vendor/llvm/dist/test/Transforms/InstCombine/sext-misc.ll vendor/llvm/dist/test/Transforms/InstCombine/xor-demorgans.ll Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/Makefile vendor/llvm/dist/Makefile.config.in vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/cmake/modules/CheckAtomic.cmake vendor/llvm/dist/configure vendor/llvm/dist/docs/CompilerDriver.html vendor/llvm/dist/docs/GettingStarted.html vendor/llvm/dist/docs/LangRef.html vendor/llvm/dist/docs/Makefile vendor/llvm/dist/include/llvm/ADT/DenseMap.h vendor/llvm/dist/include/llvm/ADT/DenseMapInfo.h vendor/llvm/dist/include/llvm/ADT/DenseSet.h vendor/llvm/dist/include/llvm/ADT/ImmutableList.h vendor/llvm/dist/include/llvm/ADT/PointerIntPair.h vendor/llvm/dist/include/llvm/ADT/SmallVector.h vendor/llvm/dist/include/llvm/ADT/StringSwitch.h vendor/llvm/dist/include/llvm/ADT/ValueMap.h vendor/llvm/dist/include/llvm/ADT/ilist.h vendor/llvm/dist/include/llvm/Analysis/AliasSetTracker.h vendor/llvm/dist/include/llvm/Analysis/DebugInfo.h vendor/llvm/dist/include/llvm/Analysis/IVUsers.h vendor/llvm/dist/include/llvm/Analysis/LoopDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h vendor/llvm/dist/include/llvm/Analysis/LoopPass.h vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/Passes.h vendor/llvm/dist/include/llvm/Analysis/ProfileInfo.h vendor/llvm/dist/include/llvm/Argument.h vendor/llvm/dist/include/llvm/Bitcode/Deserialize.h vendor/llvm/dist/include/llvm/CallingConv.h vendor/llvm/dist/include/llvm/CodeGen/DAGISelHeader.h vendor/llvm/dist/include/llvm/CodeGen/FastISel.h vendor/llvm/dist/include/llvm/CodeGen/LinkAllCodegenComponents.h vendor/llvm/dist/include/llvm/CodeGen/LiveIntervalAnalysis.h vendor/llvm/dist/include/llvm/CodeGen/LiveVariables.h vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/Passes.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGISel.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/CodeGen/SlotIndexes.h vendor/llvm/dist/include/llvm/CodeGen/ValueTypes.h vendor/llvm/dist/include/llvm/CodeGen/ValueTypes.td vendor/llvm/dist/include/llvm/CompilerDriver/Common.td vendor/llvm/dist/include/llvm/IntrinsicInst.h vendor/llvm/dist/include/llvm/Intrinsics.td vendor/llvm/dist/include/llvm/LinkAllVMCore.h vendor/llvm/dist/include/llvm/Pass.h vendor/llvm/dist/include/llvm/Support/CommandLine.h vendor/llvm/dist/include/llvm/Support/Compiler.h vendor/llvm/dist/include/llvm/Support/Debug.h vendor/llvm/dist/include/llvm/Support/DebugLoc.h vendor/llvm/dist/include/llvm/Support/ErrorHandling.h vendor/llvm/dist/include/llvm/Support/GetElementPtrTypeIterator.h vendor/llvm/dist/include/llvm/Support/IRBuilder.h vendor/llvm/dist/include/llvm/Support/ValueHandle.h vendor/llvm/dist/include/llvm/Support/raw_ostream.h vendor/llvm/dist/include/llvm/Support/type_traits.h vendor/llvm/dist/include/llvm/System/Atomic.h vendor/llvm/dist/include/llvm/System/DataTypes.h.cmake vendor/llvm/dist/include/llvm/System/DataTypes.h.in vendor/llvm/dist/include/llvm/Target/TargetData.h vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Target/TargetRegisterInfo.h vendor/llvm/dist/lib/Analysis/CMakeLists.txt vendor/llvm/dist/lib/Analysis/CaptureTracking.cpp vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/DebugInfo.cpp vendor/llvm/dist/lib/Analysis/IPA/Andersens.cpp vendor/llvm/dist/lib/Analysis/IVUsers.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ProfileEstimatorPass.cpp vendor/llvm/dist/lib/Analysis/ProfileInfo.cpp vendor/llvm/dist/lib/Analysis/ProfileInfoLoaderPass.cpp vendor/llvm/dist/lib/Analysis/ProfileVerifierPass.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/AsmParser/LLLexer.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/AsmParser/LLParser.h vendor/llvm/dist/lib/AsmParser/LLToken.h vendor/llvm/dist/lib/Bitcode/Reader/Deserialize.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIE.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfException.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfException.h vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp vendor/llvm/dist/lib/CodeGen/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/CodePlacementOpt.cpp vendor/llvm/dist/lib/CodeGen/CriticalAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/LLVMTargetMachine.cpp vendor/llvm/dist/lib/CodeGen/LiveInterval.cpp vendor/llvm/dist/lib/CodeGen/LiveIntervalAnalysis.cpp vendor/llvm/dist/lib/CodeGen/LiveVariables.cpp vendor/llvm/dist/lib/CodeGen/LowerSubregs.cpp vendor/llvm/dist/lib/CodeGen/MachineBasicBlock.cpp vendor/llvm/dist/lib/CodeGen/MachineFunction.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/MachineLoopInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PHIElimination.cpp vendor/llvm/dist/lib/CodeGen/PHIElimination.h vendor/llvm/dist/lib/CodeGen/PostRASchedulerList.cpp vendor/llvm/dist/lib/CodeGen/PreAllocSplitting.cpp vendor/llvm/dist/lib/CodeGen/PrologEpilogInserter.cpp vendor/llvm/dist/lib/CodeGen/RegAllocLinearScan.cpp vendor/llvm/dist/lib/CodeGen/RegAllocPBQP.cpp vendor/llvm/dist/lib/CodeGen/RegisterScavenging.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/SimpleRegisterCoalescing.cpp vendor/llvm/dist/lib/CodeGen/SimpleRegisterCoalescing.h vendor/llvm/dist/lib/CodeGen/Spiller.cpp vendor/llvm/dist/lib/CodeGen/Spiller.h vendor/llvm/dist/lib/CodeGen/StackSlotColoring.cpp vendor/llvm/dist/lib/CodeGen/TailDuplication.cpp vendor/llvm/dist/lib/CodeGen/TargetInstrInfoImpl.cpp vendor/llvm/dist/lib/CodeGen/TwoAddressInstructionPass.cpp vendor/llvm/dist/lib/CodeGen/VirtRegRewriter.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/JIT.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp vendor/llvm/dist/lib/Support/CMakeLists.txt vendor/llvm/dist/lib/Support/CommandLine.cpp vendor/llvm/dist/lib/Support/MemoryBuffer.cpp vendor/llvm/dist/lib/Support/raw_ostream.cpp vendor/llvm/dist/lib/System/Atomic.cpp vendor/llvm/dist/lib/System/Host.cpp vendor/llvm/dist/lib/System/Unix/Path.inc vendor/llvm/dist/lib/Target/ARM/ARM.h vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMConstantIslandPass.cpp vendor/llvm/dist/lib/Target/ARM/ARMExpandPseudoInsts.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrFormats.td vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMLoadStoreOptimizer.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/NEONMoveFix.cpp vendor/llvm/dist/lib/Target/ARM/NEONPreAllocPass.cpp vendor/llvm/dist/lib/Target/ARM/Thumb1InstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/Thumb1InstrInfo.h vendor/llvm/dist/lib/Target/ARM/Thumb1RegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/Thumb2InstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/Thumb2InstrInfo.h vendor/llvm/dist/lib/Target/ARM/Thumb2SizeReduction.cpp vendor/llvm/dist/lib/Target/Alpha/AlphaInstrInfo.cpp vendor/llvm/dist/lib/Target/Alpha/AlphaInstrInfo.h vendor/llvm/dist/lib/Target/CBackend/CBackend.cpp vendor/llvm/dist/lib/Target/CellSPU/SPUInstrInfo.cpp vendor/llvm/dist/lib/Target/CellSPU/SPUInstrInfo.h vendor/llvm/dist/lib/Target/CppBackend/CPPBackend.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.h vendor/llvm/dist/lib/Target/MSP430/MSP430InstrInfo.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430InstrInfo.h vendor/llvm/dist/lib/Target/MSP430/MSP430InstrInfo.td vendor/llvm/dist/lib/Target/MSP430/MSP430MachineFunctionInfo.h vendor/llvm/dist/lib/Target/MSP430/MSP430RegisterInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.h vendor/llvm/dist/lib/Target/README.txt vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.h vendor/llvm/dist/lib/Target/SystemZ/SystemZRegisterInfo.cpp vendor/llvm/dist/lib/Target/TargetData.cpp vendor/llvm/dist/lib/Target/X86/X86.h vendor/llvm/dist/lib/Target/X86/X86COFFMachineModuleInfo.h vendor/llvm/dist/lib/Target/X86/X86CallingConv.td vendor/llvm/dist/lib/Target/X86/X86FloatingPoint.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86Instr64bit.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.h vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86RegisterInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/XCore/XCoreInstrInfo.cpp vendor/llvm/dist/lib/Target/XCore/XCoreInstrInfo.h vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MaximumSpanningTree.h vendor/llvm/dist/lib/Transforms/Scalar/CodeGenPrepare.cpp vendor/llvm/dist/lib/Transforms/Scalar/DeadStoreElimination.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnswitch.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/ScalarReplAggregates.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/BasicBlockUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/lib/Transforms/Utils/LowerSwitch.cpp vendor/llvm/dist/lib/Transforms/Utils/PromoteMemoryToRegister.cpp vendor/llvm/dist/lib/Transforms/Utils/SSAUpdater.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/VMCore/AsmWriter.cpp vendor/llvm/dist/lib/VMCore/BasicBlock.cpp vendor/llvm/dist/lib/VMCore/Constants.cpp vendor/llvm/dist/lib/VMCore/Function.cpp vendor/llvm/dist/lib/VMCore/LLVMContextImpl.h vendor/llvm/dist/lib/VMCore/Pass.cpp vendor/llvm/dist/lib/VMCore/PassManager.cpp vendor/llvm/dist/test/Analysis/BasicAA/modref.ll vendor/llvm/dist/test/CMakeLists.txt vendor/llvm/dist/test/CodeGen/CellSPU/and_ops.ll vendor/llvm/dist/test/CodeGen/CellSPU/call_indirect.ll vendor/llvm/dist/test/CodeGen/Thumb2/large-stack.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-spill-q.ll vendor/llvm/dist/test/CodeGen/X86/2007-01-08-InstrSched.ll vendor/llvm/dist/test/CodeGen/X86/2009-09-10-SpillComments.ll vendor/llvm/dist/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll vendor/llvm/dist/test/CodeGen/X86/sink-hoist.ll vendor/llvm/dist/test/CodeGen/X86/sse2.ll vendor/llvm/dist/test/CodeGen/X86/sse3.ll vendor/llvm/dist/test/CodeGen/X86/tail-opts.ll vendor/llvm/dist/test/CodeGen/X86/tailcallstack64.ll vendor/llvm/dist/test/CodeGen/X86/unaligned-load.ll vendor/llvm/dist/test/CodeGen/X86/widen_arith-3.ll vendor/llvm/dist/test/FrontendC++/2006-11-06-StackTrace.cpp vendor/llvm/dist/test/FrontendC++/2006-11-30-NoCompileUnit.cpp vendor/llvm/dist/test/FrontendC++/2006-11-30-Pubnames.cpp vendor/llvm/dist/test/FrontendC++/2009-07-15-LineNumbers.cpp vendor/llvm/dist/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c vendor/llvm/dist/test/FrontendC/2005-09-24-AsmUserPrefix.c vendor/llvm/dist/test/FrontendC/2006-01-13-StackSave.c vendor/llvm/dist/test/FrontendC/2006-01-23-FileScopeAsm.c vendor/llvm/dist/test/FrontendC/2006-03-03-MissingInitializer.c vendor/llvm/dist/test/FrontendC/2007-01-24-InlineAsmCModifier.c vendor/llvm/dist/test/FrontendC/2007-04-11-InlineAsmStruct.c vendor/llvm/dist/test/FrontendC/2007-04-11-InlineAsmUnion.c vendor/llvm/dist/test/FrontendC/2007-04-11-InlineStorageClassC89.c vendor/llvm/dist/test/FrontendC/2007-04-11-InlineStorageClassC99.c vendor/llvm/dist/test/FrontendC/2007-08-01-LoadStoreAlign.c vendor/llvm/dist/test/FrontendC/2007-12-VarArrayDebug.c vendor/llvm/dist/test/FrontendC/2009-02-17-BitField-dbg.c vendor/llvm/dist/test/FrontendC/BasicInstrs.c vendor/llvm/dist/test/FrontendC/extern-weak.c vendor/llvm/dist/test/FrontendC/unaligned-memcpy.c vendor/llvm/dist/test/FrontendObjC/2009-08-17-DebugInfo.m vendor/llvm/dist/test/FrontendObjC/2009-11-30-Objc-ID.m vendor/llvm/dist/test/LLVMC/EmptyCompilationGraph.td vendor/llvm/dist/test/LLVMC/EnvParentheses.td vendor/llvm/dist/test/LLVMC/ExternOptions.td vendor/llvm/dist/test/LLVMC/ForwardAs.td vendor/llvm/dist/test/LLVMC/HookWithArguments.td vendor/llvm/dist/test/LLVMC/MultiValuedOption.td vendor/llvm/dist/test/LLVMC/MultipleCompilationGraphs.td vendor/llvm/dist/test/LLVMC/NoActions.td vendor/llvm/dist/test/LLVMC/NoCompilationGraph.td vendor/llvm/dist/test/LLVMC/OneOrMore.td vendor/llvm/dist/test/LLVMC/OptionPreprocessor.td vendor/llvm/dist/test/LLVMC/TestWarnings.td vendor/llvm/dist/test/Transforms/ConstProp/loads.ll vendor/llvm/dist/test/Transforms/DeadStoreElimination/const-pointers.ll vendor/llvm/dist/test/Transforms/GVN/crash.ll vendor/llvm/dist/test/Transforms/GVN/lifetime-simple.ll vendor/llvm/dist/test/Transforms/GVN/rle.ll vendor/llvm/dist/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll vendor/llvm/dist/test/Transforms/InstCombine/compare-signs.ll vendor/llvm/dist/test/Transforms/InstCombine/crash.ll vendor/llvm/dist/test/Transforms/JumpThreading/crash.ll vendor/llvm/dist/test/Unit/lit.cfg vendor/llvm/dist/test/lit.cfg vendor/llvm/dist/tools/llvmc/doc/LLVMC-Reference.rst vendor/llvm/dist/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td vendor/llvm/dist/tools/llvmc/plugins/Base/Base.td.in vendor/llvm/dist/tools/llvmc/plugins/Clang/Clang.td vendor/llvm/dist/tools/opt/opt.cpp vendor/llvm/dist/unittests/ExecutionEngine/JIT/JITTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/JIT/Makefile vendor/llvm/dist/utils/NewNightlyTest.pl vendor/llvm/dist/utils/TableGen/CodeEmitterGen.cpp vendor/llvm/dist/utils/TableGen/CodeEmitterGen.h vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.h vendor/llvm/dist/utils/TableGen/LLVMCConfigurationEmitter.cpp vendor/llvm/dist/utils/TableGen/OptParserEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.cpp vendor/llvm/dist/utils/lit/lit.py Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/CMakeLists.txt Tue Dec 15 18:09:07 2009 (r200581) @@ -191,7 +191,13 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LL add_llvm_definitions( -D__STDC_LIMIT_MACROS ) add_llvm_definitions( -D__STDC_CONSTANT_MACROS ) -option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) +# MSVC has a gazillion warnings with this. +if( MSVC ) + option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF) +else( MSVC ) + option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) +endif() + option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) Modified: vendor/llvm/dist/Makefile ============================================================================== --- vendor/llvm/dist/Makefile Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/Makefile Tue Dec 15 18:09:07 2009 (r200581) @@ -66,8 +66,7 @@ ifeq ($(MAKECMDGOALS),tools-only) endif ifeq ($(MAKECMDGOALS),install-clang) - DIRS := tools/clang/tools/driver tools/clang/tools/clang-cc \ - tools/clang/lib/Headers tools/clang/docs + DIRS := tools/clang/tools/driver tools/clang/lib/Headers tools/clang/docs OPTIONAL_DIRS := NO_INSTALL = 1 endif Modified: vendor/llvm/dist/Makefile.config.in ============================================================================== --- vendor/llvm/dist/Makefile.config.in Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/Makefile.config.in Tue Dec 15 18:09:07 2009 (r200581) @@ -313,7 +313,7 @@ endif # Location of the plugin header file for gold. BINUTILS_INCDIR := @BINUTILS_INCDIR@ -C_INCLUDE_DIRS := @C_INCLUDE_DISR@ +C_INCLUDE_DIRS := @C_INCLUDE_DIRS@ CXX_INCLUDE_ROOT := @CXX_INCLUDE_ROOT@ CXX_INCLUDE_ARCH := @CXX_INCLUDE_ARCH@ CXX_INCLUDE_32BIT_DIR = @CXX_INCLUDE_32BIT_DIR@ Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/autoconf/configure.ac Tue Dec 15 18:09:07 2009 (r200581) @@ -672,7 +672,7 @@ case "$withval" in *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;; esac -AC_ARG_WITH(c-include-dir, +AC_ARG_WITH(c-include-dirs, AS_HELP_STRING([--with-c-include-dirs], [Colon separated list of directories clang will search for headers]),, withval="") Modified: vendor/llvm/dist/cmake/modules/CheckAtomic.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/CheckAtomic.cmake Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/cmake/modules/CheckAtomic.cmake Tue Dec 15 18:09:07 2009 (r200581) @@ -1,14 +1,25 @@ # atomic builtins are required for threading support. INCLUDE(CheckCXXSourceCompiles) - + CHECK_CXX_SOURCE_COMPILES(" +#ifdef _MSC_VER +#include +#endif int main() { +#ifdef _MSC_VER + volatile LONG val = 1; + MemoryBarrier(); + InterlockedCompareExchange(&val, 0, 1); + InterlockedIncrement(&val); + InterlockedDecrement(&val); +#else volatile unsigned long val = 1; __sync_synchronize(); __sync_val_compare_and_swap(&val, 1, 0); __sync_add_and_fetch(&val, 1); __sync_sub_and_fetch(&val, 1); +#endif return 0; } " LLVM_MULTITHREADED) Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/configure Tue Dec 15 18:09:07 2009 (r200581) @@ -5286,9 +5286,9 @@ echo "$as_me: error: Invalid path for -- esac -# Check whether --with-c-include-dir was given. -if test "${with_c_include_dir+set}" = set; then - withval=$with_c_include_dir; +# Check whether --with-c-include-dirs was given. +if test "${with_c_include_dirs+set}" = set; then + withval=$with_c_include_dirs; else withval="" fi Modified: vendor/llvm/dist/docs/CompilerDriver.html ============================================================================== --- vendor/llvm/dist/docs/CompilerDriver.html Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/docs/CompilerDriver.html Tue Dec 15 18:09:07 2009 (r200581) @@ -17,28 +17,28 @@ The ReST source lives in the directory '

Contents

-

Conditional evaluation

+

Conditional evaluation

The 'case' construct is the main means by which programmability is achieved in LLVMC. It can be used to calculate edge weights, program actions and modify the shell commands to be executed. The 'case' @@ -433,7 +438,7 @@ a given value. Example: (parameter_equals "W", "all").

  • element_in_list - Returns true if a command-line parameter list contains a given value. -Example: (parameter_in_list "l", "pthread").
  • +Example: (element_in_list "l", "pthread").
  • input_languages_contain - Returns true if a given language belongs to the current input language set. Example: (input_languages_contain "c++").
  • @@ -475,7 +480,7 @@ argument. Example: -

    Writing a tool description

    +

    Writing a tool description

    As was said earlier, nodes in the compilation graph represent tools, which are described separately. A tool definition looks like this (taken from the include/llvm/CompilerDriver/Tools.td file):

    @@ -512,12 +517,12 @@ list of input files and joins them toget tools are passed to this tool.
  • actions - A single big case expression that specifies how this tool reacts on command-line options (described in more detail -below).
  • +below). -
    -

    Actions

    +
    +

    Actions

    A tool often needs to react to command-line options, and this is precisely what the actions property is for. The next example illustrates this feature:

    @@ -550,28 +555,31 @@ like a linker.

  • Possible actions:

      -
    • append_cmd - append a string to the tool invocation -command. -Example: (case (switch_on "pthread"), (append_cmd -"-lpthread"))
    • -
    • error - exit with error. +
    • append_cmd - Append a string to the tool invocation command. +Example: (case (switch_on "pthread"), (append_cmd "-lpthread")).
    • +
    • error - Exit with error. Example: (error "Mixing -c and -S is not allowed!").
    • -
    • warning - print a warning. +
    • warning - Print a warning. Example: (warning "Specifying both -O1 and -O2 is meaningless!").
    • -
    • forward - forward an option unchanged. Example: (forward "Wall").
    • -
    • forward_as - Change the name of an option, but forward the -argument unchanged. +
    • forward - Forward the option unchanged. +Example: (forward "Wall").
    • +
    • forward_as - Change the option's name, but forward the argument +unchanged. Example: (forward_as "O0", "--disable-optimization").
    • -
    • output_suffix - modify the output suffix of this -tool. +
    • forward_value - Forward only option's value. Cannot be used with switch +options (since they don't have values), but works fine with lists. +Example: (forward_value "Wa,").
    • +
    • forward_transformed_value - As above, but applies a hook to the +option's value before forwarding (see below). When +forward_transformed_value is applied to a list +option, the hook must have signature +std::string hooks::HookName (const std::vector<std::string>&). +Example: (forward_transformed_value "m", "ConvertToMAttr").
    • +
    • output_suffix - Modify the output suffix of this tool. Example: (output_suffix "i").
    • -
    • stop_compilation - stop compilation after this tool processes -its input. Used without arguments.
    • -
    • unpack_values - used for for splitting and forwarding -comma-separated lists of options, e.g. -Wa,-foo=bar,-baz is -converted to -foo=bar -baz and appended to the tool invocation -command. -Example: (unpack_values "Wa,").
    • +
    • stop_compilation - Stop compilation after this tool processes its +input. Used without arguments. +Example: (stop_compilation).
  • @@ -579,7 +587,7 @@ Example:
    -

    Language map

    +

    Language map

    If you are adding support for a new language to LLVMC, you'll need to modify the language map, which defines mappings from file extensions to language names. It is used to choose the proper toolchain(s) for a @@ -602,7 +610,7 @@ multiple output languages, for nodes &qu output languages should match. This is enforced at compile-time.

    -

    Option preprocessor

    +

    Option preprocessor

    It is sometimes useful to run error-checking code before processing the compilation graph. For example, if optimization options "-O1" and "-O2" are implemented as switches, we might want to output a warning if the user invokes @@ -629,9 +637,9 @@ in unset_option also works on lists.

    -

    More advanced topics

    +

    More advanced topics

    -

    Hooks and environment variables

    +

    Hooks and environment variables

    Normally, LLVMC executes programs from the system PATH. Sometimes, this is not sufficient: for example, we may want to specify tool paths or names in the configuration file. This can be easily achieved via @@ -664,7 +672,7 @@ the

    -

    How plugins are loaded

    +

    How plugins are loaded

    It is possible for LLVMC plugins to depend on each other. For example, one can create edges between nodes defined in some other plugin. To make this work, however, that plugin should be loaded first. To @@ -680,7 +688,7 @@ with 0. Therefore, the plugin with the h loaded last.

    -

    Debugging

    +

    Debugging

    When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command line option --view-graph. This command assumes that Graphviz and @@ -696,7 +704,7 @@ perform any compilation tasks and return errors as its status code.

    -

    Conditioning on the executable name

    +

    Conditioning on the executable name

    For now, the executable name (the value passed to the driver in argv[0]) is accessible only in the C++ code (i.e. hooks). Use the following code:

    @@ -704,12 +712,16 @@ namespace llvmc {
     extern const char* ProgramName;
     }
     
    +namespace hooks {
    +
     std::string MyHook() {
     //...
     if (strcmp(ProgramName, "mydriver") == 0) {
        //...
     
     }
    +
    +} // end namespace hooks
     

    In general, you're encouraged not to make the behaviour dependent on the executable file name, and use command-line switches instead. See for example how @@ -727,7 +739,7 @@ the Mikhail Glushenkov
    LLVM Compiler Infrastructure
    -Last modified: $Date: 2009-10-26 02:35:46 +0100 (Mon, 26 Oct 2009) $ +Last modified: $Date: 2009-12-07 19:26:24 +0100 (Mon, 07 Dec 2009) $

    Modified: vendor/llvm/dist/docs/GettingStarted.html ============================================================================== --- vendor/llvm/dist/docs/GettingStarted.html Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/docs/GettingStarted.html Tue Dec 15 18:09:07 2009 (r200581) @@ -252,7 +252,8 @@ software you will need.

    Cygwin/Win32 - x861,8 + x861,8, + 11 GCC 3.4.X, binutils 2.15 @@ -331,6 +332,9 @@ up before any Windows-based versions such as Strawberry Perl and ActivePerl, as these have Windows-specifics that will cause the build to fail. +
  • In general, LLVM modules requiring dynamic linking can + not be built on Windows. However, you can build LLVM tools using + "make tools-only".
  • @@ -1636,7 +1640,7 @@ out:

    Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-11-04 07:15:28 +0100 (Wed, 04 Nov 2009) $ + Last modified: $Date: 2009-12-09 18:26:02 +0100 (Wed, 09 Dec 2009) $ Modified: vendor/llvm/dist/docs/LangRef.html ============================================================================== --- vendor/llvm/dist/docs/LangRef.html Tue Dec 15 16:15:14 2009 (r200580) +++ vendor/llvm/dist/docs/LangRef.html Tue Dec 15 18:09:07 2009 (r200581) @@ -5,7 +5,7 @@ LLVM Assembly Language Reference Manual - @@ -54,7 +54,7 @@
  • Type System
    1. Type Classifications
    2. -
    3. Primitive Types +
    4. Primitive Types
      1. Integer Type
      2. Floating Point Types
      3. @@ -576,7 +576,7 @@ define i32 @main() { Symbols with "common" linkage are merged in the same way as weak symbols, and they may not be deleted if unreferenced. common symbols may not have an explicit section, - must have a zero initializer, and may not be marked 'constant'. Functions and aliases may not have common linkage. @@ -843,7 +843,7 @@ define i32 @main() {

        LLVM function declarations consist of the "declare" keyword, an optional linkage type, an optional - visibility style, an optional + visibility style, an optional calling convention, a return type, an optional parameter attribute for the return type, a function name, a possibly empty list of arguments, an optional alignment, and an @@ -1192,7 +1192,7 @@ target datalayout = "layout specifica location.

        p:size:abi:pref
        -
        This specifies the size of a pointer and its abi and +
        This specifies the size of a pointer and its abi and preferred alignments. All sizes are in bits. Specifying the pref alignment is optional. If omitted, the preceding : should be omitted too.
        @@ -1202,11 +1202,11 @@ target datalayout = "layout specifica size. The value of size must be in the range [1,2^23).
        vsize:abi:pref
        -
        This specifies the alignment for a vector type of a given bit +
        This specifies the alignment for a vector type of a given bit size.
        fsize:abi:pref
        -
        This specifies the alignment for a floating point type of a given bit +
        This specifies the alignment for a floating point type of a given bit size. The value of size must be either 32 (float) or 64 (double).
        @@ -1222,7 +1222,7 @@ target datalayout = "layout specifica
        This specifies a set of native integer widths for the target CPU in bits. For example, it might contain "n32" for 32-bit PowerPC, "n32:64" for PowerPC 64, or "n8:16:32:64" for X86-64. Elements of - this set are considered to support most general arithmetic + this set are considered to support most general arithmetic operations efficiently.
        @@ -1616,16 +1616,16 @@ Classifications float (i16 signext, i32 *) * - Pointer to a function that takes - an i16 that should be sign extended and a - pointer to i32, returning + Pointer to a function that takes + an i16 that should be sign extended and a + pointer to i32, returning float. i32 (i8*, ...) - A vararg function that takes at least one - pointer to i8 (char in C), - which returns an integer. This is the signature for printf in + A vararg function that takes at least one + pointer to i8 (char in C), + which returns an integer. This is the signature for printf in LLVM. @@ -2054,9 +2054,9 @@ Unsafe: For example, if "%X" has a zero bit, then the output of the 'and' operation will always be a zero, no matter what the corresponding bit from the undef is. As such, it is unsafe to optimize or assume that the result of the and is undef. -However, it is safe to assume that all bits of the undef could be 0, and -optimize the and to 0. Likewise, it is safe to assume that all the bits of -the undef operand to the or could be set, allowing the or to be folded to +However, it is safe to assume that all bits of the undef could be 0, and +optimize the and to 0. Likewise, it is safe to assume that all the bits of +the undef operand to the or could be set, allowing the or to be folded to -1.

        @@ -2086,7 +2086,7 @@ the optimizer is allowed to assume that
           %A = xor undef, undef
        -  
        +
           %B = undef
           %C = xor %B, %B
         
        @@ -2137,7 +2137,7 @@ does not execute at all.  This allows us
         it: since the undefined operation "can't happen", the optimizer can assume that
         it occurs in dead code.
         

        - +
         a:  store undef -> %X
        @@ -2149,7 +2149,7 @@ b: unreachable
         

        These examples reiterate the fdiv example: a store "of" an undefined value -can be assumed to not have any effect: we can assume that the value is +can be assumed to not have any effect: we can assume that the value is overwritten with bits that happen to match what was already there. However, a store "to" an undefined location could clobber arbitrary memory, therefore, it has undefined behavior.

        @@ -2166,7 +2166,7 @@ has undefined behavior.

        The 'blockaddress' constant computes the address of the specified basic block in the specified function, and always has an i8* type. Taking the address of the entry block is illegal.

        - +

        This value only has defined behavior when used as an operand to the 'indirectbr' instruction or for comparisons against null. Pointer equality tests between labels addresses is undefined @@ -2175,7 +2175,7 @@ has undefined behavior.

        pointer sized value as long as the bits are not inspected. This allows ptrtoint and arithmetic to be performed on these values so long as the original value is reconstituted before the indirectbr.

        - +

        Finally, some targets may provide defined semantics when using the value as the operand to an inline assembly, but that is target specific. @@ -2703,7 +2703,7 @@ IfUnequal: rest of the arguments indicate the full set of possible destinations that the address may point to. Blocks are allowed to occur multiple times in the destination list, though this isn't particularly useful.

        - +

        This destination list is required so that dataflow analysis has an accurate understanding of the CFG.

        @@ -3060,7 +3060,7 @@ Instruction

        The two arguments to the 'mul' instruction must be integer or vector of integer values. Both arguments must have identical types.

        - +
        Semantics:

        The value produced is the integer product of the two operands.

        @@ -3132,7 +3132,7 @@ Instruction

        The 'udiv' instruction returns the quotient of its two operands.

        Arguments:
        -

        The two arguments to the 'udiv' instruction must be +

        The two arguments to the 'udiv' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3167,7 +3167,7 @@ Instruction

        The 'sdiv' instruction returns the quotient of its two operands.

        Arguments:
        -

        The two arguments to the 'sdiv' instruction must be +

        The two arguments to the 'sdiv' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3238,7 +3238,7 @@ Instruction division of its two arguments.

        Arguments:
        -

        The two arguments to the 'urem' instruction must be +

        The two arguments to the 'urem' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3278,7 +3278,7 @@ Instruction elements must be integers.

        Arguments:
        -

        The two arguments to the 'srem' instruction must be +

        The two arguments to the 'srem' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3373,7 +3373,7 @@ Instruction

        Both arguments to the 'shl' instruction must be the same integer or vector of integer type. 'op2' is treated as an unsigned value.

        - +
        Semantics:

        The value produced is op1 * 2op2 mod 2n, where n is the width of the result. If op2 @@ -3409,7 +3409,7 @@ Instruction operand shifted to the right a specified number of bits with zero fill.

        Arguments:
        -

        Both arguments to the 'lshr' instruction must be the same +

        Both arguments to the 'lshr' instruction must be the same integer or vector of integer type. 'op2' is treated as an unsigned value.

        @@ -3449,7 +3449,7 @@ Instruction extension.

        Arguments:
        -

        Both arguments to the 'ashr' instruction must be the same +

        Both arguments to the 'ashr' instruction must be the same integer or vector of integer type. 'op2' is treated as an unsigned value.

        @@ -3489,7 +3489,7 @@ Instruction operands.

        Arguments:
        -

        The two arguments to the 'and' instruction must be +

        The two arguments to the 'and' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3548,7 +3548,7 @@ Instruction two operands.

        Arguments:
        -

        The two arguments to the 'or' instruction must be +

        The two arguments to the 'or' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3611,7 +3611,7 @@ Instruction complement" operation, which is the "~" operator in C.

        Arguments:
        -

        The two arguments to the 'xor' instruction must be +

        The two arguments to the 'xor' instruction must be integer or vector of integer values. Both arguments must have identical types.

        @@ -3659,7 +3659,7 @@ Instruction -
        + @@ -3782,20 +3782,20 @@ Instruction
        Example:
        -  <result> = shufflevector <4 x i32> %v1, <4 x i32> %v2, 
        +  <result> = shufflevector <4 x i32> %v1, <4 x i32> %v2,
                                   <4 x i32> <i32 0, i32 4, i32 1, i32 5>  ; yields <4 x i32>
        -  <result> = shufflevector <4 x i32> %v1, <4 x i32> undef, 
        +  <result> = shufflevector <4 x i32> %v1, <4 x i32> undef,
                                   <4 x i32> <i32 0, i32 1, i32 2, i32 3>  ; yields <4 x i32> - Identity shuffle.
        -  <result> = shufflevector <8 x i32> %v1, <8 x i32> undef, 
        +  <result> = shufflevector <8 x i32> %v1, <8 x i32> undef,
                                   <4 x i32> <i32 0, i32 1, i32 2, i32 3>  ; yields <4 x i32>
        -  <result> = shufflevector <4 x i32> %v1, <4 x i32> %v2, 
        +  <result> = shufflevector <4 x i32> %v1, <4 x i32> %v2,
                                   <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 >  ; yields <8 x i32>
         
        -
        + @@ -3880,7 +3880,7 @@ Instruction
        -
        + @@ -4243,15 +4243,15 @@ entry:
        Overview:
        -

        The 'zext' instruction zero extends its operand to type +

        The 'zext' instruction zero extends its operand to type ty2.

        Arguments:
        -

        The 'zext' instruction takes a value to cast, which must be of +

        The 'zext' instruction takes a value to cast, which must be of integer type, and a type to cast it to, which must also be of integer type. The bit size of the - value must be smaller than the bit size of the destination type, + value must be smaller than the bit size of the destination type, ty2.

        Semantics:
        @@ -4283,10 +4283,10 @@ entry:

        The 'sext' sign extends value to the type ty2.

        Arguments:
        -

        The 'sext' instruction takes a value to cast, which must be of +

        The 'sext' instruction takes a value to cast, which must be of integer type, and a type to cast it to, which must also be of integer type. The bit size of the - value must be smaller than the bit size of the destination type, + value must be smaller than the bit size of the destination type, ty2.

        Semantics:
        @@ -4324,12 +4324,12 @@ entry:

        The 'fptrunc' instruction takes a floating point value to cast and a floating point type to cast it to. The size of value must be larger than the size of - ty2. This implies that fptrunc cannot be used to make a + ty2. This implies that fptrunc cannot be used to make a no-op cast.

        Semantics:

        The 'fptrunc' instruction truncates a value from a larger - floating point type to a smaller + floating point type to a smaller floating point type. If the value cannot fit within the destination type, ty2, then the results are undefined.

        @@ -4358,7 +4358,7 @@ entry: floating point value.

        Arguments:
        -

        The 'fpext' instruction takes a +

        The 'fpext' instruction takes a floating point value to cast, and a floating point type to cast it to. The source type must be smaller than the destination type.

        @@ -4401,7 +4401,7 @@ entry: vector integer type with the same number of elements as ty

        Semantics:
        -

        The 'fptoui' instruction converts its +

        The 'fptoui' instruction converts its floating point operand into the nearest (rounding towards zero) unsigned integer value. If the value cannot fit in ty2, the results are undefined.

        @@ -4427,7 +4427,7 @@ entry:
        Overview:
        -

        The 'fptosi' instruction converts +

        The 'fptosi' instruction converts floating point value to type ty2.

        @@ -4439,7 +4439,7 @@ entry: vector integer type with the same number of elements as ty

        Semantics:
        -

        The 'fptosi' instruction converts its +

        The 'fptosi' instruction converts its floating point operand into the nearest (rounding towards zero) signed integer value. If the value cannot fit in ty2, the results are undefined.

        @@ -4636,7 +4636,7 @@ entry:
           %X = bitcast i8 255 to i8              ; yields i8 :-1
           %Y = bitcast i32* %x to sint*          ; yields sint*:%x
        -  %Z = bitcast <2 x int> %V to i64;      ; yields i64: %V   
        +  %Z = bitcast <2 x int> %V to i64;      ; yields i64: %V
         
        @@ -4696,11 +4696,11 @@ entry: result, as follows:

          -
        1. eq: yields true if the operands are equal, +
        2. eq: yields true if the operands are equal, false otherwise. No sign interpretation is necessary or performed.
        3. -
        4. ne: yields true if the operands are unequal, +
        5. ne: yields true if the operands are unequal, false otherwise. No sign interpretation is necessary or performed.
        6. @@ -4817,42 +4817,42 @@ entry:
          1. false: always yields false, regardless of operands.
          2. -
          3. oeq: yields true if both operands are not a QNAN and +
          4. oeq: yields true if both operands are not a QNAN and op1 is equal to op2.
          5. ogt: yields true if both operands are not a QNAN and op1 is greather than op2.
          6. -
          7. oge: yields true if both operands are not a QNAN and +
          8. oge: yields true if both operands are not a QNAN and op1 is greater than or equal to op2.
          9. -
          10. olt: yields true if both operands are not a QNAN and +
          11. olt: yields true if both operands are not a QNAN and op1 is less than op2.
          12. -
          13. ole: yields true if both operands are not a QNAN and +
          14. ole: yields true if both operands are not a QNAN and op1 is less than or equal to op2.
          15. -
          16. one: yields true if both operands are not a QNAN and +
          17. one: yields true if both operands are not a QNAN and op1 is not equal to op2.
          18. ord: yields true if both operands are not a QNAN.
          19. -
          20. ueq: yields true if either operand is a QNAN or +
          21. ueq: yields true if either operand is a QNAN or op1 is equal to op2.
          22. -
          23. ugt: yields true if either operand is a QNAN or +
          24. ugt: yields true if either operand is a QNAN or op1 is greater than op2.
          25. -
          26. uge: yields true if either operand is a QNAN or +
          27. uge: yields true if either operand is a QNAN or op1 is greater than or equal to op2.
          28. -
          29. ult: yields true if either operand is a QNAN or +
          30. ult: yields true if either operand is a QNAN or op1 is less than op2.
          31. -
          32. ule: yields true if either operand is a QNAN or +
          33. ule: yields true if either operand is a QNAN or op1 is less than or equal to op2.
          34. -
          35. une: yields true if either operand is a QNAN or +
          36. une: yields true if either operand is a QNAN or op1 is not equal to op2.
          37. uno: yields true if either operand is a QNAN.
          38. @@ -5144,7 +5144,7 @@ freestanding environments and non-C-base suffix is required. Because the argument's type is matched against the return type, it does not require its own name suffix.

            -

            To learn how to add an intrinsic function, please see the +

            To learn how to add an intrinsic function, please see the Extending LLVM Guide.

            @@ -6579,11 +6579,11 @@ LLVM.

            • ll: All loads before the barrier must complete before any load after the barrier begins.
            • -
            • ls: All loads before the barrier must complete before any +
            • ls: All loads before the barrier must complete before any store after the barrier begins.
            • -
            • ss: All stores before the barrier must complete before any +
            • ss: All stores before the barrier must complete before any store after the barrier begins.
            • -
            • sl: All stores before the barrier must complete before any +
            • sl: All stores before the barrier must complete before any load after the barrier begins.
            @@ -6796,7 +6796,7 @@ LLVM.

            Overview:
            -

            This intrinsic subtracts delta to the value stored in memory at +

            This intrinsic subtracts delta to the value stored in memory at ptr. It yields the original value at ptr.

            Arguments:
            @@ -6952,7 +6952,7 @@ LLVM.

            Overview:
            -

            These intrinsics takes the signed or unsigned minimum or maximum of +

            These intrinsics takes the signed or unsigned minimum or maximum of delta and the value stored in memory at ptr. It yields the original value at ptr.

            @@ -7262,24 +7262,44 @@ LLVM.

            Overview:
            -

            The llvm.objectsize intrinsic returns the constant number of bytes - from ptr to the end of the object ptr points to if it - can deduce this at compile time. If there are any side-effects in evaluating - the argument or it cannot deduce which objects ptr points to at compile - time the intrinsic returns (size_t) -1 for type 0 - or 1 and (size_t) 0 for type 2 or 3.

            +

            The llvm.objectsize intrinsic is designed to provide information + to the optimizers to either discover at compile time either a) when an + operation like memcpy will either overflow a buffer that corresponds to + an object, or b) to determine that a runtime check for overflow isn't + necessary. An object in this context means an allocation of a + specific type.

            Arguments:

            The llvm.objectsize intrinsic takes two arguments. The first - argument is a pointer to the object ptr and an integer type. - type is an integer ranging from 0 to 3. The lsb corresponds to - a return value based on whole objects, the second bit whether or not we - return the maximum or minimum remaining bytes computed.

            + argument is a pointer to the object ptr. The second argument + is an integer type which ranges from 0 to 3. The first bit in + the type corresponds to a return value based on whole objects, + and the second bit whether or not we return the maximum or minimum + remaining bytes computed.

            + + + + + + + + + + + + + + + + + +
            00whole object, maximum number of bytes
            01partial object, maximum number of bytes
            10whole object, minimum number of bytes
            11partial object, minimum number of bytes
            Semantics:

            The llvm.objectsize intrinsic is lowered to either a constant - representing the size of the object concerned or (size_t) -1 if - it cannot be determined at compile time.

            + representing the size of the object concerned or i32/i64 -1 or 0 + (depending on the type argument if the size cannot be determined *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 18:33:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1E68106566C; Tue, 15 Dec 2009 18:33:12 +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 A0FA18FC12; Tue, 15 Dec 2009 18:33: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 nBFIXCmc071536; Tue, 15 Dec 2009 18:33:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFIXC3x071533; Tue, 15 Dec 2009 18:33:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912151833.nBFIXC3x071533@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 18:33: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: r200582 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:33:12 -0000 Author: luigi Date: Tue Dec 15 18:33:12 2009 New Revision: 200582 URL: http://svn.freebsd.org/changeset/base/200582 Log: add ip_fw_private.h to ng_ipfw.c, forgotten in previous commit; comment out remove ip_fw.h from ng_bridge.c, as it seems unused. MFC after: 1 month Modified: head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Tue Dec 15 18:09:07 2009 (r200581) +++ head/sys/netgraph/ng_bridge.c Tue Dec 15 18:33:12 2009 (r200582) @@ -75,8 +75,9 @@ #include #include +#if 0 /* not used yet */ #include - +#endif #include #include #include Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Tue Dec 15 18:09:07 2009 (r200581) +++ head/sys/netgraph/ng_ipfw.c Tue Dec 15 18:33:12 2009 (r200582) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 18:49:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 160241065696; Tue, 15 Dec 2009 18:49:49 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0075F8FC49; Tue, 15 Dec 2009 18: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 nBFInmvk071893; Tue, 15 Dec 2009 18:49:48 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFInm8Q071877; Tue, 15 Dec 2009 18:49:48 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200912151849.nBFInm8Q071877@svn.freebsd.org> From: Roman Divacky Date: Tue, 15 Dec 2009 18:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200583 - in vendor/clang/dist: . clang.xcodeproj docs include/clang-c include/clang/AST include/clang/Analysis include/clang/Analysis/PathSensitive include/clang/Analysis/Support inclu... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:49:49 -0000 Author: rdivacky Date: Tue Dec 15 18:49:47 2009 New Revision: 200583 URL: http://svn.freebsd.org/changeset/base/200583 Log: Update clang to 91430. Added: vendor/clang/dist/include/clang/Index/CallGraph.h vendor/clang/dist/lib/Analysis/BuiltinFunctionChecker.cpp vendor/clang/dist/lib/Analysis/NoReturnFunctionChecker.cpp vendor/clang/dist/lib/Analysis/OSAtomicChecker.cpp vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp vendor/clang/dist/lib/CodeGen/CGRTTI.cpp vendor/clang/dist/lib/Index/CallGraph.cpp vendor/clang/dist/lib/Parse/RAIIObjectsForParser.h vendor/clang/dist/lib/Sema/SemaInit.h vendor/clang/dist/test/Analysis/NSString-failed-cases.m vendor/clang/dist/test/Analysis/blocks.m vendor/clang/dist/test/CXX/basic/basic.lookup/basic.lookup.argdep/p3.cpp vendor/clang/dist/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp vendor/clang/dist/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp vendor/clang/dist/test/CXX/class.access/class.access.dcl/p1.cpp vendor/clang/dist/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p10.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p13.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p4.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.list/basic.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp vendor/clang/dist/test/CodeGen/decl.c vendor/clang/dist/test/CodeGen/palignr.c vendor/clang/dist/test/CodeGen/vfprintf.c vendor/clang/dist/test/CodeGenCXX/constructor-convert.cpp vendor/clang/dist/test/CodeGenCXX/conversion-operator-base.cpp vendor/clang/dist/test/CodeGenCXX/copy-assign-synthesis-3.cpp vendor/clang/dist/test/CodeGenCXX/copy-constructor-synthesis-2.cpp vendor/clang/dist/test/CodeGenCXX/default-constructor-template-member.cpp vendor/clang/dist/test/CodeGenCXX/elide-call-reference.cpp vendor/clang/dist/test/CodeGenCXX/enum.cpp vendor/clang/dist/test/CodeGenCXX/eval-recursive-constant.cpp vendor/clang/dist/test/CodeGenCXX/exceptions.cpp vendor/clang/dist/test/CodeGenCXX/function-template-explicit-specialization.cpp vendor/clang/dist/test/CodeGenCXX/global-llvm-constant.cpp vendor/clang/dist/test/CodeGenCXX/inline-functions.cpp vendor/clang/dist/test/CodeGenCXX/key-function-vtable.cpp vendor/clang/dist/test/CodeGenCXX/mangle-extern-local.cpp vendor/clang/dist/test/CodeGenCXX/mangle-unnamed.cpp vendor/clang/dist/test/CodeGenCXX/member-call-parens.cpp vendor/clang/dist/test/CodeGenCXX/member-pointer-type-convert.cpp vendor/clang/dist/test/CodeGenCXX/reference-init.cpp vendor/clang/dist/test/CodeGenCXX/rtti-linkage.cpp vendor/clang/dist/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp vendor/clang/dist/test/CodeGenCXX/template-linkage.cpp vendor/clang/dist/test/CodeGenCXX/throw-expressions.cpp vendor/clang/dist/test/CodeGenCXX/unary-type-trait.cpp vendor/clang/dist/test/CodeGenCXX/virt-call-offsets.cpp vendor/clang/dist/test/CodeGenCXX/virt-canonical-decl.cpp vendor/clang/dist/test/CodeGenCXX/virt-template-vtable.cpp vendor/clang/dist/test/CodeGenCXX/virt-thunk-reference.cpp vendor/clang/dist/test/CodeGenCXX/virtual-destructor-calls.cpp vendor/clang/dist/test/CodeGenCXX/virtual-destructor-synthesis.cpp vendor/clang/dist/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp vendor/clang/dist/test/CodeGenCXX/virtual-inherited-destructor.cpp vendor/clang/dist/test/CodeGenCXX/vtable-key-function.cpp vendor/clang/dist/test/CodeGenCXX/vtable-linkage.cpp vendor/clang/dist/test/CodeGenObjC/id-isa-codegen.m vendor/clang/dist/test/CodeGenObjC/nested-rethrow.m vendor/clang/dist/test/CodeGenObjC/property-list-in-class.m vendor/clang/dist/test/CodeGenObjCXX/ vendor/clang/dist/test/CodeGenObjCXX/mangle.mm vendor/clang/dist/test/Index/Inputs/remap-complete-to.c vendor/clang/dist/test/Index/cindex-from-source.m vendor/clang/dist/test/Index/cindex-on-invalid.m vendor/clang/dist/test/Index/complete-at-directives.m vendor/clang/dist/test/Index/complete-at-exprstmt.m vendor/clang/dist/test/Index/remap-complete.c vendor/clang/dist/test/Lexer/has_feature_exceptions.cpp vendor/clang/dist/test/Lexer/has_feature_rtti.cpp vendor/clang/dist/test/Lexer/msdos-cpm-eof.c vendor/clang/dist/test/Misc/Inputs/ vendor/clang/dist/test/Misc/Inputs/remapped-file vendor/clang/dist/test/Misc/Inputs/remapped-file-2 vendor/clang/dist/test/Misc/Inputs/remapped-file-3 vendor/clang/dist/test/Misc/remap-file.c vendor/clang/dist/test/PCH/source-manager-stack.c vendor/clang/dist/test/Parser/cxx-extern-c-array.cpp vendor/clang/dist/test/Parser/cxx-stmt.cpp vendor/clang/dist/test/SemaCXX/array-bound-merge.cpp vendor/clang/dist/test/SemaCXX/attr-noreturn.cpp vendor/clang/dist/test/SemaCXX/implicit-member-functions.cpp vendor/clang/dist/test/SemaCXX/implicit-virtual-member-functions.cpp vendor/clang/dist/test/SemaCXX/literal-type.cpp vendor/clang/dist/test/SemaCXX/member-expr-anonymous-union.cpp vendor/clang/dist/test/SemaCXX/prefetch-enum.cpp vendor/clang/dist/test/SemaCXX/virtual-member-functions-key-function.cpp vendor/clang/dist/test/SemaCXX/warn-missing-prototypes.cpp vendor/clang/dist/test/SemaObjC/method-arg-qualifier-warning.m vendor/clang/dist/test/SemaObjC/restrict-id-type.m vendor/clang/dist/test/SemaObjCXX/category-lookup.mm vendor/clang/dist/test/SemaObjCXX/composite-objc-pointertype.mm vendor/clang/dist/test/SemaObjCXX/conditional-expr.mm vendor/clang/dist/test/SemaObjCXX/cstyle-cast.mm vendor/clang/dist/test/SemaObjCXX/standard-conversion-to-bool.mm vendor/clang/dist/test/SemaTemplate/instantiate-default-assignment-operator.cpp vendor/clang/dist/test/SemaTemplate/instantiate-enum-2.cpp vendor/clang/dist/test/SemaTemplate/instantiate-exception-spec.cpp vendor/clang/dist/test/SemaTemplate/template-class-traits.cpp vendor/clang/dist/test/SemaTemplate/virtual-member-functions.cpp vendor/clang/dist/utils/TestUtils/ vendor/clang/dist/utils/TestUtils/deep-stack.py (contents, props changed) vendor/clang/dist/utils/TestUtils/pch-test.pl (contents, props changed) Deleted: vendor/clang/dist/include/clang/Analysis/CallGraph.h vendor/clang/dist/lib/Analysis/CallGraph.cpp vendor/clang/dist/lib/CodeGen/CGRtti.cpp vendor/clang/dist/lib/Parse/ExtensionRAIIObject.h vendor/clang/dist/test/CodeGen/cast-to-union.c vendor/clang/dist/test/CodeGen/string-init.c vendor/clang/dist/test/Parser/cxx-try.cpp vendor/clang/dist/tools/clang-cc/ Modified: vendor/clang/dist/NOTES.txt vendor/clang/dist/TODO.txt vendor/clang/dist/clang.xcodeproj/project.pbxproj vendor/clang/dist/docs/BlockImplementation.txt vendor/clang/dist/docs/LanguageExtensions.html vendor/clang/dist/docs/PCHInternals.html vendor/clang/dist/docs/PTHInternals.html vendor/clang/dist/docs/UsersManual.html vendor/clang/dist/docs/libIndex.html vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/CanonicalType.h vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/AST/DeclContextInternals.h vendor/clang/dist/include/clang/AST/DeclNodes.def vendor/clang/dist/include/clang/AST/DeclObjC.h vendor/clang/dist/include/clang/AST/DeclTemplate.h vendor/clang/dist/include/clang/AST/DeclarationName.h vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/AST/ExprCXX.h vendor/clang/dist/include/clang/AST/RecordLayout.h vendor/clang/dist/include/clang/AST/StmtCXX.h vendor/clang/dist/include/clang/AST/TemplateBase.h vendor/clang/dist/include/clang/AST/TemplateName.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/AST/TypeLoc.h vendor/clang/dist/include/clang/AST/TypeLocBuilder.h vendor/clang/dist/include/clang/AST/TypeLocVisitor.h vendor/clang/dist/include/clang/AST/TypeNodes.def vendor/clang/dist/include/clang/AST/TypeOrdering.h vendor/clang/dist/include/clang/Analysis/PathDiagnostic.h vendor/clang/dist/include/clang/Analysis/PathSensitive/AnalysisContext.h vendor/clang/dist/include/clang/Analysis/PathSensitive/AnalysisManager.h vendor/clang/dist/include/clang/Analysis/PathSensitive/BugType.h vendor/clang/dist/include/clang/Analysis/PathSensitive/Checker.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRExprEngine.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRState.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRTransferFuncs.h vendor/clang/dist/include/clang/Analysis/PathSensitive/MemRegion.h vendor/clang/dist/include/clang/Analysis/PathSensitive/Store.h vendor/clang/dist/include/clang/Analysis/PathSensitive/SymbolManager.h vendor/clang/dist/include/clang/Analysis/ProgramPoint.h vendor/clang/dist/include/clang/Analysis/Support/BumpVector.h vendor/clang/dist/include/clang/Basic/Builtins.def vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/Diagnostic.h vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/FileManager.h vendor/clang/dist/include/clang/Basic/IdentifierTable.h vendor/clang/dist/include/clang/Basic/LangOptions.h vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h vendor/clang/dist/include/clang/Basic/SourceLocation.h vendor/clang/dist/include/clang/Basic/SourceManager.h vendor/clang/dist/include/clang/Basic/TokenKinds.def vendor/clang/dist/include/clang/Basic/TypeTraits.h vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Driver.h vendor/clang/dist/include/clang/Driver/Job.h vendor/clang/dist/include/clang/Driver/OptParser.td vendor/clang/dist/include/clang/Driver/OptTable.h vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/ASTConsumers.h vendor/clang/dist/include/clang/Frontend/ASTUnit.h vendor/clang/dist/include/clang/Frontend/AnalysisConsumer.h vendor/clang/dist/include/clang/Frontend/CompilerInstance.h vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h vendor/clang/dist/include/clang/Frontend/FrontendOptions.h vendor/clang/dist/include/clang/Frontend/HeaderSearchOptions.h vendor/clang/dist/include/clang/Frontend/PCHBitCodes.h vendor/clang/dist/include/clang/Frontend/PCHReader.h vendor/clang/dist/include/clang/Frontend/PCHWriter.h vendor/clang/dist/include/clang/Frontend/PreprocessorOptions.h vendor/clang/dist/include/clang/Index/Entity.h vendor/clang/dist/include/clang/Index/GlobalSelector.h vendor/clang/dist/include/clang/Lex/Lexer.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Parse/Action.h vendor/clang/dist/include/clang/Parse/DeclSpec.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/ExternalSemaSource.h vendor/clang/dist/include/clang/Sema/SemaConsumer.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/CXXInheritance.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/DeclObjC.cpp vendor/clang/dist/lib/AST/DeclPrinter.cpp vendor/clang/dist/lib/AST/DeclTemplate.cpp vendor/clang/dist/lib/AST/DeclarationName.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/RecordLayoutBuilder.cpp vendor/clang/dist/lib/AST/RecordLayoutBuilder.h vendor/clang/dist/lib/AST/StmtDumper.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/AST/TemplateBase.cpp vendor/clang/dist/lib/AST/TemplateName.cpp vendor/clang/dist/lib/AST/Type.cpp vendor/clang/dist/lib/AST/TypeLoc.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Analysis/AnalysisContext.cpp vendor/clang/dist/lib/Analysis/BasicStore.cpp vendor/clang/dist/lib/Analysis/BugReporter.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/CFRefCount.cpp vendor/clang/dist/lib/Analysis/CMakeLists.txt vendor/clang/dist/lib/Analysis/CallAndMessageChecker.cpp vendor/clang/dist/lib/Analysis/CheckDeadStores.cpp vendor/clang/dist/lib/Analysis/CheckSecuritySyntaxOnly.cpp vendor/clang/dist/lib/Analysis/Checker.cpp vendor/clang/dist/lib/Analysis/GRExprEngine.cpp vendor/clang/dist/lib/Analysis/GRExprEngineInternalChecks.h vendor/clang/dist/lib/Analysis/GRState.cpp vendor/clang/dist/lib/Analysis/MallocChecker.cpp vendor/clang/dist/lib/Analysis/MemRegion.cpp vendor/clang/dist/lib/Analysis/PathDiagnostic.cpp vendor/clang/dist/lib/Analysis/RegionStore.cpp vendor/clang/dist/lib/Analysis/Store.cpp vendor/clang/dist/lib/Analysis/SymbolManager.cpp vendor/clang/dist/lib/Analysis/ValueManager.cpp vendor/clang/dist/lib/Basic/Diagnostic.cpp vendor/clang/dist/lib/Basic/FileManager.cpp vendor/clang/dist/lib/Basic/SourceManager.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCXX.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGClass.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.h vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGException.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGExprConstant.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp vendor/clang/dist/lib/CodeGen/CGRecordLayoutBuilder.cpp vendor/clang/dist/lib/CodeGen/CGVtable.cpp vendor/clang/dist/lib/CodeGen/CGVtable.h vendor/clang/dist/lib/CodeGen/CMakeLists.txt vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp vendor/clang/dist/lib/CodeGen/GlobalDecl.h vendor/clang/dist/lib/CodeGen/Mangle.cpp vendor/clang/dist/lib/CodeGen/Mangle.h vendor/clang/dist/lib/CodeGen/TargetABIInfo.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/DriverOptions.cpp vendor/clang/dist/lib/Driver/Job.cpp vendor/clang/dist/lib/Driver/OptTable.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Driver/Types.cpp vendor/clang/dist/lib/Frontend/ASTConsumers.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/AnalysisConsumer.cpp vendor/clang/dist/lib/Frontend/Backend.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/DiagChecker.cpp vendor/clang/dist/lib/Frontend/FixItRewriter.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/HTMLPrint.cpp vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/LangStandards.cpp vendor/clang/dist/lib/Frontend/PCHReader.cpp vendor/clang/dist/lib/Frontend/PCHReaderDecl.cpp vendor/clang/dist/lib/Frontend/PCHReaderStmt.cpp vendor/clang/dist/lib/Frontend/PCHWriter.cpp vendor/clang/dist/lib/Frontend/PCHWriterDecl.cpp vendor/clang/dist/lib/Frontend/PCHWriterStmt.cpp vendor/clang/dist/lib/Frontend/PlistDiagnostics.cpp vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp vendor/clang/dist/lib/Frontend/RewriteObjC.cpp vendor/clang/dist/lib/Frontend/TextDiagnosticPrinter.cpp vendor/clang/dist/lib/Headers/limits.h vendor/clang/dist/lib/Headers/tmmintrin.h vendor/clang/dist/lib/Index/ASTVisitor.h vendor/clang/dist/lib/Index/CMakeLists.txt vendor/clang/dist/lib/Index/ResolveLocation.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/MacroArgs.cpp vendor/clang/dist/lib/Lex/MacroArgs.h vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPExpressions.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Lex/TokenLexer.cpp vendor/clang/dist/lib/Parse/DeclSpec.cpp vendor/clang/dist/lib/Parse/MinimalAction.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Parse/ParseTemplate.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Sema/CodeCompleteConsumer.cpp vendor/clang/dist/lib/Sema/Lookup.h vendor/clang/dist/lib/Sema/ParseAST.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/Sema.h vendor/clang/dist/lib/Sema/SemaAttr.cpp vendor/clang/dist/lib/Sema/SemaCXXCast.cpp vendor/clang/dist/lib/Sema/SemaCXXScopeSpec.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExceptionSpec.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaInit.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaOverload.h vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/test/Analysis/CFDateGC.m vendor/clang/dist/test/Analysis/CFNumber.c vendor/clang/dist/test/Analysis/CFRetainRelease_NSAssertionHandler.m vendor/clang/dist/test/Analysis/CGColorSpace.c vendor/clang/dist/test/Analysis/CheckNSError.m vendor/clang/dist/test/Analysis/MissingDealloc.m vendor/clang/dist/test/Analysis/NSPanel.m vendor/clang/dist/test/Analysis/NSString.m vendor/clang/dist/test/Analysis/NSWindow.m vendor/clang/dist/test/Analysis/NoReturn.m vendor/clang/dist/test/Analysis/ObjCProperties.m vendor/clang/dist/test/Analysis/ObjCRetSigs.m vendor/clang/dist/test/Analysis/PR2599.m vendor/clang/dist/test/Analysis/PR2978.m vendor/clang/dist/test/Analysis/PR3991.m vendor/clang/dist/test/Analysis/array-struct.c vendor/clang/dist/test/Analysis/casts.c vendor/clang/dist/test/Analysis/casts.m vendor/clang/dist/test/Analysis/cfref_PR2519.c vendor/clang/dist/test/Analysis/cfref_rdar6080742.c vendor/clang/dist/test/Analysis/complex.c vendor/clang/dist/test/Analysis/concrete-address.c vendor/clang/dist/test/Analysis/conditional-op-missing-lhs.c vendor/clang/dist/test/Analysis/dead-stores.c vendor/clang/dist/test/Analysis/dead-stores.cpp vendor/clang/dist/test/Analysis/dead-stores.m vendor/clang/dist/test/Analysis/delegates.m vendor/clang/dist/test/Analysis/elementtype.c vendor/clang/dist/test/Analysis/exercise-ps.c vendor/clang/dist/test/Analysis/fields.c vendor/clang/dist/test/Analysis/func.c vendor/clang/dist/test/Analysis/malloc.c vendor/clang/dist/test/Analysis/misc-ps-64.m vendor/clang/dist/test/Analysis/misc-ps-basic-store.m vendor/clang/dist/test/Analysis/misc-ps-eager-assume.m vendor/clang/dist/test/Analysis/misc-ps-ranges.m vendor/clang/dist/test/Analysis/misc-ps-region-store-i386.m vendor/clang/dist/test/Analysis/misc-ps-region-store-x86_64.m vendor/clang/dist/test/Analysis/misc-ps-region-store.m vendor/clang/dist/test/Analysis/misc-ps.m vendor/clang/dist/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m vendor/clang/dist/test/Analysis/no-exit-cfg.c vendor/clang/dist/test/Analysis/no-outofbounds.c vendor/clang/dist/test/Analysis/null-deref-ps-region.c vendor/clang/dist/test/Analysis/null-deref-ps.c vendor/clang/dist/test/Analysis/outofbound.c vendor/clang/dist/test/Analysis/override-werror.c vendor/clang/dist/test/Analysis/plist-output.m vendor/clang/dist/test/Analysis/pr4209.m vendor/clang/dist/test/Analysis/pr_2542_rdar_6793404.m vendor/clang/dist/test/Analysis/pr_4164.c vendor/clang/dist/test/Analysis/ptr-arith.c vendor/clang/dist/test/Analysis/rdar-6442306-1.m vendor/clang/dist/test/Analysis/rdar-6540084.m vendor/clang/dist/test/Analysis/rdar-6541136-region.c vendor/clang/dist/test/Analysis/rdar-6541136.c vendor/clang/dist/test/Analysis/rdar-6562655.m vendor/clang/dist/test/Analysis/rdar-6582778-basic-store.c vendor/clang/dist/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m vendor/clang/dist/test/Analysis/rdar-7168531.m vendor/clang/dist/test/Analysis/refcnt_naming.m vendor/clang/dist/test/Analysis/region-1.m vendor/clang/dist/test/Analysis/retain-release-basic-store.m vendor/clang/dist/test/Analysis/retain-release-gc-only.m vendor/clang/dist/test/Analysis/retain-release-region-store.m vendor/clang/dist/test/Analysis/retain-release.m vendor/clang/dist/test/Analysis/security-syntax-checks.m vendor/clang/dist/test/Analysis/sizeofpointer.c vendor/clang/dist/test/Analysis/stack-addr-ps.c vendor/clang/dist/test/Analysis/uninit-msg-expr.m vendor/clang/dist/test/Analysis/uninit-ps-rdar6145427.m vendor/clang/dist/test/Analysis/uninit-vals-ps-region.c vendor/clang/dist/test/Analysis/uninit-vals-ps.c vendor/clang/dist/test/Analysis/uninit-vals.c vendor/clang/dist/test/Analysis/uninit-vals.m vendor/clang/dist/test/Analysis/unions-region.m vendor/clang/dist/test/Analysis/unused-ivars.m vendor/clang/dist/test/CMakeLists.txt vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p3-cxx0x.cpp vendor/clang/dist/test/CXX/special/class.free/p6.cpp vendor/clang/dist/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp vendor/clang/dist/test/CodeCompletion/function-templates.cpp vendor/clang/dist/test/CodeCompletion/member-access.cpp vendor/clang/dist/test/CodeCompletion/objc-message.m vendor/clang/dist/test/CodeCompletion/templates.cpp vendor/clang/dist/test/CodeGen/2008-08-25-incompatible-cond-expr.m vendor/clang/dist/test/CodeGen/2009-01-21-invalid-debug-info.m vendor/clang/dist/test/CodeGen/arm_asm_clobber.c vendor/clang/dist/test/CodeGen/exprs.c vendor/clang/dist/test/CodeGen/function-decay.m vendor/clang/dist/test/CodeGen/object-size.c vendor/clang/dist/test/CodeGen/rdr-6732143-dangling-block-reference.m vendor/clang/dist/test/CodeGenCXX/class-layout.cpp vendor/clang/dist/test/CodeGenCXX/constructor-template.cpp vendor/clang/dist/test/CodeGenCXX/debug-info.cpp vendor/clang/dist/test/CodeGenCXX/eh.cpp vendor/clang/dist/test/CodeGenCXX/mangle-subst-std.cpp vendor/clang/dist/test/CodeGenCXX/mangle.cpp vendor/clang/dist/test/CodeGenCXX/member-function-pointers.cpp vendor/clang/dist/test/CodeGenCXX/predefined-expr.cpp vendor/clang/dist/test/CodeGenCXX/references.cpp vendor/clang/dist/test/CodeGenCXX/rtti.cpp vendor/clang/dist/test/CodeGenCXX/static-assert.cpp vendor/clang/dist/test/CodeGenCXX/static-init.cpp vendor/clang/dist/test/CodeGenCXX/virt-dtor-key.cpp vendor/clang/dist/test/CodeGenCXX/virt.cpp vendor/clang/dist/test/CodeGenObjC/2008-10-23-invalid-icmp.m vendor/clang/dist/test/CodeGenObjC/PR4541.m vendor/clang/dist/test/CodeGenObjC/PR4894-recursive-debug-crash.m vendor/clang/dist/test/CodeGenObjC/bitfield-1.m vendor/clang/dist/test/CodeGenObjC/bitfield-ivar-metadata.m vendor/clang/dist/test/CodeGenObjC/bitfield-ivar-offsets.m vendor/clang/dist/test/CodeGenObjC/blocks-1.m vendor/clang/dist/test/CodeGenObjC/blocks-2.m vendor/clang/dist/test/CodeGenObjC/blocks-3.m vendor/clang/dist/test/CodeGenObjC/blocks.m vendor/clang/dist/test/CodeGenObjC/category-super-class-meth.m vendor/clang/dist/test/CodeGenObjC/class-getter-dotsyntax.m vendor/clang/dist/test/CodeGenObjC/class-type.m vendor/clang/dist/test/CodeGenObjC/compatibility-alias.m vendor/clang/dist/test/CodeGenObjC/constant-strings.m vendor/clang/dist/test/CodeGenObjC/continuation-class.m vendor/clang/dist/test/CodeGenObjC/deadcode_strip_used_var.m vendor/clang/dist/test/CodeGenObjC/debug-info-linkagename.m vendor/clang/dist/test/CodeGenObjC/dot-syntax-1.m vendor/clang/dist/test/CodeGenObjC/dot-syntax.m vendor/clang/dist/test/CodeGenObjC/encode-test-1.m vendor/clang/dist/test/CodeGenObjC/encode-test-2.m vendor/clang/dist/test/CodeGenObjC/encode-test-3.m vendor/clang/dist/test/CodeGenObjC/encode-test-4.m vendor/clang/dist/test/CodeGenObjC/encode-test-5.m vendor/clang/dist/test/CodeGenObjC/encode-test.m vendor/clang/dist/test/CodeGenObjC/for-in.m vendor/clang/dist/test/CodeGenObjC/forward-class-impl-metadata.m vendor/clang/dist/test/CodeGenObjC/hidden-visibility.m vendor/clang/dist/test/CodeGenObjC/hidden.m vendor/clang/dist/test/CodeGenObjC/image-info.m vendor/clang/dist/test/CodeGenObjC/implicit-objc_msgSend.m vendor/clang/dist/test/CodeGenObjC/implicit-property.m vendor/clang/dist/test/CodeGenObjC/interface-layout-64.m vendor/clang/dist/test/CodeGenObjC/interface.m vendor/clang/dist/test/CodeGenObjC/ivar-layout-64-bitfields.m vendor/clang/dist/test/CodeGenObjC/ivar-layout-64.m vendor/clang/dist/test/CodeGenObjC/ivar-layout-no-optimize.m vendor/clang/dist/test/CodeGenObjC/ivars.m vendor/clang/dist/test/CodeGenObjC/link-errors.m vendor/clang/dist/test/CodeGenObjC/message-arrays.m vendor/clang/dist/test/CodeGenObjC/messages-2.m vendor/clang/dist/test/CodeGenObjC/messages.m vendor/clang/dist/test/CodeGenObjC/metadata-symbols-32.m vendor/clang/dist/test/CodeGenObjC/metadata-symbols-64.m vendor/clang/dist/test/CodeGenObjC/metadata_symbols.m vendor/clang/dist/test/CodeGenObjC/missing-atend-metadata.m vendor/clang/dist/test/CodeGenObjC/newproperty-nested-synthesis-1.m vendor/clang/dist/test/CodeGenObjC/no-category-class.m vendor/clang/dist/test/CodeGenObjC/non-lazy-classes.m vendor/clang/dist/test/CodeGenObjC/objc-align.m vendor/clang/dist/test/CodeGenObjC/objc-assign-ivar.m vendor/clang/dist/test/CodeGenObjC/objc-gc-aggr-assign.m vendor/clang/dist/test/CodeGenObjC/objc-read-weak-byref.m vendor/clang/dist/test/CodeGenObjC/objc2-assign-global.m vendor/clang/dist/test/CodeGenObjC/objc2-ivar-assign.m vendor/clang/dist/test/CodeGenObjC/objc2-new-gc-api-strongcast.m vendor/clang/dist/test/CodeGenObjC/objc2-no-strong-cast.m vendor/clang/dist/test/CodeGenObjC/objc2-no-write-barrier.m vendor/clang/dist/test/CodeGenObjC/objc2-property-encode.m vendor/clang/dist/test/CodeGenObjC/objc2-protocol-enc.m vendor/clang/dist/test/CodeGenObjC/objc2-retain-codegen.m vendor/clang/dist/test/CodeGenObjC/objc2-strong-cast-1.m vendor/clang/dist/test/CodeGenObjC/objc2-strong-cast.m vendor/clang/dist/test/CodeGenObjC/objc2-weak-assign.m vendor/clang/dist/test/CodeGenObjC/objc2-weak-compare.m vendor/clang/dist/test/CodeGenObjC/objc2-weak-import-attribute.m vendor/clang/dist/test/CodeGenObjC/objc2-weak-ivar-debug.m vendor/clang/dist/test/CodeGenObjC/objc2-weak-ivar.m vendor/clang/dist/test/CodeGenObjC/objc2-write-barrier-2.m vendor/clang/dist/test/CodeGenObjC/objc2-write-barrier-3.m vendor/clang/dist/test/CodeGenObjC/objc2-write-barrier-4.m vendor/clang/dist/test/CodeGenObjC/objc2-write-barrier-5.m vendor/clang/dist/test/CodeGenObjC/objc2-write-barrier.m vendor/clang/dist/test/CodeGenObjC/object-incr-decr-1.m vendor/clang/dist/test/CodeGenObjC/overloadable.m vendor/clang/dist/test/CodeGenObjC/predefined-expr.m vendor/clang/dist/test/CodeGenObjC/property-aggr-type.m vendor/clang/dist/test/CodeGenObjC/property-agrr-getter.m vendor/clang/dist/test/CodeGenObjC/property-complex.m vendor/clang/dist/test/CodeGenObjC/property-getter-dot-syntax.m vendor/clang/dist/test/CodeGenObjC/property-incr-decr-1.m vendor/clang/dist/test/CodeGenObjC/property-setter-attr.m vendor/clang/dist/test/CodeGenObjC/property.m vendor/clang/dist/test/CodeGenObjC/protocol-in-extended-class.m vendor/clang/dist/test/CodeGenObjC/protocol-property-synth.m vendor/clang/dist/test/CodeGenObjC/protocols-lazy.m vendor/clang/dist/test/CodeGenObjC/protocols.m vendor/clang/dist/test/CodeGenObjC/runtime-fns.m vendor/clang/dist/test/CodeGenObjC/sel-as-builtin-type.m vendor/clang/dist/test/CodeGenObjC/super-classmethod-category.m vendor/clang/dist/test/CodeGenObjC/super-dotsyntax-property.m vendor/clang/dist/test/CodeGenObjC/super-message-fragileabi.m vendor/clang/dist/test/CodeGenObjC/synchronized.m vendor/clang/dist/test/CodeGenObjC/synthesize_ivar-cont-class.m vendor/clang/dist/test/CodeGenObjC/synthesize_ivar.m vendor/clang/dist/test/CodeGenObjC/try.m vendor/clang/dist/test/CodeGenObjC/undefined-protocol.m vendor/clang/dist/test/CodeGenObjC/unname-bf-metadata.m vendor/clang/dist/test/CodeGenObjC/variadic-sends.m vendor/clang/dist/test/Coverage/ast-printing.m vendor/clang/dist/test/Coverage/codegen-gnu.m vendor/clang/dist/test/Coverage/codegen-next.m vendor/clang/dist/test/Coverage/parse-callbacks.m vendor/clang/dist/test/Driver/ccc-add-args.c vendor/clang/dist/test/Driver/clang-translation.c vendor/clang/dist/test/Driver/clang_f_opts.c vendor/clang/dist/test/Driver/cxx-pth.cpp vendor/clang/dist/test/Driver/dragonfly.c vendor/clang/dist/test/Driver/freebsd.c vendor/clang/dist/test/Driver/hello.c vendor/clang/dist/test/Driver/openbsd.c vendor/clang/dist/test/Driver/parsing.c vendor/clang/dist/test/Driver/pth.c vendor/clang/dist/test/Driver/qa_override.c vendor/clang/dist/test/FixIt/fixit-objc.m vendor/clang/dist/test/Index/TestClassDecl.m vendor/clang/dist/test/Index/TestClassForwardDecl.m vendor/clang/dist/test/Index/c-index-api-fn-scan.m vendor/clang/dist/test/Index/c-index-api-loadTU-test.m vendor/clang/dist/test/Index/c-index-getCursor-test.m vendor/clang/dist/test/Index/code-completion.cpp vendor/clang/dist/test/Index/complete-objc-message.m vendor/clang/dist/test/Index/objc-decls.m vendor/clang/dist/test/Index/objc-message.m vendor/clang/dist/test/Misc/message-length.c vendor/clang/dist/test/PCH/method_pool.m vendor/clang/dist/test/PCH/objc_exprs.m vendor/clang/dist/test/PCH/objc_import.m vendor/clang/dist/test/PCH/objc_methods.m vendor/clang/dist/test/PCH/objc_property.m vendor/clang/dist/test/Parser/check-objc2-syntax-1.m vendor/clang/dist/test/Parser/check-syntax-1.m vendor/clang/dist/test/Parser/cxx-decl.cpp vendor/clang/dist/test/Parser/cxx-friend.cpp vendor/clang/dist/test/Parser/cxx-using-declaration.cpp vendor/clang/dist/test/Parser/encode.m vendor/clang/dist/test/Parser/enhanced-proto-1.m vendor/clang/dist/test/Parser/expressions.m vendor/clang/dist/test/Parser/method-prototype-1.m vendor/clang/dist/test/Parser/objc-alias-printing.m vendor/clang/dist/test/Parser/objc-category-neg-1.m vendor/clang/dist/test/Parser/objc-forcollection-1.m vendor/clang/dist/test/Parser/objc-forcollection-neg-2.m vendor/clang/dist/test/Parser/objc-forcollection-neg.m vendor/clang/dist/test/Parser/objc-foreach-syntax.m vendor/clang/dist/test/Parser/objc-init.m vendor/clang/dist/test/Parser/objc-interfaces.m vendor/clang/dist/test/Parser/objc-messaging-1.m vendor/clang/dist/test/Parser/objc-messaging-neg-1.m vendor/clang/dist/test/Parser/objc-missing-impl.m vendor/clang/dist/test/Parser/objc-property-syntax.m vendor/clang/dist/test/Parser/objc-quirks.m vendor/clang/dist/test/Parser/objc-synthesized-recover.m vendor/clang/dist/test/Parser/objc-try-catch-1.m vendor/clang/dist/test/Parser/objc-type-printing.m vendor/clang/dist/test/Parser/prefix-attributes.m vendor/clang/dist/test/Parser/selector-1.m vendor/clang/dist/test/Preprocessor/dump_macros.c vendor/clang/dist/test/Preprocessor/header_lookup1.c vendor/clang/dist/test/Preprocessor/macro_fn_disable_expand.c vendor/clang/dist/test/Preprocessor/non_fragile_feature.m vendor/clang/dist/test/Preprocessor/non_fragile_feature1.m vendor/clang/dist/test/Preprocessor/objc-pp.m vendor/clang/dist/test/Rewriter/block-test.c vendor/clang/dist/test/Rewriter/crash.m vendor/clang/dist/test/Rewriter/finally.m vendor/clang/dist/test/Rewriter/id-test-3.m vendor/clang/dist/test/Rewriter/ivar-encoding-1.m vendor/clang/dist/test/Rewriter/ivar-encoding-2.m vendor/clang/dist/test/Rewriter/metadata-test-1.m vendor/clang/dist/test/Rewriter/metadata-test-2.m vendor/clang/dist/test/Rewriter/method-encoding-1.m vendor/clang/dist/test/Rewriter/objc-encoding-bug-1.m vendor/clang/dist/test/Rewriter/objc-ivar-receiver-1.m vendor/clang/dist/test/Rewriter/objc-string-concat-1.m vendor/clang/dist/test/Rewriter/objc-super-test.m vendor/clang/dist/test/Rewriter/objc-synchronized-1.m vendor/clang/dist/test/Rewriter/properties.m vendor/clang/dist/test/Rewriter/protocol-rewrite-1.m vendor/clang/dist/test/Rewriter/rewrite-api-bug.m vendor/clang/dist/test/Rewriter/rewrite-foreach-1.m vendor/clang/dist/test/Rewriter/rewrite-foreach-2.m vendor/clang/dist/test/Rewriter/rewrite-foreach-3.m vendor/clang/dist/test/Rewriter/rewrite-foreach-4.m vendor/clang/dist/test/Rewriter/rewrite-foreach-5.m vendor/clang/dist/test/Rewriter/rewrite-foreach-6.m vendor/clang/dist/test/Rewriter/rewrite-nest.m vendor/clang/dist/test/Rewriter/rewrite-protocol-type-1.m vendor/clang/dist/test/Rewriter/rewrite-try-catch.m vendor/clang/dist/test/Rewriter/static-type-protocol-1.m vendor/clang/dist/test/Rewriter/undecl-objc-h.m vendor/clang/dist/test/Rewriter/undeclared-method-1.m vendor/clang/dist/test/Rewriter/undef-field-reference-1.m vendor/clang/dist/test/Rewriter/va-method.m vendor/clang/dist/test/Sema/block-as-object.m vendor/clang/dist/test/Sema/builtin-prefetch.c vendor/clang/dist/test/Sema/compare.c vendor/clang/dist/test/Sema/exprs.c vendor/clang/dist/test/Sema/init.c vendor/clang/dist/test/Sema/ms-fuzzy-asm.c vendor/clang/dist/test/Sema/nested-redef.c vendor/clang/dist/test/Sema/rdar6248119.m vendor/clang/dist/test/Sema/return.c vendor/clang/dist/test/Sema/vector-init.c vendor/clang/dist/test/SemaCXX/attr-cxx0x.cpp vendor/clang/dist/test/SemaCXX/compare.cpp vendor/clang/dist/test/SemaCXX/convert-to-bool.cpp vendor/clang/dist/test/SemaCXX/decl-init-ref.cpp vendor/clang/dist/test/SemaCXX/default-assignment-operator.cpp vendor/clang/dist/test/SemaCXX/enum.cpp vendor/clang/dist/test/SemaCXX/exception-spec.cpp vendor/clang/dist/test/SemaCXX/friend.cpp vendor/clang/dist/test/SemaCXX/i-c-e-cxx.cpp vendor/clang/dist/test/SemaCXX/linkage-spec.cpp vendor/clang/dist/test/SemaCXX/member-expr.cpp vendor/clang/dist/test/SemaCXX/nested-name-spec.cpp vendor/clang/dist/test/SemaCXX/new-delete.cpp vendor/clang/dist/test/SemaCXX/offsetof.cpp vendor/clang/dist/test/SemaCXX/overload-call-copycon.cpp vendor/clang/dist/test/SemaCXX/overload-call.cpp vendor/clang/dist/test/SemaCXX/overloaded-operator.cpp vendor/clang/dist/test/SemaCXX/qualified-id-lookup.cpp vendor/clang/dist/test/SemaCXX/ref-init-ambiguous.cpp vendor/clang/dist/test/SemaCXX/references.cpp vendor/clang/dist/test/SemaCXX/rval-references.cpp vendor/clang/dist/test/SemaCXX/type-traits.cpp vendor/clang/dist/test/SemaCXX/using-decl-1.cpp vendor/clang/dist/test/SemaCXX/using-decl-templates.cpp vendor/clang/dist/test/SemaCXX/using-directive.cpp vendor/clang/dist/test/SemaCXX/vararg-non-pod.cpp vendor/clang/dist/test/SemaCXX/virtual-override.cpp vendor/clang/dist/test/SemaObjC/ContClassPropertyLookup.m vendor/clang/dist/test/SemaObjC/DoubleMethod.m vendor/clang/dist/test/SemaObjC/access-property-getter.m vendor/clang/dist/test/SemaObjC/alias-test-1.m vendor/clang/dist/test/SemaObjC/alias-test-2.m vendor/clang/dist/test/SemaObjC/argument-checking.m vendor/clang/dist/test/SemaObjC/at-defs.m vendor/clang/dist/test/SemaObjC/atomoic-property-synnthesis-rules.m vendor/clang/dist/test/SemaObjC/attr-cleanup.m vendor/clang/dist/test/SemaObjC/attr-deprecated.m vendor/clang/dist/test/SemaObjC/attr-malloc.m vendor/clang/dist/test/SemaObjC/attr-objc-exception.m vendor/clang/dist/test/SemaObjC/attr-objc-gc.m vendor/clang/dist/test/SemaObjC/bad-receiver-1.m vendor/clang/dist/test/SemaObjC/block-attr.m vendor/clang/dist/test/SemaObjC/block-explicit-return-type.m vendor/clang/dist/test/SemaObjC/block-ivar.m vendor/clang/dist/test/SemaObjC/blocks.m vendor/clang/dist/test/SemaObjC/call-super-2.m vendor/clang/dist/test/SemaObjC/catch-stmt.m vendor/clang/dist/test/SemaObjC/category-1.m vendor/clang/dist/test/SemaObjC/category-method-lookup-2.m vendor/clang/dist/test/SemaObjC/category-method-lookup.m vendor/clang/dist/test/SemaObjC/check-dup-decl-methods-1.m vendor/clang/dist/test/SemaObjC/check-dup-objc-decls-1.m vendor/clang/dist/test/SemaObjC/class-bitfield.m vendor/clang/dist/test/SemaObjC/class-conforming-protocol-1.m vendor/clang/dist/test/SemaObjC/class-conforming-protocol-2.m vendor/clang/dist/test/SemaObjC/class-def-test-1.m vendor/clang/dist/test/SemaObjC/class-extension-dup-methods.m vendor/clang/dist/test/SemaObjC/class-getter-using-dotsyntax.m vendor/clang/dist/test/SemaObjC/class-impl-1.m vendor/clang/dist/test/SemaObjC/class-method-lookup.m vendor/clang/dist/test/SemaObjC/class-method-self.m vendor/clang/dist/test/SemaObjC/class-property-access.m vendor/clang/dist/test/SemaObjC/class-proto-1.m vendor/clang/dist/test/SemaObjC/class-protocol.m vendor/clang/dist/test/SemaObjC/cocoa.m vendor/clang/dist/test/SemaObjC/compare-qualified-id.m vendor/clang/dist/test/SemaObjC/compatible-protocol-qualified-types.m vendor/clang/dist/test/SemaObjC/comptypes-1.m vendor/clang/dist/test/SemaObjC/comptypes-2.m vendor/clang/dist/test/SemaObjC/comptypes-3.m vendor/clang/dist/test/SemaObjC/comptypes-4.m vendor/clang/dist/test/SemaObjC/comptypes-5.m vendor/clang/dist/test/SemaObjC/comptypes-6.m vendor/clang/dist/test/SemaObjC/comptypes-7.m vendor/clang/dist/test/SemaObjC/comptypes-8.m vendor/clang/dist/test/SemaObjC/comptypes-9.m vendor/clang/dist/test/SemaObjC/comptypes-a.m vendor/clang/dist/test/SemaObjC/comptypes-legal.m vendor/clang/dist/test/SemaObjC/conditional-expr-2.m vendor/clang/dist/test/SemaObjC/conditional-expr-3.m vendor/clang/dist/test/SemaObjC/conditional-expr-4.m vendor/clang/dist/test/SemaObjC/conditional-expr-5.m vendor/clang/dist/test/SemaObjC/conditional-expr-6.m vendor/clang/dist/test/SemaObjC/conditional-expr.m vendor/clang/dist/test/SemaObjC/conflicting-ivar-test-1.m vendor/clang/dist/test/SemaObjC/continuation-class-err.m vendor/clang/dist/test/SemaObjC/crash-label.m vendor/clang/dist/test/SemaObjC/deref-interface.m vendor/clang/dist/test/SemaObjC/duplicate-ivar-check.m vendor/clang/dist/test/SemaObjC/enhanced-proto-2.m vendor/clang/dist/test/SemaObjC/error-property-gc-attr.m vendor/clang/dist/test/SemaObjC/exprs.m vendor/clang/dist/test/SemaObjC/foreach.m vendor/clang/dist/test/SemaObjC/format-arg-attribute.m vendor/clang/dist/test/SemaObjC/format-strings-objc.m vendor/clang/dist/test/SemaObjC/forward-class-1.m vendor/clang/dist/test/SemaObjC/forward-class-receiver.m vendor/clang/dist/test/SemaObjC/gcc-cast-ext.m vendor/clang/dist/test/SemaObjC/id-isa-ref.m vendor/clang/dist/test/SemaObjC/id.m vendor/clang/dist/test/SemaObjC/id_builtin.m vendor/clang/dist/test/SemaObjC/idiomatic-parentheses.m vendor/clang/dist/test/SemaObjC/ignore-weakimport-method.m vendor/clang/dist/test/SemaObjC/incompatible-protocol-qualified-types.m vendor/clang/dist/test/SemaObjC/inst-method-lookup-in-root.m vendor/clang/dist/test/SemaObjC/interface-1.m vendor/clang/dist/test/SemaObjC/interface-layout-2.m vendor/clang/dist/test/SemaObjC/interface-layout.m vendor/clang/dist/test/SemaObjC/interface-scope-2.m vendor/clang/dist/test/SemaObjC/interface-scope.m vendor/clang/dist/test/SemaObjC/interface-tu-variable.m vendor/clang/dist/test/SemaObjC/invalid-code.m vendor/clang/dist/test/SemaObjC/invalid-objc-decls-1.m vendor/clang/dist/test/SemaObjC/invalid-receiver.m vendor/clang/dist/test/SemaObjC/invalid-typename.m vendor/clang/dist/test/SemaObjC/ivar-access-package.m vendor/clang/dist/test/SemaObjC/ivar-access-tests.m vendor/clang/dist/test/SemaObjC/ivar-lookup.m vendor/clang/dist/test/SemaObjC/ivar-ref-misuse.m vendor/clang/dist/test/SemaObjC/ivar-sem-check-1.m vendor/clang/dist/test/SemaObjC/ivar-sem-check-2.m vendor/clang/dist/test/SemaObjC/legacy-implementation-1.m vendor/clang/dist/test/SemaObjC/message.m vendor/clang/dist/test/SemaObjC/method-arg-decay.m vendor/clang/dist/test/SemaObjC/method-attributes.m vendor/clang/dist/test/SemaObjC/method-bad-param.m vendor/clang/dist/test/SemaObjC/method-conflict.m vendor/clang/dist/test/SemaObjC/method-def-1.m vendor/clang/dist/test/SemaObjC/method-def-2.m vendor/clang/dist/test/SemaObjC/method-encoding-2.m vendor/clang/dist/test/SemaObjC/method-lookup-2.m vendor/clang/dist/test/SemaObjC/method-lookup-3.m vendor/clang/dist/test/SemaObjC/method-lookup-4.m vendor/clang/dist/test/SemaObjC/method-lookup.m vendor/clang/dist/test/SemaObjC/method-no-context.m vendor/clang/dist/test/SemaObjC/method-not-defined.m vendor/clang/dist/test/SemaObjC/method-sentinel-attr.m vendor/clang/dist/test/SemaObjC/method-typecheck-1.m vendor/clang/dist/test/SemaObjC/method-typecheck-2.m vendor/clang/dist/test/SemaObjC/method-undef-category-warn-1.m vendor/clang/dist/test/SemaObjC/method-undef-extension-warn-1.m vendor/clang/dist/test/SemaObjC/method-undefined-warn-1.m vendor/clang/dist/test/SemaObjC/missing-method-context.m vendor/clang/dist/test/SemaObjC/newproperty-class-method-1.m vendor/clang/dist/test/SemaObjC/no-gc-weak-test.m vendor/clang/dist/test/SemaObjC/no-warn-qual-mismatch.m vendor/clang/dist/test/SemaObjC/no-warn-synth-protocol-meth.m vendor/clang/dist/test/SemaObjC/no-warn-unimpl-method.m vendor/clang/dist/test/SemaObjC/nonnull.m vendor/clang/dist/test/SemaObjC/nsobject-attribute-1.m vendor/clang/dist/test/SemaObjC/nsobject-attribute.m vendor/clang/dist/test/SemaObjC/objc-string-constant.m vendor/clang/dist/test/SemaObjC/objc2-merge-gc-attribue-decl.m vendor/clang/dist/test/SemaObjC/objc2-warn-weak-decl.m vendor/clang/dist/test/SemaObjC/property-10.m vendor/clang/dist/test/SemaObjC/property-11.m vendor/clang/dist/test/SemaObjC/property-12.m vendor/clang/dist/test/SemaObjC/property-13.m vendor/clang/dist/test/SemaObjC/property-2.m vendor/clang/dist/test/SemaObjC/property-3.m vendor/clang/dist/test/SemaObjC/property-4.m vendor/clang/dist/test/SemaObjC/property-5.m vendor/clang/dist/test/SemaObjC/property-6.m vendor/clang/dist/test/SemaObjC/property-7.m vendor/clang/dist/test/SemaObjC/property-8.m vendor/clang/dist/test/SemaObjC/property-9-impl-method.m vendor/clang/dist/test/SemaObjC/property-9.m vendor/clang/dist/test/SemaObjC/property-category-1.m vendor/clang/dist/test/SemaObjC/property-category-2.m vendor/clang/dist/test/SemaObjC/property-category-3.m vendor/clang/dist/test/SemaObjC/property-category-4.m vendor/clang/dist/test/SemaObjC/property-error-readonly-assign.m vendor/clang/dist/test/SemaObjC/property-expression-error.m vendor/clang/dist/test/SemaObjC/property-impl-misuse.m vendor/clang/dist/test/SemaObjC/property-inherited.m vendor/clang/dist/test/SemaObjC/property-ivar-mismatch.m vendor/clang/dist/test/SemaObjC/property-method-lookup-impl.m vendor/clang/dist/test/SemaObjC/property-missing.m vendor/clang/dist/test/SemaObjC/property-nonfragile-abi.m vendor/clang/dist/test/SemaObjC/property-noprotocol-warning.m vendor/clang/dist/test/SemaObjC/property-redundant-decl-accessor.m vendor/clang/dist/test/SemaObjC/property-typecheck-1.m vendor/clang/dist/test/SemaObjC/property-user-setter.m vendor/clang/dist/test/SemaObjC/property-weak.m vendor/clang/dist/test/SemaObjC/property.m vendor/clang/dist/test/SemaObjC/props-on-prots.m vendor/clang/dist/test/SemaObjC/protocol-archane.m vendor/clang/dist/test/SemaObjC/protocol-attribute.m vendor/clang/dist/test/SemaObjC/protocol-expr-1.m vendor/clang/dist/test/SemaObjC/protocol-expr-neg-1.m vendor/clang/dist/test/SemaObjC/protocol-id-test-1.m vendor/clang/dist/test/SemaObjC/protocol-id-test-2.m vendor/clang/dist/test/SemaObjC/protocol-id-test-3.m vendor/clang/dist/test/SemaObjC/protocol-implementation-inherited.m vendor/clang/dist/test/SemaObjC/protocol-lookup-2.m vendor/clang/dist/test/SemaObjC/protocol-lookup.m vendor/clang/dist/test/SemaObjC/protocol-qualified-class-unsupported.m vendor/clang/dist/test/SemaObjC/protocol-typecheck.m vendor/clang/dist/test/SemaObjC/protocols.m vendor/clang/dist/test/SemaObjC/rdr-6211479-array-property.m vendor/clang/dist/test/SemaObjC/return.m vendor/clang/dist/test/SemaObjC/scope-check.m vendor/clang/dist/test/SemaObjC/selector-1.m vendor/clang/dist/test/SemaObjC/selector-error.m vendor/clang/dist/test/SemaObjC/selector-overload.m vendor/clang/dist/test/SemaObjC/sizeof-interface.m vendor/clang/dist/test/SemaObjC/static-ivar-ref-1.m vendor/clang/dist/test/SemaObjC/stmts.m vendor/clang/dist/test/SemaObjC/string.m vendor/clang/dist/test/SemaObjC/super-cat-prot.m vendor/clang/dist/test/SemaObjC/super-property-message-expr.m vendor/clang/dist/test/SemaObjC/super-property-notation.m vendor/clang/dist/test/SemaObjC/super.m vendor/clang/dist/test/SemaObjC/synchronized.m vendor/clang/dist/test/SemaObjC/synthesize-setter-contclass.m vendor/clang/dist/test/SemaObjC/synthesized-ivar.m vendor/clang/dist/test/SemaObjC/try-catch.m vendor/clang/dist/test/SemaObjC/typedef-class.m vendor/clang/dist/test/SemaObjC/ucn-objc-string.m vendor/clang/dist/test/SemaObjC/undeclared-selector.m vendor/clang/dist/test/SemaObjC/undef-class-messagin-error.m vendor/clang/dist/test/SemaObjC/undef-protocol-methods-1.m vendor/clang/dist/test/SemaObjC/undef-superclass-1.m vendor/clang/dist/test/SemaObjC/undefined-protocol-type-1.m vendor/clang/dist/test/SemaObjC/unused.m vendor/clang/dist/test/SemaObjC/va-method-1.m vendor/clang/dist/test/SemaObjC/warn-assign-property-nscopying.m vendor/clang/dist/test/SemaObjC/warn-selector-selection.m vendor/clang/dist/test/SemaObjC/warn-superclass-method-mismatch.m vendor/clang/dist/test/SemaObjC/warn-weak-field.m vendor/clang/dist/test/SemaObjC/weak-attr-ivar.m vendor/clang/dist/test/SemaObjC/writable-property-in-superclass.m vendor/clang/dist/test/SemaObjCXX/blocks.mm vendor/clang/dist/test/SemaObjCXX/linkage-spec.mm vendor/clang/dist/test/SemaObjCXX/objc-decls-inside-namespace.mm vendor/clang/dist/test/SemaObjCXX/overload.mm vendor/clang/dist/test/SemaObjCXX/protocol-lookup.mm vendor/clang/dist/test/SemaObjCXX/references.mm vendor/clang/dist/test/SemaObjCXX/reserved-keyword-selectors.mm vendor/clang/dist/test/SemaObjCXX/vararg-non-pod.mm vendor/clang/dist/test/SemaObjCXX/void_to_obj.mm vendor/clang/dist/test/SemaTemplate/class-template-id.cpp vendor/clang/dist/test/SemaTemplate/constructor-template.cpp vendor/clang/dist/test/SemaTemplate/friend-template.cpp vendor/clang/dist/test/SemaTemplate/instantiate-expr-1.cpp vendor/clang/dist/test/SemaTemplate/instantiate-expr-4.cpp vendor/clang/dist/test/SemaTemplate/instantiate-function-1.mm vendor/clang/dist/test/SemaTemplate/instantiate-method.cpp vendor/clang/dist/test/SemaTemplate/instantiate-objc-1.mm vendor/clang/dist/test/SemaTemplate/instantiate-static-var.cpp vendor/clang/dist/test/SemaTemplate/instantiate-using-decl.cpp vendor/clang/dist/test/SemaTemplate/qualified-id.cpp vendor/clang/dist/test/lit.cfg vendor/clang/dist/tools/CIndex/CIndex.cpp vendor/clang/dist/tools/CIndex/CIndex.exports vendor/clang/dist/tools/CIndex/CMakeLists.txt vendor/clang/dist/tools/CIndex/Makefile vendor/clang/dist/tools/CMakeLists.txt vendor/clang/dist/tools/Makefile vendor/clang/dist/tools/c-index-test/CMakeLists.txt vendor/clang/dist/tools/c-index-test/Makefile vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/driver/CMakeLists.txt vendor/clang/dist/tools/driver/Makefile vendor/clang/dist/tools/driver/cc1_main.cpp vendor/clang/dist/tools/driver/driver.cpp vendor/clang/dist/tools/index-test/CMakeLists.txt vendor/clang/dist/tools/index-test/Makefile vendor/clang/dist/tools/index-test/index-test.cpp vendor/clang/dist/tools/scan-build/ccc-analyzer vendor/clang/dist/tools/scan-build/scan-build vendor/clang/dist/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg vendor/clang/dist/utils/C++Tests/LLVM-Syntax/lit.local.cfg vendor/clang/dist/utils/clang-completion-mode.el vendor/clang/dist/www/analyzer/installation.html vendor/clang/dist/www/analyzer/latest_checker.html.incl vendor/clang/dist/www/get_started.html vendor/clang/dist/www/hacking.html Modified: vendor/clang/dist/NOTES.txt ============================================================================== --- vendor/clang/dist/NOTES.txt Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/NOTES.txt Tue Dec 15 18:49:47 2009 (r200583) @@ -17,7 +17,7 @@ Creating and using a PTH file for perfor build). $ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache -$ clang-cc -token-cache /tmp/tokencache INPUTS/Cocoa_h.m +$ clang -cc1 -token-cache /tmp/tokencache INPUTS/Cocoa_h.m //===---------------------------------------------------------------------===// Modified: vendor/clang/dist/TODO.txt ============================================================================== --- vendor/clang/dist/TODO.txt Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/TODO.txt Tue Dec 15 18:49:47 2009 (r200583) @@ -65,7 +65,6 @@ More ideas for code modification hints: - If no member of a given name is found in a class/struct, search through the names of entities that do exist in the class and suggest the closest candidate. e.g., if I write "DS.setTypeSpecType", it would suggest "DS.SetTypeSpecType" (edit distance = 1). - If a class member is defined out-of-line but isn't in the class declaration (and there are no close matches!), provide the option to add an in-class declaration. - Fix-it hints for the inclusion of headers when needed for particular features (e.g., for typeid) - - Change "foo.bar" to "foo->bar" when "foo" is a pointer. //===---------------------------------------------------------------------===// Modified: vendor/clang/dist/clang.xcodeproj/project.pbxproj ============================================================================== --- vendor/clang/dist/clang.xcodeproj/project.pbxproj Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/clang.xcodeproj/project.pbxproj Tue Dec 15 18:49:47 2009 (r200583) @@ -37,13 +37,14 @@ 1A6B6CD410693FC900BB4A8F /* CodeCompleteConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */; }; 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */; }; 1A6B6E9A1069833600BB4A8F /* CGExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */; }; - 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6C01F6108128710072DEE4 /* CGRtti.cpp */; }; + 1A6C01F7108128710072DEE4 /* CGRTTI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6C01F6108128710072DEE4 /* CGRTTI.cpp */; }; 1A6FE7090FD6F85800E00CA9 /* CGTemporaries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */; }; 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */; }; 1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7342470C7B57D500122F56 /* CGObjC.cpp */; }; 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A81AA18108144F40094E50B /* CGVtable.cpp */; }; 1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */; }; 1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */; }; + 1A986AB710D0746D00A8EA9E /* CGDeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A986AB610D0746D00A8EA9E /* CGDeclCXX.cpp */; }; 1AA1D91810125DE30078DEBC /* RecordLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA1D91610125DE30078DEBC /* RecordLayoutBuilder.cpp */; }; 1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */; }; 1ADD795410A90C6100741BBA /* TypePrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADD795110A90C6100741BBA /* TypePrinter.cpp */; }; @@ -53,7 +54,6 @@ 1AE4EE3E103B89ED00888A23 /* StmtProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */; }; 1AE4EE40103B8A0A00888A23 /* TargetABIInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */; }; 1AF1B50F109A4FB800AFAFAC /* CGException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF1B50E109A4FB800AFAFAC /* CGException.cpp */; }; - 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */; }; 1AFF8AE31012BFC900D248DA /* CGRecordLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */; }; 3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */; }; 352246E70F5C6BE000D0D279 /* HTMLDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */; }; @@ -279,6 +279,7 @@ DEF7D9F70C9C8B1A0001F598 /* Rewriter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */; }; DEF7D9F90C9C8B1D0001F598 /* Rewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */; }; DEFFECA70DB1546600B4E7C3 /* DeltaTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */; }; + E16B523510D30B2400430AC9 /* cc1_main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E16B523410D30B2400430AC9 /* cc1_main.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -379,7 +380,7 @@ 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCodeComplete.cpp; path = lib/Sema/SemaCodeComplete.cpp; sourceTree = ""; tabWidth = 2; }; 1A6B6CD310693FC900BB4A8F /* SemaTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaTemplate.h; path = lib/Sema/SemaTemplate.h; sourceTree = ""; tabWidth = 2; }; 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprCXX.cpp; path = lib/CodeGen/CGExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; - 1A6C01F6108128710072DEE4 /* CGRtti.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRtti.cpp; path = lib/CodeGen/CGRtti.cpp; sourceTree = ""; tabWidth = 2; }; + 1A6C01F6108128710072DEE4 /* CGRTTI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRTTI.cpp; path = lib/CodeGen/CGRTTI.cpp; sourceTree = ""; tabWidth = 2; }; 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGTemporaries.cpp; path = lib/CodeGen/CGTemporaries.cpp; sourceTree = ""; tabWidth = 2; }; 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = ""; }; 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = ""; }; @@ -396,6 +397,7 @@ 1A81AA5D108278A20094E50B /* CGVtable.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGVtable.h; path = lib/CodeGen/CGVtable.h; sourceTree = ""; tabWidth = 2; }; 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralSupport.h; sourceTree = ""; }; 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = ""; }; + 1A986AB610D0746D00A8EA9E /* CGDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDeclCXX.cpp; path = lib/CodeGen/CGDeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; 1AA1D91610125DE30078DEBC /* RecordLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = RecordLayoutBuilder.cpp; path = lib/AST/RecordLayoutBuilder.cpp; sourceTree = ""; tabWidth = 2; }; 1AA1D91710125DE30078DEBC /* RecordLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = RecordLayoutBuilder.h; path = lib/AST/RecordLayoutBuilder.h; sourceTree = ""; tabWidth = 2; }; 1AB290021045858B00FE33D8 /* PartialDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = PartialDiagnostic.h; sourceTree = ""; tabWidth = 2; }; @@ -408,7 +410,6 @@ 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtProfile.cpp; path = lib/AST/StmtProfile.cpp; sourceTree = ""; tabWidth = 2; }; 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = TargetABIInfo.cpp; path = lib/CodeGen/TargetABIInfo.cpp; sourceTree = ""; tabWidth = 2; }; 1AF1B50E109A4FB800AFAFAC /* CGException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGException.cpp; path = lib/CodeGen/CGException.cpp; sourceTree = ""; tabWidth = 2; }; - 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = "clang-cc.cpp"; path = "tools/clang-cc/clang-cc.cpp"; sourceTree = ""; tabWidth = 2; }; 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRecordLayoutBuilder.cpp; path = lib/CodeGen/CGRecordLayoutBuilder.cpp; sourceTree = ""; tabWidth = 2; }; 1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGRecordLayoutBuilder.h; path = lib/CodeGen/CGRecordLayoutBuilder.h; sourceTree = ""; tabWidth = 2; }; 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCInstMethSignature.cpp; path = lib/Analysis/CheckObjCInstMethSignature.cpp; sourceTree = ""; }; @@ -807,6 +808,7 @@ DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Rewriter.cpp; path = lib/Rewrite/Rewriter.cpp; sourceTree = ""; }; DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeltaTree.h; path = clang/Rewrite/DeltaTree.h; sourceTree = ""; }; DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeltaTree.cpp; path = lib/Rewrite/DeltaTree.cpp; sourceTree = ""; }; + E16B523410D30B2400430AC9 /* cc1_main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cc1_main.cpp; path = tools/driver/cc1_main.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1268,13 +1270,14 @@ 1A4C41BE105B4C0B0047B5E7 /* CGClass.cpp */, 1A5D5E570E5E81010023C059 /* CGCXX.cpp */, 1A649E1E0F9599DA005B965E /* CGCXX.h */, - 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */, 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */, 35A3E7010DD3874400757F74 /* CGDebugInfo.h */, DE4264FB0C113592005A861D /* CGDecl.cpp */, + 1A986AB610D0746D00A8EA9E /* CGDeclCXX.cpp */, 1AF1B50E109A4FB800AFAFAC /* CGException.cpp */, DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */, DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */, + 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */, DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */, 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */, DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */, @@ -1284,7 +1287,7 @@ 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */, 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */, 1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */, - 1A6C01F6108128710072DEE4 /* CGRtti.cpp */, + 1A6C01F6108128710072DEE4 /* CGRTTI.cpp */, DE4772F90C10EAE5002239E8 /* CGStmt.cpp */, 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */, 35475B230E7997680000BFE4 /* CGValue.h */, @@ -1539,23 +1542,15 @@ 90F9EFA8104ABDC400D09A15 /* c-index-test */, 9012911E104812DA0083456D /* CIndex */, 90FD6DB4103D9763005F5B73 /* index-test */, - DEDFE6200F7B3AE90035BD10 /* clang-cc */, DEDFE6210F7B3AF10035BD10 /* clang */, ); name = Tools; sourceTree = ""; }; - DEDFE6200F7B3AE90035BD10 /* clang-cc */ = { - isa = PBXGroup; - children = ( - 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */, - ); - name = "clang-cc"; - sourceTree = ""; - }; DEDFE6210F7B3AF10035BD10 /* clang */ = { isa = PBXGroup; children = ( + E16B523410D30B2400430AC9 /* cc1_main.cpp */, DEDFE6450F7B3B4E0035BD10 /* driver.cpp */, ); name = clang; @@ -1872,7 +1867,6 @@ 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */, 906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */, DEDFF8880F848CF80035BD10 /* TemplateName.cpp in Sources */, - 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */, DEF165710F8FB34D0098507F /* PCHWriter.cpp in Sources */, DEF165750F8FB3510098507F /* PCHReader.cpp in Sources */, DEF168400F9548DC0098507F /* FixItRewriter.cpp in Sources */, @@ -1927,12 +1921,14 @@ 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */, 1A6B6E9A1069833600BB4A8F /* CGExprCXX.cpp in Sources */, 1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */, - 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */, + 1A6C01F7108128710072DEE4 /* CGRTTI.cpp in Sources */, 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */, 1AF1B50F109A4FB800AFAFAC /* CGException.cpp in Sources */, 1ADD795410A90C6100741BBA /* TypePrinter.cpp in Sources */, 1ADD795510A90C6100741BBA /* TypeLoc.cpp in Sources */, 1ADD795610A90C6100741BBA /* TemplateBase.cpp in Sources */, + 1A986AB710D0746D00A8EA9E /* CGDeclCXX.cpp in Sources */, + E16B523510D30B2400430AC9 /* cc1_main.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: vendor/clang/dist/docs/BlockImplementation.txt ============================================================================== --- vendor/clang/dist/docs/BlockImplementation.txt Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/BlockImplementation.txt Tue Dec 15 18:49:47 2009 (r200583) @@ -292,7 +292,7 @@ would be rewritten to be: int flags; //refcount; int size; int captured_i; - } i = { NULL, &i, 0, sizeof(struct _block_byref_i), 11; + } i = { NULL, &i, 0, sizeof(struct _block_byref_i), 11 }; i.forwarding->captured_i = 11; Modified: vendor/clang/dist/docs/LanguageExtensions.html ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.html Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/LanguageExtensions.html Tue Dec 15 18:49:47 2009 (r200583) @@ -23,6 +23,11 @@ td {
          39. Include File Checking Macros
          40. Builtin Macros
          41. Vectors and Extended Vectors
          42. +
          43. Checks for Standard Language Features
          44. +
          45. Blocks
          46. Function Overloading in C
          47. Builtin Functions @@ -194,6 +199,23 @@ href="#__builtin_shufflevector">__builti

            Query for this feature with __has_feature(attribute_ext_vector_type).

            +

            Checks for Standard Language Features

            + + +

            The __has_feature macro can be used to query if certain standard language features are +enabled. Those features are listed here.

            + +

            C++ exceptions

            + +

            Use __has_feature(cxx_exceptions) to determine if C++ exceptions have been enabled. For +example, compiling code with -fexceptions enables C++ exceptions.

            + +

            C++ RTTI

            + +

            Use __has_feature(cxx_rtti) to determine if C++ RTTI has been enabled. For example, +compiling code with -fno-rtti disables the use of RTTI.

            + +

            Blocks

            Modified: vendor/clang/dist/docs/PCHInternals.html ============================================================================== --- vendor/clang/dist/docs/PCHInternals.html Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/PCHInternals.html Tue Dec 15 18:49:47 2009 (r200583) @@ -26,7 +26,7 @@

            Table of Contents

            • Using Precompiled Headers with - clang-cc
            • + clang
            • Design Philosophy
            • Precompiled Header Contents
                @@ -44,15 +44,15 @@ Points
              -

              Using Precompiled Headers with clang-cc

              +

              Using Precompiled Headers with clang

              -

              The low-level Clang compiler, clang-cc, supports two command -line options for generating and using PCH files.

              +

              The Clang compiler frontend, clang -cc1, supports two command line +options for generating and using PCH files.

              -

              To generate PCH files using clang-cc, use the option +

              To generate PCH files using clang -cc1, use the option -emit-pch: -

               $ clang-cc test.h -emit-pch -o test.h.pch 
              +
               $ clang -cc1 test.h -emit-pch -o test.h.pch 

              This option is transparently used by clang when generating PCH files. The resulting PCH file contains the serialized form of the @@ -61,7 +61,7 @@ semantic analysis. The PCH file can then with the -include-pch option:

              -  $ clang-cc -include-pch test.h.pch test.c -o test.s
              +  $ clang -cc1 -include-pch test.h.pch test.c -o test.s
               

              Design Philosophy

              Modified: vendor/clang/dist/docs/PTHInternals.html ============================================================================== --- vendor/clang/dist/docs/PTHInternals.html Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/PTHInternals.html Tue Dec 15 18:49:47 2009 (r200583) @@ -23,38 +23,38 @@ implementation. If you are interested i User's Manual.

              -

              Using Pretokenized Headers with clang-cc (Low-level Interface)

              +

              Using Pretokenized Headers with clang (Low-level Interface)

              -

              The low-level Clang compiler tool, clang-cc, supports three command -line options for generating and using PTH files.

              +

              The Clang compiler frontend, clang -cc1, supports three command line +options for generating and using PTH files.

              -

              To generate PTH files using clang-cc, use the option +

              To generate PTH files using clang -cc1, use the option -emit-pth: -

               $ clang-cc test.h -emit-pth -o test.h.pth 
              +
               $ clang -cc1 test.h -emit-pth -o test.h.pth 

              This option is transparently used by clang when generating PTH files. Similarly, PTH files can be used as prefix headers using the -include-pth option:

              -  $ clang-cc -include-pth test.h.pth test.c -o test.s
              +  $ clang -cc1 -include-pth test.h.pth test.c -o test.s
               

              Alternatively, Clang's PTH files can be used as a raw "token-cache" (or "content" cache) of the source included by the original header file. This means that the contents of the PTH file are searched as substitutes -for any source files that are used by clang-cc to process a +for any source files that are used by clang -cc1 to process a source file. This is done by specifying the -token-cache option:

                 $ cat test.h
                 #include <stdio.h>
              -  $ clang-cc -emit-pth test.h -o test.h.pth
              +  $ clang -cc1 -emit-pth test.h -o test.h.pth
                 $ cat test.c
                 #include "test.h"
              -  $ clang-cc test.c -o test -token-cache test.h.pth
              +  $ clang -cc1 test.c -o test -token-cache test.h.pth
               

              In this example the contents of stdio.h (and the files it includes) @@ -117,7 +117,7 @@ PTH file needs to be generated during a

            • Reduced memory pressure: Similar to GCC, Clang reads PTH files via the use of memory mapping (i.e., mmap). Clang, however, memory maps PTH files as read-only, meaning that multiple -invocations of clang-cc can share the same pages in memory from a +invocations of clang -cc1 can share the same pages in memory from a memory-mapped PTH file. In comparison, GCC also memory maps its PCH files but also modifies those pages in memory, incurring the copy-on-write costs. The read-only nature of PTH can greatly reduce memory pressure for builds involving @@ -160,7 +160,7 @@ optimizations to speed up the processing

              • stat caching: PTH files cache information obtained via -calls to stat that clang-cc uses to resolve which files are +calls to stat that clang -cc1 uses to resolve which files are included by #include directives. This greatly reduces the overhead involved in context-switching to the kernel to resolve included files.

              • Modified: vendor/clang/dist/docs/UsersManual.html ============================================================================== --- vendor/clang/dist/docs/UsersManual.html Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/UsersManual.html Tue Dec 15 18:49:47 2009 (r200583) @@ -40,6 +40,7 @@ td {
              • Controlling Diagnostics via Pragmas
            • Precompiled Headers
            • +
            • Controlling Code Generation
          48. C Language Features @@ -562,6 +563,29 @@ at the time of PCH use requires one of t stat() caching, to be disabled. However, this change is only likely to affect PCH files that reference a large number of headers.

            + +

            Controlling Code Generation

            + + +

            Clang provides a number of ways to control code generation. The options are listed below.

            + + +
            -fcatch-undefined-behavior: Turn +on runtime code generation to check for undefined behavior.
            + +
            This option, which defaults to off, controls whether or not Clang +adds runtime checks for undefined runtime behavior. If the check fails, +__builtin_trap() is used to indicate failure. +The checks are: +

            +

          49. Subscripting where the static type of one operand is decayed from an + array type and the other operand is greater than the size of the array or + less than zero.
          50. +
          51. Shift operators where the amount shifted is greater or equal to the + promoted bit-width of the left-hand-side or less than zero.
          52. +

            +
            +

            C Language Features

            Modified: vendor/clang/dist/docs/libIndex.html ============================================================================== --- vendor/clang/dist/docs/libIndex.html Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/docs/libIndex.html Tue Dec 15 18:49:47 2009 (r200583) @@ -211,8 +211,8 @@ void bar_func(void) { You first get AST files out of t1.c and t2.c:
            -$ clang-cc -emit-pch t1.c -o t1.ast
            -$ clang-cc -emit-pch t2.c -o t2.ast
            +$ clang -emit-ast t1.c -o t1.ast
            +$ clang -emit-ast t2.c -o t2.ast
             

            Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/include/clang-c/Index.h Tue Dec 15 18:49:47 2009 (r200583) @@ -104,6 +104,34 @@ enum CXCursorKind { CXCursor_LastInvalid = 72 }; +/** + * \brief Provides the contents of a file that has not yet been saved to disk. + * + * Each CXUnsavedFile instance provides the name of a file on the + * system along with the current contents of that file that have not + * yet been saved to disk. + */ +struct CXUnsavedFile { + /** + * \brief The file whose contents have not yet been saved. + * + * This file must already exist in the file system. + */ + const char *Filename; + + /** + * \brief A null-terminated buffer containing the unsaved contents + * of this file. + */ + const char *Contents; + + /** + * \brief The length of the unsaved contents of this buffer, not + * counting the NULL at the end of the buffer. + */ + unsigned long Length; +}; + /* A cursor into the CXTranslationUnit. */ typedef struct { @@ -174,8 +202,22 @@ CINDEX_LINKAGE void clang_disposeString( */ CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); -CINDEX_LINKAGE void clang_disposeIndex(CXIndex); -CINDEX_LINKAGE CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); +CINDEX_LINKAGE void clang_disposeIndex(CXIndex index); +CINDEX_LINKAGE CXString +clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); + +/* + * \brief Request that AST's be generated external for API calls which parse + * source code on the fly, e.g. \see createTranslationUnitFromSourceFile. + * + * Note: This is for debugging purposes only, and may be removed at a later + * date. + * + * \param index - The index to update. + * \param value - The new flag value. + */ +CINDEX_LINKAGE void clang_setUseExternalASTGeneration(CXIndex index, + int value); /* * \brief Create a translation unit from an AST file (-emit-ast). @@ -183,6 +225,7 @@ CINDEX_LINKAGE CXString clang_getTransla CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit( CXIndex, const char *ast_filename ); + /** * \brief Destroy the specified CXTranslationUnit object. */ @@ -192,20 +235,25 @@ CINDEX_LINKAGE void clang_disposeTransla * \brief Return the CXTranslationUnit for a given source file and the provided * command line arguments one would pass to the compiler. * - * Note: The 'source_filename' argument is optional. If the caller provides a NULL pointer, - * the name of the source file is expected to reside in the specified command line arguments. + * Note: The 'source_filename' argument is optional. If the caller provides a + * NULL pointer, the name of the source file is expected to reside in the + * specified command line arguments. * - * Note: When encountered in 'clang_command_line_args', the following options are ignored: + * Note: When encountered in 'clang_command_line_args', the following options + * are ignored: * * '-c' * '-emit-ast' * '-fsyntax-only' * '-o ' (both '-o' and '' are ignored) * + * + * \param source_filename - The name of the source file to load, or NULL if the + * source file is included in clang_command_line_args. */ CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile( - CXIndex CIdx, - const char *source_filename /* specify NULL if the source file is in clang_command_line_args */, + CXIndex CIdx, + const char *source_filename, int num_clang_command_line_args, const char **clang_command_line_args ); @@ -225,13 +273,14 @@ CINDEX_LINKAGE CXTranslationUnit clang_c } static void usage { clang_loadTranslationUnit(CXTranslationUnit, printObjCInterfaceNames); - } + } */ typedef void *CXClientData; typedef void (*CXTranslationUnitIterator)(CXTranslationUnit, CXCursor, CXClientData); -CINDEX_LINKAGE void clang_loadTranslationUnit(CXTranslationUnit, CXTranslationUnitIterator, - CXClientData); +CINDEX_LINKAGE void clang_loadTranslationUnit(CXTranslationUnit, + CXTranslationUnitIterator, + CXClientData); /* Usage: clang_loadDeclaration(). Will load the declaration, issuing a @@ -292,8 +341,9 @@ CINDEX_LINKAGE CXFile clang_getDeclSourc Usage: clang_getCursor() will translate a source/line/column position into an AST cursor (to derive semantic information from the source code). */ -CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, const char *source_name, - unsigned line, unsigned column); +CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, + const char *source_name, + unsigned line, unsigned column); CINDEX_LINKAGE CXCursor clang_getNullCursor(void); @@ -606,11 +656,11 @@ clang_getNumCompletionChunks(CXCompletio * \param CIdx the \c CXIndex instance that will be used to perform code * completion. * - * \param source_filename the name of the source file that should be parsed - * to perform code-completion. This source file must be the same as or - * include the filename described by \p complete_filename, or no code-completion - * results will be produced. NOTE: One can also specify NULL for this argument if - * the source file is included in command_line_args. + * \param source_filename the name of the source file that should be parsed to + * perform code-completion. This source file must be the same as or include the + * filename described by \p complete_filename, or no code-completion results + * will be produced. NOTE: One can also specify NULL for this argument if the + * source file is included in command_line_args. * * \param num_command_line_args the number of command-line arguments stored in * \p command_line_args. @@ -621,6 +671,13 @@ clang_getNumCompletionChunks(CXCompletio * includes, etc., but should not include any information specific to * code completion. * + * \param num_unsaved_files the number of unsaved file entries in \p + * unsaved_files. + * + * \param unsaved_files the files that have not yet been saved to disk + * but may be required for code completion, including the contents of + * those files. + * * \param complete_filename the name of the source file where code completion * should be performed. In many cases, this name will be the same as the * source filename. However, the completion filename may also be a file @@ -643,6 +700,8 @@ CINDEX_LINKAGE void clang_codeComplete(C const char *source_filename, int num_command_line_args, const char **command_line_args, + unsigned num_unsaved_files, + struct CXUnsavedFile *unsaved_files, const char *complete_filename, unsigned complete_line, unsigned complete_column, Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Tue Dec 15 18:49:47 2009 (r200583) @@ -45,6 +45,8 @@ namespace clang { class SourceManager; class TargetInfo; // Decls + class CXXMethodDecl; + class CXXRecordDecl; class Decl; class FieldDecl; class ObjCIvarDecl; @@ -57,6 +59,7 @@ namespace clang { class TypeDecl; class TypedefDecl; class UsingDecl; + class UsingShadowDecl; namespace Builtin { class Context; } @@ -105,6 +108,9 @@ class ASTContext { llvm::DenseMap ASTRecordLayouts; llvm::DenseMap ObjCLayouts; + /// KeyFunctions - A cache mapping from CXXRecordDecls to key functions. + llvm::DenseMap KeyFunctions; + /// \brief Mapping from ObjCContainers to their ObjCImplementations. llvm::DenseMap ObjCImpls; @@ -183,8 +189,10 @@ class ASTContext { llvm::DenseMap InstantiatedFromStaticDataMember; - /// \brief Keeps track of the UnresolvedUsingDecls from which UsingDecls - /// where created during instantiation. + /// \brief Keeps track of the declaration from which a UsingDecl was + /// created during instantiation. The source declaration is always + /// a UsingDecl, an UnresolvedUsingValueDecl, or an + /// UnresolvedUsingTypenameDecl. /// /// For example: /// \code @@ -203,8 +211,10 @@ class ASTContext { /// /// This mapping will contain an entry that maps from the UsingDecl in /// B to the UnresolvedUsingDecl in B. - llvm::DenseMap - InstantiatedFromUnresolvedUsingDecl; + llvm::DenseMap InstantiatedFromUsingDecl; + + llvm::DenseMap + InstantiatedFromUsingShadowDecl; llvm::DenseMap InstantiatedFromUnnamedFieldDecl; @@ -282,14 +292,18 @@ public: void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK); - /// \brief If this using decl is instantiated from an unresolved using decl, + /// \brief If the given using decl is an instantiation of a + /// (possibly unresolved) using decl from a template instantiation, /// return it. - NamedDecl *getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD); - - /// \brief Note that the using decl \p Inst is an instantiation of - /// the unresolved using decl \p Tmpl of a class template. - void setInstantiatedFromUnresolvedUsingDecl(UsingDecl *Inst, NamedDecl *Tmpl); + NamedDecl *getInstantiatedFromUsingDecl(UsingDecl *Inst); + /// \brief Remember that the using decl \p Inst is an instantiation + /// of the using decl \p Pattern of a class template. + void setInstantiatedFromUsingDecl(UsingDecl *Inst, NamedDecl *Pattern); + + void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, + UsingShadowDecl *Pattern); + UsingShadowDecl *getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst); FieldDecl *getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field); @@ -380,9 +394,10 @@ public: /// equivalent to calling T.withConst(). QualType getConstType(QualType T) { return T.withConst(); } - /// getNoReturnType - Add the noreturn attribute to the given type which must - /// be a FunctionType or a pointer to an allowable type or a BlockPointer. - QualType getNoReturnType(QualType T); + /// getNoReturnType - Add or remove the noreturn attribute to the given type + /// which must be a FunctionType or a pointer to an allowable type or a + /// BlockPointer. + QualType getNoReturnType(QualType T, bool AddNoReturn = true); /// getComplexType - Return the uniqued reference to the type for a complex /// number with the specified element type. @@ -569,7 +584,7 @@ public: /// getSizeType - Return the unique type for "size_t" (C99 7.17), defined /// in . The sizeof operator requires this (C99 6.5.3.4p4). - QualType getSizeType() const; + CanQualType getSizeType() const; /// getWCharType - In C++, this returns the unique wchar_t type. In C99, this /// returns a type compatible with the type defined in as defined @@ -735,12 +750,12 @@ public: DeclarationName getNameForTemplate(TemplateName Name); + TemplateName getOverloadedTemplateName(NamedDecl * const *Begin, + NamedDecl * const *End); + TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template); - TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, - bool TemplateKeyword, - OverloadedFunctionDecl *Template); TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name); @@ -843,6 +858,13 @@ public: const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D); + /// getKeyFunction - Get the key function for the given record decl. + /// The key function is, according to the Itanium C++ ABI section 5.2.3: + /// + /// ...the first non-pure virtual function that is not inline at the point + /// of class definition. + const CXXMethodDecl *getKeyFunction(const CXXRecordDecl *RD); + void CollectObjCIvars(const ObjCInterfaceDecl *OI, llvm::SmallVectorImpl &Fields); @@ -1108,9 +1130,9 @@ public: void setObjCImplementation(ObjCCategoryDecl *CatD, ObjCCategoryImplDecl *ImplD); - /// \brief Allocate an uninitialized DeclaratorInfo. + /// \brief Allocate an uninitialized TypeSourceInfo. /// - /// The caller should initialize the memory held by DeclaratorInfo using + /// The caller should initialize the memory held by TypeSourceInfo using /// the TypeLoc wrappers. /// /// \param T the type that will be the basis for type source info. This type @@ -1119,13 +1141,13 @@ public: /// /// \param Size the size of the type info to create, or 0 if the size /// should be calculated based on the type. - DeclaratorInfo *CreateDeclaratorInfo(QualType T, unsigned Size = 0); + TypeSourceInfo *CreateTypeSourceInfo(QualType T, unsigned Size = 0); - /// \brief Allocate a DeclaratorInfo where all locations have been + /// \brief Allocate a TypeSourceInfo where all locations have been /// initialized to a given location, which defaults to the empty /// location. - DeclaratorInfo * - getTrivialDeclaratorInfo(QualType T, SourceLocation Loc = SourceLocation()); + TypeSourceInfo * + getTrivialTypeSourceInfo(QualType T, SourceLocation Loc = SourceLocation()); private: ASTContext(const ASTContext&); // DO NOT IMPLEMENT Modified: vendor/clang/dist/include/clang/AST/CanonicalType.h ============================================================================== --- vendor/clang/dist/include/clang/AST/CanonicalType.h Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/include/clang/AST/CanonicalType.h Tue Dec 15 18:49:47 2009 (r200583) @@ -172,6 +172,12 @@ inline bool operator!=(CanQual x, Can /// \brief Represents a canonical, potentially-qualified type. typedef CanQual CanQualType; +inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, + CanQualType T) { + DB << static_cast(T); + return DB; +} + //----------------------------------------------------------------------------// // Internal proxy classes used by canonical types //----------------------------------------------------------------------------// Modified: vendor/clang/dist/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Decl.h Tue Dec 15 18:33:12 2009 (r200582) +++ vendor/clang/dist/include/clang/AST/Decl.h Tue Dec 15 18:49:47 2009 (r200583) @@ -35,17 +35,17 @@ class TypeLoc; /// /// A client can read the relevant info using TypeLoc wrappers, e.g: /// @code -/// TypeLoc TL = DeclaratorInfo->getTypeLoc(); +/// TypeLoc TL = TypeSourceInfo->getTypeLoc(); /// if (PointerLoc *PL = dyn_cast(&TL)) /// PL->getStarLoc().print(OS, SrcMgr); /// @endcode /// -class DeclaratorInfo { +class TypeSourceInfo { QualType Ty; // Contains a memory block after the class, used for type source information, // allocated by ASTContext. friend class ASTContext; - DeclaratorInfo(QualType ty) : Ty(ty) { } + TypeSourceInfo(QualType ty) : Ty(ty) { } public: /// \brief Return the type wrapped by this type source info. QualType getType() const { return Ty; } @@ -322,18 +322,18 @@ public: }; /// \brief Represents a ValueDecl that came out of a declarator. -/// Contains type source information through DeclaratorInfo. +/// Contains type source information through TypeSourceInfo. class DeclaratorDecl : public ValueDecl { - DeclaratorInfo *DeclInfo; + TypeSourceInfo *DeclInfo; protected: DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, - DeclarationName N, QualType T, DeclaratorInfo *DInfo) - : ValueDecl(DK, DC, L, N, T), DeclInfo(DInfo) {} + DeclarationName N, QualType T, TypeSourceInfo *TInfo) + : ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo) {} public: - DeclaratorInfo *getDeclaratorInfo() const { return DeclInfo; } - void setDeclaratorInfo(DeclaratorInfo *DInfo) { DeclInfo = DInfo; } + TypeSourceInfo *getTypeSourceInfo() const { return DeclInfo; } + void setTypeSourceInfo(TypeSourceInfo *TInfo) { DeclInfo = TInfo; } SourceLocation getTypeSpecStartLoc() const; @@ -348,15 +348,23 @@ public: /// which it was evaluated (if any), and whether or not the statement /// is an integral constant expression (if known). struct EvaluatedStmt { - EvaluatedStmt() : WasEvaluated(false), CheckedICE(false), IsICE(false) { } + EvaluatedStmt() : WasEvaluated(false), IsEvaluating(false), CheckedICE(false), + CheckingICE(false), IsICE(false) { } /// \brief Whether this statement was already evaluated. bool WasEvaluated : 1; + /// \brief Whether this statement is being evaluated. + bool IsEvaluating : 1; + /// \brief Whether we already checked whether this statement was an /// integral constant expression. bool CheckedICE : 1; + /// \brief Whether we are checking whether this statement is an + /// integral constant expression. + bool CheckingICE : 1; + /// \brief Whether this statement is an integral constant /// expression. Only valid if CheckedICE is true. bool IsICE : 1; @@ -432,8 +440,8 @@ private: friend class StmtIteratorBase; protected: VarDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, - QualType T, DeclaratorInfo *DInfo, StorageClass SC) - : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(), + QualType T, TypeSourceInfo *TInfo, StorageClass SC) + : DeclaratorDecl(DK, DC, L, Id, T, TInfo), Init(), ThreadSpecified(false), HasCXXDirectInit(false), DeclaredInCondition(false) { SClass = SC; @@ -453,7 +461,7 @@ public: static VarDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, - QualType T, DeclaratorInfo *DInfo, StorageClass S); + QualType T, TypeSourceInfo *TInfo, StorageClass S); virtual ~VarDecl(); virtual void Destroy(ASTContext& C); @@ -504,23 +512,45 @@ public: void setInit(ASTContext &C, Expr *I); - /// \brief Note that constant evaluation has computed the given - /// value for this variable's initializer. - void setEvaluatedValue(ASTContext &C, const APValue &Value) const { + EvaluatedStmt *EnsureEvaluatedStmt() const { EvaluatedStmt *Eval = Init.dyn_cast(); if (!Eval) { Stmt *S = Init.get(); - Eval = new (C) EvaluatedStmt; + Eval = new (getASTContext()) EvaluatedStmt; Eval->Value = S; Init = Eval; } + return Eval; + } + + /// \brief Check whether we are in the process of checking whether the + /// initializer can be evaluated. + bool isEvaluatingValue() const { + if (EvaluatedStmt *Eval = Init.dyn_cast()) + return Eval->IsEvaluating; + return false; + } + + /// \brief Note that we now are checking whether the initializer can be + /// evaluated. + void setEvaluatingValue() const { + EvaluatedStmt *Eval = EnsureEvaluatedStmt(); + Eval->IsEvaluating = true; + } + + /// \brief Note that constant evaluation has computed the given + /// value for this variable's initializer. + void setEvaluatedValue(const APValue &Value) const { + EvaluatedStmt *Eval = EnsureEvaluatedStmt(); + Eval->IsEvaluating = false; Eval->WasEvaluated = true; Eval->Evaluated = Value; } /// \brief Return the already-evaluated value of this variable's - /// initializer, or NULL if the value is not yet known. + /// initializer, or NULL if the value is not yet known. Returns pointer + /// to untyped APValue if the value could not be evaluated. APValue *getEvaluatedValue() const { if (EvaluatedStmt *Eval = Init.dyn_cast()) if (Eval->WasEvaluated) @@ -548,17 +578,27 @@ public: return Init.get()->IsICE; } - /// \brief Note that we now know whether the initializer is an + /// \brief Check whether we are in the process of checking the initializer + /// is an integral constant expression. + bool isCheckingICE() const { + if (EvaluatedStmt *Eval = Init.dyn_cast()) + return Eval->CheckingICE; + + return false; + } + + /// \brief Note that we now are checking whether the initializer is an /// integral constant expression. - void setInitKnownICE(ASTContext &C, bool IsICE) const { - EvaluatedStmt *Eval = Init.dyn_cast(); - if (!Eval) { - Stmt *S = Init.get(); - Eval = new (C) EvaluatedStmt; - Eval->Value = S; - Init = Eval; - } + void setCheckingICE() const { + EvaluatedStmt *Eval = EnsureEvaluatedStmt(); + Eval->CheckingICE = true; + } + /// \brief Note that we now know whether the initializer is an + /// integral constant expression. + void setInitKnownICE(bool IsICE) const { + EvaluatedStmt *Eval = EnsureEvaluatedStmt(); + Eval->CheckingICE = false; Eval->CheckedICE = true; Eval->IsICE = IsICE; } @@ -712,7 +752,7 @@ class ImplicitParamDecl : public VarDecl protected: ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType Tw) - : VarDecl(DK, DC, L, Id, Tw, /*DInfo=*/0, VarDecl::None) {} + : VarDecl(DK, DC, L, Id, Tw, /*TInfo=*/0, VarDecl::None) {} public: static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, @@ -739,16 +779,16 @@ class ParmVarDecl : public VarDecl { protected: ParmVarDecl(Kind DK, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo, + IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg) - : VarDecl(DK, DC, L, Id, T, DInfo, S), objcDeclQualifier(OBJC_TQ_None) { + : VarDecl(DK, DC, L, Id, T, TInfo, S), objcDeclQualifier(OBJC_TQ_None) { setDefaultArg(DefArg); } public: static ParmVarDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,IdentifierInfo *Id, - QualType T, DeclaratorInfo *DInfo, + QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg); ObjCDeclQualifier getObjCDeclQualifier() const { @@ -822,8 +862,8 @@ public: } QualType getOriginalType() const { - if (getDeclaratorInfo()) - return getDeclaratorInfo()->getType(); + if (getTypeSourceInfo()) + return getTypeSourceInfo()->getType(); return getType(); } @@ -907,9 +947,9 @@ private: protected: FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L, - DeclarationName N, QualType T, DeclaratorInfo *DInfo, + DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool isInline) - : DeclaratorDecl(DK, DC, L, N, T, DInfo), + : DeclaratorDecl(DK, DC, L, N, T, TInfo), DeclContext(DK), ParamInfo(0), Body(), SClass(S), IsInline(isInline), @@ -936,7 +976,7 @@ public: static FunctionDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, - DeclaratorInfo *DInfo, + TypeSourceInfo *TInfo, StorageClass S = None, bool isInline = false, bool hasWrittenPrototype = true); @@ -1272,15 +1312,15 @@ class FieldDecl : public DeclaratorDecl Expr *BitWidth; protected: FieldDecl(Kind DK, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo, + IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable) - : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW) { + : DeclaratorDecl(DK, DC, L, Id, T, TInfo), Mutable(Mutable), BitWidth(BW) { } public: static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, - DeclaratorInfo *DInfo, Expr *BW, bool Mutable); + TypeSourceInfo *TInfo, Expr *BW, bool Mutable); /// isMutable - Determines whether this field is mutable (C++ only). bool isMutable() const { return Mutable; } @@ -1383,28 +1423,28 @@ public: class TypedefDecl : public TypeDecl { /// UnderlyingType - This is the type the typedef is set to. - DeclaratorInfo *DInfo; + TypeSourceInfo *TInfo; TypedefDecl(DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, DeclaratorInfo *DInfo) - : TypeDecl(Typedef, DC, L, Id), DInfo(DInfo) {} + IdentifierInfo *Id, TypeSourceInfo *TInfo) + : TypeDecl(Typedef, DC, L, Id), TInfo(TInfo) {} virtual ~TypedefDecl() {} public: static TypedefDecl *Create(ASTContext &C, DeclContext *DC, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 19:58:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCEF1065676; Tue, 15 Dec 2009 19:58:23 +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 BF9DD8FC15; Tue, 15 Dec 2009 19:58: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 nBFJwNK7073503; Tue, 15 Dec 2009 19:58:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFJwNS4073500; Tue, 15 Dec 2009 19:58:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912151958.nBFJwNS4073500@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Dec 2009 19:58: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: r200584 - in head/sys: dev/dpms isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 19:58:23 -0000 Author: jkim Date: Tue Dec 15 19:58:23 2009 New Revision: 200584 URL: http://svn.freebsd.org/changeset/base/200584 Log: Attach dpms(4) to vgapm and make sure to restore DPMS state after VGA is resumed properly. Reviewed by: jhb Modified: head/sys/dev/dpms/dpms.c head/sys/isa/vga_isa.c Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Tue Dec 15 18:49:47 2009 (r200583) +++ head/sys/dev/dpms/dpms.c Tue Dec 15 19:58:23 2009 (r200584) @@ -118,15 +118,14 @@ static driver_t dpms_driver = { static devclass_t dpms_devclass; -DRIVER_MODULE(dpms, vgapci, dpms_driver, dpms_devclass, NULL, NULL); +DRIVER_MODULE(dpms, vgapm, dpms_driver, dpms_devclass, NULL, NULL); MODULE_DEPEND(dpms, x86bios, 1, 1, 1); static void dpms_identify(driver_t *driver, device_t parent) { - if (device_get_flags(parent) != 0 && - x86bios_match_device(0xc0000, parent)) + if (x86bios_match_device(0xc0000, device_get_parent(parent))) device_add_child(parent, "dpms", 0); } Modified: head/sys/isa/vga_isa.c ============================================================================== --- head/sys/isa/vga_isa.c Tue Dec 15 18:49:47 2009 (r200583) +++ head/sys/isa/vga_isa.c Tue Dec 15 19:58:23 2009 (r200584) @@ -328,6 +328,9 @@ static int vgapm_attach(device_t dev) { + bus_generic_probe(dev); + bus_generic_attach(dev); + return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 20:00:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A238D1065693; Tue, 15 Dec 2009 20:00:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90DB58FC1C; Tue, 15 Dec 2009 20:00: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 nBFK0Y7K073631; Tue, 15 Dec 2009 20:00:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFK0YFO073628; Tue, 15 Dec 2009 20:00:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912152000.nBFK0YFO073628@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 Dec 2009 20:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200585 - in stable/8/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:00:34 -0000 Author: marius Date: Tue Dec 15 20:00:34 2009 New Revision: 200585 URL: http://svn.freebsd.org/changeset/base/200585 Log: MFC: r200272 Add additional checks of the kernel stack addresses in order to ensure we don't overrun the beginning of the call chain. Modified: stable/8/sys/sparc64/sparc64/stack_machdep.c stable/8/sys/sun4v/sun4v/stack_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/stack_machdep.c Tue Dec 15 19:58:23 2009 (r200584) +++ stable/8/sys/sparc64/sparc64/stack_machdep.c Tue Dec 15 20:00:34 2009 (r200585) @@ -36,15 +36,20 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; @@ -56,6 +61,9 @@ stack_capture(struct stack *st, struct f break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } Modified: stable/8/sys/sun4v/sun4v/stack_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/stack_machdep.c Tue Dec 15 19:58:23 2009 (r200584) +++ stable/8/sys/sun4v/sun4v/stack_machdep.c Tue Dec 15 20:00:34 2009 (r200585) @@ -36,20 +36,28 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 20:44:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0252C10656A4; Tue, 15 Dec 2009 20:44:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6A4E8FC1B; Tue, 15 Dec 2009 20:44: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 nBFKiCNs074825; Tue, 15 Dec 2009 20:44:12 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFKiCUQ074823; Tue, 15 Dec 2009 20:44:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912152044.nBFKiCUQ074823@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 15 Dec 2009 20:44: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: r200587 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:44:13 -0000 Author: gavin Date: Tue Dec 15 20:44:12 2009 New Revision: 200587 URL: http://svn.freebsd.org/changeset/base/200587 Log: ifconfig(8) is documented to take a ISO 3166-1 country code to set the regulatory domain with the "country" parameter, but will also take a full country name. The man page warns that only the ISO code is unambiguous. In reality, however, the first match on either would be accepted, leading to "DE" being interpreted as the "DEBUG" country rather than Germany, and "MO" selecting Morocco rather than the correct country, Macau. Fix this by always checking for an ISO CC match first, and only search on the full country name if that fails. PR: bin/140571 Tested by: Dirk Meyer dirk.meyer dinoex.sub.org Reviewed by: sam Approved by: ed (mentor) MFC after: 1 month Modified: head/sbin/ifconfig/regdomain.c Modified: head/sbin/ifconfig/regdomain.c ============================================================================== --- head/sbin/ifconfig/regdomain.c Tue Dec 15 20:20:05 2009 (r200586) +++ head/sbin/ifconfig/regdomain.c Tue Dec 15 20:44:12 2009 (r200587) @@ -694,8 +694,11 @@ lib80211_country_findbyname(const struct len = strlen(name); LIST_FOREACH(cp, &rdp->countries, next) { - if (strcasecmp(cp->isoname, name) == 0 || - strncasecmp(cp->name, name, len) == 0) + if (strcasecmp(cp->isoname, name) == 0) + return cp; + } + LIST_FOREACH(cp, &rdp->countries, next) { + if (strncasecmp(cp->name, name, len) == 0) return cp; } return NULL; From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 20:47:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3F4E106568B; Tue, 15 Dec 2009 20:47:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28C78FC0C; Tue, 15 Dec 2009 20:47: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 nBFKlpjP074934; Tue, 15 Dec 2009 20:47:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFKlpiE074932; Tue, 15 Dec 2009 20:47:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912152047.nBFKlpiE074932@svn.freebsd.org> From: Xin LI Date: Tue, 15 Dec 2009 20:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200588 - stable/8/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:47:51 -0000 Author: delphij Date: Tue Dec 15 20:47:51 2009 New Revision: 200588 URL: http://svn.freebsd.org/changeset/base/200588 Log: Add SA-09:15.ssl, SA-09:16.rtld and SA-09:17.freebsd-update. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Dec 15 20:44:12 2009 (r200587) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Dec 15 20:47:51 2009 (r200588) @@ -16,7 +16,7 @@ %release; - + ]>
            @@ -40,12 +40,7 @@ $FreeBSD$ - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 + 2009 The &os; Documentation Project @@ -130,51 +125,59 @@ Security Advisories -No advisories. -]]> - -No advisories. -]]> - -No advisories. -]]> + The following security advisories pertain to &os; &release.bugfix;. + For more information, consult the individual advisories available from + . + + + + + + + + + Advisory + Date + Topic + + + + + + SA-09:17.freebsd-update + 03 December 2009 + Inappropriate directory permissions in freebsd-update(8) + + + SA-09:16.rtld + 03 December 2009 + Improper environment sanitization in rtld(1) + + + SA-09:15.ssl + 03 December 2009 + SSL protocol flaw + + + + Open Issues -No open issues. -]]> - -No open issues. -]]> - -No open issues. -]]> - Late-Breaking News - -No news. -]]> + Late-Breaking News and Corrections -No news. -]]> - -No news. -]]>
            From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 21:02:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1B351065679; Tue, 15 Dec 2009 21:02:29 +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 C1AB78FC15; Tue, 15 Dec 2009 21:02: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 nBFL2Tuo075309; Tue, 15 Dec 2009 21:02:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFL2TgD075307; Tue, 15 Dec 2009 21:02:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912152102.nBFL2TgD075307@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Dec 2009 21:02: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: r200589 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:02:29 -0000 Author: jilles Date: Tue Dec 15 21:02:29 2009 New Revision: 200589 URL: http://svn.freebsd.org/changeset/base/200589 Log: cpuset(2): fix a typo and a markup error in the man page MFC after: 1 week Modified: head/lib/libc/sys/cpuset.2 Modified: head/lib/libc/sys/cpuset.2 ============================================================================== --- head/lib/libc/sys/cpuset.2 Tue Dec 15 20:47:51 2009 (r200588) +++ head/lib/libc/sys/cpuset.2 Tue Dec 15 21:02:29 2009 (r200589) @@ -96,7 +96,7 @@ The .Fa which argument may have the following values: .Bl -column CPU_WHICH_CPUSET -offset indent -.It Dv CPU_WHICH_TID Ta "id is lpwid_t (thread id)" +.It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" .It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)" .It Dv CPU_WHICH_IRQ Ta "id is an irq number" @@ -209,7 +209,7 @@ The calling process did not have the cre operation. .It Bq Er ENFILE There was no free -.Fn cpusetid_t +.Ft cpusetid_t for allocation. .El .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 21:10:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE52106568F for ; Tue, 15 Dec 2009 21:10:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A810B8FC12 for ; Tue, 15 Dec 2009 21:10:22 +0000 (UTC) Received: (qmail 5890 invoked by uid 399); 15 Dec 2009 21:10:21 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 21:10:21 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B27FB3D.9010905@FreeBSD.org> Date: Tue, 15 Dec 2009 13:10:21 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ollivier Robert References: <200912151459.nBFExwN7066718@svn.freebsd.org> In-Reply-To: <200912151459.nBFExwN7066718@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:10:23 -0000 Ollivier Robert wrote: > Author: roberto > Date: Tue Dec 15 14:59:58 2009 > New Revision: 200577 > URL: http://svn.freebsd.org/changeset/base/200577 > > Log: > ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. Perhaps a note in UPDATING this, and what to do instead? Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 21:12:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4DE1065695 for ; Tue, 15 Dec 2009 21:12:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A07558FC18 for ; Tue, 15 Dec 2009 21:12:10 +0000 (UTC) Received: (qmail 8360 invoked by uid 399); 15 Dec 2009 21:12:10 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 21:12:10 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B27FBA9.8090204@FreeBSD.org> Date: Tue, 15 Dec 2009 13:12:09 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Robert Watson References: <200912150514.nBF5Eej4050810@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:12:11 -0000 Robert Watson wrote: > On Tue, 15 Dec 2009, Doug Barton wrote: > >> The named process needs to have a "working directory" that it can >> write to. This is specified in "options { directory }" in named.conf. >> So, create /etc/namedb/working with appropriate permissions, and >> update the entry in named.conf to match. >> >> In addition to specifying the working directory, file and path names >> in named.conf can be specified relative to the directory listed. >> However, since that directory is now different from /etc/namedb >> (where the configuration, zone, rndc.*, and other files are located) >> further update named.conf to specify all file names with fully >> qualified paths. Also update the comment about file and path names >> so users know this should be done for all file/path names in the file. >> >> This change will eliminate the 'working directory is not writable' >> messages at boot time without sacrificing security. It will also >> allow for features in newer versions of BIND (9.7+) to work as >> designed. > > On a couple of occasions, I've found myself trying to help people get > BIND to core dump on a bug, which is a bit tricky in practice. It > involves setting appropriate sysctls so that sugid processes generate > cores, arranging for a writable core dump directory in the chroot and > setting a sysctl so it is found, etc. Does this change simplify that > process down to "enable core dump for sugid processes"? It should, yes. I was able to test all the other use cases for an unprivileged named process so I have every reason to believe that dumping a core will work too. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 21:24:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8D11065670; Tue, 15 Dec 2009 21:24:12 +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 6E39F8FC1F; Tue, 15 Dec 2009 21:24: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 nBFLOCoc075765; Tue, 15 Dec 2009 21:24:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFLOCPm075761; Tue, 15 Dec 2009 21:24:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912152124.nBFLOCPm075761@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 21:24: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: r200590 - in head/sys: conf netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:24:12 -0000 Author: luigi Date: Tue Dec 15 21:24:12 2009 New Revision: 200590 URL: http://svn.freebsd.org/changeset/base/200590 Log: more splitting of ip_fw2.c, now extract the 'table' routines and the sockopt routines (the upper half of the kernel). Whoever is the author of the 'table' code (Ruslan/glebius/oleg ?) please change the attribution in ip_fw_table.c. I have copied the copyright line from ip_fw2.c but it carries my name and I have neither written nor designed the feature so I don't deserve the credit. MFC after: 1 month Added: head/sys/netinet/ipfw/ip_fw_sockopt.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_table.c (contents, props changed) Modified: head/sys/conf/files head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 15 21:02:29 2009 (r200589) +++ head/sys/conf/files Tue Dec 15 21:24:12 2009 (r200590) @@ -2430,6 +2430,8 @@ netinet/ipfw/ip_fw2.c optional inet ipf netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall netinet/ipfw/ip_fw_log.c optional inet ipfirewall netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall +netinet/ipfw/ip_fw_sockopt.c optional inet ipfirewall +netinet/ipfw/ip_fw_table.c optional inet ipfirewall netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet netinet/ip_input.c optional inet Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 21:02:29 2009 (r200589) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 21:24:12 2009 (r200590) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include /* for ETHERTYPE_IP */ #include -#include #include #include #include @@ -112,7 +111,7 @@ static VNET_DEFINE(int, ipfw_vnet_ready) * and CANNOT be disabled. * Rules in set RESVD_SET can only be deleted explicitly. */ -static VNET_DEFINE(u_int32_t, set_disable); +VNET_DEFINE(u_int32_t, set_disable); VNET_DEFINE(int, fw_verbose); #define V_set_disable VNET(set_disable) @@ -132,8 +131,6 @@ struct ip_fw *ip_fw_default_rule; VNET_DEFINE(struct ip_fw_chain, layer3_chain); MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); -MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); -#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; @@ -152,10 +149,6 @@ static VNET_DEFINE(int, autoinc_step); static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) -static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ -#define V_static_count VNET(static_count) -#define V_static_len VNET(static_len) extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE @@ -197,9 +190,6 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A "Deny packets with unknown IPv6 Extension Headers"); #endif /* INET6 */ -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, - CTLFLAG_RD, &VNET_NAME(static_count), 0, - "Number of static rules"); #endif /* SYSCTL_NODE */ @@ -693,193 +683,6 @@ lookup_next_rule(struct ip_fw *me, u_int } static int -add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint8_t mlen, uint32_t value) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct radix_node *rn; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - ent = malloc(sizeof(*ent), M_IPFW_TBL, M_NOWAIT | M_ZERO); - if (ent == NULL) - return (ENOMEM); - ent->value = value; - ent->addr.sin_len = ent->mask.sin_len = 8; - ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); - ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; - IPFW_WLOCK(ch); - rn = rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent); - if (rn == NULL) { - IPFW_WUNLOCK(ch); - free(ent, M_IPFW_TBL); - return (EEXIST); - } - IPFW_WUNLOCK(ch); - return (0); -} - -static int -del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint8_t mlen) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct sockaddr_in sa, mask; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - sa.sin_len = mask.sin_len = 8; - mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); - sa.sin_addr.s_addr = addr & mask.sin_addr.s_addr; - IPFW_WLOCK(ch); - ent = (struct table_entry *)rnh->rnh_deladdr(&sa, &mask, rnh); - if (ent == NULL) { - IPFW_WUNLOCK(ch); - return (ESRCH); - } - IPFW_WUNLOCK(ch); - free(ent, M_IPFW_TBL); - return (0); -} - -static int -flush_table_entry(struct radix_node *rn, void *arg) -{ - struct radix_node_head * const rnh = arg; - struct table_entry *ent; - - ent = (struct table_entry *) - rnh->rnh_deladdr(rn->rn_key, rn->rn_mask, rnh); - if (ent != NULL) - free(ent, M_IPFW_TBL); - return (0); -} - -static int -flush_table(struct ip_fw_chain *ch, uint16_t tbl) -{ - struct radix_node_head *rnh; - - IPFW_WLOCK_ASSERT(ch); - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - KASSERT(rnh != NULL, ("NULL IPFW table")); - rnh->rnh_walktree(rnh, flush_table_entry, rnh); - return (0); -} - -static void -flush_tables(struct ip_fw_chain *ch) -{ - uint16_t tbl; - - IPFW_WLOCK_ASSERT(ch); - - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) - flush_table(ch, tbl); -} - -static int -init_tables(struct ip_fw_chain *ch) -{ - int i; - uint16_t j; - - for (i = 0; i < IPFW_TABLES_MAX; i++) { - if (!rn_inithead((void **)&ch->tables[i], 32)) { - for (j = 0; j < i; j++) { - (void) flush_table(ch, j); - } - return (ENOMEM); - } - } - return (0); -} - -static int -lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint32_t *val) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct sockaddr_in sa; - - if (tbl >= IPFW_TABLES_MAX) - return (0); - rnh = ch->tables[tbl]; - sa.sin_len = 8; - sa.sin_addr.s_addr = addr; - ent = (struct table_entry *)(rnh->rnh_lookup(&sa, NULL, rnh)); - if (ent != NULL) { - *val = ent->value; - return (1); - } - return (0); -} - -static int -count_table_entry(struct radix_node *rn, void *arg) -{ - u_int32_t * const cnt = arg; - - (*cnt)++; - return (0); -} - -static int -count_table(struct ip_fw_chain *ch, uint32_t tbl, uint32_t *cnt) -{ - struct radix_node_head *rnh; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - *cnt = 0; - rnh->rnh_walktree(rnh, count_table_entry, cnt); - return (0); -} - -static int -dump_table_entry(struct radix_node *rn, void *arg) -{ - struct table_entry * const n = (struct table_entry *)rn; - ipfw_table * const tbl = arg; - ipfw_table_entry *ent; - - if (tbl->cnt == tbl->size) - return (1); - ent = &tbl->ent[tbl->cnt]; - ent->tbl = tbl->tbl; - if (in_nullhost(n->mask.sin_addr)) - ent->masklen = 0; - else - ent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr)); - ent->addr = n->addr.sin_addr.s_addr; - ent->value = n->value; - tbl->cnt++; - return (0); -} - -static int -dump_table(struct ip_fw_chain *ch, ipfw_table *tbl) -{ - struct radix_node_head *rnh; - - if (tbl->tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl->tbl]; - tbl->cnt = 0; - rnh->rnh_walktree(rnh, dump_table_entry, tbl); - return (0); -} - -static int check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif, struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip, u_int16_t src_port, struct ucred **uc, int *ugid_lookupp, @@ -1636,7 +1439,7 @@ do { \ } else break; } - match = lookup_table(chain, cmd->arg1, a, + match = ipfw_lookup_table(chain, cmd->arg1, a, &v); if (!match) break; @@ -2448,1010 +2251,6 @@ pullup_failed: return (IP_FW_DENY); } -/* - * When a rule is added/deleted, clear the next_rule pointers in all rules. - * These will be reconstructed on the fly as packets are matched. - */ -static void -flush_rule_ptrs(struct ip_fw_chain *chain) -{ - struct ip_fw *rule; - - IPFW_WLOCK_ASSERT(chain); - - chain->id++; - - for (rule = chain->rules; rule; rule = rule->next) - rule->next_rule = NULL; -} - -/* - * Add a new rule to the list. Copy the rule into a malloc'ed area, then - * possibly create a rule number and add the rule to the list. - * Update the rule_number in the input struct so the caller knows it as well. - */ -static int -add_rule(struct ip_fw_chain *chain, struct ip_fw *input_rule) -{ - struct ip_fw *rule, *f, *prev; - int l = RULESIZE(input_rule); - - if (chain->rules == NULL && input_rule->rulenum != IPFW_DEFAULT_RULE) - return (EINVAL); - - rule = malloc(l, M_IPFW, M_NOWAIT | M_ZERO); - if (rule == NULL) - return (ENOSPC); - - bcopy(input_rule, rule, l); - - rule->next = NULL; - rule->next_rule = NULL; - - rule->pcnt = 0; - rule->bcnt = 0; - rule->timestamp = 0; - - IPFW_WLOCK(chain); - - if (chain->rules == NULL) { /* default rule */ - chain->rules = rule; - rule->id = ++chain->id; - goto done; - } - - /* - * If rulenum is 0, find highest numbered rule before the - * default rule, and add autoinc_step - */ - if (V_autoinc_step < 1) - V_autoinc_step = 1; - else if (V_autoinc_step > 1000) - V_autoinc_step = 1000; - if (rule->rulenum == 0) { - /* - * locate the highest numbered rule before default - */ - for (f = chain->rules; f; f = f->next) { - if (f->rulenum == IPFW_DEFAULT_RULE) - break; - rule->rulenum = f->rulenum; - } - if (rule->rulenum < IPFW_DEFAULT_RULE - V_autoinc_step) - rule->rulenum += V_autoinc_step; - input_rule->rulenum = rule->rulenum; - } - - /* - * Now insert the new rule in the right place in the sorted list. - */ - for (prev = NULL, f = chain->rules; f; prev = f, f = f->next) { - if (f->rulenum > rule->rulenum) { /* found the location */ - if (prev) { - rule->next = f; - prev->next = rule; - } else { /* head insert */ - rule->next = chain->rules; - chain->rules = rule; - } - break; - } - } - flush_rule_ptrs(chain); - /* chain->id incremented inside flush_rule_ptrs() */ - rule->id = chain->id; -done: - V_static_count++; - V_static_len += l; - IPFW_WUNLOCK(chain); - DEB(printf("ipfw: installed rule %d, static count now %d\n", - rule->rulenum, V_static_count);) - return (0); -} - -/** - * Remove a static rule (including derived * dynamic rules) - * and place it on the ``reap list'' for later reclamation. - * The caller is in charge of clearing rule pointers to avoid - * dangling pointers. - * @return a pointer to the next entry. - * Arguments are not checked, so they better be correct. - */ -static struct ip_fw * -remove_rule(struct ip_fw_chain *chain, struct ip_fw *rule, - struct ip_fw *prev) -{ - struct ip_fw *n; - int l = RULESIZE(rule); - - IPFW_WLOCK_ASSERT(chain); - - n = rule->next; - remove_dyn_children(rule); - if (prev == NULL) - chain->rules = n; - else - prev->next = n; - V_static_count--; - V_static_len -= l; - - rule->next = chain->reap; - chain->reap = rule; - - return n; -} - -/* - * Reclaim storage associated with a list of rules. This is - * typically the list created using remove_rule. - * A NULL pointer on input is handled correctly. - */ -static void -reap_rules(struct ip_fw *head) -{ - struct ip_fw *rule; - - while ((rule = head) != NULL) { - head = head->next; - free(rule, M_IPFW); - } -} - -/* - * Remove all rules from a chain (except rules in set RESVD_SET - * unless kill_default = 1). The caller is responsible for - * reclaiming storage for the rules left in chain->reap. - */ -static void -free_chain(struct ip_fw_chain *chain, int kill_default) -{ - struct ip_fw *prev, *rule; - - IPFW_WLOCK_ASSERT(chain); - - chain->reap = NULL; - flush_rule_ptrs(chain); /* more efficient to do outside the loop */ - for (prev = NULL, rule = chain->rules; rule ; ) - if (kill_default || rule->set != RESVD_SET) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } -} - -/** - * Remove all rules with given number, and also do set manipulation. - * Assumes chain != NULL && *chain != NULL. - * - * The argument is an u_int32_t. The low 16 bit are the rule or set number, - * the next 8 bits are the new set, the top 8 bits are the command: - * - * 0 delete rules with given number - * 1 delete rules with given set number - * 2 move rules with given number to new set - * 3 move rules with given set number to new set - * 4 swap sets with given numbers - * 5 delete rules with given number and with given set number - */ -static int -del_entry(struct ip_fw_chain *chain, u_int32_t arg) -{ - struct ip_fw *prev = NULL, *rule; - u_int16_t rulenum; /* rule or old_set */ - u_int8_t cmd, new_set; - - rulenum = arg & 0xffff; - cmd = (arg >> 24) & 0xff; - new_set = (arg >> 16) & 0xff; - - if (cmd > 5 || new_set > RESVD_SET) - return EINVAL; - if (cmd == 0 || cmd == 2 || cmd == 5) { - if (rulenum >= IPFW_DEFAULT_RULE) - return EINVAL; - } else { - if (rulenum > RESVD_SET) /* old_set */ - return EINVAL; - } - - IPFW_WLOCK(chain); - rule = chain->rules; /* common starting point */ - chain->reap = NULL; /* prepare for deletions */ - switch (cmd) { - case 0: /* delete rules with given number */ - /* - * locate first rule to delete - */ - for (; rule->rulenum < rulenum; prev = rule, rule = rule->next) - ; - if (rule->rulenum != rulenum) { - IPFW_WUNLOCK(chain); - return EINVAL; - } - - /* - * flush pointers outside the loop, then delete all matching - * rules. prev remains the same throughout the cycle. - */ - flush_rule_ptrs(chain); - while (rule->rulenum == rulenum) - rule = remove_rule(chain, rule, prev); - break; - - case 1: /* delete all rules with given set number */ - flush_rule_ptrs(chain); - while (rule->rulenum < IPFW_DEFAULT_RULE) { - if (rule->set == rulenum) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } - } - break; - - case 2: /* move rules with given number to new set */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->rulenum == rulenum) - rule->set = new_set; - break; - - case 3: /* move rules with given set number to new set */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->set == rulenum) - rule->set = new_set; - break; - - case 4: /* swap two sets */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->set == rulenum) - rule->set = new_set; - else if (rule->set == new_set) - rule->set = rulenum; - break; - - case 5: /* delete rules with given number and with given set number. - * rulenum - given rule number; - * new_set - given set number. - */ - for (; rule->rulenum < rulenum; prev = rule, rule = rule->next) - ; - if (rule->rulenum != rulenum) { - IPFW_WUNLOCK(chain); - return (EINVAL); - } - flush_rule_ptrs(chain); - while (rule->rulenum == rulenum) { - if (rule->set == new_set) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } - } - } - /* - * Look for rules to reclaim. We grab the list before - * releasing the lock then reclaim them w/o the lock to - * avoid a LOR with dummynet. - */ - rule = chain->reap; - IPFW_WUNLOCK(chain); - reap_rules(rule); - return 0; -} - -/* - * Clear counters for a specific rule. - * The enclosing "table" is assumed locked. - */ -static void -clear_counters(struct ip_fw *rule, int log_only) -{ - ipfw_insn_log *l = (ipfw_insn_log *)ACTION_PTR(rule); - - if (log_only == 0) { - rule->bcnt = rule->pcnt = 0; - rule->timestamp = 0; - } - if (l->o.opcode == O_LOG) - l->log_left = l->max_log; -} - -/** - * Reset some or all counters on firewall rules. - * The argument `arg' is an u_int32_t. The low 16 bit are the rule number, - * the next 8 bits are the set number, the top 8 bits are the command: - * 0 work with rules from all set's; - * 1 work with rules only from specified set. - * Specified rule number is zero if we want to clear all entries. - * log_only is 1 if we only want to reset logs, zero otherwise. - */ -static int -zero_entry(struct ip_fw_chain *chain, u_int32_t arg, int log_only) -{ - struct ip_fw *rule; - char *msg; - - uint16_t rulenum = arg & 0xffff; - uint8_t set = (arg >> 16) & 0xff; - uint8_t cmd = (arg >> 24) & 0xff; - - if (cmd > 1) - return (EINVAL); - if (cmd == 1 && set > RESVD_SET) - return (EINVAL); - - IPFW_WLOCK(chain); - if (rulenum == 0) { - V_norule_counter = 0; - for (rule = chain->rules; rule; rule = rule->next) { - /* Skip rules from another set. */ - if (cmd == 1 && rule->set != set) - continue; - clear_counters(rule, log_only); - } - msg = log_only ? "All logging counts reset" : - "Accounting cleared"; - } else { - int cleared = 0; - /* - * We can have multiple rules with the same number, so we - * need to clear them all. - */ - for (rule = chain->rules; rule; rule = rule->next) - if (rule->rulenum == rulenum) { - while (rule && rule->rulenum == rulenum) { - if (cmd == 0 || rule->set == set) - clear_counters(rule, log_only); - rule = rule->next; - } - cleared = 1; - break; - } - if (!cleared) { /* we did not find any matching rules */ - IPFW_WUNLOCK(chain); - return (EINVAL); - } - msg = log_only ? "logging count reset" : "cleared"; - } - IPFW_WUNLOCK(chain); - - if (V_fw_verbose) { - int lev = LOG_SECURITY | LOG_NOTICE; - - if (rulenum) - log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); - else - log(lev, "ipfw: %s.\n", msg); - } - return (0); -} - -/* - * Check validity of the structure before insert. - * Fortunately rules are simple, so this mostly need to check rule sizes. - */ -static int -check_ipfw_struct(struct ip_fw *rule, int size) -{ - int l, cmdlen = 0; - int have_action=0; - ipfw_insn *cmd; - - if (size < sizeof(*rule)) { - printf("ipfw: rule too short\n"); - return (EINVAL); - } - /* first, check for valid size */ - l = RULESIZE(rule); - if (l != size) { - printf("ipfw: size mismatch (have %d want %d)\n", size, l); - return (EINVAL); - } - if (rule->act_ofs >= rule->cmd_len) { - printf("ipfw: bogus action offset (%u > %u)\n", - rule->act_ofs, rule->cmd_len - 1); - return (EINVAL); - } - /* - * Now go for the individual checks. Very simple ones, basically only - * instruction sizes. - */ - for (l = rule->cmd_len, cmd = rule->cmd ; - l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - if (cmdlen > l) { - printf("ipfw: opcode %d size truncated\n", - cmd->opcode); - return EINVAL; - } - DEB(printf("ipfw: opcode %d\n", cmd->opcode);) - switch (cmd->opcode) { - case O_PROBE_STATE: - case O_KEEP_STATE: - case O_PROTO: - case O_IP_SRC_ME: - case O_IP_DST_ME: - case O_LAYER2: - case O_IN: - case O_FRAG: - case O_DIVERTED: - case O_IPOPT: - case O_IPTOS: - case O_IPPRECEDENCE: - case O_IPVER: - case O_TCPWIN: - case O_TCPFLAGS: - case O_TCPOPTS: - case O_ESTAB: - case O_VERREVPATH: - case O_VERSRCREACH: - case O_ANTISPOOF: - case O_IPSEC: -#ifdef INET6 - case O_IP6_SRC_ME: - case O_IP6_DST_ME: - case O_EXT_HDR: - case O_IP6: -#endif - case O_IP4: - case O_TAG: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - break; - - case O_FIB: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - if (cmd->arg1 >= rt_numfibs) { - printf("ipfw: invalid fib number %d\n", - cmd->arg1); - return EINVAL; - } - break; - - case O_SETFIB: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - if (cmd->arg1 >= rt_numfibs) { - printf("ipfw: invalid fib number %d\n", - cmd->arg1); - return EINVAL; - } - goto check_action; - - case O_UID: - case O_GID: - case O_JAIL: - case O_IP_SRC: - case O_IP_DST: - case O_TCPSEQ: - case O_TCPACK: - case O_PROB: - case O_ICMPTYPE: - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32)) - goto bad_size; - break; - - case O_LIMIT: - if (cmdlen != F_INSN_SIZE(ipfw_insn_limit)) - goto bad_size; - break; - - case O_LOG: - if (cmdlen != F_INSN_SIZE(ipfw_insn_log)) - goto bad_size; - - ((ipfw_insn_log *)cmd)->log_left = - ((ipfw_insn_log *)cmd)->max_log; - - break; - - case O_IP_SRC_MASK: - case O_IP_DST_MASK: - /* only odd command lengths */ - if ( !(cmdlen & 1) || cmdlen > 31) - goto bad_size; - break; - - case O_IP_SRC_SET: - case O_IP_DST_SET: - if (cmd->arg1 == 0 || cmd->arg1 > 256) { - printf("ipfw: invalid set size %d\n", - cmd->arg1); - return EINVAL; - } - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + - (cmd->arg1+31)/32 ) - goto bad_size; - break; - - case O_IP_SRC_LOOKUP: - case O_IP_DST_LOOKUP: - if (cmd->arg1 >= IPFW_TABLES_MAX) { - printf("ipfw: invalid table number %d\n", - cmd->arg1); - return (EINVAL); - } - if (cmdlen != F_INSN_SIZE(ipfw_insn) && - cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1 && - cmdlen != F_INSN_SIZE(ipfw_insn_u32)) - goto bad_size; - break; - - case O_MACADDR2: - if (cmdlen != F_INSN_SIZE(ipfw_insn_mac)) - goto bad_size; - break; - - case O_NOP: - case O_IPID: - case O_IPTTL: - case O_IPLEN: - case O_TCPDATALEN: - case O_TAGGED: - if (cmdlen < 1 || cmdlen > 31) - goto bad_size; - break; - - case O_MAC_TYPE: - case O_IP_SRCPORT: - case O_IP_DSTPORT: /* XXX artificial limit, 30 port pairs */ - if (cmdlen < 2 || cmdlen > 31) - goto bad_size; - break; - - case O_RECV: - case O_XMIT: - case O_VIA: - if (cmdlen != F_INSN_SIZE(ipfw_insn_if)) - goto bad_size; - break; - - case O_ALTQ: - if (cmdlen != F_INSN_SIZE(ipfw_insn_altq)) - goto bad_size; - break; - - case O_PIPE: - case O_QUEUE: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - goto check_action; - - case O_FORWARD_IP: -#ifdef IPFIREWALL_FORWARD - if (cmdlen != F_INSN_SIZE(ipfw_insn_sa)) - goto bad_size; - goto check_action; -#else - return EINVAL; -#endif - - case O_DIVERT: - case O_TEE: - if (ip_divert_ptr == NULL) - return EINVAL; - else - goto check_size; - case O_NETGRAPH: - case O_NGTEE: - if (!NG_IPFW_LOADED) - return EINVAL; - else - goto check_size; - case O_NAT: - if (!IPFW_NAT_LOADED) - return EINVAL; - if (cmdlen != F_INSN_SIZE(ipfw_insn_nat)) - goto bad_size; - goto check_action; - case O_FORWARD_MAC: /* XXX not implemented yet */ - case O_CHECK_STATE: - case O_COUNT: - case O_ACCEPT: - case O_DENY: - case O_REJECT: -#ifdef INET6 - case O_UNREACH6: -#endif - case O_SKIPTO: - case O_REASS: -check_size: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; -check_action: - if (have_action) { - printf("ipfw: opcode %d, multiple actions" - " not allowed\n", - cmd->opcode); - return EINVAL; - } - have_action = 1; - if (l != cmdlen) { - printf("ipfw: opcode %d, action must be" - " last opcode\n", - cmd->opcode); - return EINVAL; - } - break; -#ifdef INET6 - case O_IP6_SRC: - case O_IP6_DST: - if (cmdlen != F_INSN_SIZE(struct in6_addr) + - F_INSN_SIZE(ipfw_insn)) - goto bad_size; - break; - - case O_FLOW6ID: - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + - ((ipfw_insn_u32 *)cmd)->o.arg1) - goto bad_size; - break; - - case O_IP6_SRC_MASK: - case O_IP6_DST_MASK: - if ( !(cmdlen & 1) || cmdlen > 127) - goto bad_size; - break; - case O_ICMP6TYPE: - if( cmdlen != F_INSN_SIZE( ipfw_insn_icmp6 ) ) - goto bad_size; - break; -#endif - - default: - switch (cmd->opcode) { -#ifndef INET6 - case O_IP6_SRC_ME: - case O_IP6_DST_ME: - case O_EXT_HDR: - case O_IP6: - case O_UNREACH6: - case O_IP6_SRC: - case O_IP6_DST: - case O_FLOW6ID: - case O_IP6_SRC_MASK: - case O_IP6_DST_MASK: - case O_ICMP6TYPE: - printf("ipfw: no IPv6 support in kernel\n"); - return EPROTONOSUPPORT; -#endif - default: - printf("ipfw: opcode %d, unknown opcode\n", - cmd->opcode); - return EINVAL; - } - } - } - if (have_action == 0) { - printf("ipfw: missing action\n"); - return EINVAL; - } - return 0; - -bad_size: - printf("ipfw: opcode %d size %d wrong\n", - cmd->opcode, cmdlen); - return EINVAL; -} - -/* - * Copy the static and dynamic rules to the supplied buffer - * and return the amount of space actually used. - */ -static size_t -ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space) -{ - char *bp = buf; - char *ep = bp + space; - struct ip_fw *rule; - int i; - time_t boot_seconds; - - boot_seconds = boottime.tv_sec; - /* XXX this can take a long time and locking will block packet flow */ - IPFW_RLOCK(chain); - for (rule = chain->rules; rule ; rule = rule->next) { - /* - * Verify the entry fits in the buffer in case the - * rules changed between calculating buffer space and - * now. This would be better done using a generation - * number but should suffice for now. - */ - i = RULESIZE(rule); - if (bp + i <= ep) { - bcopy(rule, bp, i); - /* - * XXX HACK. Store the disable mask in the "next" - * pointer in a wild attempt to keep the ABI the same. - * Why do we do this on EVERY rule? - */ - bcopy(&V_set_disable, - &(((struct ip_fw *)bp)->next_rule), - sizeof(V_set_disable)); - if (((struct ip_fw *)bp)->timestamp) - ((struct ip_fw *)bp)->timestamp += boot_seconds; - bp += i; - } - } - IPFW_RUNLOCK(chain); - ipfw_get_dynamic(&bp, ep); - return (bp - (char *)buf); -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 22:44:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A8651065670; Tue, 15 Dec 2009 22:44:29 +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 306C78FC1B; Tue, 15 Dec 2009 22:44: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 nBFMiT4a077328; Tue, 15 Dec 2009 22:44:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFMiTlf077326; Tue, 15 Dec 2009 22:44:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912152244.nBFMiTlf077326@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Dec 2009 22:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200591 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 22:44:29 -0000 Author: jkim Date: Tue Dec 15 22:44:28 2009 New Revision: 200591 URL: http://svn.freebsd.org/changeset/base/200591 Log: Add two new debugging tunables for x86bios instead of abusing bootverbose, i.e., debug.x86bios.call and debug.x86bios.int. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Tue Dec 15 21:24:12 2009 (r200590) +++ head/sys/compat/x86bios/x86bios.c Tue Dec 15 22:44:28 2009 (r200591) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,6 +81,16 @@ static vm_offset_t *x86bios_map; static vm_paddr_t x86bios_seg_phys; +SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); +static int x86bios_trace_call; +TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); +SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, + "Trace far function calls"); +static int x86bios_trace_int; +TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int); +SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0, + "Trace software interrupt handlers"); + static void * x86bios_get_pages(uint32_t offset, size_t size) { @@ -312,7 +323,7 @@ x86bios_call(struct x86regs *regs, uint1 if (x86bios_map == NULL) return; - if (bootverbose) + if (x86bios_trace_call) printf("Calling 0x%05x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, @@ -324,7 +335,7 @@ x86bios_call(struct x86regs *regs, uint1 memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (bootverbose) + if (x86bios_trace_call) printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, @@ -351,7 +362,7 @@ x86bios_intr(struct x86regs *regs, int i if (x86bios_map == NULL) return; - if (bootverbose) + if (x86bios_trace_int) printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", intno, regs->R_AX, regs->R_BX, regs->R_CX, @@ -363,7 +374,7 @@ x86bios_intr(struct x86regs *regs, int i memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (bootverbose) + if (x86bios_trace_int) printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", intno, regs->R_AX, regs->R_BX, regs->R_CX, From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 23:05:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBFA91065692; Tue, 15 Dec 2009 23:05:16 +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 CA58F8FC16; Tue, 15 Dec 2009 23:05: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 nBFN5GgL077883; Tue, 15 Dec 2009 23:05:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFN5GlW077881; Tue, 15 Dec 2009 23:05:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912152305.nBFN5GlW077881@svn.freebsd.org> From: Doug Barton Date: Tue, 15 Dec 2009 23:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200592 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 23:05:17 -0000 Author: dougb Date: Tue Dec 15 23:05:16 2009 New Revision: 200592 URL: http://svn.freebsd.org/changeset/base/200592 Log: Re-apply the fix from r199029 (MFC from r198162) to allow $name_program to override $command. PR: conf//141642 Submitted by: Petr Lampa Modified: stable/8/etc/rc.subr Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Tue Dec 15 22:44:28 2009 (r200591) +++ stable/8/etc/rc.subr Tue Dec 15 23:05:16 2009 (r200592) @@ -616,7 +616,7 @@ run_rc_command() esac eval _override_command=\$${name}_program - command=${command:-${_override_command}} + command=${_override_command:-$command} _keywords="start stop restart rcvar $extra_commands" rc_pid= From owner-svn-src-all@FreeBSD.ORG Tue Dec 15 23:13:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E760D1065692 for ; Tue, 15 Dec 2009 23:13:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 788BE8FC14 for ; Tue, 15 Dec 2009 23:13:33 +0000 (UTC) Received: (qmail 9462 invoked by uid 399); 15 Dec 2009 23:13:32 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 23:13:32 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B28181B.5070503@FreeBSD.org> Date: Tue, 15 Dec 2009 15:13:31 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Hiroki Sato References: <200912070625.nB76PJli043796@svn.freebsd.org> In-Reply-To: <200912070625.nB76PJli043796@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200205 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 23:13:34 -0000 Hiroki Sato wrote: > Author: hrs > Date: Mon Dec 7 06:25:19 2009 > New Revision: 200205 > URL: http://svn.freebsd.org/changeset/base/200205 > > Log: > MFC: > > r197144: > - Add an extension of set_rcvar(), a new function set_rcvar_obsolete(), > and $desc. > > The set_rcvar_obsolete() is to mark a variable as obsolete and define > the new one. More specifically, a warning is displayed when > a variable is removed or changed in the source tree and the user > still defines the old one. > @@ -588,7 +616,7 @@ run_rc_command() > esac > > eval _override_command=\$${name}_program > - command=${_override_command:-$command} > + command=${command:-${_override_command}} > > _keywords="start stop restart rcvar $extra_commands" > rc_pid= Hiroki, You apparently merged your change from r197144 without applying my fix for this problem above from r198162, which broke this feature in 8-stable. See http://www.freebsd.org/cgi/query-pr.cgi?pr=141642 In my mind breaking this feature in a -stable branch is a fairly serious error, and adds fuel to my growing discomfort about the changes you've been making in /etc. How do you suggest that we move forward and at the same time lessen the potential for further problems? Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 02:17:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58004106566C; Wed, 16 Dec 2009 02:17:44 +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 43D048FC0A; Wed, 16 Dec 2009 02:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG2HiYt081760; Wed, 16 Dec 2009 02:17:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG2Hir1081750; Wed, 16 Dec 2009 02:17:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912160217.nBG2Hir1081750@svn.freebsd.org> From: Doug Barton Date: Wed, 16 Dec 2009 02:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200594 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 02:17:44 -0000 Author: dougb Date: Wed Dec 16 02:17:43 2009 New Revision: 200594 URL: http://svn.freebsd.org/changeset/base/200594 Log: Add INCLUDE_CONFIG_FILE, and a note in comments about how to also include the comments with CONFIGARGS Modified: head/sys/amd64/conf/DEFAULTS head/sys/arm/conf/DEFAULTS head/sys/i386/conf/DEFAULTS head/sys/ia64/conf/DEFAULTS head/sys/mips/conf/DEFAULTS head/sys/pc98/conf/DEFAULTS head/sys/powerpc/conf/DEFAULTS head/sys/sparc64/conf/DEFAULTS head/sys/sun4v/conf/DEFAULTS Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/amd64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -21,3 +21,9 @@ options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/arm/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -9,3 +9,10 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/i386/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -28,3 +28,10 @@ options GEOM_PART_MBR # enable support for native hardware options NATIVE device atpic + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/ia64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -17,3 +17,10 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/mips/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -11,3 +11,10 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/pc98/conf/DEFAULTS ============================================================================== --- head/sys/pc98/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/pc98/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -24,3 +24,10 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/powerpc/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -14,3 +14,10 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sparc64/conf/DEFAULTS ============================================================================== --- head/sys/sparc64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/sparc64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -19,3 +19,10 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sun4v/conf/DEFAULTS ============================================================================== --- head/sys/sun4v/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/sun4v/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -11,3 +11,10 @@ device mem # Memory and kernel memory # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_VTOC8 + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 02:54:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714671065670; Wed, 16 Dec 2009 02:54:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 469BA8FC29; Wed, 16 Dec 2009 02: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 nBG2sYwK082661; Wed, 16 Dec 2009 02:54:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG2sYLP082659; Wed, 16 Dec 2009 02:54:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160254.nBG2sYLP082659@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 02: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: r200596 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 02:54:34 -0000 Author: imp Date: Wed Dec 16 02:54:34 2009 New Revision: 200596 URL: http://svn.freebsd.org/changeset/base/200596 Log: Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN}, which disables doing a make obj. Use it when you know it will work only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep doing obj when doing incremental kernel builds. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 16 02:52:33 2009 (r200595) +++ head/Makefile.inc1 Wed Dec 16 02:54:34 2009 (r200596) @@ -5,10 +5,11 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir -# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND +# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel +# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects @@ -694,6 +695,7 @@ distrib-dirs distribution: NO_KERNELCLEAN= t NO_KERNELCONFIG= t NO_KERNELDEPEND= t +NO_KERNELOBJ= t # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah .if !defined(KERNCONF) && ${KERNFAST} != "1" KERNCONF=${KERNFAST} @@ -763,11 +765,13 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif +.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj +.endif @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 03:22:45 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F170F106566B; Wed, 16 Dec 2009 03:22:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ADE878FC13; Wed, 16 Dec 2009 03:22:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBG3FqKU002339; Tue, 15 Dec 2009 20:15:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 15 Dec 2009 20:16:21 -0700 (MST) Message-Id: <20091215.201621.756168950458235997.imp@bsdimp.com> To: luigi@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200912151615.nBFGFEOq068598@svn.freebsd.org> References: <200912151615.nBFGFEOq068598@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:22:46 -0000 In message: <200912151615.nBFGFEOq068598@svn.freebsd.org> Luigi Rizzo writes: : Log: : Start splitting ip_fw2.c and ip_fw.h into smaller components. : At this time we pull out from ip_fw2.c the logging functions, and : support for dynamic rules, and move kernel-only stuff into : netinet/ipfw/ip_fw_private.h : : No ABI change involved in this commit, unless I made some mistake. : ip_fw.h has changed, though not in the userland-visible part. ... : netinet/ipfw/ip_fw_nat.c : minor rearrangement to remove LOOKUP_NAT from the : main headers. This require a new function pointer. This broke the build. Here's the fix: Index: sys/netinet/ipfw/ip_fw_nat.c =================================================================== --- sys/netinet/ipfw/ip_fw_nat.c (revision 200593) +++ sys/netinet/ipfw/ip_fw_nat.c (working copy) @@ -70,12 +70,6 @@ static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); #define V_ifaddr_event_tag VNET(ifaddr_event_tag) -extern ipfw_nat_t *ipfw_nat_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - static void ifaddr_change(void *arg __unused, struct ifnet *ifp) { Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 03:25:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E943106566B; Wed, 16 Dec 2009 03:25:43 +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 642A68FC1B; Wed, 16 Dec 2009 03:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG3PhKC083555; Wed, 16 Dec 2009 03:25:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3PhOx083552; Wed, 16 Dec 2009 03:25:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160325.nBG3PhOx083552@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200597 - in head/share/man: man5 man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:25:43 -0000 Author: imp Date: Wed Dec 16 03:25:43 2009 New Revision: 200597 URL: http://svn.freebsd.org/changeset/base/200597 Log: Docmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary. Update documentation on KERNFAST meaning. Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Dec 16 02:54:34 2009 (r200596) +++ head/share/man/man5/make.conf.5 Wed Dec 16 03:25:43 2009 (r200597) @@ -369,6 +369,12 @@ It defaults to .It Va MODULES_OVERRIDE .Pq Vt str Set to a list of modules to build instead of all of them. +.It Va NO_KERNELCLEAN +.Pq Vt bool +Set this to skip running +.Dq Li "${MAKE} clean" +during +.Dq Li "${MAKE} buildkernel" . .It Va NO_KERNELCONFIG .Pq Vt bool Set this to skip running @@ -381,6 +387,12 @@ Set this to skip running .Dq Li "${MAKE} depend" during .Dq Li "${MAKE} buildkernel" . +.It Va NO_KERNELOBJ +.Pq Vt bool +Set this to skip running +.Dq Li "${MAKE} obj" +during +.Dq Li "${MAKE} buildkernel" . .It Va NO_MODULES .Pq Vt bool Set to not build modules with the kernel. Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Dec 16 02:54:34 2009 (r200596) +++ head/share/man/man7/build.7 Wed Dec 16 03:25:43 2009 (r200597) @@ -345,9 +345,10 @@ If set, the build target .Cm buildkernel defaults to setting .Va NO_KERNELCLEAN , -.Va NO_KERNELCONFIG +.Va NO_KERNELCONFIG , +.Va NO_KERNELDEPEND and -.Va NO_KERNELDEPEND . +.Va NO_KERNELOBJ . When set to a value other than .Cm 1 then @@ -444,6 +445,12 @@ If set, the build process does not run as part of the .Cm buildkernel target. +.It Va NO_KERNELOBJ +If set, the build process does not run +.Dq make obj +as part of the +.Cm buildkernel +target. .It Va NO_DOCUPDATE If set, the update process does not update the source of the .Fx From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 03:26:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DB91065676; Wed, 16 Dec 2009 03:26:38 +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 E80A48FC16; Wed, 16 Dec 2009 03:26: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 nBG3QbkX083610; Wed, 16 Dec 2009 03:26:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3QbeH083608; Wed, 16 Dec 2009 03:26:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160326.nBG3QbeH083608@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:26: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: r200598 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:26:38 -0000 Author: imp Date: Wed Dec 16 03:26:37 2009 New Revision: 200598 URL: http://svn.freebsd.org/changeset/base/200598 Log: Quick fix to make this compile: Remove redundant extern declearations. If the maintainer has a better fix, then feel free to back this out. Modified: head/sys/netinet/ipfw/ip_fw_nat.c Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 03:25:43 2009 (r200597) +++ head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 03:26:37 2009 (r200598) @@ -70,12 +70,6 @@ __FBSDID("$FreeBSD$"); static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); #define V_ifaddr_event_tag VNET(ifaddr_event_tag) -extern ipfw_nat_t *ipfw_nat_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - static void ifaddr_change(void *arg __unused, struct ifnet *ifp) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 03:29:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87A88106566C; Wed, 16 Dec 2009 03:29:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76AA28FC18; Wed, 16 Dec 2009 03:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG3T0m4083688; Wed, 16 Dec 2009 03:29:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3T0tw083685; Wed, 16 Dec 2009 03:29:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160329.nBG3T0tw083685@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200599 - in head/share/man: man5 man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:29:00 -0000 Author: imp Date: Wed Dec 16 03:29:00 2009 New Revision: 200599 URL: http://svn.freebsd.org/changeset/base/200599 Log: Forgot to bump .Dd, so do it with this commit. Chose local time over UTC time for the date... Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Dec 16 03:26:37 2009 (r200598) +++ head/share/man/man5/make.conf.5 Wed Dec 16 03:29:00 2009 (r200599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2009 +.Dd December 15, 2009 .Dt MAKE.CONF 5 .Os .Sh NAME Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Dec 16 03:26:37 2009 (r200598) +++ head/share/man/man7/build.7 Wed Dec 16 03:29:00 2009 (r200599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd December 15, 2009 .Dt BUILD 7 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 03:38:24 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52708106566C; Wed, 16 Dec 2009 03:38:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0C15C8FC08; Wed, 16 Dec 2009 03:38:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBG3WpIx003024; Tue, 15 Dec 2009 20:32:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 15 Dec 2009 20:33:20 -0700 (MST) Message-Id: <20091215.203320.789626515546446979.imp@bsdimp.com> To: luigi@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20091215.201621.756168950458235997.imp@bsdimp.com> References: <200912151615.nBFGFEOq068598@svn.freebsd.org> <20091215.201621.756168950458235997.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:38:24 -0000 In message: <20091215.201621.756168950458235997.imp@bsdimp.com> "M. Warner Losh" writes: : In message: <200912151615.nBFGFEOq068598@svn.freebsd.org> : Luigi Rizzo writes: : : Log: : : Start splitting ip_fw2.c and ip_fw.h into smaller components. : : At this time we pull out from ip_fw2.c the logging functions, and : : support for dynamic rules, and move kernel-only stuff into : : netinet/ipfw/ip_fw_private.h : : : : No ABI change involved in this commit, unless I made some mistake. : : ip_fw.h has changed, though not in the userland-visible part. : ... : : netinet/ipfw/ip_fw_nat.c : : minor rearrangement to remove LOOKUP_NAT from the : : main headers. This require a new function pointer. : : This broke the build. : : Here's the fix: : : Index: sys/netinet/ipfw/ip_fw_nat.c : =================================================================== : --- sys/netinet/ipfw/ip_fw_nat.c (revision 200593) : +++ sys/netinet/ipfw/ip_fw_nat.c (working copy) : @@ -70,12 +70,6 @@ : static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); : #define V_ifaddr_event_tag VNET(ifaddr_event_tag) : : -extern ipfw_nat_t *ipfw_nat_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; : - : static void : ifaddr_change(void *arg __unused, struct ifnet *ifp) : { I committed this fix. If there's a problem, feel free to back it out. Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 04:19:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A84EA106566B; Wed, 16 Dec 2009 04:19:23 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A4C8FC18; Wed, 16 Dec 2009 04:19: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 nBG4JNrB084770; Wed, 16 Dec 2009 04:19:23 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG4JNbR084768; Wed, 16 Dec 2009 04:19:23 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200912160419.nBG4JNbR084768@svn.freebsd.org> From: Matteo Riondato Date: Wed, 16 Dec 2009 04:19: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: r200600 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 04:19:23 -0000 Author: matteo Date: Wed Dec 16 04:19:23 2009 New Revision: 200600 URL: http://svn.freebsd.org/changeset/base/200600 Log: Modified: head/lib/libc/stdio/getline.3 Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Wed Dec 16 03:29:00 2009 (r200599) +++ head/lib/libc/stdio/getline.3 Wed Dec 16 04:19:23 2009 (r200600) @@ -78,7 +78,8 @@ and .Fn getline functions return the number of characters written, excluding the terminating -.Dv NUL . +.Dv NUL +character. The value \-1 is returned if an error occurs, or if end-of-file is reached. .Sh EXAMPLES The following code fragment reads lines from a file and From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 05:43:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BAC61065670; Wed, 16 Dec 2009 05:43:44 +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 AC50D8FC1A; Wed, 16 Dec 2009 05:43:43 +0000 (UTC) Received: from lstewart-laptop.caia.swin.edu.au (lstewart-laptop.caia.swin.edu.au [136.186.229.148]) (authenticated bits=0) by lauren.room52.net (8.14.3/8.14.3) with ESMTP id nBG5hV19098255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 16:43:36 +1100 (EST) (envelope-from lstewart@freebsd.org) Message-ID: <4B27684E.5050908@freebsd.org> Date: Tue, 15 Dec 2009 21:43:26 +1100 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: Jack Vogel References: <200912081854.nB8IsbrP096592@svn.freebsd.org> <4B25C3EF.5010009@freebsd.org> <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> In-Reply-To: <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_12_24,SPF_SOFTFAIL autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lauren.room52.net Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 05:43:44 -0000 Jack Vogel wrote: > Fixed in the commit today. Test again please. > > Jack > > > On Sun, Dec 13, 2009 at 8:49 PM, Lawrence Stewart > wrote: > > [picking a recent e1000 commit] > > Hi Jack, > > I'm getting the following panic on head r200376 on my HP DC7800 work > desktop: > > mtx_lock() of spin mutex &dev_spec->swflag_mutex @ > /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 > > I don't experience the panic with an 8.0-RELEASE kernel. > > Anything obviously wrong with that line of code as far as you're > concerned, or do I need to dig some more detail out? Debugging with > this system is painful, hence the initial hand transcribed minimal > detail, but if you need more info I'll try figure out how to get you > what you need. Looks good, thanks for the fix. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 06:02:38 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01785106566C; Wed, 16 Dec 2009 06:02:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9EF8FC19; Wed, 16 Dec 2009 06:02:35 +0000 (UTC) Received: from delta.allbsd.org (p3177-ipbf416funabasi.chiba.ocn.ne.jp [123.225.92.177]) (authenticated bits=128) by mail.allbsd.org (8.14.3/8.14.3) with ESMTP id nBG629Bd013631; Wed, 16 Dec 2009 15:02:21 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (alph.allbsd.org [192.168.0.10]) (authenticated bits=0) by delta.allbsd.org (8.13.4/8.13.4) with ESMTP id nBG625T6073065; Wed, 16 Dec 2009 15:02:07 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 16 Dec 2009 15:01:37 +0900 (JST) Message-Id: <20091216.150137.11277993.hrs@allbsd.org> To: dougb@FreeBSD.org, freebsd-rc@FreeBSD.org From: Hiroki Sato In-Reply-To: <4B28181B.5070503@FreeBSD.org> References: <200912070625.nB76PJli043796@svn.freebsd.org> <4B28181B.5070503@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3rc1 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Dec_16_15_01_37_2009_122)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Wed, 16 Dec 2009 15:02:27 +0900 (JST) X-Spam-Status: No, score=-5.6 required=13.0 tests=AWL,BAYES_00, CONTENT_TYPE_PRESENT, QENCPTR1, SPF_SOFTFAIL, X_MAILER_PRESENT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200205 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-rc@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 06:02:38 -0000 ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4B28181B.5070503@FreeBSD.org>: do> You apparently merged your change from r197144 without applying my fix do> for this problem above from r198162, which broke this feature in do> 8-stable. See http://www.freebsd.org/cgi/query-pr.cgi?pr=141642 do> do> In my mind breaking this feature in a -stable branch is a fairly do> serious error, and adds fuel to my growing discomfort about the do> changes you've been making in /etc. How do you suggest that we move do> forward and at the same time lessen the potential for further problems? I am really sorry for breaking it again. My intention was to merge only changes of set_rcvar* on a request, but I mistakenly included the line you fixed after I committed the original change. It is totally my fault. Sorry. I think I will add regression tests for checking rc.d functionality before merging other changes I made on -HEAD. The rc.d scripts are used in various ways now and there are some ambiguous definitions and inconsistency such as a way to set the default value to a variable, naming conventions, and so on, so for that we may need to define what are correct/acceptable ones. Anyway, I start trying to do so and this should help to prevent further inappropriate changes (in terms of whether the existing functionality is broken or not) from being added. -- Hiroki ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAksod8EACgkQTyzT2CeTzy3ZTQCdGcpJ/K8xEN2eRsWjYC6hrqh8 okYAn3uzvbOCwS85lwRq18+AZLsnhitO =j2E6 -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)---- From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 10:48:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15DD11065670; Wed, 16 Dec 2009 10:48:41 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01FBE8FC14; Wed, 16 Dec 2009 10:48: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 nBGAmeFs096553; Wed, 16 Dec 2009 10:48:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGAmeON096543; Wed, 16 Dec 2009 10:48:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161048.nBGAmeON096543@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 10:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200601 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 10:48:41 -0000 Author: luigi Date: Wed Dec 16 10:48:40 2009 New Revision: 200601 URL: http://svn.freebsd.org/changeset/base/200601 Log: Various cosmetic cleanup of the files: - move global variables around to reduce the scope and make them static if possible; - add an ipfw_ prefix to all public functions to prevent conflicts (the same should be done for variables); - try to pack variable declaration in an uniform way across files; - clarify some comments; - remove some misspelling of names (#define V_foo VNET(bar)) that slipped in due to cut&paste - remove duplicate static variables in different files; MFC after: 1 month Modified: head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_sockopt.c head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 16 10:48:40 2009 (r200601) @@ -2364,3 +2364,4 @@ static moduledata_t dummynet_mod = { DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); MODULE_DEPEND(dummynet, ipfw, 2, 2, 2); MODULE_VERSION(dummynet, 1); +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw2.c Wed Dec 16 10:48:40 2009 (r200601) @@ -26,11 +26,8 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - /* - * Implement IP packet firewall (new version) + * The FreeBSD IP packet firewall, main file */ #if !defined(KLD_MODULE) @@ -101,21 +98,17 @@ __FBSDID("$FreeBSD$"); #include #endif -static VNET_DEFINE(int, ipfw_vnet_ready) = 0; -#define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) /* - * set_disable contains one bit per set value (0..31). - * If the bit is set, all rules with the corresponding set - * are disabled. Set RESVD_SET(31) is reserved for the default rule - * and rules that are not deleted by the flush command, - * and CANNOT be disabled. - * Rules in set RESVD_SET can only be deleted explicitly. + * static variables followed by global ones. + * All ipfw global variables are here. */ -VNET_DEFINE(u_int32_t, set_disable); -VNET_DEFINE(int, fw_verbose); -#define V_set_disable VNET(set_disable) -#define V_verbose_limit VNET(verbose_limit) +/* ipfw_vnet_ready controls when we are open for business */ +static VNET_DEFINE(int, ipfw_vnet_ready) = 0; +#define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) + +static VNET_DEFINE(int, fw_deny_unknown_exthdrs); +#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; @@ -123,14 +116,30 @@ static int default_to_accept = 1; static int default_to_accept; #endif -struct ip_fw *ip_fw_default_rule; +VNET_DEFINE(int, autoinc_step); /* - * list of rules for layer 3 + * Each rule belongs to one of 32 different sets (0..31). + * The variable set_disable contains one bit per set. + * If the bit is set, all rules in the corresponding set + * are disabled. Set RESVD_SET(31) is reserved for the default rule + * and rules that are not deleted by the flush command, + * and CANNOT be disabled. + * Rules in set RESVD_SET can only be deleted individually. */ +VNET_DEFINE(u_int32_t, set_disable); +#define V_set_disable VNET(set_disable) + +VNET_DEFINE(int, fw_verbose); +//#define V_verbose_limit VNET(verbose_limit) +/* counter for ipfw_log(NULL...) */ +VNET_DEFINE(u_int64_t, norule_counter); +VNET_DEFINE(int, verbose_limit); + + +/* layer3_chain contains the list of rules for layer 3 */ VNET_DEFINE(struct ip_fw_chain, layer3_chain); -MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; @@ -138,30 +147,16 @@ ipfw_nat_cfg_t *ipfw_nat_del_ptr; ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; -struct table_entry { - struct radix_node rn[2]; - struct sockaddr_in addr, mask; - u_int32_t value; -}; - -static VNET_DEFINE(int, autoinc_step); -#define V_autoinc_step VNET(autoinc_step) -static VNET_DEFINE(int, fw_deny_unknown_exthdrs); -#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) - extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); -SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, enable, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, - ipfw_chg_hook, "I", "Enable ipfw"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, - CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, - "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, "Only do a single pass through ipfw when using dummynet(4)"); +SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, + CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, + "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_verbose), 0, "Log matches to ipfw rules"); @@ -182,9 +177,6 @@ TUNABLE_INT("net.inet.ip.fw.default_to_a #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); -SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, - ipfw_chg_hook, "I", "Enable ipfw+6"); SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); @@ -194,6 +186,7 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A /* + * Some macros used in the various matching options. * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T * Other macros just cast void * into the appropriate type */ @@ -379,19 +372,20 @@ iface_match(struct ifnet *ifp, ipfw_insn * * The 'verrevpath' option checks that the interface that an IP packet * arrives on is the same interface that traffic destined for the - * packet's source address would be routed out of. The 'versrcreach' - * option just checks that the source address is reachable via any route - * (except default) in the routing table. These two are a measure to block - * forged packets. This is also commonly known as "anti-spoofing" or Unicast - * Reverse Path Forwarding (Unicast RFP) in Cisco-ese. The name of the knobs + * packet's source address would be routed out of. + * The 'versrcreach' option just checks that the source address is + * reachable via any route (except default) in the routing table. + * These two are a measure to block forged packets. This is also + * commonly known as "anti-spoofing" or Unicast Reverse Path + * Forwarding (Unicast RFP) in Cisco-ese. The name of the knobs * is purposely reminiscent of the Cisco IOS command, * * ip verify unicast reverse-path * ip verify unicast source reachable-via any * - * which implements the same functionality. But note that syntax is - * misleading. The check may be performed on all IP packets whether unicast, - * multicast, or broadcast. + * which implements the same functionality. But note that the syntax + * is misleading, and the check may be performed on all IP packets + * whether unicast, multicast, or broadcast. */ static int verify_path(struct in_addr src, struct ifnet *ifp, u_int fib) @@ -536,6 +530,7 @@ verify_path6(struct in6_addr *src, struc return 1; } + static int is_icmp6_query(int icmp6_type) { @@ -562,7 +557,7 @@ send_reject6(struct ip_fw_args *args, in if ((tcp->th_flags & TH_RST) == 0) { struct mbuf *m0; - m0 = send_pkt(args->m, &(args->f_id), + m0 = ipfw_send_pkt(args->m, &(args->f_id), ntohl(tcp->th_seq), ntohl(tcp->th_ack), tcp->th_flags | TH_RST); if (m0 != NULL) @@ -622,7 +617,7 @@ send_reject(struct ip_fw_args *args, int L3HDR(struct tcphdr, mtod(args->m, struct ip *)); if ( (tcp->th_flags & TH_RST) == 0) { struct mbuf *m; - m = send_pkt(args->m, &(args->f_id), + m = ipfw_send_pkt(args->m, &(args->f_id), ntohl(tcp->th_seq), ntohl(tcp->th_ack), tcp->th_flags | TH_RST); if (m != NULL) @@ -635,18 +630,18 @@ send_reject(struct ip_fw_args *args, int } /** - * * Given an ip_fw *, lookup_next_rule will return a pointer * to the next rule, which can be either the jump * target (for skipto instructions) or the next one in the list (in * all other cases including a missing jump target). * The result is also written in the "next_rule" field of the rule. - * Backward jumps are not allowed, so start looking from the next - * rule... + * Backward jumps are not allowed, so we start the search from the + * rule following the current one. * - * This never returns NULL -- in case we do not have an exact match, - * the next rule is returned. When the ruleset is changed, - * pointers are flushed so we are always correct. + * The function never returns NULL: if the requested rule is not + * present, it returns the next rule in the chain. + * As a side effect, the rule pointer is also set so next time + * the jump will not require a scan of the list. */ static struct ip_fw * @@ -676,12 +671,22 @@ lookup_next_rule(struct ip_fw *me, u_int } } } - if (rule == NULL) /* failure or not a skipto */ + if (rule == NULL) /* failure or not a skipto */ rule = me->next; me->next_rule = rule; return rule; } +/* + * Support for uid/gid/jail lookup. These tests are expensive + * (because we may need to look into the list of active sockets) + * so we cache the results. ugid_lookupp is 0 if we have not + * yet done a lookup, 1 if we succeeded, and -1 if we tried + * and failed. The function always returns the match value. + * We could actually spare the variable and use *uc, setting + * it to '(void *)check_uidgid if we have no info, NULL if + * we tried and failed, or any other value if successful. + */ static int check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif, struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip, @@ -740,10 +745,8 @@ check_uidgid(ipfw_insn_u32 *insn, int pr INP_INFO_RUNLOCK(pi); if (*ugid_lookupp == 0) { /* - * If the lookup did not yield any results, there - * is no sense in coming back and trying again. So - * we can set lookup to -1 and ensure that we wont - * bother the pcb system again. + * We tried and failed, set the variable to -1 + * so we will not try again on this packet. */ *ugid_lookupp = -1; return (0); @@ -768,10 +771,10 @@ check_uidgid(ipfw_insn_u32 *insn, int pr * * args->m (in/out) The packet; we set to NULL when/if we nuke it. * Starts with the IP header. - * args->eh (in) Mac header if present, or NULL for layer3 packet. + * args->eh (in) Mac header if present, NULL for layer3 packet. * args->L3offset Number of bytes bypassed if we came from L2. * e.g. often sizeof(eh) ** NOTYET ** - * args->oif Outgoing interface, or NULL if packet is incoming. + * args->oif Outgoing interface, NULL if packet is incoming. * The incoming interface is in the mbuf. (in) * args->divert_rule (in/out) * Skip up to the first rule past this rule number; @@ -797,7 +800,7 @@ ipfw_chk(struct ip_fw_args *args) { /* - * Local variables holding state during the processing of a packet: + * Local variables holding state while processing a packet: * * IMPORTANT NOTE: to speed up the processing of rules, there * are some assumption on the values of the variables, which @@ -932,15 +935,15 @@ ipfw_chk(struct ip_fw_args *args) * pointer might become stale after other pullups (but we never use it * this way). */ -#define PULLUP_TO(_len, p, T) \ -do { \ - int x = (_len) + sizeof(T); \ - if ((m)->m_len < x) { \ - args->m = m = m_pullup(m, x); \ - if (m == NULL) \ - goto pullup_failed; \ - } \ - p = (mtod(m, char *) + (_len)); \ +#define PULLUP_TO(_len, p, T) \ +do { \ + int x = (_len) + sizeof(T); \ + if ((m)->m_len < x) { \ + args->m = m = m_pullup(m, x); \ + if (m == NULL) \ + goto pullup_failed; \ + } \ + p = (mtod(m, char *) + (_len)); \ } while (0) /* @@ -1199,7 +1202,7 @@ do { \ if (f != NULL) f = f->next_rule; else - f = ip_fw_default_rule; + f = V_layer3_chain.default_rule; } else f = args->rule->next_rule; @@ -1905,7 +1908,7 @@ do { \ */ case O_LIMIT: case O_KEEP_STATE: - if (install_state(f, + if (ipfw_install_state(f, (ipfw_insn_limit *)cmd, args, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; @@ -1927,7 +1930,7 @@ do { \ * to be run first). */ if (dyn_dir == MATCH_UNKNOWN && - (q = lookup_dyn_rule(&args->f_id, + (q = ipfw_lookup_dyn_rule(&args->f_id, &dyn_dir, proto == IPPROTO_TCP ? TCP(ulp) : NULL)) != NULL) { @@ -2251,7 +2254,11 @@ pullup_failed: return (IP_FW_DENY); } -/**************** +/* + * Module and VNET glue + */ + +/* * Stuff that must be initialised only on boot or module load */ static int @@ -2306,7 +2313,7 @@ ipfw_init(void) return (error); } -/********************** +/* * Called for the removal of the last instance only on module unload. */ static void @@ -2317,7 +2324,7 @@ ipfw_destroy(void) printf("IP firewall unloaded\n"); } -/**************** +/* * Stuff that must be initialized for every instance * (including the first of course). */ @@ -2345,7 +2352,6 @@ vnet_ipfw_init(const void *unused) V_autoinc_step = 100; /* bounded to 1..1000 in add_rule() */ - V_fw_deny_unknown_exthdrs = 1; V_layer3_chain.rules = NULL; @@ -2368,7 +2374,7 @@ vnet_ipfw_init(const void *unused) return (error); } - ip_fw_default_rule = V_layer3_chain.rules; + V_layer3_chain.default_rule = V_layer3_chain.rules; ipfw_dyn_init(); @@ -2391,20 +2397,11 @@ vnet_ipfw_init(const void *unused) */ V_ip_fw_ctl_ptr = ipfw_ctl; V_ip_fw_chk_ptr = ipfw_chk; - if (V_fw_enable && ipfw_hook() != 0) { - error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ - printf("ipfw_hook() error\n"); - } -#ifdef INET6 - if (V_fw6_enable && ipfw6_hook() != 0) { - error = ENOENT; - printf("ipfw6_hook() error\n"); - } -#endif + error = ipfw_attach_hooks(); return (error); } -/*********************** +/* * Called for the removal of each instance. */ static int @@ -2514,4 +2511,4 @@ SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIRE ipfw_destroy, NULL); VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, vnet_ipfw_uninit, NULL); - +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 10:48:40 2009 (r200601) @@ -114,6 +114,10 @@ __FBSDID("$FreeBSD$"); * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ + +/* + * Static variables followed by global ones + */ static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); static VNET_DEFINE(u_int32_t, dyn_buckets); static VNET_DEFINE(u_int32_t, curr_dyn_buckets); @@ -374,7 +378,7 @@ next: } void -remove_dyn_children(struct ip_fw *rule) +ipfw_remove_dyn_children(struct ip_fw *rule) { IPFW_DYN_LOCK(); remove_dyn_rule(rule, NULL /* force removal */); @@ -382,9 +386,9 @@ remove_dyn_children(struct ip_fw *rule) } /** - * lookup a dynamic rule. + * lookup a dynamic rule, locked version */ -ipfw_dyn_rule * +static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { @@ -528,7 +532,7 @@ done: } ipfw_dyn_rule * -lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, +ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { ipfw_dyn_rule *q; @@ -699,7 +703,7 @@ lookup_dyn_parent(struct ipfw_flow_id *p * session limitations are enforced. */ int -install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, +ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { static int last_log; @@ -877,7 +881,7 @@ install_state(struct ip_fw *rule, ipfw_i * so that MAC can label the reply appropriately. */ struct mbuf * -send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, +ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, u_int32_t ack, int flags) { struct mbuf *m; @@ -1065,9 +1069,9 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - m = send_pkt(NULL, &(q->id), q->ack_rev - 1, + m = ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, q->ack_fwd, TH_SYN); - mnext = send_pkt(NULL, &(q->id), q->ack_fwd - 1, + mnext = ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, q->ack_rev, 0); switch (q->id.addr_type) { @@ -1222,3 +1226,4 @@ ipfw_get_dynamic(char **pbp, const char bzero(&last->next, sizeof(last)); *pbp = bp; } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_log.c Wed Dec 16 10:48:40 2009 (r200601) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #define ICMP(p) ((struct icmphdr *)(p)) #define ICMP6(p) ((struct icmp6_hdr *)(p)) -/* counter for ipfw_log(NULL...) */ -VNET_DEFINE(u_int64_t, norule_counter); -VNET_DEFINE(int, verbose_limit); - #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) @@ -369,3 +365,4 @@ ipfw_log(struct ip_fw *f, u_int hlen, st "ipfw: limit %d reached on entry %d\n", limit_reached, f ? f->rulenum : -1); } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 10:48:40 2009 (r200601) @@ -671,3 +671,4 @@ DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, S MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1); MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2); MODULE_VERSION(ipfw_nat, 1); +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Wed Dec 16 10:48:40 2009 (r200601) @@ -68,9 +68,12 @@ __FBSDID("$FreeBSD$"); #include -VNET_DEFINE(int, fw_enable) = 1; +static VNET_DEFINE(int, fw_enable) = 1; +#define V_fw_enable VNET(fw_enable) + #ifdef INET6 -VNET_DEFINE(int, fw6_enable) = 1; +static VNET_DEFINE(int, fw6_enable) = 1; +#define V_fw6_enable VNET(fw6_enable) #endif int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); @@ -86,6 +89,19 @@ static int ipfw_divert(struct mbuf **, i #define DIV_DIR_IN 1 #define DIV_DIR_OUT 0 +#ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet_ip_fw); +SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, + ipfw_chg_hook, "I", "Enable ipfw"); +#ifdef INET6 +SYSCTL_DECL(_net_inet6_ip6_fw); +SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, + ipfw_chg_hook, "I", "Enable ipfw+6"); +#endif /* INET6 */ +#endif /* SYSCTL_NODE */ + int ipfw_check_in(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) @@ -443,7 +459,7 @@ nodivert: return 1; } -int +static int ipfw_hook(void) { struct pfil_head *pfh_inet; @@ -478,7 +494,7 @@ ipfw_unhook(void) } #ifdef INET6 -int +static int ipfw6_hook(void) { struct pfil_head *pfh_inet6; @@ -514,6 +530,24 @@ ipfw6_unhook(void) #endif /* INET6 */ int +ipfw_attach_hooks(void) +{ + int error = 0; + + if (V_fw_enable && ipfw_hook() != 0) { + error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ + printf("ipfw_hook() error\n"); + } +#ifdef INET6 + if (V_fw6_enable && ipfw6_hook() != 0) { + error = ENOENT; + printf("ipfw6_hook() error\n"); + } +#endif + return error; +} + +int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { int enable; @@ -566,4 +600,4 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) return (0); } - +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_private.h Wed Dec 16 10:48:40 2009 (r200601) @@ -99,12 +99,12 @@ MALLOC_DECLARE(M_IPFW); /* Firewall hooks */ -int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); +int ipfw_check_in(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *inp); +int ipfw_check_out(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *inp); - -int ipfw_hook(void); -int ipfw6_hook(void); +int ipfw_attach_hooks(void); int ipfw_unhook(void); int ipfw6_unhook(void); #ifdef NOTYET @@ -138,15 +138,13 @@ enum { /* result for matching dynamic ru void ipfw_dyn_unlock(void); struct tcphdr; -struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, +struct mbuf *ipfw_send_pkt(struct mbuf *, struct ipfw_flow_id *, u_int32_t, u_int32_t, int); -int install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, +int ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg); -ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp); -ipfw_dyn_rule * lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp); -void remove_dyn_children(struct ip_fw *rule); +ipfw_dyn_rule *ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, + int *match_direction, struct tcphdr *tcp); +void ipfw_remove_dyn_children(struct ip_fw *rule); void ipfw_get_dynamic(char **bp, const char *ep); void ipfw_dyn_attach(void); /* uma_zcreate .... */ @@ -157,25 +155,24 @@ int ipfw_dyn_len(void); /* common variables */ VNET_DECLARE(int, fw_one_pass); -VNET_DECLARE(int, fw_enable); +#define V_fw_one_pass VNET(fw_one_pass) + VNET_DECLARE(int, fw_verbose); -VNET_DECLARE(struct ip_fw_chain, layer3_chain); -VNET_DECLARE(u_int32_t, set_disable); +#define V_fw_verbose VNET(fw_verbose) -#define V_fw_one_pass VNET(fw_one_pass) -#define V_fw_enable VNET(fw_enable) -#define V_fw_verbose VNET(fw_enable) +VNET_DECLARE(struct ip_fw_chain, layer3_chain); #define V_layer3_chain VNET(layer3_chain) + +VNET_DECLARE(u_int32_t, set_disable); #define V_set_disable VNET(set_disable) -#ifdef INET6 -VNET_DECLARE(int, fw6_enable); -#define V_fw6_enable VNET(fw6_enable) -#endif +VNET_DECLARE(int, autoinc_step); +#define V_autoinc_step VNET(autoinc_step) struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ + struct ip_fw *default_rule; LIST_HEAD(nat_list, cfg_nat) nat; /* list of nat entries */ struct radix_node_head *tables[IPFW_TABLES_MAX]; struct rwlock rwmtx; @@ -236,6 +233,5 @@ extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - #endif /* _KERNEL */ #endif /* _IPFW2_PRIVATE_H */ Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 10:48:40 2009 (r200601) @@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$"); #define DDB(x) x /* - * Sockopt support for ipfw + * Sockopt support for ipfw. The routines here implement + * the upper half of the ipfw code. */ #if !defined(KLD_MODULE) @@ -72,8 +73,11 @@ __FBSDID("$FreeBSD$"); #include #endif -static VNET_DEFINE(int, autoinc_step); -#define V_autoinc_step VNET(autoinc_step) +MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); + +/* + * static variables followed by global ones + */ static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ @@ -210,7 +214,7 @@ remove_rule(struct ip_fw_chain *chain, s IPFW_WLOCK_ASSERT(chain); n = rule->next; - remove_dyn_children(rule); + ipfw_remove_dyn_children(rule); if (prev == NULL) chain->rules = n; else @@ -474,7 +478,7 @@ zero_entry(struct ip_fw_chain *chain, u_ /* * Check validity of the structure before insert. - * Fortunately rules are simple, so this mostly need to check rule sizes. + * Rules are simple, so this mostly need to check rule sizes. */ static int check_ipfw_struct(struct ip_fw *rule, int size) @@ -821,7 +825,7 @@ ipfw_getrules(struct ip_fw_chain *chain, } } IPFW_RUNLOCK(chain); - ipfw_get_dynamic(&bp, ep); + ipfw_get_dynamic(&bp, ep); /* protected by the dynamic lock */ return (bp - (char *)buf); } @@ -1094,3 +1098,4 @@ ipfw_ctl(struct sockopt *sopt) return (error); #undef RULE_MAXSIZE } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_table.c Wed Dec 16 10:48:40 2009 (r200601) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002 ......... * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,14 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - /* - * Sockopt support for ipfw + * Lookup table support for ipfw + * + * Lookup tables are implemented (at the moment) using the radix + * tree used for routing tables. Tables store key-value entries, where + * keys are network prefixes (addr/masklen), and values are integers. + * As a degenerate case we can interpret keys as 32-bit integers + * (with a /32 mask). */ #if !defined(KLD_MODULE) @@ -259,3 +262,4 @@ ipfw_dump_table(struct ip_fw_chain *ch, rnh->rnh_walktree(rnh, dump_table_entry, tbl); return (0); } +/* end of file */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 12:25:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C4210656A4; Wed, 16 Dec 2009 12:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762D68FC1F; Wed, 16 Dec 2009 12:25: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 nBGCPRe2098626; Wed, 16 Dec 2009 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGCPRVQ098624; Wed, 16 Dec 2009 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912161225.nBGCPRVQ098624@svn.freebsd.org> From: Andriy Gapon Date: Wed, 16 Dec 2009 12:25: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: r200602 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 12:25:27 -0000 Author: avg Date: Wed Dec 16 12:25:27 2009 New Revision: 200602 URL: http://svn.freebsd.org/changeset/base/200602 Log: ichsmb: add another pci id This is SMBus controller found in Intel Platform Controller Hub (PCH), which is a general name that refers to Intel 5 Series chipsets and 3400 Series chipsets. Submitted by: Dmitry S. Luhtionov MFC after: 3 days Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 16 10:48:40 2009 (r200601) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 16 12:25:27 2009 (r200602) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define ID_82801H 0x283e8086 #define ID_82801I 0x29308086 #define ID_82801JI 0x3a308086 +#define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -164,6 +165,9 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH: + device_set_desc(dev, "Intel PCH SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 13:00:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D24106568D; Wed, 16 Dec 2009 13:00:39 +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 644D58FC0A; Wed, 16 Dec 2009 13:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGD0dI1099410; Wed, 16 Dec 2009 13:00:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGD0dEV099407; Wed, 16 Dec 2009 13:00:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161300.nBGD0dEV099407@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200603 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 13:00:39 -0000 Author: luigi Date: Wed Dec 16 13:00:37 2009 New Revision: 200603 URL: http://svn.freebsd.org/changeset/base/200603 Log: bring back a couple of #include that are supplied by nesting, and explain why they are used. Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 12:25:27 2009 (r200602) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 13:00:37 2009 (r200603) @@ -66,8 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* IN6_ARE_ADDR_EQUAL */ #ifdef INET6 -#include #include #include #endif Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 12:25:27 2009 (r200602) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 13:00:37 2009 (r200603) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* struct m_tag used by nested headers */ #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 14:34:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DF30106566B; Wed, 16 Dec 2009 14:34:49 +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 140F38FC29; Wed, 16 Dec 2009 14: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 nBGEYmTi001717; Wed, 16 Dec 2009 14:34:48 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGEYm6u001716; Wed, 16 Dec 2009 14:34:48 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912161434.nBGEYm6u001716@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 16 Dec 2009 14:34: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: r200604 - head/usr.bin/comm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 14:34:49 -0000 Author: jh Date: Wed Dec 16 14:34:48 2009 New Revision: 200604 URL: http://svn.freebsd.org/changeset/base/200604 Log: - Prevent overflowing of the buffer length variable in getline() by limiting its maximum value. - Exit if reallocf(3) fails in getline(). Failure was silently considered as end-of-file. Reviewed by: ghelmer Approved by: trasz (mentor) Modified: head/usr.bin/comm/comm.c Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Wed Dec 16 13:00:37 2009 (r200603) +++ head/usr.bin/comm/comm.c Wed Dec 16 14:34:48 2009 (r200604) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,7 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define MAXLINELEN (LINE_MAX + 1) +#define INITLINELEN (LINE_MAX + 1) +#define MAXLINELEN ((SIZE_MAX / sizeof(wchar_t)) / 2) const wchar_t *tabs[] = { L"", L"\t", L"\t\t" }; @@ -83,8 +85,8 @@ main(int argc, char *argv[]) flag1 = flag2 = flag3 = 1; iflag = 0; - line1len = MAXLINELEN; - line2len = MAXLINELEN; + line1len = INITLINELEN; + line2len = INITLINELEN; line1 = malloc(line1len * sizeof(*line1)); line2 = malloc(line2len * sizeof(*line2)); if (line1 == NULL || line2 == NULL) @@ -193,9 +195,13 @@ getline(wchar_t *buf, size_t *buflen, FI while ((ch = getwc(fp)) != WEOF && ch != '\n') { if (bufpos + 1 >= *buflen) { *buflen = *buflen * 2; + if (*buflen > MAXLINELEN) + errx(1, + "Maximum line buffer length (%zu) exceeded", + MAXLINELEN); buf = reallocf(buf, *buflen * sizeof(*buf)); if (buf == NULL) - return (NULL); + err(1, "reallocf"); } buf[bufpos++] = ch; } @@ -251,13 +257,13 @@ wcsicoll(const wchar_t *s1, const wchar_ new_l2_buflen = wcsicoll_l2_buflen; while (new_l1_buflen < l1) { if (new_l1_buflen == 0) - new_l1_buflen = MAXLINELEN; + new_l1_buflen = INITLINELEN; else new_l1_buflen *= 2; } while (new_l2_buflen < l2) { if (new_l2_buflen == 0) - new_l2_buflen = MAXLINELEN; + new_l2_buflen = INITLINELEN; else new_l2_buflen *= 2; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 16:24:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BB1106568D; Wed, 16 Dec 2009 16:24:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46E0E8FC18; Wed, 16 Dec 2009 16:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGGOXcu004301; Wed, 16 Dec 2009 16:24:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGGOXfR004300; Wed, 16 Dec 2009 16:24:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912161624.nBGGOXfR004300@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Dec 2009 16:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200605 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 16:24:33 -0000 Author: jhb Date: Wed Dec 16 16:24:32 2009 New Revision: 200605 URL: http://svn.freebsd.org/changeset/base/200605 Log: Add entries to NOTES for the modular phy support so that these options are documented. PR: docs/141358 Submitted by: Bruce Cran Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Dec 16 14:34:48 2009 (r200604) +++ head/sys/conf/NOTES Wed Dec 16 16:24:32 2009 (r200605) @@ -1812,14 +1812,47 @@ device puc # # Network interfaces: # -# MII bus support is required for some PCI 10/100 ethernet NICs, +# MII bus support is required for many PCI Ethernet NICs, # namely those which use MII-compliant transceivers or implement -# transceiver control interfaces that operate like an MII. Adding +# transceiver control interfaces that operate like an MII. Adding # "device miibus" to the kernel config pulls in support for # the generic miibus API and all of the PHY drivers, including a # generic one for PHYs that aren't specifically handled by an -# individual driver. -device miibus +# individual driver. Support for specific PHYs may be built by adding +# "device mii" then adding the appropriate PHY driver. +device miibus # MII support including all PHYs +device mii # Minimal MII support + +device acphy # Altima Communications AC101 +device amphy # AMD AM79c873 / Davicom DM910{1,2} +device atphy # Attansic/Atheros F1 +device axphy # Asix Semiconductor AX88x9x +device bmtphy # Broadcom BCM5201/BCM5202 and 3Com 3c905C +device brgphy # Broadcom BCM54xx/57xx 1000baseTX +device ciphy # Cicada/Vitesse CS/VSC8xxx +device e1000phy # Marvell 88E1000 1000/100/10-BT +device exphy # 3Com internal PHY +device gentbi # Generic 10-bit 1000BASE-{LX,SX} fiber ifaces +device icsphy # ICS ICS1889-1893 +device inphy # Intel 82553/82555 +device ip1000phy # IC Plus IP1000A/IP1001 +device jmphy # JMicron JMP211/JMP202 +device lxtphy # Level One LXT-970 +device mlphy # Micro Linear 6692 +device nsgphy # NatSemi DP8361/DP83865/DP83891 +device nsphy # NatSemi DP83840A +device nsphyter # NatSemi DP83843/DP83815 +device pnaphy # HomePNA +device qsphy # Quality Semiconductor QS6612 +device rgephy # RealTek 8169S/8110S/8211B/8211C +device rlphy # RealTek 8139 +device rlswitch # RealTek 8305 +device ruephy # RealTek RTL8150 +device smcphy # SMSC LAN91C111 +device tdkphy # TDK 89Q2120 +device tlphy # Texas Instruments ThunderLAN +device truephy # LSI TruePHY +device xmphy # XaQti XMAC II # an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA, # PCI and ISA varieties. From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 17:17:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049CE1065670; Wed, 16 Dec 2009 17:17:41 +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 E78788FC0C; Wed, 16 Dec 2009 17:17: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 nBGHHeF2005544; Wed, 16 Dec 2009 17:17:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHHeQZ005541; Wed, 16 Dec 2009 17:17:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912161717.nBGHHeQZ005541@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 17:17: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: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:17:41 -0000 Author: imp Date: Wed Dec 16 17:17:40 2009 New Revision: 200606 URL: http://svn.freebsd.org/changeset/base/200606 Log: Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. Note: Not sure this is the right way to do compat, but it makes the headers consistent with the implementations. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 16:24:32 2009 (r200605) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 17:17:40 2009 (r200606) @@ -692,7 +692,8 @@ int freebsd6_freebsd32_ftruncate(struct #endif /* COMPAT_FREEBSD6 */ -#ifdef COMPAT_FREEBSD7 +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -714,7 +715,7 @@ int freebsd7_freebsd32_semctl(struct thr int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); -#endif /* COMPAT_FREEBSD7 */ +#endif #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Dec 16 16:24:32 2009 (r200605) +++ head/sys/sys/sysproto.h Wed Dec 16 17:17:40 2009 (r200606) @@ -2242,13 +2242,8 @@ int freebsd4_sigreturn(struct thread *, #endif /* COMPAT_FREEBSD4 */ -#ifdef COMPAT_FREEBSD6 - - -#endif /* COMPAT_FREEBSD6 */ - - -#ifdef COMPAT_FREEBSD7 +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct freebsd7___semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -2270,7 +2265,7 @@ int freebsd7___semctl(struct thread *, s int freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *); int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); -#endif /* COMPAT_FREEBSD7 */ +#endif #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 17:42:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF5B1065672; Wed, 16 Dec 2009 17:42:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2098FC12; Wed, 16 Dec 2009 17:42: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 nBGHg3Li006087; Wed, 16 Dec 2009 17:42:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHg3Cc006085; Wed, 16 Dec 2009 17:42:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912161742.nBGHg3Cc006085@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Dec 2009 17:42: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: r200607 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:42:03 -0000 Author: mav Date: Wed Dec 16 17:42:02 2009 New Revision: 200607 URL: http://svn.freebsd.org/changeset/base/200607 Log: Large I/Os on Promise controllers reported to cause UDMA ICRC errors and subsequent timeouts. Restore previous limit for now, at least until I will have hardware to experiment. PR: kern/141438 Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:17:40 2009 (r200606) +++ head/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:42:02 2009 (r200607) @@ -957,6 +957,7 @@ ata_promise_mio_dmainit(device_t dev) ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; + ch->dma.max_iosize = 65536; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 17:48:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3EFC1065670; Wed, 16 Dec 2009 17:48:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23FB8FC08; Wed, 16 Dec 2009 17:48: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 nBGHmQv5006272; Wed, 16 Dec 2009 17:48:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHmQn1006270; Wed, 16 Dec 2009 17:48:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912161748.nBGHmQn1006270@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Dec 2009 17:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200608 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:48:27 -0000 Author: mav Date: Wed Dec 16 17:48:26 2009 New Revision: 200608 URL: http://svn.freebsd.org/changeset/base/200608 Log: MFC r200607: Large I/Os on Promise controllers reported to cause UDMA ICRC errors and subsequent timeouts. Restore previous limit for now, at least until I will have hardware to experiment. PR: kern/141438 Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:42:02 2009 (r200607) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:48:26 2009 (r200608) @@ -957,6 +957,7 @@ ata_promise_mio_dmainit(device_t dev) ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; + ch->dma.max_iosize = 65536; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 18:03:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D108F1065670; Wed, 16 Dec 2009 18:03:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6AAE8FC23; Wed, 16 Dec 2009 18:03: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 nBGI3Qli006628; Wed, 16 Dec 2009 18:03:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGI3Qk3006626; Wed, 16 Dec 2009 18:03:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161803.nBGI3Qk3006626@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 18:03: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: r200609 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:03:27 -0000 Author: yongari Date: Wed Dec 16 18:03:25 2009 New Revision: 200609 URL: http://svn.freebsd.org/changeset/base/200609 Log: All vge(4) controllers support RX/TX checksum offloading for VLAN tagged frames so add checksum offloading capabilities. Also add missing VLAN hardware tagging control in ioctl handler and let upper stack know current VLAN capabilities. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 17:48:26 2009 (r200608) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 18:03:25 2009 (r200609) @@ -180,6 +180,7 @@ static void vge_reset(struct vge_softc * static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); static void vge_setmulti(struct vge_softc *); +static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); @@ -504,6 +505,23 @@ fail: return (error); } +static void +vge_setvlan(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint8_t cfg; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + cfg = CSR_READ_1(sc, VGE_RXCFG); + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + cfg |= VGE_VTAG_OPT2; + else + cfg &= ~VGE_VTAG_OPT2; + CSR_WRITE_1(sc, VGE_RXCFG, cfg); +} + /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, @@ -1050,7 +1068,8 @@ vge_attach(device_t dev) ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_start = vge_start; ifp->if_hwassist = VGE_CSUM_FEATURES; - ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTAGGING; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2010,7 +2029,7 @@ vge_init_locked(struct vge_softc *sc) * reception of VLAN tagged frames. */ CSR_CLRBIT_1(sc, VGE_RXCFG, VGE_RXCFG_FIFO_THR|VGE_RXCFG_VTAGOPT); - CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES|VGE_VTAG_OPT2); + CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES); /* Set DMA burst length */ CSR_CLRBIT_1(sc, VGE_DMACFG0, VGE_DMACFG0_BURSTLEN); @@ -2072,6 +2091,7 @@ vge_init_locked(struct vge_softc *sc) /* Init the multicast filter. */ vge_setmulti(sc); + vge_setvlan(sc); /* Enable flow control */ @@ -2242,7 +2262,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFMTU: @@ -2287,8 +2307,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { @@ -2325,8 +2344,16 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + vge_setvlan(sc); + } VGE_UNLOCK(sc); - } + VLAN_CAPABILITIES(ifp); break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 18:03:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F214B10656EE; Wed, 16 Dec 2009 18:03:36 +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 028838FC0C; Wed, 16 Dec 2009 18:03: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 nBGI3ZuE006671; Wed, 16 Dec 2009 18:03:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGI3Zoh006669; Wed, 16 Dec 2009 18:03:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161803.nBGI3Zoh006669@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 18:03: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: r200610 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:03:37 -0000 Author: luigi Date: Wed Dec 16 18:03:35 2009 New Revision: 200610 URL: http://svn.freebsd.org/changeset/base/200610 Log: remove a duplicate sysctl entry Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 18:03:25 2009 (r200609) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 18:03:35 2009 (r200610) @@ -81,15 +81,13 @@ MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "Ip */ static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ #define V_static_count VNET(static_count) + +static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ #define V_static_len VNET(static_len) #ifdef SYSCTL_NODE SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, - CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, - "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, CTLFLAG_RD, &VNET_NAME(static_count), 0, "Number of static rules"); From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 18:39:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45CF1065670; Wed, 16 Dec 2009 18:39:32 +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 98E7B8FC12; Wed, 16 Dec 2009 18:39: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 nBGIdWsp007457; Wed, 16 Dec 2009 18:39:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGIdW2d007453; Wed, 16 Dec 2009 18:39:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912161839.nBGIdW2d007453@svn.freebsd.org> From: Marius Strobl Date: Wed, 16 Dec 2009 18:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200611 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:39:32 -0000 Author: marius Date: Wed Dec 16 18:39:32 2009 New Revision: 200611 URL: http://svn.freebsd.org/changeset/base/200611 Log: MFC: r200459 Unbreak the ata_atapi() usage. Since r200171 (MFC'ed in r200432) the mode setting functions get a ata_device type device passed instead of a ata_channel one, thus ata_atapi() has to be adjusted accordingly. Reviewed by: mav Modified: stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/chipsets/ata-ite.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/ata-all.c Wed Dec 16 18:39:32 2009 (r200611) @@ -1150,12 +1150,11 @@ ata_satarev2str(int rev) } int -ata_atapi(device_t dev) +ata_atapi(device_t dev, int target) { - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(dev); - return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); + return (ch->devices & (ATA_ATAPI_MASTER << target)); } int Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/ata-all.h Wed Dec 16 18:39:32 2009 (r200611) @@ -622,7 +622,7 @@ void ata_udelay(int interval); char *ata_unit2str(struct ata_device *atadev); const char *ata_mode2str(int mode); const char *ata_satarev2str(int rev); -int ata_atapi(device_t dev); +int ata_atapi(device_t dev, int target); int ata_pmode(struct ata_params *ap); int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ite.c Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/chipsets/ata-ite.c Wed Dec 16 18:39:32 2009 (r200611) @@ -212,12 +212,12 @@ ata_ite_8213_setmode(device_t dev, int t reg40 |= 0x4033; /* Set PIO/WDMA timings. */ if (target == 0) { - reg40 |= (ata_atapi(dev) ? 0x04 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x04 : 0x00); mask40 = 0x3300; new40 = timings[ata_mode2idx(piomode)] << 8; } else { - reg40 |= (ata_atapi(dev) ? 0x40 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x40 : 0x00); mask44 = 0x0f; new44 = ((timings[ata_mode2idx(piomode)] & 0x30) >> 2) | (timings[ata_mode2idx(piomode)] & 0x03); From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 19:32:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D08621065672; Wed, 16 Dec 2009 19:32:44 +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 BF35A8FC12; Wed, 16 Dec 2009 19:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJWi3Y008557; Wed, 16 Dec 2009 19:32:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJWih7008555; Wed, 16 Dec 2009 19:32:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161932.nBGJWih7008555@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:32: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: r200613 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:32:44 -0000 Author: yongari Date: Wed Dec 16 19:32:44 2009 New Revision: 200613 URL: http://svn.freebsd.org/changeset/base/200613 Log: Rewrite RX filter setup and simplify code. Now promiscuous mode and multicast handling is performed in single function, vge_rxfilter(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:27:54 2009 (r200612) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:32:44 2009 (r200613) @@ -179,7 +179,7 @@ static void vge_read_eeprom(struct vge_s static void vge_reset(struct vge_softc *); static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); -static void vge_setmulti(struct vge_softc *); +static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); @@ -528,32 +528,43 @@ vge_setvlan(struct vge_softc *sc) * we use the hash filter instead. */ static void -vge_setmulti(struct vge_softc *sc) +vge_rxfilter(struct vge_softc *sc) { struct ifnet *ifp; - int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2]; + uint8_t rxcfg; + int error = 0; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - /* First, zot all the multicast entries. */ - vge_cam_clear(sc); - CSR_WRITE_4(sc, VGE_MAR0, 0); - CSR_WRITE_4(sc, VGE_MAR1, 0); + hashes[0] = 0; + hashes[1] = 0; + rxcfg = CSR_READ_1(sc, VGE_RXCTL); + rxcfg &= ~(VGE_RXCTL_RX_MCAST | VGE_RXCTL_RX_BCAST | + VGE_RXCTL_RX_PROMISC); /* - * If the user wants allmulti or promisc mode, enable reception - * of all multicast frames. + * Always allow VLAN oversized frames and frames for + * this host. */ - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - CSR_WRITE_4(sc, VGE_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, VGE_MAR1, 0xFFFFFFFF); - return; + rxcfg |= VGE_RXCTL_RX_GIANT | VGE_RXCTL_RX_UCAST; + + ifp = sc->vge_ifp; + if ((ifp->if_flags & IFF_BROADCAST) != 0) + rxcfg |= VGE_RXCTL_RX_BCAST; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= VGE_RXCTL_RX_PROMISC; + if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } + goto done; } + vge_cam_clear(sc); /* Now program new ones */ if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -579,11 +590,15 @@ vge_setmulti(struct vge_softc *sc) else hashes[1] |= (1 << (h - 32)); } - - CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); - CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); + +done: + if (hashes[0] != 0 || hashes[1] != 0) + rxcfg |= VGE_RXCTL_RX_MCAST; + CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); + CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); + CSR_WRITE_1(sc, VGE_RXCTL, rxcfg); } static void @@ -2068,29 +2083,11 @@ vge_init_locked(struct vge_softc *sc) /* Enable the TX descriptor queue */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_RUN0); - /* Set up the receive filter -- allow large frames for VLANs. */ - CSR_WRITE_1(sc, VGE_RXCTL, VGE_RXCTL_RX_UCAST|VGE_RXCTL_RX_GIANT); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_BCAST); - } - - /* Set multicast bit to capture multicast frames. */ - if (ifp->if_flags & IFF_MULTICAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_MCAST); - } - /* Init the cam filter. */ vge_cam_clear(sc); - /* Init the multicast filter. */ - vge_setmulti(sc); + /* Set up receiver filter. */ + vge_rxfilter(sc); vge_setvlan(sc); /* Enable flow control */ @@ -2272,25 +2269,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCSIFFLAGS: VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->vge_if_flags & IFF_PROMISC)) { - CSR_SETBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->vge_if_flags & IFF_PROMISC) { - CSR_CLRBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->vge_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + vge_rxfilter(sc); + else vge_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + vge_stop(sc); sc->vge_if_flags = ifp->if_flags; VGE_UNLOCK(sc); break; @@ -2298,7 +2285,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm case SIOCDELMULTI: VGE_LOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_setmulti(sc); + vge_rxfilter(sc); VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 19:37:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228C6106566C; Wed, 16 Dec 2009 19:37:39 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120698FC18; Wed, 16 Dec 2009 19:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJbcMP008732; Wed, 16 Dec 2009 19:37:38 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJbcdi008730; Wed, 16 Dec 2009 19:37:38 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200912161937.nBGJbcdi008730@svn.freebsd.org> From: Julian Elischer Date: Wed, 16 Dec 2009 19:37: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: r200614 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:37:39 -0000 Author: julian Date: Wed Dec 16 19:37:38 2009 New Revision: 200614 URL: http://svn.freebsd.org/changeset/base/200614 Log: Make man page reflect the output columns MFC after: 1 week Modified: head/share/man/man9/LOCK_PROFILING.9 Modified: head/share/man/man9/LOCK_PROFILING.9 ============================================================================== --- head/share/man/man9/LOCK_PROFILING.9 Wed Dec 16 19:32:44 2009 (r200613) +++ head/share/man/man9/LOCK_PROFILING.9 Wed Dec 16 19:37:38 2009 (r200614) @@ -114,6 +114,8 @@ The columns are as follows, from left to .Bl -tag -width ".Va cnt_hold" .It Va max The longest continuous hold time in microseconds. +.It Va wait_max +The longest continuous wait time in microseconds. .It Va total The total (accumulated) hold time in microseconds. .It Va wait_total From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 19:41:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 112891065670; Wed, 16 Dec 2009 19:41:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2FFD8FC12; Wed, 16 Dec 2009 19: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 nBGJfe3T008838; Wed, 16 Dec 2009 19:41:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJfelg008834; Wed, 16 Dec 2009 19:41:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161941.nBGJfelg008834@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19: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: r200615 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:41:41 -0000 Author: yongari Date: Wed Dec 16 19:41:40 2009 New Revision: 200615 URL: http://svn.freebsd.org/changeset/base/200615 Log: Add hardware MAC statistics support. This statistics could be extracted from dev.vge.%d.stats sysctl node. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:41:40 2009 (r200615) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -132,6 +133,13 @@ static int msi_disable = 0; TUNABLE_INT("hw.vge.msi_disable", &msi_disable); /* + * The SQE error counter of MIB seems to report bogus value. + * Vendor's workaround does not seem to work on PCIe based + * controllers. Disable it until we find better workaround. + */ +#undef VGE_ENABLE_SQEERR + +/* * Various supported device vendors/types and their names. */ static struct vge_type vge_devs[] = { @@ -183,7 +191,10 @@ static void vge_rxfilter(struct vge_soft static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); +static void vge_stats_clear(struct vge_softc *); +static void vge_stats_update(struct vge_softc *); static void vge_stop(struct vge_softc *); +static void vge_sysctl_node(struct vge_softc *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1057,6 +1068,7 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) goto fail; @@ -1698,7 +1710,6 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, count); - ifp->if_ierrors++; CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } @@ -2034,7 +2045,8 @@ vge_init_locked(struct vge_softc *sc) return; } vge_tx_list_init(sc); - + /* Clear MAC statistics. */ + vge_stats_clear(sc); /* Set our station address */ for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]); @@ -2358,6 +2370,7 @@ vge_watchdog(void *arg) sc = arg; VGE_LOCK_ASSERT(sc); + vge_stats_update(sc); callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); if (sc->vge_timer == 0 || --sc->vge_timer > 0) return; @@ -2396,6 +2409,7 @@ vge_stop(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_RXQCSRC, 0xFF); CSR_WRITE_4(sc, VGE_RXDESC_ADDR_LO, 0); + vge_stats_update(sc); VGE_CHAIN_RESET(sc); vge_txeof(sc); vge_freebufs(sc); @@ -2469,3 +2483,223 @@ vge_shutdown(device_t dev) return (0); } + +#define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +vge_sysctl_node(struct vge_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct vge_hw_stats *stats; + + stats = &sc->vge_stats; + ctx = device_get_sysctl_ctx(sc->vge_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "VGE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "RX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->rx_frames, "frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts_errs", + &stats->rx_runts_errs, "Too short frames with errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max_errs", + &stats->rx_pkts_1519_max_errs, "1519 to max frames with error"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->rx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "crcerrs", + &stats->rx_crcerrs, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "nobufs", + &stats->rx_nobufs, "Frames with no buffer event"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "sym_errs", + &stats->rx_symerrs, "Frames with symbol errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "TX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->tx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "colls", + &stats->tx_colls, "Collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_latecolls, "Late collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause, "Pause frames"); +#ifdef VGE_ENABLE_SQEERR + VGE_SYSCTL_STAT_ADD32(ctx, child, "sqeerrs", + &stats->tx_sqeerrs, "SQE errors"); +#endif + /* Clear MAC statistics. */ + vge_stats_clear(sc); +} + +#undef VGE_SYSCTL_STAT_ADD32 + +static void +vge_stats_clear(struct vge_softc *sc) +{ + int i; + + VGE_LOCK_ASSERT(sc); + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_CLR); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_CLR) == 0) + break; + } + if (i == 0) + device_printf(sc->vge_dev, "MIB clear timed out!\n"); + CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) & + ~VGE_MIBCSR_FREEZE); +} + +static void +vge_stats_update(struct vge_softc *sc) +{ + struct vge_hw_stats *stats; + struct ifnet *ifp; + uint32_t mib[VGE_MIB_CNT], val; + int i; + + VGE_LOCK_ASSERT(sc); + + stats = &sc->vge_stats; + ifp = sc->vge_ifp; + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FLUSH); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_FLUSH) == 0) + break; + } + if (i == 0) { + device_printf(sc->vge_dev, "MIB counter dump timed out!\n"); + vge_stats_clear(sc); + return; + } + + bzero(mib, sizeof(mib)); +reset_idx: + /* Set MIB read index to 0. */ + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_RINI); + for (i = 0; i < VGE_MIB_CNT; i++) { + val = CSR_READ_4(sc, VGE_MIBDATA); + if (i != VGE_MIB_DATA_IDX(val)) { + /* Reading interrupted. */ + goto reset_idx; + } + mib[i] = val & VGE_MIB_DATA_MASK; + } + + /* Rx stats. */ + stats->rx_frames += mib[VGE_MIB_RX_FRAMES]; + stats->rx_good_frames += mib[VGE_MIB_RX_GOOD_FRAMES]; + stats->rx_fifo_oflows += mib[VGE_MIB_RX_FIFO_OVERRUNS]; + stats->rx_runts += mib[VGE_MIB_RX_RUNTS]; + stats->rx_runts_errs += mib[VGE_MIB_RX_RUNTS_ERRS]; + stats->rx_pkts_64 += mib[VGE_MIB_RX_PKTS_64]; + stats->rx_pkts_65_127 += mib[VGE_MIB_RX_PKTS_65_127]; + stats->rx_pkts_128_255 += mib[VGE_MIB_RX_PKTS_128_255]; + stats->rx_pkts_256_511 += mib[VGE_MIB_RX_PKTS_256_511]; + stats->rx_pkts_512_1023 += mib[VGE_MIB_RX_PKTS_512_1023]; + stats->rx_pkts_1024_1518 += mib[VGE_MIB_RX_PKTS_1024_1518]; + stats->rx_pkts_1519_max += mib[VGE_MIB_RX_PKTS_1519_MAX]; + stats->rx_pkts_1519_max_errs += mib[VGE_MIB_RX_PKTS_1519_MAX_ERRS]; + stats->rx_jumbos += mib[VGE_MIB_RX_JUMBOS]; + stats->rx_crcerrs += mib[VGE_MIB_RX_CRCERRS]; + stats->rx_pause_frames += mib[VGE_MIB_RX_PAUSE]; + stats->rx_alignerrs += mib[VGE_MIB_RX_ALIGNERRS]; + stats->rx_nobufs += mib[VGE_MIB_RX_NOBUFS]; + stats->rx_symerrs += mib[VGE_MIB_RX_SYMERRS]; + stats->rx_lenerrs += mib[VGE_MIB_RX_LENERRS]; + + /* Tx stats. */ + stats->tx_good_frames += mib[VGE_MIB_TX_GOOD_FRAMES]; + stats->tx_pkts_64 += mib[VGE_MIB_TX_PKTS_64]; + stats->tx_pkts_65_127 += mib[VGE_MIB_TX_PKTS_65_127]; + stats->tx_pkts_128_255 += mib[VGE_MIB_TX_PKTS_128_255]; + stats->tx_pkts_256_511 += mib[VGE_MIB_TX_PKTS_256_511]; + stats->tx_pkts_512_1023 += mib[VGE_MIB_TX_PKTS_512_1023]; + stats->tx_pkts_1024_1518 += mib[VGE_MIB_TX_PKTS_1024_1518]; + stats->tx_jumbos += mib[VGE_MIB_TX_JUMBOS]; + stats->tx_colls += mib[VGE_MIB_TX_COLLS]; + stats->tx_pause += mib[VGE_MIB_TX_PAUSE]; +#ifdef VGE_ENABLE_SQEERR + stats->tx_sqeerrs += mib[VGE_MIB_TX_SQEERRS]; +#endif + stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; + + /* Update counters in ifnet. */ + ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + + ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + + ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + mib[VGE_MIB_RX_RUNTS] + + mib[VGE_MIB_RX_RUNTS_ERRS] + + mib[VGE_MIB_RX_CRCERRS] + + mib[VGE_MIB_RX_ALIGNERRS] + + mib[VGE_MIB_RX_NOBUFS] + + mib[VGE_MIB_RX_SYMERRS] + + mib[VGE_MIB_RX_LENERRS]; +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vgereg.h Wed Dec 16 19:41:40 2009 (r200615) @@ -301,7 +301,7 @@ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_MIBOFLOW|VGE_ISR_TIMER0) + VGE_ISR_TIMER0) /* Interrupt mask register */ @@ -543,6 +543,54 @@ #define VGE_TXBLOCK_128PKTS 0x08 #define VGE_TXBLOCK_8PKTS 0x0C +/* MIB control/status register */ +#define VGE_MIBCSR_CLR 0x01 +#define VGE_MIBCSR_RINI 0x02 +#define VGE_MIBCSR_FLUSH 0x04 +#define VGE_MIBCSR_FREEZE 0x08 +#define VGE_MIBCSR_HI_80 0x00 +#define VGE_MIBCSR_HI_C0 0x10 +#define VGE_MIBCSR_BISTGO 0x40 +#define VGE_MIBCSR_BISTOK 0x80 + +/* MIB data index. */ +#define VGE_MIB_RX_FRAMES 0 +#define VGE_MIB_RX_GOOD_FRAMES 1 +#define VGE_MIB_TX_GOOD_FRAMES 2 +#define VGE_MIB_RX_FIFO_OVERRUNS 3 +#define VGE_MIB_RX_RUNTS 4 +#define VGE_MIB_RX_RUNTS_ERRS 5 +#define VGE_MIB_RX_PKTS_64 6 +#define VGE_MIB_TX_PKTS_64 7 +#define VGE_MIB_RX_PKTS_65_127 8 +#define VGE_MIB_TX_PKTS_65_127 9 +#define VGE_MIB_RX_PKTS_128_255 10 +#define VGE_MIB_TX_PKTS_128_255 11 +#define VGE_MIB_RX_PKTS_256_511 12 +#define VGE_MIB_TX_PKTS_256_511 13 +#define VGE_MIB_RX_PKTS_512_1023 14 +#define VGE_MIB_TX_PKTS_512_1023 15 +#define VGE_MIB_RX_PKTS_1024_1518 16 +#define VGE_MIB_TX_PKTS_1024_1518 17 +#define VGE_MIB_TX_COLLS 18 +#define VGE_MIB_RX_CRCERRS 19 +#define VGE_MIB_RX_JUMBOS 20 +#define VGE_MIB_TX_JUMBOS 21 +#define VGE_MIB_RX_PAUSE 22 +#define VGE_MIB_TX_PAUSE 23 +#define VGE_MIB_RX_ALIGNERRS 24 +#define VGE_MIB_RX_PKTS_1519_MAX 25 +#define VGE_MIB_RX_PKTS_1519_MAX_ERRS 26 +#define VGE_MIB_TX_SQEERRS 27 +#define VGE_MIB_RX_NOBUFS 28 +#define VGE_MIB_RX_SYMERRS 29 +#define VGE_MIB_RX_LENERRS 30 +#define VGE_MIB_TX_LATECOLLS 31 + +#define VGE_MIB_CNT (VGE_MIB_TX_LATECOLLS - VGE_MIB_RX_FRAMES + 1) +#define VGE_MIB_DATA_MASK 0x00FFFFFF +#define VGE_MIB_DATA_IDX(x) ((x) >> 24) + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:41:40 2009 (r200615) @@ -130,6 +130,42 @@ struct vge_ring_data { bus_addr_t vge_rx_ring_paddr; }; +struct vge_hw_stats { + uint32_t rx_frames; + uint32_t rx_good_frames; + uint32_t rx_fifo_oflows; + uint32_t rx_runts; + uint32_t rx_runts_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_1519_max_errs; + uint32_t rx_jumbos; + uint32_t rx_crcerrs; + uint32_t rx_pause_frames; + uint32_t rx_alignerrs; + uint32_t rx_nobufs; + uint32_t rx_symerrs; + uint32_t rx_lenerrs; + + uint32_t tx_good_frames; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_jumbos; + uint32_t tx_colls; + uint32_t tx_pause; + uint32_t tx_sqeerrs; + uint32_t tx_latecolls; +}; + struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; @@ -152,6 +188,7 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; + struct vge_hw_stats vge_stats; int suspended; /* 0 = normal 1 = suspended */ }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 19:49:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12BE1065676; Wed, 16 Dec 2009 19:49:23 +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 9067E8FC1C; Wed, 16 Dec 2009 19:49:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJnNYq009029; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJnNJ9009026; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161949.nBGJnNJ9009026@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:49: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: r200616 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:49:23 -0000 Author: yongari Date: Wed Dec 16 19:49:23 2009 New Revision: 200616 URL: http://svn.freebsd.org/changeset/base/200616 Log: Add new flag VGE_FLAG_SUSPENDED to mark suspended state and remove suspended member in softc. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:49:23 2009 (r200616) @@ -1728,15 +1728,11 @@ vge_intr(void *arg) uint32_t status; sc = arg; - - if (sc->suspended) { - return; - } - VGE_LOCK(sc); - ifp = sc->vge_ifp; - if (!(ifp->if_flags & IFF_UP)) { + ifp = sc->vge_ifp; + if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 || + (ifp->if_flags & IFF_UP) == 0) { VGE_UNLOCK(sc); return; } @@ -2430,7 +2426,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - sc->suspended = 1; + sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); @@ -2460,7 +2456,7 @@ vge_resume(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } - sc->suspended = 0; + sc->vge_flags &= ~VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:49:23 2009 (r200616) @@ -179,6 +179,7 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; @@ -189,8 +190,6 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; struct vge_hw_stats vge_stats; - - int suspended; /* 0 = normal 1 = suspended */ }; #define VGE_LOCK(_sc) mtx_lock(&(_sc)->vge_mtx) From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 20:03:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 802761065672; Wed, 16 Dec 2009 20:03: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 6F7388FC12; Wed, 16 Dec 2009 20:03:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGK3hJF009424; Wed, 16 Dec 2009 20:03:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGK3hE9009422; Wed, 16 Dec 2009 20:03:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912162003.nBGK3hE9009422@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 20:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200617 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 20:03:43 -0000 Author: yongari Date: Wed Dec 16 20:03:43 2009 New Revision: 200617 URL: http://svn.freebsd.org/changeset/base/200617 Log: Add "Velocity" to probe message which will make it clearer which ethernet controller was recognized. VIA consistently calls "Velocity" family for gigabit ethernet controllers. For fast ethernet controllers they uses "Rhine" family(vr(4) controllers)) and vr(4) already shows "Rhine" in probe message. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:49:23 2009 (r200616) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 20:03:43 2009 (r200617) @@ -144,7 +144,7 @@ TUNABLE_INT("hw.vge.msi_disable", &msi_d */ static struct vge_type vge_devs[] = { { VIA_VENDORID, VIA_DEVICEID_61XX, - "VIA Networking Gigabit Ethernet" }, + "VIA Networking Velocity Gigabit Ethernet" }, { 0, 0, NULL } }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 20:43:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940C01065692; Wed, 16 Dec 2009 20:43:01 +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 668F18FC18; Wed, 16 Dec 2009 20:43:01 +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 08CF146B46; Wed, 16 Dec 2009 15:43:01 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BBB7E8A01B; Wed, 16 Dec 2009 15:42:59 -0500 (EST) From: John Baldwin To: Warner Losh Date: Wed, 16 Dec 2009 15:41:53 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> In-Reply-To: <200912161717.nBGHHeQZ005541@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200912161541.53834.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 16 Dec 2009 15:42:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 20:43:01 -0000 On Wednesday 16 December 2009 12:17:40 pm Warner Losh wrote: > Author: imp > Date: Wed Dec 16 17:17:40 2009 > New Revision: 200606 > URL: http://svn.freebsd.org/changeset/base/200606 >=20 > Log: > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. > =20 > Note: Not sure this is the right way to do compat, but it makes the > headers consistent with the implementations. Please revert. I think this has already been reverted once before. Though= =20 this approach happens to work for the SYSV IPC case because it uses=20 SYSCALL_MODULE() to register the system calls at runtime (even when compile= d=20 statically into the kernel), it would not work for a COMPAT syscall that di= d=20 not use NOSTD. =46rom src/UPDATING: 20090624: The ABI of various structures related to the SYSV IPC API have been changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to 800100. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 21:33:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EBCE106566C; Wed, 16 Dec 2009 21:33:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C1FCD8FC0A; Wed, 16 Dec 2009 21:33:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBGLWqCW028024; Wed, 16 Dec 2009 14:32:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 16 Dec 2009 14:33:22 -0700 (MST) Message-Id: <20091216.143322.951491966188790000.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <200912161541.53834.jhb@freebsd.org> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:33:27 -0000 In message: <200912161541.53834.jhb@freebsd.org> John Baldwin writes: : On Wednesday 16 December 2009 12:17:40 pm Warner Losh wrote: : > Author: imp : > Date: Wed Dec 16 17:17:40 2009 : > New Revision: 200606 : > URL: http://svn.freebsd.org/changeset/base/200606 : > : > Log: : > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. : > : > Note: Not sure this is the right way to do compat, but it makes the : > headers consistent with the implementations. : : Please revert. I think this has already been reverted once before. Though : this approach happens to work for the SYSV IPC case because it uses : SYSCALL_MODULE() to register the system calls at runtime (even when compiled : statically into the kernel), it would not work for a COMPAT syscall that did : not use NOSTD. : : From src/UPDATING: : : 20090624: : The ABI of various structures related to the SYSV IPC API have been : changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel : options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to : 800100. Yes. We need a better error than what we get here. I'll revert these generated files and come up with something better. Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 21:48:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B8C106566C; Wed, 16 Dec 2009 21:48:27 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6CE8FC16; Wed, 16 Dec 2009 21:48: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 nBGLmRs7011700; Wed, 16 Dec 2009 21:48:27 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGLmRoM011698; Wed, 16 Dec 2009 21:48:27 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200912162148.nBGLmRoM011698@svn.freebsd.org> From: Ivan Voras Date: Wed, 16 Dec 2009 21:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200618 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:48:27 -0000 Author: ivoras Date: Wed Dec 16 21:48:27 2009 New Revision: 200618 URL: http://svn.freebsd.org/changeset/base/200618 Log: MFC r199764: Make ULE process usage (%CPU) accounting usable again Approved by: gnn (mentor) (implicitly) Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Wed Dec 16 20:03:43 2009 (r200617) +++ stable/8/sys/kern/sched_ule.c Wed Dec 16 21:48:27 2009 (r200618) @@ -103,6 +103,7 @@ struct td_sched { u_int ts_slptime; /* Number of ticks we vol. slept */ u_int ts_runtime; /* Number of ticks we were running */ int ts_ltick; /* Last tick that we were running on */ + int ts_incrtick; /* Last tick that we incremented on */ int ts_ftick; /* First tick that we were running on */ int ts_ticks; /* Tick count */ #ifdef KTR @@ -1991,6 +1992,7 @@ sched_fork_thread(struct thread *td, str */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; + ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; child->td_user_pri = td->td_user_pri; child->td_base_user_pri = td->td_base_user_pri; @@ -2182,11 +2184,12 @@ sched_tick(void) * Ticks is updated asynchronously on a single cpu. Check here to * avoid incrementing ts_ticks multiple times in a single tick. */ - if (ts->ts_ltick == ticks) + if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ ts->ts_ticks += 1 << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; + ts->ts_incrtick = ticks; /* * Update if we've exceeded our desired tick threshhold by over one * second. From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 21:53:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65443106566C; Wed, 16 Dec 2009 21:53:57 +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 3AE4B8FC1B; Wed, 16 Dec 2009 21:53: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 nBGLrvdS011850; Wed, 16 Dec 2009 21:53:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGLrvLY011847; Wed, 16 Dec 2009 21:53:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912162153.nBGLrvLY011847@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 21:53: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: r200619 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:53:57 -0000 Author: imp Date: Wed Dec 16 21:53:56 2009 New Revision: 200619 URL: http://svn.freebsd.org/changeset/base/200619 Log: Revert 200606. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 21:48:27 2009 (r200618) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 21:53:56 2009 (r200619) @@ -692,8 +692,7 @@ int freebsd6_freebsd32_ftruncate(struct #endif /* COMPAT_FREEBSD6 */ -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) +#ifdef COMPAT_FREEBSD7 struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -715,7 +714,7 @@ int freebsd7_freebsd32_semctl(struct thr int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); -#endif +#endif /* COMPAT_FREEBSD7 */ #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Dec 16 21:48:27 2009 (r200618) +++ head/sys/sys/sysproto.h Wed Dec 16 21:53:56 2009 (r200619) @@ -2242,8 +2242,13 @@ int freebsd4_sigreturn(struct thread *, #endif /* COMPAT_FREEBSD4 */ -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) +#ifdef COMPAT_FREEBSD6 + + +#endif /* COMPAT_FREEBSD6 */ + + +#ifdef COMPAT_FREEBSD7 struct freebsd7___semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -2265,7 +2270,7 @@ int freebsd7___semctl(struct thread *, s int freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *); int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); -#endif +#endif /* COMPAT_FREEBSD7 */ #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 00:21:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90D541065672; Thu, 17 Dec 2009 00:21:12 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808AB8FC14; Thu, 17 Dec 2009 00:21: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 nBH0LClS015297; Thu, 17 Dec 2009 00:21:12 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH0LCWU015295; Thu, 17 Dec 2009 00:21:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912170021.nBH0LCWU015295@svn.freebsd.org> From: Matt Jacob Date: Thu, 17 Dec 2009 00:21: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: r200620 - head/sys/dev/ips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 00:21:12 -0000 Author: mjacob Date: Thu Dec 17 00:21:12 2009 New Revision: 200620 URL: http://svn.freebsd.org/changeset/base/200620 Log: Fix argument order in a call to mtx_init. MFC after: 1 week Modified: head/sys/dev/ips/ips_pci.c Modified: head/sys/dev/ips/ips_pci.c ============================================================================== --- head/sys/dev/ips/ips_pci.c Wed Dec 16 21:53:56 2009 (r200619) +++ head/sys/dev/ips/ips_pci.c Thu Dec 17 00:21:12 2009 (r200620) @@ -154,7 +154,7 @@ static int ips_pci_attach(device_t dev) } sc->ips_ich.ich_func = ips_intrhook; sc->ips_ich.ich_arg = sc; - mtx_init(&sc->queue_mtx, "IPS bioqueue lock", MTX_DEF, 0); + mtx_init(&sc->queue_mtx, "IPS bioqueue lock", NULL, MTX_DEF); sema_init(&sc->cmd_sema, 0, "IPS Command Semaphore"); bioq_init(&sc->queue); if (config_intrhook_establish(&sc->ips_ich) != 0) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 00:22:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41761065676; Thu, 17 Dec 2009 00:22:56 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E808FC17; Thu, 17 Dec 2009 00:22: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 nBH0MuKR015376; Thu, 17 Dec 2009 00:22:56 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH0Mu7m015374; Thu, 17 Dec 2009 00:22:56 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912170022.nBH0Mu7m015374@svn.freebsd.org> From: Matt Jacob Date: Thu, 17 Dec 2009 00:22: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: r200621 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 00:22:56 -0000 Author: mjacob Date: Thu Dec 17 00:22:56 2009 New Revision: 200621 URL: http://svn.freebsd.org/changeset/base/200621 Log: Fix argument order in a call to mtx_init. MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Dec 17 00:21:12 2009 (r200620) +++ head/sys/kern/uipc_syscalls.c Thu Dec 17 00:22:56 2009 (r200621) @@ -1886,7 +1886,7 @@ kern_sendfile(struct thread *td, struct if (uap->flags & SF_SYNC) { sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK); memset(sfs, 0, sizeof *sfs); - mtx_init(&sfs->mtx, "sendfile", MTX_DEF, 0); + mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 02:06:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FAE51065676; Thu, 17 Dec 2009 02:06:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E21C8FC0A; Thu, 17 Dec 2009 02:06: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 nBH267EN017401; Thu, 17 Dec 2009 02:06:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH267ma017399; Thu, 17 Dec 2009 02:06:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912170206.nBH267ma017399@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 Dec 2009 02:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200622 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 02:06:07 -0000 Author: marcel Date: Thu Dec 17 02:06:07 2009 New Revision: 200622 URL: http://svn.freebsd.org/changeset/base/200622 Log: MFC rev 200498: Work-around a race condition on ia64 while unlocking a contested lock. Modified: stable/8/lib/libthr/thread/thr_umtx.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/8/lib/libthr/thread/thr_umtx.c Thu Dec 17 00:22:56 2009 (r200621) +++ stable/8/lib/libthr/thread/thr_umtx.c Thu Dec 17 02:06:07 2009 (r200622) @@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { +#ifndef __ia64__ + /* XXX this logic has a race-condition on ia64. */ if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); } +#endif /* __ia64__ */ return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 05:06:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAE0106566B; Thu, 17 Dec 2009 05:06:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB61D8FC0C; Thu, 17 Dec 2009 05:06: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 nBH56u5E021132; Thu, 17 Dec 2009 05:06:56 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH56ugi021131; Thu, 17 Dec 2009 05:06:56 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200912170506.nBH56ugi021131@svn.freebsd.org> From: Jamie Gritton Date: Thu, 17 Dec 2009 05:06: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: r200623 - head/lib/libjail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 05:06:56 -0000 Author: jamie Date: Thu Dec 17 05:06:56 2009 New Revision: 200623 URL: http://svn.freebsd.org/changeset/base/200623 Log: Add a null pointer check so "name" can be used as a key parameter in jailparam_get. PR: bin/141692 Submitted by: delphij MFC after: 3 days Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Thu Dec 17 02:06:07 2009 (r200622) +++ head/lib/libjail/jail.c Thu Dec 17 05:06:56 2009 (r200623) @@ -532,7 +532,7 @@ jailparam_get(struct jailparam *jp, unsi } jp_key = jp_lastjid ? jp_lastjid : jp_jid && jp_jid->jp_valuelen == sizeof(int) && - *(int *)jp_jid->jp_value ? jp_jid : jp_name; + jp_jid->jp_value && *(int *)jp_jid->jp_value ? jp_jid : jp_name; if (jp_key == NULL || jp_key->jp_value == NULL) { strlcpy(jail_errmsg, "no jail specified", JAIL_ERRMSGLEN); errno = ENOENT; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 07:18:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC3B106566C; Thu, 17 Dec 2009 07:18:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5238FC08; Thu, 17 Dec 2009 07:18: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 nBH7I67p023876; Thu, 17 Dec 2009 07:18:06 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH7I6E1023874; Thu, 17 Dec 2009 07:18:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912170718.nBH7I6E1023874@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 17 Dec 2009 07:18: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: r200624 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 07:18:06 -0000 Author: edwin Date: Thu Dec 17 07:18:06 2009 New Revision: 200624 URL: http://svn.freebsd.org/changeset/base/200624 Log: Add Australian, New Zealand and Ukraian calendars to the "all" target". MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.all Modified: head/usr.bin/calendar/calendars/calendar.all ============================================================================== --- head/usr.bin/calendar/calendars/calendar.all Thu Dec 17 05:06:56 2009 (r200623) +++ head/usr.bin/calendar/calendars/calendar.all Thu Dec 17 07:18:06 2009 (r200624) @@ -8,13 +8,16 @@ #define _calendar_all_ #include +#include #include #include #include #include #include -#include +#include #include +#include +#include #include #endif /* !_calendar_all_ */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 07:36:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F9B1065670; Thu, 17 Dec 2009 07:36:40 +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 C5BD18FC1A; Thu, 17 Dec 2009 07:36: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 nBH7aeOq024235; Thu, 17 Dec 2009 07:36:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH7aexf024227; Thu, 17 Dec 2009 07:36:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912170736.nBH7aexf024227@svn.freebsd.org> From: Marius Strobl Date: Thu, 17 Dec 2009 07:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200625 - in stable/7/sys: amd64/include arm/include i386/include ia64/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 07:36:41 -0000 Author: marius Date: Thu Dec 17 07:36:40 2009 New Revision: 200625 URL: http://svn.freebsd.org/changeset/base/200625 Log: MFC: r195376 Cleanup ALIGNED_POINTER: o add to platforms where it was missing (arm, i386, powerpc, sparc64, sun4v) o define as "1" on amd64 and i386 where there is no restriction o make the type returned consistent with ALIGN o remove _ALIGNED_POINTER o make associated comments consistent Reviewed by: bde, imp, marcel Approved by: sam (MFC to stable/7) Modified: stable/7/sys/amd64/include/param.h stable/7/sys/arm/include/param.h stable/7/sys/i386/include/param.h stable/7/sys/ia64/include/param.h stable/7/sys/powerpc/include/param.h stable/7/sys/sparc64/include/param.h stable/7/sys/sun4v/include/param.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/include/param.h ============================================================================== --- stable/7/sys/amd64/include/param.h Thu Dec 17 07:18:06 2009 (r200624) +++ stable/7/sys/amd64/include/param.h Thu Dec 17 07:36:40 2009 (r200625) @@ -47,12 +47,6 @@ * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_long and * must be cast to any desired pointer type. - * - * ALIGNED_POINTER is a boolean macro that checks whether an address - * is valid to fetch data elements of type t from on this architecture. - * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). - * */ #ifndef _ALIGNBYTES #define _ALIGNBYTES (sizeof(long) - 1) @@ -60,9 +54,6 @@ #ifndef _ALIGN #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #endif -#ifndef _ALIGNED_POINTER -#define _ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) -#endif #ifndef _NO_NAMESPACE_POLLUTION @@ -87,7 +78,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) -#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) 1 /* Size of the level 1 page table units */ Modified: stable/7/sys/arm/include/param.h ============================================================================== --- stable/7/sys/arm/include/param.h Thu Dec 17 07:18:06 2009 (r200624) +++ stable/7/sys/arm/include/param.h Thu Dec 17 07:36:40 2009 (r200625) @@ -80,6 +80,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0) #define PAGE_SHIFT 12 #define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */ Modified: stable/7/sys/i386/include/param.h ============================================================================== --- stable/7/sys/i386/include/param.h Thu Dec 17 07:18:06 2009 (r200624) +++ stable/7/sys/i386/include/param.h Thu Dec 17 07:36:40 2009 (r200625) @@ -73,6 +73,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) 1 #define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */ #define PAGE_SIZE (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36095106568D; Thu, 17 Dec 2009 08:37:03 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 258DD8FC08; Thu, 17 Dec 2009 08:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH8b3bd025891; Thu, 17 Dec 2009 08:37:03 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8b3Fo025889; Thu, 17 Dec 2009 08:37:03 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170837.nBH8b3Fo025889@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200626 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:37:03 -0000 Author: rse Date: Thu Dec 17 08:37:02 2009 New Revision: 200626 URL: http://svn.freebsd.org/changeset/base/200626 Log: remove external reference to not (or at least no longer) existing variable 'myname' Modified: head/usr.bin/yacc/defs.h Modified: head/usr.bin/yacc/defs.h ============================================================================== --- head/usr.bin/yacc/defs.h Thu Dec 17 07:36:40 2009 (r200625) +++ head/usr.bin/yacc/defs.h Thu Dec 17 08:37:02 2009 (r200626) @@ -220,7 +220,6 @@ extern char tflag; extern char vflag; extern const char *symbol_prefix; -extern char *myname; extern char *cptr; extern char *line; extern int lineno; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 08:41:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB3A1065679; Thu, 17 Dec 2009 08:41:06 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB76F8FC20; Thu, 17 Dec 2009 08:41: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 nBH8f6tt025997; Thu, 17 Dec 2009 08:41:06 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8f6Vt025995; Thu, 17 Dec 2009 08:41:06 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170841.nBH8f6Vt025995@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:41: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: r200627 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:41:06 -0000 Author: rse Date: Thu Dec 17 08:41:06 2009 New Revision: 200627 URL: http://svn.freebsd.org/changeset/base/200627 Log: DEBUG is either defined or not defined for the 'calender' sources, so use #ifdef and not just #if -- both to be semantically correct and also to be aligned with the rest of the 'calendar' sources Modified: head/usr.bin/calendar/ostern.c Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Thu Dec 17 08:37:02 2009 (r200626) +++ head/usr.bin/calendar/ostern.c Thu Dec 17 08:41:06 2009 (r200627) @@ -87,7 +87,7 @@ geteaster(char *s, int year) else return (0); -#if DEBUG +#ifdef DEBUG printf("%s %d %d\n", s, year, EASTERNAMELEN); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 08:42:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E2C31065672; Thu, 17 Dec 2009 08:42:45 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD628FC13; Thu, 17 Dec 2009 08:42: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 nBH8gi3t026058; Thu, 17 Dec 2009 08:42:44 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8giIe026056; Thu, 17 Dec 2009 08:42:44 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170842.nBH8giIe026056@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:42: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: r200628 - head/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:42:45 -0000 Author: rse Date: Thu Dec 17 08:42:44 2009 New Revision: 200628 URL: http://svn.freebsd.org/changeset/base/200628 Log: rewind(3) is already declared to return 'void', so no need for an explicit cast Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Thu Dec 17 08:41:06 2009 (r200627) +++ head/usr.bin/calendar/io.c Thu Dec 17 08:42:44 2009 (r200628) @@ -467,7 +467,7 @@ closecal(FILE *fp) if (!doall) return; - (void)rewind(fp); + rewind(fp); if (fstat(fileno(fp), &sbuf) || !sbuf.st_size) goto done; if (pipe(pdes) < 0) From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 09:24:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2910F106566C; Thu, 17 Dec 2009 09:24:33 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id C47848FC0A; Thu, 17 Dec 2009 09:24:32 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 02007A59088; Thu, 17 Dec 2009 17:24:31 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id lNOO5o6O+Ma7; Thu, 17 Dec 2009 17:24:19 +0800 (CST) Received: from delta.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5C548A58F5D; Thu, 17 Dec 2009 17:24:13 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=tzTPKscCLKlorXtBMXdgX/renMBexgqnbPJ8gxPFiN6loIVvcPFogM7bDSoR4yznE OgdD0hr8ZhWwTek/vaEfw== Message-ID: <4B29F8B0.4030300@delphij.net> Date: Thu, 17 Dec 2009 01:24:00 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091214 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Jamie Gritton References: <200912170506.nBH56ugi021131@svn.freebsd.org> In-Reply-To: <200912170506.nBH56ugi021131@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r200623 - head/lib/libjail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 09:24:33 -0000 On 2009/12/16 21:06, Jamie Gritton wrote: > Author: jamie > Date: Thu Dec 17 05:06:56 2009 > New Revision: 200623 > URL: http://svn.freebsd.org/changeset/base/200623 > > Log: > Add a null pointer check so "name" can be used as a key parameter in > jailparam_get. > > PR: bin/141692 > Submitted by: delphij Thanks! For the record, the work was sponsored by iXsystems as it's done in my office hours. Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 11:42:37 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4768A1065672; Thu, 17 Dec 2009 11:42:37 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id DFE408FC14; Thu, 17 Dec 2009 11:42:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 10D289CB08A; Thu, 17 Dec 2009 12:40:28 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDDG9l0Tvt2d; Thu, 17 Dec 2009 12:40:25 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CA5499CB0FA; Thu, 17 Dec 2009 12:40:25 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nBHBePpt026890; Thu, 17 Dec 2009 12:40:25 +0100 (CET) (envelope-from rdivacky) Date: Thu, 17 Dec 2009 12:40:25 +0100 From: Roman Divacky To: "Ralf S. Engelschall" Message-ID: <20091217114025.GA26660@freebsd.org> References: <200912170837.nBH8b3Fo025889@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912170837.nBH8b3Fo025889@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, delphij@FreeBSD.org Subject: Re: svn commit: r200626 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 11:42:37 -0000 On Thu, Dec 17, 2009 at 08:37:03AM +0000, Ralf S. Engelschall wrote: > Author: rse > Date: Thu Dec 17 08:37:02 2009 > New Revision: 200626 > URL: http://svn.freebsd.org/changeset/base/200626 > > Log: > remove external reference to not (or at least no longer) existing variable 'myname' this is a contributed source that is in the process of being updated... I am not exactly sure what's the status of the update, Xin Li? roman From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 12:27:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6D7E106566C; Thu, 17 Dec 2009 12:27:54 +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 B64AC8FC12; Thu, 17 Dec 2009 12:27: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 nBHCRsBn033443; Thu, 17 Dec 2009 12:27:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHCRsRv033442; Thu, 17 Dec 2009 12:27:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171227.nBHCRsRv033442@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 12:27: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: r200629 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 12:27:54 -0000 Author: luigi Date: Thu Dec 17 12:27:54 2009 New Revision: 200629 URL: http://svn.freebsd.org/changeset/base/200629 Log: simplify the code that finds the next rule after reinjections MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 08:42:44 2009 (r200628) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 12:27:54 2009 (r200629) @@ -1183,31 +1183,29 @@ do { \ mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); if (args->rule) { /* - * Packet has already been tagged. Look for the next rule - * to restart processing. Make sure that args->rule still - * exists and not changed. - * If fw_one_pass != 0 then just accept it. - * XXX should not happen here, but optimized out in - * the caller. + * Packet has already been tagged as a result of a previous + * match on rule args->rule aka args->rule_id (PIPE, QUEUE, + * REASS, NETGRAPH and similar, never a skipto). + * Validate the pointer and continue from args->rule->next + * if still present, otherwise use the default rule. + * XXX If fw_one_pass != 0 then just accept it, though + * the caller should never pass us such packets. */ if (V_fw_one_pass) { IPFW_RUNLOCK(chain); return (IP_FW_PASS); } - if (chain->id != args->chain_id) { + if (chain->id == args->chain_id) { /* pointer still valid */ + f = args->rule->next; + } else { /* must revalidate the pointer */ for (f = chain->rules; f != NULL; f = f->next) - if (f == args->rule && f->id == args->rule_id) + if (f == args->rule && f->id == args->rule_id) { + f = args->rule->next; break; - - if (f != NULL) - f = f->next_rule; - else - f = V_layer3_chain.default_rule; - } else - f = args->rule->next_rule; - - if (f == NULL) - f = lookup_next_rule(args->rule, 0); + } + } + if (f == NULL) /* in case of errors, use default; */ + f = chain->default_rule; } else { /* * Find the starting rule. It can be either the first From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 12:42:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96F51065670; Thu, 17 Dec 2009 12:42:45 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989658FC0C; Thu, 17 Dec 2009 12:42: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 nBHCgjTn033804; Thu, 17 Dec 2009 12:42:45 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHCgjRF033801; Thu, 17 Dec 2009 12:42:45 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912171242.nBHCgjRF033801@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 17 Dec 2009 12:42: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: r200630 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 12:42:45 -0000 Author: stas Date: Thu Dec 17 12:42:45 2009 New Revision: 200630 URL: http://svn.freebsd.org/changeset/base/200630 Log: - Partially revert r200417. config.h brings several definitions, that appears to be actually used. Without config.h included cross-build of world failed (at least for ARM). Modified: head/usr.bin/make/arch.c head/usr.bin/make/make.c Modified: head/usr.bin/make/arch.c ============================================================================== --- head/usr.bin/make/arch.c Thu Dec 17 12:27:54 2009 (r200629) +++ head/usr.bin/make/arch.c Thu Dec 17 12:42:45 2009 (r200630) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include "arch.h" #include "buf.h" +#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" Modified: head/usr.bin/make/make.c ============================================================================== --- head/usr.bin/make/make.c Thu Dec 17 12:27:54 2009 (r200629) +++ head/usr.bin/make/make.c Thu Dec 17 12:42:45 2009 (r200630) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); */ #include "arch.h" +#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 13:14:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE69106566B; Thu, 17 Dec 2009 13:14: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 EBDDE8FC08; Thu, 17 Dec 2009 13:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHDEBiH034589; Thu, 17 Dec 2009 13:14:11 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHDEBQa034586; Thu, 17 Dec 2009 13:14:11 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912171314.nBHDEBQa034586@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Dec 2009 13:14: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: r200631 - in head/sys/boot: i386/libi386 pc98/libpc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 13:14:12 -0000 Author: nyan Date: Thu Dec 17 13:14:11 2009 New Revision: 200631 URL: http://svn.freebsd.org/changeset/base/200631 Log: Fix debug messages of bd_io(). MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Thu Dec 17 12:42:45 2009 (r200630) +++ head/sys/boot/i386/libi386/biosdisk.c Thu Dec 17 13:14:11 2009 (r200631) @@ -1266,11 +1266,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 17 12:42:45 2009 (r200630) +++ head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 17 13:14:11 2009 (r200631) @@ -906,11 +906,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 16:59:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE217106566C; Thu, 17 Dec 2009 16:59:19 +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 CD7588FC2A; Thu, 17 Dec 2009 16:59: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 nBHGxJRP041577; Thu, 17 Dec 2009 16:59:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHGxJQC041576; Thu, 17 Dec 2009 16:59:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912171659.nBHGxJQC041576@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 17 Dec 2009 16:59: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: r200632 - head/usr.bin/uniq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 16:59:20 -0000 Author: jh Date: Thu Dec 17 16:59:19 2009 New Revision: 200632 URL: http://svn.freebsd.org/changeset/base/200632 Log: The input line length limit mentioned on the manual page was removed by r176119. Approved by: trasz (mentor) Modified: head/usr.bin/uniq/uniq.1 Modified: head/usr.bin/uniq/uniq.1 ============================================================================== --- head/usr.bin/uniq/uniq.1 Thu Dec 17 13:14:11 2009 (r200631) +++ head/usr.bin/uniq/uniq.1 Thu Dec 17 16:59:19 2009 (r200632) @@ -35,7 +35,7 @@ .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 3, 2004 +.Dd December 17, 2009 .Dt UNIQ 1 .Os .Sh NAME @@ -153,7 +153,3 @@ A .Nm command appeared in .At v3 . -.Sh BUGS -Input lines are limited to -.Dv LINE_MAX -(2048) bytes in length. From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 17:03:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 547C6106568F; Thu, 17 Dec 2009 17:03:48 +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 2A4308FC22; Thu, 17 Dec 2009 17:03: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 nBHH3m8j041895; Thu, 17 Dec 2009 17:03:48 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHH3mEn041893; Thu, 17 Dec 2009 17:03:48 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912171703.nBHH3mEn041893@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 17 Dec 2009 17:03: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: r200633 - head/usr.bin/uniq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:03:48 -0000 Author: jh Date: Thu Dec 17 17:03:47 2009 New Revision: 200633 URL: http://svn.freebsd.org/changeset/base/200633 Log: Sync getline() with comm(1): - Prevent overflowing of the buffer length variable in getline() by limiting its maximum value. - Exit if reallocf(3) fails in getline(). Failure was silently considered as end-of-file. Reviewed by: ghelmer Approved by: trasz (mentor) Modified: head/usr.bin/uniq/uniq.c Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Thu Dec 17 16:59:19 2009 (r200632) +++ head/usr.bin/uniq/uniq.c Thu Dec 17 17:03:47 2009 (r200633) @@ -52,6 +52,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -59,7 +60,8 @@ static const char rcsid[] = #include #include -#define MAXLINELEN (LINE_MAX + 1) +#define INITLINELEN (LINE_MAX + 1) +#define MAXLINELEN ((SIZE_MAX / sizeof(wchar_t)) / 2) int cflag, dflag, uflag; int numchars, numfields, repeats; @@ -137,8 +139,8 @@ main (int argc, char *argv[]) if (argc > 1) ofp = file(argv[1], "w"); - prevbuflen = MAXLINELEN; - thisbuflen = MAXLINELEN; + prevbuflen = INITLINELEN; + thisbuflen = INITLINELEN; prevline = malloc(prevbuflen * sizeof(*prevline)); thisline = malloc(thisbuflen * sizeof(*thisline)); if (prevline == NULL || thisline == NULL) @@ -198,16 +200,19 @@ getline(wchar_t *buf, size_t *buflen, FI bufpos = 0; while ((ch = getwc(fp)) != WEOF && ch != '\n') { - if (bufpos + 2 >= *buflen) { + if (bufpos + 1 >= *buflen) { *buflen = *buflen * 2; + if (*buflen > MAXLINELEN) + errx(1, + "Maximum line buffer length (%zu) exceeded", + MAXLINELEN); buf = reallocf(buf, *buflen * sizeof(*buf)); if (buf == NULL) - return (NULL); + err(1, "reallocf"); } buf[bufpos++] = ch; } - if (bufpos + 1 != *buflen) - buf[bufpos] = '\0'; + buf[bufpos] = '\0'; return (bufpos != 0 || ch == '\n' ? buf : NULL); } @@ -305,13 +310,13 @@ wcsicoll(wchar_t *s1, wchar_t *s2) new_l2_buflen = wcsicoll_l2_buflen; while (new_l1_buflen < l1) { if (new_l1_buflen == 0) - new_l1_buflen = MAXLINELEN; + new_l1_buflen = INITLINELEN; else new_l1_buflen *= 2; } while (new_l2_buflen < l2) { if (new_l2_buflen == 0) - new_l2_buflen = MAXLINELEN; + new_l2_buflen = INITLINELEN; else new_l2_buflen *= 2; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 17:27:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 075AB106566C; Thu, 17 Dec 2009 17:27:13 +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 E003C8FC19; Thu, 17 Dec 2009 17:27: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 nBHHRCxK042530; Thu, 17 Dec 2009 17:27:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHRCnj042528; Thu, 17 Dec 2009 17:27:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171727.nBHHRCnj042528@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 17:27: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: r200634 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:27:13 -0000 Author: luigi Date: Thu Dec 17 17:27:12 2009 New Revision: 200634 URL: http://svn.freebsd.org/changeset/base/200634 Log: simplify and document lookup_next_rule() Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 17:03:47 2009 (r200633) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 17:27:12 2009 (r200634) @@ -630,50 +630,27 @@ send_reject(struct ip_fw_args *args, int } /** - * Given an ip_fw *, lookup_next_rule will return a pointer - * to the next rule, which can be either the jump - * target (for skipto instructions) or the next one in the list (in - * all other cases including a missing jump target). - * The result is also written in the "next_rule" field of the rule. - * Backward jumps are not allowed, so we start the search from the - * rule following the current one. + * Return the pointer to the skipto target. + * + * IMPORTANT: this should only be called on SKIPTO rules, and the + * jump target is taken from the 'rulenum' argument, which may come + * from the rule itself (direct skipto) or not (tablearg) * * The function never returns NULL: if the requested rule is not * present, it returns the next rule in the chain. - * As a side effect, the rule pointer is also set so next time - * the jump will not require a scan of the list. + * This also happens in case of a bogus argument > 65535 */ - static struct ip_fw * -lookup_next_rule(struct ip_fw *me, u_int32_t tablearg) +lookup_next_rule(struct ip_fw *me, uint32_t rulenum) { - struct ip_fw *rule = NULL; - ipfw_insn *cmd; - u_int16_t rulenum; - - /* look for action, in case it is a skipto */ - cmd = ACTION_PTR(me); - if (cmd->opcode == O_LOG) - cmd += F_LEN(cmd); - if (cmd->opcode == O_ALTQ) - cmd += F_LEN(cmd); - if (cmd->opcode == O_TAG) - cmd += F_LEN(cmd); - if (cmd->opcode == O_SKIPTO ) { - if (tablearg != 0) { - rulenum = (u_int16_t)tablearg; - } else { - rulenum = cmd->arg1; - } - for (rule = me->next; rule ; rule = rule->next) { - if (rule->rulenum >= rulenum) { - break; - } - } + struct ip_fw *rule; + + for (rule = me->next; rule ; rule = rule->next) { + if (rule->rulenum >= rulenum) + break; } if (rule == NULL) /* failure or not a skipto */ - rule = me->next; - me->next_rule = rule; + rule = me->next ? me->next : me; return rule; } @@ -2013,13 +1990,15 @@ do { \ l = 0; /* exit inner loop */ break; } - /* handle skipto */ + /* skipto: */ if (cmd->arg1 == IP_FW_TABLEARG) { - f = lookup_next_rule(f, tablearg); - } else { - if (f->next_rule == NULL) - lookup_next_rule(f, 0); - f = f->next_rule; + f = lookup_next_rule(f, tablearg); + } else { /* direct skipto */ + /* update f->next_rule if not set */ + if (f->next_rule == NULL) + f->next_rule = + lookup_next_rule(f, cmd->arg1); + f = f->next_rule; } /* * Skip disabled rules, and @@ -2032,7 +2011,7 @@ do { \ if (f) { /* found a valid rule */ l = f->cmd_len; cmd = f->cmd; - } else { + } else { /* should not happen */ l = 0; /* exit inner loop */ } match = 1; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 17:38:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55711065679; Thu, 17 Dec 2009 17: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 A49488FC17; Thu, 17 Dec 2009 17:38: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 nBHHc6nA042997; Thu, 17 Dec 2009 17:38:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHc6nY042995; Thu, 17 Dec 2009 17:38:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171738.nBHHc6nY042995@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 17:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200635 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:38:06 -0000 Author: yongari Date: Thu Dec 17 17:38:06 2009 New Revision: 200635 URL: http://svn.freebsd.org/changeset/base/200635 Log: Remove unused VGE_ETHER_ALIGN definition. Modified: head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:27:12 2009 (r200634) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:38:06 2009 (r200635) @@ -65,12 +65,6 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 -#ifdef VGE_FIXUP_RX -#define VGE_ETHER_ALIGN sizeof(uint32_t) -#else -#define VGE_ETHER_ALIGN 0 -#endif - struct vge_type { uint16_t vge_vid; uint16_t vge_did; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 17:44:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF67910656A7; Thu, 17 Dec 2009 17:44:34 +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 BE9308FC2A; Thu, 17 Dec 2009 17:44: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 nBHHiYpg043300; Thu, 17 Dec 2009 17:44:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHiY3i043298; Thu, 17 Dec 2009 17:44:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171744.nBHHiY3i043298@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 17:44: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: r200636 - head/sys/modules/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:44:34 -0000 Author: luigi Date: Thu Dec 17 17:44:34 2009 New Revision: 200636 URL: http://svn.freebsd.org/changeset/base/200636 Log: Now that ipfw is split into multiple files, we need to list them all in the Makefile for the module, otherwise it won't load due to missing symbols. The problem only affected head with ipfw built as a module. Reported by David Horn Modified: head/sys/modules/ipfw/Makefile Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Thu Dec 17 17:38:06 2009 (r200635) +++ head/sys/modules/ipfw/Makefile Thu Dec 17 17:44:34 2009 (r200636) @@ -6,6 +6,8 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c +SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_nat.c +SRCS+= ip_fw_sockopt.c ip_fw_table.c SRCS+= opt_inet6.h opt_ipsec.h CFLAGS+= -DIPFIREWALL From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 17:46:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D644D106568B; Thu, 17 Dec 2009 17:46:08 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5B128FC19; Thu, 17 Dec 2009 17:46: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 nBHHk8Wu043394; Thu, 17 Dec 2009 17:46:08 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHk8VM043392; Thu, 17 Dec 2009 17:46:08 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912171746.nBHHk8VM043392@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 17 Dec 2009 17:46: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: r200637 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:46:08 -0000 Author: gavin Date: Thu Dec 17 17:46:08 2009 New Revision: 200637 URL: http://svn.freebsd.org/changeset/base/200637 Log: Don't panic due to unlocking an unowned mutex if we fail during attach. PR: kern/139053 Reviewed by: scottl Approved by: ed (mentor) MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Dec 17 17:44:34 2009 (r200636) +++ head/sys/dev/ciss/ciss.c Thu Dec 17 17:46:08 2009 (r200637) @@ -418,6 +418,7 @@ ciss_attach(device_t dev) sc = device_get_softc(dev); sc->ciss_dev = dev; + mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); /* * Do PCI-specific init. @@ -430,7 +431,6 @@ ciss_attach(device_t dev) */ ciss_initq_free(sc); ciss_initq_notify(sc); - mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); callout_init_mtx(&sc->ciss_periodic, &sc->ciss_mtx, 0); /* @@ -496,8 +496,11 @@ ciss_attach(device_t dev) error = 0; out: - if (error != 0) + if (error != 0) { + /* ciss_free() expects the mutex to be held */ + mtx_lock(&sc->ciss_mtx); ciss_free(sc); + } return(error); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:00:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E091A106568D; Thu, 17 Dec 2009 18:00: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 CE54A8FC0C; Thu, 17 Dec 2009 18: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 nBHI0PjO043947; Thu, 17 Dec 2009 18:00:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHI0PZN043943; Thu, 17 Dec 2009 18:00:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171800.nBHI0PZN043943@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18: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: r200638 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:00:26 -0000 Author: yongari Date: Thu Dec 17 18:00:25 2009 New Revision: 200638 URL: http://svn.freebsd.org/changeset/base/200638 Log: Implement interrupt moderation scheme supported by VT61xx controllers. TX/RX interrupt mitigation is controlled by VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress generation of interrupts until the programmed frames counter equals to the registers. VT61xx also supports interrupt hold off timer register. If this interrupt hold off timer is active all interrupts would be disabled until the timer reaches to 0. The timer value is reloaded whenever VGE_ISR register written. The timer resolution is about 20us. Previously vge(4) used single shot timer to reduce Tx completion interrupts. This required VGE_CRS1 register access in Tx start/completion handler to rearm new timeout value and it did not show satisfactory result(more than 50k interrupts under load). Rx interrupts was not moderated at all such that vge(4) used to generate too many interrupts which in turn made polling(4) better approach under high network load. This change activates all interrupt moderation mechanism and initial values were tuned to generate interrupt less than 8k per second. That number of interrupts wouldn't add additional packet latencies compared to polling(4). These interrupt parameters could be changed with sysctl. dev.vge.%d.int_holdoff dev.vge.%d.rx_coal_pkt dev.vge.%d.tx_coal_pkt Interface has be brought down and up again before change take effect. With interrupt moderation there is no more need to loop in interrupt handler. This loop always added one more register access. While I'm here remove dead code which tried to implement subset of interrupt moderation. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vge.c Thu Dec 17 18:00:25 2009 (r200638) @@ -175,6 +175,7 @@ static int vge_ifmedia_upd(struct ifnet static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); +static void vge_intr_holdoff(struct vge_softc *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); @@ -1631,15 +1632,6 @@ vge_txeof(struct vge_softc *sc) sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; - else { - /* - * If not all descriptors have been released reaped yet, - * reload the timer so that we will eventually get another - * interrupt that will cause us to re-enter this routine. - * This is done in case the transmitter has gone idle. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - } } static void @@ -1746,30 +1738,21 @@ vge_intr(void *arg) /* Disable interrupts */ CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_GMSK); - - for (;;) { - - status = CSR_READ_4(sc, VGE_ISR); - /* If the card has gone away the read returns 0xffff. */ - if (status == 0xFFFFFFFF) - break; - - if (status) - CSR_WRITE_4(sc, VGE_ISR, status); - - if ((status & VGE_INTRS) == 0) - break; - + status = CSR_READ_4(sc, VGE_ISR); + CSR_WRITE_4(sc, VGE_ISR, status | VGE_ISR_HOLDOFF_RELOAD); + /* If the card has gone away the read returns 0xffff. */ + if (status == 0xFFFFFFFF || (status & VGE_INTRS) == 0) + goto done; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (status & (VGE_ISR_RXOK|VGE_ISR_RXOK_HIPRIO)) vge_rxeof(sc, VGE_RX_DESC_CNT); - if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, VGE_RX_DESC_CNT); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } - if (status & (VGE_ISR_TXOK0|VGE_ISR_TIMER0)) + if (status & (VGE_ISR_TXOK0|VGE_ISR_TXOK_HIPRIO)) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) { @@ -1780,13 +1763,14 @@ vge_intr(void *arg) if (status & VGE_ISR_LINKSTS) vge_link_statchg(sc); } +done: + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + /* Re-enable interrupts */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - /* Re-enable interrupts */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vge_start_locked(ifp); - + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vge_start_locked(ifp); + } VGE_UNLOCK(sc); } @@ -1985,17 +1969,6 @@ vge_start_locked(struct ifnet *ifp) /* Issue a transmit command. */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_WAK0); /* - * Use the countdown timer for interrupt moderation. - * 'TX done' interrupts are disabled. Instead, we reset the - * countdown timer, which will begin counting until it hits - * the value in the SSTIMER register, and then trigger an - * interrupt. Each time we set the TIMER0_ENABLE bit, the - * the timer count is reloaded. Only when the transmitter - * is idle will the timer hit 0 and an interrupt fire. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - - /* * Set a timeout in case the chip goes out to lunch. */ sc->vge_timer = 5; @@ -2084,6 +2057,9 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_2(sc, VGE_RXDESCNUM, VGE_RX_DESC_CNT - 1); CSR_WRITE_2(sc, VGE_RXDESC_RESIDUECNT, VGE_RX_DESC_CNT); + /* Configure interrupt moderation. */ + vge_intr_holdoff(sc); + /* Enable and wake up the RX descriptor queue */ CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); @@ -2110,42 +2086,6 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS0, VGE_CR0_TX_ENABLE|VGE_CR0_RX_ENABLE|VGE_CR0_START); - /* - * Configure one-shot timer for microsecond - * resolution and load it for 500 usecs. - */ - CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); - CSR_WRITE_2(sc, VGE_SSTIMER, 400); - - /* - * Configure interrupt moderation for receive. Enable - * the holdoff counter and load it, and set the RX - * suppression count to the number of descriptors we - * want to allow before triggering an interrupt. - * The holdoff timer is in units of 20 usecs. - */ - -#ifdef notyet - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_TXINTSUP_DISABLE); - /* Select the interrupt holdoff timer page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); - CSR_WRITE_1(sc, VGE_INTHOLDOFF, 10); /* ~200 usecs */ - - /* Enable use of the holdoff timer. */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_SC_RELOAD); - - /* Select the RX suppression threshold page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); - CSR_WRITE_1(sc, VGE_RXSUPPTHR, 64); /* interrupt after 64 packets */ - - /* Restore the page select bits. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); -#endif - #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. @@ -2494,6 +2434,25 @@ vge_sysctl_node(struct vge_softc *sc) stats = &sc->vge_stats; ctx = device_get_sysctl_ctx(sc->vge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_holdoff", + CTLFLAG_RW, &sc->vge_int_holdoff, 0, "interrupt holdoff"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLFLAG_RW, &sc->vge_rx_coal_pkt, 0, "rx coalescing packet"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLFLAG_RW, &sc->vge_tx_coal_pkt, 0, "tx coalescing packet"); + + /* Pull in device tunables. */ + sc->vge_int_holdoff = VGE_INT_HOLDOFF_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "int_holdoff", &sc->vge_int_holdoff); + sc->vge_rx_coal_pkt = VGE_RX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "rx_coal_pkt", &sc->vge_rx_coal_pkt); + sc->vge_tx_coal_pkt = VGE_TX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "tx_coal_pkt", &sc->vge_tx_coal_pkt); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "VGE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2699,3 +2658,51 @@ reset_idx: mib[VGE_MIB_RX_SYMERRS] + mib[VGE_MIB_RX_LENERRS]; } + +static void +vge_intr_holdoff(struct vge_softc *sc) +{ + uint8_t intctl; + + VGE_LOCK_ASSERT(sc); + + /* + * Set Tx interrupt supression threshold. + * It's possible to use single-shot timer in VGE_CRS1 register + * in Tx path such that driver can remove most of Tx completion + * interrupts. However this requires additional access to + * VGE_CRS1 register to reload the timer in addintion to + * activating Tx kick command. Another downside is we don't know + * what single-shot timer value should be used in advance so + * reclaiming transmitted mbufs could be delayed a lot which in + * turn slows down Tx operation. + */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_TXSUPPTHR); + CSR_WRITE_1(sc, VGE_TXSUPPTHR, sc->vge_tx_coal_pkt); + + /* Set Rx interrupt suppresion threshold. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); + CSR_WRITE_1(sc, VGE_RXSUPPTHR, sc->vge_rx_coal_pkt); + + intctl = CSR_READ_1(sc, VGE_INTCTL1); + intctl &= ~VGE_INTCTL_SC_RELOAD; + intctl |= VGE_INTCTL_HC_RELOAD; + if (sc->vge_tx_coal_pkt <= 0) + intctl |= VGE_INTCTL_TXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_TXINTSUP_DISABLE; + if (sc->vge_rx_coal_pkt <= 0) + intctl |= VGE_INTCTL_RXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_RXINTSUP_DISABLE; + CSR_WRITE_1(sc, VGE_INTCTL1, intctl); + CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_HOLDOFF); + if (sc->vge_int_holdoff > 0) { + /* Set interrupt holdoff timer. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); + CSR_WRITE_1(sc, VGE_INTHOLDOFF, + VGE_INT_HOLDOFF_USEC(sc->vge_int_holdoff)); + /* Enable holdoff timer. */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); + } +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vgereg.h Thu Dec 17 18:00:25 2009 (r200638) @@ -300,8 +300,7 @@ #define VGE_INTRS (VGE_ISR_TXOK0|VGE_ISR_RXOK|VGE_ISR_STOPPED| \ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ - VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_TIMER0) + VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL) /* Interrupt mask register */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 18:00:25 2009 (r200638) @@ -65,6 +65,20 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 +#define VGE_INT_HOLDOFF_TICK 20 +#define VGE_INT_HOLDOFF_USEC(x) ((x) / VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_MIN 0 +#define VGE_INT_HOLDOFF_MAX (255 * VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_DEFAULT 150 + +#define VGE_RX_COAL_PKT_MIN 1 +#define VGE_RX_COAL_PKT_MAX VGE_RX_DESC_CNT +#define VGE_RX_COAL_PKT_DEFAULT 64 + +#define VGE_TX_COAL_PKT_MIN 1 +#define VGE_TX_COAL_PKT_MAX VGE_TX_DESC_CNT +#define VGE_TX_COAL_PKT_DEFAULT 128 + struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -177,6 +191,9 @@ struct vge_softc { #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; + int vge_int_holdoff; + int vge_rx_coal_pkt; + int vge_tx_coal_pkt; struct mtx vge_mtx; struct callout vge_watchdog; int vge_timer; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:03:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8760C1065676; Thu, 17 Dec 2009 18:03: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 76D978FC14; Thu, 17 Dec 2009 18:03: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 nBHI35kY044060; Thu, 17 Dec 2009 18:03:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHI35Hc044058; Thu, 17 Dec 2009 18:03:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171803.nBHI35Hc044058@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18:03: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: r200639 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:03:05 -0000 Author: yongari Date: Thu Dec 17 18:03:05 2009 New Revision: 200639 URL: http://svn.freebsd.org/changeset/base/200639 Log: Actually clear interrupts. Writing 0 has no effect. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Dec 17 18:00:25 2009 (r200638) +++ head/sys/dev/vge/if_vge.c Thu Dec 17 18:03:05 2009 (r200639) @@ -2100,7 +2100,7 @@ vge_init_locked(struct vge_softc *sc) * Enable interrupts. */ CSR_WRITE_4(sc, VGE_IMR, VGE_INTRS); - CSR_WRITE_4(sc, VGE_ISR, 0); + CSR_WRITE_4(sc, VGE_ISR, 0xFFFFFFFF); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:17:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E117D10656C6; Thu, 17 Dec 2009 18:17:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CED938FC14; Thu, 17 Dec 2009 18:17: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 nBHIHkQd044589; Thu, 17 Dec 2009 18:17:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIHkF2044586; Thu, 17 Dec 2009 18:17:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912171817.nBHIHkF2044586@svn.freebsd.org> From: Marius Strobl Date: Thu, 17 Dec 2009 18:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200640 - in stable/7/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:17:47 -0000 Author: marius Date: Thu Dec 17 18:17:46 2009 New Revision: 200640 URL: http://svn.freebsd.org/changeset/base/200640 Log: MFC: r200272 Add additional checks of the kernel stack addresses in order to ensure we don't overrun the beginning of the call chain. Modified: stable/7/sys/sparc64/sparc64/stack_machdep.c stable/7/sys/sun4v/sun4v/stack_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/stack_machdep.c Thu Dec 17 18:03:05 2009 (r200639) +++ stable/7/sys/sparc64/sparc64/stack_machdep.c Thu Dec 17 18:17:46 2009 (r200640) @@ -36,15 +36,20 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; @@ -56,6 +61,9 @@ stack_capture(struct stack *st, struct f break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } Modified: stable/7/sys/sun4v/sun4v/stack_machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/stack_machdep.c Thu Dec 17 18:03:05 2009 (r200639) +++ stable/7/sys/sun4v/sun4v/stack_machdep.c Thu Dec 17 18:17:46 2009 (r200640) @@ -36,20 +36,28 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:37:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3E61065694; Thu, 17 Dec 2009 18:37: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 7D8A08FC13; Thu, 17 Dec 2009 18:37: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 nBHIbBYp045313; Thu, 17 Dec 2009 18:37:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIbBEd045311; Thu, 17 Dec 2009 18:37:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171837.nBHIbBEd045311@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18:37: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: r200641 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:37:11 -0000 Author: yongari Date: Thu Dec 17 18:37:11 2009 New Revision: 200641 URL: http://svn.freebsd.org/changeset/base/200641 Log: Document newly added loader tunable and sysctl variables. o hw.vge.msi_disable o dev.vge.%d.int_holdoff o dev.vge.%d.rx_coal_pkt o dev.vge.%d.tx_coal_pkt Modified: head/share/man/man4/vge.4 Modified: head/share/man/man4/vge.4 ============================================================================== --- head/share/man/man4/vge.4 Thu Dec 17 18:17:46 2009 (r200640) +++ head/share/man/man4/vge.4 Thu Dec 17 18:37:11 2009 (r200641) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2007 +.Dd December 17, 2009 .Dt VGE 4 .Os .Sh NAME @@ -173,6 +173,38 @@ ZyXEL GN650-T 64-bit PCI Gigabit Etherne .It ZyXEL GN670-T 32-bit PCI Gigabit Ethernet NIC (ZX1702) .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 "xxxxxx" +.It Va hw.vge.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.vge.%d.int_holdoff +Maximum number of time to delay interrupts. +The valid range is 0 to 5100 in units of 1us, the default is +150 (150us). +The resolution of of timer is about 20us so finer tuning than +20us wouldn't be available. +The interface should be brought down and up again before a change +takes effect. +.It Va dev.vge.%d.rx_coal_pkt +Maximum number of packets to fire Rx completion interrupt. +The valid range is 1 to 255, the default is 64. +.It Va dev.vge.%d.tx_coal_pkt +Maximum number of packets to fire Tx completion interrupt. +The valid range is 1 to 255, the default is 128. +.El .Sh DIAGNOSTICS .Bl -diag .It "vge%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:43:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFCB106566B; Thu, 17 Dec 2009 18:43:34 +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 853918FC17; Thu, 17 Dec 2009 18:43: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 nBHIhYsp045588; Thu, 17 Dec 2009 18:43:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIhYad045585; Thu, 17 Dec 2009 18:43:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171843.nBHIhYad045585@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 18:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200642 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:43:34 -0000 Author: kib Date: Thu Dec 17 18:43:34 2009 New Revision: 200642 URL: http://svn.freebsd.org/changeset/base/200642 Log: MFC r200450: Document PBDRY and SLEEPQ_STOP_ON_BDRY. Modified: stable/8/share/man/man9/sleep.9 stable/8/share/man/man9/sleepqueue.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sleep.9 ============================================================================== --- stable/8/share/man/man9/sleep.9 Thu Dec 17 18:37:11 2009 (r200641) +++ stable/8/share/man/man9/sleep.9 Thu Dec 17 18:43:34 2009 (r200642) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd December 12, 2009 .Os .Dt SLEEP 9 .Sh NAME @@ -97,6 +97,7 @@ when it resumes. should never be used, as it is for compatibility only. A new priority of 0 means to use the thread's current priority when it is made runnable again. +.Pp If .Fa priority includes the @@ -113,6 +114,17 @@ possible, and is returned if the system call should be interrupted by the signal (return .Er EINTR ) . +If +.Dv PBDRY +flag is specified in addition to +.Dv PCATCH , +then the sleeping thread is not stopped while sleeping upon delivery of +.Dv SIGSTOP +or other stop action. +Instead, it is waken up, assuming that stop occurs on reaching a stop +point when returning to usermode. +The flag should be used when sleeping thread owns resources, for instance +vnode locks, that should be freed timely. .Pp The parameter .Fa wmesg Modified: stable/8/share/man/man9/sleepqueue.9 ============================================================================== --- stable/8/share/man/man9/sleepqueue.9 Thu Dec 17 18:37:11 2009 (r200641) +++ stable/8/share/man/man9/sleepqueue.9 Thu Dec 17 18:43:34 2009 (r200642) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd December 12, 2009 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -195,12 +195,19 @@ A sleep queue used to implement .Xr pause 9 . .El .Pp -There is currently only one optional flag: +There are currently two optional flag: .Pp .Bl -tag -width ".Dv SLEEPQ_INTERRUPTIBLE" -compact .It Dv SLEEPQ_INTERRUPTIBLE The current thread is entering an interruptible sleep. .El +.Bl -tag -width ".Dv SLEEPQ_STOP_ON_BDRY" -compact +.It Dv SLEEPQ_STOP_ON_BDRY +When thread is entering an interruptible sleep, do not stop it upon +arrival of stop action, like +.Dv SIGSTOP . +Wake it up instead. +.El .Pp A timeout on the sleep may be specified by calling .Fn sleepq_set_timeout From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 18:56:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3A2106566B; Thu, 17 Dec 2009 18:56:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F958FC0C; Thu, 17 Dec 2009 18:56: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 nBHIuqU8046161; Thu, 17 Dec 2009 18:56:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIuqDA046159; Thu, 17 Dec 2009 18:56:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171856.nBHIuqDA046159@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 18:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200643 - stable/8/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:56:52 -0000 Author: kib Date: Thu Dec 17 18:56:52 2009 New Revision: 200643 URL: http://svn.freebsd.org/changeset/base/200643 Log: MFC r199826: sigset() is the name of function specified by SUSv4. Replace it to avoid conflict. Modified: stable/8/lib/libutil/pw_util.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/pw_util.c ============================================================================== --- stable/8/lib/libutil/pw_util.c Thu Dec 17 18:43:34 2009 (r200642) +++ stable/8/lib/libutil/pw_util.c Thu Dec 17 18:56:52 2009 (r200643) @@ -289,7 +289,7 @@ int pw_edit(int notsetuid) { struct sigaction sa, sa_int, sa_quit; - sigset_t oldsigset, sigset; + sigset_t oldsigset, nsigset; struct stat st1, st2; const char *editor; int pstat; @@ -303,9 +303,9 @@ pw_edit(int notsetuid) sa.sa_flags = 0; sigaction(SIGINT, &sa, &sa_int); sigaction(SIGQUIT, &sa, &sa_quit); - sigemptyset(&sigset); - sigaddset(&sigset, SIGCHLD); - sigprocmask(SIG_BLOCK, &sigset, &oldsigset); + sigemptyset(&nsigset); + sigaddset(&nsigset, SIGCHLD); + sigprocmask(SIG_BLOCK, &nsigset, &oldsigset); switch ((editpid = fork())) { case -1: return (-1); From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 19:35:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E12A5106566C; Thu, 17 Dec 2009 19:35:48 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id A4FA58FC17; Thu, 17 Dec 2009 19:35:48 +0000 (UTC) Received: by pzk15 with SMTP id 15so1622504pzk.3 for ; Thu, 17 Dec 2009 11:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sK9ULPM5b+qRDIwFoEPsDufhno/APO7EmNPTWLuLfas=; b=HwmChBc7K5MOALYhi8bSdPH/ei2USQG4tmYGWVKOKIebT3B4WozLFRqKkD1iCrE7Ul +O4HrFO9eeEraNUReZ88h+9ibeBEsg+BnQhQpOcKHtumOPUikVHELf5Xbtbx/YUwpJGZ E6PWb6GXbncSsgDgbruaQjEJk+cnmK7hrtjy8= 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=mn2V/HCNFnrB3mmaJxlYjid+Blw7hbF7iMqMEh3Ca8hXEZn6dX0oWOPQL7zu3jcrnH WHpzL+K96FMb9OvF8xU3wGKZgx171emiFzUwrb3Kc2SRgTj7BPCEscgOqxmQ39hDBecX 0Nuofi1sHlXZw6wA5mska4jAR5dtQgsY+cBVE= MIME-Version: 1.0 Received: by 10.115.66.29 with SMTP id t29mr1925225wak.187.1261077142196; Thu, 17 Dec 2009 11:12:22 -0800 (PST) In-Reply-To: <200912171242.nBHCgjRF033801@svn.freebsd.org> References: <200912171242.nBHCgjRF033801@svn.freebsd.org> Date: Thu, 17 Dec 2009 11:12:22 -0800 Message-ID: From: Xin LI To: Stanislav Sedov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200630 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:35:49 -0000 Hi, On Thu, Dec 17, 2009 at 4:42 AM, Stanislav Sedov wrote: > Author: stas > Date: Thu Dec 17 12:42:45 2009 > New Revision: 200630 > URL: http://svn.freebsd.org/changeset/base/200630 > > Log: > =C2=A0- Partially revert r200417. =C2=A0config.h brings several definitio= ns, > =C2=A0 =C2=A0that appears to be actually used. =C2=A0Without config.h inc= luded > =C2=A0 =C2=A0cross-build of world failed (at least for ARM). Sorry for the breakage, I was shock that this was not caught by ``make universe'', could you please send me a copy of the build log so I will be able to see why? Thanks in advance! --=20 Xin LI http://www.delphij.net From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 19:48:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED3E106566B; Thu, 17 Dec 2009 19:48:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB728FC0A; Thu, 17 Dec 2009 19:48: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 nBHJmstZ047913; Thu, 17 Dec 2009 19:48:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJmsXC047911; Thu, 17 Dec 2009 19:48:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171948.nBHJmsXC047911@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 19:48: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: r200644 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:48:55 -0000 Author: yongari Date: Thu Dec 17 19:48:54 2009 New Revision: 200644 URL: http://svn.freebsd.org/changeset/base/200644 Log: Remove unused member variable of softc. Modified: head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 18:56:52 2009 (r200643) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 19:48:54 2009 (r200644) @@ -181,7 +181,6 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - uint8_t vge_type; int vge_if_flags; int vge_phyaddr; int vge_flags; From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 19:53:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD95D1065694; Thu, 17 Dec 2009 19:53:16 +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 CB8FC8FC13; Thu, 17 Dec 2009 19:53: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 nBHJrGxw048180; Thu, 17 Dec 2009 19:53:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJrGbw048176; Thu, 17 Dec 2009 19:53:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171953.nBHJrGbw048176@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 19:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200645 - in stable/8: libexec/rtld-elf sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:53:17 -0000 Author: kib Date: Thu Dec 17 19:53:16 2009 New Revision: 200645 URL: http://svn.freebsd.org/changeset/base/200645 Log: MFC r199829: Implement rtld part of the support for -z nodlopen (see ld(1)). MFC r199877: Allow to load not-openable dso when tracing. This fixes ldd on such dso or dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. Modified: stable/8/libexec/rtld-elf/rtld.c stable/8/libexec/rtld-elf/rtld.h stable/8/sys/sys/elf_common.h Directory Properties: stable/8/libexec/rtld-elf/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/libexec/rtld-elf/rtld.c Thu Dec 17 19:53:16 2009 (r200645) @@ -87,7 +87,7 @@ static void die(void) __dead2; static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); -static Obj_Entry *do_load_object(int, const char *, char *, struct stat *); +static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); static void errmsg_restore(char *); @@ -103,7 +103,7 @@ static void initlist_add_objects(Obj_Ent static bool is_exported(const Elf_Sym *); static void linkmap_add(Obj_Entry *); static void linkmap_delete(Obj_Entry *); -static int load_needed_objects(Obj_Entry *); +static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *, int); static Obj_Entry *obj_from_addr(const void *); @@ -485,7 +485,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ preload_tail = obj_tail; dbg("loading needed objects"); - if (load_needed_objects(obj_main) == -1) + if (load_needed_objects(obj_main, 0) == -1) die(); /* Make a list of all objects loaded at startup. */ @@ -932,6 +932,8 @@ digest_dynamic(Obj_Entry *obj, int early #endif case DT_FLAGS_1: + if (dynp->d_un.d_val & DF_1_NOOPEN) + obj->z_noopen = true; if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) obj->z_origin = true; if (dynp->d_un.d_val & DF_1_GLOBAL) @@ -1425,7 +1427,7 @@ is_exported(const Elf_Sym *def) * returns -1 on failure. */ static int -load_needed_objects(Obj_Entry *first) +load_needed_objects(Obj_Entry *first, int flags) { Obj_Entry *obj, *obj1; @@ -1434,7 +1436,7 @@ load_needed_objects(Obj_Entry *first) for (needed = obj->needed; needed != NULL; needed = needed->next) { obj1 = needed->obj = load_object(obj->strtab + needed->name, obj, - false); + flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing) return -1; if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { @@ -1465,7 +1467,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, NULL, false) == NULL) + if (load_object(p, NULL, 0) == NULL) return -1; /* XXX - cleanup */ p[len] = savech; p += len; @@ -1482,7 +1484,7 @@ load_preload_objects(void) * on failure. */ static Obj_Entry * -load_object(const char *name, const Obj_Entry *refobj, int noload) +load_object(const char *name, const Obj_Entry *refobj, int flags) { Obj_Entry *obj; int fd = -1; @@ -1528,11 +1530,11 @@ load_object(const char *name, const Obj_ close(fd); return obj; } - if (noload) + if (flags & RTLD_LO_NOLOAD) return (NULL); /* First use of this object, so we must map it in */ - obj = do_load_object(fd, name, path, &sb); + obj = do_load_object(fd, name, path, &sb, flags); if (obj == NULL) free(path); close(fd); @@ -1541,7 +1543,8 @@ load_object(const char *name, const Obj_ } static Obj_Entry * -do_load_object(int fd, const char *name, char *path, struct stat *sbp) +do_load_object(int fd, const char *name, char *path, struct stat *sbp, + int flags) { Obj_Entry *obj; struct statfs fs; @@ -1568,6 +1571,14 @@ do_load_object(int fd, const char *name, object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); + if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == + RTLD_LO_DLOPEN) { + dbg("refusing to load non-loadable \"%s\"", obj->path); + _rtld_error("Cannot dlopen non-loadable %s", obj->path); + munmap(obj->mapbase, obj->mapsize); + obj_free(obj); + return (NULL); + } *obj_tail = obj; obj_tail = &obj->next; @@ -1986,14 +1997,18 @@ dlopen(const char *name, int mode) Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - int result, lockstate, nodelete, noload; + int result, lockstate, nodelete, lo_flags; LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name); ld_tracing = (mode & RTLD_TRACE) == 0 ? NULL : "1"; if (ld_tracing != NULL) environ = (char **)*get_program_var_addr("environ"); nodelete = mode & RTLD_NODELETE; - noload = mode & RTLD_NOLOAD; + lo_flags = RTLD_LO_DLOPEN; + if (mode & RTLD_NOLOAD) + lo_flags |= RTLD_LO_NOLOAD; + if (ld_tracing != NULL) + lo_flags |= RTLD_LO_TRACE; objlist_init(&initlist); @@ -2006,7 +2021,7 @@ dlopen(const char *name, int mode) obj = obj_main; obj->refcount++; } else { - obj = load_object(name, obj_main, noload); + obj = load_object(name, obj_main, lo_flags); } if (obj) { @@ -2016,7 +2031,7 @@ dlopen(const char *name, int mode) mode &= RTLD_MODEMASK; if (*old_obj_tail != NULL) { /* We loaded something new. */ assert(*old_obj_tail == obj); - result = load_needed_objects(obj); + result = load_needed_objects(obj, RTLD_LO_DLOPEN); init_dag(obj); if (result != -1) result = rtld_verify_versions(&obj->dagmembers); Modified: stable/8/libexec/rtld-elf/rtld.h ============================================================================== --- stable/8/libexec/rtld-elf/rtld.h Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/libexec/rtld-elf/rtld.h Thu Dec 17 19:53:16 2009 (r200645) @@ -218,6 +218,7 @@ typedef struct Struct_Obj_Entry { bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */ + bool z_noopen : 1; /* Do not load on dlopen */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ @@ -240,6 +241,11 @@ typedef struct Struct_Obj_Entry { #define SYMLOOK_DLSYM 0x02 /* Return newes versioned symbol. Used by dlsym. */ +/* Flags for load_object(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD. */ +#define RTLD_LO_DLOPEN 0x02 /* Load_object() called from dlopen(). */ +#define RTLD_LO_TRACE 0x04 /* Only tracing. */ + /* * Symbol cache entry used during relocation to avoid multiple lookups * of the same symbol. Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/sys/sys/elf_common.h Thu Dec 17 19:53:16 2009 (r200645) @@ -471,6 +471,7 @@ typedef struct { #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ /* Values for n_type. Used in core files. */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 19:54:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 949BF1065676; Thu, 17 Dec 2009 19:54:32 +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 8435B8FC1F; Thu, 17 Dec 2009 19:54: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 nBHJsWA7048319; Thu, 17 Dec 2009 19:54:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJsWHL048317; Thu, 17 Dec 2009 19:54:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912171954.nBHJsWHL048317@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 19:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200646 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:54:32 -0000 Author: jhb Date: Thu Dec 17 19:54:32 2009 New Revision: 200646 URL: http://svn.freebsd.org/changeset/base/200646 Log: Partial merge of 187961 to ease compilation of 8.x code on 7: Add a function attribute called `__malloc_like'. Modified: stable/7/sys/sys/cdefs.h Modified: stable/7/sys/sys/cdefs.h ============================================================================== --- stable/7/sys/sys/cdefs.h Thu Dec 17 19:53:16 2009 (r200645) +++ stable/7/sys/sys/cdefs.h Thu Dec 17 19:54:32 2009 (r200646) @@ -224,8 +224,10 @@ #endif #if __GNUC_PREREQ__(2, 96) +#define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) #else +#define __malloc_like #define __pure #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 19:56:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD041065670; Thu, 17 Dec 2009 19:56:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE778FC1B; Thu, 17 Dec 2009 19:56:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHJuAZ3048429; Thu, 17 Dec 2009 19:56:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJuALM048427; Thu, 17 Dec 2009 19:56:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912171956.nBHJuALM048427@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 19:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200647 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:56:10 -0000 Author: jhb Date: Thu Dec 17 19:56:09 2009 New Revision: 200647 URL: http://svn.freebsd.org/changeset/base/200647 Log: Partial merge of 179210 and 192926 to ease compilation of 8.x code on 7: Introduce REMOVE_AFTER() macro's for SLIST and STAILQ. Modified: stable/7/sys/sys/queue.h Modified: stable/7/sys/sys/queue.h ============================================================================== --- stable/7/sys/sys/queue.h Thu Dec 17 19:54:32 2009 (r200646) +++ stable/7/sys/sys/queue.h Thu Dec 17 19:56:09 2009 (r200647) @@ -96,6 +96,7 @@ * _INSERT_AFTER + + + + * _INSERT_TAIL - - + + * _CONCAT - - + + + * _REMOVE_AFTER + - + - * _REMOVE_HEAD + - + - * _REMOVE + + + + * @@ -195,12 +196,16 @@ struct { \ struct type *curelm = SLIST_FIRST((head)); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ - SLIST_NEXT(curelm, field) = \ - SLIST_NEXT(SLIST_NEXT(curelm, field), field); \ + SLIST_REMOVE_AFTER(curelm, field); \ } \ TRASHIT((elm)->field.sle_next); \ } while (0) +#define SLIST_REMOVE_AFTER(elm, field) do { \ + SLIST_NEXT(elm, field) = \ + SLIST_NEXT(SLIST_NEXT(elm, field), field); \ +} while (0) + #define SLIST_REMOVE_HEAD(head, field) do { \ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ } while (0) @@ -287,9 +292,7 @@ struct { \ struct type *curelm = STAILQ_FIRST((head)); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ - if ((STAILQ_NEXT(curelm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((curelm), field);\ + STAILQ_REMOVE_AFTER(head, curelm, field); \ } \ TRASHIT((elm)->field.stqe_next); \ } while (0) @@ -300,6 +303,12 @@ struct { \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) +#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ + if ((STAILQ_NEXT(elm, field) = \ + STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ + (head)->stqh_last = &STAILQ_NEXT((elm), field); \ +} while (0) + /* * List declarations. */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 20:41:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75B9A106566C; Thu, 17 Dec 2009 20:41:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B29E8FC0C; Thu, 17 Dec 2009 20:41: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 nBHKfRlQ049650; Thu, 17 Dec 2009 20:41:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHKfRnQ049646; Thu, 17 Dec 2009 20:41:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912172041.nBHKfRnQ049646@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 20:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200648 - in stable/8/lib/libc: gen include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 20:41:27 -0000 Author: jhb Date: Thu Dec 17 20:41:27 2009 New Revision: 200648 URL: http://svn.freebsd.org/changeset/base/200648 Log: MFC 199606, 199614: Add an internal _once() method. This works identical to pthread_once(3) with the additional property that it is safe for routines in libc to use in both single-threaded and multi-threaded processes. Multi-threaded processes use the pthread_once() implementation from the threading library while single-threaded processes use a simplified "stub" version internal to libc. Added: stable/8/lib/libc/gen/_once_stub.c - copied, changed from r199606, head/lib/libc/gen/_once_stub.c Modified: stable/8/lib/libc/gen/Makefile.inc stable/8/lib/libc/include/libc_private.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/Makefile.inc ============================================================================== --- stable/8/lib/libc/gen/Makefile.inc Thu Dec 17 19:56:09 2009 (r200647) +++ stable/8/lib/libc/gen/Makefile.inc Thu Dec 17 20:41:27 2009 (r200648) @@ -5,7 +5,8 @@ .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ - _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ + _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ + _thread_init.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ Copied and modified: stable/8/lib/libc/gen/_once_stub.c (from r199606, head/lib/libc/gen/_once_stub.c) ============================================================================== --- head/lib/libc/gen/_once_stub.c Fri Nov 20 19:19:51 2009 (r199606, copy source) +++ stable/8/lib/libc/gen/_once_stub.c Thu Dec 17 20:41:27 2009 (r200648) @@ -33,11 +33,8 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -/* - * This implements pthread_once() for the single-threaded case. It is - * non-static so that it can be used by _pthread_stubs.c. - */ -int +/* This implements pthread_once() for the single-threaded case. */ +static int _libc_once(pthread_once_t *once_control, void (*init_routine)(void)) { Modified: stable/8/lib/libc/include/libc_private.h ============================================================================== --- stable/8/lib/libc/include/libc_private.h Thu Dec 17 19:56:09 2009 (r200647) +++ stable/8/lib/libc/include/libc_private.h Thu Dec 17 20:41:27 2009 (r200648) @@ -34,6 +34,7 @@ #ifndef _LIBC_PRIVATE_H_ #define _LIBC_PRIVATE_H_ +#include /* * This global flag is non-zero when a process has created one @@ -147,6 +148,12 @@ int _yp_check(char **); void _init_tls(void); /* + * Provides pthread_once()-like functionality for both single-threaded + * and multi-threaded applications. + */ +int _once(pthread_once_t *, void (*)(void)); + +/* * Set the TLS thread pointer */ void _set_tp(void *tp); From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 20:41:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3564F1065740; Thu, 17 Dec 2009 20:41:41 +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 0AEBF8FC13; Thu, 17 Dec 2009 20:41: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 nBHKfeUY049694; Thu, 17 Dec 2009 20:41:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHKfeIA049690; Thu, 17 Dec 2009 20:41:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912172041.nBHKfeIA049690@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 20:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200649 - in stable/7/lib/libc: gen include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 20:41:41 -0000 Author: jhb Date: Thu Dec 17 20:41:40 2009 New Revision: 200649 URL: http://svn.freebsd.org/changeset/base/200649 Log: MFC 199606, 199614: Add an internal _once() method. This works identical to pthread_once(3) with the additional property that it is safe for routines in libc to use in both single-threaded and multi-threaded processes. Multi-threaded processes use the pthread_once() implementation from the threading library while single-threaded processes use a simplified "stub" version internal to libc. Added: stable/7/lib/libc/gen/_once_stub.c - copied, changed from r199606, head/lib/libc/gen/_once_stub.c Modified: stable/7/lib/libc/gen/Makefile.inc stable/7/lib/libc/include/libc_private.h Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/Makefile.inc ============================================================================== --- stable/7/lib/libc/gen/Makefile.inc Thu Dec 17 20:41:27 2009 (r200648) +++ stable/7/lib/libc/gen/Makefile.inc Thu Dec 17 20:41:40 2009 (r200649) @@ -5,7 +5,8 @@ .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ - _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ + _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ + _thread_init.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ Copied and modified: stable/7/lib/libc/gen/_once_stub.c (from r199606, head/lib/libc/gen/_once_stub.c) ============================================================================== --- head/lib/libc/gen/_once_stub.c Fri Nov 20 19:19:51 2009 (r199606, copy source) +++ stable/7/lib/libc/gen/_once_stub.c Thu Dec 17 20:41:40 2009 (r200649) @@ -33,11 +33,8 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -/* - * This implements pthread_once() for the single-threaded case. It is - * non-static so that it can be used by _pthread_stubs.c. - */ -int +/* This implements pthread_once() for the single-threaded case. */ +static int _libc_once(pthread_once_t *once_control, void (*init_routine)(void)) { Modified: stable/7/lib/libc/include/libc_private.h ============================================================================== --- stable/7/lib/libc/include/libc_private.h Thu Dec 17 20:41:27 2009 (r200648) +++ stable/7/lib/libc/include/libc_private.h Thu Dec 17 20:41:40 2009 (r200649) @@ -34,6 +34,7 @@ #ifndef _LIBC_PRIVATE_H_ #define _LIBC_PRIVATE_H_ +#include /* * This global flag is non-zero when a process has created one @@ -147,6 +148,12 @@ int _yp_check(char **); void _init_tls(void); /* + * Provides pthread_once()-like functionality for both single-threaded + * and multi-threaded applications. + */ +int _once(pthread_once_t *, void (*)(void)); + +/* * Set the TLS thread pointer */ void _set_tp(void *tp); From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 20:41:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9A7106568F; Thu, 17 Dec 2009 20:41:59 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFF348FC1E; Thu, 17 Dec 2009 20:41: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 nBHKfxZJ049754; Thu, 17 Dec 2009 20:41:59 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHKfxaA049752; Thu, 17 Dec 2009 20:41:59 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912172041.nBHKfxaA049752@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 17 Dec 2009 20:41: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: r200650 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 20:42:00 -0000 Author: edwin Date: Thu Dec 17 20:41:59 2009 New Revision: 200650 URL: http://svn.freebsd.org/changeset/base/200650 Log: Nationalise Easter -> Pasen MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Thu Dec 17 20:41:40 2009 (r200649) +++ head/usr.bin/calendar/calendars/calendar.dutch Thu Dec 17 20:41:59 2009 (r200650) @@ -5,6 +5,7 @@ */ LANG=nl_NL.ISO8859-15 +Easter=Pasen /* * Feestdagen @@ -32,21 +33,21 @@ LANG=nl_NL.ISO8859-15 /* * Pasen gerelateerd */ -Easter-50 Carnaval -Easter-49 Carnaval -Easter-48 Carnaval -Easter-47 Carnaval (Vastenavond) -Easter-46 Aswoensdag -Easter-7 Palmzondag -Easter-3 Witte Donderdag -Easter-2 Goede vrijdag -Easter-1 Stille zaterdag -Easter Eerste paasdag -Easter+1 Tweede paasdag -Easter+39 Hemelvaartsdag -Easter+49 Eerste Pinksterdag -Easter+50 Tweede Pinksterdag -Easter+56 Trinitatis +Pasen-50 Carnaval +Pasen-49 Carnaval +Pasen-48 Carnaval +Pasen-47 Carnaval (Vastenavond) +Pasen-46 Aswoensdag +Pasen-7 Palmzondag +Pasen-3 Witte Donderdag +Pasen-2 Goede vrijdag +Pasen-1 Stille zaterdag +Pasen Eerste paasdag +Pasen+1 Tweede paasdag +Pasen+39 Hemelvaartsdag +Pasen+49 Eerste Pinksterdag +Pasen+50 Tweede Pinksterdag +Pasen+56 Trinitatis /* * Misc From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 21:17:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB8B106566B; Thu, 17 Dec 2009 21:17:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD668FC08; Thu, 17 Dec 2009 21:17: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 nBHLHCqq050830; Thu, 17 Dec 2009 21:17:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHLHCbk050827; Thu, 17 Dec 2009 21:17:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912172117.nBHLHCbk050827@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 21:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200651 - stable/7/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:17:12 -0000 Author: jhb Date: Thu Dec 17 21:17:12 2009 New Revision: 200651 URL: http://svn.freebsd.org/changeset/base/200651 Log: Partial merge of 179210 and 192926 to ease compilation of 8.x code on 7: Introduce REMOVE_AFTER() macro's for SLIST and STAILQ. I forgot to merge the manpage update previously. Pointed out by: pluknet Modified: stable/7/share/man/man3/Makefile stable/7/share/man/man3/queue.3 Directory Properties: stable/7/share/man/man3/ (props changed) Modified: stable/7/share/man/man3/Makefile ============================================================================== --- stable/7/share/man/man3/Makefile Thu Dec 17 20:41:59 2009 (r200650) +++ stable/7/share/man/man3/Makefile Thu Dec 17 21:17:12 2009 (r200651) @@ -62,6 +62,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 SLIST_INSERT_HEAD.3 \ queue.3 SLIST_NEXT.3 \ queue.3 SLIST_REMOVE.3 \ + queue.3 SLIST_REMOVE_AFTER.3 \ queue.3 SLIST_REMOVE_HEAD.3 \ queue.3 STAILQ_CONCAT.3 \ queue.3 STAILQ_EMPTY.3 \ @@ -78,6 +79,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 STAILQ_LAST.3 \ queue.3 STAILQ_NEXT.3 \ queue.3 STAILQ_REMOVE.3 \ + queue.3 STAILQ_REMOVE_AFTER.3 \ queue.3 STAILQ_REMOVE_HEAD.3 \ queue.3 TAILQ_CONCAT.3 \ queue.3 TAILQ_EMPTY.3 \ Modified: stable/7/share/man/man3/queue.3 ============================================================================== --- stable/7/share/man/man3/queue.3 Thu Dec 17 20:41:59 2009 (r200650) +++ stable/7/share/man/man3/queue.3 Thu Dec 17 21:17:12 2009 (r200651) @@ -47,6 +47,7 @@ .Nm SLIST_INSERT_AFTER , .Nm SLIST_INSERT_HEAD , .Nm SLIST_NEXT , +.Nm SLIST_REMOVE_AFTER , .Nm SLIST_REMOVE_HEAD , .Nm SLIST_REMOVE , .Nm STAILQ_CONCAT , @@ -63,6 +64,7 @@ .Nm STAILQ_INSERT_TAIL , .Nm STAILQ_LAST , .Nm STAILQ_NEXT , +.Nm STAILQ_REMOVE_AFTER , .Nm STAILQ_REMOVE_HEAD , .Nm STAILQ_REMOVE , .Nm LIST_EMPTY , @@ -113,6 +115,7 @@ lists and tail queues .Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME" +.Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" .\" @@ -130,6 +133,7 @@ lists and tail queues .Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE" "STAILQ_ENTRY NAME" .Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME" +.Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" .\" @@ -376,6 +380,14 @@ The macro returns the next element in the list. .Pp The macro +.Nm SLIST_REMOVE_AFTER +removes the element after +.Fa elm +from the list. Unlike +.Fa SLIST_REMOVE , +this macro does not traverse the entire list. +.Pp +The macro .Nm SLIST_REMOVE_HEAD removes the element .Fa elm @@ -552,6 +564,14 @@ The macro returns the next item on the tail queue, or NULL this item is the last. .Pp The macro +.Nm STAILQ_REMOVE_AFTER +removes the element after +.Fa elm +from the tail queue. Unlike +.Fa STAILQ_REMOVE , +this macro does not traverse the entire tail queue. +.Pp +The macro .Nm STAILQ_REMOVE_HEAD removes the element at the head of the tail queue. For optimum efficiency, From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 21:17:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09138106566C; Thu, 17 Dec 2009 21:17:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5798FC0A; Thu, 17 Dec 2009 21:17: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 nBHLHDZE050861; Thu, 17 Dec 2009 21:17:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHLHDiY050859; Thu, 17 Dec 2009 21:17:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912172117.nBHLHDiY050859@svn.freebsd.org> From: Andrew Thompson Date: Thu, 17 Dec 2009 21:17: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: r200652 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:17:14 -0000 Author: thompsa Date: Thu Dec 17 21:17:13 2009 New Revision: 200652 URL: http://svn.freebsd.org/changeset/base/200652 Log: If the runcount is non-zero in eventhandler_deregister() then one or more threads are executing the eventhandler, sleep in this case to make it safe for module unload. If the runcount was up then an entry would have been marked EHE_DEAD_PRIORITY so use this as a trigger to do the wakeup in eventhandler_prune_list(). Reviewed by: jhb Modified: head/sys/kern/subr_eventhandler.c Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Thu Dec 17 21:17:12 2009 (r200651) +++ head/sys/kern/subr_eventhandler.c Thu Dec 17 21:17:13 2009 (r200652) @@ -178,6 +178,8 @@ eventhandler_deregister(struct eventhand ep->ee_priority = EHE_DEAD_PRIORITY; } } + while (list->el_runcount > 0) + mtx_sleep(list, &list->el_lock, 0, "evhrm", 0); EHL_UNLOCK(list); } @@ -225,16 +227,17 @@ void eventhandler_prune_list(struct eventhandler_list *list) { struct eventhandler_entry *ep, *en; + int pruned = 0; CTR2(KTR_EVH, "%s: pruning list \"%s\"", __func__, list->el_name); EHL_LOCK_ASSERT(list, MA_OWNED); - ep = TAILQ_FIRST(&list->el_entries); - while (ep != NULL) { - en = TAILQ_NEXT(ep, ee_link); + TAILQ_FOREACH_SAFE(ep, &list->el_entries, ee_link, en) { if (ep->ee_priority == EHE_DEAD_PRIORITY) { TAILQ_REMOVE(&list->el_entries, ep, ee_link); free(ep, M_EVENTHANDLER); + pruned++; } - ep = en; } + if (pruned > 0) + wakeup(list); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 21:42:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C02E81065694; Thu, 17 Dec 2009 21:42:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC0E8FC19; Thu, 17 Dec 2009 21:42: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 nBHLgAQP051566; Thu, 17 Dec 2009 21:42:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHLgAkf051560; Thu, 17 Dec 2009 21:42:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912172142.nBHLgAkf051560@svn.freebsd.org> From: Andrew Thompson Date: Thu, 17 Dec 2009 21:42: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: r200653 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:42:10 -0000 Author: thompsa Date: Thu Dec 17 21:42:10 2009 New Revision: 200653 URL: http://svn.freebsd.org/changeset/base/200653 Log: Use the EVENTHANDLER system to hook into the usb device configuration and perform a function such as ejecting a 3G autoinstaller disk. The eventhandler system properly tracks threads and is safe to unload, remove the setting/clearing of a function pointer in the kernel by u3g(4) which included a tsleep for safety. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_dynamic.h head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/serial/u3g.c Thu Dec 17 21:42:10 2009 (r200653) @@ -122,8 +122,13 @@ static void u3g_stop_read(struct ucom_so static void u3g_start_write(struct ucom_softc *ucom); static void u3g_stop_write(struct ucom_softc *ucom); + +static void u3g_test_autoinst(void *, struct usb_device *, + struct usb_attach_arg *); static int u3g_driver_loaded(struct module *mod, int what, void *arg); +static eventhandler_tag u3g_etag; + static const struct usb_config u3g_config[U3G_N_TRANSFER] = { [U3G_BULK_WR] = { @@ -360,58 +365,48 @@ u3g_sael_m460_init(struct usb_device *ud } } -static int -u3g_lookup_huawei(struct usb_attach_arg *uaa) -{ - /* Calling the lookup function will also set the driver info! */ - return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)); -} - /* * The following function handles 3G modem devices (E220, Mobile, * etc.) with auto-install flash disks for Windows/MacOSX on the first * interface. After some command or some delay they change appearance * to a modem. */ -static usb_error_t -u3g_test_huawei_autoinst(struct usb_device *udev, +static void +u3g_test_autoinst(void *arg, struct usb_device *udev, struct usb_attach_arg *uaa) { struct usb_interface *iface; struct usb_interface_descriptor *id; uint32_t flags; - if (udev == NULL) { - return (USB_ERR_INVAL); - } + if (uaa->dev_state != UAA_DEV_READY) + return; + iface = usbd_get_iface(udev, 0); - if (iface == NULL) { - return (USB_ERR_INVAL); - } + if (iface == NULL) + return; id = iface->idesc; - if (id == NULL) { - return (USB_ERR_INVAL); - } - if (id->bInterfaceClass != UICLASS_MASS) { - return (USB_ERR_INVAL); - } - if (u3g_lookup_huawei(uaa)) { + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return; + if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) { /* no device match */ - return (USB_ERR_INVAL); + return; } flags = USB_GET_DRIVER_INFO(uaa); if (flags & U3GFL_HUAWEI_INIT) { u3g_huawei_init(udev); } else if (flags & U3GFL_SCSI_EJECT) { - return (usb_test_autoinstall(udev, 0, 1)); + if (usb_test_autoinstall(udev, 0, 1) != 0) + return; } else if (flags & U3GFL_SIERRA_INIT) { u3g_sierra_init(udev); } else { /* no quirks */ - return (USB_ERR_INVAL); + return; } - return (0); /* success */ + uaa->dev_state = UAA_DEV_EJECTING; + return; /* success */ } static int @@ -420,10 +415,11 @@ u3g_driver_loaded(struct module *mod, in switch (what) { case MOD_LOAD: /* register our autoinstall handler */ - usb_test_huawei_autoinst_p = &u3g_test_huawei_autoinst; + u3g_etag = EVENTHANDLER_REGISTER(usb_dev_configured, + u3g_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); break; case MOD_UNLOAD: - usb_test_huawei_unload(NULL); + EVENTHANDLER_DEREGISTER(usb_dev_configured, u3g_etag); break; default: return (EOPNOTSUPP); @@ -445,7 +441,7 @@ u3g_probe(device_t self) if (uaa->info.bInterfaceClass != UICLASS_VENDOR) { return (ENXIO); } - return (u3g_lookup_huawei(uaa)); + return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)); } static int Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_device.c Thu Dec 17 21:42:10 2009 (r200653) @@ -1204,6 +1204,7 @@ usb_init_attach_arg(struct usb_device *u uaa->device = udev; uaa->usb_mode = udev->flags.usb_mode; uaa->port = udev->port_no; + uaa->dev_state = UAA_DEV_READY; uaa->info.idVendor = UGETW(udev->ddesc.idVendor); uaa->info.idProduct = UGETW(udev->ddesc.idProduct); @@ -1453,6 +1454,9 @@ usb_alloc_device(device_t parent_dev, st size_t scratch_size; usb_error_t err; uint8_t device_index; + uint8_t config_index; + uint8_t config_quirk; + uint8_t set_config_failed; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1732,96 +1736,91 @@ usb_alloc_device(device_t parent_dev, st /* fetch the vendor and product strings from the device */ usbd_set_device_strings(udev); - if (udev->flags.usb_mode == USB_MODE_HOST) { - uint8_t config_index; - uint8_t config_quirk; - uint8_t set_config_failed = 0; + if (udev->flags.usb_mode == USB_MODE_DEVICE) { + /* USB device mode setup is complete */ + err = 0; + goto config_done; + } - /* - * Most USB devices should attach to config index 0 by - * default - */ - if (usb_test_quirk(&uaa, UQ_CFG_INDEX_0)) { - config_index = 0; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_1)) { - config_index = 1; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_2)) { - config_index = 2; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_3)) { - config_index = 3; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_4)) { - config_index = 4; - config_quirk = 1; - } else { - config_index = 0; - config_quirk = 0; - } + /* + * Most USB devices should attach to config index 0 by + * default + */ + if (usb_test_quirk(&uaa, UQ_CFG_INDEX_0)) { + config_index = 0; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_1)) { + config_index = 1; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_2)) { + config_index = 2; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_3)) { + config_index = 3; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_4)) { + config_index = 4; + config_quirk = 1; + } else { + config_index = 0; + config_quirk = 0; + } + set_config_failed = 0; repeat_set_config: - DPRINTF("setting config %u\n", config_index); + DPRINTF("setting config %u\n", config_index); - /* get the USB device configured */ - err = usbd_set_config_index(udev, config_index); - if (err) { - if (udev->ddesc.bNumConfigurations != 0) { - if (!set_config_failed) { - set_config_failed = 1; - /* XXX try to re-enumerate the device */ - err = usbd_req_re_enumerate( - udev, NULL); - if (err == 0) - goto repeat_set_config; - } - DPRINTFN(0, "Failure selecting " - "configuration index %u: %s, port %u, " - "addr %u (ignored)\n", - config_index, usbd_errstr(err), udev->port_no, - udev->address); + /* get the USB device configured */ + err = usbd_set_config_index(udev, config_index); + if (err) { + if (udev->ddesc.bNumConfigurations != 0) { + if (!set_config_failed) { + set_config_failed = 1; + /* XXX try to re-enumerate the device */ + err = usbd_req_re_enumerate(udev, NULL); + if (err == 0) + goto repeat_set_config; } + DPRINTFN(0, "Failure selecting configuration index %u:" + "%s, port %u, addr %u (ignored)\n", + config_index, usbd_errstr(err), udev->port_no, + udev->address); + } + /* + * Some USB devices do not have any configurations. Ignore any + * set config failures! + */ + err = 0; + goto config_done; + } + if (!config_quirk && config_index + 1 < udev->ddesc.bNumConfigurations) { + if ((udev->cdesc->bNumInterface < 2) && + usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0) { + DPRINTFN(0, "Found no endpoints, trying next config\n"); + config_index++; + goto repeat_set_config; + } + if (config_index == 0) { /* - * Some USB devices do not have any - * configurations. Ignore any set config - * failures! + * Try to figure out if we have an + * auto-install disk there: */ - err = 0; - } else if (config_quirk) { - /* user quirk selects configuration index */ - } else if ((config_index + 1) < udev->ddesc.bNumConfigurations) { - - if ((udev->cdesc->bNumInterface < 2) && - (usbd_get_no_descriptors(udev->cdesc, - UDESC_ENDPOINT) == 0)) { - DPRINTFN(0, "Found no endpoints " - "(trying next config)\n"); + if (usb_test_autoinstall(udev, 0, 0) == 0) { + DPRINTFN(0, "Found possible auto-install " + "disk (trying next config)\n"); config_index++; goto repeat_set_config; } - if (config_index == 0) { - /* - * Try to figure out if we have an - * auto-install disk there: - */ - if (usb_test_autoinstall(udev, 0, 0) == 0) { - DPRINTFN(0, "Found possible auto-install " - "disk (trying next config)\n"); - config_index++; - goto repeat_set_config; - } - } - } else if (usb_test_huawei_autoinst_p(udev, &uaa) == 0) { - DPRINTFN(0, "Found Huawei auto-install disk\n"); - /* leave device unconfigured */ - usb_unconfigure(udev, 0); } - } else { - err = 0; /* set success */ + } + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); + if (uaa.dev_state != UAA_DEV_READY) { + /* leave device unconfigured */ + usb_unconfigure(udev, 0); } +config_done: DPRINTF("new dev (addr %d), udev=%p, parent_hub=%p\n", udev->address, udev, udev->parent_hub); Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_dynamic.c Thu Dec 17 21:42:10 2009 (r200653) @@ -57,7 +57,6 @@ static usb_handle_req_t usb_temp_get_des static usb_temp_setup_by_index_t usb_temp_setup_by_index_w; static usb_temp_unsetup_t usb_temp_unsetup_w; static usb_test_quirk_t usb_test_quirk_w; -static usb_test_huawei_autoinst_t usb_test_huawei_autoinst_w; static usb_quirk_ioctl_t usb_quirk_ioctl_w; /* global variables */ @@ -65,7 +64,6 @@ usb_handle_req_t *usb_temp_get_desc_p = usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = &usb_temp_setup_by_index_w; usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w; usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w; -usb_test_huawei_autoinst_t *usb_test_huawei_autoinst_p = &usb_test_huawei_autoinst_w; usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w; devclass_t usb_devclass_ptr = NULL; @@ -105,13 +103,6 @@ usb_temp_unsetup_w(struct usb_device *ud } } -static usb_error_t -usb_test_huawei_autoinst_w(struct usb_device *udev, - struct usb_attach_arg *uaa) -{ - return (USB_ERR_INVAL); -} - void usb_quirk_unload(void *arg) { @@ -156,17 +147,3 @@ usb_bus_unload(void *arg) pause("WAIT", hz); } - -void -usb_test_huawei_unload(void *arg) -{ - /* reset function pointers */ - - usb_test_huawei_autoinst_p = &usb_test_huawei_autoinst_w; - - /* wait for CPU to exit the loaded functions, if any */ - - /* XXX this is a tradeoff */ - - pause("WAIT", 16*hz); -} Modified: head/sys/dev/usb/usb_dynamic.h ============================================================================== --- head/sys/dev/usb/usb_dynamic.h Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_dynamic.h Thu Dec 17 21:42:10 2009 (r200653) @@ -37,8 +37,6 @@ struct usb_device_request; typedef usb_error_t (usb_temp_setup_by_index_t)(struct usb_device *udev, uint16_t index); -typedef usb_error_t (usb_test_huawei_autoinst_t)(struct usb_device *udev, - struct usb_attach_arg *uaa); typedef uint8_t (usb_test_quirk_t)(const struct usbd_lookup_info *info, uint16_t quirk); typedef int (usb_quirk_ioctl_t)(unsigned long cmd, caddr_t data, @@ -51,13 +49,11 @@ extern usb_handle_req_t *usb_temp_get_de extern usb_temp_setup_by_index_t *usb_temp_setup_by_index_p; extern usb_temp_unsetup_t *usb_temp_unsetup_p; extern usb_test_quirk_t *usb_test_quirk_p; -extern usb_test_huawei_autoinst_t *usb_test_huawei_autoinst_p; extern usb_quirk_ioctl_t *usb_quirk_ioctl_p; extern devclass_t usb_devclass_ptr; /* function prototypes */ -void usb_test_huawei_unload(void *); void usb_temp_unload(void *); void usb_quirk_unload(void *); void usb_bus_unload(void *); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usbdi.h Thu Dec 17 21:42:10 2009 (r200653) @@ -29,6 +29,7 @@ struct usb_fifo; struct usb_xfer; struct usb_device; +struct usb_attach_arg; struct usb_interface; struct usb_endpoint; struct usb_page_cache; @@ -98,6 +99,13 @@ typedef int (usb_fifo_ioctl_t)(struct us typedef void (usb_fifo_cmd_t)(struct usb_fifo *fifo); typedef void (usb_fifo_filter_t)(struct usb_fifo *fifo, struct usb_mbuf *m); + +/* USB events */ +#include +typedef void (*usb_dev_configured_t)(void *, struct usb_device *, + struct usb_attach_arg *); +EVENTHANDLER_DECLARE(usb_dev_configured, usb_dev_configured_t); + /* * The following macros are used used to convert milliseconds into * HZ. We use 1024 instead of 1000 milliseconds per second to save a @@ -338,6 +346,10 @@ struct usb_attach_arg { enum usb_hc_mode usb_mode; /* host or device mode */ uint8_t port; uint8_t use_generic; /* hint for generic drivers */ + uint8_t dev_state; +#define UAA_DEV_READY 0 +#define UAA_DEV_DISABLED 1 +#define UAA_DEV_EJECTING 2 }; /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 21:43:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D44381065670; Thu, 17 Dec 2009 21:43:32 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 7A32C8FC08; Thu, 17 Dec 2009 21:43:32 +0000 (UTC) Received: from orion.SpringDaemons.com (adsl-99-48-191-9.dsl.snfc21.sbcglobal.net [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 457268FC4E; Fri, 18 Dec 2009 00:43:30 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 40AF939C4E; Thu, 17 Dec 2009 13:43:26 -0800 (PST) Date: Thu, 17 Dec 2009 13:43:21 -0800 From: Stanislav Sedov To: Xin LI Message-Id: <20091217134321.dc65ba15.stas@FreeBSD.org> In-Reply-To: References: <200912171242.nBHCgjRF033801@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc" Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200630 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:43:32 -0000 --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc Content-Type: text/plain; charset=KOI8-R Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 17 Dec 2009 11:12:22 -0800 Xin LI mentioned: > Hi, >=20 > On Thu, Dec 17, 2009 at 4:42 AM, Stanislav Sedov wrote: > > Author: stas > > Date: Thu Dec 17 12:42:45 2009 > > New Revision: 200630 > > URL: http://svn.freebsd.org/changeset/base/200630 > > > > Log: > > =9A- Partially revert r200417. =9Aconfig.h brings several definitions, > > =9A =9Athat appears to be actually used. =9AWithout config.h included > > =9A =9Across-build of world failed (at least for ARM). >=20 > Sorry for the breakage, I was shock that this was not caught by ``make > universe'', could you please send me a copy of the build log so I will > be able to see why? Sure, here is it: http://www.SpringDaemons.com/stas/broken_log.Z And this log is after my fix: http://www.SpringDaemons.com/stas/log1.z I'm not entirely sure why it fails, but it seem to have something to do with "LIBRARIES" and "RECHECK" definitions. Thanks! --=20 Stanislav Sedov ST4096-RIPE --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJLKqX+AAoJEL8lojEJL9nwXS4P/jdn6bBYrQvE5DUQ9WS1IdVk A+KG/+GX4vhddc/HJcLO64yv+U1N+2hQszWW8ddzbpISJGDorvIoKlDgMhzi2MIK NAHimbQJTzo9q24TnY4gOdSvbqmwMmPvaJJBqtKWidt8pAJcMUfOHHRisaYMBd1n yjOjhILyKkOpHzlg/yWtioi2tkdNHzgP/7lCDMOGxSTeqBTQ2uN+5slQ3HCeWeda /6HrYFckbaVPtIPp0/6DI1khjMfBmnL9Q5cQEiPQNSJ8WmAQmeEnoTS+J5a7OJXE jr2G+d0OcwZpUuTBhxyFXMwvVqzOmynM4LZYkmP7KxidtplrB392zO6uebZ/ZwEC G8U908JCErFY5yuNgSFH6uXg6UH6Vy6p5shYNyQ+aXAxqCmnWn1VBfJWuASHoisw Ufhq6wuLyB0ldtb4tpBGYTQFcPTdQSmenC3WeTVS278PvkNFk0iTUbYcAUGyAu9G Y4sTI1gW6gsZtVbzw4rNbVcEtFiywEij3WDpXVCjaenMGl6bFPmnMpmnsPCOgYXu 26JlPmEefqFWFPchKvzIPFdfCeVsC2yvdcVk9vMZgImVhxCfmtK0kbv+KHn8wj08 qLNSV9fpTmJVR86hYQDPXCZ7ad17UxvTmJZS4wk+wQH74EfvbePNe2oc6IRHVjhE 1yOE6iRIqjbK1jq4eHui =SKTo -----END PGP SIGNATURE----- --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 23:11:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB518106566B; Thu, 17 Dec 2009 23:11:16 +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 BA9898FC14; Thu, 17 Dec 2009 23:11: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 nBHNBG0h063426; Thu, 17 Dec 2009 23:11:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHNBGML063422; Thu, 17 Dec 2009 23:11:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912172311.nBHNBGML063422@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 23:11: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: r200654 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 23:11:16 -0000 Author: luigi Date: Thu Dec 17 23:11:16 2009 New Revision: 200654 URL: http://svn.freebsd.org/changeset/base/200654 Log: Add some experimental code to log traffic with tcpdump, similar to pflog(4). To use the feature, just put the 'log' options on rules you are interested in, e.g. ipfw add 5000 count log .... and run tcpdump -ni ipfw0 ... net.inet.ip.fw.verbose=0 enables logging to ipfw0, net.inet.ip.fw.verbose=1 sends logging to syslog as before. More features can be added, similar to pflog(), to store in the MAC header metadata such as rule numbers and actions. Manpage to come once features are settled. Modified: head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 23:11:16 2009 (r200654) @@ -1651,8 +1651,7 @@ do { \ } case O_LOG: - if (V_fw_verbose) - ipfw_log(f, hlen, args, m, + ipfw_log(f, hlen, args, m, oif, offset, tablearg, ip); match = 1; break; @@ -2287,6 +2286,7 @@ ipfw_init(void) printf("limited to %d packets/entry by default\n", V_verbose_limit); + ipfw_log_bpf(1); /* init */ return (error); } @@ -2297,6 +2297,7 @@ static void ipfw_destroy(void) { + ipfw_log_bpf(0); /* uninit */ ipfw_dyn_detach(); printf("IP firewall unloaded\n"); } Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw_log.c Thu Dec 17 23:11:16 2009 (r200654) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include /* for ETHERTYPE_IP */ #include #include +#include /* for IFT_ETHER */ +#include /* for BPF */ #include #include @@ -88,6 +90,48 @@ __FBSDID("$FreeBSD$"); #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) +static struct ifnet *log_if; /* hook to attach to bpf */ + +/* we use this dummy function for all ifnet callbacks */ +static int +log_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr) +{ + return EINVAL; +} + +void +ipfw_log_bpf(int onoff) +{ + struct ifnet *ifp; + + if (onoff) { + if (log_if) + return; + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) + return; + if_initname(ifp, "ipfw", 0); + ifp->if_mtu = 65536; + ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = (void *)log_dummy; + ifp->if_ioctl = log_dummy; + ifp->if_start = (void *)log_dummy; + ifp->if_output = (void *)log_dummy; + ifp->if_addrlen = 6; + ifp->if_hdrlen = 14; + if_attach(ifp); + ifp->if_baudrate = IF_Mbps(10); + bpfattach(ifp, DLT_EN10MB, 14); + log_if = ifp; + } else { + if (log_if) { + ether_ifdetach(log_if); + if_free(log_if); + } + log_if = NULL; + } +} + /* * We enter here when we have a rule with O_LOG. * XXX this function alone takes about 2Kbytes of code! @@ -102,6 +146,36 @@ ipfw_log(struct ip_fw *f, u_int hlen, st int limit_reached = 0; char action2[40], proto[128], fragment[32]; + if (V_fw_verbose == 0) { + struct m_hdr mh; + + if (log_if == NULL || log_if->if_bpf == NULL) + return; + /* BPF treats the "mbuf" as read-only */ + mh.mh_next = m; + mh.mh_len = ETHER_HDR_LEN; + if (args->eh) { /* layer2, use orig hdr */ + mh.mh_data = (char *)args->eh; + } else { + /* add fake header. Later we will store + * more info in the header + */ + mh.mh_data = "DDDDDDSSSSSS\x08\x00"; + if (args->f_id.addr_type == 4) { + /* restore wire format */ + ip->ip_off = ntohs(ip->ip_off); + ip->ip_len = ntohs(ip->ip_len); + } + } + BPF_MTAP(log_if, (struct mbuf *)&mh); + if (args->eh == NULL && args->f_id.addr_type == 4) { + /* restore host format */ + ip->ip_off = htons(ip->ip_off); + ip->ip_len = htons(ip->ip_len); + } + return; + } + /* the old 'log' function */ fragment[0] = '\0'; proto[0] = '\0'; Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw_private.h Thu Dec 17 23:11:16 2009 (r200654) @@ -113,6 +113,7 @@ void ipfw_nat_destroy(void); /* In ip_fw_log.c */ struct ip; +void ipfw_log_bpf(int); void ipfw_log(struct ip_fw *f, u_int hlen, struct ip_fw_args *args, struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, struct ip *ip); From owner-svn-src-all@FreeBSD.ORG Thu Dec 17 23:42:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B83106568B; Thu, 17 Dec 2009 23:42:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48068FC1A; Thu, 17 Dec 2009 23:42: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 nBHNg9jw064229; Thu, 17 Dec 2009 23:42:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHNg997064227; Thu, 17 Dec 2009 23:42:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912172342.nBHNg997064227@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Dec 2009 23:42: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: r200655 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 23:42:10 -0000 Author: mav Date: Thu Dec 17 23:42:09 2009 New Revision: 200655 URL: http://svn.freebsd.org/changeset/base/200655 Log: Serverworks OSB4 has no 0x4a (piomode) register, do not touch it. Also OSB4 has some problems with UDMA transfers, limit it to WDMA2. Modified: head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Thu Dec 17 23:11:16 2009 (r200654) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Thu Dec 17 23:42:09 2009 (r200655) @@ -80,7 +80,7 @@ ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); static struct ata_chip_id ids[] = - {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_UDMA2, "ROSB4" }, + {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, { ATA_CSB6, 0x00, SWKS_100, 0, ATA_UDMA5, "CSB6" }, @@ -388,10 +388,12 @@ ata_serverworks_setmode(device_t dev, in piomode = mode; } /* Set PIO mode and timings, calculated above. */ - pci_write_config(parent, 0x4a, + if (ctlr->chip->cfg1 != SWKS_33) { + pci_write_config(parent, 0x4a, (pci_read_config(parent, 0x4a, 2) & ~(0xf << (devno << 2))) | ((piomode - ATA_PIO0) << (devno<<2)),2); + } pci_write_config(parent, 0x40, (pci_read_config(parent, 0x40, 4) & ~(0xff << offset)) | From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 00:34:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA54B1065692; Fri, 18 Dec 2009 00:34:58 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E658FC19; Fri, 18 Dec 2009 00:34: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 nBI0YwgU065777; Fri, 18 Dec 2009 00:34:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI0YwfE065774; Fri, 18 Dec 2009 00:34:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912180034.nBI0YwfE065774@svn.freebsd.org> From: Andrew Thompson Date: Fri, 18 Dec 2009 00:34: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: r200657 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 00:34:59 -0000 Author: thompsa Date: Fri Dec 18 00:34:58 2009 New Revision: 200657 URL: http://svn.freebsd.org/changeset/base/200657 Log: Add a bunch of new 3G ids obtained from from various operating systems and Internet sources. Obtained from: Linux, NetBSD, OpenBSD, etc Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Dec 17 23:55:49 2009 (r200656) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:34:58 2009 (r200657) @@ -178,33 +178,123 @@ MODULE_DEPEND(u3g, usb, 1, 1, 1); static const struct usb_device_id u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - /* OEM: Huawei */ - U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(ACERP, H10, 0), + U3G_DEV(AIRPLUS, MCD650, 0), + U3G_DEV(AIRPRIME, PC5220, 0), + U3G_DEV(ALINK, 3G, 0), + U3G_DEV(ALINK, 3GU, 0), + U3G_DEV(ALINK, DWM652U5, 0), + U3G_DEV(AMOI, H01, 0), + U3G_DEV(AMOI, H01A, 0), + U3G_DEV(AMOI, H02, 0), + U3G_DEV(ANYDATA, ADU_620UW, 0), + U3G_DEV(ANYDATA, ADU_500A, 0), + U3G_DEV(ANYDATA, ADU_E100X, 0), + U3G_DEV(AXESSTEL, DATAMODEM, 0), + U3G_DEV(CMOTECH, CDMA_MODEM1, 0), + U3G_DEV(DELL, U5500, 0), + U3G_DEV(DELL, U5505, 0), + U3G_DEV(DELL, U5510, 0), + U3G_DEV(DELL, U5520, 0), + U3G_DEV(DELL, U5520_2, 0), + U3G_DEV(DELL, U5520_3, 0), + U3G_DEV(DELL, U5700, 0), + U3G_DEV(DELL, U5700_2, 0), + U3G_DEV(DELL, U5700_3, 0), + U3G_DEV(DELL, U5700_4, 0), + U3G_DEV(DELL, U5720, 0), + U3G_DEV(DELL, U5720_2, 0), + U3G_DEV(DELL, U5730, 0), + U3G_DEV(DELL, U5730_2, 0), + U3G_DEV(DELL, U5730_3, 0), + U3G_DEV(DELL, U740, 0), + U3G_DEV(DLINK3, DWM652, 0), + U3G_DEV(HP, EV2200, 0), + U3G_DEV(HP, HS2300, 0), + U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1401, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1402, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1403, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1404, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1405, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1406, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1407, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1408, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1409, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1410, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1411, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1412, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1413, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1414, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1415, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1416, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1417, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1418, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1419, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1420, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1421, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1422, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1423, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1424, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1425, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1426, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1427, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1428, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1429, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1430, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1431, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1432, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1433, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1434, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1435, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1436, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1437, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1438, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1439, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E14AC, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), - /* OEM: Option */ - U3G_DEV(OPTION, GT3G, 0), - U3G_DEV(OPTION, GT3GQUAD, 0), - U3G_DEV(OPTION, GT3GPLUS, 0), - U3G_DEV(OPTION, GTMAX36, 0), - U3G_DEV(OPTION, GTHSDPA, 0), - U3G_DEV(OPTION, GTMAXHSUPA, 0), - U3G_DEV(OPTION, GTMAXHSUPAE, 0), - U3G_DEV(OPTION, GTMAX380HSUPAE, 0), - U3G_DEV(OPTION, VODAFONEMC3G, 0), - /* OEM: Qualcomm, Inc. */ - U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), - U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), - /* OEM: Merlin */ + U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(KYOCERA2, KPC680, 0), + U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(MERLIN, V620, 0), - /* OEM: Novatel */ - U3G_DEV(NOVATEL, CDMA_MODEM, 0), + U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), + U3G_DEV(NOVATEL, ES620_2, 0), + U3G_DEV(NOVATEL, EU730, 0), + U3G_DEV(NOVATEL, EU740, 0), + U3G_DEV(NOVATEL, EU870D, 0), + U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), + U3G_DEV(NOVATEL, U727_2, 0), U3G_DEV(NOVATEL, U740, 0), U3G_DEV(NOVATEL, U740_2, 0), + U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), U3G_DEV(NOVATEL, U870, 0), U3G_DEV(NOVATEL, V620, 0), U3G_DEV(NOVATEL, V640, 0), @@ -212,41 +302,199 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, V740, 0), U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), - U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), - U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), - U3G_DEV(DELL, U740, 0), - /* OEM: Sierra Wireless: */ - U3G_DEV(SIERRA, AIRCARD580, 0), - U3G_DEV(SIERRA, AIRCARD595, 0), + U3G_DEV(OPTION, GT3G_1, 0), + U3G_DEV(OPTION, GT3G_2, 0), + U3G_DEV(OPTION, GT3G_3, 0), + U3G_DEV(OPTION, GT3G_4, 0), + U3G_DEV(OPTION, GT3G_5, 0), + U3G_DEV(OPTION, GT3G_6, 0), + U3G_DEV(OPTION, E6500, 0), + U3G_DEV(OPTION, E6501, 0), + U3G_DEV(OPTION, E6601, 0), + U3G_DEV(OPTION, E6721, 0), + U3G_DEV(OPTION, E6741, 0), + U3G_DEV(OPTION, E6761, 0), + U3G_DEV(OPTION, E6800, 0), + U3G_DEV(OPTION, E7021, 0), + U3G_DEV(OPTION, E7041, 0), + U3G_DEV(OPTION, E7061, 0), + U3G_DEV(OPTION, E7100, 0), + U3G_DEV(OPTION, GTM380, 0), + U3G_DEV(OPTION, GT3G, 0), + U3G_DEV(OPTION, GT3GPLUS, 0), + U3G_DEV(OPTION, GT3GQUAD, 0), + U3G_DEV(OPTION, GTHSDPA, 0), + U3G_DEV(OPTION, GTMAX36, 0), + U3G_DEV(OPTION, GTMAX380HSUPAE, 0), + U3G_DEV(OPTION, GTMAXHSUPA, 0), + U3G_DEV(OPTION, GTMAXHSUPAE, 0), + U3G_DEV(OPTION, VODAFONEMC3G, 0), + U3G_DEV(QISDA, H21_1, 0), + U3G_DEV(QISDA, H21_2, 0), + U3G_DEV(QISDA, H20_1, 0), + U3G_DEV(QISDA, H20_2, 0), + U3G_DEV(QUALCOMM2, AC8700, 0), + U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMMINC, E0002, 0), + U3G_DEV(QUALCOMMINC, E0003, 0), + U3G_DEV(QUALCOMMINC, E0004, 0), + U3G_DEV(QUALCOMMINC, E0005, 0), + U3G_DEV(QUALCOMMINC, E0006, 0), + U3G_DEV(QUALCOMMINC, E0007, 0), + U3G_DEV(QUALCOMMINC, E0008, 0), + U3G_DEV(QUALCOMMINC, E0009, 0), + U3G_DEV(QUALCOMMINC, E000A, 0), + U3G_DEV(QUALCOMMINC, E000B, 0), + U3G_DEV(QUALCOMMINC, E000C, 0), + U3G_DEV(QUALCOMMINC, E000D, 0), + U3G_DEV(QUALCOMMINC, E000E, 0), + U3G_DEV(QUALCOMMINC, E000F, 0), + U3G_DEV(QUALCOMMINC, E0010, 0), + U3G_DEV(QUALCOMMINC, E0011, 0), + U3G_DEV(QUALCOMMINC, E0012, 0), + U3G_DEV(QUALCOMMINC, E0013, 0), + U3G_DEV(QUALCOMMINC, E0014, 0), + U3G_DEV(QUALCOMMINC, MF628, 0), + U3G_DEV(QUALCOMMINC, E0016, 0), + U3G_DEV(QUALCOMMINC, E0017, 0), + U3G_DEV(QUALCOMMINC, E0018, 0), + U3G_DEV(QUALCOMMINC, E0019, 0), + U3G_DEV(QUALCOMMINC, E0020, 0), + U3G_DEV(QUALCOMMINC, E0021, 0), + U3G_DEV(QUALCOMMINC, E0022, 0), + U3G_DEV(QUALCOMMINC, E0023, 0), + U3G_DEV(QUALCOMMINC, E0024, 0), + U3G_DEV(QUALCOMMINC, E0025, 0), + U3G_DEV(QUALCOMMINC, E0026, 0), + U3G_DEV(QUALCOMMINC, E0027, 0), + U3G_DEV(QUALCOMMINC, E0028, 0), + U3G_DEV(QUALCOMMINC, E0029, 0), + U3G_DEV(QUALCOMMINC, E0030, 0), + U3G_DEV(QUALCOMMINC, MF626, 0), + U3G_DEV(QUALCOMMINC, E0032, 0), + U3G_DEV(QUALCOMMINC, E0033, 0), + U3G_DEV(QUALCOMMINC, E0037, 0), + U3G_DEV(QUALCOMMINC, E0039, 0), + U3G_DEV(QUALCOMMINC, E0042, 0), + U3G_DEV(QUALCOMMINC, E0043, 0), + U3G_DEV(QUALCOMMINC, E0048, 0), + U3G_DEV(QUALCOMMINC, E0049, 0), + U3G_DEV(QUALCOMMINC, E0051, 0), + U3G_DEV(QUALCOMMINC, E0052, 0), + U3G_DEV(QUALCOMMINC, E0054, 0), + U3G_DEV(QUALCOMMINC, E0055, 0), + U3G_DEV(QUALCOMMINC, E0057, 0), + U3G_DEV(QUALCOMMINC, E0058, 0), + U3G_DEV(QUALCOMMINC, E0059, 0), + U3G_DEV(QUALCOMMINC, E0060, 0), + U3G_DEV(QUALCOMMINC, E0061, 0), + U3G_DEV(QUALCOMMINC, E0062, 0), + U3G_DEV(QUALCOMMINC, E0063, 0), + U3G_DEV(QUALCOMMINC, E0064, 0), + U3G_DEV(QUALCOMMINC, E0066, 0), + U3G_DEV(QUALCOMMINC, E0069, 0), + U3G_DEV(QUALCOMMINC, E0070, 0), + U3G_DEV(QUALCOMMINC, E0073, 0), + U3G_DEV(QUALCOMMINC, E0076, 0), + U3G_DEV(QUALCOMMINC, E0078, 0), + U3G_DEV(QUALCOMMINC, E0082, 0), + U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, E2002, 0), + U3G_DEV(QUALCOMMINC, E2003, 0), + U3G_DEV(QUALCOMMINC, AC8710, 0), + U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC8700, 0), + U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), + U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), + U3G_DEV(QUANTA, Q101, 0), + U3G_DEV(QUANTA, Q111, 0), + U3G_DEV(QUANTA, GLX, 0), + U3G_DEV(QUANTA, GKE, 0), + U3G_DEV(QUANTA, GLE, 0), + U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC597E, 0), - U3G_DEV(SIERRA, C597, 0), + U3G_DEV(SIERRA, AC875E, 0), + U3G_DEV(SIERRA, AC875U, 0), + U3G_DEV(SIERRA, AC875U_2, 0), U3G_DEV(SIERRA, AC880, 0), U3G_DEV(SIERRA, AC880E, 0), U3G_DEV(SIERRA, AC880U, 0), U3G_DEV(SIERRA, AC881, 0), U3G_DEV(SIERRA, AC881E, 0), U3G_DEV(SIERRA, AC881U, 0), + U3G_DEV(SIERRA, AC885E, 0), + U3G_DEV(SIERRA, AC885E_2, 0), U3G_DEV(SIERRA, AC885U, 0), + U3G_DEV(SIERRA, AIRCARD580, 0), + U3G_DEV(SIERRA, AIRCARD595, 0), + U3G_DEV(SIERRA, AIRCARD875, 0), + U3G_DEV(SIERRA, C22, 0), + U3G_DEV(SIERRA, C597, 0), + U3G_DEV(SIERRA, C888, 0), + U3G_DEV(SIERRA, E0029, 0), + U3G_DEV(SIERRA, E6892, 0), + U3G_DEV(SIERRA, E6893, 0), U3G_DEV(SIERRA, EM5625, 0), + U3G_DEV(SIERRA, EM5725, 0), U3G_DEV(SIERRA, MC5720, 0), U3G_DEV(SIERRA, MC5720_2, 0), U3G_DEV(SIERRA, MC5725, 0), - U3G_DEV(SIERRA, MINI5725, 0), - U3G_DEV(SIERRA, AIRCARD875, 0), + U3G_DEV(SIERRA, MC5727, 0), + U3G_DEV(SIERRA, MC5727_2, 0), + U3G_DEV(SIERRA, MC5728, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), U3G_DEV(SIERRA, MC8755_3, 0), + U3G_DEV(SIERRA, MC8755_4, 0), U3G_DEV(SIERRA, MC8765, 0), - U3G_DEV(SIERRA, AC875U, 0), + U3G_DEV(SIERRA, MC8765_2, 0), + U3G_DEV(SIERRA, MC8765_3, 0), + U3G_DEV(SIERRA, MC8775, 0), U3G_DEV(SIERRA, MC8775_2, 0), U3G_DEV(SIERRA, MC8780, 0), + U3G_DEV(SIERRA, MC8780_2, 0), + U3G_DEV(SIERRA, MC8780_3, 0), U3G_DEV(SIERRA, MC8781, 0), - U3G_DEV(HP, HS2300, 0), - /* Sierra TruInstaller device ID */ - U3G_DEV(SIERRA, TRUINSTALL, U3GFL_SIERRA_INIT), - /* PRUEBA SILABS */ + U3G_DEV(SIERRA, MC8781_2, 0), + U3G_DEV(SIERRA, MC8781_3, 0), + U3G_DEV(SIERRA, MC8785, 0), + U3G_DEV(SIERRA, MC8785_2, 0), + U3G_DEV(SIERRA, MC8790, 0), + U3G_DEV(SIERRA, MC8791, 0), + U3G_DEV(SIERRA, MC8792, 0), + U3G_DEV(SIERRA, MINI5725, 0), + U3G_DEV(SIERRA, T11, 0), + U3G_DEV(SIERRA, T598, 0), U3G_DEV(SILABS, SAEL, U3GFL_SAEL_M460_INIT), + U3G_DEV(STELERA, C105, 0), + U3G_DEV(STELERA, E1003, 0), + U3G_DEV(STELERA, E1004, 0), + U3G_DEV(STELERA, E1005, 0), + U3G_DEV(STELERA, E1006, 0), + U3G_DEV(STELERA, E1007, 0), + U3G_DEV(STELERA, E1008, 0), + U3G_DEV(STELERA, E1009, 0), + U3G_DEV(STELERA, E100A, 0), + U3G_DEV(STELERA, E100B, 0), + U3G_DEV(STELERA, E100C, 0), + U3G_DEV(STELERA, E100D, 0), + U3G_DEV(STELERA, E100E, 0), + U3G_DEV(STELERA, E100F, 0), + U3G_DEV(STELERA, E1010, 0), + U3G_DEV(STELERA, E1011, 0), + U3G_DEV(STELERA, E1012, 0), + U3G_DEV(TCTMOBILE, X060S, 0), + U3G_DEV(TELIT, UC864E, 0), + U3G_DEV(TELIT, UC864G, 0), + U3G_DEV(TLAYTECH, TEU800, 0), + U3G_DEV(TOSHIBA, G450, 0), + U3G_DEV(TOSHIBA, HSDPA, 0), + U3G_DEV(YISO, C893, 0), + /* Autoinstallers */ + U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), + U3G_DEV(SIERRA, TRUINSTALL, U3GFL_SIERRA_INIT), +#undef U3G_DEV }; static void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Dec 17 23:55:49 2009 (r200656) +++ head/sys/dev/usb/usbdevs Fri Dec 18 00:34:58 2009 (r200657) @@ -554,6 +554,7 @@ vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante vendor SILABS 0x10c4 Silicon Labs vendor ACTIONS 0x10d6 Actions +vendor AIRPLUS 0x1011 Airplus vendor ANALOG 0x1110 Analog Devices vendor TENX 0x1130 Ten X Technology, Inc. vendor ISSC 0x1131 Integrated System Solution Corp. @@ -561,6 +562,7 @@ vendor JRC 0x1145 Japan Radio Company vendor SPHAIRON 0x114b Sphairon Access Systems GmbH vendor DELORME 0x1163 DeLorme vendor SERVERWORKS 0x1166 ServerWorks +vendor DLINK3 0x1186 Dlink vendor ACERCM 0x1189 Acer Communications & Multimedia vendor SIERRA 0x1199 Sierra Wireless vendor TOPFIELD 0x11db Topfield Co., Ltd @@ -609,6 +611,7 @@ vendor SPARKLAN 0x15a9 SparkLAN vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks +vendor AMOI 0x1614 Amoi Electronics vendor GOODWAY 0x1631 Good Way Technology vendor ENTREGA 0x1645 Entrega vendor ACTIONTEC 0x1668 Actiontec Electronics @@ -628,10 +631,15 @@ vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor TCTMOBILE 0x1bbb TCT Mobile +vendor TELIT 0x1bc7 Telit vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik +vendor QISDA 0x1da5 Qisda +vendor ALINK 0x1e0e Alink vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications +vendor TLAYTECH 0x20b9 Tlay Tech vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -739,6 +747,7 @@ product ACERP ACERSCAN_620U 0x2060 Acers product ACERP ACERSCAN_4300U 0x20b0 Benq 3300U/4300U product ACERP ACERSCAN_640BT 0x20be Acerscan 640BT product ACERP ACERSCAN_1240U 0x20c0 Acerscan 1240U +product ACERP H10 0x4068 AWL400 Wireless Adapter product ACERP ATAPI 0x6003 ATA/ATAPI Adapter product ACERP AWL300 0x9000 AWL300 Wireless Adapter product ACERP AWL400 0x9001 AWL400 Wireless Adapter @@ -815,6 +824,9 @@ product AIPTEK POCKETCAM3M 0x2011 Pocket product AIPTEK2 PENCAM_MEGA_1_3 0x504a PenCam Mega 1.3 product AIPTEK2 SUNPLUS_TECH 0x0c15 Sunplus Technology Inc. +/* AirPlis products */ +product AIRPLUS MCD650 0x3198 MCD650 modem + /* AirPrime products */ product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card @@ -833,6 +845,11 @@ product ALCOR SM_KBD 0x9410 MicroConnec product ALCOR NEC_KBD_HUB 0x9472 NEC Kbd Hub product ALCOR AU6390 0x6390 AU6390 USB-IDE converter +/* Alink products */ +product ALINK DWM652U5 0xce16 DWM-652 +product ALINK 3G 0x9000 3G modem +product ALINK 3GU 0x9200 3G modem + /* Altec Lansing products */ product ALTEC ADA70 0x0070 ADA70 Speakers product ALTEC ASC495 0xff05 ASC495 Speakers @@ -840,6 +857,11 @@ product ALTEC ASC495 0xff05 ASC495 Spea /* Allied Telesyn International products */ product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100 +/* Amoi products */ +product AMOI H01 0x0800 H01 3G modem +product AMOI H01A 0x7002 H01A 3G modem +product AMOI H02 0x0802 H02 3G modem + /* American Power Conversion products */ product APC UPS 0x0002 Uninterruptible Power Supply @@ -855,6 +877,7 @@ product ANCHOR EZUSB 0x2131 EZUSB product ANCHOR EZLINK 0x2720 EZLINK /* AnyData products */ +product ANYDATA ADU_620UW 0x6202 CDMA 2000 EV-DO USB Modem product ANYDATA ADU_E100X 0x6501 CDMA 2000 1xRTT/EV-DO USB Modem product ANYDATA ADU_500A 0x6502 CDMA 2000 EV-DO USB Modem @@ -1150,7 +1173,22 @@ product DELL BC02 0x8000 BC02 Bluetooth product DELL PRISM_GT_1 0x8102 PrismGT USB 2.0 WLAN product DELL TM350 0x8103 TrueMobile 350 Bluetooth USB Adapter product DELL PRISM_GT_2 0x8104 PrismGT USB 2.0 WLAN +product DELL U5700 0x8114 Dell 5700 3G +product DELL U5500 0x8115 Dell 5500 3G +product DELL U5505 0x8116 Dell 5505 3G +product DELL U5700_2 0x8117 Dell 5700 3G +product DELL U5510 0x8118 Dell 5510 3G +product DELL U5700_3 0x8128 Dell 5700 3G +product DELL U5700_4 0x8129 Dell 5700 3G +product DELL U5720 0x8133 Dell 5720 3G +product DELL U5720_2 0x8134 Dell 5720 3G product DELL U740 0x8135 Dell U740 CDMA +product DELL U5520 0x8136 Dell 5520 3G +product DELL U5520_2 0x8137 Dell 5520 3G +product DELL U5520_3 0x8138 Dell 5520 3G +product DELL U5730 0x8180 Dell 5730 3G +product DELL U5730_2 0x8181 Dell 5730 3G +product DELL U5730_3 0x8182 Dell 5730 3G /* Delorme Paublishing products */ product DELORME EARTHMATE 0x0100 Earthmate GPS @@ -1199,6 +1237,7 @@ product DLINK2 DWLG122C1 0x3c03 DWL-G122 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 product DLINK2 DWA110 0x3c07 DWA-110 +product DLINK3 DWM652 0x3e04 DWM-652 /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer @@ -1490,6 +1529,7 @@ product HP P1100 0x3102 Photosmart P110 product HP OJ4215 0x3d11 OfficeJet 4215 product HP HN210E 0x811c Ethernet HN210E product HP2 C500 0x6002 PhotoSmart C500 +product HP EV2200 0x1b1d ev2200 HSDPA (aka MC5720) product HP HS2300 0x1e1d hs2300 HSDPA (aka MC8775) /* HTC products */ @@ -1500,7 +1540,71 @@ product HTC SMARTPHONE 0x0a51 SmartPhon /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile product HUAWEI E220 0x1003 Huawei HSDPA modem +product HUAWEI E220BIS 0x1004 Huawei HSDPA modem +product HUAWEI E1401 0x1401 3G modem +product HUAWEI E1402 0x1402 3G modem +product HUAWEI E1403 0x1403 3G modem +product HUAWEI E1404 0x1404 3G modem +product HUAWEI E1405 0x1405 3G modem +product HUAWEI E1406 0x1406 3G modem +product HUAWEI E1407 0x1407 3G modem +product HUAWEI E1408 0x1408 3G modem +product HUAWEI E1409 0x1409 3G modem +product HUAWEI E140A 0x140a 3G modem +product HUAWEI E140B 0x140b 3G modem product HUAWEI E180V 0x140c Huawei Mobile E180V +product HUAWEI E140D 0x140d 3G modem +product HUAWEI E140E 0x140e 3G modem +product HUAWEI E140F 0x140f 3G modem +product HUAWEI E1410 0x1410 3G modem +product HUAWEI E1411 0x1411 3G modem +product HUAWEI E1412 0x1412 3G modem +product HUAWEI E1413 0x1413 3G modem +product HUAWEI E1414 0x1414 3G modem +product HUAWEI E1415 0x1415 3G modem +product HUAWEI E1416 0x1416 3G modem +product HUAWEI E1417 0x1417 3G modem +product HUAWEI E1418 0x1418 3G modem +product HUAWEI E1419 0x1419 3G modem +product HUAWEI E141A 0x141a 3G modem +product HUAWEI E141B 0x141b 3G modem +product HUAWEI E141C 0x141c 3G modem +product HUAWEI E141D 0x141d 3G modem +product HUAWEI E141E 0x141e 3G modem +product HUAWEI E141F 0x141f 3G modem +product HUAWEI E1420 0x1420 3G modem +product HUAWEI E1421 0x1421 3G modem +product HUAWEI E1422 0x1422 3G modem +product HUAWEI E1423 0x1423 3G modem +product HUAWEI E1424 0x1424 3G modem +product HUAWEI E1425 0x1425 3G modem +product HUAWEI E1426 0x1426 3G modem +product HUAWEI E1427 0x1427 3G modem +product HUAWEI E1428 0x1428 3G modem +product HUAWEI E1429 0x1429 3G modem +product HUAWEI E142A 0x142a 3G modem +product HUAWEI E142B 0x142b 3G modem +product HUAWEI E142C 0x142c 3G modem +product HUAWEI E142D 0x142d 3G modem +product HUAWEI E142E 0x142e 3G modem +product HUAWEI E142F 0x142f 3G modem +product HUAWEI E1430 0x1430 3G modem +product HUAWEI E1431 0x1431 3G modem +product HUAWEI E1432 0x1432 3G modem +product HUAWEI E1433 0x1433 3G modem +product HUAWEI E1434 0x1434 3G modem +product HUAWEI E1435 0x1435 3G modem +product HUAWEI E1436 0x1436 3G modem +product HUAWEI E1437 0x1437 3G modem +product HUAWEI E1438 0x1438 3G modem +product HUAWEI E1439 0x1439 3G modem +product HUAWEI E143A 0x143a 3G modem +product HUAWEI E143B 0x143b 3G modem +product HUAWEI E143C 0x143c 3G modem +product HUAWEI E143D 0x143d 3G modem +product HUAWEI E143E 0x143e 3G modem +product HUAWEI E143F 0x143f 3G modem +product HUAWEI E14AC 0x14ac 3G modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -1641,6 +1745,7 @@ product KYOCERA FINECAM_S5 0x0103 Fineca product KYOCERA FINECAM_L3 0x0105 Finecam L3 product KYOCERA AHK3001V 0x0203 AH-K3001V product KYOCERA2 CDMA_MSM_K 0x17da Qualcomm Kyocera CDMA Technologies MSM +product KYOCERA2 KPC680 0x180a Qualcomm Kyocera CDMA Technologies MSM /* LaCie products */ product LACIE HD 0xa601 Hard Disk @@ -1909,7 +2014,6 @@ product NOVATECH RT2573 0x9021 RT2573 /* Novatel Wireless products */ product NOVATEL V640 0x1100 Merlin V620 -product NOVATEL CDMA_MODEM 0x1110 Novatel Wireless Merlin CDMA product NOVATEL V620 0x1110 Merlin V620 product NOVATEL V740 0x1120 Merlin V740 product NOVATEL V720 0x1130 Merlin V720 @@ -1918,13 +2022,20 @@ product NOVATEL U740_2 0x1410 Merlin U7 product NOVATEL U870 0x1420 Merlin U870 product NOVATEL XU870 0x1430 Merlin XU870 product NOVATEL X950D 0x1450 Merlin X950D -product NOVATEL ES620 0x2100 ES620 CDMA +product NOVATEL ES620 0x2100 Expedite ES620 +product NOVATEL E725 0x2120 Expedite E725 +product NOVATEL ES620_2 0x2130 Expedite ES620 product NOVATEL U720 0x2110 Merlin U720 +product NOVATEL EU730 0x2400 Expedite EU730 +product NOVATEL EU740 0x2410 Expedite EU740 +product NOVATEL EU870D 0x2420 Expedite EU870D product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD +product NOVATEL U727_2 0x5100 Merlin U727 CDMA product NOVATEL U760 0x6000 Novatel U760 +product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ @@ -1961,6 +2072,24 @@ product OPTION GTHSDPA 0x6971 GlobeTrot product OPTION GTMAXHSUPA 0x7001 GlobeTrotter HSUPA product OPTION GTMAXHSUPAE 0x6901 GlobeTrotter HSUPA PCIe product OPTION GTMAX380HSUPAE 0x7211 GlobeTrotter 380HSUPA PCIe +product OPTION GT3G_1 0x6050 3G modem +product OPTION GT3G_2 0x6100 3G modem +product OPTION GT3G_3 0x6150 3G modem +product OPTION GT3G_4 0x6200 3G modem +product OPTION GT3G_5 0x6250 3G modem +product OPTION GT3G_6 0x6350 3G modem +product OPTION E6500 0x6500 3G modem +product OPTION E6501 0x6501 3G modem +product OPTION E6601 0x6601 3G modem +product OPTION E6721 0x6721 3G modem +product OPTION E6741 0x6741 3G modem +product OPTION E6761 0x6761 3G modem +product OPTION E6800 0x6800 3G modem +product OPTION E7021 0x7021 3G modem +product OPTION E7041 0x7041 3G modem +product OPTION E7061 0x7061 3G modem +product OPTION E7100 0x7100 3G modem +product OPTION GTM380 0x7201 3G modem /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface @@ -2081,13 +2210,96 @@ product QCOM RT2573 0x6196 RT2573 product QCOM RT2573_2 0x6229 RT2573 product QCOM RT2573_3 0x6238 RT2573 +/* Qisda products */ +product QISDA H21_1 0x4512 3G modem +product QISDA H21_2 0x4523 3G modem +product QISDA H20_1 0x4515 3G modem +product QISDA H20_2 0x4519 3G modem + /* Qualcomm products */ product QUALCOMM CDMA_MSM 0x6000 CDMA Technologies MSM phone product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem +product QUALCOMM2 AC8700 0x6000 AC8700 +product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage +product QUALCOMMINC AC8710 0xfff1 3G modem +product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem +product QUALCOMMINC E0002 0x0002 3G modem +product QUALCOMMINC E0003 0x0003 3G modem +product QUALCOMMINC E0004 0x0004 3G modem +product QUALCOMMINC E0005 0x0005 3G modem +product QUALCOMMINC E0006 0x0006 3G modem +product QUALCOMMINC E0007 0x0007 3G modem +product QUALCOMMINC E0008 0x0008 3G modem +product QUALCOMMINC E0009 0x0009 3G modem +product QUALCOMMINC E000A 0x000a 3G modem +product QUALCOMMINC E000B 0x000b 3G modem +product QUALCOMMINC E000C 0x000c 3G modem +product QUALCOMMINC E000D 0x000d 3G modem +product QUALCOMMINC E000E 0x000e 3G modem +product QUALCOMMINC E000F 0x000f 3G modem +product QUALCOMMINC E0010 0x0010 3G modem +product QUALCOMMINC E0011 0x0011 3G modem +product QUALCOMMINC E0012 0x0012 3G modem +product QUALCOMMINC E0013 0x0013 3G modem +product QUALCOMMINC E0014 0x0014 3G modem +product QUALCOMMINC MF628 0x0015 3G modem +product QUALCOMMINC E0016 0x0016 3G modem +product QUALCOMMINC E0017 0x0017 3G modem +product QUALCOMMINC E0018 0x0018 3G modem +product QUALCOMMINC E0019 0x0019 3G modem +product QUALCOMMINC E0020 0x0020 3G modem +product QUALCOMMINC E0021 0x0021 3G modem +product QUALCOMMINC E0022 0x0022 3G modem +product QUALCOMMINC E0023 0x0023 3G modem +product QUALCOMMINC E0024 0x0024 3G modem +product QUALCOMMINC E0025 0x0025 3G modem +product QUALCOMMINC E0026 0x0026 3G modem +product QUALCOMMINC E0027 0x0027 3G modem +product QUALCOMMINC E0028 0x0028 3G modem +product QUALCOMMINC E0029 0x0029 3G modem +product QUALCOMMINC E0030 0x0030 3G modem +product QUALCOMMINC MF626 0x0031 3G modem +product QUALCOMMINC E0032 0x0032 3G modem +product QUALCOMMINC E0033 0x0033 3G modem +product QUALCOMMINC E0037 0x0037 3G modem +product QUALCOMMINC E0039 0x0039 3G modem +product QUALCOMMINC E0042 0x0042 3G modem +product QUALCOMMINC E0043 0x0043 3G modem +product QUALCOMMINC E0048 0x0048 3G modem +product QUALCOMMINC E0049 0x0049 3G modem +product QUALCOMMINC E0051 0x0051 3G modem +product QUALCOMMINC E0052 0x0052 3G modem +product QUALCOMMINC E0054 0x0054 3G modem +product QUALCOMMINC E0055 0x0055 3G modem +product QUALCOMMINC E0057 0x0057 3G modem +product QUALCOMMINC E0058 0x0058 3G modem +product QUALCOMMINC E0059 0x0059 3G modem +product QUALCOMMINC E0060 0x0060 3G modem +product QUALCOMMINC E0061 0x0061 3G modem +product QUALCOMMINC E0062 0x0062 3G modem +product QUALCOMMINC E0063 0x0063 3G modem +product QUALCOMMINC E0064 0x0064 3G modem +product QUALCOMMINC E0066 0x0066 3G modem +product QUALCOMMINC E0069 0x0069 3G modem +product QUALCOMMINC E0070 0x0070 3G modem +product QUALCOMMINC E0073 0x0073 3G modem +product QUALCOMMINC E0076 0x0076 3G modem +product QUALCOMMINC E0078 0x0078 3G modem +product QUALCOMMINC E0082 0x0082 3G modem +product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC E2002 0x2002 3G modem +product QUALCOMMINC E2003 0x2003 3G modem + +/* Quanta products */ +product QUANTA Q101 0xea02 HSDPA modem +product QUANTA Q111 0xea03 HSDPA modem +product QUANTA GLX 0xea04 HSDPA modem +product QUANTA GKE 0xea05 HSDPA modem +product QUANTA GLE 0xea06 HSDPA modem /* Qtronix products */ product QTRONIX 980N 0x2011 Scorpion-980N keyboard @@ -2211,33 +2423,62 @@ product SIEMENS3 X65 0x0003 X65 product SIEMENS3 X75 0x0004 X75 /* Sierra Wireless products */ -product SIERRA AIRCARD580 0x0112 Sierra Wireless AirCard 580 +product SIERRA EM5625 0x0017 EM5625 +product SIERRA MC5720_2 0x0018 MC5720 +product SIERRA MC5725 0x0020 MC5725 product SIERRA AIRCARD595 0x0019 Sierra Wireless AirCard 595 -product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA AC597E 0x0021 Sierra Wireless AirCard 597E +product SIERRA EM5725 0x0022 EM5725 product SIERRA C597 0x0023 Sierra Wireless Compass 597 -product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 -product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 -product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 -product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E -product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E -product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U -product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U -product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U -product SIERRA EM5625 0x0017 EM5625 +product SIERRA MC5727 0x0024 MC5727 +product SIERRA T598 0x0025 T598 +product SIERRA T11 0x0026 T11 +product SIERRA AC402 0x0027 AC402 +product SIERRA MC5728 0x0028 MC5728 +product SIERRA E0029 0x0029 E0029 +product SIERRA AIRCARD580 0x0112 Sierra Wireless AirCard 580 +product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA MC5720 0x0218 MC5720 Wireless Modem -product SIERRA MC5720_2 0x0018 MC5720 -product SIERRA MC5725 0x0020 MC5725 product SIERRA MINI5725 0x0220 Sierra Wireless miniPCI 5275 +product SIERRA MC5727_2 0x0224 MC5727 product SIERRA MC8755_2 0x6802 MC8755 product SIERRA MC8765 0x6803 MC8765 product SIERRA MC8755 0x6804 MC8755 +product SIERRA MC8765_2 0x6805 MC8765 +product SIERRA MC8755_4 0x6808 MC8755 +product SIERRA MC8765_3 0x6809 MC8765 product SIERRA AC875U 0x6812 AC875U HSDPA USB Modem product SIERRA MC8755_3 0x6813 MC8755 HSDPA product SIERRA MC8775_2 0x6815 MC8775 -product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA +product SIERRA MC8775 0x6816 MC8775 +product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 +product SIERRA AC875U_2 0x6821 AC875U +product SIERRA AC875E 0x6822 AC875E product SIERRA MC8780 0x6832 MC8780 product SIERRA MC8781 0x6833 MC8781 +product SIERRA MC8780_2 0x6834 MC8780 +product SIERRA MC8781_2 0x6835 MC8781 +product SIERRA MC8780_3 0x6838 MC8780 +product SIERRA MC8781_3 0x6839 MC8781 +product SIERRA MC8785 0x683A MC8785 +product SIERRA MC8785_2 0x683B MC8785 +product SIERRA MC8790 0x683C MC8790 +product SIERRA MC8791 0x683D MC8791 +product SIERRA MC8792 0x683E MC8792 +product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 +product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 +product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E +product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E +product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U +product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U +product SIERRA AC885E 0x6859 AC885E +product SIERRA AC885E_2 0x685A AC885E +product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U +product SIERRA C888 0x6890 C888 +product SIERRA C22 0x6891 C22 +product SIERRA E6892 0x6892 E6892 +product SIERRA E6893 0x6893 E6893 +product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer /* Sigmatel products */ @@ -2352,6 +2593,22 @@ product SPHAIRON UB801R 0x0110 UB801R /* Stelera Wireless products */ product STELERA ZEROCD 0x1000 Zerocd Installer product STELERA C105 0x1002 Stelera/Bandrish C105 USB +product STELERA E1003 0x1003 3G modem +product STELERA E1004 0x1004 3G modem +product STELERA E1005 0x1005 3G modem +product STELERA E1006 0x1006 3G modem +product STELERA E1007 0x1007 3G modem +product STELERA E1008 0x1008 3G modem +product STELERA E1009 0x1009 3G modem +product STELERA E100A 0x100a 3G modem +product STELERA E100B 0x100b 3G modem +product STELERA E100C 0x100c 3G modem +product STELERA E100D 0x100d 3G modem +product STELERA E100E 0x100e 3G modem +product STELERA E100F 0x100f 3G modem +product STELERA E1010 0x1010 3G modem +product STELERA E1011 0x1011 3G modem +product STELERA E1012 0x1012 3G modem /* MpMan products */ product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go @@ -2408,6 +2665,9 @@ product TAPWAVE ZODIAC 0x0100 Zodiac /* Taugagreining products */ product TAUGA CAMERAMATE 0x0005 CameraMate (DPCM_USB) +/* TCTMobile products */ +product TCTMOBILE X060S 0x0000 X060S 3G modem + /* TDK products */ product TDK UPA9664 0x0115 USB-PDC Adapter UPA9664 product TDK UCA1464 0x0116 USB-cdmaOne Adapter UCA1464 @@ -2426,6 +2686,10 @@ product TEKRAM ZD1211_2 0x6630 ZD1211 /* Telex Communications products */ product TELEX MIC1 0x0001 Enhanced USB Microphone +/* Telit products */ +product TELIT UC864E 0x1003 UC864E 3G modem +product TELIT UC864G 0x1004 UC864G 3G modem + /* Ten X Technology, Inc. */ product TENX UAUDIO0 0xf211 USB audio headset @@ -2436,11 +2700,16 @@ product TI TUSB2046 0x2046 TUSB2046 hub /* Thrustmaster products */ product THRUST FUSION_PAD 0xa0a3 Fusion Digital Gamepad +/* TLayTech products */ +product TLAYTECH TEU800 0x1682 TEU800 3G modem + /* Topre Corporation products */ product TOPRE HHKB 0x0100 HHKB Professional /* Toshiba Corporation products */ product TOSHIBA POCKETPC_E740 0x0706 PocketPC e740 +product TOSHIBA G450 0x0d45 G450 modem +product TOSHIBA HSDPA 0x1302 G450 modem /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 00:36:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 676DA106566B; Fri, 18 Dec 2009 00:36:30 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C948FC16; Fri, 18 Dec 2009 00:36: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 nBI0aUZj065873; Fri, 18 Dec 2009 00:36:30 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI0aUV9065871; Fri, 18 Dec 2009 00:36:30 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912180036.nBI0aUV9065871@svn.freebsd.org> From: Andrew Thompson Date: Fri, 18 Dec 2009 00:36: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: r200658 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 00:36:30 -0000 Author: thompsa Date: Fri Dec 18 00:36:30 2009 New Revision: 200658 URL: http://svn.freebsd.org/changeset/base/200658 Log: Keep list sorted. Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:34:58 2009 (r200657) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:36:30 2009 (r200658) @@ -187,8 +187,8 @@ static const struct usb_device_id u3g_de U3G_DEV(AMOI, H01, 0), U3G_DEV(AMOI, H01A, 0), U3G_DEV(AMOI, H02, 0), - U3G_DEV(ANYDATA, ADU_620UW, 0), U3G_DEV(ANYDATA, ADU_500A, 0), + U3G_DEV(ANYDATA, ADU_620UW, 0), U3G_DEV(ANYDATA, ADU_E100X, 0), U3G_DEV(AXESSTEL, DATAMODEM, 0), U3G_DEV(CMOTECH, CDMA_MODEM1, 0), @@ -211,7 +211,6 @@ static const struct usb_device_id u3g_de U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), - U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1401, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1402, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1403, U3GFL_HUAWEI_INIT), @@ -277,9 +276,10 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E14AC, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), - U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), + U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), @@ -302,12 +302,6 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, V740, 0), U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), - U3G_DEV(OPTION, GT3G_1, 0), - U3G_DEV(OPTION, GT3G_2, 0), - U3G_DEV(OPTION, GT3G_3, 0), - U3G_DEV(OPTION, GT3G_4, 0), - U3G_DEV(OPTION, GT3G_5, 0), - U3G_DEV(OPTION, GT3G_6, 0), U3G_DEV(OPTION, E6500, 0), U3G_DEV(OPTION, E6501, 0), U3G_DEV(OPTION, E6601, 0), @@ -319,22 +313,32 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, E7041, 0), U3G_DEV(OPTION, E7061, 0), U3G_DEV(OPTION, E7100, 0), - U3G_DEV(OPTION, GTM380, 0), U3G_DEV(OPTION, GT3G, 0), U3G_DEV(OPTION, GT3GPLUS, 0), U3G_DEV(OPTION, GT3GQUAD, 0), + U3G_DEV(OPTION, GT3G_1, 0), + U3G_DEV(OPTION, GT3G_2, 0), + U3G_DEV(OPTION, GT3G_3, 0), + U3G_DEV(OPTION, GT3G_4, 0), + U3G_DEV(OPTION, GT3G_5, 0), + U3G_DEV(OPTION, GT3G_6, 0), U3G_DEV(OPTION, GTHSDPA, 0), + U3G_DEV(OPTION, GTM380, 0), U3G_DEV(OPTION, GTMAX36, 0), U3G_DEV(OPTION, GTMAX380HSUPAE, 0), U3G_DEV(OPTION, GTMAXHSUPA, 0), U3G_DEV(OPTION, GTMAXHSUPAE, 0), U3G_DEV(OPTION, VODAFONEMC3G, 0), - U3G_DEV(QISDA, H21_1, 0), - U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QISDA, H20_1, 0), U3G_DEV(QISDA, H20_2, 0), + U3G_DEV(QISDA, H21_1, 0), + U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC8700, 0), + U3G_DEV(QUALCOMMINC, AC8710, 0), + U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), U3G_DEV(QUALCOMMINC, E0002, 0), U3G_DEV(QUALCOMMINC, E0003, 0), U3G_DEV(QUALCOMMINC, E0004, 0), @@ -354,7 +358,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0012, 0), U3G_DEV(QUALCOMMINC, E0013, 0), U3G_DEV(QUALCOMMINC, E0014, 0), - U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, E0016, 0), U3G_DEV(QUALCOMMINC, E0017, 0), U3G_DEV(QUALCOMMINC, E0018, 0), @@ -370,7 +373,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0028, 0), U3G_DEV(QUALCOMMINC, E0029, 0), U3G_DEV(QUALCOMMINC, E0030, 0), - U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, E0032, 0), U3G_DEV(QUALCOMMINC, E0033, 0), U3G_DEV(QUALCOMMINC, E0037, 0), @@ -401,16 +403,14 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0086, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), - U3G_DEV(QUALCOMMINC, AC8710, 0), - U3G_DEV(QUALCOMMINC, AC2726, 0), - U3G_DEV(QUALCOMMINC, AC8700, 0), - U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), + U3G_DEV(QUALCOMMINC, MF626, 0), + U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), - U3G_DEV(QUANTA, Q101, 0), - U3G_DEV(QUANTA, Q111, 0), - U3G_DEV(QUANTA, GLX, 0), U3G_DEV(QUANTA, GKE, 0), U3G_DEV(QUANTA, GLE, 0), + U3G_DEV(QUANTA, GLX, 0), + U3G_DEV(QUANTA, Q101, 0), + U3G_DEV(QUANTA, Q111, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC597E, 0), From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 06:09:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C14F106566C; Fri, 18 Dec 2009 06:09:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EECF98FC15; Fri, 18 Dec 2009 06:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBI69h0C076832; Fri, 18 Dec 2009 06:09:43 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI69hN7076830; Fri, 18 Dec 2009 06:09:43 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912180609.nBI69hN7076830@svn.freebsd.org> From: Brooks Davis Date: Fri, 18 Dec 2009 06:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200662 - stable/8/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 06:09:44 -0000 Author: brooks Date: Fri Dec 18 06:09:43 2009 New Revision: 200662 URL: http://svn.freebsd.org/changeset/base/200662 Log: MFC r200366 Add a missing else that negated the truncation of ki_ngroups to NGROUPS. Submitted by: Dmitry Pryanishnikov Modified: stable/8/lib/libkvm/kvm_proc.c Directory Properties: stable/8/lib/libkvm/ (props changed) Modified: stable/8/lib/libkvm/kvm_proc.c ============================================================================== --- stable/8/lib/libkvm/kvm_proc.c Fri Dec 18 01:30:11 2009 (r200661) +++ stable/8/lib/libkvm/kvm_proc.c Fri Dec 18 06:09:43 2009 (r200662) @@ -149,7 +149,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn if (ucred.cr_ngroups > KI_NGROUPS) { kp->ki_ngroups = KI_NGROUPS; kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; - } + } else kp->ki_ngroups = ucred.cr_ngroups; kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 11:27:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32EB1106568B; Fri, 18 Dec 2009 11:27:36 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id DE9C88FC08; Fri, 18 Dec 2009 11:27:35 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EEBA96D450; Fri, 18 Dec 2009 11:27:34 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id CC1BD84549; Fri, 18 Dec 2009 12:27:34 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> Date: Fri, 18 Dec 2009 12:27:34 +0100 In-Reply-To: <200912161541.53834.jhb@freebsd.org> (John Baldwin's message of "Wed, 16 Dec 2009 15:41:53 -0500") Message-ID: <868wd0cyjd.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 11:27:36 -0000 John Baldwin writes: > Warner Losh writes: > > Log: > > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. > >=20=20=20 > > Note: Not sure this is the right way to do compat, but it makes the > > headers consistent with the implementations. > Please revert. I think this has already been reverted once before. Yep, that was me... we concluded back then that this is a perfectly reasonable dependency; perhaps we should simply add the appropriate #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) without FREEBSD_COMPAT(n+1). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 12:09:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF24106566B; Fri, 18 Dec 2009 12:09:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD838FC0A; Fri, 18 Dec 2009 12:09:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIC9iks090747; Fri, 18 Dec 2009 12:09:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIC9iov090746; Fri, 18 Dec 2009 12:09:44 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912181209.nBIC9iov090746@svn.freebsd.org> From: Christian Brueffer Date: Fri, 18 Dec 2009 12:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200665 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 12:09:44 -0000 Author: brueffer Date: Fri Dec 18 12:09:44 2009 New Revision: 200665 URL: http://svn.freebsd.org/changeset/base/200665 Log: MFC: r197900 Improved one-line description of this module (taken from NOTES). Modified: stable/7/share/man/man4/lindev.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/lindev.4 ============================================================================== --- stable/7/share/man/man4/lindev.4 Fri Dec 18 08:35:34 2009 (r200664) +++ stable/7/share/man/man4/lindev.4 Fri Dec 18 12:09:44 2009 (r200665) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm lindev -.Nd the lindev module +.Nd Linux-specific pseudo devices support .Sh SYNOPSIS To compile this collection of linux-specific pseudo devices into the kernel, place the following line in your kernel configuration file: From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 12:10:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EF581065670; Fri, 18 Dec 2009 12:10:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B9B8FC16; Fri, 18 Dec 2009 12:10: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 nBICAgDu090827; Fri, 18 Dec 2009 12:10:42 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBICAgjX090825; Fri, 18 Dec 2009 12:10:42 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912181210.nBICAgjX090825@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 18 Dec 2009 12:10: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: r200666 - head/sys/dev/ipmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 12:10:43 -0000 Author: ru Date: Fri Dec 18 12:10:42 2009 New Revision: 200666 URL: http://svn.freebsd.org/changeset/base/200666 Log: - Fixed incorrect watchdog timeout setting: MSB of a 2-byte value is obtained by dividing it by 256, not by 2550; also, one second is 10^9 nanoseconds, not 1800000000 nanoseconds. - Due to rounding error, setting watchdog to a really small timeout (<1 sec) was turning the watchdog off. It should set the watchdog to a small timeout instead. - Implemented error checking in ipmi_wd_event(), as required by watchdog(9). PR: kern/130512 Submitted by: Dmitrij Tejblum - Additionally, check that the timeout value is within the supported range, and if it's too large, act as required by watchdog(9). MFC after: 3 days Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Fri Dec 18 12:09:44 2009 (r200665) +++ head/sys/dev/ipmi/ipmi.c Fri Dec 18 12:10:42 2009 (r200666) @@ -588,12 +588,15 @@ ipmi_polled_enqueue_request(struct ipmi_ * Watchdog event handler. */ -static void -ipmi_set_watchdog(struct ipmi_softc *sc, int sec) +static int +ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; int error; + if (sec > 0xffff / 10) + return (EINVAL); + req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); @@ -604,7 +607,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[2] = 0; req->ir_request[3] = 0; /* Timer use */ req->ir_request[4] = (sec * 10) & 0xff; - req->ir_request[5] = (sec * 10) / 2550; + req->ir_request[5] = (sec * 10) >> 8; } else { req->ir_request[0] = IPMI_SET_WD_TIMER_SMS_OS; req->ir_request[1] = 0; @@ -617,8 +620,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - - if (error == 0 && sec) { + else if (sec) { ipmi_free_request(req); req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), @@ -631,6 +633,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, } ipmi_free_request(req); + return (error); /* dump_watchdog(sc); */ @@ -641,14 +644,22 @@ ipmi_wd_event(void *arg, unsigned int cm { struct ipmi_softc *sc = arg; unsigned int timeout; + int e; cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { - timeout = ((uint64_t)1 << cmd) / 1800000000; - ipmi_set_watchdog(sc, timeout); - *error = 0; + timeout = ((uint64_t)1 << cmd) / 1000000000; + if (timeout == 0) + timeout = 1; + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) + *error = 0; + else + (void)ipmi_set_watchdog(sc, 0); } else { - ipmi_set_watchdog(sc, 0); + e = ipmi_set_watchdog(sc, 0); + if (e != 0 && cmd == 0) + *error = EOPNOTSUPP; } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 14:27:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969701065692; Fri, 18 Dec 2009 14:27:18 +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 854E58FC20; Fri, 18 Dec 2009 14:27: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 nBIERIOK094487; Fri, 18 Dec 2009 14:27:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIERI7j094485; Fri, 18 Dec 2009 14:27:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912181427.nBIERI7j094485@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Dec 2009 14:27: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: r200667 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 14:27:18 -0000 Author: kib Date: Fri Dec 18 14:27:18 2009 New Revision: 200667 URL: http://svn.freebsd.org/changeset/base/200667 Log: Signal 0 is used to check the permission for current process to signal target one. Since r184058, linux_do_tkill() calls tdsignal() instead of kill(), without checking for validity of supplied signal number. Prevent panic when supplied signal is 0 by finishing work after checks. Found and tested by: scf MFC after: 3 days Modified: head/sys/compat/linux/linux_signal.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Fri Dec 18 12:10:42 2009 (r200666) +++ head/sys/compat/linux/linux_signal.c Fri Dec 18 14:27:18 2009 (r200667) @@ -565,7 +565,7 @@ linux_do_tkill(struct thread *td, l_int AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, signum); - if (error) + if (error != 0 || signum == 0) goto out; error = ESRCH; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 14:41:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F941065672; Fri, 18 Dec 2009 14:41:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42EA68FC13; Fri, 18 Dec 2009 14:41: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 nBIEfVDX094871; Fri, 18 Dec 2009 14:41:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIEfVZc094869; Fri, 18 Dec 2009 14:41:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912181441.nBIEfVZc094869@svn.freebsd.org> From: Alexander Motin Date: Fri, 18 Dec 2009 14:41: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: r200668 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 14:41:31 -0000 Author: mav Date: Fri Dec 18 14:41:30 2009 New Revision: 200668 URL: http://svn.freebsd.org/changeset/base/200668 Log: Remove duplicate devstat_start_transaction_bio() call. It is already called from geom_disk. Dulicate call causes wrong queue depth and busy accounting. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri Dec 18 14:27:18 2009 (r200667) +++ head/sys/cam/scsi/scsi_cd.c Fri Dec 18 14:41:30 2009 (r200668) @@ -1464,8 +1464,6 @@ cdstart(struct cam_periph *periph, union } else { bioq_remove(&softc->bio_queue, bp); - devstat_start_transaction_bio(softc->disk->d_devstat, bp); - scsi_read_write(&start_ccb->csio, /*retries*/cd_retry_count, /* cbfcnp */ cddone, From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 15:01:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 031AC106566B; Fri, 18 Dec 2009 15:01:47 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E62EE8FC17; Fri, 18 Dec 2009 15:01: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 nBIF1kYd095488; Fri, 18 Dec 2009 15:01:46 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIF1kLC095486; Fri, 18 Dec 2009 15:01:46 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200912181501.nBIF1kLC095486@svn.freebsd.org> From: Joseph Koshy Date: Fri, 18 Dec 2009 15:01: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: r200669 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 15:01:47 -0000 Author: jkoshy Date: Fri Dec 18 15:01:46 2009 New Revision: 200669 URL: http://svn.freebsd.org/changeset/base/200669 Log: Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F. Submitted by: Marc Unangst Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 18 14:41:30 2009 (r200668) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 18 15:01:46 2009 (r200669) @@ -131,6 +131,8 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x1A: + case 0x1E: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ + case 0x1F: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ cputype = PMC_CPU_INTEL_COREI7; nclasses = 3; break; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 16:13:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3223106568F; Fri, 18 Dec 2009 16:13:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918F38FC1F; Fri, 18 Dec 2009 16:13: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 nBIGDLJB097496; Fri, 18 Dec 2009 16:13:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGDLL0097491; Fri, 18 Dec 2009 16:13:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181613.nBIGDLL0097491@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 16:13: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: r200670 - in head/sys: amd64/conf conf i386/conf pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:13:21 -0000 Author: jhb Date: Fri Dec 18 16:13:21 2009 New Revision: 200670 URL: http://svn.freebsd.org/changeset/base/200670 Log: - Create a separate section in in the MI NOTES file for PCI wireless NIC drivers and move bwi(4) there from the PCI Ethernet NIC section. - Move ath(4) and ral(4) to the MI NOTES file. Reviewed by: rpaulo Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/amd64/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -277,7 +277,6 @@ options DRM_DEBUG # Include debug print # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking -# ral: Ralink Technology IEEE 802.11 wireless adapter # wpi: Intel 3945ABG Wireless LAN controller device ed @@ -289,16 +288,8 @@ device iwn device ipw device nfe device nve -device ral device wpi -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -device ath_rate_sample # SampleRate tx rate control for ath -#device ath_rate_amrr # AMRR rate control for ath driver -#device ath_rate_onoe # Onoe rate control for ath driver - # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -1862,6 +1862,7 @@ device xmphy # XaQti XMAC II # L1 PCI express gigabit ethernet controllers. # alc: Support for Atheros AR8131/AR8132 PCIe ethernet controllers. # ale: Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers. +# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # bce: Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet # adapters. # bfe: Broadcom BCM4401 Ethernet adapter. @@ -1920,6 +1921,7 @@ device xmphy # XaQti XMAC II # pcn(4) driver is left out of the kernel. The le(4) driver does not # support the additional features like the MII bus and burst mode of # the PCnet-FAST and greater chipsets though. +# ral: Ralink Technology IEEE 802.11 wireless adapter # re: RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter # rl: Support for PCI fast ethernet adapters based on the RealTek 8129/8139 # chipset. Note that the RealTek driver defaults to using programmed @@ -2039,7 +2041,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. -device bwi # Broadcom BCM430* BCM431* device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet @@ -2058,6 +2059,26 @@ device fpa # PCI WAN adapters. device lmc +# PCI IEEE 802.11 Wireless NICs +device ath # Atheros pci/cardbus NIC's +device ath_hal # pci/cardbus chip support +#device ath_ar5210 # AR5210 chips +#device ath_ar5211 # AR5211 chips +#device ath_ar5212 # AR5212 chips +#device ath_rf2413 +#device ath_rf2417 +#device ath_rf2425 +#device ath_rf5111 +#device ath_rf5112 +#device ath_rf5413 +#device ath_ar5416 # AR5416 chips +options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +#device ath_ar9160 # AR9160 chips +#device ath_ar9280 # AR9280 chips +device ath_rate_sample # SampleRate tx rate control for ath +device bwi # Broadcom BCM430* BCM431* +device ral # Ralink Technology RT2500 wireless NICs. + # Use "private" jumbo buffers allocated exclusively for the ti(4) driver. # This option is incompatible with the TI_JUMBO_HDRSPLIT option below. #options TI_PRIVATE_JUMBOS Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/i386/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -533,7 +533,6 @@ hint.mse.0.irq="5" # Network interfaces: # -# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # ce: Cronyx Tau-PCI/32 sync single/dual port G.703/E1 serial adaptor # with 32 HDLC subchannels (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) @@ -555,29 +554,12 @@ hint.mse.0.irq="5" # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking -# ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters # wl: Lucent Wavelan (ISA card only). # wpi: Intel 3945ABG Wireless LAN controller # Order for ISA/EISA devices is important here -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -#device ath_ar5210 # AR5210 chips -#device ath_ar5211 # AR5211 chips -#device ath_ar5212 # AR5212 chips -#device ath_rf2413 -#device ath_rf2417 -#device ath_rf2425 -#device ath_rf5111 -#device ath_rf5112 -#device ath_rf5413 -#device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9280 chips -device ath_rate_sample # SampleRate tx rate control for ath device ce device cp device cs @@ -612,7 +594,6 @@ hint.le.0.irq="10" hint.le.0.drq="0" device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking -device ral device sbni hint.sbni.0.at="isa" hint.sbni.0.port="0x210" Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/pc98/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -382,10 +382,8 @@ hint.mse.0.irq="13" # ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; # Intel EtherExpress # le: AMD Am7900 LANCE and Am79C9xx ILACC/PCnet Ethernet interface driver -# ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters # snc: National Semiconductor DP8393X SONIC Ethernet adapter driver -# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # Order for ISA/EISA devices is important here @@ -407,7 +405,6 @@ hint.ie.2.maddr="0xd0000" hint.le.0.at="isa" hint.le.0.port="0x03d0" hint.le.0.irq="6" -device ral device sbni hint.sbni.0.at="isa" hint.sbni.0.port="0x210" @@ -419,23 +416,6 @@ hint.snc.0.port="0x888" hint.snc.0.irq="6" hint.snc.0.maddr="0xc0000" -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -#device ath_ar5210 # AR5210 chips -#device ath_ar5211 # AR5211 chips -#device ath_ar5212 # AR5212 chips -#device ath_rf2413 -#device ath_rf2417 -#device ath_rf2425 -#device ath_rf5111 -#device ath_rf5112 -#device ath_rf5413 -#device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9280 chips -device ath_rate_sample # SampleRate tx rate control for ath - # # SCSI host adapters: # From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 16:14:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A39106566C; Fri, 18 Dec 2009 16:14:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A40528FC19; Fri, 18 Dec 2009 16:14: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 nBIGEVTX097559; Fri, 18 Dec 2009 16:14:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGEVkL097557; Fri, 18 Dec 2009 16:14:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181614.nBIGEVkL097557@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 16:14: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: r200671 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:14:31 -0000 Author: jhb Date: Fri Dec 18 16:14:31 2009 New Revision: 200671 URL: http://svn.freebsd.org/changeset/base/200671 Log: - Add missing newlines to some error messages. - Add interrupt descriptions when using mulitple MSI-X interrupts. Reviewed by: jfv Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Dec 18 16:13:21 2009 (r200670) +++ head/sys/dev/e1000/if_igb.c Fri Dec 18 16:14:31 2009 (r200671) @@ -2121,9 +2121,10 @@ igb_allocate_msix(struct adapter *adapte igb_msix_tx, txr, &txr->tag); if (error) { txr->res = NULL; - device_printf(dev, "Failed to register TX handler"); + device_printf(dev, "Failed to register TX handler\n"); return (error); } + bus_describe_intr(dev, txr->res, txr->tag, "tx %d", i); txr->msix = vector; if (adapter->hw.mac.type == e1000_82575) txr->eims = E1000_EICR_TX_QUEUE0 << i; @@ -2159,9 +2160,10 @@ igb_allocate_msix(struct adapter *adapte igb_msix_rx, rxr, &rxr->tag); if (error) { rxr->res = NULL; - device_printf(dev, "Failed to register RX handler"); + device_printf(dev, "Failed to register RX handler\n"); return (error); } + bus_describe_intr(dev, rxr->res, rxr->tag, "rx %d", i); rxr->msix = vector; if (adapter->hw.mac.type == e1000_82575) rxr->eims = E1000_EICR_RX_QUEUE0 << i; @@ -2200,9 +2202,10 @@ igb_allocate_msix(struct adapter *adapte if ((error = bus_setup_intr(dev, adapter->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, igb_msix_link, adapter, &adapter->tag)) != 0) { - device_printf(dev, "Failed to register Link handler"); + device_printf(dev, "Failed to register Link handler\n"); return (error); } + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); adapter->linkvec = vector; return (0); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 16:35:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E9A1065679; Fri, 18 Dec 2009 16:35:28 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55E238FC2F; Fri, 18 Dec 2009 16:35: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 nBIGZSUE098149; Fri, 18 Dec 2009 16:35:28 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGZSOm098147; Fri, 18 Dec 2009 16:35:28 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912181635.nBIGZSOm098147@svn.freebsd.org> From: Hajimu UMEMOTO Date: Fri, 18 Dec 2009 16:35: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: r200672 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:35:28 -0000 Author: ume Date: Fri Dec 18 16:35:28 2009 New Revision: 200672 URL: http://svn.freebsd.org/changeset/base/200672 Log: Mention the unification of rc.firewall and rc.firewall6. Suggested by: David Horn Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 18 16:14:31 2009 (r200671) +++ head/UPDATING Fri Dec 18 16:35:28 2009 (r200672) @@ -22,6 +22,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091202: + The rc.firewall and rc.firewall6 were unified, and + rc.firewall6 and rc.d/ip6fw were removed. + According to the removal of rc.d/ip6fw, ipv6_firewall_* rc + variables are obsoleted. Instead, the following new rc + variables are added to rc.d/ipfw: + + firewall_client_net_ipv6, firewall_simple_iif_ipv6, + firewall_simple_inet_ipv6, firewall_simple_oif_ipv6, + firewall_simple_onet_ipv6, firewall_trusted_ipv6 + + The meanings correspond to the relevant IPv4 variables. + 20091113: The default terminal emulation for syscons(4) has been changed from cons25 to xterm on all platforms except pc98. This means From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 16:36:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B822E1065693; Fri, 18 Dec 2009 16:36:28 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 59B0D8FC13; Fri, 18 Dec 2009 16:36:28 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EAB031CDE9; Fri, 18 Dec 2009 17:36:26 +0100 (CET) Date: Fri, 18 Dec 2009 17:36:26 +0100 From: Ed Schouten To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091218163626.GF64905@hoeg.nl> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Up32gbJlVxH+cNZn" Content-Disposition: inline In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , John Baldwin Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:36:28 -0000 --Up32gbJlVxH+cNZn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello DES, First of all: happy birthday! * Dag-Erling Sm=F8rgrav wrote: > perhaps we should simply add the appropriate > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) > without FREEBSD_COMPAT(n+1). Why not make COMPAT_FREEBSD numerical? | options COMPAT_FREEBSD=3D4 and let the code use: | #if COMPAT_FREEBSD <=3D 4 | ... | #endif --=20 Ed Schouten WWW: http://80386.nl/ --Up32gbJlVxH+cNZn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksrr4oACgkQ52SDGA2eCwWZXACfXEpYqe3SS/g6ME1PqJmDex6d VqoAnA9CyDHQa1vXQW0KmvRd1aqVwxF8 =ZRJw -----END PGP SIGNATURE----- --Up32gbJlVxH+cNZn-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 17:22:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8A21065670; Fri, 18 Dec 2009 17:22:21 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE2B18FC0A; Fri, 18 Dec 2009 17:22: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 nBIHMLJ9099393; Fri, 18 Dec 2009 17:22:21 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIHMLxK099391; Fri, 18 Dec 2009 17:22:21 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912181722.nBIHMLxK099391@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 18 Dec 2009 17:22: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: r200673 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 17:22:22 -0000 Author: ru Date: Fri Dec 18 17:22:21 2009 New Revision: 200673 URL: http://svn.freebsd.org/changeset/base/200673 Log: Added proper attribution. Requested by: luigi Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Fri Dec 18 16:35:28 2009 (r200672) +++ head/sys/netinet/ipfw/ip_fw_table.c Fri Dec 18 17:22:21 2009 (r200673) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 ......... + * Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 17:46:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6F11065670; Fri, 18 Dec 2009 17:46:57 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0AC8FC0C; Fri, 18 Dec 2009 17: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 nBIHkvde000817; Fri, 18 Dec 2009 17:46:57 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIHkvod000814; Fri, 18 Dec 2009 17:46:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <200912181746.nBIHkvod000814@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 18 Dec 2009 17: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: r200674 - in head: share/man/man4 sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 17:46:57 -0000 Author: dumbbell Date: Fri Dec 18 17:46:57 2009 New Revision: 200674 URL: http://svn.freebsd.org/changeset/base/200674 Log: Add new "hw.psm.tap_enabled" tunable and sysctl. This tunable allows one to enable (1) or disable (0) gestures like tap and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled (ie. "hw.psm.synaptics_support" not set). By default, the value is -1 in order to keep the current behaviour of not enabling/disabling gestures explicitly. PR: kern/139272 Submitted by: David Horn Reviewed by: David Horn Modified: head/share/man/man4/psm.4 head/sys/dev/atkbdc/psm.c Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Fri Dec 18 17:22:21 2009 (r200673) +++ head/share/man/man4/psm.4 Fri Dec 18 17:46:57 2009 (r200674) @@ -359,6 +359,18 @@ at boot-time. This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. +.Pp +Tap and drag gestures can be disabled by setting +.Va hw.psm.tap_enabled +to +.Em 0 +at boot-time. +Currently, this is only supported on Synaptics touchpads with Extended +support disabled. The behaviour may be changed after boot by setting +the sysctl with the same name and by restarting +.Xr moused 8 +using +.Pa /etc/rc.d/moused . .Sh IOCTLS There are a few .Xr ioctl 2 Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Fri Dec 18 17:22:21 2009 (r200673) +++ head/sys/dev/atkbdc/psm.c Fri Dec 18 17:46:57 2009 (r200674) @@ -343,6 +343,9 @@ static devclass_t psm_devclass; #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ /* Tunables */ +static int tap_enabled = -1; +TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled); + static int synaptics_support = 0; TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); @@ -901,6 +904,36 @@ doopen(struct psm_softc *sc, int command } } + /* + * A user may want to disable tap and drag gestures on a Synaptics + * TouchPad when it operates in Relative Mode. + */ + if (sc->hw.model == MOUSE_MODEL_GENERIC) { + if (tap_enabled > 0) { + /* + * Enable tap & drag gestures. We use a Mode Byte + * and clear the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: enable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x00); + set_mouse_sampling_rate(sc->kbdc, 20); + } else if (tap_enabled == 0) { + /* + * Disable tap & drag gestures. We use a Mode Byte + * and set the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: disable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x04); + set_mouse_sampling_rate(sc->kbdc, 20); + } + } + /* enable the mouse device */ if (!enable_aux_dev(sc->kbdc)) { /* MOUSE ERROR: failed to enable the mouse because: @@ -2261,6 +2294,8 @@ static int pkterrthresh = 2; SYSCTL_INT(_debug_psm, OID_AUTO, pkterrthresh, CTLFLAG_RW, &pkterrthresh, 0, "Number of error packets allowed before reinitializing the mouse"); +SYSCTL_INT(_hw_psm, OID_AUTO, tap_enabled, CTLFLAG_RW, &tap_enabled, 0, + "Enable tap and drag gestures"); static int tap_threshold = PSM_TAP_THRESHOLD; SYSCTL_INT(_hw_psm, OID_AUTO, tap_threshold, CTLFLAG_RW, &tap_threshold, 0, "Button tap threshold"); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 18:30:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98AA106566B; Fri, 18 Dec 2009 18:30:49 +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 C88FB8FC14; Fri, 18 Dec 2009 18:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIIUnp9003581; Fri, 18 Dec 2009 18:30:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIIUn3K003579; Fri, 18 Dec 2009 18:30:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181830.nBIIUn3K003579@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 18:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200675 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:30:50 -0000 Author: jhb Date: Fri Dec 18 18:30:49 2009 New Revision: 200675 URL: http://svn.freebsd.org/changeset/base/200675 Log: MFC 200037: ndis_scan_results() can sleep if the scan results are not ready when ndis_scan() is called. However, ndis_scan() is invoked from softclock() and cannot sleep. Move ndis_scan_results() to the ndis driver's scan_end hook instead. Modified: stable/8/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Fri Dec 18 17:46:57 2009 (r200674) +++ stable/8/sys/dev/if_ndis/if_ndis.c Fri Dec 18 18:30:49 2009 (r200675) @@ -3278,14 +3278,8 @@ ndis_newstate(struct ieee80211vap *vap, static void ndis_scan(void *arg) { - struct ndis_softc *sc = arg; - struct ieee80211com *ic; - struct ieee80211vap *vap; - - ic = sc->ifp->if_l2com; - vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211vap *vap = arg; - ndis_scan_results(sc); ieee80211_scan_done(vap); } @@ -3434,7 +3428,7 @@ ndis_scan_start(struct ieee80211com *ic) return; } /* Set a timer to collect the results */ - callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, sc); + callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, vap); } static void @@ -3458,6 +3452,8 @@ ndis_scan_mindwell(struct ieee80211_scan static void ndis_scan_end(struct ieee80211com *ic) { - /* ignore */ + struct ndis_softc *sc = ic->ic_ifp->if_softc; + + ndis_scan_results(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 18:45:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8FFF106568F; Fri, 18 Dec 2009 18:45:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1428FC0C; Fri, 18 Dec 2009 18:45: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 nBIIja6Z004534; Fri, 18 Dec 2009 18:45:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIIjaRx004532; Fri, 18 Dec 2009 18:45:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912181845.nBIIjaRx004532@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 18:45: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: r200676 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:45:36 -0000 Author: yongari Date: Fri Dec 18 18:45:36 2009 New Revision: 200676 URL: http://svn.freebsd.org/changeset/base/200676 Log: Document more VIA Velocity family controllers to vge(4). Previously it mentioned only VT6122. While I'm here remove the mention of VT3119 which seems to be VIA's internal model name and VT3119 wouldn't be available to end users. Reviewed by: brueffer Modified: head/share/man/man4/vge.4 Modified: head/share/man/man4/vge.4 ============================================================================== --- head/share/man/man4/vge.4 Fri Dec 18 18:30:49 2009 (r200675) +++ head/share/man/man4/vge.4 Fri Dec 18 18:45:36 2009 (r200676) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2009 +.Dd December 18, 2009 .Dt VGE 4 .Os .Sh NAME .Nm vge -.Nd "VIA Networking Technologies VT6122 PCI Gigabit Ethernet adapter driver" +.Nd "VIA Networking Technologies Velocity Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -55,22 +55,23 @@ if_vge_load="YES" The .Nm driver provides support for various NICs and embedded Ethernet interfaces -based on the VIA Networking Technologies VT6122 Gigabit Ethernet -controller chips. +based on the VIA Technologies VT6120, VT6122, VT6130 and VT6132 Velocity +Family Gigabit Ethernet controller chips. .Pp -The VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed MAC with -an integrated 10/100/1000 copper PHY. +The VT6120/VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed +MAC with an integrated 10/100/1000 copper PHY. (Some older cards use an external PHY.) +The VT6130/VT6132 is the PCI express version of Velocity family. The MAC supports TCP/IP hardware checksums (IPv4 only), TCP large send, VLAN tag insertion and stripping, as well as VLAN filtering, a 64-entry CAM filter and a 64-entry VLAN filter, 64-bit multicast hash filter, 4 separate transmit DMA queues, flow control and jumbo frames up to 16K in size. -The VT6122 has a 16K receive FIFO and 48K transmit FIFO. +The Velocity family controllers have a 16K receive FIFO and 48K transmit FIFO. .Pp The .Nm -driver takes advantage of the VT6122's checksum offload and VLAN +driver takes advantage of the controller's checksum offload and VLAN tagging features, as well as the jumbo frame and CAM filter support. The CAM filter is used for multicast address filtering to provide 64 perfect multicast address filter support. @@ -162,7 +163,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports VIA Networking VT3119 and VT6122 based +driver supports VIA Networking VT6120, VT6122, VT6130 and VT6132 based Gigabit Ethernet adapters including: .Pp .Bl -bullet -compact From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 18:55:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A96106566B; Fri, 18 Dec 2009 18:55:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDB08FC12; Fri, 18 Dec 2009 18:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIItFu7005165; Fri, 18 Dec 2009 18:55:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIItFMe005161; Fri, 18 Dec 2009 18:55:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912181855.nBIItFMe005161@svn.freebsd.org> From: Xin LI Date: Fri, 18 Dec 2009 18:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:55:15 -0000 Author: delphij Date: Fri Dec 18 18:55:15 2009 New Revision: 200677 URL: http://svn.freebsd.org/changeset/base/200677 Log: MFC r199463: rc.early(8) was removed as of 20090530 so remove manual page reference to it. Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man8/Makefile stable/8/share/man/man8/rc.8 Directory Properties: stable/8/share/man/man8/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/ObsoleteFiles.inc Fri Dec 18 18:55:15 2009 (r200677) @@ -14,6 +14,16 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091218: removal of rc.early(8) link +OLD_FILES+=usr/share/man/man8/rc.early.8.gz +# 20091027: pselect.3 implemented as syscall +OLD_FILES+=usr/share/man/man3/pselect.3.gz +# 20091005: fusword.9 and susword.9 removed +OLD_FILES+=usr/share/man/man9/fusword.9.gz +OLD_FILES+=usr/share/man/man9/susword.9.gz +# 20090909: vesa and dpms promoted to be i386/amd64 common +OLD_FILES+=usr/include/machine/pc/vesa.h +OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz Modified: stable/8/share/man/man8/Makefile ============================================================================== --- stable/8/share/man/man8/Makefile Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/share/man/man8/Makefile Fri Dec 18 18:55:15 2009 (r200677) @@ -16,7 +16,6 @@ MAN= crash.8 \ MLINKS= rc.8 rc.atm.8 \ rc.8 rc.d.8 \ - rc.8 rc.early.8 \ rc.8 rc.firewall.8 \ rc.8 rc.local.8 \ rc.8 rc.network.8 \ Modified: stable/8/share/man/man8/rc.8 ============================================================================== --- stable/8/share/man/man8/rc.8 Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/share/man/man8/rc.8 Fri Dec 18 18:55:15 2009 (r200677) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd May 18, 2007 +.Dd November 17, 2009 .Dt RC 8 .Os .Sh NAME @@ -394,20 +394,6 @@ is not set, when going from single-user the script does not do anything. .Pp The -.Nm rc.early -script is run very early in the startup process, immediately before the -file system check. -The -.Nm rc.early -script is deprecated. -Any commands in this -file should be separated out into -.Nm rc.d/ -style scripts and integrated into the -.Nm -system. -.Pp -The .Pa /etc/rc.d/local script can execute scripts from multiple .Nm rc.d/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:16:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2C5E1065679; Fri, 18 Dec 2009 19:16:45 +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 A19308FC13; Fri, 18 Dec 2009 19:16: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 nBIJGjQS005684; Fri, 18 Dec 2009 19:16:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJGjim005683; Fri, 18 Dec 2009 19:16:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912181916.nBIJGjim005683@svn.freebsd.org> From: Xin LI Date: Fri, 18 Dec 2009 19:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200678 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:16:45 -0000 Author: delphij Date: Fri Dec 18 19:16:44 2009 New Revision: 200678 URL: http://svn.freebsd.org/changeset/base/200678 Log: MFC r199464: Add a missing .Ed tag. Modified: stable/8/share/man/man4/wi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/wi.4 ============================================================================== --- stable/8/share/man/man4/wi.4 Fri Dec 18 18:55:15 2009 (r200677) +++ stable/8/share/man/man4/wi.4 Fri Dec 18 19:16:44 2009 (r200678) @@ -253,6 +253,7 @@ Join a specific BSS network with network .Bd -literal -offset indent ifconfig wlan create wlandev wi0 inet 192.168.0.20 \e netmask 0xffffff00 ssid my_net +.Ed .Pp Join a specific BSS network with WEP encryption: .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:26:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39B9106566B; Fri, 18 Dec 2009 19:26:16 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23D18FC0C; Fri, 18 Dec 2009 19:26: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 nBIJQGjK005960; Fri, 18 Dec 2009 19:26:16 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJQGPA005958; Fri, 18 Dec 2009 19:26:16 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912181926.nBIJQGPA005958@svn.freebsd.org> From: Benedict Reuschling Date: Fri, 18 Dec 2009 19:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200679 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:26:17 -0000 Author: bcr (doc committer) Date: Fri Dec 18 19:26:16 2009 New Revision: 200679 URL: http://svn.freebsd.org/changeset/base/200679 Log: MFC r200415: Reference the correct man page for firmware(9). PR: docs/140985 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) Reviewed by: rpaulo Approved by: rpaulo, jkois (mentor) Merged with: user/des/fmerge Modified: stable/8/share/man/man4/iwnfw.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/iwnfw.4 ============================================================================== --- stable/8/share/man/man4/iwnfw.4 Fri Dec 18 19:16:44 2009 (r200678) +++ stable/8/share/man/man4/iwnfw.4 Fri Dec 18 19:26:16 2009 (r200679) @@ -49,4 +49,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr iwn 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:34:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AE30106568B; Fri, 18 Dec 2009 19:34:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF868FC12; Fri, 18 Dec 2009 19:34:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBIJSTxT095237; Fri, 18 Dec 2009 12:28:30 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 18 Dec 2009 12:28:57 -0700 (MST) Message-Id: <20091218.122857.59640143227132198.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:34:27 -0000 In message: <868wd0cyjd.fsf@ds4.des.no> Dag-Erling Sm=F8rgrav writes: : John Baldwin writes: : > Warner Losh writes: : > > Log: : > > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. : > > = : > > Note: Not sure this is the right way to do compat, but it makes= the : > > headers consistent with the implementations. : > Please revert. I think this has already been reverted once before.= : = : Yep, that was me... we concluded back then that this is a perfectly : reasonable dependency; perhaps we should simply add the appropriate : #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) : without FREEBSD_COMPAT(n+1). I'll take care of that... Warner From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:43:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD75F106566B; Fri, 18 Dec 2009 19:43:44 +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 AC0218FC0A; Fri, 18 Dec 2009 19:43:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIJhiHD006341; Fri, 18 Dec 2009 19:43:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJhiVb006339; Fri, 18 Dec 2009 19:43:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181943.nBIJhiVb006339@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 19:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200680 - stable/8/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:43:44 -0000 Author: jhb Date: Fri Dec 18 19:43:44 2009 New Revision: 200680 URL: http://svn.freebsd.org/changeset/base/200680 Log: MFC 200084: Properly return an error reply if an NFS remove or link operation fails. Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. Modified: stable/8/sys/nfsserver/nfs_serv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Fri Dec 18 19:26:16 2009 (r200679) +++ stable/8/sys/nfsserver/nfs_serv.c Fri Dec 18 19:43:44 2009 (r200680) @@ -1810,10 +1810,9 @@ out: } ereply: nfsm_reply(NFSX_WCCDATA(v3)); - if (v3) { + if (v3) nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; - } + error = 0; nfsmout: NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp) { @@ -2187,8 +2186,8 @@ ereply: if (v3) { nfsm_srvpostop_attr(getret, &at); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; } + error = 0; /* fall through */ nfsmout: From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:50:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B862C106566B; Fri, 18 Dec 2009 19:50:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6EC78FC08; Fri, 18 Dec 2009 19: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 nBIJoLcj006502; Fri, 18 Dec 2009 19:50:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJoLoJ006500; Fri, 18 Dec 2009 19:50:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181950.nBIJoLoJ006500@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 19:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200681 - stable/7/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:50:21 -0000 Author: jhb Date: Fri Dec 18 19:50:21 2009 New Revision: 200681 URL: http://svn.freebsd.org/changeset/base/200681 Log: MFC 200084: Properly return an error reply if an NFS remove or link operation fails. Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. Modified: stable/7/sys/nfsserver/nfs_serv.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Fri Dec 18 19:43:44 2009 (r200680) +++ stable/7/sys/nfsserver/nfs_serv.c Fri Dec 18 19:50:21 2009 (r200681) @@ -2219,10 +2219,9 @@ out: } ereply: nfsm_reply(NFSX_WCCDATA(v3)); - if (v3) { + if (v3) nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; - } + error = 0; nfsmout: NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp) { @@ -2596,8 +2595,8 @@ ereply: if (v3) { nfsm_srvpostop_attr(getret, &at); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; } + error = 0; /* fall through */ nfsmout: From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 19:50:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE4A1065749; Fri, 18 Dec 2009 19:50:47 +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 4E9498FC19; Fri, 18 Dec 2009 19:50: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 nBIJolk3006547; Fri, 18 Dec 2009 19:50:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJolIT006545; Fri, 18 Dec 2009 19:50:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181950.nBIJolIT006545@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 19:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200682 - stable/6/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:50:47 -0000 Author: jhb Date: Fri Dec 18 19:50:47 2009 New Revision: 200682 URL: http://svn.freebsd.org/changeset/base/200682 Log: MFC 200084: Properly return an error reply if an NFS remove or link operation fails. Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. Modified: stable/6/sys/nfsserver/nfs_serv.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/6/sys/nfsserver/nfs_serv.c Fri Dec 18 19:50:21 2009 (r200681) +++ stable/6/sys/nfsserver/nfs_serv.c Fri Dec 18 19:50:47 2009 (r200682) @@ -2339,10 +2339,9 @@ out: ereply: NFSD_LOCK_ASSERT(); nfsm_reply(NFSX_WCCDATA(v3)); - if (v3) { + if (v3) nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; - } + error = 0; nfsmout: NFSD_LOCK_ASSERT(); NFSD_UNLOCK(); @@ -2751,8 +2750,8 @@ ereply: if (v3) { nfsm_srvpostop_attr(getret, &at); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; } + error = 0; /* fall through */ nfsmout: From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:05:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA2A1065679; Fri, 18 Dec 2009 20:05:10 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD9B38FC18; Fri, 18 Dec 2009 20: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 nBIK5A3B006902; Fri, 18 Dec 2009 20:05:10 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIK5AHd006900; Fri, 18 Dec 2009 20:05:10 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912182005.nBIK5AHd006900@svn.freebsd.org> From: Sean Farley Date: Fri, 18 Dec 2009 20:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200683 - stable/8/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:05:11 -0000 Author: scf Date: Fri Dec 18 20:05:10 2009 New Revision: 200683 URL: http://svn.freebsd.org/changeset/base/200683 Log: Merge from head to stable/8: r200423: Remove a dead store. Modified: stable/8/lib/libutil/gr_util.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/gr_util.c ============================================================================== --- stable/8/lib/libutil/gr_util.c Fri Dec 18 19:50:47 2009 (r200682) +++ stable/8/lib/libutil/gr_util.c Fri Dec 18 20:05:10 2009 (r200683) @@ -117,8 +117,8 @@ gr_make(const struct group *gr) /* Create the group line and fill it. */ if ((line = malloc(line_size)) == NULL) return (NULL); - line_size = snprintf(line, line_size, group_line_format, gr->gr_name, - gr->gr_passwd, (uintmax_t)gr->gr_gid); + snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + (uintmax_t)gr->gr_gid); if (gr->gr_mem != NULL) for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { strcat(line, gr->gr_mem[ndx]); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:08:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24695106566C; Fri, 18 Dec 2009 20:08:30 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1315E8FC17; Fri, 18 Dec 2009 20:08:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIK8TSg007014; Fri, 18 Dec 2009 20:08:29 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIK8TjU007012; Fri, 18 Dec 2009 20:08:29 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912182008.nBIK8TjU007012@svn.freebsd.org> From: Sean Farley Date: Fri, 18 Dec 2009 20:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200684 - stable/7/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:08:30 -0000 Author: scf Date: Fri Dec 18 20:08:29 2009 New Revision: 200684 URL: http://svn.freebsd.org/changeset/base/200684 Log: Merge from head to stable/7: r200423: Remove a dead store. Modified: stable/7/lib/libutil/gr_util.c Directory Properties: stable/7/lib/libutil/ (props changed) Modified: stable/7/lib/libutil/gr_util.c ============================================================================== --- stable/7/lib/libutil/gr_util.c Fri Dec 18 20:05:10 2009 (r200683) +++ stable/7/lib/libutil/gr_util.c Fri Dec 18 20:08:29 2009 (r200684) @@ -117,8 +117,8 @@ gr_make(const struct group *gr) /* Create the group line and fill it. */ if ((line = malloc(line_size)) == NULL) return (NULL); - line_size = snprintf(line, line_size, group_line_format, gr->gr_name, - gr->gr_passwd, (uintmax_t)gr->gr_gid); + snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + (uintmax_t)gr->gr_gid); if (gr->gr_mem != NULL) for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { strcat(line, gr->gr_mem[ndx]); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:11:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0015106566C; Fri, 18 Dec 2009 20:11:29 +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 DF6B98FC08; Fri, 18 Dec 2009 20:11: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 nBIKBTSY007155; Fri, 18 Dec 2009 20:11:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKBTsA007153; Fri, 18 Dec 2009 20:11:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912182011.nBIKBTsA007153@svn.freebsd.org> From: Ed Schouten Date: Fri, 18 Dec 2009 20:11: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: r200685 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:11:30 -0000 Author: ed Date: Fri Dec 18 20:11:29 2009 New Revision: 200685 URL: http://svn.freebsd.org/changeset/base/200685 Log: Make the wchan names of pts(4) fit in top(1). Just like a similar change we made to the TTY code about half a year ago, make these strings look similar. Suggested by: Jille Timmermans Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Fri Dec 18 20:08:29 2009 (r200684) +++ head/sys/kern/tty_pts.c Fri Dec 18 20:11:29 2009 (r200685) @@ -733,8 +733,8 @@ pts_alloc(int fflags, struct thread *td, /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); - cv_init(&psc->pts_inwait, "pts inwait"); - cv_init(&psc->pts_outwait, "pts outwait"); + cv_init(&psc->pts_inwait, "ptsin"); + cv_init(&psc->pts_outwait, "ptsout"); psc->pts_unit = unit; psc->pts_uidinfo = uid; @@ -772,8 +772,8 @@ pts_alloc_external(int fflags, struct th /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); - cv_init(&psc->pts_inwait, "pts inwait"); - cv_init(&psc->pts_outwait, "pts outwait"); + cv_init(&psc->pts_inwait, "ptsin"); + cv_init(&psc->pts_outwait, "ptsout"); psc->pts_unit = -1; psc->pts_cdev = dev; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:28:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD151106566C; Fri, 18 Dec 2009 20:28:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD228FC16; Fri, 18 Dec 2009 20:28:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIKS4Om007682; Fri, 18 Dec 2009 20:28:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKS4UZ007678; Fri, 18 Dec 2009 20:28:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182028.nBIKS4UZ007678@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 20:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200686 - in stable/8/sys/boot/i386: libi386 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:28:04 -0000 Author: jhb Date: Fri Dec 18 20:28:04 2009 New Revision: 200686 URL: http://svn.freebsd.org/changeset/base/200686 Log: MFC 200216,200219: - Various small whitespace and style fixes. - Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. Modified: stable/8/sys/boot/i386/libi386/biosmem.c stable/8/sys/boot/i386/libi386/libi386.h stable/8/sys/boot/i386/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosmem.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:04 2009 (r200686) @@ -35,14 +35,20 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; static struct bios_smap smap; +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + void bios_getmem(void) { + uint64_t size; /* Parse system memory map */ v86.ebx = 0; @@ -65,6 +71,26 @@ bios_getmem(void) if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } } while (v86.ebx != 0); /* Fall back to the old compatibility function for base memory */ @@ -97,5 +123,13 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/8/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/8/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:04 2009 (r200686) @@ -78,9 +78,9 @@ int bc_add(int biosdev); /* Register CD int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */ int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */ -u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ -int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ -int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ +uint32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ +int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ +int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -92,12 +92,15 @@ void bios_addsmapdata(struct preloaded_f void bios_getsmap(void); void bios_getmem(void); -extern u_int32_t bios_basemem; /* base memory in bytes */ -extern u_int32_t bios_extmem; /* extended memory in bytes */ +extern uint32_t bios_basemem; /* base memory in bytes */ +extern uint32_t bios_extmem; /* extended memory in bytes */ extern vm_offset_t memtop; /* last address of physical memory + 1 */ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ - /* when heap is at the top of extended memory */ - /* for other cases - just the same as memtop */ + /* when heap is at the top of */ + /* extended memory; for other cases */ + /* just the same as memtop */ +extern uint32_t high_heap_size; /* extended memory region available */ +extern vm_offset_t high_heap_base; /* for use as the heap */ int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); Modified: stable/8/sys/boot/i386/loader/main.c ============================================================================== --- stable/8/sys/boot/i386/loader/main.c Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/loader/main.c Fri Dec 18 20:28:04 2009 (r200686) @@ -102,14 +102,19 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ + defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:28:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500571065693; Fri, 18 Dec 2009 20:28:29 +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 3DCFD8FC0A; Fri, 18 Dec 2009 20:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIKSTx2007728; Fri, 18 Dec 2009 20:28:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKSTkA007724; Fri, 18 Dec 2009 20:28:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182028.nBIKSTkA007724@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 20:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200687 - in stable/7/sys/boot/i386: libi386 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:28:29 -0000 Author: jhb Date: Fri Dec 18 20:28:28 2009 New Revision: 200687 URL: http://svn.freebsd.org/changeset/base/200687 Log: MFC 200216,200219: - Various small whitespace and style fixes. - Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. Modified: stable/7/sys/boot/i386/libi386/biosmem.c stable/7/sys/boot/i386/libi386/libi386.h stable/7/sys/boot/i386/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/libi386/biosmem.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:04 2009 (r200686) +++ stable/7/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:28 2009 (r200687) @@ -35,14 +35,20 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; static struct bios_smap smap; +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + void bios_getmem(void) { + uint64_t size; /* Parse system memory map */ v86.ebx = 0; @@ -65,6 +71,26 @@ bios_getmem(void) if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } } while (v86.ebx != 0); /* Fall back to the old compatibility function for base memory */ @@ -97,5 +123,13 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/7/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/7/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:04 2009 (r200686) +++ stable/7/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:28 2009 (r200687) @@ -78,9 +78,9 @@ int bc_add(int biosdev); /* Register CD int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */ int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */ -u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ -int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ -int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ +uint32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ +int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ +int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -92,12 +92,15 @@ void bios_addsmapdata(struct preloaded_f void bios_getsmap(void); void bios_getmem(void); -extern u_int32_t bios_basemem; /* base memory in bytes */ -extern u_int32_t bios_extmem; /* extended memory in bytes */ +extern uint32_t bios_basemem; /* base memory in bytes */ +extern uint32_t bios_extmem; /* extended memory in bytes */ extern vm_offset_t memtop; /* last address of physical memory + 1 */ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ - /* when heap is at the top of extended memory */ - /* for other cases - just the same as memtop */ + /* when heap is at the top of */ + /* extended memory; for other cases */ + /* just the same as memtop */ +extern uint32_t high_heap_size; /* extended memory region available */ +extern vm_offset_t high_heap_base; /* for use as the heap */ int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); Modified: stable/7/sys/boot/i386/loader/main.c ============================================================================== --- stable/7/sys/boot/i386/loader/main.c Fri Dec 18 20:28:04 2009 (r200686) +++ stable/7/sys/boot/i386/loader/main.c Fri Dec 18 20:28:28 2009 (r200687) @@ -102,14 +102,19 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ + defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 20:28:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26653106568D; Fri, 18 Dec 2009 20:28:49 +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 145AB8FC1A; Fri, 18 Dec 2009 20:28: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 nBIKSmsc007771; Fri, 18 Dec 2009 20:28:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKSmsu007767; Fri, 18 Dec 2009 20:28:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182028.nBIKSmsu007767@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 20:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200688 - in stable/6/sys/boot/i386: libi386 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:28:49 -0000 Author: jhb Date: Fri Dec 18 20:28:48 2009 New Revision: 200688 URL: http://svn.freebsd.org/changeset/base/200688 Log: MFC 200216,200219: - Various small whitespace and style fixes. - Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. Modified: stable/6/sys/boot/i386/libi386/biosmem.c stable/6/sys/boot/i386/libi386/libi386.h stable/6/sys/boot/i386/loader/main.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/libi386/biosmem.c ============================================================================== --- stable/6/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:28 2009 (r200687) +++ stable/6/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:48 2009 (r200688) @@ -35,14 +35,20 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; static struct bios_smap smap; +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + void bios_getmem(void) { + uint64_t size; /* Parse system memory map */ v86.ebx = 0; @@ -65,6 +71,26 @@ bios_getmem(void) if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } } while (v86.ebx != 0); /* Fall back to the old compatibility function for base memory */ @@ -97,5 +123,13 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/6/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/6/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:28 2009 (r200687) +++ stable/6/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:48 2009 (r200688) @@ -83,9 +83,9 @@ int bc_add(int biosdev); /* Register CD int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */ int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */ -u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ -int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ -int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ +uint32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ +int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ +int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -97,12 +97,15 @@ void bios_addsmapdata(struct preloaded_f void bios_getsmap(void); void bios_getmem(void); -extern u_int32_t bios_basemem; /* base memory in bytes */ -extern u_int32_t bios_extmem; /* extended memory in bytes */ +extern uint32_t bios_basemem; /* base memory in bytes */ +extern uint32_t bios_extmem; /* extended memory in bytes */ extern vm_offset_t memtop; /* last address of physical memory + 1 */ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ - /* when heap is at the top of extended memory */ - /* for other cases - just the same as memtop */ + /* when heap is at the top of */ + /* extended memory; for other cases */ + /* just the same as memtop */ +extern uint32_t high_heap_size; /* extended memory region available */ +extern vm_offset_t high_heap_base; /* for use as the heap */ int biospci_find_devclass(uint32_t class, int index); int biospci_write_config(uint32_t locator, int offset, int width, int val); Modified: stable/6/sys/boot/i386/loader/main.c ============================================================================== --- stable/6/sys/boot/i386/loader/main.c Fri Dec 18 20:28:28 2009 (r200687) +++ stable/6/sys/boot/i386/loader/main.c Fri Dec 18 20:28:48 2009 (r200688) @@ -97,13 +97,17 @@ main(void) bios_getmem(); #if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_GPT_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 21:01:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647F3106566B; Fri, 18 Dec 2009 21:01: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 51B2C8FC15; Fri, 18 Dec 2009 21:01: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 nBIL1uGE008596; Fri, 18 Dec 2009 21:01:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIL1uZM008593; Fri, 18 Dec 2009 21:01:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182101.nBIL1uZM008593@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 21:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200689 - in stable/8/sys/boot: i386/zfsboot zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:01:56 -0000 Author: jhb Date: Fri Dec 18 21:01:56 2009 New Revision: 200689 URL: http://svn.freebsd.org/changeset/base/200689 Log: MFC 200309: - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to safely allocate a heap region above 1MB. This enables {gpt,}zfsboot() to allocate much larger buffers than before. - Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers. This allows more reliable reading of compressed files in a raidz/raidz2 pool. Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 20:28:48 2009 (r200688) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:01:56 2009 (r200689) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -90,8 +91,6 @@ __FBSDID("$FreeBSD$"); #define ARGS 0x900 #define NOPT 14 #define NDEV 3 -#define MEM_BASE 0x12 -#define MEM_EXT 0x15 #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) @@ -149,6 +148,19 @@ static struct bootinfo bootinfo; static uint32_t bootdev; static uint8_t ioctrl = IO_KEYBOARD; +vm_offset_t high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +static struct bios_smap smap; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + +static char *heap_next; +static char *heap_end; + /* Buffers that must not span a 64k boundary. */ #define READ_BUF_SIZE 8192 struct dmadat { @@ -162,7 +174,7 @@ static void load(void); static int parse(void); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); +static void bios_getmem(void); static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -237,14 +249,6 @@ memset(void *p, char val, size_t n) static void * malloc(size_t n) { - static char *heap_next; - static char *heap_end; - - if (!heap_next) { - heap_next = (char *) dmadat + sizeof(*dmadat); - heap_end = (char *) (640*1024); - } - char *p = heap_next; if (p + n > heap_end) { printf("malloc failure\n"); @@ -344,14 +348,91 @@ xfsread(const dnode_phys_t *dnode, off_t return 0; } -static inline uint32_t -memsize(void) +static void +bios_getmem(void) { - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} + uint64_t size; + + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { + bios_extmem = smap.length; + } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); + + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); + + bios_basemem = (v86.eax & 0xffff) * 1024; + } + + /* Fall back through several compatibility functions for extended memory */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } +} static inline void getstr(void) @@ -536,6 +617,16 @@ main(void) off_t off; struct dsk *dsk; + bios_getmem(); + + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *) dmadat + sizeof(*dmadat); + heap_end = (char *) PTOV(bios_basemem); + } + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -550,8 +641,8 @@ main(void) bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk->drive; Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Fri Dec 18 20:28:48 2009 (r200688) +++ stable/8/sys/boot/zfs/zfsimpl.c Fri Dec 18 21:01:56 2009 (r200689) @@ -51,7 +51,7 @@ static char *dnode_cache_buf; static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; -#define TEMP_SIZE (1*SPA_MAXBLOCKSIZE) +#define TEMP_SIZE (1024 * 1024) static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 21:02:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA9931065672; Fri, 18 Dec 2009 21:02:32 +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 D83F78FC1E; Fri, 18 Dec 2009 21:02: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 nBIL2WxW008645; Fri, 18 Dec 2009 21:02:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIL2Wpr008642; Fri, 18 Dec 2009 21:02:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182102.nBIL2Wpr008642@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 21:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200690 - in stable/7/sys/boot: i386/zfsboot zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:02:33 -0000 Author: jhb Date: Fri Dec 18 21:02:32 2009 New Revision: 200690 URL: http://svn.freebsd.org/changeset/base/200690 Log: MFC 200309: - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to safely allocate a heap region above 1MB. This enables {gpt,}zfsboot() to allocate much larger buffers than before. - Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers. This allows more reliable reading of compressed files in a raidz/raidz2 pool. Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c stable/7/sys/boot/zfs/zfsimpl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:01:56 2009 (r200689) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:02:32 2009 (r200690) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -90,8 +91,6 @@ __FBSDID("$FreeBSD$"); #define ARGS 0x900 #define NOPT 14 #define NDEV 3 -#define MEM_BASE 0x12 -#define MEM_EXT 0x15 #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) @@ -149,6 +148,19 @@ static struct bootinfo bootinfo; static uint32_t bootdev; static uint8_t ioctrl = IO_KEYBOARD; +vm_offset_t high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +static struct bios_smap smap; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + +static char *heap_next; +static char *heap_end; + /* Buffers that must not span a 64k boundary. */ #define READ_BUF_SIZE 8192 struct dmadat { @@ -162,7 +174,7 @@ static void load(void); static int parse(void); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); +static void bios_getmem(void); static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -237,14 +249,6 @@ memset(void *p, char val, size_t n) static void * malloc(size_t n) { - static char *heap_next; - static char *heap_end; - - if (!heap_next) { - heap_next = (char *) dmadat + sizeof(*dmadat); - heap_end = (char *) (640*1024); - } - char *p = heap_next; if (p + n > heap_end) { printf("malloc failure\n"); @@ -344,14 +348,91 @@ xfsread(const dnode_phys_t *dnode, off_t return 0; } -static inline uint32_t -memsize(void) +static void +bios_getmem(void) { - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} + uint64_t size; + + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { + bios_extmem = smap.length; + } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); + + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); + + bios_basemem = (v86.eax & 0xffff) * 1024; + } + + /* Fall back through several compatibility functions for extended memory */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } +} static inline void getstr(void) @@ -536,6 +617,16 @@ main(void) off_t off; struct dsk *dsk; + bios_getmem(); + + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *) dmadat + sizeof(*dmadat); + heap_end = (char *) PTOV(bios_basemem); + } + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -550,8 +641,8 @@ main(void) bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk->drive; Modified: stable/7/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/7/sys/boot/zfs/zfsimpl.c Fri Dec 18 21:01:56 2009 (r200689) +++ stable/7/sys/boot/zfs/zfsimpl.c Fri Dec 18 21:02:32 2009 (r200690) @@ -51,7 +51,7 @@ static char *dnode_cache_buf; static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; -#define TEMP_SIZE (1*SPA_MAXBLOCKSIZE) +#define TEMP_SIZE (1024 * 1024) static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 21:12:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8EBF106568D; Fri, 18 Dec 2009 21:12:37 +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 97A3D8FC14; Fri, 18 Dec 2009 21:12: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 nBILCb2F008908; Fri, 18 Dec 2009 21:12:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILCbt8008906; Fri, 18 Dec 2009 21:12:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912182112.nBILCbt8008906@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 18 Dec 2009 21:12: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: r200691 - head/sys/boot/uboot/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:12:37 -0000 Author: marcel Date: Fri Dec 18 21:12:37 2009 New Revision: 200691 URL: http://svn.freebsd.org/changeset/base/200691 Log: Fix ub_env_enum(): syscall() returns 0 when properly invoked. Modified: head/sys/boot/uboot/lib/glue.c Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Fri Dec 18 21:02:32 2009 (r200690) +++ head/sys/boot/uboot/lib/glue.c Fri Dec 18 21:12:37 2009 (r200691) @@ -568,17 +568,16 @@ ub_env_enum(const char *last) const char *env, *str; int i; - env = NULL; - /* * It's OK to pass only the name piece as last (and not the whole * 'name=val' string), since the API_ENUM_ENV call uses envmatch() * internally, which handles such case */ - if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env)) + env = NULL; + if (syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env) != 0) return (NULL); - if (!env) + if (env == NULL) /* no more env. variables to enumerate */ return (NULL); From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 21:21:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E601065679; Fri, 18 Dec 2009 21:21:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B79F8FC16; Fri, 18 Dec 2009 21: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 nBILLEGQ009108; Fri, 18 Dec 2009 21:21:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILLE3r009105; Fri, 18 Dec 2009 21:21:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182121.nBILLE3r009105@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 21:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200692 - in stable/8/sys/boot/i386: gptboot zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:21:14 -0000 Author: jhb Date: Fri Dec 18 21:21:14 2009 New Revision: 200692 URL: http://svn.freebsd.org/changeset/base/200692 Log: MFC 200310: Fix a confusing typo in the EDD packet structure used in gptboot and gptzfsboot. I got the segment and offset fields reversed in the structure, but I also succeeded in crossing the assignments so the actual EDD packet ended up correct. Modified: stable/8/sys/boot/i386/gptboot/gptboot.c stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/8/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 21:12:37 2009 (r200691) +++ stable/8/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 21:21:14 2009 (r200692) @@ -642,8 +642,8 @@ bcmp(const void *b1, const void *b2, siz static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; @@ -656,8 +656,8 @@ drvread(void *buf, daddr_t lba, unsigned printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba; v86.ctl = V86_FLAGS; v86.addr = 0x13; Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:12:37 2009 (r200691) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:21:14 2009 (r200692) @@ -1049,8 +1049,8 @@ putchar(int c) static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; #endif @@ -1065,8 +1065,8 @@ drvread(struct dsk *dsk, void *buf, dadd printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba + dsk->start; v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 21:57:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCFE106566C; Fri, 18 Dec 2009 21:57:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CED278FC15; Fri, 18 Dec 2009 21:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBILvpDU009961; Fri, 18 Dec 2009 21:57:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILvpfm009959; Fri, 18 Dec 2009 21:57:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912182157.nBILvpfm009959@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 21:57: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: r200693 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:57:52 -0000 Author: yongari Date: Fri Dec 18 21:57:51 2009 New Revision: 200693 URL: http://svn.freebsd.org/changeset/base/200693 Log: Make sure to enable Next Page bit for IP1001. Otherwise the PHY fails to re-establishe 1000baseT link after downgrading to 10/100Mbps link. Modified: head/sys/dev/mii/ip1000phy.c Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Fri Dec 18 21:21:14 2009 (r200692) +++ head/sys/dev/mii/ip1000phy.c Fri Dec 18 21:57:51 2009 (r200693) @@ -398,8 +398,10 @@ ip1000phy_mii_phy_auto(struct mii_softc isc = (struct ip1000phy_softc *)sc; reg = 0; - if (isc->model == MII_MODEL_ICPLUS_IP1001) + if (isc->model == MII_MODEL_ICPLUS_IP1001) { reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_NP; + } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:08:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 479B1106566C; Fri, 18 Dec 2009 22:08:24 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id E21B18FC1D; Fri, 18 Dec 2009 22:08:23 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 726CD1701A; Sat, 19 Dec 2009 01:08:21 +0300 (MSK) Date: Sat, 19 Dec 2009 01:08:21 +0300 From: Maxim Dounin To: Xin LI Message-ID: <20091218220821.GF43547@mdounin.ru> References: <200912181855.nBIItFMe005161@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912181855.nBIItFMe005161@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:08:24 -0000 Hello! On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 18 18:55:15 2009 > New Revision: 200677 > URL: http://svn.freebsd.org/changeset/base/200677 > > Log: > MFC r199463: > > rc.early(8) was removed as of 20090530 so remove manual page reference > to it. Just a side note: gmirror(8) manpage still references rc.early in description of doing kernel dumps on gmirror. It would be great to fix it too. Maxim Dounin From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:12:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A2B106566B; Fri, 18 Dec 2009 22:12:47 +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 864EE8FC08; Fri, 18 Dec 2009 22:12: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 nBIMClit010378; Fri, 18 Dec 2009 22:12:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMCl7E010375; Fri, 18 Dec 2009 22:12:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182212.nBIMCl7E010375@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200694 - in stable/7/sys/boot/i386: gptboot zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:12:47 -0000 Author: jhb Date: Fri Dec 18 22:12:47 2009 New Revision: 200694 URL: http://svn.freebsd.org/changeset/base/200694 Log: MFC 200310: Fix a confusing typo in the EDD packet structure used in gptboot and gptzfsboot. I got the segment and offset fields reversed in the structure, but I also succeeded in crossing the assignments so the actual EDD packet ended up correct. Modified: stable/7/sys/boot/i386/gptboot/gptboot.c stable/7/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/7/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 21:57:51 2009 (r200693) +++ stable/7/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 22:12:47 2009 (r200694) @@ -645,8 +645,8 @@ bcmp(const void *b1, const void *b2, siz static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; @@ -659,8 +659,8 @@ drvread(void *buf, daddr_t lba, unsigned printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba; v86.ctl = V86_FLAGS; v86.addr = 0x13; Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:57:51 2009 (r200693) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 22:12:47 2009 (r200694) @@ -1049,8 +1049,8 @@ putchar(int c) static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; #endif @@ -1065,8 +1065,8 @@ drvread(struct dsk *dsk, void *buf, dadd printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba + dsk->start; v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:13:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC918106568B; Fri, 18 Dec 2009 22:13:34 +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 9A9C38FC1F; Fri, 18 Dec 2009 22:13: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 nBIMDY8L010429; Fri, 18 Dec 2009 22:13:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMDYNV010427; Fri, 18 Dec 2009 22:13:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182213.nBIMDYNV010427@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200695 - stable/6/sys/boot/i386/gptboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:13:34 -0000 Author: jhb Date: Fri Dec 18 22:13:34 2009 New Revision: 200695 URL: http://svn.freebsd.org/changeset/base/200695 Log: MFC 200310: Fix a confusing typo in the EDD packet structure used in gptboot and gptzfsboot. I got the segment and offset fields reversed in the structure, but I also succeeded in crossing the assignments so the actual EDD packet ended up correct. Modified: stable/6/sys/boot/i386/gptboot/gptboot.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/6/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 22:12:47 2009 (r200694) +++ stable/6/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 22:13:34 2009 (r200695) @@ -645,8 +645,8 @@ bcmp(const void *b1, const void *b2, siz static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; @@ -659,8 +659,8 @@ drvread(void *buf, daddr_t lba, unsigned printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba; v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:14:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8223C1065672; Fri, 18 Dec 2009 22:14: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 701788FC15; Fri, 18 Dec 2009 22:14: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 nBIMESkG010520; Fri, 18 Dec 2009 22:14:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMESsh010515; Fri, 18 Dec 2009 22:14:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912182214.nBIMESsh010515@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 22:14: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: r200696 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:14:28 -0000 Author: yongari Date: Fri Dec 18 22:14:28 2009 New Revision: 200696 URL: http://svn.freebsd.org/changeset/base/200696 Log: Add rudimentary WOL support. While I'm here remove enabling busmastering/memory address in resume path. Bus driver will handle that. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vge.c Fri Dec 18 22:14:28 2009 (r200696) @@ -157,6 +157,7 @@ static int vge_suspend(device_t); static void vge_cam_clear(struct vge_softc *); static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_clrwol(struct vge_softc *); static void vge_discard_rxbuf(struct vge_softc *, int); static int vge_dma_alloc(struct vge_softc *); static void vge_dma_free(struct vge_softc *); @@ -190,6 +191,7 @@ static int vge_rx_list_init(struct vge_s static int vge_rxeof(struct vge_softc *, int); static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); +static void vge_setwol(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stats_clear(struct vge_softc *); @@ -1012,6 +1014,10 @@ vge_attach(device_t dev) sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; } + if (pci_find_extcap(dev, PCIY_PMG, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PMCAP; + sc->vge_pmcap = cap; + } rid = 0; msic = pci_msi_count(dev); if (msi_disable == 0 && msic > 0) { @@ -1069,6 +1075,8 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + /* Clear WOL and take hardware from powerdown. */ + vge_clrwol(sc); vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) @@ -1098,6 +1106,8 @@ vge_attach(device_t dev) ifp->if_hwassist = VGE_CSUM_FEATURES; ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTAGGING; + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) + ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2279,6 +2289,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_WOL_UCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -2365,7 +2384,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - + vge_setwol(sc); sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); @@ -2382,17 +2401,26 @@ vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; + uint16_t pmstat; sc = device_get_softc(dev); - ifp = sc->vge_ifp; - - /* reenable busmastering */ - pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - /* reinitialize interface if necessary */ VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, pmstat, 2); + } + } + vge_clrwol(sc); + /* Restart MII auto-polling. */ + vge_miipoll_start(sc); + ifp = sc->vge_ifp; + /* Reinitialize interface if necessary. */ + if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } @@ -2409,15 +2437,8 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; - - sc = device_get_softc(dev); - VGE_LOCK(sc); - vge_stop(sc); - VGE_UNLOCK(sc); - - return (0); + return (vge_suspend(dev)); } #define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ @@ -2706,3 +2727,154 @@ vge_intr_holdoff(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); } } + +static void +vge_setlinkspeed(struct vge_softc *sc) +{ + struct mii_data *mii; + int aneg, i; + + VGE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->vge_miibus); + mii_pollstat(mii); + aneg = 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: + return; + case IFM_1000_T: + aneg++; + default: + break; + } + } + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_100T2CR, 0); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_ANAR, + ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* Poll link state until vge(4) get a 10/100 link. */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + 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: + return; + default: + break; + } + } + VGE_UNLOCK(sc); + pause("vgelnk", hz); + VGE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->vge_dev, "establishing link failed, " + "WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; +} + +static void +vge_setwol(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + + VGE_LOCK_ASSERT(sc); + + if ((sc->vge_flags & VGE_FLAG_PMCAP) == 0) { + /* No PME capability, PHY power down. */ + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_PDOWN); + vge_miipoll_stop(sc); + return; + } + + ifp = sc->vge_ifp; + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + vge_setlinkspeed(sc); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= VGE_WOLCR1_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= VGE_WOLCR1_MAGIC; + CSR_WRITE_1(sc, VGE_WOLCR1S, val); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= VGE_WOLCFG_SAM | VGE_WOLCFG_SAB; + CSR_WRITE_1(sc, VGE_WOLCFGS, val | VGE_WOLCFG_PMEOVR); + /* Disable MII auto-polling. */ + vge_miipoll_stop(sc); + } + CSR_SETBIT_1(sc, VGE_DIAGCTL, + VGE_DIAGCTL_MACFORCE | VGE_DIAGCTL_FDXFORCE); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Put hardware into sleep. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_DS0 | VGE_STICKHW_DS1; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->vge_dev, sc->vge_pmcap + + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, sc->vge_pmcap + PCIR_POWER_STATUS, + pmstat, 2); +} + +static void +vge_clrwol(struct vge_softc *sc) +{ + uint8_t val; + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Disable WOL and clear power state indicator. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~(VGE_STICKHW_DS0 | VGE_STICKHW_DS1); + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE); + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vgereg.h Fri Dec 18 22:14:28 2009 (r200696) @@ -590,6 +590,42 @@ #define VGE_MIB_DATA_MASK 0x00FFFFFF #define VGE_MIB_DATA_IDX(x) ((x) >> 24) +/* Sticky bit shadow register */ + +#define VGE_STICKHW_DS0 0x01 +#define VGE_STICKHW_DS1 0x02 +#define VGE_STICKHW_WOL_ENB 0x04 +#define VGE_STICKHW_WOL_STS 0x08 +#define VGE_STICKHW_SWPTAG 0x10 + +/* WOL pattern control */ +#define VGE_WOLCR0_PATTERN0 0x01 +#define VGE_WOLCR0_PATTERN1 0x02 +#define VGE_WOLCR0_PATTERN2 0x04 +#define VGE_WOLCR0_PATTERN3 0x08 +#define VGE_WOLCR0_PATTERN4 0x10 +#define VGE_WOLCR0_PATTERN5 0x20 +#define VGE_WOLCR0_PATTERN6 0x40 +#define VGE_WOLCR0_PATTERN7 0x80 +#define VGE_WOLCR0_PATTERN_ALL 0xFF + +/* WOL event control */ +#define VGE_WOLCR1_UCAST 0x01 +#define VGE_WOLCR1_MAGIC 0x02 +#define VGE_WOLCR1_LINKON 0x04 +#define VGE_WOLCR1_LINKOFF 0x08 + +/* Poweer management config */ +#define VGE_PWRCFG_LEGACY_WOLEN 0x01 +#define VGE_PWRCFG_WOL_PULSE 0x20 +#define VGE_PWRCFG_WOL_BUTTON 0x00 + +/* WOL config register */ +#define VGE_WOLCFG_PHYINT_ENB 0x01 +#define VGE_WOLCFG_SAB 0x10 +#define VGE_WOLCFG_SAM 0x20 +#define VGE_WOLCFG_PMEOVR 0x80 + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vgevar.h Fri Dec 18 22:14:28 2009 (r200696) @@ -186,9 +186,11 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_PMCAP 0x0004 #define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; + int vge_pmcap; int vge_camidx; int vge_int_holdoff; int vge_rx_coal_pkt; From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:19:45 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57527106566B; Fri, 18 Dec 2009 22:19:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F0FB88FC08; Fri, 18 Dec 2009 22:19:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBIM9oa3097158; Fri, 18 Dec 2009 15:09:50 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 18 Dec 2009 15:10:17 -0700 (MST) Message-Id: <20091218.151017.956847443318915404.imp@bsdimp.com> To: ed@80386.nl From: "M. Warner Losh" In-Reply-To: <20091218163626.GF64905@hoeg.nl> References: <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> <20091218163626.GF64905@hoeg.nl> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, des@des.no, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:19:45 -0000 In message: <20091218163626.GF64905@hoeg.nl> Ed Schouten writes: : Hello DES, : = : First of all: happy birthday! : = : * Dag-Erling Sm=F8rgrav wrote: : > perhaps we should simply add the appropriate : > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) : > without FREEBSD_COMPAT(n+1). : = : Why not make COMPAT_FREEBSD numerical? : = : | options COMPAT_FREEBSD=3D4 : = : and let the code use: : = : | #if COMPAT_FREEBSD <=3D 4 : | ... : | #endif That would take some doing to the syscall generation code as well. The whole concept of the compat stuff isn't well thought out, since it seems backwards (and I think that you got your example wrong). Warner From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:23:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27990106566B; Fri, 18 Dec 2009 22:23:28 +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 15CAE8FC08; Fri, 18 Dec 2009 22:23: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 nBIMNRih010776; Fri, 18 Dec 2009 22:23:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMNR53010774; Fri, 18 Dec 2009 22:23:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182223.nBIMNR53010774@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200697 - stable/8/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:23:28 -0000 Author: jhb Date: Fri Dec 18 22:23:27 2009 New Revision: 200697 URL: http://svn.freebsd.org/changeset/base/200697 Log: MFC 200357: Don't warn about an RSDP with a corrupt checksum. The kernel does a better job about warning about these things later and this message can be confusing. Modified: stable/8/sys/boot/i386/libi386/biosacpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:14:28 2009 (r200696) +++ stable/8/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:23:27 2009 (r200697) @@ -125,10 +125,8 @@ biosacpi_search_rsdp(char *base, int len sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); - if (sum != 0) { - printf("acpi: bad RSDP checksum (%d)\n", sum); + if (sum != 0) continue; - } return(rsdp); } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:23:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E16B10656C2; Fri, 18 Dec 2009 22:23:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7CC8FC1D; Fri, 18 Dec 2009 22:23: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 nBIMNwWf010822; Fri, 18 Dec 2009 22:23:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMNwJk010820; Fri, 18 Dec 2009 22:23:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182223.nBIMNwJk010820@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200698 - stable/7/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:23:58 -0000 Author: jhb Date: Fri Dec 18 22:23:57 2009 New Revision: 200698 URL: http://svn.freebsd.org/changeset/base/200698 Log: MFC 200357: Don't warn about an RSDP with a corrupt checksum. The kernel does a better job about warning about these things later and this message can be confusing. Modified: stable/7/sys/boot/i386/libi386/biosacpi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:23:27 2009 (r200697) +++ stable/7/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:23:57 2009 (r200698) @@ -125,10 +125,8 @@ biosacpi_search_rsdp(char *base, int len sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); - if (sum != 0) { - printf("acpi: bad RSDP checksum (%d)\n", sum); + if (sum != 0) continue; - } return(rsdp); } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:24:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A2C1065740; Fri, 18 Dec 2009 22:24:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CED658FC17; Fri, 18 Dec 2009 22:24: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 nBIMOJjf010873; Fri, 18 Dec 2009 22:24:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMOJ7U010871; Fri, 18 Dec 2009 22:24:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182224.nBIMOJ7U010871@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200699 - stable/6/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:24:20 -0000 Author: jhb Date: Fri Dec 18 22:24:19 2009 New Revision: 200699 URL: http://svn.freebsd.org/changeset/base/200699 Log: MFC 200357: Don't warn about an RSDP with a corrupt checksum. The kernel does a better job about warning about these things later and this message can be confusing. Modified: stable/6/sys/boot/i386/libi386/biosacpi.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- stable/6/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:23:57 2009 (r200698) +++ stable/6/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:24:19 2009 (r200699) @@ -123,10 +123,8 @@ biosacpi_search_rsdp(char *base, int len sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); - if (sum != 0) { - printf("acpi: bad RSDP checksum (%d)\n", sum); + if (sum != 0) continue; - } return(rsdp); } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 22:30:18 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB4BA10656A3; Fri, 18 Dec 2009 22:30:18 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 45E058FC15; Fri, 18 Dec 2009 22:30:16 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 54DF7A595C2; Sat, 19 Dec 2009 06:30:15 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id o7euhlPP-peA; Sat, 19 Dec 2009 06:30:02 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id B3308A595A7; Sat, 19 Dec 2009 06:29:57 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=EkI4YRg7Ao21S2ui23ZoMAN7FkYgj6ZINFI9HGcI7urAQ9vropWLvn9IlnUrV2DDg z7Ww+L4IQE25n6h2y/Gpw== Message-ID: <4B2C0259.7000101@delphij.net> Date: Fri, 18 Dec 2009 14:29:45 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091214 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Maxim Dounin References: <200912181855.nBIItFMe005161@svn.freebsd.org> <20091218220821.GF43547@mdounin.ru> In-Reply-To: <20091218220821.GF43547@mdounin.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-8@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:30:18 -0000 On 2009/12/18 14:08, Maxim Dounin wrote: > Hello! > > On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > >> Author: delphij >> Date: Fri Dec 18 18:55:15 2009 >> New Revision: 200677 >> URL: http://svn.freebsd.org/changeset/base/200677 >> >> Log: >> MFC r199463: >> >> rc.early(8) was removed as of 20090530 so remove manual page reference >> to it. > > Just a side note: gmirror(8) manpage still references rc.early in > description of doing kernel dumps on gmirror. It would be great > to fix it too. I think we need to fix it with new instruction about the (deprecated) rc.early and rc.local scripts. To be honest I think it's an overkill to have one-liners as a standard alone rc.d script, as it's far too easy for administrator to screw themselves, though. I have a similar script (ignore the Chinese characters which just described how to do this remotely) http://wiki.freebsdchina.org/howto/s/softupdates-enable Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-all@FreeBSD.ORG Fri Dec 18 23:38:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2262610656C1 for ; Fri, 18 Dec 2009 23:38:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A6C278FC1C for ; Fri, 18 Dec 2009 23:38:32 +0000 (UTC) Received: (qmail 20166 invoked by uid 399); 18 Dec 2009 23:38:31 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 18 Dec 2009 23:38:31 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B2C127A.8060509@FreeBSD.org> Date: Fri, 18 Dec 2009 15:38:34 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , John Baldwin Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 23:38:33 -0000 Dag-Erling Smørgrav wrote: > John Baldwin writes: >> Warner Losh writes: >>> Log: >>> Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. >>> >>> Note: Not sure this is the right way to do compat, but it makes the >>> headers consistent with the implementations. >> Please revert. I think this has already been reverted once before. > > Yep, that was me... we concluded back then that this is a perfectly > reasonable dependency; perhaps we should simply add the appropriate > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) > without FREEBSD_COMPAT(n+1). Trying to look at this from the user perspective, it's kind of silly that if what I want is COMPAT5 I also need to add COMPAT. I don't know the issues in the code so I don't know what the solution should be on the back end, but on the front end what needs to work is that I specify the compat level I want in my kernel config, then the code does what's necessary to make that work. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 01:30:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B256C1065672; Sat, 19 Dec 2009 01:30:45 +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 A10AA8FC16; Sat, 19 Dec 2009 01:30: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 nBJ1UjJM014532; Sat, 19 Dec 2009 01:30:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ1UjSa014530; Sat, 19 Dec 2009 01:30:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190130.nBJ1UjSa014530@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 01:30: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: r200700 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 01:30:45 -0000 Author: dougb Date: Sat Dec 19 01:30:45 2009 New Revision: 200700 URL: http://svn.freebsd.org/changeset/base/200700 Log: In the places where find is used that the user may see the results, first pipe it to sort so that order of processing will be deterministic and like things will be grouped together. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri Dec 18 22:24:19 2009 (r200699) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:30:45 2009 (r200700) @@ -974,7 +974,7 @@ fi # change to something else in a newer version. So we need to explicitly # test for this, and warn the user if what we find does not match. # -for COMPFILE in `find .` ; do +for COMPFILE in `find . | sort` ; do if [ -e "${DESTDIR}${COMPFILE#.}" ]; then INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` else @@ -1021,7 +1021,7 @@ for COMPFILE in `find .` ; do fi done -for COMPFILE in `find . -type f`; do +for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. @@ -1124,7 +1124,7 @@ echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" - find "${TEMPROOT}" -type f -size +0 + find "${TEMPROOT}" -type f -size +0 | sort echo '' fi From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 01:32:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17D0A1065679; Sat, 19 Dec 2009 01:32:35 +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 E0E6C8FC13; Sat, 19 Dec 2009 01:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ1WYbj014600; Sat, 19 Dec 2009 01:32:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ1WYWU014598; Sat, 19 Dec 2009 01:32:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190132.nBJ1WYWU014598@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 01:32: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: r200701 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 01:32:35 -0000 Author: dougb Date: Sat Dec 19 01:32:34 2009 New Revision: 200701 URL: http://svn.freebsd.org/changeset/base/200701 Log: Fix an indentation issue, no functional changes Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:30:45 2009 (r200700) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:32:34 2009 (r200701) @@ -840,33 +840,33 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') - case "${LINK_EXPLAINED}" in + case "${AUTO_INSTALL}" in '') - echo " *** Historically BSD derived systems have had a" - echo " hard link from /.cshrc and /.profile to" - echo " their namesakes in /root. Please indicate" - echo " your preference below for bringing your" - echo " installed files up to date." + case "${LINK_EXPLAINED}" in + '') + echo " *** Historically BSD derived systems have had a" + echo " hard link from /.cshrc and /.profile to" + echo " their namesakes in /root. Please indicate" + echo " your preference below for bringing your" + echo " installed files up to date." + echo '' + LINK_EXPLAINED=yes + ;; + esac + + echo " Use 'd' to delete the temporary ${COMPFILE}" + echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" + echo '' + echo " Default is to leave the temporary file to deal with by hand" echo '' - LINK_EXPLAINED=yes + echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " + read HANDLE_LINK + ;; + *) # Part of AUTO_INSTALL + HANDLE_LINK=l ;; esac - echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" - echo '' - echo " Default is to leave the temporary file to deal with by hand" - echo '' - echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " - read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac - case "${HANDLE_LINK}" in [dD]*) rm "${COMPFILE}" From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 04:25:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA0A81065670; Sat, 19 Dec 2009 04:25:19 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4018FC14; Sat, 19 Dec 2009 04:25: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 nBJ4PJel019469; Sat, 19 Dec 2009 04:25:19 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4PJi4019466; Sat, 19 Dec 2009 04:25:19 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190425.nBJ4PJi4019466@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200702 - in stable/8/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:25:19 -0000 Author: nyan Date: Sat Dec 19 04:25:19 2009 New Revision: 200702 URL: http://svn.freebsd.org/changeset/base/200702 Log: MFC: r200253 and r200255 Reduce diffs against i386. Modified: stable/8/sys/boot/pc98/libpc98/biosmem.c stable/8/sys/boot/pc98/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- stable/8/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 01:32:34 2009 (r200701) +++ stable/8/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:25:19 2009 (r200702) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,5 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Sat Dec 19 01:32:34 2009 (r200701) +++ stable/8/sys/boot/pc98/loader/main.c Sat Dec 19 04:25:19 2009 (r200702) @@ -96,14 +96,18 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 04:33:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC81106566B; Sat, 19 Dec 2009 04:33:10 +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 812B08FC14; Sat, 19 Dec 2009 04:33: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 nBJ4XAej019673; Sat, 19 Dec 2009 04:33:10 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4XA8Q019670; Sat, 19 Dec 2009 04:33:10 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190433.nBJ4XA8Q019670@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200703 - in stable/7/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:33:10 -0000 Author: nyan Date: Sat Dec 19 04:33:10 2009 New Revision: 200703 URL: http://svn.freebsd.org/changeset/base/200703 Log: MFC: r200253 and r200255 Reduce diffs against i386. Modified: stable/7/sys/boot/pc98/libpc98/biosmem.c stable/7/sys/boot/pc98/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:25:19 2009 (r200702) +++ stable/7/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:33:10 2009 (r200703) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,5 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/7/sys/boot/pc98/loader/main.c ============================================================================== --- stable/7/sys/boot/pc98/loader/main.c Sat Dec 19 04:25:19 2009 (r200702) +++ stable/7/sys/boot/pc98/loader/main.c Sat Dec 19 04:33:10 2009 (r200703) @@ -96,14 +96,18 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 04:39:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA88A106566B; Sat, 19 Dec 2009 04:39:21 +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 BF1018FC16; Sat, 19 Dec 2009 04:39: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 nBJ4dLnM019883; Sat, 19 Dec 2009 04:39:21 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4dLjc019880; Sat, 19 Dec 2009 04:39:21 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190439.nBJ4dLjc019880@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200704 - in stable/6/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:39:22 -0000 Author: nyan Date: Sat Dec 19 04:39:21 2009 New Revision: 200704 URL: http://svn.freebsd.org/changeset/base/200704 Log: MFC: r200253 and r200255 Reduce diffs against i386. Modified: stable/6/sys/boot/pc98/libpc98/biosmem.c stable/6/sys/boot/pc98/loader/main.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- stable/6/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:33:10 2009 (r200703) +++ stable/6/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:39:21 2009 (r200704) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,5 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/6/sys/boot/pc98/loader/main.c ============================================================================== --- stable/6/sys/boot/pc98/loader/main.c Sat Dec 19 04:33:10 2009 (r200703) +++ stable/6/sys/boot/pc98/loader/main.c Sat Dec 19 04:39:21 2009 (r200704) @@ -96,14 +96,18 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 04:43:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62EFE106566C; Sat, 19 Dec 2009 04:43:25 +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 4FD338FC15; Sat, 19 Dec 2009 04:43: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 nBJ4hPas020011; Sat, 19 Dec 2009 04:43:25 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4hPNv020009; Sat, 19 Dec 2009 04:43:25 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190443.nBJ4hPNv020009@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200705 - stable/8/sys/boot/pc98/btx/btx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:43:25 -0000 Author: nyan Date: Sat Dec 19 04:43:25 2009 New Revision: 200705 URL: http://svn.freebsd.org/changeset/base/200705 Log: MFC: r200254 MFi386: Use real mode instead of v86 mode. Modified: stable/8/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 04:39:21 2009 (r200704) +++ stable/8/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 04:43:25 2009 (r200705) @@ -21,11 +21,11 @@ .set MEM_BTX,0x1000 # Start of BTX memory .set MEM_ESP0,0x1800 # Supervisor stack .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_TSS_END,0x3fff # Page directory + .set MEM_ESPR,0x5e00 # Real mode stack + .set MEM_IDT,0x5e00 # IDT + .set MEM_TSS,0x5f98 # TSS + .set MEM_MAP,0x6000 # I/O bit map + .set MEM_TSS_END,0x7fff # End of TSS .set MEM_ORG,0x9000 # BTX code .set MEM_USR,0xa000 # Start of user memory /* @@ -34,6 +34,14 @@ .set PAG_SIZ,0x1000 # Page size .set PAG_CNT,0x1000 # Pages to map /* + * Fields in %eflags. + */ + .set PSL_RESERVED_DEFAULT,0x00000002 + .set PSL_T,0x00000100 # Trap flag + .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_VM,0x00020000 # Virtual 8086 mode flag + .set PSL_AC,0x00040000 # Alignment check flag +/* * Segment selectors. */ .set SEL_SCODE,0x8 # Supervisor code @@ -48,7 +56,6 @@ */ .set TSS_ESP0,0x4 # PL 0 ESP .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP .set TSS_MAP,0x66 # I/O bit map base /* * System calls. @@ -56,10 +63,20 @@ .set SYS_EXIT,0x0 # Exit .set SYS_EXEC,0x1 # Exec /* - * V86 constants. + * Fields in V86 interface structure. */ - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS +/* + * V86 control flags. + */ + .set V86F_ADDR,0x10000 # Segment:offset address + .set V86F_CALLF,0x20000 # Emulate far call + .set V86F_FLAGS,0x40000 # Return flags /* * Dump format control bytes. */ @@ -77,13 +94,11 @@ * BIOS Data Area locations. */ .set BDA_MEM,0x501 # Free memory - .set BDA_KEYFLAGS,0x53a # Keyboard shift-state flags .set BDA_POS,0x53e # Cursor position /* * Derivations, for brevity. */ .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit @@ -100,7 +115,7 @@ btx_hdr: .byte 0xeb # Machine ID .byte 0xe # Header size .ascii "BTX" # Magic .byte 0x1 # Major version - .byte 0x1 # Minor version + .byte 0x2 # Minor version .byte BTX_FLAGS # Flags .word PAG_CNT-MEM_ORG>>0xc # Paging control .word break-start # Text size @@ -121,13 +136,24 @@ init: cli # Disable interrupts */ mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero - push %di # Save rep # Zero-fill stosw # memory - pop %di # Restore +/* + * Update real mode IDT for reflecting hardware interrupts. + */ + mov $intr20,%bx # Address first handler + mov $0x10,%cx # Number of handlers + mov $0x20*4,%di # First real mode IDT entry +init.0: mov %bx,(%di) # Store IP + inc %di # Address next + inc %di # entry + stosw # Store CS + add $4,%bx # Next handler + loop init.0 # Next IRQ /* * Create IDT. */ + mov $MEM_IDT,%di mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -153,7 +179,6 @@ init.3: lea 0x8(%di),%di # Next entry */ init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 - movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base /* * Bring up the system. @@ -253,8 +278,8 @@ exit.2: xor %ax,%ax # Real mode segme exit.3: jz exit.3 # No movb $0xa0,%al outb %al,$0x35 - movb 0,%al - outb %al,$0xf0 + movb $0x00,%al + outb %al,$0xf0 # reboot the machine exit.4: jmp exit.4 /* * Set IRQ offsets by reprogramming 8259A PICs. @@ -285,10 +310,6 @@ setpic: in $0x02,%al # Save master retw # To caller .code32 /* - * Initiate return from V86 mode to user mode. - */ -inthlt: hlt # To supervisor mode -/* * Exception jump table. */ intx00: push $0x0 # Int 0x0: #DE @@ -314,18 +335,12 @@ intx00: push $0x0 # Int 0x0: #DE push $0xc # Int 0xc: #SS jmp except # Stack segment fault push $0xd # Int 0xd: #GP - jmp ex_v86 # General protection + jmp except # General protection push $0xe # Int 0xe: #PF jmp except # Page fault intx10: push $0x10 # Int 0x10: #MF jmp ex_noc # Floating-point error /* - * Handle #GP exception. - */ -ex_v86: testb $0x2,0x12(%esp,1) # V86 mode? - jz except # No - jmp v86mon # To monitor -/* * Save a zero error code. */ ex_noc: pushl (%esp,1) # Duplicate int no @@ -337,24 +352,17 @@ except: cld # String ops inc pushl %ds # Save pushl %es # most pusha # registers - movb $0x6,%al # Push loop count - testb $0x2,0x3a(%esp,1) # V86 mode? - jnz except.1 # Yes pushl %gs # Set GS pushl %fs # Set FS pushl %ds # Set DS pushl %es # Set ES - movb $0x2,%al # Push loop count cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode? jne except.1 # No pushl %ss # Set SS - leal 0x50(%esp,1),%eax # Set - pushl %eax # ESP jmp except.2 # Join common code -except.1: pushl 0x50(%esp,1) # Set GS, FS, DS, ES - decb %al # (if V86 mode), and - jne except.1 # SS, ESP -except.2: push $SEL_SDATA # Set up +except.1: pushl 0x50(%esp,1) # Set SS +except.2: pushl 0x50(%esp,1) # Set ESP + push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data @@ -363,14 +371,12 @@ except.2: push $SEL_SDATA # Set up movl $MEM_BUF,%edi # Buffer pushl %eax pushl %edx -wait.1: - inb $0x60,%al +wait.1: inb $0x60,%al testb $0x04,%al jz wait.1 movb $0xe0,%al outb %al,$0x62 -wait.2: - inb $0x60,%al +wait.2: inb $0x60,%al testb $0x01,%al jz wait.2 xorl %edx,%edx @@ -399,237 +405,11 @@ wait.2: je except.3 # Yes cmpb $0x1,(%esp,1) # Debug? jne except.2a # No - testl $0x100,0x10(%esp,1) # Trap flag set? + testl $PSL_T,0x10(%esp,1) # Trap flag set? jnz except.3 # Yes except.2a: jmp exit # Exit except.3: leal 0x8(%esp,1),%esp # Discard err, int no iret # From interrupt -/* - * Return to user mode from V86 mode. - */ -intrtn: cld # String ops inc - pushl %ds # Address - popl %es # data - leal 0x3c(%ebp),%edx # V86 Segment registers - movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer - lodsl # INT_V86 args pointer - movl %esi,%ebx # Saved exception frame - testl %eax,%eax # INT_V86 args? - jz intrtn.2 # No - movl $MEM_USR,%edi # User base - movl 0x1c(%esi),%ebx # User ESP - movl %eax,(%edi,%ebx,1) # Restore to user stack - leal 0x8(%edi,%eax,1),%edi # Arg segment registers - testb $0x4,-0x6(%edi) # Return flags? - jz intrtn.1 # No - movl 0x30(%ebp),%eax # Get V86 flags - movw %ax,0x18(%esi) # Set user flags -intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame - xchgl %edx,%esi # Segment registers - movb $0x4,%cl # Update seg regs - rep # in INT_V86 - movsl # args -intrtn.2: xchgl %edx,%esi # Segment registers - leal 0x28(%ebp),%edi # Set up seg - movb $0x4,%cl # regs for - rep # later - movsl # pop - xchgl %ebx,%esi # Restore exception - movb $0x5,%cl # frame to - rep # supervisor - movsl # stack - movl %esi,MEM_TSS+TSS_ESP1 # Link stack pointer - popa # Restore - leal 0x8(%esp,1),%esp # Discard err, int no - popl %es # Restore - popl %ds # user - popl %fs # segment - popl %gs # registers - iret # To user mode -/* - * V86 monitor. - */ -v86mon: cld # String ops inc - pushl $SEL_SDATA # Set up for - popl %ds # flat addressing - pusha # Save registers - movl %esp,%ebp # Address stack frame - movzwl 0x2c(%ebp),%edi # Load V86 CS - shll $0x4,%edi # To linear - movl 0x28(%ebp),%esi # Load V86 IP - addl %edi,%esi # Code pointer - xorl %ecx,%ecx # Zero - movb $0x2,%cl # 16-bit operands - xorl %eax,%eax # Zero -v86mon.1: lodsb # Get opcode - cmpb $0x66,%al # Operand size prefix? - jne v86mon.2 # No - movb $0x4,%cl # 32-bit operands - jmp v86mon.1 # Continue -v86mon.2: cmpb $0xf4,%al # HLT? - jne v86mon.3 # No - cmpl $inthlt+0x1,%esi # Is inthlt? - jne v86mon.7 # No (ignore) - jmp intrtn # Return to user mode -v86mon.3: cmpb $0xf,%al # Prefixed instruction? - jne v86mon.4 # No - cmpb $0x09,(%esi) # Is it a WBINVD? - je v86wbinvd # Yes - cmpb $0x30,(%esi) # Is it a WRMSR? - je v86wrmsr # Yes - cmpb $0x32,(%esi) # Is it a RDMSR? - je v86rdmsr # Yes - cmpb $0x20,(%esi) # Is this a MOV reg,CRx? - je v86mov # Yes -v86mon.4: cmpb $0xfa,%al # CLI? - je v86cli # Yes - cmpb $0xfb,%al # STI? - je v86sti # Yes - movzwl 0x38(%ebp),%ebx # Load V86 SS - shll $0x4,%ebx # To offset - pushl %ebx # Save - addl 0x34(%ebp),%ebx # Add V86 SP - movl 0x30(%ebp),%edx # Load V86 flags - cmpb $0x9c,%al # PUSHF/PUSHFD? - je v86pushf # Yes - cmpb $0x9d,%al # POPF/POPFD? - je v86popf # Yes - cmpb $0xcd,%al # INT imm8? - je v86intn # Yes - cmpb $0xcf,%al # IRET/IRETD? - je v86iret # Yes - popl %ebx # Restore - popa # Restore - jmp except # Handle exception -v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags -v86mon.6: popl %edx # V86 SS adjustment - subl %edx,%ebx # Save V86 - movl %ebx,0x34(%ebp) # SP -v86mon.7: subl %edi,%esi # From linear - movl %esi,0x28(%ebp) # Save V86 IP - popa # Restore - leal 0x8(%esp,1),%esp # Discard int no, error - iret # To V86 mode -/* - * Emulate MOV reg,CRx. - */ -v86mov: movb 0x1(%esi),%bl # Fetch Mod R/M byte - testb $0x10,%bl # Read CR2 or CR3? - jnz v86mov.1 # Yes - movl %cr0,%eax # Read CR0 - testb $0x20,%bl # Read CR4 instead? - jz v86mov.2 # No - movl %cr4,%eax # Read CR4 - jmp v86mov.2 -v86mov.1: movl %cr2,%eax # Read CR2 - testb $0x08,%bl # Read CR3 instead? - jz v86mov.2 # No - movl %cr3,%eax # Read CR3 -v86mov.2: andl $0x7,%ebx # Compute offset in - shl $2,%ebx # frame of destination - neg %ebx # register - movl %eax,0x1c(%ebp,%ebx,1) # Store CR to reg - incl %esi # Adjust IP -/* - * Return from emulating a 0x0f prefixed instruction - */ -v86preret: incl %esi # Adjust IP - jmp v86mon.7 # Finish up -/* - * Emulate WBINVD - */ -v86wbinvd: wbinvd # Write back and invalidate - # cache - jmp v86preret # Finish up -/* - * Emulate WRMSR - */ -v86wrmsr: movl 0x18(%ebp),%ecx # Get user's %ecx (MSR to write) - movl 0x14(%ebp),%edx # Load the value - movl 0x1c(%ebp),%eax # to write - wrmsr # Write MSR - jmp v86preret # Finish up -/* - * Emulate RDMSR - */ -v86rdmsr: movl 0x18(%ebp),%ecx # MSR to read - rdmsr # Read the MSR - movl %eax,0x1c(%ebp) # Return the value of - movl %edx,0x14(%ebp) # the MSR to the user - jmp v86preret # Finish up -/* - * Emulate CLI. - */ -v86cli: andb $~0x2,0x31(%ebp) # Clear IF - jmp v86mon.7 # Finish up -/* - * Emulate STI. - */ -v86sti: orb $0x2,0x31(%ebp) # Set IF - jmp v86mon.7 # Finish up -/* - * Emulate PUSHF/PUSHFD. - */ -v86pushf: subl %ecx,%ebx # Adjust SP - cmpb $0x4,%cl # 32-bit - je v86pushf.1 # Yes - data16 # 16-bit -v86pushf.1: movl %edx,(%ebx) # Save flags - jmp v86mon.6 # Finish up -/* - * Emulate IRET/IRETD. - */ -v86iret: movzwl (%ebx),%esi # Load V86 IP - movzwl 0x2(%ebx),%edi # Load V86 CS - leal 0x4(%ebx),%ebx # Adjust SP - movl %edi,0x2c(%ebp) # Save V86 CS - xorl %edi,%edi # No ESI adjustment -/* - * Emulate POPF/POPFD (and remainder of IRET/IRETD). - */ -v86popf: cmpb $0x4,%cl # 32-bit? - je v86popf.1 # Yes - movl %edx,%eax # Initialize - data16 # 16-bit -v86popf.1: movl (%ebx),%eax # Load flags - addl %ecx,%ebx # Adjust SP - andl $V86_FLG,%eax # Merge - andl $~V86_FLG,%edx # the - orl %eax,%edx # flags - jmp v86mon.5 # Finish up -/* - * trap int 15, function 87 - * reads %es:%si from saved registers on stack to find a GDT containing - * source and destination locations - * reads count of words from saved %cx - * returns success by setting %ah to 0 - */ -int15_87: pushl %esi # Save - pushl %edi # registers - movl 0x3C(%ebp),%edi # Load ES - movzwl 0x4(%ebp),%eax # Load user's SI - shll $0x4,%edi # EDI = (ES << 4) + - addl %eax,%edi # SI - movl 0x11(%edi),%eax # Read base of - movb 0x17(%edi),%al # GDT entry - ror $8,%eax # for source - xchgl %eax,%esi # into %esi - movl 0x19(%edi),%eax # Read base of - movb 0x1f(%edi),%al # GDT entry for - ror $8,%eax # destination - xchgl %eax,%edi # into %edi - pushl %ds # Make: - popl %es # es = ds - movzwl 0x18(%ebp),%ecx # Get user's CX - shll $0x1,%ecx # Convert count from words - rep # repeat... - movsb # perform copy. - popl %edi # Restore - popl %esi # registers - movb $0x0,0x1d(%ebp) # set ah = 0 to indicate - # success - andb $0xfe,%dl # clear CF - jmp v86mon.5 # Finish up /* * Reboot the machine by setting the reboot flag and exiting @@ -638,36 +418,7 @@ reboot: orb $0x1,btx_hdr+0x7 # Set the jmp exit # Terminate BTX and reboot /* - * Emulate INT imm8... also make sure to check if it's int 15/87 - */ -v86intn: lodsb # Get int no - cmpb $0x19,%al # is it int 19? - je reboot # yes, reboot the machine - cmpb $0x15,%al # is it int 15? - jne v86intn.1 # no, skip parse - cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction? - je int15_87 # yes - cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout? - jne v86intn.1 # no, handle the int normally - movb BDA_KEYFLAGS,%ch # get the shift key state - andb $0x18,%ch # mask off just Ctrl and Alt - cmpb $0x18,%ch # are both Ctrl and Alt down? - je reboot # yes, reboot the machine -v86intn.1: subl %edi,%esi # From - shrl $0x4,%edi # linear - movw %dx,-0x2(%ebx) # Save flags - movw %di,-0x4(%ebx) # Save CS - leal -0x6(%ebx),%ebx # Adjust SP - movw %si,(%ebx) # Save IP - shll $0x2,%eax # Scale - movzwl (%eax),%esi # Load IP - movzwl 0x2(%eax),%edi # Load CS - movl %edi,0x2c(%ebp) # Save CS - xorl %edi,%edi # No ESI adjustment - andb $~0x1,%dh # Clear TF - jmp v86mon.5 # Finish up -/* - * Hardware interrupt jump table. + * Protected Mode Hardware interrupt jump table. */ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x8 @@ -701,127 +452,267 @@ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x16 push $0x17 # Int 0x2f: IRQ15 jmp int_hw # V86 int 0x17 + +/* + * Invoke real mode interrupt/function call from user mode with arguments. + */ +intx31: pushl $-1 # Dummy int no for btx_v86 /* - * Reflect hardware interrupts. + * Invoke real mode interrupt/function call from protected mode. + * + * We place a trampoline on the user stack that will return to rret_tramp + * which will reenter protected mode and then finally return to the user + * client. + * + * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR: + * + * -0x00 user %ss -0x04 kernel %esp (with full frame) + * -0x04 user %esp -0x08 btx_v86 pointer + * -0x08 user %eflags -0x0c flags (only used if interrupt) + * -0x0c user %cs -0x10 real mode CS:IP return trampoline + * -0x10 user %eip -0x12 real mode flags + * -0x14 int no -0x16 real mode CS:IP (target) + * -0x18 %eax + * -0x1c %ecx + * -0x20 %edx + * -0x24 %ebx + * -0x28 %esp + * -0x2c %ebp + * -0x30 %esi + * -0x34 %edi + * -0x38 %gs + * -0x3c %fs + * -0x40 %ds + * -0x44 %es + * -0x48 zero %eax (hardware int only) + * -0x4c zero %ecx (hardware int only) + * -0x50 zero %edx (hardware int only) + * -0x54 zero %ebx (hardware int only) + * -0x58 zero %esp (hardware int only) + * -0x5c zero %ebp (hardware int only) + * -0x60 zero %esi (hardware int only) + * -0x64 zero %edi (hardware int only) + * -0x68 zero %gs (hardware int only) + * -0x6c zero %fs (hardware int only) + * -0x70 zero %ds (hardware int only) + * -0x74 zero %es (hardware int only) */ -int_hw: testb $0x2,0xe(%esp,1) # V86 mode? - jz intusr # No - pushl $SEL_SDATA # Address - popl %ds # data - xchgl %eax,(%esp,1) # Swap EAX, int no - pushl %ebp # Address - movl %esp,%ebp # stack frame - pushl %ebx # Save - shll $0x2,%eax # Get int - movl (%eax),%eax # vector - subl $0x6,0x14(%ebp) # Adjust V86 ESP - movzwl 0x18(%ebp),%ebx # V86 SS - shll $0x4,%ebx # * 0x10 - addl 0x14(%ebp),%ebx # + V86 ESP - xchgw %ax,0x8(%ebp) # Swap V86 IP - rorl $0x10,%eax # Swap words - xchgw %ax,0xc(%ebp) # Swap V86 CS - roll $0x10,%eax # Swap words - movl %eax,(%ebx) # CS:IP for IRET - movl 0x10(%ebp),%eax # V86 flags - movw %ax,0x4(%ebx) # Flags for IRET - andb $~0x3,0x11(%ebp) # Clear IF, TF - popl %ebx # Restore - popl %ebp # saved - popl %eax # registers - iret # To V86 mode -/* - * Invoke V86 interrupt from user mode, with arguments. - */ -intx31: stc # Have btx_v86 - pushl %eax # Missing int no -/* - * Invoke V86 interrupt from user mode. - */ -intusr: std # String ops dec - pushl %eax # Expand - pushl %eax # stack - pushl %eax # frame - pusha # Save +int_hw: cld # String ops inc + pusha # Save gp regs pushl %gs # Save - movl %esp,%eax # seg regs - pushl %fs # and - pushl %ds # point - pushl %es # to them + pushl %fs # seg + pushl %ds # regs + pushl %es push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data + leal 0x44(%esp,1),%esi # Base of frame + movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer + movl -0x14(%esi),%eax # Get Int no + cmpl $-1,%eax # Hardware interrupt? + jne intusr.1 # Yes +/* + * v86 calls save the btx_v86 pointer on the real mode stack and read + * the address and flags from the btx_v86 structure. For interrupt + * handler invocations (VM86 INTx requests), disable interrupts, + * tracing, and alignment checking while the handler runs. + */ movl $MEM_USR,%ebx # User base movl %ebx,%edx # address - jc intusr.1 # If btx_v86 - xorl %edx,%edx # Control flags - xorl %ebp,%ebp # btx_v86 pointer -intusr.1: leal 0x50(%esp,1),%esi # Base of frame - pushl %esi # Save addl -0x4(%esi),%ebx # User ESP - movl MEM_TSS+TSS_ESP1,%edi # Link stack pointer - leal -0x4(%edi),%edi # Adjust for push - xorl %ecx,%ecx # Zero - movb $0x5,%cl # Push exception - rep # frame on - movsl # link stack - xchgl %eax,%esi # Saved seg regs - movl 0x40(%esp,1),%eax # Get int no - testl %edx,%edx # Have btx_v86? - jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer - movb $0x4,%cl # Count - addl %ecx,%ebx # Adjust for pop - rep # Push saved seg regs - movsl # on link stack addl %ebp,%edx # Flatten btx_v86 ptr - leal 0x14(%edx),%esi # Seg regs pointer - movl 0x4(%edx),%eax # Get int no/address - movzwl 0x2(%edx),%edx # Get control flags -intusr.2: movl %ebp,(%edi) # Push btx_v86 and - movl %edi,MEM_TSS+TSS_ESP1 # save link stack ptr - popl %edi # Base of frame - xchgl %eax,%ebp # Save intno/address - movl 0x48(%esp,1),%eax # Get flags - testb $0x2,%dl # Simulate CALLF? - jnz intusr.3 # Yes - decl %ebx # Push flags - decl %ebx # on V86 - movw %ax,(%ebx) # stack -intusr.3: movb $0x4,%cl # Count - subl %ecx,%ebx # Push return address - movl $inthlt,(%ebx) # on V86 stack - rep # Copy seg regs to - movsl # exception frame - xchgl %eax,%ecx # Save flags - movl %ebx,%eax # User ESP - subl $V86_STK,%eax # Less bytes - ja intusr.4 # to - xorl %eax,%eax # keep -intusr.4: shrl $0x4,%eax # Gives segment - stosl # Set SS - shll $0x4,%eax # To bytes - xchgl %eax,%ebx # Swap - subl %ebx,%eax # Gives offset - stosl # Set ESP - xchgl %eax,%ecx # Get flags - btsl $0x11,%eax # Set VM - andb $~0x1,%ah # Clear TF - stosl # Set EFL - xchgl %eax,%ebp # Get int no/address - testb $0x1,%dl # Address? - jnz intusr.5 # Yes - shll $0x2,%eax # Scale + movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr + movl V86_ADDR(%edx),%eax # Get int no/address + movl V86_CTL(%edx),%edx # Get control flags + movl -0x08(%esi),%ebx # Save user flags in %ebx + testl $V86F_ADDR,%edx # Segment:offset? + jnz intusr.4 # Yes + andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing, + # and alignment checking for + # interrupt handler + jmp intusr.3 # Skip hardware interrupt +/* + * Hardware interrupts store a NULL btx_v86 pointer and use the + * address (interrupt number) from the stack with empty flags. Also, + * push a dummy frame of zeros onto the stack for all the general + * purpose and segment registers and clear %eflags. This gives the + * hardware interrupt handler a clean slate. + */ +intusr.1: xorl %edx,%edx # Control flags + movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr + movl $12,%ecx # Frame is 12 dwords +intusr.2: pushl $0x0 # Fill frame + loop intusr.2 # with zeros + movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags +/* + * Look up real mode IDT entry for hardware interrupts and VM86 INTx + * requests. + */ +intusr.3: shll $0x2,%eax # Scale movl (%eax),%eax # Load int vector -intusr.5: movl %eax,%ecx # Save - shrl $0x10,%eax # Gives segment - stosl # Set CS - movw %cx,%ax # Restore - stosl # Set EIP - leal 0x10(%esp,1),%esp # Discard seg regs - popa # Restore - iret # To V86 mode + jmp intusr.5 # Skip CALLF test +/* + * Panic if V86F_CALLF isn't set with V86F_ADDR. + */ +intusr.4: testl $V86F_CALLF,%edx # Far call? + jnz intusr.5 # Ok + movl %edx,0x30(%esp,1) # Place VM86 flags in int no + movl $badvm86,%esi # Display bad + call putstr # VM86 call + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + jmp ex_noc # Panic +/* + * %eax now holds the segment:offset of the function. + * %ebx now holds the %eflags to pass to real mode. + * %edx now holds the V86F_* flags. + */ +intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode + # target +/* + * If this is a v86 call, copy the seg regs out of the btx_v86 structure. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + jecxz intusr.6 # Skip for hardware ints + leal -0x44(%esi),%edi # %edi => kernel stack seg regs + pushl %esi # Save + leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs + movl $4,%ecx # Copy seg regs + rep # from btx_v86 + movsl # to kernel stack + popl %esi # Restore +intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real + movl %ebx,MEM_ESPR-0x0c # mode return trampoline + movl $rret_tramp,%ebx # Set return trampoline + movl %ebx,MEM_ESPR-0x10 # CS:IP + movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP + ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment + .code16 +intusr.7: movl %cr0,%eax # Leave + dec %al # protected + movl %eax,%cr0 # mode + ljmpw $0x0,$intusr.8 +intusr.8: xorw %ax,%ax # Reset %ds + movw %ax,%ds # and + movw %ax,%ss # %ss + lidt ivtdesc # Set IVT + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + movw $MEM_ESPR-0x16,%sp # Switch to real mode stack + iret # Call target routine +/* + * For the return to real mode we setup a stack frame like this on the real + * mode stack. Note that callf calls won't pop off the flags, but we just + * ignore that by repositioning %sp to be just above the btx_v86 pointer + * so it is aligned. The stack is relative to MEM_ESPR. + * + * -0x04 kernel %esp + * -0x08 btx_v86 + * -0x0c %eax + * -0x10 %ecx + * -0x14 %edx + * -0x18 %ebx + * -0x1c %esp + * -0x20 %ebp + * -0x24 %esi + * -0x28 %edi + * -0x2c %gs + * -0x30 %fs + * -0x34 %ds + * -0x38 %es + * -0x3c %eflags + */ +rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer + pushal # Save gp regs + pushl %gs # Save + pushl %fs # seg + pushl %ds # regs + pushl %es + pushfl # Save %eflags + cli # Disable interrupts + std # String ops dec + xorw %ax,%ax # Reset seg + movw %ax,%ds # regs + movw %ax,%es # (%ss is already 0) + lidt idtdesc # Set IDT + lgdt gdtdesc # Set GDT + mov %cr0,%eax # Switch to protected + inc %ax # mode + mov %eax,%cr0 # + ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code + .code32 +rret_tramp.1: xorl %ecx,%ecx # Zero + movb $SEL_SDATA,%cl # Setup + movw %cx,%ss # 32-bit + movw %cx,%ds # seg + movw %cx,%es # regs + movl MEM_ESPR-0x04,%esp # Switch to kernel stack + leal 0x44(%esp,1),%esi # Base of frame + andb $~0x2,tss_desc+0x5 # Clear TSS busy + movb $SEL_TSS,%cl # Set task + ltr %cx # register +/* + * Now we are back in protected mode. The kernel stack frame set up + * before entering real mode is still intact. For hardware interrupts, + * leave the frame unchanged. + */ + cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged + jz rret_tramp.3 # for hardware ints +/* + * For V86 calls, copy the registers off of the real mode stack onto + * the kernel stack as we want their updated values. Also, initialize + * the segment registers on the kernel stack. + * + * Note that the %esp in the kernel stack after this is garbage, but popa + * ignores it, so we don't have to fix it up. + */ + leal -0x18(%esi),%edi # Kernel stack GP regs + pushl %esi # Save + movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs + movl $8,%ecx # Copy GP regs from + rep # real mode stack + movsl # to kernel stack + movl $SEL_UDATA,%eax # Selector for data seg regs + movl $4,%ecx # Initialize %ds, + rep # %es, %fs, and + stosl # %gs +/* + * For V86 calls, copy the saved seg regs on the real mode stack back + * over to the btx_v86 structure. Also, conditionally update the + * saved eflags on the kernel stack based on the flags from the user. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs + leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs + xchgl %ecx,%edx # Save btx_v86 ptr + movl $4,%ecx # Copy seg regs + rep # from real mode stack + movsl # to btx_v86 + popl %esi # Restore + movl V86_CTL(%edx),%edx # Read V86 control flags + testl $V86F_FLAGS,%edx # User wants flags? + jz rret_tramp.3 # No + movl MEM_ESPR-0x3c,%eax # Read real mode flags + movw %ax,-0x08(%esi) # Update user flags (low 16) +/* + * Return to the user task + */ +rret_tramp.3: popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + addl $4,%esp # Discard int no + iret # Return to user mode + /* * System Call. */ @@ -869,7 +760,7 @@ dump.1: testb $DMP_X32,%ch # Dump long dump.2: testb $DMP_MEM,%ch # Dump memory? jz dump.8 # No pushl %ds # Save - testb $0x2,0x52(%ebx) # V86 mode? + testl $PSL_VM,0x50(%ebx) # V86 mode? jnz dump.3 # Yes verr 0x4(%esi) # Readable selector? jnz dump.3 # No @@ -1060,6 +951,61 @@ putchr.4: movw %dx,(%ebx) # Update pos ret # To caller #endif + .code16 +/* + * Real Mode Hardware interrupt jump table. + */ +intr20: push $0x8 # Int 0x20: IRQ0 + jmp int_hwr # V86 int 0x8 + push $0x9 # Int 0x21: IRQ1 + jmp int_hwr # V86 int 0x9 + push $0xa # Int 0x22: IRQ2 + jmp int_hwr # V86 int 0xa + push $0xb # Int 0x23: IRQ3 + jmp int_hwr # V86 int 0xb + push $0xc # Int 0x24: IRQ4 + jmp int_hwr # V86 int 0xc + push $0xd # Int 0x25: IRQ5 + jmp int_hwr # V86 int 0xd + push $0xe # Int 0x26: IRQ6 + jmp int_hwr # V86 int 0xe + push $0xf # Int 0x27: IRQ7 + jmp int_hwr # V86 int 0xf + push $0x10 # Int 0x28: IRQ8 + jmp int_hwr # V86 int 0x10 + push $0x11 # Int 0x29: IRQ9 + jmp int_hwr # V86 int 0x11 + push $0x12 # Int 0x2a: IRQ10 + jmp int_hwr # V86 int 0x12 + push $0x13 # Int 0x2b: IRQ11 + jmp int_hwr # V86 int 0x13 + push $0x14 # Int 0x2c: IRQ12 + jmp int_hwr # V86 int 0x14 + push $0x15 # Int 0x2d: IRQ13 + jmp int_hwr # V86 int 0x15 + push $0x16 # Int 0x2e: IRQ14 + jmp int_hwr # V86 int 0x16 + push $0x17 # Int 0x2f: IRQ15 + jmp int_hwr # V86 int 0x17 +/* + * Reflect hardware interrupts in real mode. + */ +int_hwr: push %ax # Save + push %ds # Save + push %bp # Save + mov %sp,%bp # Address stack frame + xchg %bx,6(%bp) # Swap BX, int no + xor %ax,%ax # Set %ds:%bx to + shl $2,%bx # point to + mov %ax,%ds # IDT entry + mov (%bx),%ax # Load IP + mov 2(%bx),%bx # Load CS + xchg %ax,4(%bp) # Swap saved %ax,%bx with + xchg %bx,6(%bp) # CS:IP of handler + pop %bp # Restore + pop %ds # Restore + lret # Jump to handler + .p2align 4 /* * Global descriptor table. @@ -1071,7 +1017,7 @@ gdt: .word 0x0,0x0,0x0,0x0 # Null entr .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA .word 0xffff,MEM_USR,0xfa00,0xcf# SEL_UCODE .word 0xffff,MEM_USR,0xf200,0xcf# SEL_UDATA - .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS +tss_desc: .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS gdt.1: /* * Pseudo-descriptors. @@ -1140,6 +1086,11 @@ dmpfmt: .byte '\n' # "\n" .byte 0x80|DMP_MEM|DMP_EOL,0x0 # "00 00 ... 00 00\n" .asciz "BTX halted\n" # End /* + * Bad VM86 call panic + */ +badvm86: .asciz "Invalid VM86 Request\n" + +/* * End of BTX memory. */ .p2align 4 From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 05:00:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10A3106566B; Sat, 19 Dec 2009 05:00:09 +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 9D3AC8FC0A; Sat, 19 Dec 2009 05:00: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 nBJ509r6020408; Sat, 19 Dec 2009 05:00:09 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ509tm020405; Sat, 19 Dec 2009 05:00:09 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190500.nBJ509tm020405@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 05:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200706 - stable/7/sys/boot/pc98/btx/btx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:00:10 -0000 Author: nyan Date: Sat Dec 19 05:00:09 2009 New Revision: 200706 URL: http://svn.freebsd.org/changeset/base/200706 Log: MFC: r176645 and r200254 - Retire the support for using paging in BTX. - Use real mode instead of v86 mode. Modified: stable/7/sys/boot/pc98/btx/btx/Makefile stable/7/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- stable/7/sys/boot/pc98/btx/btx/Makefile Sat Dec 19 04:43:25 2009 (r200705) +++ stable/7/sys/boot/pc98/btx/btx/Makefile Sat Dec 19 05:00:09 2009 (r200706) @@ -5,10 +5,6 @@ INTERNALPROG= NO_MAN= SRCS= btx.S -.if defined(PAGING) -CFLAGS+=-DPAGING -.endif - .if defined(BOOT_BTX_NOHANG) BOOT_BTX_FLAGS=0x1 .else Modified: stable/7/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/7/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 04:43:25 2009 (r200705) +++ stable/7/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 05:00:09 2009 (r200706) @@ -21,12 +21,11 @@ .set MEM_BTX,0x1000 # Start of BTX memory .set MEM_ESP0,0x1800 # Supervisor stack .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_DIR,0x4000 # Page directory - .set MEM_TBL,0x5000 # Page tables + .set MEM_ESPR,0x5e00 # Real mode stack + .set MEM_IDT,0x5e00 # IDT + .set MEM_TSS,0x5f98 # TSS + .set MEM_MAP,0x6000 # I/O bit map + .set MEM_TSS_END,0x7fff # End of TSS .set MEM_ORG,0x9000 # BTX code .set MEM_USR,0xa000 # Start of user memory /* @@ -35,6 +34,14 @@ .set PAG_SIZ,0x1000 # Page size .set PAG_CNT,0x1000 # Pages to map /* + * Fields in %eflags. + */ + .set PSL_RESERVED_DEFAULT,0x00000002 + .set PSL_T,0x00000100 # Trap flag + .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_VM,0x00020000 # Virtual 8086 mode flag + .set PSL_AC,0x00040000 # Alignment check flag +/* * Segment selectors. */ .set SEL_SCODE,0x8 # Supervisor code @@ -49,7 +56,6 @@ */ .set TSS_ESP0,0x4 # PL 0 ESP .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP .set TSS_MAP,0x66 # I/O bit map base /* * System calls. @@ -57,10 +63,20 @@ .set SYS_EXIT,0x0 # Exit .set SYS_EXEC,0x1 # Exec /* - * V86 constants. + * Fields in V86 interface structure. */ - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS +/* + * V86 control flags. + */ + .set V86F_ADDR,0x10000 # Segment:offset address + .set V86F_CALLF,0x20000 # Emulate far call + .set V86F_FLAGS,0x40000 # Return flags /* * Dump format control bytes. */ @@ -78,15 +94,13 @@ * BIOS Data Area locations. */ .set BDA_MEM,0x501 # Free memory - .set BDA_KEYFLAGS,0x53a # Keyboard shift-state flags .set BDA_POS,0x53e # Cursor position /* * Derivations, for brevity. */ .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base - .set _TSSLM,MEM_DIR-MEM_TSS-1 # TSS limit + .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit /* * Code segment. @@ -101,7 +115,7 @@ btx_hdr: .byte 0xeb # Machine ID .byte 0xe # Header size .ascii "BTX" # Magic .byte 0x1 # Major version - .byte 0x1 # Minor version + .byte 0x2 # Minor version .byte BTX_FLAGS # Flags .word PAG_CNT-MEM_ORG>>0xc # Paging control .word break-start # Text size @@ -122,13 +136,24 @@ init: cli # Disable interrupts */ mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero - push %di # Save rep # Zero-fill stosw # memory - pop %di # Restore +/* + * Update real mode IDT for reflecting hardware interrupts. + */ + mov $intr20,%bx # Address first handler + mov $0x10,%cx # Number of handlers + mov $0x20*4,%di # First real mode IDT entry +init.0: mov %bx,(%di) # Store IP + inc %di # Address next + inc %di # entry + stosw # Store CS + add $4,%bx # Next handler + loop init.0 # Next IRQ /* * Create IDT. */ + mov $MEM_IDT,%di mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -154,60 +179,16 @@ init.3: lea 0x8(%di),%di # Next entry */ init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 - movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base -#ifdef PAGING -/* - * Create page directory. - */ - xor %edx,%edx # Page - mov $PAG_SIZ>>0x8,%dh # size - xor %eax,%eax # Zero - mov $MEM_DIR,%di # Page directory - mov $PAG_CNT>>0xa,%cl # Entries - mov $MEM_TBL|0x7,%ax # First entry -init.5: stosl # Write entry - add %dx,%ax # To next - loop init.5 # Till done -/* - * Create page tables. - */ - mov $MEM_TBL,%di # Page table - mov $PAG_CNT>>0x8,%ch # Entries - xor %ax,%ax # Start address -init.6: mov $0x7,%al # Set U:W:P flags - cmp btx_hdr+0x8,%cx # Standard user page? - jb init.7 # Yes - cmp $PAG_CNT-MEM_BTX>>0xc,%cx # BTX memory? - jae init.7 # No or first page - and $~0x2,%al # Clear W flag - cmp $PAG_CNT-MEM_USR>>0xc,%cx # User page zero? - jne init.7 # No - testb $0x80,btx_hdr+0x7 # Unmap it? - jz init.7 # No - and $~0x1,%al # Clear P flag -init.7: stosl # Set entry - add %edx,%eax # Next address - loop init.6 # Till done -#endif /* * Bring up the system. */ mov $0x2820,%bx # Set protected mode callw setpic # IRQ offsets lidt idtdesc # Set IDT -#ifdef PAGING - xor %eax,%eax # Set base - mov $MEM_DIR>>0x8,%ah # of page - mov %eax,%cr3 # directory -#endif lgdt gdtdesc # Set GDT mov %cr0,%eax # Switch to protected -#ifdef PAGING - or $0x80000001,%eax # mode and enable paging -#else inc %ax # mode -#endif mov %eax,%cr0 # ljmp $SEL_SCODE,$init.8 # To 32-bit code .code32 @@ -297,8 +278,8 @@ exit.2: xor %ax,%ax # Real mode segme exit.3: jz exit.3 # No movb $0xa0,%al outb %al,$0x35 - movb 0,%al - outb %al,$0xf0 + movb $0x00,%al + outb %al,$0xf0 # reboot the machine exit.4: jmp exit.4 /* * Set IRQ offsets by reprogramming 8259A PICs. @@ -329,10 +310,6 @@ setpic: in $0x02,%al # Save master retw # To caller .code32 /* - * Initiate return from V86 mode to user mode. - */ -inthlt: hlt # To supervisor mode -/* * Exception jump table. */ intx00: push $0x0 # Int 0x0: #DE @@ -358,18 +335,12 @@ intx00: push $0x0 # Int 0x0: #DE push $0xc # Int 0xc: #SS jmp except # Stack segment fault push $0xd # Int 0xd: #GP - jmp ex_v86 # General protection + jmp except # General protection push $0xe # Int 0xe: #PF jmp except # Page fault intx10: push $0x10 # Int 0x10: #MF jmp ex_noc # Floating-point error /* - * Handle #GP exception. - */ -ex_v86: testb $0x2,0x12(%esp,1) # V86 mode? - jz except # No - jmp v86mon # To monitor -/* * Save a zero error code. */ ex_noc: pushl (%esp,1) # Duplicate int no @@ -381,24 +352,17 @@ except: cld # String ops inc pushl %ds # Save pushl %es # most pusha # registers - movb $0x6,%al # Push loop count - testb $0x2,0x3a(%esp,1) # V86 mode? - jnz except.1 # Yes pushl %gs # Set GS pushl %fs # Set FS pushl %ds # Set DS pushl %es # Set ES - movb $0x2,%al # Push loop count cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode? jne except.1 # No pushl %ss # Set SS - leal 0x50(%esp,1),%eax # Set - pushl %eax # ESP jmp except.2 # Join common code -except.1: pushl 0x50(%esp,1) # Set GS, FS, DS, ES - decb %al # (if V86 mode), and - jne except.1 # SS, ESP -except.2: push $SEL_SDATA # Set up +except.1: pushl 0x50(%esp,1) # Set SS +except.2: pushl 0x50(%esp,1) # Set ESP + push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data @@ -407,14 +371,12 @@ except.2: push $SEL_SDATA # Set up movl $MEM_BUF,%edi # Buffer pushl %eax pushl %edx -wait.1: - inb $0x60,%al +wait.1: inb $0x60,%al testb $0x04,%al jz wait.1 movb $0xe0,%al outb %al,$0x62 -wait.2: - inb $0x60,%al +wait.2: inb $0x60,%al testb $0x01,%al jz wait.2 xorl %edx,%edx @@ -443,237 +405,11 @@ wait.2: je except.3 # Yes cmpb $0x1,(%esp,1) # Debug? jne except.2a # No - testl $0x100,0x10(%esp,1) # Trap flag set? + testl $PSL_T,0x10(%esp,1) # Trap flag set? jnz except.3 # Yes except.2a: jmp exit # Exit except.3: leal 0x8(%esp,1),%esp # Discard err, int no iret # From interrupt -/* - * Return to user mode from V86 mode. - */ -intrtn: cld # String ops inc - pushl %ds # Address - popl %es # data - leal 0x3c(%ebp),%edx # V86 Segment registers - movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer - lodsl # INT_V86 args pointer - movl %esi,%ebx # Saved exception frame - testl %eax,%eax # INT_V86 args? - jz intrtn.2 # No - movl $MEM_USR,%edi # User base - movl 0x1c(%esi),%ebx # User ESP - movl %eax,(%edi,%ebx,1) # Restore to user stack - leal 0x8(%edi,%eax,1),%edi # Arg segment registers - testb $0x4,-0x6(%edi) # Return flags? - jz intrtn.1 # No - movl 0x30(%ebp),%eax # Get V86 flags - movw %ax,0x18(%esi) # Set user flags -intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame - xchgl %edx,%esi # Segment registers - movb $0x4,%cl # Update seg regs - rep # in INT_V86 - movsl # args -intrtn.2: xchgl %edx,%esi # Segment registers - leal 0x28(%ebp),%edi # Set up seg - movb $0x4,%cl # regs for - rep # later - movsl # pop - xchgl %ebx,%esi # Restore exception - movb $0x5,%cl # frame to - rep # supervisor - movsl # stack - movl %esi,MEM_TSS+TSS_ESP1 # Link stack pointer - popa # Restore - leal 0x8(%esp,1),%esp # Discard err, int no - popl %es # Restore - popl %ds # user - popl %fs # segment - popl %gs # registers - iret # To user mode -/* - * V86 monitor. - */ -v86mon: cld # String ops inc - pushl $SEL_SDATA # Set up for - popl %ds # flat addressing - pusha # Save registers - movl %esp,%ebp # Address stack frame - movzwl 0x2c(%ebp),%edi # Load V86 CS - shll $0x4,%edi # To linear - movl 0x28(%ebp),%esi # Load V86 IP - addl %edi,%esi # Code pointer - xorl %ecx,%ecx # Zero - movb $0x2,%cl # 16-bit operands - xorl %eax,%eax # Zero -v86mon.1: lodsb # Get opcode - cmpb $0x66,%al # Operand size prefix? - jne v86mon.2 # No - movb $0x4,%cl # 32-bit operands - jmp v86mon.1 # Continue -v86mon.2: cmpb $0xf4,%al # HLT? - jne v86mon.3 # No - cmpl $inthlt+0x1,%esi # Is inthlt? - jne v86mon.7 # No (ignore) - jmp intrtn # Return to user mode -v86mon.3: cmpb $0xf,%al # Prefixed instruction? - jne v86mon.4 # No - cmpb $0x09,(%esi) # Is it a WBINVD? - je v86wbinvd # Yes - cmpb $0x30,(%esi) # Is it a WRMSR? - je v86wrmsr # Yes - cmpb $0x32,(%esi) # Is it a RDMSR? - je v86rdmsr # Yes - cmpb $0x20,(%esi) # Is this a MOV reg,CRx? - je v86mov # Yes -v86mon.4: cmpb $0xfa,%al # CLI? - je v86cli # Yes - cmpb $0xfb,%al # STI? - je v86sti # Yes - movzwl 0x38(%ebp),%ebx # Load V86 SS - shll $0x4,%ebx # To offset - pushl %ebx # Save - addl 0x34(%ebp),%ebx # Add V86 SP - movl 0x30(%ebp),%edx # Load V86 flags - cmpb $0x9c,%al # PUSHF/PUSHFD? - je v86pushf # Yes - cmpb $0x9d,%al # POPF/POPFD? - je v86popf # Yes - cmpb $0xcd,%al # INT imm8? - je v86intn # Yes - cmpb $0xcf,%al # IRET/IRETD? - je v86iret # Yes - popl %ebx # Restore - popa # Restore - jmp except # Handle exception -v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags -v86mon.6: popl %edx # V86 SS adjustment - subl %edx,%ebx # Save V86 - movl %ebx,0x34(%ebp) # SP -v86mon.7: subl %edi,%esi # From linear - movl %esi,0x28(%ebp) # Save V86 IP - popa # Restore - leal 0x8(%esp,1),%esp # Discard int no, error - iret # To V86 mode -/* - * Emulate MOV reg,CRx. - */ -v86mov: movb 0x1(%esi),%bl # Fetch Mod R/M byte - testb $0x10,%bl # Read CR2 or CR3? - jnz v86mov.1 # Yes - movl %cr0,%eax # Read CR0 - testb $0x20,%bl # Read CR4 instead? - jz v86mov.2 # No - movl %cr4,%eax # Read CR4 - jmp v86mov.2 -v86mov.1: movl %cr2,%eax # Read CR2 - testb $0x08,%bl # Read CR3 instead? - jz v86mov.2 # No - movl %cr3,%eax # Read CR3 -v86mov.2: andl $0x7,%ebx # Compute offset in - shl $2,%ebx # frame of destination - neg %ebx # register - movl %eax,0x1c(%ebp,%ebx,1) # Store CR to reg - incl %esi # Adjust IP -/* - * Return from emulating a 0x0f prefixed instruction - */ -v86preret: incl %esi # Adjust IP - jmp v86mon.7 # Finish up -/* - * Emulate WBINVD - */ -v86wbinvd: wbinvd # Write back and invalidate - # cache - jmp v86preret # Finish up -/* - * Emulate WRMSR - */ -v86wrmsr: movl 0x18(%ebp),%ecx # Get user's %ecx (MSR to write) - movl 0x14(%ebp),%edx # Load the value - movl 0x1c(%ebp),%eax # to write - wrmsr # Write MSR - jmp v86preret # Finish up -/* - * Emulate RDMSR - */ -v86rdmsr: movl 0x18(%ebp),%ecx # MSR to read - rdmsr # Read the MSR - movl %eax,0x1c(%ebp) # Return the value of - movl %edx,0x14(%ebp) # the MSR to the user - jmp v86preret # Finish up -/* - * Emulate CLI. - */ -v86cli: andb $~0x2,0x31(%ebp) # Clear IF - jmp v86mon.7 # Finish up -/* - * Emulate STI. - */ -v86sti: orb $0x2,0x31(%ebp) # Set IF - jmp v86mon.7 # Finish up -/* - * Emulate PUSHF/PUSHFD. - */ -v86pushf: subl %ecx,%ebx # Adjust SP - cmpb $0x4,%cl # 32-bit - je v86pushf.1 # Yes - data16 # 16-bit -v86pushf.1: movl %edx,(%ebx) # Save flags - jmp v86mon.6 # Finish up -/* - * Emulate IRET/IRETD. - */ -v86iret: movzwl (%ebx),%esi # Load V86 IP - movzwl 0x2(%ebx),%edi # Load V86 CS - leal 0x4(%ebx),%ebx # Adjust SP - movl %edi,0x2c(%ebp) # Save V86 CS - xorl %edi,%edi # No ESI adjustment -/* - * Emulate POPF/POPFD (and remainder of IRET/IRETD). - */ -v86popf: cmpb $0x4,%cl # 32-bit? - je v86popf.1 # Yes - movl %edx,%eax # Initialize - data16 # 16-bit -v86popf.1: movl (%ebx),%eax # Load flags - addl %ecx,%ebx # Adjust SP - andl $V86_FLG,%eax # Merge - andl $~V86_FLG,%edx # the - orl %eax,%edx # flags - jmp v86mon.5 # Finish up -/* - * trap int 15, function 87 - * reads %es:%si from saved registers on stack to find a GDT containing - * source and destination locations - * reads count of words from saved %cx - * returns success by setting %ah to 0 - */ -int15_87: pushl %esi # Save - pushl %edi # registers - movl 0x3C(%ebp),%edi # Load ES - movzwl 0x4(%ebp),%eax # Load user's SI - shll $0x4,%edi # EDI = (ES << 4) + - addl %eax,%edi # SI - movl 0x11(%edi),%eax # Read base of - movb 0x17(%edi),%al # GDT entry - ror $8,%eax # for source - xchgl %eax,%esi # into %esi - movl 0x19(%edi),%eax # Read base of - movb 0x1f(%edi),%al # GDT entry for - ror $8,%eax # destination - xchgl %eax,%edi # into %edi - pushl %ds # Make: - popl %es # es = ds - movzwl 0x18(%ebp),%ecx # Get user's CX - shll $0x1,%ecx # Convert count from words - rep # repeat... - movsb # perform copy. - popl %edi # Restore - popl %esi # registers - movb $0x0,0x1d(%ebp) # set ah = 0 to indicate - # success - andb $0xfe,%dl # clear CF - jmp v86mon.5 # Finish up /* * Reboot the machine by setting the reboot flag and exiting @@ -682,36 +418,7 @@ reboot: orb $0x1,btx_hdr+0x7 # Set the jmp exit # Terminate BTX and reboot /* - * Emulate INT imm8... also make sure to check if it's int 15/87 - */ -v86intn: lodsb # Get int no - cmpb $0x19,%al # is it int 19? - je reboot # yes, reboot the machine - cmpb $0x15,%al # is it int 15? - jne v86intn.1 # no, skip parse - cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction? - je int15_87 # yes - cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout? - jne v86intn.1 # no, handle the int normally - movb BDA_KEYFLAGS,%ch # get the shift key state - andb $0x18,%ch # mask off just Ctrl and Alt - cmpb $0x18,%ch # are both Ctrl and Alt down? - je reboot # yes, reboot the machine -v86intn.1: subl %edi,%esi # From - shrl $0x4,%edi # linear - movw %dx,-0x2(%ebx) # Save flags - movw %di,-0x4(%ebx) # Save CS - leal -0x6(%ebx),%ebx # Adjust SP - movw %si,(%ebx) # Save IP - shll $0x2,%eax # Scale - movzwl (%eax),%esi # Load IP - movzwl 0x2(%eax),%edi # Load CS - movl %edi,0x2c(%ebp) # Save CS - xorl %edi,%edi # No ESI adjustment - andb $~0x1,%dh # Clear TF - jmp v86mon.5 # Finish up -/* - * Hardware interrupt jump table. + * Protected Mode Hardware interrupt jump table. */ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x8 @@ -745,127 +452,267 @@ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x16 push $0x17 # Int 0x2f: IRQ15 jmp int_hw # V86 int 0x17 + +/* + * Invoke real mode interrupt/function call from user mode with arguments. + */ +intx31: pushl $-1 # Dummy int no for btx_v86 /* - * Reflect hardware interrupts. + * Invoke real mode interrupt/function call from protected mode. + * + * We place a trampoline on the user stack that will return to rret_tramp + * which will reenter protected mode and then finally return to the user + * client. + * + * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR: + * + * -0x00 user %ss -0x04 kernel %esp (with full frame) + * -0x04 user %esp -0x08 btx_v86 pointer + * -0x08 user %eflags -0x0c flags (only used if interrupt) + * -0x0c user %cs -0x10 real mode CS:IP return trampoline + * -0x10 user %eip -0x12 real mode flags + * -0x14 int no -0x16 real mode CS:IP (target) + * -0x18 %eax + * -0x1c %ecx + * -0x20 %edx + * -0x24 %ebx + * -0x28 %esp + * -0x2c %ebp + * -0x30 %esi + * -0x34 %edi + * -0x38 %gs + * -0x3c %fs + * -0x40 %ds + * -0x44 %es + * -0x48 zero %eax (hardware int only) + * -0x4c zero %ecx (hardware int only) + * -0x50 zero %edx (hardware int only) + * -0x54 zero %ebx (hardware int only) + * -0x58 zero %esp (hardware int only) + * -0x5c zero %ebp (hardware int only) + * -0x60 zero %esi (hardware int only) + * -0x64 zero %edi (hardware int only) + * -0x68 zero %gs (hardware int only) + * -0x6c zero %fs (hardware int only) + * -0x70 zero %ds (hardware int only) + * -0x74 zero %es (hardware int only) */ -int_hw: testb $0x2,0xe(%esp,1) # V86 mode? - jz intusr # No - pushl $SEL_SDATA # Address - popl %ds # data - xchgl %eax,(%esp,1) # Swap EAX, int no - pushl %ebp # Address - movl %esp,%ebp # stack frame - pushl %ebx # Save - shll $0x2,%eax # Get int - movl (%eax),%eax # vector - subl $0x6,0x14(%ebp) # Adjust V86 ESP - movzwl 0x18(%ebp),%ebx # V86 SS - shll $0x4,%ebx # * 0x10 - addl 0x14(%ebp),%ebx # + V86 ESP - xchgw %ax,0x8(%ebp) # Swap V86 IP - rorl $0x10,%eax # Swap words - xchgw %ax,0xc(%ebp) # Swap V86 CS - roll $0x10,%eax # Swap words - movl %eax,(%ebx) # CS:IP for IRET - movl 0x10(%ebp),%eax # V86 flags - movw %ax,0x4(%ebx) # Flags for IRET - andb $~0x3,0x11(%ebp) # Clear IF, TF - popl %ebx # Restore - popl %ebp # saved - popl %eax # registers - iret # To V86 mode -/* - * Invoke V86 interrupt from user mode, with arguments. - */ -intx31: stc # Have btx_v86 - pushl %eax # Missing int no -/* - * Invoke V86 interrupt from user mode. - */ -intusr: std # String ops dec - pushl %eax # Expand - pushl %eax # stack - pushl %eax # frame - pusha # Save +int_hw: cld # String ops inc + pusha # Save gp regs pushl %gs # Save - movl %esp,%eax # seg regs - pushl %fs # and - pushl %ds # point - pushl %es # to them + pushl %fs # seg + pushl %ds # regs + pushl %es push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data + leal 0x44(%esp,1),%esi # Base of frame + movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer + movl -0x14(%esi),%eax # Get Int no + cmpl $-1,%eax # Hardware interrupt? + jne intusr.1 # Yes +/* + * v86 calls save the btx_v86 pointer on the real mode stack and read + * the address and flags from the btx_v86 structure. For interrupt + * handler invocations (VM86 INTx requests), disable interrupts, + * tracing, and alignment checking while the handler runs. + */ movl $MEM_USR,%ebx # User base movl %ebx,%edx # address - jc intusr.1 # If btx_v86 - xorl %edx,%edx # Control flags - xorl %ebp,%ebp # btx_v86 pointer -intusr.1: leal 0x50(%esp,1),%esi # Base of frame - pushl %esi # Save addl -0x4(%esi),%ebx # User ESP - movl MEM_TSS+TSS_ESP1,%edi # Link stack pointer - leal -0x4(%edi),%edi # Adjust for push - xorl %ecx,%ecx # Zero - movb $0x5,%cl # Push exception - rep # frame on - movsl # link stack - xchgl %eax,%esi # Saved seg regs - movl 0x40(%esp,1),%eax # Get int no - testl %edx,%edx # Have btx_v86? - jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer - movb $0x4,%cl # Count - addl %ecx,%ebx # Adjust for pop - rep # Push saved seg regs - movsl # on link stack addl %ebp,%edx # Flatten btx_v86 ptr - leal 0x14(%edx),%esi # Seg regs pointer - movl 0x4(%edx),%eax # Get int no/address - movzwl 0x2(%edx),%edx # Get control flags -intusr.2: movl %ebp,(%edi) # Push btx_v86 and - movl %edi,MEM_TSS+TSS_ESP1 # save link stack ptr - popl %edi # Base of frame - xchgl %eax,%ebp # Save intno/address - movl 0x48(%esp,1),%eax # Get flags - testb $0x2,%dl # Simulate CALLF? - jnz intusr.3 # Yes - decl %ebx # Push flags - decl %ebx # on V86 - movw %ax,(%ebx) # stack -intusr.3: movb $0x4,%cl # Count - subl %ecx,%ebx # Push return address - movl $inthlt,(%ebx) # on V86 stack - rep # Copy seg regs to - movsl # exception frame - xchgl %eax,%ecx # Save flags - movl %ebx,%eax # User ESP - subl $V86_STK,%eax # Less bytes - ja intusr.4 # to - xorl %eax,%eax # keep -intusr.4: shrl $0x4,%eax # Gives segment - stosl # Set SS - shll $0x4,%eax # To bytes - xchgl %eax,%ebx # Swap - subl %ebx,%eax # Gives offset - stosl # Set ESP - xchgl %eax,%ecx # Get flags - btsl $0x11,%eax # Set VM - andb $~0x1,%ah # Clear TF - stosl # Set EFL - xchgl %eax,%ebp # Get int no/address - testb $0x1,%dl # Address? - jnz intusr.5 # Yes - shll $0x2,%eax # Scale + movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr + movl V86_ADDR(%edx),%eax # Get int no/address + movl V86_CTL(%edx),%edx # Get control flags + movl -0x08(%esi),%ebx # Save user flags in %ebx + testl $V86F_ADDR,%edx # Segment:offset? + jnz intusr.4 # Yes + andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing, + # and alignment checking for + # interrupt handler + jmp intusr.3 # Skip hardware interrupt +/* + * Hardware interrupts store a NULL btx_v86 pointer and use the + * address (interrupt number) from the stack with empty flags. Also, + * push a dummy frame of zeros onto the stack for all the general + * purpose and segment registers and clear %eflags. This gives the + * hardware interrupt handler a clean slate. + */ +intusr.1: xorl %edx,%edx # Control flags + movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr + movl $12,%ecx # Frame is 12 dwords +intusr.2: pushl $0x0 # Fill frame + loop intusr.2 # with zeros + movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags +/* + * Look up real mode IDT entry for hardware interrupts and VM86 INTx + * requests. + */ +intusr.3: shll $0x2,%eax # Scale movl (%eax),%eax # Load int vector -intusr.5: movl %eax,%ecx # Save - shrl $0x10,%eax # Gives segment - stosl # Set CS - movw %cx,%ax # Restore - stosl # Set EIP - leal 0x10(%esp,1),%esp # Discard seg regs - popa # Restore - iret # To V86 mode + jmp intusr.5 # Skip CALLF test +/* + * Panic if V86F_CALLF isn't set with V86F_ADDR. + */ +intusr.4: testl $V86F_CALLF,%edx # Far call? + jnz intusr.5 # Ok + movl %edx,0x30(%esp,1) # Place VM86 flags in int no + movl $badvm86,%esi # Display bad + call putstr # VM86 call + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + jmp ex_noc # Panic +/* + * %eax now holds the segment:offset of the function. + * %ebx now holds the %eflags to pass to real mode. + * %edx now holds the V86F_* flags. + */ +intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode + # target +/* + * If this is a v86 call, copy the seg regs out of the btx_v86 structure. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + jecxz intusr.6 # Skip for hardware ints + leal -0x44(%esi),%edi # %edi => kernel stack seg regs + pushl %esi # Save + leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs + movl $4,%ecx # Copy seg regs + rep # from btx_v86 + movsl # to kernel stack + popl %esi # Restore +intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real + movl %ebx,MEM_ESPR-0x0c # mode return trampoline + movl $rret_tramp,%ebx # Set return trampoline + movl %ebx,MEM_ESPR-0x10 # CS:IP + movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP + ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment + .code16 +intusr.7: movl %cr0,%eax # Leave + dec %al # protected + movl %eax,%cr0 # mode + ljmpw $0x0,$intusr.8 +intusr.8: xorw %ax,%ax # Reset %ds + movw %ax,%ds # and + movw %ax,%ss # %ss + lidt ivtdesc # Set IVT + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + movw $MEM_ESPR-0x16,%sp # Switch to real mode stack + iret # Call target routine +/* + * For the return to real mode we setup a stack frame like this on the real + * mode stack. Note that callf calls won't pop off the flags, but we just + * ignore that by repositioning %sp to be just above the btx_v86 pointer + * so it is aligned. The stack is relative to MEM_ESPR. + * + * -0x04 kernel %esp + * -0x08 btx_v86 + * -0x0c %eax + * -0x10 %ecx + * -0x14 %edx + * -0x18 %ebx + * -0x1c %esp + * -0x20 %ebp + * -0x24 %esi + * -0x28 %edi + * -0x2c %gs + * -0x30 %fs + * -0x34 %ds + * -0x38 %es + * -0x3c %eflags + */ +rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer + pushal # Save gp regs + pushl %gs # Save + pushl %fs # seg + pushl %ds # regs + pushl %es + pushfl # Save %eflags + cli # Disable interrupts + std # String ops dec + xorw %ax,%ax # Reset seg + movw %ax,%ds # regs + movw %ax,%es # (%ss is already 0) + lidt idtdesc # Set IDT + lgdt gdtdesc # Set GDT + mov %cr0,%eax # Switch to protected + inc %ax # mode + mov %eax,%cr0 # + ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code + .code32 +rret_tramp.1: xorl %ecx,%ecx # Zero + movb $SEL_SDATA,%cl # Setup + movw %cx,%ss # 32-bit + movw %cx,%ds # seg + movw %cx,%es # regs + movl MEM_ESPR-0x04,%esp # Switch to kernel stack + leal 0x44(%esp,1),%esi # Base of frame + andb $~0x2,tss_desc+0x5 # Clear TSS busy + movb $SEL_TSS,%cl # Set task + ltr %cx # register +/* + * Now we are back in protected mode. The kernel stack frame set up + * before entering real mode is still intact. For hardware interrupts, + * leave the frame unchanged. + */ + cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged + jz rret_tramp.3 # for hardware ints +/* + * For V86 calls, copy the registers off of the real mode stack onto + * the kernel stack as we want their updated values. Also, initialize + * the segment registers on the kernel stack. + * + * Note that the %esp in the kernel stack after this is garbage, but popa + * ignores it, so we don't have to fix it up. + */ + leal -0x18(%esi),%edi # Kernel stack GP regs + pushl %esi # Save + movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs + movl $8,%ecx # Copy GP regs from + rep # real mode stack + movsl # to kernel stack + movl $SEL_UDATA,%eax # Selector for data seg regs + movl $4,%ecx # Initialize %ds, + rep # %es, %fs, and + stosl # %gs +/* + * For V86 calls, copy the saved seg regs on the real mode stack back + * over to the btx_v86 structure. Also, conditionally update the + * saved eflags on the kernel stack based on the flags from the user. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs + leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs + xchgl %ecx,%edx # Save btx_v86 ptr + movl $4,%ecx # Copy seg regs + rep # from real mode stack + movsl # to btx_v86 + popl %esi # Restore + movl V86_CTL(%edx),%edx # Read V86 control flags + testl $V86F_FLAGS,%edx # User wants flags? + jz rret_tramp.3 # No + movl MEM_ESPR-0x3c,%eax # Read real mode flags + movw %ax,-0x08(%esi) # Update user flags (low 16) +/* + * Return to the user task + */ +rret_tramp.3: popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + addl $4,%esp # Discard int no + iret # Return to user mode + /* * System Call. */ @@ -882,13 +729,6 @@ intx30: cmpl $SYS_EXEC,%eax # Exec sys movl $MEM_USR,%eax # User base address addl 0xc(%esp,1),%eax # Change to user leal 0x4(%eax),%esp # stack -#ifdef PAGING - movl %cr0,%eax # Turn - andl $~0x80000000,%eax # off - movl %eax,%cr0 # paging - xorl %eax,%eax # Flush - movl %eax,%cr3 # TLB -#endif popl %eax # Call call *%eax # program intx30.1: orb $0x1,%ss:btx_hdr+0x7 # Flag reboot @@ -920,7 +760,7 @@ dump.1: testb $DMP_X32,%ch # Dump long dump.2: testb $DMP_MEM,%ch # Dump memory? jz dump.8 # No pushl %ds # Save - testb $0x2,0x52(%ebx) # V86 mode? + testl $PSL_VM,0x50(%ebx) # V86 mode? jnz dump.3 # Yes verr 0x4(%esi) # Readable selector? jnz dump.3 # No @@ -1111,6 +951,61 @@ putchr.4: movw %dx,(%ebx) # Update pos ret # To caller #endif + .code16 +/* + * Real Mode Hardware interrupt jump table. + */ +intr20: push $0x8 # Int 0x20: IRQ0 + jmp int_hwr # V86 int 0x8 + push $0x9 # Int 0x21: IRQ1 + jmp int_hwr # V86 int 0x9 + push $0xa # Int 0x22: IRQ2 + jmp int_hwr # V86 int 0xa + push $0xb # Int 0x23: IRQ3 + jmp int_hwr # V86 int 0xb + push $0xc # Int 0x24: IRQ4 + jmp int_hwr # V86 int 0xc + push $0xd # Int 0x25: IRQ5 + jmp int_hwr # V86 int 0xd + push $0xe # Int 0x26: IRQ6 + jmp int_hwr # V86 int 0xe + push $0xf # Int 0x27: IRQ7 + jmp int_hwr # V86 int 0xf + push $0x10 # Int 0x28: IRQ8 + jmp int_hwr # V86 int 0x10 + push $0x11 # Int 0x29: IRQ9 + jmp int_hwr # V86 int 0x11 + push $0x12 # Int 0x2a: IRQ10 + jmp int_hwr # V86 int 0x12 + push $0x13 # Int 0x2b: IRQ11 + jmp int_hwr # V86 int 0x13 + push $0x14 # Int 0x2c: IRQ12 + jmp int_hwr # V86 int 0x14 + push $0x15 # Int 0x2d: IRQ13 + jmp int_hwr # V86 int 0x15 + push $0x16 # Int 0x2e: IRQ14 + jmp int_hwr # V86 int 0x16 + push $0x17 # Int 0x2f: IRQ15 + jmp int_hwr # V86 int 0x17 +/* + * Reflect hardware interrupts in real mode. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 05:05:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 775531065672; Sat, 19 Dec 2009 05:05:14 +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 6419F8FC0A; Sat, 19 Dec 2009 05:05: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 nBJ55EYg020558; Sat, 19 Dec 2009 05:05:14 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ55EaZ020555; Sat, 19 Dec 2009 05:05:14 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190505.nBJ55EaZ020555@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 05:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200707 - stable/6/sys/boot/pc98/btx/btx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:05:14 -0000 Author: nyan Date: Sat Dec 19 05:05:14 2009 New Revision: 200707 URL: http://svn.freebsd.org/changeset/base/200707 Log: MFC: r176645 and r200254 - Retire the support for using paging in BTX. - Use real mode instead of v86 mode. Modified: stable/6/sys/boot/pc98/btx/btx/Makefile stable/6/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- stable/6/sys/boot/pc98/btx/btx/Makefile Sat Dec 19 05:00:09 2009 (r200706) +++ stable/6/sys/boot/pc98/btx/btx/Makefile Sat Dec 19 05:05:14 2009 (r200707) @@ -5,10 +5,6 @@ INTERNALPROG= NO_MAN= SRCS= btx.S -.if defined(PAGING) -CFLAGS+=-DPAGING -.endif - .if defined(BOOT_BTX_NOHANG) BOOT_BTX_FLAGS=0x1 .else Modified: stable/6/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/6/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 05:00:09 2009 (r200706) +++ stable/6/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 05:05:14 2009 (r200707) @@ -21,12 +21,11 @@ .set MEM_BTX,0x1000 # Start of BTX memory .set MEM_ESP0,0x1800 # Supervisor stack .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_DIR,0x4000 # Page directory - .set MEM_TBL,0x5000 # Page tables + .set MEM_ESPR,0x5e00 # Real mode stack + .set MEM_IDT,0x5e00 # IDT + .set MEM_TSS,0x5f98 # TSS + .set MEM_MAP,0x6000 # I/O bit map + .set MEM_TSS_END,0x7fff # End of TSS .set MEM_ORG,0x9000 # BTX code .set MEM_USR,0xa000 # Start of user memory /* @@ -35,6 +34,14 @@ .set PAG_SIZ,0x1000 # Page size .set PAG_CNT,0x1000 # Pages to map /* + * Fields in %eflags. + */ + .set PSL_RESERVED_DEFAULT,0x00000002 + .set PSL_T,0x00000100 # Trap flag + .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_VM,0x00020000 # Virtual 8086 mode flag + .set PSL_AC,0x00040000 # Alignment check flag +/* * Segment selectors. */ .set SEL_SCODE,0x8 # Supervisor code @@ -49,7 +56,6 @@ */ .set TSS_ESP0,0x4 # PL 0 ESP .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP .set TSS_MAP,0x66 # I/O bit map base /* * System calls. @@ -57,10 +63,20 @@ .set SYS_EXIT,0x0 # Exit .set SYS_EXEC,0x1 # Exec /* - * V86 constants. + * Fields in V86 interface structure. */ - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS +/* + * V86 control flags. + */ + .set V86F_ADDR,0x10000 # Segment:offset address + .set V86F_CALLF,0x20000 # Emulate far call + .set V86F_FLAGS,0x40000 # Return flags /* * Dump format control bytes. */ @@ -78,15 +94,13 @@ * BIOS Data Area locations. */ .set BDA_MEM,0x501 # Free memory - .set BDA_KEYFLAGS,0x53a # Keyboard shift-state flags .set BDA_POS,0x53e # Cursor position /* * Derivations, for brevity. */ .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base - .set _TSSLM,MEM_DIR-MEM_TSS-1 # TSS limit + .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit /* * Code segment. @@ -101,7 +115,7 @@ btx_hdr: .byte 0xeb # Machine ID .byte 0xe # Header size .ascii "BTX" # Magic .byte 0x1 # Major version - .byte 0x1 # Minor version + .byte 0x2 # Minor version .byte BTX_FLAGS # Flags .word PAG_CNT-MEM_ORG>>0xc # Paging control .word break-start # Text size @@ -122,13 +136,24 @@ init: cli # Disable interrupts */ mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero - push %di # Save rep # Zero-fill stosw # memory - pop %di # Restore +/* + * Update real mode IDT for reflecting hardware interrupts. + */ + mov $intr20,%bx # Address first handler + mov $0x10,%cx # Number of handlers + mov $0x20*4,%di # First real mode IDT entry +init.0: mov %bx,(%di) # Store IP + inc %di # Address next + inc %di # entry + stosw # Store CS + add $4,%bx # Next handler + loop init.0 # Next IRQ /* * Create IDT. */ + mov $MEM_IDT,%di mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -154,60 +179,16 @@ init.3: lea 0x8(%di),%di # Next entry */ init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 - movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base -#ifdef PAGING -/* - * Create page directory. - */ - xor %edx,%edx # Page - mov $PAG_SIZ>>0x8,%dh # size - xor %eax,%eax # Zero - mov $MEM_DIR,%di # Page directory - mov $PAG_CNT>>0xa,%cl # Entries - mov $MEM_TBL|0x7,%ax # First entry -init.5: stosl # Write entry - add %dx,%ax # To next - loop init.5 # Till done -/* - * Create page tables. - */ - mov $MEM_TBL,%di # Page table - mov $PAG_CNT>>0x8,%ch # Entries - xor %ax,%ax # Start address -init.6: mov $0x7,%al # Set U:W:P flags - cmp btx_hdr+0x8,%cx # Standard user page? - jb init.7 # Yes - cmp $PAG_CNT-MEM_BTX>>0xc,%cx # BTX memory? - jae init.7 # No or first page - and $~0x2,%al # Clear W flag - cmp $PAG_CNT-MEM_USR>>0xc,%cx # User page zero? - jne init.7 # No - testb $0x80,btx_hdr+0x7 # Unmap it? - jz init.7 # No - and $~0x1,%al # Clear P flag -init.7: stosl # Set entry - add %edx,%eax # Next address - loop init.6 # Till done -#endif /* * Bring up the system. */ mov $0x2820,%bx # Set protected mode callw setpic # IRQ offsets lidt idtdesc # Set IDT -#ifdef PAGING - xor %eax,%eax # Set base - mov $MEM_DIR>>0x8,%ah # of page - mov %eax,%cr3 # directory -#endif lgdt gdtdesc # Set GDT mov %cr0,%eax # Switch to protected -#ifdef PAGING - or $0x80000001,%eax # mode and enable paging -#else inc %ax # mode -#endif mov %eax,%cr0 # ljmp $SEL_SCODE,$init.8 # To 32-bit code .code32 @@ -297,8 +278,8 @@ exit.2: xor %ax,%ax # Real mode segme exit.3: jz exit.3 # No movb $0xa0,%al outb %al,$0x35 - movb 0,%al - outb %al,$0xf0 + movb $0x00,%al + outb %al,$0xf0 # reboot the machine exit.4: jmp exit.4 /* * Set IRQ offsets by reprogramming 8259A PICs. @@ -329,10 +310,6 @@ setpic: in $0x02,%al # Save master retw # To caller .code32 /* - * Initiate return from V86 mode to user mode. - */ -inthlt: hlt # To supervisor mode -/* * Exception jump table. */ intx00: push $0x0 # Int 0x0: #DE @@ -358,18 +335,12 @@ intx00: push $0x0 # Int 0x0: #DE push $0xc # Int 0xc: #SS jmp except # Stack segment fault push $0xd # Int 0xd: #GP - jmp ex_v86 # General protection + jmp except # General protection push $0xe # Int 0xe: #PF jmp except # Page fault intx10: push $0x10 # Int 0x10: #MF jmp ex_noc # Floating-point error /* - * Handle #GP exception. - */ -ex_v86: testb $0x2,0x12(%esp,1) # V86 mode? - jz except # No - jmp v86mon # To monitor -/* * Save a zero error code. */ ex_noc: pushl (%esp,1) # Duplicate int no @@ -381,24 +352,17 @@ except: cld # String ops inc pushl %ds # Save pushl %es # most pusha # registers - movb $0x6,%al # Push loop count - testb $0x2,0x3a(%esp,1) # V86 mode? - jnz except.1 # Yes pushl %gs # Set GS pushl %fs # Set FS pushl %ds # Set DS pushl %es # Set ES - movb $0x2,%al # Push loop count cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode? jne except.1 # No pushl %ss # Set SS - leal 0x50(%esp,1),%eax # Set - pushl %eax # ESP jmp except.2 # Join common code -except.1: pushl 0x50(%esp,1) # Set GS, FS, DS, ES - decb %al # (if V86 mode), and - jne except.1 # SS, ESP -except.2: push $SEL_SDATA # Set up +except.1: pushl 0x50(%esp,1) # Set SS +except.2: pushl 0x50(%esp,1) # Set ESP + push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data @@ -407,14 +371,12 @@ except.2: push $SEL_SDATA # Set up movl $MEM_BUF,%edi # Buffer pushl %eax pushl %edx -wait.1: - inb $0x60,%al +wait.1: inb $0x60,%al testb $0x04,%al jz wait.1 movb $0xe0,%al outb %al,$0x62 -wait.2: - inb $0x60,%al +wait.2: inb $0x60,%al testb $0x01,%al jz wait.2 xorl %edx,%edx @@ -443,237 +405,11 @@ wait.2: je except.3 # Yes cmpb $0x1,(%esp,1) # Debug? jne except.2a # No - testl $0x100,0x10(%esp,1) # Trap flag set? + testl $PSL_T,0x10(%esp,1) # Trap flag set? jnz except.3 # Yes except.2a: jmp exit # Exit except.3: leal 0x8(%esp,1),%esp # Discard err, int no iret # From interrupt -/* - * Return to user mode from V86 mode. - */ -intrtn: cld # String ops inc - pushl %ds # Address - popl %es # data - leal 0x3c(%ebp),%edx # V86 Segment registers - movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer - lodsl # INT_V86 args pointer - movl %esi,%ebx # Saved exception frame - testl %eax,%eax # INT_V86 args? - jz intrtn.2 # No - movl $MEM_USR,%edi # User base - movl 0x1c(%esi),%ebx # User ESP - movl %eax,(%edi,%ebx,1) # Restore to user stack - leal 0x8(%edi,%eax,1),%edi # Arg segment registers - testb $0x4,-0x6(%edi) # Return flags? - jz intrtn.1 # No - movl 0x30(%ebp),%eax # Get V86 flags - movw %ax,0x18(%esi) # Set user flags -intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame - xchgl %edx,%esi # Segment registers - movb $0x4,%cl # Update seg regs - rep # in INT_V86 - movsl # args -intrtn.2: xchgl %edx,%esi # Segment registers - leal 0x28(%ebp),%edi # Set up seg - movb $0x4,%cl # regs for - rep # later - movsl # pop - xchgl %ebx,%esi # Restore exception - movb $0x5,%cl # frame to - rep # supervisor - movsl # stack - movl %esi,MEM_TSS+TSS_ESP1 # Link stack pointer - popa # Restore - leal 0x8(%esp,1),%esp # Discard err, int no - popl %es # Restore - popl %ds # user - popl %fs # segment - popl %gs # registers - iret # To user mode -/* - * V86 monitor. - */ -v86mon: cld # String ops inc - pushl $SEL_SDATA # Set up for - popl %ds # flat addressing - pusha # Save registers - movl %esp,%ebp # Address stack frame - movzwl 0x2c(%ebp),%edi # Load V86 CS - shll $0x4,%edi # To linear - movl 0x28(%ebp),%esi # Load V86 IP - addl %edi,%esi # Code pointer - xorl %ecx,%ecx # Zero - movb $0x2,%cl # 16-bit operands - xorl %eax,%eax # Zero -v86mon.1: lodsb # Get opcode - cmpb $0x66,%al # Operand size prefix? - jne v86mon.2 # No - movb $0x4,%cl # 32-bit operands - jmp v86mon.1 # Continue -v86mon.2: cmpb $0xf4,%al # HLT? - jne v86mon.3 # No - cmpl $inthlt+0x1,%esi # Is inthlt? - jne v86mon.7 # No (ignore) - jmp intrtn # Return to user mode -v86mon.3: cmpb $0xf,%al # Prefixed instruction? - jne v86mon.4 # No - cmpb $0x09,(%esi) # Is it a WBINVD? - je v86wbinvd # Yes - cmpb $0x30,(%esi) # Is it a WRMSR? - je v86wrmsr # Yes - cmpb $0x32,(%esi) # Is it a RDMSR? - je v86rdmsr # Yes - cmpb $0x20,(%esi) # Is this a MOV reg,CRx? - je v86mov # Yes -v86mon.4: cmpb $0xfa,%al # CLI? - je v86cli # Yes - cmpb $0xfb,%al # STI? - je v86sti # Yes - movzwl 0x38(%ebp),%ebx # Load V86 SS - shll $0x4,%ebx # To offset - pushl %ebx # Save - addl 0x34(%ebp),%ebx # Add V86 SP - movl 0x30(%ebp),%edx # Load V86 flags - cmpb $0x9c,%al # PUSHF/PUSHFD? - je v86pushf # Yes - cmpb $0x9d,%al # POPF/POPFD? - je v86popf # Yes - cmpb $0xcd,%al # INT imm8? - je v86intn # Yes - cmpb $0xcf,%al # IRET/IRETD? - je v86iret # Yes - popl %ebx # Restore - popa # Restore - jmp except # Handle exception -v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags -v86mon.6: popl %edx # V86 SS adjustment - subl %edx,%ebx # Save V86 - movl %ebx,0x34(%ebp) # SP -v86mon.7: subl %edi,%esi # From linear - movl %esi,0x28(%ebp) # Save V86 IP - popa # Restore - leal 0x8(%esp,1),%esp # Discard int no, error - iret # To V86 mode -/* - * Emulate MOV reg,CRx. - */ -v86mov: movb 0x1(%esi),%bl # Fetch Mod R/M byte - testb $0x10,%bl # Read CR2 or CR3? - jnz v86mov.1 # Yes - movl %cr0,%eax # Read CR0 - testb $0x20,%bl # Read CR4 instead? - jz v86mov.2 # No - movl %cr4,%eax # Read CR4 - jmp v86mov.2 -v86mov.1: movl %cr2,%eax # Read CR2 - testb $0x08,%bl # Read CR3 instead? - jz v86mov.2 # No - movl %cr3,%eax # Read CR3 -v86mov.2: andl $0x7,%ebx # Compute offset in - shl $2,%ebx # frame of destination - neg %ebx # register - movl %eax,0x1c(%ebp,%ebx,1) # Store CR to reg - incl %esi # Adjust IP -/* - * Return from emulating a 0x0f prefixed instruction - */ -v86preret: incl %esi # Adjust IP - jmp v86mon.7 # Finish up -/* - * Emulate WBINVD - */ -v86wbinvd: wbinvd # Write back and invalidate - # cache - jmp v86preret # Finish up -/* - * Emulate WRMSR - */ -v86wrmsr: movl 0x18(%ebp),%ecx # Get user's %ecx (MSR to write) - movl 0x14(%ebp),%edx # Load the value - movl 0x1c(%ebp),%eax # to write - wrmsr # Write MSR - jmp v86preret # Finish up -/* - * Emulate RDMSR - */ -v86rdmsr: movl 0x18(%ebp),%ecx # MSR to read - rdmsr # Read the MSR - movl %eax,0x1c(%ebp) # Return the value of - movl %edx,0x14(%ebp) # the MSR to the user - jmp v86preret # Finish up -/* - * Emulate CLI. - */ -v86cli: andb $~0x2,0x31(%ebp) # Clear IF - jmp v86mon.7 # Finish up -/* - * Emulate STI. - */ -v86sti: orb $0x2,0x31(%ebp) # Set IF - jmp v86mon.7 # Finish up -/* - * Emulate PUSHF/PUSHFD. - */ -v86pushf: subl %ecx,%ebx # Adjust SP - cmpb $0x4,%cl # 32-bit - je v86pushf.1 # Yes - data16 # 16-bit -v86pushf.1: movl %edx,(%ebx) # Save flags - jmp v86mon.6 # Finish up -/* - * Emulate IRET/IRETD. - */ -v86iret: movzwl (%ebx),%esi # Load V86 IP - movzwl 0x2(%ebx),%edi # Load V86 CS - leal 0x4(%ebx),%ebx # Adjust SP - movl %edi,0x2c(%ebp) # Save V86 CS - xorl %edi,%edi # No ESI adjustment -/* - * Emulate POPF/POPFD (and remainder of IRET/IRETD). - */ -v86popf: cmpb $0x4,%cl # 32-bit? - je v86popf.1 # Yes - movl %edx,%eax # Initialize - data16 # 16-bit -v86popf.1: movl (%ebx),%eax # Load flags - addl %ecx,%ebx # Adjust SP - andl $V86_FLG,%eax # Merge - andl $~V86_FLG,%edx # the - orl %eax,%edx # flags - jmp v86mon.5 # Finish up -/* - * trap int 15, function 87 - * reads %es:%si from saved registers on stack to find a GDT containing - * source and destination locations - * reads count of words from saved %cx - * returns success by setting %ah to 0 - */ -int15_87: pushl %esi # Save - pushl %edi # registers - movl 0x3C(%ebp),%edi # Load ES - movzwl 0x4(%ebp),%eax # Load user's SI - shll $0x4,%edi # EDI = (ES << 4) + - addl %eax,%edi # SI - movl 0x11(%edi),%eax # Read base of - movb 0x17(%edi),%al # GDT entry - ror $8,%eax # for source - xchgl %eax,%esi # into %esi - movl 0x19(%edi),%eax # Read base of - movb 0x1f(%edi),%al # GDT entry for - ror $8,%eax # destination - xchgl %eax,%edi # into %edi - pushl %ds # Make: - popl %es # es = ds - movzwl 0x18(%ebp),%ecx # Get user's CX - shll $0x1,%ecx # Convert count from words - rep # repeat... - movsb # perform copy. - popl %edi # Restore - popl %esi # registers - movb $0x0,0x1d(%ebp) # set ah = 0 to indicate - # success - andb $0xfe,%dl # clear CF - jmp v86mon.5 # Finish up /* * Reboot the machine by setting the reboot flag and exiting @@ -682,36 +418,7 @@ reboot: orb $0x1,btx_hdr+0x7 # Set the jmp exit # Terminate BTX and reboot /* - * Emulate INT imm8... also make sure to check if it's int 15/87 - */ -v86intn: lodsb # Get int no - cmpb $0x19,%al # is it int 19? - je reboot # yes, reboot the machine - cmpb $0x15,%al # is it int 15? - jne v86intn.1 # no, skip parse - cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction? - je int15_87 # yes - cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout? - jne v86intn.1 # no, handle the int normally - movb BDA_KEYFLAGS,%ch # get the shift key state - andb $0x18,%ch # mask off just Ctrl and Alt - cmpb $0x18,%ch # are both Ctrl and Alt down? - je reboot # yes, reboot the machine -v86intn.1: subl %edi,%esi # From - shrl $0x4,%edi # linear - movw %dx,-0x2(%ebx) # Save flags - movw %di,-0x4(%ebx) # Save CS - leal -0x6(%ebx),%ebx # Adjust SP - movw %si,(%ebx) # Save IP - shll $0x2,%eax # Scale - movzwl (%eax),%esi # Load IP - movzwl 0x2(%eax),%edi # Load CS - movl %edi,0x2c(%ebp) # Save CS - xorl %edi,%edi # No ESI adjustment - andb $~0x1,%dh # Clear TF - jmp v86mon.5 # Finish up -/* - * Hardware interrupt jump table. + * Protected Mode Hardware interrupt jump table. */ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x8 @@ -745,127 +452,267 @@ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x16 push $0x17 # Int 0x2f: IRQ15 jmp int_hw # V86 int 0x17 + +/* + * Invoke real mode interrupt/function call from user mode with arguments. + */ +intx31: pushl $-1 # Dummy int no for btx_v86 /* - * Reflect hardware interrupts. + * Invoke real mode interrupt/function call from protected mode. + * + * We place a trampoline on the user stack that will return to rret_tramp + * which will reenter protected mode and then finally return to the user + * client. + * + * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR: + * + * -0x00 user %ss -0x04 kernel %esp (with full frame) + * -0x04 user %esp -0x08 btx_v86 pointer + * -0x08 user %eflags -0x0c flags (only used if interrupt) + * -0x0c user %cs -0x10 real mode CS:IP return trampoline + * -0x10 user %eip -0x12 real mode flags + * -0x14 int no -0x16 real mode CS:IP (target) + * -0x18 %eax + * -0x1c %ecx + * -0x20 %edx + * -0x24 %ebx + * -0x28 %esp + * -0x2c %ebp + * -0x30 %esi + * -0x34 %edi + * -0x38 %gs + * -0x3c %fs + * -0x40 %ds + * -0x44 %es + * -0x48 zero %eax (hardware int only) + * -0x4c zero %ecx (hardware int only) + * -0x50 zero %edx (hardware int only) + * -0x54 zero %ebx (hardware int only) + * -0x58 zero %esp (hardware int only) + * -0x5c zero %ebp (hardware int only) + * -0x60 zero %esi (hardware int only) + * -0x64 zero %edi (hardware int only) + * -0x68 zero %gs (hardware int only) + * -0x6c zero %fs (hardware int only) + * -0x70 zero %ds (hardware int only) + * -0x74 zero %es (hardware int only) */ -int_hw: testb $0x2,0xe(%esp,1) # V86 mode? - jz intusr # No - pushl $SEL_SDATA # Address - popl %ds # data - xchgl %eax,(%esp,1) # Swap EAX, int no - pushl %ebp # Address - movl %esp,%ebp # stack frame - pushl %ebx # Save - shll $0x2,%eax # Get int - movl (%eax),%eax # vector - subl $0x6,0x14(%ebp) # Adjust V86 ESP - movzwl 0x18(%ebp),%ebx # V86 SS - shll $0x4,%ebx # * 0x10 - addl 0x14(%ebp),%ebx # + V86 ESP - xchgw %ax,0x8(%ebp) # Swap V86 IP - rorl $0x10,%eax # Swap words - xchgw %ax,0xc(%ebp) # Swap V86 CS - roll $0x10,%eax # Swap words - movl %eax,(%ebx) # CS:IP for IRET - movl 0x10(%ebp),%eax # V86 flags - movw %ax,0x4(%ebx) # Flags for IRET - andb $~0x3,0x11(%ebp) # Clear IF, TF - popl %ebx # Restore - popl %ebp # saved - popl %eax # registers - iret # To V86 mode -/* - * Invoke V86 interrupt from user mode, with arguments. - */ -intx31: stc # Have btx_v86 - pushl %eax # Missing int no -/* - * Invoke V86 interrupt from user mode. - */ -intusr: std # String ops dec - pushl %eax # Expand - pushl %eax # stack - pushl %eax # frame - pusha # Save +int_hw: cld # String ops inc + pusha # Save gp regs pushl %gs # Save - movl %esp,%eax # seg regs - pushl %fs # and - pushl %ds # point - pushl %es # to them + pushl %fs # seg + pushl %ds # regs + pushl %es push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data + leal 0x44(%esp,1),%esi # Base of frame + movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer + movl -0x14(%esi),%eax # Get Int no + cmpl $-1,%eax # Hardware interrupt? + jne intusr.1 # Yes +/* + * v86 calls save the btx_v86 pointer on the real mode stack and read + * the address and flags from the btx_v86 structure. For interrupt + * handler invocations (VM86 INTx requests), disable interrupts, + * tracing, and alignment checking while the handler runs. + */ movl $MEM_USR,%ebx # User base movl %ebx,%edx # address - jc intusr.1 # If btx_v86 - xorl %edx,%edx # Control flags - xorl %ebp,%ebp # btx_v86 pointer -intusr.1: leal 0x50(%esp,1),%esi # Base of frame - pushl %esi # Save addl -0x4(%esi),%ebx # User ESP - movl MEM_TSS+TSS_ESP1,%edi # Link stack pointer - leal -0x4(%edi),%edi # Adjust for push - xorl %ecx,%ecx # Zero - movb $0x5,%cl # Push exception - rep # frame on - movsl # link stack - xchgl %eax,%esi # Saved seg regs - movl 0x40(%esp,1),%eax # Get int no - testl %edx,%edx # Have btx_v86? - jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer - movb $0x4,%cl # Count - addl %ecx,%ebx # Adjust for pop - rep # Push saved seg regs - movsl # on link stack addl %ebp,%edx # Flatten btx_v86 ptr - leal 0x14(%edx),%esi # Seg regs pointer - movl 0x4(%edx),%eax # Get int no/address - movzwl 0x2(%edx),%edx # Get control flags -intusr.2: movl %ebp,(%edi) # Push btx_v86 and - movl %edi,MEM_TSS+TSS_ESP1 # save link stack ptr - popl %edi # Base of frame - xchgl %eax,%ebp # Save intno/address - movl 0x48(%esp,1),%eax # Get flags - testb $0x2,%dl # Simulate CALLF? - jnz intusr.3 # Yes - decl %ebx # Push flags - decl %ebx # on V86 - movw %ax,(%ebx) # stack -intusr.3: movb $0x4,%cl # Count - subl %ecx,%ebx # Push return address - movl $inthlt,(%ebx) # on V86 stack - rep # Copy seg regs to - movsl # exception frame - xchgl %eax,%ecx # Save flags - movl %ebx,%eax # User ESP - subl $V86_STK,%eax # Less bytes - ja intusr.4 # to - xorl %eax,%eax # keep -intusr.4: shrl $0x4,%eax # Gives segment - stosl # Set SS - shll $0x4,%eax # To bytes - xchgl %eax,%ebx # Swap - subl %ebx,%eax # Gives offset - stosl # Set ESP - xchgl %eax,%ecx # Get flags - btsl $0x11,%eax # Set VM - andb $~0x1,%ah # Clear TF - stosl # Set EFL - xchgl %eax,%ebp # Get int no/address - testb $0x1,%dl # Address? - jnz intusr.5 # Yes - shll $0x2,%eax # Scale + movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr + movl V86_ADDR(%edx),%eax # Get int no/address + movl V86_CTL(%edx),%edx # Get control flags + movl -0x08(%esi),%ebx # Save user flags in %ebx + testl $V86F_ADDR,%edx # Segment:offset? + jnz intusr.4 # Yes + andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing, + # and alignment checking for + # interrupt handler + jmp intusr.3 # Skip hardware interrupt +/* + * Hardware interrupts store a NULL btx_v86 pointer and use the + * address (interrupt number) from the stack with empty flags. Also, + * push a dummy frame of zeros onto the stack for all the general + * purpose and segment registers and clear %eflags. This gives the + * hardware interrupt handler a clean slate. + */ +intusr.1: xorl %edx,%edx # Control flags + movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr + movl $12,%ecx # Frame is 12 dwords +intusr.2: pushl $0x0 # Fill frame + loop intusr.2 # with zeros + movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags +/* + * Look up real mode IDT entry for hardware interrupts and VM86 INTx + * requests. + */ +intusr.3: shll $0x2,%eax # Scale movl (%eax),%eax # Load int vector -intusr.5: movl %eax,%ecx # Save - shrl $0x10,%eax # Gives segment - stosl # Set CS - movw %cx,%ax # Restore - stosl # Set EIP - leal 0x10(%esp,1),%esp # Discard seg regs - popa # Restore - iret # To V86 mode + jmp intusr.5 # Skip CALLF test +/* + * Panic if V86F_CALLF isn't set with V86F_ADDR. + */ +intusr.4: testl $V86F_CALLF,%edx # Far call? + jnz intusr.5 # Ok + movl %edx,0x30(%esp,1) # Place VM86 flags in int no + movl $badvm86,%esi # Display bad + call putstr # VM86 call + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + jmp ex_noc # Panic +/* + * %eax now holds the segment:offset of the function. + * %ebx now holds the %eflags to pass to real mode. + * %edx now holds the V86F_* flags. + */ +intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode + # target +/* + * If this is a v86 call, copy the seg regs out of the btx_v86 structure. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + jecxz intusr.6 # Skip for hardware ints + leal -0x44(%esi),%edi # %edi => kernel stack seg regs + pushl %esi # Save + leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs + movl $4,%ecx # Copy seg regs + rep # from btx_v86 + movsl # to kernel stack + popl %esi # Restore +intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real + movl %ebx,MEM_ESPR-0x0c # mode return trampoline + movl $rret_tramp,%ebx # Set return trampoline + movl %ebx,MEM_ESPR-0x10 # CS:IP + movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP + ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment + .code16 +intusr.7: movl %cr0,%eax # Leave + dec %al # protected + movl %eax,%cr0 # mode + ljmpw $0x0,$intusr.8 +intusr.8: xorw %ax,%ax # Reset %ds + movw %ax,%ds # and + movw %ax,%ss # %ss + lidt ivtdesc # Set IVT + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + movw $MEM_ESPR-0x16,%sp # Switch to real mode stack + iret # Call target routine +/* + * For the return to real mode we setup a stack frame like this on the real + * mode stack. Note that callf calls won't pop off the flags, but we just + * ignore that by repositioning %sp to be just above the btx_v86 pointer + * so it is aligned. The stack is relative to MEM_ESPR. + * + * -0x04 kernel %esp + * -0x08 btx_v86 + * -0x0c %eax + * -0x10 %ecx + * -0x14 %edx + * -0x18 %ebx + * -0x1c %esp + * -0x20 %ebp + * -0x24 %esi + * -0x28 %edi + * -0x2c %gs + * -0x30 %fs + * -0x34 %ds + * -0x38 %es + * -0x3c %eflags + */ +rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer + pushal # Save gp regs + pushl %gs # Save + pushl %fs # seg + pushl %ds # regs + pushl %es + pushfl # Save %eflags + cli # Disable interrupts + std # String ops dec + xorw %ax,%ax # Reset seg + movw %ax,%ds # regs + movw %ax,%es # (%ss is already 0) + lidt idtdesc # Set IDT + lgdt gdtdesc # Set GDT + mov %cr0,%eax # Switch to protected + inc %ax # mode + mov %eax,%cr0 # + ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code + .code32 +rret_tramp.1: xorl %ecx,%ecx # Zero + movb $SEL_SDATA,%cl # Setup + movw %cx,%ss # 32-bit + movw %cx,%ds # seg + movw %cx,%es # regs + movl MEM_ESPR-0x04,%esp # Switch to kernel stack + leal 0x44(%esp,1),%esi # Base of frame + andb $~0x2,tss_desc+0x5 # Clear TSS busy + movb $SEL_TSS,%cl # Set task + ltr %cx # register +/* + * Now we are back in protected mode. The kernel stack frame set up + * before entering real mode is still intact. For hardware interrupts, + * leave the frame unchanged. + */ + cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged + jz rret_tramp.3 # for hardware ints +/* + * For V86 calls, copy the registers off of the real mode stack onto + * the kernel stack as we want their updated values. Also, initialize + * the segment registers on the kernel stack. + * + * Note that the %esp in the kernel stack after this is garbage, but popa + * ignores it, so we don't have to fix it up. + */ + leal -0x18(%esi),%edi # Kernel stack GP regs + pushl %esi # Save + movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs + movl $8,%ecx # Copy GP regs from + rep # real mode stack + movsl # to kernel stack + movl $SEL_UDATA,%eax # Selector for data seg regs + movl $4,%ecx # Initialize %ds, + rep # %es, %fs, and + stosl # %gs +/* + * For V86 calls, copy the saved seg regs on the real mode stack back + * over to the btx_v86 structure. Also, conditionally update the + * saved eflags on the kernel stack based on the flags from the user. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs + leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs + xchgl %ecx,%edx # Save btx_v86 ptr + movl $4,%ecx # Copy seg regs + rep # from real mode stack + movsl # to btx_v86 + popl %esi # Restore + movl V86_CTL(%edx),%edx # Read V86 control flags + testl $V86F_FLAGS,%edx # User wants flags? + jz rret_tramp.3 # No + movl MEM_ESPR-0x3c,%eax # Read real mode flags + movw %ax,-0x08(%esi) # Update user flags (low 16) +/* + * Return to the user task + */ +rret_tramp.3: popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + addl $4,%esp # Discard int no + iret # Return to user mode + /* * System Call. */ @@ -882,13 +729,6 @@ intx30: cmpl $SYS_EXEC,%eax # Exec sys movl $MEM_USR,%eax # User base address addl 0xc(%esp,1),%eax # Change to user leal 0x4(%eax),%esp # stack -#ifdef PAGING - movl %cr0,%eax # Turn - andl $~0x80000000,%eax # off - movl %eax,%cr0 # paging - xorl %eax,%eax # Flush - movl %eax,%cr3 # TLB -#endif popl %eax # Call call *%eax # program intx30.1: orb $0x1,%ss:btx_hdr+0x7 # Flag reboot @@ -920,7 +760,7 @@ dump.1: testb $DMP_X32,%ch # Dump long dump.2: testb $DMP_MEM,%ch # Dump memory? jz dump.8 # No pushl %ds # Save - testb $0x2,0x52(%ebx) # V86 mode? + testl $PSL_VM,0x50(%ebx) # V86 mode? jnz dump.3 # Yes verr 0x4(%esi) # Readable selector? jnz dump.3 # No @@ -1111,6 +951,61 @@ putchr.4: movw %dx,(%ebx) # Update pos ret # To caller #endif + .code16 +/* + * Real Mode Hardware interrupt jump table. + */ +intr20: push $0x8 # Int 0x20: IRQ0 + jmp int_hwr # V86 int 0x8 + push $0x9 # Int 0x21: IRQ1 + jmp int_hwr # V86 int 0x9 + push $0xa # Int 0x22: IRQ2 + jmp int_hwr # V86 int 0xa + push $0xb # Int 0x23: IRQ3 + jmp int_hwr # V86 int 0xb + push $0xc # Int 0x24: IRQ4 + jmp int_hwr # V86 int 0xc + push $0xd # Int 0x25: IRQ5 + jmp int_hwr # V86 int 0xd + push $0xe # Int 0x26: IRQ6 + jmp int_hwr # V86 int 0xe + push $0xf # Int 0x27: IRQ7 + jmp int_hwr # V86 int 0xf + push $0x10 # Int 0x28: IRQ8 + jmp int_hwr # V86 int 0x10 + push $0x11 # Int 0x29: IRQ9 + jmp int_hwr # V86 int 0x11 + push $0x12 # Int 0x2a: IRQ10 + jmp int_hwr # V86 int 0x12 + push $0x13 # Int 0x2b: IRQ11 + jmp int_hwr # V86 int 0x13 + push $0x14 # Int 0x2c: IRQ12 + jmp int_hwr # V86 int 0x14 + push $0x15 # Int 0x2d: IRQ13 + jmp int_hwr # V86 int 0x15 + push $0x16 # Int 0x2e: IRQ14 + jmp int_hwr # V86 int 0x16 + push $0x17 # Int 0x2f: IRQ15 + jmp int_hwr # V86 int 0x17 +/* + * Reflect hardware interrupts in real mode. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 05:20:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E531065676; Sat, 19 Dec 2009 05:20:27 +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 E3B128FC18; Sat, 19 Dec 2009 05:20: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 nBJ5KQs7020865; Sat, 19 Dec 2009 05:20:26 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ5KQiT020863; Sat, 19 Dec 2009 05:20:26 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190520.nBJ5KQiT020863@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 05:20: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: r200708 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:20:27 -0000 Author: dougb Date: Sat Dec 19 05:20:26 2009 New Revision: 200708 URL: http://svn.freebsd.org/changeset/base/200708 Log: Fix a problem with how mergemaster handles the hard links for /.cshrc and /.profile. The problem is that install(1) will unlink the old file before it installs the new one, which means that in the best case we have to compare the changes for the old file twice. So, change the logic to first test to see if the link exists, then install the file. Then if the link was there and we're using -i, just create the link in /root and be done with it. Otherwise display the message to the user and give them the option. Because we are now sorting things before doing the comparison we can know conclusively that the files in / should be the sources, and the files in /root will be the targets, so adjust the paths accordingly. While I'm here, split a too-long error message into two lines and just return at the end of handling these files instead of setting the variable that says "do nothing" and then returning at the end of the function anyway. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 05:05:14 2009 (r200707) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 05:20:26 2009 (r200708) @@ -840,8 +840,19 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') + local st_nlink + + # install will unlink the file before it installs the new one, + # so we have to restore/create the link afterwards. + # + st_nlink=0 # In case the file does not yet exist + eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) + + do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + + if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then + HANDLE_LINK=l + else case "${LINK_EXPLAINED}" in '') echo " *** Historically BSD derived systems have had a" @@ -855,17 +866,13 @@ mm_install () { esac echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" + echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" echo '' echo " Default is to leave the temporary file to deal with by hand" echo '' echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac + fi case "${HANDLE_LINK}" in [dD]*) @@ -875,19 +882,19 @@ mm_install () { ;; [lL]*) echo '' - rm -f "${DESTDIR}${COMPFILE#.}" - if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then + unlink ${DESTDIR}/root/${COMPFILE##*/} + if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" - rm "${COMPFILE}" else - echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand" + echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" + echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac - DONT_INSTALL=yes + return ;; esac From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 05:23:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF991065670; Sat, 19 Dec 2009 05:23:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 921978FC13; Sat, 19 Dec 2009 05:23:39 +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 nBJ5NQ9R042636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 07:23:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nBJ5NQw8047563; Sat, 19 Dec 2009 07:23:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nBJ5NQ6P047562; Sat, 19 Dec 2009 07:23:26 +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: Sat, 19 Dec 2009 07:23:26 +0200 From: Kostik Belousov To: Xin LI Message-ID: <20091219052326.GC2170@deviant.kiev.zoral.com.ua> References: <200912181855.nBIItFMe005161@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <200912181855.nBIItFMe005161@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:23:41 -0000 --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 18 18:55:15 2009 > New Revision: 200677 > URL: http://svn.freebsd.org/changeset/base/200677 >=20 > Log: > MFC r199463: > =20 > rc.early(8) was removed as of 20090530 so remove manual page reference > to it. >=20 > Modified: > stable/8/ObsoleteFiles.inc (contents, props changed) > stable/8/share/man/man8/Makefile > stable/8/share/man/man8/rc.8 > Directory Properties: > stable/8/share/man/man8/ (props changed) >=20 > Modified: stable/8/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/ObsoleteFiles.inc Fri Dec 18 18:45:36 2009 (r200676) > +++ stable/8/ObsoleteFiles.inc Fri Dec 18 18:55:15 2009 (r200677) > @@ -14,6 +14,16 @@ > # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS l= ast. > # > =20 > +# 20091218: removal of rc.early(8) link > +OLD_FILES+=3Dusr/share/man/man8/rc.early.8.gz > +# 20091027: pselect.3 implemented as syscall > +OLD_FILES+=3Dusr/share/man/man3/pselect.3.gz > +# 20091005: fusword.9 and susword.9 removed > +OLD_FILES+=3Dusr/share/man/man9/fusword.9.gz > +OLD_FILES+=3Dusr/share/man/man9/susword.9.gz > +# 20090909: vesa and dpms promoted to be i386/amd64 common > +OLD_FILES+=3Dusr/include/machine/pc/vesa.h > +OLD_FILES+=3Dusr/share/man/man4/i386/dpms.4.gz > # 20090904: remove lukemftpd > OLD_FILES+=3Dusr/libexec/lukemftpd > OLD_FILES+=3Dusr/share/man/man5/ftpd.conf.5.gz This is not only a merge of r199463. You also merged several others unrelated revisions to ObsoleteFiles.inc. At least addition of pselect.3 removal is wrong for stable/8, I still not merged r198508 (but plan to do it really soon). I am not sure about other additions. --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkssY00ACgkQC3+MBN1Mb4jtAACfb2Iyrw4yAVubTJz99PHJa+/9 /TYAoMLS2IHWtuuZ/aXYAxvMR/7373m5 =ES0S -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:28:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAB61065693; Sat, 19 Dec 2009 10:28:24 +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 AFA658FC13; Sat, 19 Dec 2009 10:28: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 nBJASOhA029787; Sat, 19 Dec 2009 10:28:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJASOFa029786; Sat, 19 Dec 2009 10:28:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191028.nBJASOFa029786@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 10:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200710 - in stable/8/sys/amd64: amd64 ia32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:28:25 -0000 Author: kib Date: Sat Dec 19 10:28:24 2009 New Revision: 200710 URL: http://svn.freebsd.org/changeset/base/200710 Log: MFC r200444: For ia32 syscall(), call cpu_set_syscall_retval(). Modified: stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 19 06:36:34 2009 (r200709) +++ stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 19 10:28:24 2009 (r200710) @@ -330,10 +330,14 @@ cpu_set_syscall_retval(struct thread *td case ERESTART: /* - * Reconstruct pc, we know that 'syscall' is 2 bytes. + * Reconstruct pc, we know that 'syscall' is 2 bytes, + * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. + * We saved this in tf_err. * We have to do a full context restore so that %r10 * (which was holding the value of %rcx) is restored * for the next iteration. + * r10 restore is only required for freebsd/amd64 processes, + * but shall be innocent for any ia32 ABI. */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Sat Dec 19 06:36:34 2009 (r200709) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Sat Dec 19 10:28:24 2009 (r200710) @@ -183,35 +183,7 @@ ia32_syscall(struct trapframe *frame) AUDIT_SYSCALL_EXIT(error, td); } - switch (error) { - case 0: - frame->tf_rax = td->td_retval[0]; - frame->tf_rdx = td->td_retval[1]; - frame->tf_rflags &= ~PSL_C; - break; - - case ERESTART: - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, - * int 0x80 is 2 bytes. We saved this in tf_err. - */ - frame->tf_rip -= frame->tf_err; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->tf_rax = error; - frame->tf_rflags |= PSL_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Traced syscall. From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:38:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6883E1065670; Sat, 19 Dec 2009 10:38:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 559EF8FC18; Sat, 19 Dec 2009 10:38: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 nBJAcTkP030077; Sat, 19 Dec 2009 10:38:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAcSH7030072; Sat, 19 Dec 2009 10:38:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191038.nBJAcSH7030072@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200711 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:38:29 -0000 Author: avg Date: Sat Dec 19 10:38:28 2009 New Revision: 200711 URL: http://svn.freebsd.org/changeset/base/200711 Log: MFC r200033: mca: improve status checking, recording and reporting Modified: stable/8/sys/amd64/amd64/mca.c stable/8/sys/amd64/include/mca.h stable/8/sys/i386/i386/mca.c stable/8/sys/i386/include/mca.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mca.c ============================================================================== --- stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:38:28 2009 (r200711) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/8/sys/amd64/include/mca.h ============================================================================== --- stable/8/sys/amd64/include/mca.h Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/amd64/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL Modified: stable/8/sys/i386/i386/mca.c ============================================================================== --- stable/8/sys/i386/i386/mca.c Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/i386/i386/mca.c Sat Dec 19 10:38:28 2009 (r200711) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/8/sys/i386/include/mca.h ============================================================================== --- stable/8/sys/i386/include/mca.h Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/i386/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:41:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A512C1065795; Sat, 19 Dec 2009 10:41:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 922E58FC17; Sat, 19 Dec 2009 10:41: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 nBJAfuL3030197; Sat, 19 Dec 2009 10:41:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAfurO030192; Sat, 19 Dec 2009 10:41:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191041.nBJAfurO030192@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200712 - in stable/7/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:41:56 -0000 Author: avg Date: Sat Dec 19 10:41:56 2009 New Revision: 200712 URL: http://svn.freebsd.org/changeset/base/200712 Log: MFC r200033: mca: improve status checking, recording and reporting Modified: stable/7/sys/amd64/amd64/mca.c stable/7/sys/amd64/include/mca.h stable/7/sys/i386/i386/mca.c stable/7/sys/i386/include/mca.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/mca.c ============================================================================== --- stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:38:28 2009 (r200711) +++ stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:41:56 2009 (r200712) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/7/sys/amd64/include/mca.h ============================================================================== --- stable/7/sys/amd64/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) +++ stable/7/sys/amd64/include/mca.h Sat Dec 19 10:41:56 2009 (r200712) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL Modified: stable/7/sys/i386/i386/mca.c ============================================================================== --- stable/7/sys/i386/i386/mca.c Sat Dec 19 10:38:28 2009 (r200711) +++ stable/7/sys/i386/i386/mca.c Sat Dec 19 10:41:56 2009 (r200712) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/7/sys/i386/include/mca.h ============================================================================== --- stable/7/sys/i386/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) +++ stable/7/sys/i386/include/mca.h Sat Dec 19 10:41:56 2009 (r200712) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:44:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA654106566B; Sat, 19 Dec 2009 10:44:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8A848FC16; Sat, 19 Dec 2009 10:44: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 nBJAiQro030306; Sat, 19 Dec 2009 10:44:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAiQrW030303; Sat, 19 Dec 2009 10:44:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191044.nBJAiQrW030303@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200713 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:44:26 -0000 Author: avg Date: Sat Dec 19 10:44:26 2009 New Revision: 200713 URL: http://svn.freebsd.org/changeset/base/200713 Log: MFC r200064: mca: small enhancements related to cpu quirks Modified: stable/8/sys/amd64/amd64/mca.c stable/8/sys/i386/i386/mca.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mca.c ============================================================================== --- stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:41:56 2009 (r200712) +++ stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:44:26 2009 (r200713) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } Modified: stable/8/sys/i386/i386/mca.c ============================================================================== --- stable/8/sys/i386/i386/mca.c Sat Dec 19 10:41:56 2009 (r200712) +++ stable/8/sys/i386/i386/mca.c Sat Dec 19 10:44:26 2009 (r200713) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:45:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE1B21065672; Sat, 19 Dec 2009 10:45:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC75A8FC13; Sat, 19 Dec 2009 10:45: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 nBJAjvVK030391; Sat, 19 Dec 2009 10:45:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAjvfc030388; Sat, 19 Dec 2009 10:45:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191045.nBJAjvfc030388@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200714 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:45:57 -0000 Author: avg Date: Sat Dec 19 10:45:57 2009 New Revision: 200714 URL: http://svn.freebsd.org/changeset/base/200714 Log: MFC r200064: mca: small enhancements related to cpu quirks Modified: stable/7/sys/amd64/amd64/mca.c stable/7/sys/i386/i386/mca.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/mca.c ============================================================================== --- stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:44:26 2009 (r200713) +++ stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:45:57 2009 (r200714) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } Modified: stable/7/sys/i386/i386/mca.c ============================================================================== --- stable/7/sys/i386/i386/mca.c Sat Dec 19 10:44:26 2009 (r200713) +++ stable/7/sys/i386/i386/mca.c Sat Dec 19 10:45:57 2009 (r200714) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:52:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C757C106566C; Sat, 19 Dec 2009 10:52:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1F78FC17; Sat, 19 Dec 2009 10:52: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 nBJAqWFf030569; Sat, 19 Dec 2009 10:52:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAqWq1030567; Sat, 19 Dec 2009 10:52:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191052.nBJAqWq1030567@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200715 - stable/8/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:52:32 -0000 Author: avg Date: Sat Dec 19 10:52:32 2009 New Revision: 200715 URL: http://svn.freebsd.org/changeset/base/200715 Log: MFC r200602: ichsmb: add another pci id Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:45:57 2009 (r200714) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:52:32 2009 (r200715) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define ID_82801H 0x283e8086 #define ID_82801I 0x29308086 #define ID_82801JI 0x3a308086 +#define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -164,6 +165,9 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH: + device_set_desc(dev, "Intel PCH SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:54:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF77106566B; Sat, 19 Dec 2009 10:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4B78FC14; Sat, 19 Dec 2009 10:54: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 nBJAsTA4030673; Sat, 19 Dec 2009 10:54:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAsTuu030667; Sat, 19 Dec 2009 10:54:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191054.nBJAsTuu030667@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 10:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200716 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:54:29 -0000 Author: kib Date: Sat Dec 19 10:54:29 2009 New Revision: 200716 URL: http://svn.freebsd.org/changeset/base/200716 Log: MFC r197963: Put process-directed signals to the process queue unconditionally, selecting the thread to deliver the signal only by the thread returning to usermode. Change cursig() and postsig() to look both into the thread and process signal queues. MFC r197976: Fix typo. MFC r200082: Remove wrong assertion. Debugee is allowed to lose a signal Modified: stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_thr.c stable/8/sys/kern/subr_trap.c stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 10:54:29 2009 (r200716) @@ -216,6 +216,8 @@ static int sigproptbl[NSIG] = { SA_KILL|SA_PROC, /* SIGUSR2 */ }; +static void reschedule_signals(struct proc *p, sigset_t block); + static void sigqueue_start(void) { @@ -577,20 +579,11 @@ void signotify(struct thread *td) { struct proc *p; - sigset_t set; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); - /* - * If our mask changed we may have to move signal that were - * previously masked by all threads to our sigqueue. - */ - set = p->p_sigqueue.sq_signals; - SIGSETNAND(set, td->td_sigmask); - if (! SIGISEMPTY(set)) - sigqueue_move_set(&p->p_sigqueue, &td->td_sigqueue, &set); if (SIGPENDING(td)) { thread_lock(td); td->td_flags |= TDF_NEEDSIGCHK | TDF_ASTPENDING; @@ -972,24 +965,28 @@ execsigs(struct proc *p) * Manipulate signal mask. */ int -kern_sigprocmask(td, how, set, oset, old) - struct thread *td; - int how; - sigset_t *set, *oset; - int old; +kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, + int old) { + sigset_t new_block, oset1; + struct proc *p; int error; - PROC_LOCK(td->td_proc); + p = td->td_proc; + PROC_LOCK(p); if (oset != NULL) *oset = td->td_sigmask; error = 0; + SIGEMPTYSET(new_block); if (set != NULL) { switch (how) { case SIG_BLOCK: SIG_CANTMASK(*set); + oset1 = td->td_sigmask; SIGSETOR(td->td_sigmask, *set); + new_block = td->td_sigmask; + SIGSETNAND(new_block, oset1); break; case SIG_UNBLOCK: SIGSETNAND(td->td_sigmask, *set); @@ -997,10 +994,13 @@ kern_sigprocmask(td, how, set, oset, old break; case SIG_SETMASK: SIG_CANTMASK(*set); + oset1 = td->td_sigmask; if (old) SIGSETLO(td->td_sigmask, *set); else td->td_sigmask = *set; + new_block = td->td_sigmask; + SIGSETNAND(new_block, oset1); signotify(td); break; default: @@ -1008,7 +1008,20 @@ kern_sigprocmask(td, how, set, oset, old break; } } - PROC_UNLOCK(td->td_proc); + + /* + * The new_block set contains signals that were not previously + * blocked, but are blocked now. + * + * In case we block any signal that was not previously blocked + * for td, and process has the signal pending, try to schedule + * signal delivery to some thread that does not block the signal, + * possibly waking it up. + */ + if (p->p_numthreads != 1) + reschedule_signals(p, new_block); + + PROC_UNLOCK(p); return (error); } @@ -1981,17 +1994,9 @@ tdsignal(struct proc *p, struct thread * KNOTE_LOCKED(&p->p_klist, NOTE_SIGNAL | sig); prop = sigprop(sig); - /* - * If the signal is blocked and not destined for this thread, then - * assign it to the process so that we can find it later in the first - * thread that unblocks it. Otherwise, assign it to this thread now. - */ if (td == NULL) { td = sigtd(p, sig, prop); - if (SIGISMEMBER(td->td_sigmask, sig)) - sigqueue = &p->p_sigqueue; - else - sigqueue = &td->td_sigqueue; + sigqueue = &p->p_sigqueue; } else { KASSERT(td->td_proc == p, ("invalid thread")); sigqueue = &td->td_sigqueue; @@ -2388,6 +2393,62 @@ stopme: return (td->td_xsig); } +static void +reschedule_signals(struct proc *p, sigset_t block) +{ + struct sigacts *ps; + struct thread *td; + int i; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + ps = p->p_sigacts; + for (i = 1; !SIGISEMPTY(block); i++) { + if (!SIGISMEMBER(block, i)) + continue; + SIGDELSET(block, i); + if (!SIGISMEMBER(p->p_siglist, i)) + continue; + + td = sigtd(p, i, 0); + signotify(td); + mtx_lock(&ps->ps_mtx); + if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i)) + tdsigwakeup(td, i, SIG_CATCH, + (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR : + ERESTART)); + mtx_unlock(&ps->ps_mtx); + } +} + +void +tdsigcleanup(struct thread *td) +{ + struct proc *p; + sigset_t unblocked; + + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + sigqueue_flush(&td->td_sigqueue); + if (p->p_numthreads == 1) + return; + + /* + * Since we cannot handle signals, notify signal post code + * about this by filling the sigmask. + * + * Also, if needed, wake up thread(s) that do not block the + * same signals as the exiting thread, since the thread might + * have been selected for delivery and woken up. + */ + SIGFILLSET(unblocked); + SIGSETNAND(unblocked, td->td_sigmask); + SIGFILLSET(td->td_sigmask); + reschedule_signals(p, unblocked); + +} + /* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. @@ -2405,6 +2466,7 @@ issignal(struct thread *td, int stop_all { struct proc *p; struct sigacts *ps; + struct sigqueue *queue; sigset_t sigpending; int sig, prop, newsig; @@ -2416,6 +2478,7 @@ issignal(struct thread *td, int stop_all int traced = (p->p_flag & P_TRACED) || (p->p_stops & S_SIG); sigpending = td->td_sigqueue.sq_signals; + SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); if (p->p_flag & P_PPWAIT) @@ -2436,6 +2499,7 @@ issignal(struct thread *td, int stop_all */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (traced == 0)) { sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); continue; } if (p->p_flag & P_TRACED && (p->p_flag & P_PPWAIT) == 0) { @@ -2448,12 +2512,17 @@ issignal(struct thread *td, int stop_all if (sig != newsig) { ksiginfo_t ksi; + + queue = &td->td_sigqueue; /* * clear old signal. * XXX shrug off debugger, it causes siginfo to * be thrown away. */ - sigqueue_get(&td->td_sigqueue, sig, &ksi); + if (sigqueue_get(queue, sig, &ksi) == 0) { + queue = &p->p_sigqueue; + sigqueue_get(queue, sig, &ksi); + } /* * If parent wants us to take the signal, @@ -2468,7 +2537,7 @@ issignal(struct thread *td, int stop_all * Put the new signal into td_sigqueue. If the * signal is being masked, look for other signals. */ - SIGADDSET(td->td_sigqueue.sq_signals, sig); + SIGADDSET(queue->sq_signals, sig); if (SIGISMEMBER(td->td_sigmask, sig)) continue; signotify(td); @@ -2563,6 +2632,7 @@ issignal(struct thread *td, int stop_all return (sig); } sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ + sigqueue_delete(&p->p_sigqueue, sig); } /* NOTREACHED */ } @@ -2609,7 +2679,9 @@ postsig(sig) ps = p->p_sigacts; mtx_assert(&ps->ps_mtx, MA_OWNED); ksiginfo_init(&ksi); - sigqueue_get(&td->td_sigqueue, sig, &ksi); + if (sigqueue_get(&td->td_sigqueue, sig, &ksi) == 0 && + sigqueue_get(&p->p_sigqueue, sig, &ksi) == 0) + return; ksi.ksi_signo = sig; if (ksi.ksi_code == SI_TIMER) itimer_accept(p, ksi.ksi_timerid, &ksi); Modified: stable/8/sys/kern/kern_thr.c ============================================================================== --- stable/8/sys/kern/kern_thr.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/kern_thr.c Sat Dec 19 10:54:29 2009 (r200716) @@ -282,7 +282,7 @@ thr_exit(struct thread *td, struct thr_e } PROC_LOCK(p); - sigqueue_flush(&td->td_sigqueue); + tdsigcleanup(td); PROC_SLOCK(p); /* Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/subr_trap.c Sat Dec 19 10:54:29 2009 (r200716) @@ -90,6 +90,7 @@ userret(struct thread *td, struct trapfr CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid, td->td_name); +#if 0 #ifdef DIAGNOSTIC /* Check that we called signotify() enough. */ PROC_LOCK(p); @@ -100,6 +101,7 @@ userret(struct thread *td, struct trapfr thread_unlock(td); PROC_UNLOCK(p); #endif +#endif #ifdef KTRACE KTRUSERRET(td); #endif @@ -218,7 +220,14 @@ ast(struct trapframe *framep) ktrcsw(0, 1); #endif } - if (flags & TDF_NEEDSIGCHK) { + + /* + * Check for signals. Unlocked reads of p_pendingcnt or + * p_siglist might cause process-directed signal to be handled + * later. + */ + if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 || + !SIGISEMPTY(p->p_siglist)) { PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 10:54:29 2009 (r200716) @@ -252,9 +252,10 @@ typedef struct sigqueue { /* Return nonzero if process p has an unmasked pending signal. */ #define SIGPENDING(td) \ - (!SIGISEMPTY((td)->td_siglist) && \ - !sigsetmasked(&(td)->td_siglist, &(td)->td_sigmask)) - + ((!SIGISEMPTY((td)->td_siglist) && \ + !sigsetmasked(&(td)->td_siglist, &(td)->td_sigmask)) || \ + (!SIGISEMPTY((td)->td_proc->p_siglist) && \ + !sigsetmasked(&(td)->td_proc->p_siglist, &(td)->td_sigmask))) /* * Return the value of the pseudo-expression ((*set & ~*mask) != 0). This * is an optimized version of SIGISEMPTY() on a temporary variable @@ -336,6 +337,7 @@ void sigexit(struct thread *td, int sign int sig_ffs(sigset_t *set); void siginit(struct proc *p); void signotify(struct thread *td); +void tdsigcleanup(struct thread *td); int tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi); void trapsignal(struct thread *td, ksiginfo_t *); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 10:55:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AFE2106568D; Sat, 19 Dec 2009 10:55:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09C288FC18; Sat, 19 Dec 2009 10:55: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 nBJAtfUq030751; Sat, 19 Dec 2009 10:55:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAtfNx030749; Sat, 19 Dec 2009 10:55:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191055.nBJAtfNx030749@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200717 - stable/7/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:55:42 -0000 Author: avg Date: Sat Dec 19 10:55:41 2009 New Revision: 200717 URL: http://svn.freebsd.org/changeset/base/200717 Log: MFC r200602: ichsmb: add another pci id Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/7/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:54:29 2009 (r200716) +++ stable/7/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:55:41 2009 (r200717) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define ID_82801H 0x283e8086 #define ID_82801I 0x29308086 #define ID_82801JI 0x3a308086 +#define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -164,6 +165,9 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH: + device_set_desc(dev, "Intel PCH SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:05:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A572C106566B; Sat, 19 Dec 2009 11:05:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9428B8FC14; Sat, 19 Dec 2009 11:05: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 nBJB5g3n031046; Sat, 19 Dec 2009 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJB5gtt031044; Sat, 19 Dec 2009 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191105.nBJB5gtt031044@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 11:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200718 - stable/8/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:05:42 -0000 Author: avg Date: Sat Dec 19 11:05:42 2009 New Revision: 200718 URL: http://svn.freebsd.org/changeset/base/200718 Log: MFC r200053,200091: ichsmb: drop default attachment to generic smbus hw Note that r200091 completely overrides r200053 and the merge of the former is recorded for bookkeeping only. r200091 won't be merged to 'more stable' branche(s) because of the POLA. Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:55:41 2009 (r200717) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 11:05:42 2009 (r200718) @@ -175,12 +175,6 @@ ichsmb_pci_probe(device_t dev) device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; default: - if (pci_get_class(dev) == PCIC_SERIALBUS - && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS - && pci_get_progif(dev) == PCIS_SERIALBUS_SMBUS_PROGIF) { - device_set_desc(dev, "SMBus controller"); - return (BUS_PROBE_DEFAULT); /* XXX */ - } return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:10:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B897D106566B; Sat, 19 Dec 2009 11:10:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6FFB8FC21; Sat, 19 Dec 2009 11:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBAXQV031209; Sat, 19 Dec 2009 11:10:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBAXoQ031207; Sat, 19 Dec 2009 11:10:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191110.nBJBAXoQ031207@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 11:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200719 - stable/7/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:10:33 -0000 Author: avg Date: Sat Dec 19 11:10:33 2009 New Revision: 200719 URL: http://svn.freebsd.org/changeset/base/200719 Log: MFC r200053: ichsmb: try attaching only to intel hardware in the default case Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/7/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 11:05:42 2009 (r200718) +++ stable/7/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 11:10:33 2009 (r200719) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ +#define VENDORID_INTEL 0x8086 #define ID_82801AA 0x24138086 #define ID_82801AB 0x24238086 #define ID_82801BA 0x24438086 @@ -175,10 +176,11 @@ ichsmb_pci_probe(device_t dev) device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; default: - if (pci_get_class(dev) == PCIC_SERIALBUS + if (pci_get_vendor(dev) == VENDORID_INTEL + && pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS && pci_get_progif(dev) == PCIS_SERIALBUS_SMBUS_PROGIF) { - device_set_desc(dev, "SMBus controller"); + device_set_desc(dev, "Intel SMBus controller"); return (BUS_PROBE_DEFAULT); /* XXX */ } return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:11:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A876106568B; Sat, 19 Dec 2009 11:11:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 593008FC19; Sat, 19 Dec 2009 11:11: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 nBJBBvUF031284; Sat, 19 Dec 2009 11:11:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBBvAn031282; Sat, 19 Dec 2009 11:11:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191111.nBJBBvAn031282@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200720 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:11:57 -0000 Author: delphij Date: Sat Dec 19 11:11:57 2009 New Revision: 200720 URL: http://svn.freebsd.org/changeset/base/200720 Log: Fix inappropriate merge. Pointed out by: kib Pointy hat to: delphij Modified: stable/8/ObsoleteFiles.inc Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Sat Dec 19 11:10:33 2009 (r200719) +++ stable/8/ObsoleteFiles.inc Sat Dec 19 11:11:57 2009 (r200720) @@ -16,14 +16,6 @@ # 20091218: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz -# 20091027: pselect.3 implemented as syscall -OLD_FILES+=usr/share/man/man3/pselect.3.gz -# 20091005: fusword.9 and susword.9 removed -OLD_FILES+=usr/share/man/man9/fusword.9.gz -OLD_FILES+=usr/share/man/man9/susword.9.gz -# 20090909: vesa and dpms promoted to be i386/amd64 common -OLD_FILES+=usr/include/machine/pc/vesa.h -OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:14:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52F4610656C3; Sat, 19 Dec 2009 11:14:00 +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 405588FC1F; Sat, 19 Dec 2009 11:14:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBE0Ya031367; Sat, 19 Dec 2009 11:14:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBE0lT031362; Sat, 19 Dec 2009 11:14:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191114.nBJBE0lT031362@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200721 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:14:00 -0000 Author: kib Date: Sat Dec 19 11:13:59 2009 New Revision: 200721 URL: http://svn.freebsd.org/changeset/base/200721 Log: MFC r198506: In kern_sigsuspend(), manipulate thread signal mask using kern_sigprocmask(). Also, do cursig/postsig loop immediately after waiting for signal, repeating the wait if wakeup was spurious due to race with other thread fetching signal from the process queue before us. MFC r199136: Use cpu_set_syscall_retval(9) to set syscall result, and return EJUSTRETURN from kern_sigsuspend() to prevent syscall return code from modifying wrong frame. Take care of possibility that pending SIGCONT might be cancelled by SIGSTOP, causing postsig() not to deliver any catched signal. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/kern/kern_sig.c stable/8/sys/sys/signalvar.h stable/8/sys/sys/syscallsubr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:13:59 2009 (r200721) @@ -2579,21 +2579,10 @@ int ofreebsd32_sigsuspend(struct thread *td, struct ofreebsd32_sigsuspend_args *uap) { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } struct sigstack32 { Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 11:13:59 2009 (r200721) @@ -966,14 +966,15 @@ execsigs(struct proc *p) */ int kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, - int old) + int flags) { sigset_t new_block, oset1; struct proc *p; int error; p = td->td_proc; - PROC_LOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_LOCK(p); if (oset != NULL) *oset = td->td_sigmask; @@ -995,7 +996,7 @@ kern_sigprocmask(struct thread *td, int case SIG_SETMASK: SIG_CANTMASK(*set); oset1 = td->td_sigmask; - if (old) + if (flags & SIGPROCMASK_OLD) SIGSETLO(td->td_sigmask, *set); else td->td_sigmask = *set; @@ -1021,7 +1022,8 @@ kern_sigprocmask(struct thread *td, int if (p->p_numthreads != 1) reschedule_signals(p, new_block); - PROC_UNLOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_UNLOCK(p); return (error); } @@ -1454,6 +1456,7 @@ int kern_sigsuspend(struct thread *td, sigset_t mask) { struct proc *p = td->td_proc; + int has_sig, sig; /* * When returning from sigsuspend, we want @@ -1463,16 +1466,29 @@ kern_sigsuspend(struct thread *td, sigse * to indicate this. */ PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; + kern_sigprocmask(td, SIG_SETMASK, &mask, &td->td_oldsigmask, + SIGPROCMASK_PROC_LOCKED); td->td_pflags |= TDP_OLDMASK; - SIG_CANTMASK(mask); - td->td_sigmask = mask; - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", 0) == 0) - /* void */; + + /* + * Process signals now. Otherwise, we can get spurious wakeup + * due to signal entered process queue, but delivered to other + * thread. But sigsuspend should return only on signal + * delivery. + */ + cpu_set_syscall_retval(td, EINTR); + for (has_sig = 0; !has_sig;) { + while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", + 0) == 0) + /* void */; + thread_suspend_check(0); + mtx_lock(&p->p_sigacts->ps_mtx); + while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) + has_sig += postsig(sig); + mtx_unlock(&p->p_sigacts->ps_mtx); + } PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (EJUSTRETURN); } #ifdef COMPAT_43 /* XXX - COMPAT_FBSD3 */ @@ -1491,21 +1507,10 @@ osigsuspend(td, uap) struct thread *td; struct osigsuspend_args *uap; { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } #endif /* COMPAT_43 */ @@ -2662,7 +2667,7 @@ thread_stopped(struct proc *p) * Take the action for the specified signal * from the current set of pending signals. */ -void +int postsig(sig) register int sig; { @@ -2681,7 +2686,7 @@ postsig(sig) ksiginfo_init(&ksi); if (sigqueue_get(&td->td_sigqueue, sig, &ksi) == 0 && sigqueue_get(&p->p_sigqueue, sig, &ksi) == 0) - return; + return (0); ksi.ksi_signo = sig; if (ksi.ksi_code == SI_TIMER) itimer_accept(p, ksi.ksi_timerid, &ksi); @@ -2747,6 +2752,7 @@ postsig(sig) } (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); } + return (1); } /* Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 11:13:59 2009 (r200721) @@ -316,6 +316,10 @@ extern int kern_logsigexit; /* Sysctl va #define SIG_STOP_ALLOWED 100 #define SIG_STOP_NOT_ALLOWED 101 +/* flags for kern_sigprocmask */ +#define SIGPROCMASK_OLD 0x0001 +#define SIGPROCMASK_PROC_LOCKED 0x0002 + /* * Machine-independent functions: */ @@ -325,7 +329,7 @@ void gsignal(int pgid, int sig); void killproc(struct proc *p, char *why); void pgsigio(struct sigio **, int signum, int checkctty); void pgsignal(struct pgrp *pgrp, int sig, int checkctty); -void postsig(int sig); +int postsig(int sig); void psignal(struct proc *p, int sig); int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *); struct sigacts *sigacts_alloc(void); @@ -359,7 +363,8 @@ void sigqueue_delete_stopmask_proc(struc void sigqueue_take(ksiginfo_t *ksi); int kern_sigtimedwait(struct thread *, sigset_t, ksiginfo_t *, struct timespec *); - +int kern_sigprocmask(struct thread *td, int how, + sigset_t *set, sigset_t *oset, int flags); /* * Machine-dependent functions: */ Modified: stable/8/sys/sys/syscallsubr.h ============================================================================== --- stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:13:59 2009 (r200721) @@ -190,8 +190,6 @@ int kern_shmctl(struct thread *td, int s int kern_sigaction(struct thread *td, int sig, struct sigaction *act, struct sigaction *oact, int flags); int kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); -int kern_sigprocmask(struct thread *td, int how, - sigset_t *set, sigset_t *oset, int old); int kern_sigsuspend(struct thread *td, sigset_t mask); int kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:31:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E800910656BE; Sat, 19 Dec 2009 11:31:28 +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 D26B88FC15; Sat, 19 Dec 2009 11:31: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 nBJBVSKi031779; Sat, 19 Dec 2009 11:31:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBVSIW031761; Sat, 19 Dec 2009 11:31:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191131.nBJBVSIW031761@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200722 - in stable/8/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm compat/freebsd32 i386/i386 i386/linux ia64/ia64 kern mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc6... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:31:29 -0000 Author: kib Date: Sat Dec 19 11:31:28 2009 New Revision: 200722 URL: http://svn.freebsd.org/changeset/base/200722 Log: MFC r198507: Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals. MFC r198590: Trapsignal() calls kern_sigprocmask() when delivering catched signal with proc lock held. MFC r198670: For trapsignal() and postsig(), kern_sigprocmask() is called with both process lock and curproc->p_sigacts->ps_mtx locked. Prevent lock recursion on ps_mtx in reschedule_signals(). Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/amd64/linux32/linux32_sysvec.c stable/8/sys/arm/arm/machdep.c stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/linux/linux_sysvec.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/kern/kern_context.c stable/8/sys/kern/kern_sig.c stable/8/sys/mips/mips/pm_machdep.c stable/8/sys/pc98/pc98/machdep.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sun4v/sun4v/machdep.c stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/amd64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -415,7 +415,7 @@ sigreturn(td, uap) ucontext_t uc; struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; long rflags; int cs, error, ret; ksiginfo_t ksi; @@ -478,7 +478,6 @@ sigreturn(td, uap) td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase; td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase; - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -486,10 +485,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/ia32/ia32_signal.c Sat Dec 19 11:31:28 2009 (r200722) @@ -244,10 +244,8 @@ freebsd32_setcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -273,10 +271,8 @@ freebsd32_swapcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -544,9 +540,8 @@ freebsd4_freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext4 *ucp; + struct ia32_ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -610,11 +605,7 @@ freebsd4_freebsd32_sigreturn(td, uap) regs->tf_fs = ucp->uc_mcontext.mc_fs; regs->tf_gs = ucp->uc_mcontext.mc_gs; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } @@ -631,9 +622,8 @@ freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext *ucp; + struct ia32_ucontext *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -702,11 +692,7 @@ freebsd32_sigreturn(td, uap) regs->tf_gs = ucp->uc_mcontext.mc_gs; regs->tf_flags = TF_HASSEGS; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Sat Dec 19 11:31:28 2009 (r200722) @@ -565,9 +565,9 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; + sigset_t bmask; l_sigset_t lmask; int eflags, i; ksiginfo_t ksi; @@ -623,11 +623,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -666,9 +663,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -725,11 +722,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: stable/8/sys/arm/arm/machdep.c ============================================================================== --- stable/8/sys/arm/arm/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/arm/arm/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -605,7 +605,6 @@ sigreturn(td, uap) const struct __ucontext *sigcntxp; } */ *uap; { - struct proc *p = td->td_proc; struct sigframe sf; struct trapframe *tf; int spsr; @@ -627,11 +626,7 @@ sigreturn(td, uap) set_mcontext(td, &sf.sf_uc.uc_mcontext); /* Restore signal mask. */ - PROC_LOCK(p); - td->td_sigmask = sf.sf_uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &sf.sf_uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:31:28 2009 (r200722) @@ -2482,7 +2482,7 @@ ofreebsd32_sigprocmask(struct thread *td int error; OSIG2SIG(uap->mask, set); - error = kern_sigprocmask(td, uap->how, &set, &oset, 1); + error = kern_sigprocmask(td, uap->how, &set, &oset, SIGPROCMASK_OLD); SIG2OSIG(oset, td->td_retval[0]); return (error); } @@ -2546,15 +2546,11 @@ int ofreebsd32_sigblock(struct thread *td, struct ofreebsd32_sigblock_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -2562,16 +2558,11 @@ int ofreebsd32_sigsetmask(struct thread *td, struct ofreebsd32_sigsetmask_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/i386/i386/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -756,7 +756,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -856,17 +855,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -883,9 +879,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -973,18 +968,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -1000,9 +990,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1094,7 +1083,6 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -1102,10 +1090,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/8/sys/i386/linux/linux_sysvec.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/i386/linux/linux_sysvec.c Sat Dec 19 11:31:28 2009 (r200722) @@ -667,10 +667,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; l_sigset_t lmask; + sigset_t bmask; int eflags, i; ksiginfo_t ksi; @@ -725,11 +725,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -767,9 +764,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -826,11 +823,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/ia64/ia64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -1119,11 +1119,9 @@ sigreturn(struct thread *td, { ucontext_t uc; struct trapframe *tf; - struct proc *p; struct pcb *pcb; tf = td->td_frame; - p = td->td_proc; pcb = td->td_pcb; /* @@ -1135,17 +1133,13 @@ sigreturn(struct thread *td, set_mcontext(td, &uc.uc_mcontext); - PROC_LOCK(p); #if defined(COMPAT_43) if (sigonstack(tf->tf_special.sp)) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/kern/kern_context.c ============================================================================== --- stable/8/sys/kern/kern_context.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/kern/kern_context.c Sat Dec 19 11:31:28 2009 (r200722) @@ -89,10 +89,8 @@ setcontext(struct thread *td, struct set if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, + NULL, 0); } } } @@ -118,10 +116,8 @@ swapcontext(struct thread *td, struct sw if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 11:31:28 2009 (r200722) @@ -216,7 +216,7 @@ static int sigproptbl[NSIG] = { SA_KILL|SA_PROC, /* SIGUSR2 */ }; -static void reschedule_signals(struct proc *p, sigset_t block); +static void reschedule_signals(struct proc *p, sigset_t block, int flags); static void sigqueue_start(void) @@ -1020,7 +1020,7 @@ kern_sigprocmask(struct thread *td, int * possibly waking it up. */ if (p->p_numthreads != 1) - reschedule_signals(p, new_block); + reschedule_signals(p, new_block, flags); if (!(flags & SIGPROCMASK_PROC_LOCKED)) PROC_UNLOCK(p); @@ -1392,15 +1392,11 @@ osigblock(td, uap) register struct thread *td; struct osigblock_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -1414,16 +1410,11 @@ osigsetmask(td, uap) struct thread *td; struct osigsetmask_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } #endif /* COMPAT_43 */ @@ -1839,6 +1830,7 @@ void trapsignal(struct thread *td, ksiginfo_t *ksi) { struct sigacts *ps; + sigset_t mask; struct proc *p; int sig; int code; @@ -1861,9 +1853,11 @@ trapsignal(struct thread *td, ksiginfo_t #endif (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); - SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); + mask = ps->ps_catchmask[_SIG_IDX(sig)]; if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* * See kern_sigaction() for origin of this code. @@ -2399,7 +2393,7 @@ stopme: } static void -reschedule_signals(struct proc *p, sigset_t block) +reschedule_signals(struct proc *p, sigset_t block, int flags) { struct sigacts *ps; struct thread *td; @@ -2417,12 +2411,14 @@ reschedule_signals(struct proc *p, sigse td = sigtd(p, i, 0); signotify(td); - mtx_lock(&ps->ps_mtx); + if (!(flags & SIGPROCMASK_PS_LOCKED)) + mtx_lock(&ps->ps_mtx); if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i)) tdsigwakeup(td, i, SIG_CATCH, (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR : ERESTART)); - mtx_unlock(&ps->ps_mtx); + if (!(flags & SIGPROCMASK_PS_LOCKED)) + mtx_unlock(&ps->ps_mtx); } } @@ -2450,7 +2446,7 @@ tdsigcleanup(struct thread *td) SIGFILLSET(unblocked); SIGSETNAND(unblocked, td->td_sigmask); SIGFILLSET(td->td_sigmask); - reschedule_signals(p, unblocked); + reschedule_signals(p, unblocked, 0); } @@ -2676,7 +2672,7 @@ postsig(sig) struct sigacts *ps; sig_t action; ksiginfo_t ksi; - sigset_t returnmask; + sigset_t returnmask, mask; KASSERT(sig != 0, ("postsig")); @@ -2731,9 +2727,11 @@ postsig(sig) } else returnmask = td->td_sigmask; - SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); + mask = ps->ps_catchmask[_SIG_IDX(sig)]; if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* Modified: stable/8/sys/mips/mips/pm_machdep.c ============================================================================== --- stable/8/sys/mips/mips/pm_machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/mips/mips/pm_machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -213,13 +213,11 @@ int sigreturn(struct thread *td, struct sigreturn_args *uap) { struct trapframe *regs; - const ucontext_t *ucp; - struct proc *p; + ucontext_t *ucp; ucontext_t uc; int error; ucp = &uc; - p = td->td_proc; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) @@ -229,7 +227,7 @@ sigreturn(struct thread *td, struct sigr /* #ifdef DEBUG */ if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { - printf("sigreturn: pid %d, ucp %p\n", p->p_pid, ucp); + printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp); printf(" old sp %x ra %x pc %x\n", regs->sp, regs->ra, regs->pc); printf(" new sp %x ra %x pc %x z %x\n", @@ -253,11 +251,8 @@ sigreturn(struct thread *td, struct sigr regs->mullo = ucp->uc_mcontext.mullo; regs->mulhi = ucp->uc_mcontext.mulhi; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + return(EJUSTRETURN); } Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/pc98/pc98/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -686,7 +686,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -786,17 +785,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -813,9 +809,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -903,18 +898,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -930,9 +920,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1024,18 +1013,14 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); return (EJUSTRETURN); } Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/powerpc/aim/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -695,7 +695,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -710,12 +709,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/powerpc/booke/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -664,7 +664,6 @@ set_mcontext(struct thread *td, const mc int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -679,12 +678,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sparc64/sparc64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -653,11 +653,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); Modified: stable/8/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sun4v/sun4v/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -667,11 +667,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 11:31:28 2009 (r200722) @@ -319,6 +319,7 @@ extern int kern_logsigexit; /* Sysctl va /* flags for kern_sigprocmask */ #define SIGPROCMASK_OLD 0x0001 #define SIGPROCMASK_PROC_LOCKED 0x0002 +#define SIGPROCMASK_PS_LOCKED 0x0004 /* * Machine-independent functions: From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:41:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51309106566B; Sat, 19 Dec 2009 11:41:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401138FC08; Sat, 19 Dec 2009 11:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBfrGV032078; Sat, 19 Dec 2009 11:41:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBfrlP032076; Sat, 19 Dec 2009 11:41:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912191141.nBJBfrlP032076@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 19 Dec 2009 11:41: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: r200723 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:41:53 -0000 Author: trasz Date: Sat Dec 19 11:41:52 2009 New Revision: 200723 URL: http://svn.freebsd.org/changeset/base/200723 Log: Interpret VAPPEND correctly in vaccess_acl_nfs4(9). Modified: head/sys/kern/subr_acl_nfs4.c Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Sat Dec 19 11:31:28 2009 (r200722) +++ head/sys/kern/subr_acl_nfs4.c Sat Dec 19 11:41:52 2009 (r200723) @@ -82,6 +82,13 @@ _access_mask_from_accmode(accmode_t accm access_mask |= accmode2mask[i].mask; } + /* + * VAPPEND is just a modifier for VWRITE; if the caller asked + * for 'VAPPEND | VWRITE', we want to check for ACL_APPEND_DATA only. + */ + if (access_mask & ACL_APPEND_DATA) + access_mask &= ~ACL_WRITE_DATA; + return (access_mask); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:43:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9A231065670; Sat, 19 Dec 2009 11:43:39 +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 C64738FC12; Sat, 19 Dec 2009 11:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBhdJJ032151; Sat, 19 Dec 2009 11:43:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBhdv4032147; Sat, 19 Dec 2009 11:43:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191143.nBJBhdv4032147@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200724 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:43:39 -0000 Author: delphij Date: Sat Dec 19 11:43:39 2009 New Revision: 200724 URL: http://svn.freebsd.org/changeset/base/200724 Log: Apply fix Solaris bug 6462803 zfs snapshot -r failed because filesystem was busy. Submitted by: mm Approved by: pjd MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sat Dec 19 11:41:52 2009 (r200723) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sat Dec 19 11:43:39 2009 (r200724) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Print intent log header and statistics. */ @@ -345,8 +343,10 @@ dump_intent_log(zilog_t *zilog) if (zh->zh_log.blk_birth == 0 || verbose < 2) return; - (void) printf("\n ZIL header: claim_txg %llu, seq %llu\n", - (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_replay_seq); + (void) printf("\n ZIL header: claim_txg %llu, claim_seq %llu", + (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_claim_seq); + (void) printf(" replay_seq %llu, flags 0x%llx\n", + (u_longlong_t)zh->zh_replay_seq, (u_longlong_t)zh->zh_flags); if (verbose >= 4) print_log_bp(&zh->zh_log, "\n\tfirst block: "); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sat Dec 19 11:41:52 2009 (r200723) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sat Dec 19 11:43:39 2009 (r200724) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -56,10 +56,16 @@ typedef struct zil_header { uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ uint64_t zh_claim_seq; /* highest claimed sequence number */ - uint64_t zh_pad[5]; + uint64_t zh_flags; /* header flags */ + uint64_t zh_pad[4]; } zil_header_t; /* + * zh_flags bit settings + */ +#define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */ + +/* * Log block trailer - structure at the end of the header and each log block * * The zit_bt contains a zbt_cksum which for the intent log is Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 19 11:41:52 2009 (r200723) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 19 11:43:39 2009 (r200724) @@ -502,6 +502,25 @@ zil_rollback_destroy(zilog_t *zilog, dmu tx, zh->zh_claim_txg); } +/* + * return true if the initial log block is not valid + */ +static boolean_t +zil_empty(zilog_t *zilog) +{ + const zil_header_t *zh = zilog->zl_header; + arc_buf_t *abuf = NULL; + + if (BP_IS_HOLE(&zh->zh_log)) + return (B_TRUE); + + if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) + return (B_TRUE); + + VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); + return (B_FALSE); +} + int zil_claim(char *osname, void *txarg) { @@ -522,6 +541,21 @@ zil_claim(char *osname, void *txarg) zh = zil_header_in_syncing_context(zilog); /* + * Record here whether the zil has any records to replay. + * If the header block pointer is null or the block points + * to the stubby then we know there are no valid log records. + * We use the header to store this state as the the zilog gets + * freed later in dmu_objset_close(). + * The flags (and the rest of the header fields) are cleared in + * zil_sync() as a result of a zil_destroy(), after replaying the log. + * + * Note, the intent log can be empty but still need the + * stubby to be claimed. + */ + if (!zil_empty(zilog)) + zh->zh_flags |= ZIL_REPLAY_NEEDED; + + /* * Claim all log blocks if we haven't already done so, and remember * the highest claimed sequence number. This ensures that if we can * read only part of the log now (e.g. due to a missing device), @@ -1345,25 +1379,6 @@ zil_free(zilog_t *zilog) } /* - * return true if the initial log block is not valid - */ -static boolean_t -zil_empty(zilog_t *zilog) -{ - const zil_header_t *zh = zilog->zl_header; - arc_buf_t *abuf = NULL; - - if (BP_IS_HOLE(&zh->zh_log)) - return (B_TRUE); - - if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) - return (B_TRUE); - - VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); - return (B_FALSE); -} - -/* * Open an intent log. */ zilog_t * @@ -1418,7 +1433,7 @@ zil_suspend(zilog_t *zilog) const zil_header_t *zh = zilog->zl_header; mutex_enter(&zilog->zl_lock); - if (zh->zh_claim_txg != 0) { /* unplayed log */ + if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */ mutex_exit(&zilog->zl_lock); return (EBUSY); } @@ -1645,7 +1660,7 @@ zil_replay(objset_t *os, void *arg, uint const zil_header_t *zh = zilog->zl_header; zil_replay_arg_t zr; - if (zil_empty(zilog)) { + if ((zh->zh_flags & ZIL_REPLAY_NEEDED) == 0) { zil_destroy(zilog, B_TRUE); return; } From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:47:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BADD106568B; Sat, 19 Dec 2009 11:47:01 +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 06C808FC1B; Sat, 19 Dec 2009 11:47: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 nBJBl1dH032269; Sat, 19 Dec 2009 11:47:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBl0G2032256; Sat, 19 Dec 2009 11:47:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191147.nBJBl0G2032256@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200725 - in stable/8: lib/libc/gen lib/libc/sys lib/libthr/thread sys/compat/freebsd32 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:47:01 -0000 Author: kib Date: Sat Dec 19 11:47:00 2009 New Revision: 200725 URL: http://svn.freebsd.org/changeset/base/200725 Log: MFC r198508, r198509: Reimplement pselect() in kernel, making change of sigmask and sleep atomic. MFC r198538: Move pselect(3) man page to section 2. Added: stable/8/lib/libc/sys/pselect.2 - copied unchanged from r198538, head/lib/libc/sys/pselect.2 Deleted: stable/8/lib/libc/gen/pselect.3 stable/8/lib/libc/gen/pselect.c Modified: stable/8/lib/libc/gen/Makefile.inc stable/8/lib/libc/gen/Symbol.map stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libthr/thread/thr_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/subr_trap.c stable/8/sys/kern/sys_generic.c stable/8/sys/kern/syscalls.master stable/8/sys/sys/syscallsubr.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libc/gen/Makefile.inc ============================================================================== --- stable/8/lib/libc/gen/Makefile.inc Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/gen/Makefile.inc Sat Dec 19 11:47:00 2009 (r200725) @@ -22,7 +22,7 @@ SRCS+= __getosreldate.c __xuname.c \ initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ - pause.c pmadvise.c popen.c posix_spawn.c pselect.c \ + pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ scandir.c seed48.c seekdir.c sem.c semctl.c \ @@ -63,7 +63,7 @@ MAN+= alarm.3 arc4random.3 \ posix_spawnattr_getpgroup.3 posix_spawnattr_getschedparam.3 \ posix_spawnattr_getschedpolicy.3 posix_spawnattr_init.3 \ posix_spawnattr_getsigdefault.3 posix_spawnattr_getsigmask.3 \ - pselect.3 psignal.3 pwcache.3 \ + psignal.3 pwcache.3 \ raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \ scandir.3 sem_destroy.3 sem_getvalue.3 sem_init.3 \ sem_open.3 sem_post.3 sem_timedwait.3 sem_wait.3 \ Modified: stable/8/lib/libc/gen/Symbol.map ============================================================================== --- stable/8/lib/libc/gen/Symbol.map Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/gen/Symbol.map Sat Dec 19 11:47:00 2009 (r200725) @@ -223,7 +223,6 @@ FBSD_1.0 { posix_madvise; popen; pclose; - pselect; psignal; raise; readdir; @@ -453,7 +452,6 @@ FBSDprivate_1.0 { __opendir2; __pause; _pause; - __pselect; __pw_scan; /* Used by (at least) libutil */ __raise; _raise; Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/sys/Makefile.inc Sat Dec 19 11:47:00 2009 (r200725) @@ -83,7 +83,8 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 ptrace.2 quotactl.2 \ + pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 \ + pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 .if !defined(NO_P1003_1B) Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/sys/Symbol.map Sat Dec 19 11:47:00 2009 (r200725) @@ -211,6 +211,7 @@ FBSD_1.0 { posix_openpt; preadv; profil; + pselect; ptrace; pwritev; quotactl; @@ -779,6 +780,8 @@ FBSDprivate_1.0 { __sys_preadv; _profil; __sys_profil; + _pselect; + __sys_pselect; _ptrace; __sys_ptrace; _pwritev; Copied: stable/8/lib/libc/sys/pselect.2 (from r198538, head/lib/libc/sys/pselect.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/pselect.2 Sat Dec 19 11:47:00 2009 (r200725, copy of r198538, head/lib/libc/sys/pselect.2) @@ -0,0 +1,122 @@ +.\" +.\" Copyright 2002 Massachusetts Institute of Technology +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that both the above copyright notice and this +.\" permission notice appear in all copies, that both the above +.\" copyright notice and this permission notice appear in all +.\" supporting documentation, and that the name of M.I.T. not be used +.\" in advertising or publicity pertaining to distribution of the +.\" software without specific, written prior permission. M.I.T. makes +.\" no representations about the suitability of this software for any +.\" purpose. It is provided "as is" without express or implied +.\" warranty. +.\" +.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS +.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT +.\" SHALL M.I.T. 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 October 27, 2009 +.Dt PSELECT 2 +.Os +.Sh NAME +.Nm pselect +.Nd synchronous I/O multiplexing a la POSIX.1g +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/select.h +.Ft int +.Fo pselect +.Fa "int nfds" +.Fa "fd_set * restrict readfds" +.Fa "fd_set * restrict writefds" +.Fa "fd_set * restrict exceptfds" +.Fa "const struct timespec * restrict timeout" +.Fa "const sigset_t * restrict newsigmask" +.Fc +.Sh DESCRIPTION +The +.Fn pselect +function was introduced by +.St -p1003.1g-2000 +as a slightly stronger version of +.Xr select 2 . +The +.Fa nfds , readfds , writefds , +and +.Fa exceptfds +arguments are all identical to the analogous arguments of +.Fn select . +The +.Fa timeout +argument in +.Fn pselect +points to a +.Vt "const struct timespec" +rather than the (modifiable) +.Vt "struct timeval" +used by +.Fn select ; +as in +.Fn select , +a null pointer may be passed to indicate that +.Fn pselect +should wait indefinitely. +Finally, +.Fa newsigmask +specifies a signal mask which is set while waiting for input. +When +.Fn pselect +returns, the original signal mask is restored. +.Pp +See +.Xr select 2 +for a more detailed discussion of the semantics of this interface, and +for macros used to manipulate the +.Vt "fd_set" +data type. +.Sh RETURN VALUES +The +.Fn pselect +function returns the same values and under the same conditions as +.Fn select . +.Sh ERRORS +The +.Fn pselect +function may fail for any of the reasons documented for +.Xr select 2 +and (if a signal mask is provided) +.Xr sigprocmask 2 . +.Sh SEE ALSO +.Xr kqueue 2 , +.Xr poll 2 , +.Xr select 2 , +.Xr sigprocmask 2 +.Sh STANDARDS +The +.Fn pselect +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn pselect +function first appeared in +.Fx 5.0 . +.Sh AUTHORS +The first implementation of +.Fn pselect +function and this manual page were written by +.An Garrett Wollman Aq wollman@FreeBSD.org . Modified: stable/8/lib/libthr/thread/thr_syscalls.c ============================================================================== --- stable/8/lib/libthr/thread/thr_syscalls.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libthr/thread/thr_syscalls.c Sat Dec 19 11:47:00 2009 (r200725) @@ -104,6 +104,8 @@ extern int __sys_accept(int, struct sock extern int __sys_connect(int, const struct sockaddr *, socklen_t); extern int __sys_fsync(int); extern int __sys_msync(void *, size_t, int); +extern int __sys_pselect(int, fd_set *, fd_set *, fd_set *, + const struct timespec *, const sigset_t *); extern int __sys_poll(struct pollfd *, unsigned, int); extern ssize_t __sys_recv(int, void *, size_t, int); extern ssize_t __sys_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); @@ -366,7 +368,7 @@ ___pselect(int count, fd_set *rfds, fd_s int ret; _thr_cancel_enter(curthread); - ret = __pselect(count, rfds, wfds, efds, timo, mask); + ret = __sys_pselect(count, rfds, wfds, efds, timo, mask); _thr_cancel_leave(curthread); return (ret); Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:47:00 2009 (r200725) @@ -593,6 +593,41 @@ freebsd32_select(struct thread *td, stru sizeof(int32_t) * 8)); } +int +freebsd32_pselect(struct thread *td, struct freebsd32_pselect_args *uap) +{ + struct timespec32 ts32; + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts32, sizeof(ts32)); + if (error != 0) + return (error); + CP(ts32, ts, tv_sec); + CP(ts32, ts, tv_nsec); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + /* + * XXX big-endian needs to convert the fd_sets too. + * XXX Do pointers need PTRIN()? + */ + error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, sizeof(int32_t) * 8); + return (error); +} + /* * Copy 'count' items into the destination list pointed to by uap->eventlist. */ Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/compat/freebsd32/syscalls.master Sat Dec 19 11:47:00 2009 (r200725) @@ -913,3 +913,7 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int freebsd32_pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec32 *ts, \ + const sigset_t *sm); } Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/subr_trap.c Sat Dec 19 11:47:00 2009 (r200725) @@ -245,6 +245,11 @@ ast(struct trapframe *framep) PROC_UNLOCK(p); } + if (td->td_pflags & TDP_OLDMASK) { + td->td_pflags &= ~TDP_OLDMASK; + kern_sigprocmask(td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0); + } + userret(td, framep); mtx_assert(&Giant, MA_NOTOWNED); } Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/sys_generic.c Sat Dec 19 11:47:00 2009 (r200725) @@ -751,6 +751,58 @@ poll_no_poll(int events) return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } +int +pselect(struct thread *td, struct pselect_args *uap) +{ + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts, sizeof(ts)); + if (error != 0) + return (error); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + return (kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, NFDBITS)); +} + +int +kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, + struct timeval *tvp, sigset_t *uset, int abi_nfdbits) +{ + int error; + + if (uset != NULL) { + error = kern_sigprocmask(td, SIG_SETMASK, uset, + &td->td_oldsigmask, 0); + if (error != 0) + return (error); + td->td_pflags |= TDP_OLDMASK; + /* + * Make sure that ast() is called on return to + * usermode and TDP_OLDMASK is cleared, restoring old + * sigmask. + */ + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + } + error = kern_select(td, nd, in, ou, ex, tvp, abi_nfdbits); + return (error); +} + #ifndef _SYS_SYSPROTO_H_ struct select_args { int nd; @@ -759,9 +811,7 @@ struct select_args { }; #endif int -select(td, uap) - register struct thread *td; - register struct select_args *uap; +select(struct thread *td, struct select_args *uap) { struct timeval tv, *tvp; int error; Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/syscalls.master Sat Dec 19 11:47:00 2009 (r200725) @@ -919,5 +919,9 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec *ts, \ + const sigset_t *sm); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/8/sys/sys/syscallsubr.h ============================================================================== --- stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:47:00 2009 (r200725) @@ -148,6 +148,8 @@ int kern_pathconf(struct thread *td, cha int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); +int kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, + fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data); int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:47:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76EA010656A4; Sat, 19 Dec 2009 11:47:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63F878FC15; Sat, 19 Dec 2009 11:47: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 nBJBlM2D032323; Sat, 19 Dec 2009 11:47:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBlM9a032318; Sat, 19 Dec 2009 11:47:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191147.nBJBlM9a032318@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:47: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: r200726 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:47:22 -0000 Author: delphij Date: Sat Dec 19 11:47:22 2009 New Revision: 200726 URL: http://svn.freebsd.org/changeset/base/200726 Log: Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG (onnv revision 8986) Requested by: mm Submitted by: pjd Obtained from: OpenSolaris MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Dec 19 11:47:22 2009 (r200726) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -108,19 +106,51 @@ dmu_object_claim(objset_t *os, uint64_t int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) + int blocksize, dmu_object_type_t bonustype, int bonuslen) { dnode_t *dn; + dmu_tx_t *tx; + int nblkptr; int err; - if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) + if (object == DMU_META_DNODE_OBJECT) return (EBADF); err = dnode_hold_impl(os->os, object, DNODE_MUST_BE_ALLOCATED, FTAG, &dn); if (err) return (err); + + if (dn->dn_type == ot && dn->dn_datablksz == blocksize && + dn->dn_bonustype == bonustype && dn->dn_bonuslen == bonuslen) { + /* nothing is changing, this is a noop */ + dnode_rele(dn, FTAG); + return (0); + } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + dnode_rele(dn, FTAG); + return (err); + } + + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + + /* + * If we are losing blkptrs or changing the block size this must + * be a new file instance. We must clear out the previous file + * contents before we can change this type of metadata in the dnode. + */ + if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) + dmu_free_long_range(os, object, 0, DMU_OBJECT_END); + dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx); + + dmu_tx_commit(tx); + dnode_rele(dn, FTAG); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:22 2009 (r200726) @@ -829,11 +829,6 @@ restore_object(struct restorearg *ra, ob int err; dmu_tx_t *tx; - err = dmu_object_info(os, drro->drr_object, NULL); - - if (err != 0 && err != ENOENT) - return (EINVAL); - if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || drro->drr_bonustype >= DMU_OT_NUMTYPES || @@ -846,12 +841,15 @@ restore_object(struct restorearg *ra, ob return (EINVAL); } - tx = dmu_tx_create(os); + err = dmu_object_info(os, drro->drr_object, NULL); + + if (err != 0 && err != ENOENT) + return (EINVAL); if (err == ENOENT) { /* currently free, want to be allocated */ + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, DMU_NEW_OBJECT); - dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, 1); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); @@ -860,28 +858,23 @@ restore_object(struct restorearg *ra, ob err = dmu_object_claim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); + dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - dmu_tx_hold_bonus(tx, drro->drr_object); - /* - * We may change blocksize and delete old content, - * so need to hold_write and hold_free. - */ - dmu_tx_hold_write(tx, drro->drr_object, 0, 1); - dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err) { - dmu_tx_abort(tx); - return (err); - } err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen); } - if (err) { - dmu_tx_commit(tx); + if (err) return (EINVAL); + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, drro->drr_object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + return (err); } dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Dec 19 11:47:22 2009 (r200726) @@ -415,8 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, nblkptr; - dmu_buf_impl_t *db = NULL; + int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE); @@ -428,42 +427,25 @@ dnode_reallocate(dnode_t *dn, dmu_object ASSERT3U(bonustype, <, DMU_OT_NUMTYPES); ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN); - for (i = 0; i < TXG_SIZE; i++) - ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - /* clean up any unreferenced dbufs */ dnode_evict_dbufs(dn); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); - - /* - * XXX I should really have a generation number to tell if we - * need to do this... - */ - if (blocksize != dn->dn_datablksz || - dn->dn_bonustype != bonustype || dn->dn_bonuslen != bonuslen) { - /* free all old data */ - dnode_free_range(dn, 0, -1ULL, tx); - } - - nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); - /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (blocksize != dn->dn_datablksz && - (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || - list_head(&dn->dn_dbufs) != NULL)) { - db = dbuf_hold(dn, 0, FTAG); - dbuf_new_size(db, blocksize, tx); - } - dnode_setdblksz(dn, blocksize); dnode_setdirty(dn, tx); - dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; - dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_datablksz != blocksize) { + /* change blocksize */ + ASSERT(dn->dn_maxblkid == 0 && + (BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || + dnode_block_freed(dn, 0))); + dnode_setdblksz(dn, blocksize); + dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + } + if (dn->dn_bonuslen != bonuslen) + dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); if (dn->dn_nblkptr != nblkptr) dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); - if (db) - dbuf_rele(db, FTAG); /* change type */ dn->dn_type = ot; @@ -1187,11 +1169,6 @@ dnode_block_freed(dnode_t *dn, uint64_t if (dn->dn_free_txg) return (TRUE); - /* - * If dn_datablkshift is not set, then there's only a single - * block, in which case there will never be a free range so it - * won't matter. - */ range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Dec 19 11:47:22 2009 (r200726) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -237,7 +237,7 @@ uint64_t dmu_object_alloc(objset_t *os, int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx); int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx); + int blocksize, dmu_object_type_t bonustype, int bonuslen); /* * Free an object from this objset. From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:49:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB5C1065676; Sat, 19 Dec 2009 11:49:21 +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 0FA408FC1C; Sat, 19 Dec 2009 11:49: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 nBJBnKOX032413; Sat, 19 Dec 2009 11:49:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBnKjg032411; Sat, 19 Dec 2009 11:49:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191149.nBJBnKjg032411@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:49: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: r200727 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:49:21 -0000 Author: delphij Date: Sat Dec 19 11:49:20 2009 New Revision: 200727 URL: http://svn.freebsd.org/changeset/base/200727 Log: Apply fix for Solaris bug 6462803: zfs snapshot -r failed because filesystem was busy (onnv revision 8989) Submitted by: mm Approved by: pjd Obtained from: OpenSolaris MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:22 2009 (r200726) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:49:20 2009 (r200727) @@ -828,6 +828,7 @@ restore_object(struct restorearg *ra, ob { int err; dmu_tx_t *tx; + void *data = NULL; if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || @@ -869,6 +870,12 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -880,18 +887,13 @@ restore_object(struct restorearg *ra, ob dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); dmu_object_set_compress(os, drro->drr_object, drro->drr_compress, tx); - if (drro->drr_bonuslen) { + if (data != NULL) { dmu_buf_t *db; - void *data; + VERIFY(0 == dmu_bonus_hold(os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (data == NULL) { - dmu_tx_commit(tx); - return (ra->err); - } bcopy(data, db->db_data, drro->drr_bonuslen); if (ra->byteswap) { dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data, From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:50:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 027D2106568B; Sat, 19 Dec 2009 11:50:05 +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 E37BC8FC1A; Sat, 19 Dec 2009 11:50:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBo4H2032475; Sat, 19 Dec 2009 11:50:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBo4wC032464; Sat, 19 Dec 2009 11:50:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191150.nBJBo4wC032464@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200728 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:50:05 -0000 Author: kib Date: Sat Dec 19 11:50:04 2009 New Revision: 200728 URL: http://svn.freebsd.org/changeset/base/200728 Log: Regen Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/kern/systrace_args.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -453,6 +453,14 @@ struct freebsd32_shmctl_args { char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char buf_l_[PADL_(struct shmid_ds32 *)]; struct shmid_ds32 * buf; char buf_r_[PADR_(struct shmid_ds32 *)]; }; +struct freebsd32_pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *); int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *); @@ -536,6 +544,7 @@ int freebsd32_jail_set(struct thread *, int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); +int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); #ifdef COMPAT_43 @@ -814,6 +823,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL +#define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #undef PAD_ #undef PADL_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -386,4 +386,5 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 -#define FREEBSD32_SYS_MAXSYSCALL 522 +#define FREEBSD32_SYS_freebsd32_pselect 522 +#define FREEBSD32_SYS_MAXSYSCALL 523 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ const char *freebsd32_syscallnames[] = { @@ -529,4 +529,5 @@ const char *freebsd32_syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "freebsd32_pselect", /* 522 = freebsd32_pselect */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #include "opt_compat.h" @@ -566,4 +566,5 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = freebsd32_pselect */ }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/init_sysent.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #include "opt_compat.h" @@ -556,4 +556,5 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = pselect */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/syscalls.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ const char *syscallnames[] = { @@ -529,4 +529,5 @@ const char *syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "pselect", /* 522 = pselect */ }; Modified: stable/8/sys/kern/systrace_args.c ============================================================================== --- stable/8/sys/kern/systrace_args.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/systrace_args.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3072,6 +3072,18 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* pselect */ + case 522: { + struct pselect_args *p = params; + iarg[0] = p->nd; /* int */ + uarg[1] = (intptr_t) p->in; /* fd_set * */ + uarg[2] = (intptr_t) p->ou; /* fd_set * */ + uarg[3] = (intptr_t) p->ex; /* fd_set * */ + uarg[4] = (intptr_t) p->ts; /* const struct timespec * */ + uarg[5] = (intptr_t) p->sm; /* const sigset_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8154,6 +8166,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* pselect */ + case 522: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "fd_set *"; + break; + case 2: + p = "fd_set *"; + break; + case 3: + p = "fd_set *"; + break; + case 4: + p = "const struct timespec *"; + break; + case 5: + p = "const sigset_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/syscall.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #define SYS_syscall 0 @@ -428,4 +428,5 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 -#define SYS_MAXSYSCALL 522 +#define SYS_pselect 522 +#define SYS_MAXSYSCALL 523 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/syscall.mk Sat Dec 19 11:50:04 2009 (r200728) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson +# created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib MIASM = \ syscall.o \ exit.o \ @@ -376,4 +376,5 @@ MIASM = \ __semctl.o \ msgctl.o \ shmctl.o \ - lpathconf.o + lpathconf.o \ + pselect.o Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/sysproto.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1641,6 +1641,14 @@ struct lpathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; +struct pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1999,6 +2007,7 @@ int __semctl(struct thread *, struct __s int msgctl(struct thread *, struct msgctl_args *); int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); +int pselect(struct thread *, struct pselect_args *); #ifdef COMPAT_43 @@ -2671,6 +2680,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_msgctl AUE_MSGCTL #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF +#define SYS_AUE_pselect AUE_SELECT #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 11:53:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C45106566C; Sat, 19 Dec 2009 11:53:03 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by mx1.freebsd.org (Postfix) with ESMTP id 26A648FC08; Sat, 19 Dec 2009 11:53:03 +0000 (UTC) Received: by gxk10 with SMTP id 10so3732795gxk.3 for ; Sat, 19 Dec 2009 03:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ouwbnfP4lb5AEzZP2yjHYerNMBspFj/AqIIzY8JzOPg=; b=b9CyB8x6gTG6xdC0XaLySq1xLTPpUls+fJtpXZpAuW0lVlVAyyNfByhttvQSiv8QXm HPmKePnenDEVjtvUUNlqNvJyXaIFmzX4Qg3qH8WUMt4msWIQZacmin5Iavpj7b3gXwwg tILiC4p6ToYGB3AJ9ZlY5iUNfTE7i9xCFDXs8= 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=LJXAAHoZp6LRWa4dvteykAyS5f1qGo5a/r4s2BuQA5wy48mNGBgWKDb7A1bdwp9yCb 8zraHeCffvMd7yk2DVqllEGoQxIRFFXCRv2yZHgZLWlbXO6+FRvy3TDO8CHceiOjKAdP z4rW2LcsK89/ldU3aahIK5R/MryqisDSAw/OQ= MIME-Version: 1.0 Received: by 10.150.6.17 with SMTP id 17mr8111341ybf.154.1261223581827; Sat, 19 Dec 2009 03:53:01 -0800 (PST) In-Reply-To: <200912191143.nBJBhdv4032147@svn.freebsd.org> References: <200912191143.nBJBhdv4032147@svn.freebsd.org> Date: Sat, 19 Dec 2009 03:53:01 -0800 Message-ID: From: Xin LI To: Xin LI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200724 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:53:04 -0000 On Sat, Dec 19, 2009 at 3:43 AM, Xin LI wrote: > Author: delphij > Date: Sat Dec 19 11:43:39 2009 > New Revision: 200724 > URL: http://svn.freebsd.org/changeset/base/200724 > > Log: > =C2=A0Apply fix Solaris bug 6462803 zfs snapshot -r failed because > =C2=A0filesystem was busy. > > =C2=A0Submitted by: mm > =C2=A0Approved by: =C2=A0pjd > =C2=A0MFC after: =C2=A0 =C2=A02 weeks Sorry, the commit log was wrong. It should read: Apply fix for Solaris bug 6764159: restore_object() makes a call that can block while having a tx open but not yet committed onnv revision 7996. Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 12:06:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A82B106566B; Sat, 19 Dec 2009 12:06: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 36CBD8FC16; Sat, 19 Dec 2009 12:06: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 nBJC6DHR032858; Sat, 19 Dec 2009 12:06:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJC6D5J032851; Sat, 19 Dec 2009 12:06:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191206.nBJC6D5J032851@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 12:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200729 - in stable/8/sys: ddb dev/syscons kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 12:06:13 -0000 Author: kib Date: Sat Dec 19 12:06:12 2009 New Revision: 200729 URL: http://svn.freebsd.org/changeset/base/200729 Log: MFC r199355: Add SI_KERNEL. MFC r199418: Fix pgsignal() call after signature change in r199355. Modified: stable/8/sys/ddb/db_command.c stable/8/sys/dev/syscons/scvidctl.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/tty.c stable/8/sys/sys/signal.h stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ddb/db_command.c ============================================================================== --- stable/8/sys/ddb/db_command.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/ddb/db_command.c Sat Dec 19 12:06:12 2009 (r200729) @@ -652,7 +652,7 @@ db_kill(dummy1, dummy2, dummy3, dummy4) if (PROC_TRYLOCK(p) == 0) DB_ERROR(("Can't lock process with pid %ld\n", (long) pid)); else { - psignal(p, sig); + pksignal(p, sig, NULL); PROC_UNLOCK(p); } Modified: stable/8/sys/dev/syscons/scvidctl.c ============================================================================== --- stable/8/sys/dev/syscons/scvidctl.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/dev/syscons/scvidctl.c Sat Dec 19 12:06:12 2009 (r200729) @@ -321,6 +321,7 @@ sc_set_pixel_mode(scr_stat *scp, struct return ENODEV; #else video_info_t info; + ksiginfo_t ksi; u_char *font; int prev_ysize; int error; @@ -454,8 +455,11 @@ sc_set_pixel_mode(scr_stat *scp, struct tp->t_winsize.ws_col = scp->xsize; tp->t_winsize.ws_row = scp->ysize; if (tp->t_pgrp != NULL) { + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGWINCH; + ksi.ksi_code = SI_KERNEL; PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, SIGWINCH, 1); + pgsignal(tp->t_pgrp, SIGWINCH, 1, &ksi); PGRP_UNLOCK(tp->t_pgrp); } } Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 12:06:12 2009 (r200729) @@ -99,7 +99,8 @@ SDT_PROBE_ARGTYPE(proc, kernel, , signal static int coredump(struct thread *); static char *expand_name(const char *, uid_t, pid_t); -static int killpg1(struct thread *td, int sig, int pgid, int all); +static int killpg1(struct thread *td, int sig, int pgid, int all, + ksiginfo_t *ksi); static int issignal(struct thread *td, int stop_allowed); static int sigprop(int sig); static void tdsigwakeup(struct thread *, int, sig_t, int); @@ -377,7 +378,8 @@ sigqueue_add(sigqueue_t *sq, int signo, ksi->ksi_sigq = sq; } - if ((si->ksi_flags & KSI_TRAP) != 0) { + if ((si->ksi_flags & KSI_TRAP) != 0 || + (si->ksi_flags & KSI_SIGQ) == 0) { if (ret != 0) SIGADDSET(sq->sq_kill, signo); ret = 0; @@ -1607,11 +1609,9 @@ kern_sigaltstack(struct thread *td, stac * cp is calling process. */ static int -killpg1(td, sig, pgid, all) - register struct thread *td; - int sig, pgid, all; +killpg1(struct thread *td, int sig, int pgid, int all, ksiginfo_t *ksi) { - register struct proc *p; + struct proc *p; struct pgrp *pgrp; int nfound = 0; @@ -1630,7 +1630,7 @@ killpg1(td, sig, pgid, all) if (p_cansignal(td, p, sig) == 0) { nfound++; if (sig) - psignal(p, sig); + pksignal(p, sig, ksi); } PROC_UNLOCK(p); } @@ -1661,7 +1661,7 @@ killpg1(td, sig, pgid, all) if (p_cansignal(td, p, sig) == 0) { nfound++; if (sig) - psignal(p, sig); + pksignal(p, sig, ksi); } PROC_UNLOCK(p); } @@ -1678,11 +1678,10 @@ struct kill_args { #endif /* ARGSUSED */ int -kill(td, uap) - register struct thread *td; - register struct kill_args *uap; +kill(struct thread *td, struct kill_args *uap) { - register struct proc *p; + ksiginfo_t ksi; + struct proc *p; int error; AUDIT_ARG_SIGNUM(uap->signum); @@ -1690,6 +1689,12 @@ kill(td, uap) if ((u_int)uap->signum > _SIG_MAXSIG) return (EINVAL); + ksiginfo_init(&ksi); + ksi.ksi_signo = uap->signum; + ksi.ksi_code = SI_USER; + ksi.ksi_pid = td->td_proc->p_pid; + ksi.ksi_uid = td->td_ucred->cr_ruid; + if (uap->pid > 0) { /* kill single process */ if ((p = pfind(uap->pid)) == NULL) { @@ -1699,17 +1704,17 @@ kill(td, uap) AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) - psignal(p, uap->signum); + pksignal(p, uap->signum, &ksi); PROC_UNLOCK(p); return (error); } switch (uap->pid) { case -1: /* broadcast signal */ - return (killpg1(td, uap->signum, 0, 1)); + return (killpg1(td, uap->signum, 0, 1, &ksi)); case 0: /* signal own process group */ - return (killpg1(td, uap->signum, 0, 0)); + return (killpg1(td, uap->signum, 0, 0, &ksi)); default: /* negative explicit process group */ - return (killpg1(td, uap->signum, -uap->pid, 0)); + return (killpg1(td, uap->signum, -uap->pid, 0, &ksi)); } /* NOTREACHED */ } @@ -1723,17 +1728,21 @@ struct okillpg_args { #endif /* ARGSUSED */ int -okillpg(td, uap) - struct thread *td; - register struct okillpg_args *uap; +okillpg(struct thread *td, struct okillpg_args *uap) { + ksiginfo_t ksi; AUDIT_ARG_SIGNUM(uap->signum); AUDIT_ARG_PID(uap->pgid); if ((u_int)uap->signum > _SIG_MAXSIG) return (EINVAL); - return (killpg1(td, uap->signum, uap->pgid, 0)); + ksiginfo_init(&ksi); + ksi.ksi_signo = uap->signum; + ksi.ksi_code = SI_USER; + ksi.ksi_pid = td->td_proc->p_pid; + ksi.ksi_uid = td->td_ucred->cr_ruid; + return (killpg1(td, uap->signum, uap->pgid, 0, &ksi)); } #endif /* COMPAT_43 */ @@ -1768,6 +1777,7 @@ sigqueue(struct thread *td, struct sigqu error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum != 0) { ksiginfo_init(&ksi); + ksi.ksi_flags = KSI_SIGQ; ksi.ksi_signo = uap->signum; ksi.ksi_code = SI_QUEUE; ksi.ksi_pid = td->td_proc->p_pid; @@ -1783,8 +1793,7 @@ sigqueue(struct thread *td, struct sigqu * Send a signal to a process group. */ void -gsignal(pgid, sig) - int pgid, sig; +gsignal(int pgid, int sig, ksiginfo_t *ksi) { struct pgrp *pgrp; @@ -1793,7 +1802,7 @@ gsignal(pgid, sig) pgrp = pgfind(pgid); sx_sunlock(&proctree_lock); if (pgrp != NULL) { - pgsignal(pgrp, sig, 0); + pgsignal(pgrp, sig, 0, ksi); PGRP_UNLOCK(pgrp); } } @@ -1804,18 +1813,16 @@ gsignal(pgid, sig) * limit to members which have a controlling terminal. */ void -pgsignal(pgrp, sig, checkctty) - struct pgrp *pgrp; - int sig, checkctty; +pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi) { - register struct proc *p; + struct proc *p; if (pgrp) { PGRP_LOCK_ASSERT(pgrp, MA_OWNED); LIST_FOREACH(p, &pgrp->pg_members, p_pglist) { PROC_LOCK(p); if (checkctty == 0 || p->p_flag & P_CONTROLT) - psignal(p, sig); + pksignal(p, sig, ksi); PROC_UNLOCK(p); } } @@ -1936,7 +1943,19 @@ sigtd(struct proc *p, int sig, int prop) void psignal(struct proc *p, int sig) { - (void) tdsignal(p, NULL, sig, NULL); + ksiginfo_t ksi; + + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; + (void) tdsignal(p, NULL, sig, &ksi); +} + +void +pksignal(struct proc *p, int sig, ksiginfo_t *ksi) +{ + + (void) tdsignal(p, NULL, sig, ksi); } int @@ -3138,8 +3157,13 @@ pgsigio(sigiop, sig, checkctty) struct sigio **sigiop; int sig, checkctty; { + ksiginfo_t ksi; struct sigio *sigio; + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; + SIGIO_LOCK(); sigio = *sigiop; if (sigio == NULL) { Modified: stable/8/sys/kern/tty.c ============================================================================== --- stable/8/sys/kern/tty.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/kern/tty.c Sat Dec 19 12:06:12 2009 (r200729) @@ -355,6 +355,7 @@ tty_wait_background(struct tty *tp, stru { struct proc *p = td->td_proc; struct pgrp *pg; + ksiginfo_t ksi; int error; MPASS(sig == SIGTTIN || sig == SIGTTOU); @@ -396,8 +397,14 @@ tty_wait_background(struct tty *tp, stru * Send the signal and sleep until we're the new * foreground process group. */ + if (sig != 0) { + ksiginfo_init(&ksi); + ksi.ksi_code = SI_KERNEL; + ksi.ksi_signo = sig; + sig = 0; + } PGRP_LOCK(pg); - pgsignal(pg, sig, 1); + pgsignal(pg, ksi.ksi_signo, 1, &ksi); PGRP_UNLOCK(pg); error = tty_wait(tp, &tp->t_bgwait); @@ -1223,6 +1230,8 @@ tty_signal_sessleader(struct tty *tp, in void tty_signal_pgrp(struct tty *tp, int sig) { + ksiginfo_t ksi; + tty_lock_assert(tp, MA_OWNED); MPASS(sig >= 1 && sig < NSIG); @@ -1232,8 +1241,11 @@ tty_signal_pgrp(struct tty *tp, int sig) if (sig == SIGINFO && !(tp->t_termios.c_lflag & NOKERNINFO)) tty_info(tp); if (tp->t_pgrp != NULL) { + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, sig, 1); + pgsignal(tp->t_pgrp, sig, 1, &ksi); PGRP_UNLOCK(tp->t_pgrp); } } Modified: stable/8/sys/sys/signal.h ============================================================================== --- stable/8/sys/sys/signal.h Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/sys/signal.h Sat Dec 19 12:06:12 2009 (r200729) @@ -338,6 +338,7 @@ struct sigaction { /* an asynchronous I/O request.*/ #define SI_MESGQ 0x10005 /* Signal generated by arrival of a */ /* message on an empty message queue. */ +#define SI_KERNEL 0x10006 #endif #if __BSD_VISIBLE #define SI_UNDEFINED 0 Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 12:06:12 2009 (r200729) @@ -233,7 +233,8 @@ typedef struct ksiginfo { #define KSI_TRAP 0x01 /* Generated by trap. */ #define KSI_EXT 0x02 /* Externally managed ksi. */ #define KSI_INS 0x04 /* Directly insert ksi, not the copy */ -#define KSI_COPYMASK KSI_TRAP +#define KSI_SIGQ 0x08 /* Generated by sigqueue, might ret EGAIN. */ +#define KSI_COPYMASK (KSI_TRAP|KSI_SIGQ) #define KSI_ONQ(ksi) ((ksi)->ksi_sigq != NULL) @@ -326,10 +327,11 @@ extern int kern_logsigexit; /* Sysctl va */ int cursig(struct thread *td, int stop_allowed); void execsigs(struct proc *p); -void gsignal(int pgid, int sig); +void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); +void pksignal(struct proc *p, int sig, ksiginfo_t *ksi); void pgsigio(struct sigio **, int signum, int checkctty); -void pgsignal(struct pgrp *pgrp, int sig, int checkctty); +void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi); int postsig(int sig); void psignal(struct proc *p, int sig); int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 16:36:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34FA1065670; Sat, 19 Dec 2009 16:36:57 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92BB98FC19; Sat, 19 Dec 2009 16:36: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 nBJGavxn037993; Sat, 19 Dec 2009 16:36:57 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJGavcr037991; Sat, 19 Dec 2009 16:36:57 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912191636.nBJGavcr037991@svn.freebsd.org> From: Benedict Reuschling Date: Sat, 19 Dec 2009 16:36: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: r200731 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 16:36:57 -0000 Author: bcr (doc committer) Date: Sat Dec 19 16:36:57 2009 New Revision: 200731 URL: http://svn.freebsd.org/changeset/base/200731 Log: Reference the correct man page for firmware(9). PR: docs/140986 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) MFC after: 4 days Reviewed by: sam Approved by: sam, jkois (mentor) Modified: head/share/man/man4/mwlfw.4 Modified: head/share/man/man4/mwlfw.4 ============================================================================== --- head/share/man/man4/mwlfw.4 Sat Dec 19 13:39:07 2009 (r200730) +++ head/share/man/man4/mwlfw.4 Sat Dec 19 16:36:57 2009 (r200731) @@ -49,4 +49,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr mwl 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 18:42:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8051065670; Sat, 19 Dec 2009 18:42:13 +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 2B65D8FC0A; Sat, 19 Dec 2009 18:42: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 nBJIgDi6040511; Sat, 19 Dec 2009 18:42:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJIgDgP040506; Sat, 19 Dec 2009 18:42:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912191842.nBJIgDgP040506@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Dec 2009 18:42: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: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:42:13 -0000 Author: ed Date: Sat Dec 19 18:42:12 2009 New Revision: 200732 URL: http://svn.freebsd.org/changeset/base/200732 Log: Let access overriding to TTYs depend on the cdev_priv, not the vnode. Basically this commit changes two things, which improves access to TTYs in exceptional conditions. Basically the problem was that when you ran jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if you want to attach to screens quickly, use ssh(1), etc. The fixes: - Cache the cdev_priv of the controlling TTY in struct session. Change devfs_access() to compare against the cdev_priv instead of the vnode. This allows you to bypass UNIX permissions, even across different mounts of devfs. - Extend devfs_prison_check() to unconditionally expose the device node of the controlling TTY, even if normal prison nesting rules normally don't allow this. This actually allows you to interact with this device node. To be honest, I'm not really happy with this solution. We now have to store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). In an ideal world, we should just get rid of the latter two and only use s_ttyp, but this makes certian pieces of code very impractical (e.g. devfs, kern_exit.c). Reported by: Many people Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/kern_exit.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/fs/devfs/devfs_vnops.c Sat Dec 19 18:42:12 2009 (r200732) @@ -436,14 +436,14 @@ devfs_access(struct vop_access_args *ap) error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, ap->a_accmode, ap->a_cred, NULL); - if (!error) - return (error); + if (error == 0) + return (0); if (error != EACCES) return (error); /* We do, however, allow access to the controlling terminal */ if (!(ap->a_td->td_proc->p_flag & P_CONTROLT)) return (error); - if (ap->a_td->td_proc->p_session->s_ttyvp == de->de_vnode) + if (ap->a_td->td_proc->p_session->s_ttydp == de->de_cdp) return (0); return (error); } @@ -474,6 +474,7 @@ devfs_close(struct vop_close_args *ap) VI_LOCK(vp); if (count_dev(dev) == 2 && (vp->v_iflag & VI_DOOMED) == 0) { td->td_proc->p_session->s_ttyvp = NULL; + td->td_proc->p_session->s_ttydp = NULL; oldvp = vp; } VI_UNLOCK(vp); @@ -675,6 +676,7 @@ devfs_ioctl_f(struct file *fp, u_long co VREF(vp); SESS_LOCK(td->td_proc->p_session); td->td_proc->p_session->s_ttyvp = vp; + td->td_proc->p_session->s_ttydp = cdev2priv(dev); SESS_UNLOCK(td->td_proc->p_session); sx_sunlock(&proctree_lock); @@ -708,10 +710,11 @@ devfs_kqfilter_f(struct file *fp, struct } static inline int -devfs_prison_check(struct devfs_dirent *de, struct ucred *tcr) +devfs_prison_check(struct devfs_dirent *de, struct thread *td) { struct cdev_priv *cdp; struct ucred *dcr; + int error; cdp = de->de_cdp; if (cdp == NULL) @@ -720,7 +723,15 @@ devfs_prison_check(struct devfs_dirent * if (dcr == NULL) return (0); - return (prison_check(tcr, dcr)); + error = prison_check(td->td_ucred, dcr); + if (error == 0) + return (0); + /* We do, however, allow access to the controlling terminal */ + if (!(td->td_proc->p_flag & P_CONTROLT)) + return (error); + if (td->td_proc->p_session->s_ttydp == cdp) + return (0); + return (error); } static int @@ -848,7 +859,7 @@ devfs_lookupx(struct vop_lookup_args *ap return (ENOENT); } - if (devfs_prison_check(de, td->td_ucred)) + if (devfs_prison_check(de, td)) return (ENOENT); if ((cnp->cn_nameiop == DELETE) && (flags & ISLASTCN)) { @@ -1126,7 +1137,7 @@ devfs_readdir(struct vop_readdir_args *a KASSERT(dd->de_cdp != (void *)0xdeadc0de, ("%s %d\n", __func__, __LINE__)); if (dd->de_flags & DE_WHITEOUT) continue; - if (devfs_prison_check(dd, ap->a_cred)) + if (devfs_prison_check(dd, uio->uio_td)) continue; if (dd->de_dirent->d_type == DT_DIR) de = dd->de_dir; Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/kern/kern_exit.c Sat Dec 19 18:42:12 2009 (r200732) @@ -316,6 +316,7 @@ exit1(struct thread *td, int rv) ttyvp = sp->s_ttyvp; tp = sp->s_ttyp; sp->s_ttyvp = NULL; + sp->s_ttydp = NULL; sp->s_leader = NULL; SESS_UNLOCK(sp); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/kern/kern_proc.c Sat Dec 19 18:42:12 2009 (r200732) @@ -358,6 +358,7 @@ enterpgrp(p, pgid, pgrp, sess) sess->s_sid = p->p_pid; refcount_init(&sess->s_count, 1); sess->s_ttyvp = NULL; + sess->s_ttydp = NULL; sess->s_ttyp = NULL; bcopy(p->p_session->s_login, sess->s_login, sizeof(sess->s_login)); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/sys/proc.h Sat Dec 19 18:42:12 2009 (r200732) @@ -77,6 +77,7 @@ struct session { u_int s_count; /* Ref cnt; pgrps in session - atomic. */ struct proc *s_leader; /* (m + e) Session leader. */ struct vnode *s_ttyvp; /* (m) Vnode of controlling tty. */ + struct cdev_priv *s_ttydp; /* (m) Device of controlling tty. */ struct tty *s_ttyp; /* (e) Controlling tty. */ pid_t s_sid; /* (c) Session ID. */ /* (m) Setlogin() name: */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 18:55:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B1C106566B; Sat, 19 Dec 2009 18:55:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1A07F8FC13; Sat, 19 Dec 2009 18:55:01 +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 nBJIsvbI095505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nBJIsviu084351; Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nBJIsvce084350; Sat, 19 Dec 2009 20:54:57 +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: Sat, 19 Dec 2009 20:54:57 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20091219185457.GH2170@deviant.kiev.zoral.com.ua> References: <200912191842.nBJIgDgP040506@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lQSB8Tqijvu1+4Ba" Content-Disposition: inline In-Reply-To: <200912191842.nBJIgDgP040506@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:55:02 -0000 --lQSB8Tqijvu1+4Ba Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 19, 2009 at 06:42:12PM +0000, Ed Schouten wrote: > Author: ed > Date: Sat Dec 19 18:42:12 2009 > New Revision: 200732 > URL: http://svn.freebsd.org/changeset/base/200732 >=20 > Log: > Let access overriding to TTYs depend on the cdev_priv, not the vnode. > =20 > Basically this commit changes two things, which improves access to TTYs > in exceptional conditions. Basically the problem was that when you ran > jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the > node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if > you want to attach to screens quickly, use ssh(1), etc. > =20 > The fixes: > =20 > - Cache the cdev_priv of the controlling TTY in struct session. Change > devfs_access() to compare against the cdev_priv instead of the vnode. > This allows you to bypass UNIX permissions, even across different > mounts of devfs. > =20 > - Extend devfs_prison_check() to unconditionally expose the device node > of the controlling TTY, even if normal prison nesting rules normally > don't allow this. This actually allows you to interact with this > device node. > =20 > To be honest, I'm not really happy with this solution. We now have to > store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). > In an ideal world, we should just get rid of the latter two and only use > s_ttyp, but this makes certian pieces of code very impractical (e.g. > devfs, kern_exit.c). Note that struct devfs_dirent is available as vp->v_data, and devfs_dirent' de_cdp member contains pointer to cdev_priv. I think this would allow to remove s_ttydp. --lQSB8Tqijvu1+4Ba Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkstIYAACgkQC3+MBN1Mb4hR/QCgm8Ov8UdK/Tdm1mSUI0bbDiZD M/QAoLYyMcPUw4NMkDuXze8lMe2FKMQx =gT/U -----END PGP SIGNATURE----- --lQSB8Tqijvu1+4Ba-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:01:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7681065694; Sat, 19 Dec 2009 19:01:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 4018E8FC1B; Sat, 19 Dec 2009 19:01:53 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 343431CECF; Sat, 19 Dec 2009 20:01:52 +0100 (CET) Date: Sat, 19 Dec 2009 20:01:52 +0100 From: Ed Schouten To: Kostik Belousov Message-ID: <20091219190152.GJ64905@hoeg.nl> References: <200912191842.nBJIgDgP040506@svn.freebsd.org> <20091219185457.GH2170@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fZfO+AAAmBD6aS/A" Content-Disposition: inline In-Reply-To: <20091219185457.GH2170@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:01:53 -0000 --fZfO+AAAmBD6aS/A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kostik Belousov wrote: > Note that struct devfs_dirent is available as vp->v_data, and > devfs_dirent' de_cdp member contains pointer to cdev_priv. I think this > would allow to remove s_ttydp. Well, there are lots of fields that could be derived. We could even remove s_ttyp and only use the vnode, because cdp_c.si_drv1 contains a pointer to the TTY. The reason why I didn't choose that approach, was because I'm a bit afraid we get these insanely long chains of pointer dereferences, of which I'm not entirely sure we do the locking properly. Even right now I'm not sure whether we pick up proctree_lock enough. s_ttydp isn't too strict about any form of locking, because its value is only used comparatively. --=20 Ed Schouten WWW: http://80386.nl/ --fZfO+AAAmBD6aS/A Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkstIyAACgkQ52SDGA2eCwW+2QCdFgQyWZZU9OZ0bF3NMst6saQ/ vHIAnA/8vvu5SVGTyg6ndImpHoCTDq4t =3nhx -----END PGP SIGNATURE----- --fZfO+AAAmBD6aS/A-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:20:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75AB7106566B for ; Sat, 19 Dec 2009 19:20:07 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.211.172]) by mx1.freebsd.org (Postfix) with ESMTP id F333C8FC0A for ; Sat, 19 Dec 2009 19:20:06 +0000 (UTC) Received: by ywh2 with SMTP id 2so4324247ywh.27 for ; Sat, 19 Dec 2009 11:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=YnrnxULD8yz78veS24l/aUmPYuGRJ774A/q5sv2X6gU=; b=LUp7WFracw6Y5fTk6npP8XK72SXzoyovf6w/X4tplkmzbXQGPotSQbjGK71ik17SXb 75x+J+0ShS0MRgt+zLMxMng5gq+FpEu2x0zGszWZhKEoapytjjdacWl5XS1QYeLrlAIm jbKOs61wjNKFsdalniHuD//pagAdKyJIG/Yd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=BXiiiOjeWjRB1VyM9keZxxTQHrkYJFHIPAEw5omsyyZ7556WeaRzpr/s+q5hrlTIc9 zn81U9rRDY2VIElY9qAzGOaH1zGi4qQhi0RCUVlT1fDib8UTQx/iiLuTs1WjfJewUSSk ryDDLZpxMYfdlkhrWkXln7IgoWS7NeJecVutI= Received: by 10.151.1.4 with SMTP id d4mr544107ybi.265.1261250405928; Sat, 19 Dec 2009 11:20:05 -0800 (PST) Received: from dimension.5p.local (ppp-21.26.dialinfree.com [209.172.21.26]) by mx.google.com with ESMTPS id 4sm1535525ywi.57.2009.12.19.11.19.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 19 Dec 2009 11:20:04 -0800 (PST) Sender: "J. Hellenthal" Date: Sat, 19 Dec 2009 14:19:41 -0500 From: jhell To: Andriy Gapon In-Reply-To: <200912191045.nBJAjvfc030388@svn.freebsd.org> Message-ID: References: <200912191045.nBJAjvfc030388@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r200714 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:20:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 19 Dec 2009 05:45, avg@ wrote: > Author: avg > Date: Sat Dec 19 10:45:57 2009 > New Revision: 200714 > URL: http://svn.freebsd.org/changeset/base/200714 > > Log: > MFC r200064: mca: small enhancements related to cpu quirks > > Modified: > stable/7/sys/amd64/amd64/mca.c > stable/7/sys/i386/i386/mca.c > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/cddl/contrib/opensolaris/ (props changed) > stable/7/sys/contrib/dev/acpica/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > > Modified: stable/7/sys/amd64/amd64/mca.c > ============================================================================== > --- stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:44:26 2009 (r200713) > +++ stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:45:57 2009 (r200714) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -478,6 +479,8 @@ void > mca_init(void) > { > uint64_t mcg_cap; > + uint64_t ctl; > + int skip; > int i; > > /* MCE is required. */ > @@ -495,15 +498,26 @@ mca_init(void) > wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); > > for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { > - /* > - * Enable logging of all errors. For P6 > - * processors, MC0_CTL is always enabled. > - * > - * XXX: Better CPU test needed here? > - */ > - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) > - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); > + /* By default enable logging of all errors. */ > + ctl = 0xffffffffffffffffUL; > + skip = 0; > + > + if (cpu_vendor_id == CPU_VENDOR_INTEL) { > + /* > + * For P6 models before Nehalem MC0_CTL is > + * always enabled and reserved. > + */ > + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 > + && CPUID_TO_MODEL(cpu_id) < 0x1a) > + skip = 1; > + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { > + /* BKDG for Family 10h: unset GartTblWkEn. */ > + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) > + ctl &= ~(1UL << 10); > + } > > + if (!skip) > + wrmsr(MSR_MC_CTL(i), ctl); > /* Clear all errors. */ > wrmsr(MSR_MC_STATUS(i), 0); > } > > Modified: stable/7/sys/i386/i386/mca.c > ============================================================================== > --- stable/7/sys/i386/i386/mca.c Sat Dec 19 10:44:26 2009 (r200713) > +++ stable/7/sys/i386/i386/mca.c Sat Dec 19 10:45:57 2009 (r200714) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -478,6 +479,8 @@ void > mca_init(void) > { > uint64_t mcg_cap; > + uint64_t ctl; > + int skip; > int i; > > /* MCE is required. */ > @@ -495,15 +498,26 @@ mca_init(void) > wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); > > for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { > - /* > - * Enable logging of all errors. For P6 > - * processors, MC0_CTL is always enabled. > - * > - * XXX: Better CPU test needed here? > - */ > - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) > - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); > + /* By default enable logging of all errors. */ > + ctl = 0xffffffffffffffffUL; > + skip = 0; > + > + if (cpu_vendor_id == CPU_VENDOR_INTEL) { > + /* > + * For P6 models before Nehalem MC0_CTL is > + * always enabled and reserved. > + */ > + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 > + && CPUID_TO_MODEL(cpu_id) < 0x1a) > + skip = 1; > + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { > + /* BKDG for Family 10h: unset GartTblWkEn. */ > + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) > + ctl &= ~(1UL << 10); > + } > > + if (!skip) > + wrmsr(MSR_MC_CTL(i), ctl); > /* Clear all errors. */ > wrmsr(MSR_MC_STATUS(i), 0); > } > [FYI] Following errors are being generated on stable/7 i386 "Intel" based machine. If more information is needed, let me know. cc1: warnings being treated as errors /usr/src/sys/i386/i386/mca.c: In function 'mca_init': /usr/src/sys/i386/i386/mca.c:510: warning: implicit declaration of function 'CPUID_TO_FAMILY' /usr/src/sys/i386/i386/mca.c:510: warning: nested extern declaration of 'CPUID_TO_FAMILY' /usr/src/sys/i386/i386/mca.c:511: warning: implicit declaration of function 'CPUID_TO_MODEL' /usr/src/sys/i386/i386/mca.c:511: warning: nested extern declaration of 'CPUID_TO_MODEL' *** Error code 1 - -- Sat Dec 19 14:16:11 2009 -0500 jhell -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJLLSdZAAoJEJBXh4mJ2FR++e0H/iWCMNkzAjXOhQUUf24+eiJw 5rC/XcLCOCP8FAeu1LzJ2mnsGswPKnnnQaaT4i8K4g4kZyvaYFOszq8XOSsK4M2G bXWUTN7An6LLtct7tkDj+cOE7icjeTRCXBRhegnBG0IloXNxqbdxd8l/VNbXepGk gJPSSZHBGJ48GC6Um/sXP+XC/3tDSL9UdhCcRAJzBmZxpK1GnNJZbYREeBJo6Ywg uEjDJ29bqEMqwGIykh8CB+9u7CPZ70UcDPfQN4lz/YaWaYXGKMlzCYalbXZNVVUB AmS9PiTUBZ6gJpri0vtykePcWjiY0nESoV+9keNleADCVYzMnT9Hj/dwOiYg25o= =zift -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:22:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4D21065676; Sat, 19 Dec 2009 19:22:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABDB8FC17; Sat, 19 Dec 2009 19:22: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 nBJJM9nB041417; Sat, 19 Dec 2009 19:22:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJM9gJ041415; Sat, 19 Dec 2009 19:22:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191922.nBJJM9gJ041415@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200734 - stable/8/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:22:10 -0000 Author: attilio Date: Sat Dec 19 19:22:09 2009 New Revision: 200734 URL: http://svn.freebsd.org/changeset/base/200734 Log: MFC r199801: Fix a socket leak. Sponsored by: Sandvine Incorporated Modified: stable/8/lib/libfetch/ftp.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/ftp.c ============================================================================== --- stable/8/lib/libfetch/ftp.c Sat Dec 19 19:01:24 2009 (r200733) +++ stable/8/lib/libfetch/ftp.c Sat Dec 19 19:22:09 2009 (r200734) @@ -1122,17 +1122,19 @@ ftp_request(struct url *url, const char /* change directory */ if (ftp_cwd(conn, url->doc) == -1) - return (NULL); + goto errsock; /* stat file */ if (us && ftp_stat(conn, url->doc, us) == -1 && fetchLastErrCode != FETCH_PROTO && fetchLastErrCode != FETCH_UNAVAIL) - return (NULL); + goto errsock; /* just a stat */ - if (strcmp(op, "STAT") == 0) + if (strcmp(op, "STAT") == 0) { + ftp_disconnect(conn); return (FILE *)1; /* bogus return value */ + } if (strcmp(op, "STOR") == 0 || strcmp(op, "APPE") == 0) oflag = O_WRONLY; else @@ -1140,6 +1142,10 @@ ftp_request(struct url *url, const char /* initiate the transfer */ return (ftp_transfer(conn, op, url->doc, oflag, url->offset, flags)); + +errsock: + ftp_disconnect(conn); + return (NULL); } /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:23:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B27A51065696; Sat, 19 Dec 2009 19:23:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A13AA8FC0A; Sat, 19 Dec 2009 19:23: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 nBJJNPL0041486; Sat, 19 Dec 2009 19:23:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJNPKo041484; Sat, 19 Dec 2009 19:23:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191923.nBJJNPKo041484@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200735 - stable/8/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:23:25 -0000 Author: attilio Date: Sat Dec 19 19:23:25 2009 New Revision: 200735 URL: http://svn.freebsd.org/changeset/base/200735 Log: MFC r199802: Fix handling of empty attributes. Sponsored by: Sandvine Incorporated Modified: stable/8/lib/libtacplus/taclib.c Directory Properties: stable/8/lib/libtacplus/ (props changed) Modified: stable/8/lib/libtacplus/taclib.c ============================================================================== --- stable/8/lib/libtacplus/taclib.c Sat Dec 19 19:22:09 2009 (r200734) +++ stable/8/lib/libtacplus/taclib.c Sat Dec 19 19:23:25 2009 (r200735) @@ -1263,8 +1263,13 @@ tac_get_av_value(struct tac_handle *h, c * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * + * Note that for empty string attribute values a + * 0-length string is returned in order to distinguish + * against unset values. + * dump_str() will handle srvr.len == 0 correctly. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:25:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9552106568B; Sat, 19 Dec 2009 19:25:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979228FC12; Sat, 19 Dec 2009 19:25: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 nBJJPZJi041575; Sat, 19 Dec 2009 19:25:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJPZWl041573; Sat, 19 Dec 2009 19:25:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191925.nBJJPZWl041573@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200736 - stable/8/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:25:35 -0000 Author: attilio Date: Sat Dec 19 19:25:35 2009 New Revision: 200736 URL: http://svn.freebsd.org/changeset/base/200736 Log: MFC r199803: Add the possibility to show informations about dropped packets on the input path when showing interfaces informations. Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/netstat/if.c Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Sat Dec 19 19:23:25 2009 (r200735) +++ stable/8/usr.bin/netstat/if.c Sat Dec 19 19:25:35 2009 (r200736) @@ -198,6 +198,7 @@ intpr(int interval1, u_long ifnetaddr, v u_long imcasts; u_long oerrors; u_long ierrors; + u_long idrops; u_long collisions; short timer; int drops; @@ -225,8 +226,8 @@ intpr(int interval1, u_long ifnetaddr, v printf("%-7.7s", "Name"); else printf("%-5.5s", "Name"); - printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s", - "Mtu", "Network", "Address", "Ipkts", "Ierrs"); + printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s %5.5s", + "Mtu", "Network", "Address", "Ipkts", "Ierrs", "Idrop"); if (bflag) printf(" %10.10s","Ibytes"); printf(" %8.8s %5.5s", "Opkts", "Oerrs"); @@ -285,6 +286,7 @@ intpr(int interval1, u_long ifnetaddr, v imcasts = ifnet.if_imcasts; oerrors = ifnet.if_oerrors; ierrors = ifnet.if_ierrors; + idrops = ifnet.if_iqdrops; collisions = ifnet.if_collisions; timer = ifnet.if_timer; drops = ifnet.if_snd.ifq_drops; @@ -423,6 +425,7 @@ intpr(int interval1, u_long ifnetaddr, v show_stat("lu", 8, ipackets, link_layer|network_layer); show_stat("lu", 5, ierrors, link_layer); + show_stat("lu", 5, idrops, link_layer); if (bflag) show_stat("lu", 10, ibytes, link_layer|network_layer); @@ -513,6 +516,7 @@ struct iftot { char ift_name[IFNAMSIZ]; /* interface name */ u_long ift_ip; /* input packets */ u_long ift_ie; /* input errors */ + u_long ift_id; /* input drops */ u_long ift_op; /* output packets */ u_long ift_oe; /* output errors */ u_long ift_co; /* collisions */ @@ -598,8 +602,9 @@ banner: printf("%17s %14s %16s", "input", interesting ? interesting->ift_name : "(Total)", "output"); putchar('\n'); - printf("%10s %5s %10s %10s %5s %10s %5s", - "packets", "errs", "bytes", "packets", "errs", "bytes", "colls"); + printf("%10s %5s %5s %10s %10s %5s %10s %5s", + "packets", "errs", "idrops", "bytes", "packets", "errs", "bytes", + "colls"); if (dflag) printf(" %5.5s", "drops"); putchar('\n'); @@ -615,6 +620,7 @@ loop: if (!first) { show_stat("lu", 10, ifnet.if_ipackets - ip->ift_ip, 1); show_stat("lu", 5, ifnet.if_ierrors - ip->ift_ie, 1); + show_stat("lu", 5, ifnet.if_iqdrops - ip->ift_id, 1); show_stat("lu", 10, ifnet.if_ibytes - ip->ift_ib, 1); show_stat("lu", 10, ifnet.if_opackets - ip->ift_op, 1); show_stat("lu", 5, ifnet.if_oerrors - ip->ift_oe, 1); @@ -636,6 +642,7 @@ loop: } else { sum->ift_ip = 0; sum->ift_ie = 0; + sum->ift_id = 0; sum->ift_ib = 0; sum->ift_op = 0; sum->ift_oe = 0; @@ -651,6 +658,7 @@ loop: } sum->ift_ip += ifnet.if_ipackets; sum->ift_ie += ifnet.if_ierrors; + sum->ift_id += ifnet.if_iqdrops; sum->ift_ib += ifnet.if_ibytes; sum->ift_op += ifnet.if_opackets; sum->ift_oe += ifnet.if_oerrors; @@ -662,6 +670,7 @@ loop: if (!first) { show_stat("lu", 10, sum->ift_ip - total->ift_ip, 1); show_stat("lu", 5, sum->ift_ie - total->ift_ie, 1); + show_stat("lu", 5, sum->ift_id - total->ift_id, 1); show_stat("lu", 10, sum->ift_ib - total->ift_ib, 1); show_stat("lu", 10, sum->ift_op - total->ift_op, 1); show_stat("lu", 5, sum->ift_oe - total->ift_oe, 1); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:30:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A301065670; Sat, 19 Dec 2009 19:30:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8638FC16; Sat, 19 Dec 2009 19:30: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 nBJJUS9j041735; Sat, 19 Dec 2009 19:30:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJURq4041730; Sat, 19 Dec 2009 19:30:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191930.nBJJURq4041730@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200737 - stable/8/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:30:28 -0000 Author: attilio Date: Sat Dec 19 19:30:27 2009 New Revision: 200737 URL: http://svn.freebsd.org/changeset/base/200737 Log: MFC r199805: Change gcore in order to get rid of the procfs support and use FreeBSD's specific interfaces. Main changes: - now gcore recognizes threads within the the process and handle dumps on a thread scope - the process to be analyzed should be stopped while gcore runs - gcore may not work with processes that are being debugged with gdb or truss - ptrace may let interruptible calls to return EINTR, thus dirtying signals handling within the process Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/gcore/Makefile stable/8/usr.bin/gcore/elfcore.c stable/8/usr.bin/gcore/gcore.1 stable/8/usr.bin/gcore/gcore.c Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/Makefile ============================================================================== --- stable/8/usr.bin/gcore/Makefile Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/Makefile Sat Dec 19 19:30:27 2009 (r200737) @@ -1,6 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +LDADD+= -lutil PROG= gcore SRCS= elfcore.c gcore.c Modified: stable/8/usr.bin/gcore/elfcore.c ============================================================================== --- stable/8/usr.bin/gcore/elfcore.c Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/elfcore.c Sat Dec 19 19:30:27 2009 (r200737) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007 Sandvine Incorporated * Copyright (c) 1998 John D. Polstra * All rights reserved. * @@ -29,8 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include +#include #include #include #include @@ -44,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -69,16 +75,15 @@ static void cb_put_phdr(vm_map_entry_t, static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); -static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs, - void *hdr, size_t hdrsize); -static void elf_puthdr(vm_map_entry_t, void *, size_t *, - const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs); +static void elf_detach(void); /* atexit() handler. */ +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); static void elf_putnote(void *dst, size_t *off, const char *name, int type, const void *desc, size_t descsz); static void freemap(vm_map_entry_t); -static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *); static vm_map_entry_t readmap(pid_t); +static pid_t g_pid; /* Pid being dumped, global for elf_detach */ + static int elf_ident(int efd, pid_t pid __unused, char *binfile __unused) { @@ -93,6 +98,14 @@ elf_ident(int efd, pid_t pid __unused, c return (0); } +static void +elf_detach(void) +{ + + if (g_pid != 0) + ptrace(PT_DETACH, g_pid, (caddr_t)1, 0); +} + /* * Write an ELF coredump for the given pid to the given fd. */ @@ -103,11 +116,20 @@ elf_coredump(int efd __unused, int fd, p struct sseg_closure seginfo; void *hdr; size_t hdrsize; - char memname[64]; - int memfd; Elf_Phdr *php; int i; + /* Attach to process to dump. */ + g_pid = pid; + if (atexit(elf_detach) != 0) + err(1, "atexit"); + errno = 0; + ptrace(PT_ATTACH, pid, NULL, 0); + if (errno) + err(1, "PT_ATTACH"); + if (waitpid(pid, NULL, 0) == -1) + err(1, "waitpid"); + /* Get the program's memory map. */ map = readmap(pid); @@ -122,28 +144,31 @@ elf_coredump(int efd __unused, int fd, p * size is calculated. */ hdrsize = 0; - elf_puthdr(map, (void *)NULL, &hdrsize, - (const prstatus_t *)NULL, (const prfpregset_t *)NULL, - (const prpsinfo_t *)NULL, seginfo.count); + elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); /* * Allocate memory for building the header, fill it up, * and write it out. */ - if ((hdr = malloc(hdrsize)) == NULL) + if ((hdr = calloc(1, hdrsize)) == NULL) errx(1, "out of memory"); - elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize); - /* Write the contents of all of the writable segments. */ - snprintf(memname, sizeof memname, "/proc/%d/mem", pid); - if ((memfd = open(memname, O_RDONLY)) == -1) - err(1, "cannot open %s", memname); + /* Fill in the header. */ + hdrsize = 0; + elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + + /* Write it to the core file. */ + if (write(fd, hdr, hdrsize) == -1) + err(1, "write"); + /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; for (i = 0; i < seginfo.count; i++) { + struct ptrace_io_desc iorequest; uintmax_t nleft = php->p_filesz; - lseek(memfd, (off_t)php->p_vaddr, SEEK_SET); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (caddr_t)php->p_vaddr; while (nleft > 0) { char buf[8*1024]; size_t nwant; @@ -153,12 +178,12 @@ elf_coredump(int efd __unused, int fd, p nwant = sizeof buf; else nwant = nleft; - ngot = read(memfd, buf, nwant); - if (ngot == -1) - err(1, "read from %s", memname); + iorequest.piod_addr = buf; + iorequest.piod_len = nwant; + ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); + ngot = iorequest.piod_len; if ((size_t)ngot < nwant) - errx(1, "short read from %s:" - " wanted %zu, got %zd", memname, + errx(1, "short read wanted %d, got %d", nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -166,10 +191,10 @@ elf_coredump(int efd __unused, int fd, p if ((size_t)ngot != nwant) errx(1, "short write"); nleft -= nwant; + iorequest.piod_offs += ngot; } php++; } - close(memfd); free(hdr); freemap(map); } @@ -231,30 +256,25 @@ each_writable_segment(vm_map_entry_t map (*func)(entry, closure); } -/* - * Write the core file header to the file, including padding up to - * the page boundary. - */ static void -elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr, - size_t hdrsize) +elf_getstatus(pid_t pid, prpsinfo_t *psinfo) { - size_t off; - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - - /* Gather the information for the header. */ - readhdrinfo(pid, &status, &fpregset, &psinfo); - - /* Fill in the header. */ - memset(hdr, 0, hdrsize); - off = 0; - elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs); - - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) - err(1, "write"); + struct kinfo_proc kobj; + int name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + + len = sizeof(kobj); + if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) + err(1, "error accessing kern.proc.pid.%u sysctl", pid); + if (kobj.ki_pid != pid) + err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); + strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); } /* @@ -262,13 +282,24 @@ elf_corehdr(int fd, pid_t pid, vm_map_en * be NULL, in which case the header is sized but not actually generated. */ static void -elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status, - const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs) +elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct { + prstatus_t status; + prfpregset_t fpregset; + prpsinfo_t psinfo; + } *tempdata; size_t ehoff; size_t phoff; size_t noteoff; size_t notesz; + size_t threads; + lwpid_t *tids; + int i; + + prstatus_t *status; + prfpregset_t *fpregset; + prpsinfo_t *psinfo; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -277,14 +308,68 @@ elf_puthdr(vm_map_entry_t map, void *dst *off += (numsegs + 1) * sizeof(Elf_Phdr); noteoff = *off; - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); + + if (dst != NULL) { + if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) + errx(1, "out of memory"); + status = &tempdata->status; + fpregset = &tempdata->fpregset; + psinfo = &tempdata->psinfo; + } else { + tempdata = NULL; + status = NULL; + fpregset = NULL; + psinfo = NULL; + } + + errno = 0; + threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); + if (errno) + err(1, "PT_GETNUMLWPS"); + + if (dst != NULL) { + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + elf_getstatus(pid, psinfo); + + } elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, sizeof *psinfo); + + if (dst != NULL) { + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); + } + for (i = 0; i < threads; ++i) { + if (dst != NULL) { + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tids[i]; + + ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); + ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + } + elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, + sizeof *status); + elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, + sizeof *fpregset); + } + notesz = *off - noteoff; + if (dst != NULL) { + free(tids); + free(tempdata); + } + /* Align up to a page boundary for the program segments. */ *off = round_page(*off); @@ -381,70 +466,7 @@ freemap(vm_map_entry_t map) } /* - * Read the process information necessary to fill in the core file's header. - */ -static void -readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset, - prpsinfo_t *psinfo) -{ - char name[64]; - char line[256]; - int fd; - int i; - int n; - - memset(status, 0, sizeof *status); - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = pid; - - memset(fpregset, 0, sizeof *fpregset); - - memset(psinfo, 0, sizeof *psinfo); - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - - /* Read the general registers. */ - snprintf(name, sizeof name, "/proc/%d/regs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof status->pr_reg, n); - close(fd); - - /* Read the floating point registers. */ - snprintf(name, sizeof name, "/proc/%d/fpregs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof *fpregset, n); - close(fd); - - /* Read and parse the process status. */ - snprintf(name, sizeof name, "/proc/%d/status", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, line, sizeof line - 1)) == -1) - err(1, "read error from %s", name); - if (n > MAXCOMLEN) - n = MAXCOMLEN; - for (i = 0; i < n && line[i] != ' '; i++) - psinfo->pr_fname[i] = line[i]; - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); - close(fd); -} - -/* - * Read the process's memory map using procfs, and return a list of + * Read the process's memory map using kinfo_getvmmap(), and return a list of * VM map entries. Only the non-device read/writable segments are * returned. The map entries in the list aren't fully filled in; only * the items we need are present. @@ -452,83 +474,44 @@ readhdrinfo(pid_t pid, prstatus_t *statu static vm_map_entry_t readmap(pid_t pid) { - char mapname[64]; - int mapfd; - ssize_t mapsize; - size_t bufsize; - char *mapbuf; - int pos; - vm_map_entry_t map; - vm_map_entry_t *linkp; - - snprintf(mapname, sizeof mapname, "/proc/%d/map", pid); - if ((mapfd = open(mapname, O_RDONLY)) == -1) - err(1, "cannot open %s", mapname); + vm_map_entry_t ent, *linkp, map; + struct kinfo_vmentry *vmentl, *kve; + int i, nitems; + + vmentl = kinfo_getvmmap(pid, &nitems); + if (vmentl == NULL) + err(1, "cannot retrieve mappings for %u process", pid); - /* - * Procfs requires (for consistency) that the entire memory map - * be read with a single read() call. Start with a reasonably sized - * buffer, and double it until it is big enough. - */ - bufsize = 8 * 1024; - mapbuf = NULL; - for ( ; ; ) { - if ((mapbuf = realloc(mapbuf, bufsize + 1)) == NULL) - errx(1, "out of memory"); - mapsize = read(mapfd, mapbuf, bufsize); - if (mapsize != -1 || errno != EFBIG) - break; - bufsize *= 2; - /* This lseek shouldn't be necessary, but it is. */ - lseek(mapfd, (off_t)0, SEEK_SET); - } - if (mapsize == -1) - err(1, "read error from %s", mapname); - if (mapsize == 0) - errx(1, "empty map file %s", mapname); - mapbuf[mapsize] = 0; - close(mapfd); - - pos = 0; map = NULL; linkp = ↦ - while (pos < mapsize) { - vm_map_entry_t ent; - u_long start; - u_long end; - char prot[4]; - char type[16]; - int n; - int len; - - len = 0; - n = sscanf(mapbuf + pos, "%lx %lx %*d %*d %*x %3[-rwx]" - " %*d %*d %*x %*s %*s %16s %*s%*[\n]%n", - &start, &end, prot, type, &len); - if (n != 4 || len == 0) - errx(1, "ill-formed line in %s starting at character %d", mapname, pos + 1); - pos += len; - - /* Ignore segments of the wrong kind, and unwritable ones */ - if (strncmp(prot, "rw", 2) != 0 || - (strcmp(type, "default") != 0 && - strcmp(type, "vnode") != 0 && - strcmp(type, "swap") != 0)) + for (i = 0; i < nitems; i++) { + kve = &vmentl[i]; + + /* + * Ignore segments of the wrong kind and ones which are not + * readable and writable. + */ + if ((kve->kve_protection & KVME_PROT_WRITE) == 0 || + (kve->kve_protection & KVME_PROT_READ) == 0 || + (kve->kve_type != KVME_TYPE_DEFAULT && + kve->kve_type != KVME_TYPE_VNODE && + kve->kve_type != KVME_TYPE_SWAP)) continue; - if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL) + ent = calloc(1, sizeof(*ent)); + if (ent == NULL) errx(1, "out of memory"); - ent->start = start; - ent->end = end; + ent->start = (vm_offset_t)kve->kve_start; + ent->end = (vm_offset_t)kve->kve_end; ent->protection = VM_PROT_READ | VM_PROT_WRITE; - if (prot[2] == 'x') - ent->protection |= VM_PROT_EXECUTE; + if ((kve->kve_protection & KVME_PROT_EXEC) != 0) + ent->protection |= VM_PROT_EXECUTE; *linkp = ent; linkp = &ent->next; } - free(mapbuf); - return map; + free(vmentl); + return (map); } struct dumpers elfdump = { elf_ident, elf_coredump }; Modified: stable/8/usr.bin/gcore/gcore.1 ============================================================================== --- stable/8/usr.bin/gcore/gcore.1 Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/gcore.1 Sat Dec 19 19:30:27 2009 (r200737) @@ -32,7 +32,7 @@ .\" @(#)gcore.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd November 18, 2009 .Dt GCORE 1 .Os .Sh NAME @@ -55,11 +55,6 @@ By default, the core is written to the f The process identifier, .Ar pid , must be given on the command line. -If no executable image is -specified, -.Nm -will use -.Dq Pa /proc//file . .Pp The following options are available: .Bl -tag -width indent @@ -80,8 +75,6 @@ The same effect can be achieved manually .Bl -tag -width /var/log/messages -compact .It Pa core. the core image -.It Pa /proc//file -the executable image .El .Sh HISTORY A @@ -89,12 +82,15 @@ A utility appeared in .Bx 4.2 . .Sh BUGS -Context switches or paging activity that occur while -.Nm -is running may cause the program to become confused. -For best results, use -.Fl s -to temporarily stop the target process. +Because of the +.Xr ptrace 2 +usage +.Nm +may not work with processes which are actively investigated with +.Xr truss 1 +or +.Xr gdb 1 . +Additionally, interruptable sleeps may exit with EINTR. .Pp The .Nm Modified: stable/8/usr.bin/gcore/gcore.c ============================================================================== --- stable/8/usr.bin/gcore/gcore.c Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/gcore.c Sat Dec 19 19:30:27 2009 (r200737) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,10 +84,11 @@ SET_DECLARE(dumpset, struct dumpers); int main(int argc, char *argv[]) { - int ch, efd, fd, sflag; + int ch, efd, fd, name[4], sflag; char *binfile, *corefile; - char fname[MAXPATHLEN]; + char passpath[MAXPATHLEN], fname[MAXPATHLEN]; struct dumpers **d, *dumper; + size_t len; sflag = 0; corefile = NULL; @@ -109,9 +111,14 @@ main(int argc, char *argv[]) switch (argc) { case 1: pid = atoi(argv[0]); - asprintf(&binfile, "/proc/%d/file", pid); - if (binfile == NULL) - errx(1, "allocation failure"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + len = sizeof(passpath); + if (sysctl(name, 4, passpath, &len, NULL, 0) == -1) + errx(1, "kern.proc.pathname failure"); + binfile = passpath; break; case 2: pid = atoi(argv[1]); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 19:35:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 869C0106568F; Sat, 19 Dec 2009 19:35:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73AE58FC19; Sat, 19 Dec 2009 19:35: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 nBJJZr0x041929; Sat, 19 Dec 2009 19:35:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJZr2H041924; Sat, 19 Dec 2009 19:35:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191935.nBJJZr2H041924@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200738 - in stable/8: crypto/openssh usr.sbin/cron/cron usr.sbin/inetd usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:35:53 -0000 Author: attilio Date: Sat Dec 19 19:35:53 2009 New Revision: 200738 URL: http://svn.freebsd.org/changeset/base/200738 Log: MFC r199804: Avoid sshd, crond, inetd and syslogd to be killed in an high-pressure swapping environment. Sponsored by: Sandvine Incorporated Modified: stable/8/crypto/openssh/sshd.c stable/8/usr.sbin/cron/cron/cron.c stable/8/usr.sbin/inetd/inetd.c stable/8/usr.sbin/syslogd/syslogd.c Directory Properties: stable/8/crypto/openssh/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) Modified: stable/8/crypto/openssh/sshd.c ============================================================================== --- stable/8/crypto/openssh/sshd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/crypto/openssh/sshd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -47,6 +47,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #ifdef HAVE_SYS_STAT_H # include @@ -1292,6 +1293,10 @@ main(int ac, char **av) /* Initialize configuration options to their default values. */ initialize_server_options(&options); + /* Avoid killing the process in high-pressure swapping environments. */ + if (madvise(NULL, 0, MADV_PROTECT) != 0) + debug("madvise(): %.200s", strerror(errno)); + /* Parse command-line arguments. */ while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:C:dDeiqrtQRT46")) != -1) { switch (opt) { Modified: stable/8/usr.sbin/cron/cron/cron.c ============================================================================== --- stable/8/usr.sbin/cron/cron/cron.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/cron/cron/cron.c Sat Dec 19 19:35:53 2009 (r200738) @@ -24,6 +24,7 @@ static const char rcsid[] = #include "cron.h" +#include #include #if SYS_TIME_H # include @@ -134,6 +135,9 @@ main(argc, argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + log_it("CRON", getpid(), "WARNING", "madvise() failed"); + pidfile_write(pfh); database.head = NULL; database.tail = NULL; Modified: stable/8/usr.sbin/inetd/inetd.c ============================================================================== --- stable/8/usr.sbin/inetd/inetd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/inetd/inetd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -497,6 +498,9 @@ main(int argc, char **argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + syslog(LOG_WARNING, "madvise() failed: %s", strerror(errno)); + for (i = 0; i < PERIPSIZE; ++i) LIST_INIT(&proctable[i]); Modified: stable/8/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/8/usr.sbin/syslogd/syslogd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/syslogd/syslogd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -352,6 +353,9 @@ main(int argc, char *argv[]) pid_t ppid = 1, spid; socklen_t len; + if (madvise(NULL, 0, MADV_PROTECT) != 0) + dprintf("madvise() failed: %s\n", strerror(errno)); + bindhostname = NULL; while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nop:P:sS:Tuv")) != -1) From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 20:42:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9701710656C0; Sat, 19 Dec 2009 20:42:56 +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 85D8C8FC0A; Sat, 19 Dec 2009 20:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJKgubS043227; Sat, 19 Dec 2009 20:42:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKgu9i043225; Sat, 19 Dec 2009 20:42:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912192042.nBJKgu9i043225@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 Dec 2009 20:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200739 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:42:56 -0000 Author: marcel Date: Sat Dec 19 20:42:56 2009 New Revision: 200739 URL: http://svn.freebsd.org/changeset/base/200739 Log: Remove a warning in DELAY about large delays. In kern_shutdown.c we use excessive delays quite habitually. Modified: head/sys/powerpc/booke/clock.c Modified: head/sys/powerpc/booke/clock.c ============================================================================== --- head/sys/powerpc/booke/clock.c Sat Dec 19 19:35:53 2009 (r200738) +++ head/sys/powerpc/booke/clock.c Sat Dec 19 20:42:56 2009 (r200739) @@ -197,15 +197,8 @@ DELAY(int n) { u_quad_t start, end, now; -#define USECS_IN_SEC 1000000ULL - - if (n > USECS_IN_SEC) { - printf("WARNING: %s(%d) called from %p", __func__, n, - __builtin_return_address(0)); - } - start = mftb(); - end = start + (u_quad_t)ticks_per_sec / (USECS_IN_SEC / n); + end = start + (u_quad_t)ticks_per_sec / (1000000ULL / n); do { now = mftb(); } while (now < end || (now > start && end < start)); From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 20:45:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E22B1065670; Sat, 19 Dec 2009 20:45: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 2D46E8FC0C; Sat, 19 Dec 2009 20:45: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 nBJKjOGM043386; Sat, 19 Dec 2009 20:45:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKjO53043384; Sat, 19 Dec 2009 20:45:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912192045.nBJKjO53043384@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Dec 2009 20:45: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: r200740 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:45:24 -0000 Author: yongari Date: Sat Dec 19 20:45:23 2009 New Revision: 200740 URL: http://svn.freebsd.org/changeset/base/200740 Log: Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending timer for Tx queue is at 0x3E. Modified: head/sys/dev/vge/if_vgereg.h Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Sat Dec 19 20:42:56 2009 (r200739) +++ head/sys/dev/vge/if_vgereg.h Sat Dec 19 20:45:23 2009 (r200740) @@ -89,8 +89,8 @@ #define VGE_RXQCSRC 0x36 /* RX queue ctl/status clear */ #define VGE_RXDESC_ADDR_LO 0x38 /* RX desc base addr (lo 32 bits) */ #define VGE_RXDESC_CONSIDX 0x3C /* Current RX descriptor index */ -#define VGE_RXQTIMER 0x3E /* RX queue timer pend register */ -#define VGE_TXQTIMER 0x3F /* TX queue timer pend register */ +#define VGE_TXQTIMER 0x3E /* TX queue timer pend register */ +#define VGE_RXQTIMER 0x3F /* RX queue timer pend register */ #define VGE_TXDESC_ADDR_LO0 0x40 /* TX desc0 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO1 0x44 /* TX desc1 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO2 0x48 /* TX desc2 base addr (lo 32 bits) */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 20:50:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26085106568F; Sat, 19 Dec 2009 20:50:49 +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 14A388FC26; Sat, 19 Dec 2009 20:50: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 nBJKomU1043516; Sat, 19 Dec 2009 20:50:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKomEA043514; Sat, 19 Dec 2009 20:50:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912192050.nBJKomEA043514@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 20:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200741 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:50:49 -0000 Author: kib Date: Sat Dec 19 20:50:48 2009 New Revision: 200741 URL: http://svn.freebsd.org/changeset/base/200741 Log: MFC r198538: Move pselect(3) man page to section 2. Modified: stable/8/ObsoleteFiles.inc (contents, props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Sat Dec 19 20:45:23 2009 (r200740) +++ stable/8/ObsoleteFiles.inc Sat Dec 19 20:50:48 2009 (r200741) @@ -16,6 +16,8 @@ # 20091218: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz +# 20091027: pselect.3 implemented as syscall +OLD_FILES+=usr/share/man/man3/pselect.3.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz