From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 01:30:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B0F106566B; Sun, 11 Apr 2010 01:30:16 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9688FC13; Sun, 11 Apr 2010 01:30: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 o3B1UFHK050705; Sun, 11 Apr 2010 01:30:15 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3B1UFSo050703; Sun, 11 Apr 2010 01:30:15 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004110130.o3B1UFSo050703@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 01:30: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: r206463 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 01:30:16 -0000 Author: kientzle Date: Sun Apr 11 01:30:15 2010 New Revision: 206463 URL: http://svn.freebsd.org/changeset/base/206463 Log: Correct the markup for the -s option, document the iso9660:rockridge and mtree:indent options Modified: head/usr.bin/tar/bsdtar.1 Modified: head/usr.bin/tar/bsdtar.1 ============================================================================== --- head/usr.bin/tar/bsdtar.1 Sat Apr 10 22:24:03 2010 (r206462) +++ head/usr.bin/tar/bsdtar.1 Sun Apr 11 01:30:15 2010 (r206463) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2009 +.Dd Oct 12, 2009 .Dt BSDTAR 1 .Os .Sh NAME @@ -336,6 +336,13 @@ This is enabled by default, use or .Cm iso9660:!joliet to disable. +.It Cm iso9660:rockridge +Support Rock Ridge extensions. +This is enabled by default, use +.Cm !rockridge +or +.Cm iso9660:!rockridge +to disable. .It Cm gzip:compression-level A decimal integer from 0 to 9 specifying the gzip compression level. .It Cm xz:compression-level @@ -359,7 +366,13 @@ Enable generation of .Cm /set lines in the output. .It Cm mtree:indent -XXX need explanation XXX +Produce human-readable output by indenting options and splitting lines +to fit into 80 columns. +.It Cm zip:compression Ns = Ns Ar type +Use +.Ar type +as compression method. +Supported values are store (uncompressed) and deflate (gzip algorithm). .El If a provided option is not supported by any module, that is a fatal error. @@ -412,11 +425,21 @@ but before security checks. .It Fl s Ar pattern Modify file or archive member names according to .Pa pattern . -The pattern has the format /old/new/[gps]. -old is a basic regular expression. -If it doesn't apply, the pattern is skipped. -new is the replacement string of the matched part. -~ is substituted with the match, \e1 to \e9 with the content of +The pattern has the format +.Ar /old/new/ Ns Op gps +where +.Ar old +is a basic regular expression, +.Ar new +is the replacement string of the matched part, +and the optional trailing letters modify +how the replacement is handled. +If +.Ar old +is not matched, the pattern is skipped. +Within +.Ar new , +~ is substituted with the match, \1 to \9 with the content of the corresponding captured group. The optional trailing g specifies that matching should continue after the matched part and stopped on the first unmatched pattern. From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 01:31:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9606F106566B; Sun, 11 Apr 2010 01:31:50 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854BE8FC0A; Sun, 11 Apr 2010 01:31: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 o3B1VoWd051070; Sun, 11 Apr 2010 01:31:50 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3B1Vonx051067; Sun, 11 Apr 2010 01:31:50 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004110131.o3B1Vonx051067@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 01:31: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: r206464 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 01:31:50 -0000 Author: kientzle Date: Sun Apr 11 01:31:50 2010 New Revision: 206464 URL: http://svn.freebsd.org/changeset/base/206464 Log: Remove an unnecessary include and conditionalize some code. Modified: head/usr.bin/tar/bsdtar.c head/usr.bin/tar/bsdtar_platform.h Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sun Apr 11 01:30:15 2010 (r206463) +++ head/usr.bin/tar/bsdtar.c Sun Apr 11 01:31:50 2010 (r206464) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "bsdtar.h" #include "err.h" -#include "matching.h" /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from @@ -180,8 +179,10 @@ main(int argc, char **argv) time(&now); +#if HAVE_SETLOCALE if (setlocale(LC_ALL, "") == NULL) bsdtar_warnc(0, "Failed to set default locale"); +#endif #if defined(HAVE_NL_LANGINFO) && defined(HAVE_D_MD_ORDER) bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd'); #endif Modified: head/usr.bin/tar/bsdtar_platform.h ============================================================================== --- head/usr.bin/tar/bsdtar_platform.h Sun Apr 11 01:30:15 2010 (r206463) +++ head/usr.bin/tar/bsdtar_platform.h Sun Apr 11 01:31:50 2010 (r206464) @@ -62,6 +62,10 @@ #include "archive_entry.h" #endif +#ifdef HAVE_LIBACL +#include +#endif + /* * Include "dirent.h" (or it's equivalent on several different platforms). * From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 01:32:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6BF106564A; Sun, 11 Apr 2010 01:32:30 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC888FC0A; Sun, 11 Apr 2010 01:32: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 o3B1WU9U051270; Sun, 11 Apr 2010 01:32:30 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3B1WURr051268; Sun, 11 Apr 2010 01:32:30 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004110132.o3B1WURr051268@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 01:32: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: r206465 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 01:32:30 -0000 Author: kientzle Date: Sun Apr 11 01:32:30 2010 New Revision: 206465 URL: http://svn.freebsd.org/changeset/base/206465 Log: Consistently specify O_BINARY when opening files. Modified: head/usr.bin/tar/write.c Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Apr 11 01:31:50 2010 (r206464) +++ head/usr.bin/tar/write.c Sun Apr 11 01:32:30 2010 (r206465) @@ -95,6 +95,10 @@ __FBSDID("$FreeBSD$"); /* Fixed size of uname/gname caches. */ #define name_cache_size 101 +#ifndef O_BINARY +#define O_BINARY 0 +#endif + static const char * const NO_NAME = "(noname)"; struct archive_dir_entry { @@ -256,9 +260,9 @@ tar_mode_r(struct bsdtar *bsdtar) format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; #if defined(__BORLANDC__) - bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT); + bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT | O_BINARY); #else - bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT, 0666); + bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT | O_BINARY, 0666); #endif if (bsdtar->fd < 0) bsdtar_errc(1, errno, @@ -353,7 +357,7 @@ tar_mode_u(struct bsdtar *bsdtar) /* Sanity-test some arguments and the file. */ test_for_append(bsdtar); - bsdtar->fd = open(bsdtar->filename, O_RDWR); + bsdtar->fd = open(bsdtar->filename, O_RDWR | O_BINARY); if (bsdtar->fd < 0) bsdtar_errc(1, errno, "Cannot open %s", bsdtar->filename); @@ -843,7 +847,7 @@ write_hierarchy(struct bsdtar *bsdtar, s #if defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) /* Linux uses ioctl to read flags. */ if (bsdtar->option_honor_nodump) { - int fd = open(name, O_RDONLY | O_NONBLOCK); + int fd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY); if (fd >= 0) { unsigned long fflags; int r = ioctl(fd, EXT2_IOC_GETFLAGS, &fflags); @@ -913,7 +917,7 @@ write_entry_backend(struct bsdtar *bsdta if (archive_entry_size(entry) > 0) { const char *pathname = archive_entry_sourcepath(entry); - fd = open(pathname, O_RDONLY); + fd = open(pathname, O_RDONLY | O_BINARY); if (fd == -1) { if (!bsdtar->verbose) bsdtar_warnc(errno, From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 01:36:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 039F9106564A; Sun, 11 Apr 2010 01:36:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E722B8FC0C; Sun, 11 Apr 2010 01:36: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 o3B1aATx052110; Sun, 11 Apr 2010 01:36:10 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3B1aAY9052108; Sun, 11 Apr 2010 01:36:10 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004110136.o3B1aAY9052108@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 01:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206466 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 01:36:11 -0000 Author: kientzle Date: Sun Apr 11 01:36:10 2010 New Revision: 206466 URL: http://svn.freebsd.org/changeset/base/206466 Log: Fix -X. Modified: head/usr.bin/tar/matching.c Modified: head/usr.bin/tar/matching.c ============================================================================== --- head/usr.bin/tar/matching.c Sun Apr 11 01:32:30 2010 (r206465) +++ head/usr.bin/tar/matching.c Sun Apr 11 01:36:10 2010 (r206466) @@ -89,7 +89,7 @@ lafe_exclude_from_file(struct lafe_match const char *p; int ret = 0; - lr = lafe_line_reader(pathname, '\n'); + lr = lafe_line_reader(pathname, 0); while ((p = lafe_line_reader_next(lr)) != NULL) { if (lafe_exclude(matching, p) != 0) ret = -1; From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 09:16:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7412106566B; Sun, 11 Apr 2010 09:16:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 79EAA8FC12; Sun, 11 Apr 2010 09:16:16 +0000 (UTC) Received: from c122-106-168-84.carlnfd1.nsw.optusnet.com.au (c122-106-168-84.carlnfd1.nsw.optusnet.com.au [122.106.168.84]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3B9GCxI012004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Apr 2010 19:16:14 +1000 Date: Sun, 11 Apr 2010 19:16:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Roman Divacky In-Reply-To: <201004091521.o39FLBqx035856@svn.freebsd.org> Message-ID: <20100411175432.S10835@delplex.bde.org> References: <201004091521.o39FLBqx035856@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: r206424 - head/usr.bin/xlint/lint1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 09:16:17 -0000 On Fri, 9 Apr 2010, Roman Divacky wrote: > Log: > Rename the ALIGN macro to LINT_ALIGN so it does not clash with machine/param.h > > Bump the alignment to 16bytes because lint1 memory allocator is used for > objects that require 16bytes alignment on amd64 (ie. val_t). This makes > lint1 work when compiled with compiler(s) that use SSE for memcpy on amd64. > (e.g. clang). This seems to be mostly backwards. xlint wants to use the system ALIGN(), since it has no way of knowing the correct alignment. However, the system might not supply ALIGN(), so it provided its own probably-incorrect ALIGN() as a fallback. FreeBSD has a system ALIGN() and it should have always been used. xlint get the includes correct for this, though this is fragile. However2, the system ALIGN() on amd64 doesn't know the correct alignment either (both essentially had 64 bits hard-coded). Now xlint uses a different hard-coded alignment (128 bits). For a non-backwards fix, you need to follow the comment in xlint which says ALIGN should go away [in xlint]. Other compilers might need a working system ALIGN() in other places. I think only memory allocator in xlint needs a working ALIGN() (just 1 instance). Perhaps the allocator should just use malloc(). The only other uses of ALIGN() are in getbound(). These seem to be all completely wrong. The all use ALIGN(1), where ALIGN() is the host or hard-coded ALIGN() which gives maximal alignment and 1 is the size of a char, where SALIGN(type), where SALIGN() is the source ALIGN() which gives the (usually non-maximal) alignment of a type and the `type' parameter must contain type info and not be just the size of the type (certainly not the size of another type) since types of the same size may have different alignment. SALIGN() is much more impossible to write as a portable macro. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 09:26:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31EC106566B; Sun, 11 Apr 2010 09:26:29 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 962F38FC1A; Sun, 11 Apr 2010 09:26:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1B1759CB099; Sun, 11 Apr 2010 11:24:20 +0200 (CEST) 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 j6QW7gblIOUC; Sun, 11 Apr 2010 11:24:18 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D88CD9CB0F4; Sun, 11 Apr 2010 11:24:17 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o3B9OHb8038206; Sun, 11 Apr 2010 11:24:17 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 11 Apr 2010 11:24:17 +0200 From: Roman Divacky To: Bruce Evans Message-ID: <20100411092417.GA37528@freebsd.org> References: <201004091521.o39FLBqx035856@svn.freebsd.org> <20100411175432.S10835@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100411175432.S10835@delplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206424 - head/usr.bin/xlint/lint1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 09:26:30 -0000 On Sun, Apr 11, 2010 at 07:16:12PM +1000, Bruce Evans wrote: > On Fri, 9 Apr 2010, Roman Divacky wrote: > > >Log: > > Rename the ALIGN macro to LINT_ALIGN so it does not clash with > > machine/param.h > > > > Bump the alignment to 16bytes because lint1 memory allocator is used for > > objects that require 16bytes alignment on amd64 (ie. val_t). This makes > > lint1 work when compiled with compiler(s) that use SSE for memcpy on > > amd64. > > (e.g. clang). > > This seems to be mostly backwards. xlint wants to use the system > ALIGN(), since it has no way of knowing the correct alignment. However, > the system might not supply ALIGN(), so it provided its own > probably-incorrect ALIGN() as a fallback. FreeBSD has a system ALIGN() > and it should have always been used. xlint get the includes correct > for this, though this is fragile. However2, the system ALIGN() on > amd64 doesn't know the correct alignment either (both essentially had > 64 bits hard-coded). Now xlint uses a different hard-coded alignment > (128 bits). so you suggest fixing the ALIGN on amd64? ie. to make it 128bit? > For a non-backwards fix, you need to follow the comment in xlint which > says ALIGN should go away [in xlint]. Other compilers might need a > working system ALIGN() in other places. I think only memory allocator > in xlint needs a working ALIGN() (just 1 instance). Perhaps the allocator > should just use malloc(). The only other uses of ALIGN() are in getbound(). > These seem to be all completely wrong. The all use ALIGN(1), where ALIGN() > is the host or hard-coded ALIGN() which gives maximal alignment and 1 is > the size of a char, where SALIGN(type), where SALIGN() is the source > ALIGN() which gives the (usually non-maximal) alignment of a type and > the `type' parameter must contain type info and not be just the size of > the type (certainly not the size of another type) since types of the same > size may have different alignment. SALIGN() is much more impossible to > write as a portable macro. the xlint allocator uses malloc and builds upon it. fixing this wont be trivial and I have no interest in it :( From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 10:13:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12C8106566C; Sun, 11 Apr 2010 10:13:44 +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 1E7588FC0A; Sun, 11 Apr 2010 10:13:43 +0000 (UTC) Received: from besplex.bde.org (c122-106-168-84.carlnfd1.nsw.optusnet.com.au [122.106.168.84]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3BADecX027220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Apr 2010 20:13:41 +1000 Date: Sun, 11 Apr 2010 20:13:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Roman Divacky In-Reply-To: <20100411092417.GA37528@freebsd.org> Message-ID: <20100411200313.G2454@besplex.bde.org> References: <201004091521.o39FLBqx035856@svn.freebsd.org> <20100411175432.S10835@delplex.bde.org> <20100411092417.GA37528@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, Bruce Evans Subject: Re: svn commit: r206424 - head/usr.bin/xlint/lint1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 10:13:44 -0000 On Sun, 11 Apr 2010, Roman Divacky wrote: > On Sun, Apr 11, 2010 at 07:16:12PM +1000, Bruce Evans wrote: >> .... However2, the system ALIGN() on >> amd64 doesn't know the correct alignment either (both essentially had >> 64 bits hard-coded). Now xlint uses a different hard-coded alignment >> (128 bits). > > so you suggest fixing the ALIGN on amd64? ie. to make it 128bit? It's an ABI change, thus needs careful release engineering. _ALIGN (= ALIGN) is used in the CMSG ABI in so I think would affect public ABIs. amd64 has a strict ABI which I think involves 128-byte alignment for long doubles (not sure if it specifies anything for non-C things like copies of SSE registers). The system should have a macro to support the maximal alignment and it is easiest to use ALIGN() for this (otherwise you would need a new macro for this and keep ALIGN() for pointers and longs...). Bruce From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 11:49:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E93DD106566C; Sun, 11 Apr 2010 11:49:24 +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 D74AD8FC12; Sun, 11 Apr 2010 11:49: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 o3BBnOYY088192; Sun, 11 Apr 2010 11:49:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BBnOOm088190; Sun, 11 Apr 2010 11:49:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111149.o3BBnOOm088190@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 11:49: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: r206469 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:49:25 -0000 Author: bz Date: Sun Apr 11 11:49:24 2010 New Revision: 206469 URL: http://svn.freebsd.org/changeset/base/206469 Log: In if_detach_internal() only try to do the detach run if if_attachdomain1() has actually succeeded to initialize and attach. There is a theoretical possibility to drop out early in if_attachdomain1() leaving the array uninitialized if we cannot get the lock. Discussed with: rwatson MFC after: 10 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Apr 11 11:27:19 2010 (r206468) +++ head/sys/net/if.c Sun Apr 11 11:49:24 2010 (r206469) @@ -898,7 +898,7 @@ if_detach_internal(struct ifnet *ifp, in if_delgroups(ifp); IF_AFDATA_LOCK(ifp); - for (dp = domains; dp; dp = dp->dom_next) { + for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) { if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 11:51:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483AA106567E; Sun, 11 Apr 2010 11:51:45 +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 366CE8FC2C; Sun, 11 Apr 2010 11:51: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 o3BBpjt9088726; Sun, 11 Apr 2010 11:51:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BBpjlJ088724; Sun, 11 Apr 2010 11:51:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111151.o3BBpjlJ088724@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 11:51: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: r206470 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:51:45 -0000 Author: bz Date: Sun Apr 11 11:51:44 2010 New Revision: 206470 URL: http://svn.freebsd.org/changeset/base/206470 Log: In if_detach_internal() we cannot hold the af_data lock over the dom_ifdetach() calls as they might sleep for callout_drain(). Do as we do in if_attachdomain1() [r121470] and handle if_afdata_initialized earlier and call dom_ifdetach() unlocked. Discussed with: rwatson MFC after: 10 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Apr 11 11:49:24 2010 (r206469) +++ head/sys/net/if.c Sun Apr 11 11:51:44 2010 (r206470) @@ -897,14 +897,20 @@ if_detach_internal(struct ifnet *ifp, in devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); if_delgroups(ifp); + /* + * We cannot hold the lock over dom_ifdetach calls as they might + * sleep, for example trying to drain a callout, thus open up the + * theoretical race with re-attaching. + */ IF_AFDATA_LOCK(ifp); - for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) { + i = ifp->if_afdata_initialized; + ifp->if_afdata_initialized = 0; + IF_AFDATA_UNLOCK(ifp); + for (dp = domains; i > 0 && dp; dp = dp->dom_next) { if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); } - ifp->if_afdata_initialized = 0; - IF_AFDATA_UNLOCK(ifp); } #ifdef VIMAGE From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 12:02:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 497B01065670; Sun, 11 Apr 2010 12:02:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377628FC1C; Sun, 11 Apr 2010 12:02: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 o3BC2EWc091078; Sun, 11 Apr 2010 12:02:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BC2ED7091075; Sun, 11 Apr 2010 12:02:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201004111202.o3BC2ED7091075@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Apr 2010 12:02: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: r206471 - head/usr.sbin/lastlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 12:02:14 -0000 Author: ed Date: Sun Apr 11 12:02:13 2010 New Revision: 206471 URL: http://svn.freebsd.org/changeset/base/206471 Log: Alphabetically sort the output of lastlogin(8). According to the manpage, the entries have to be sorted by uid. This is no longer possible, since our utmpx implementation is completely unaware of user IDs. You can safely add entries for multiple users sharing the same uid. Make the output less random by sorting everything by name. Modified: head/usr.sbin/lastlogin/lastlogin.8 head/usr.sbin/lastlogin/lastlogin.c Modified: head/usr.sbin/lastlogin/lastlogin.8 ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.8 Sun Apr 11 11:51:44 2010 (r206470) +++ head/usr.sbin/lastlogin/lastlogin.8 Sun Apr 11 12:02:13 2010 (r206471) @@ -55,7 +55,7 @@ If more than one is given, the session information for each user is printed in the order given on the command line. Otherwise, information -for all users is printed, sorted by uid. +for all users is printed, sorted by name. .Pp The .Nm Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 11:51:44 2010 (r206470) +++ head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 12:02:13 2010 (r206471) @@ -39,6 +39,7 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998 #include #include #include +#include #include #include #include @@ -47,11 +48,19 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998 static void output(struct utmpx *); static void usage(void); +static int +utcmp(const void *u1, const void *u2) +{ + + return (strcmp(((const struct utmpx *)u1)->ut_user, + ((const struct utmpx *)u2)->ut_user)); +} + int main(int argc, char *argv[]) { - int ch, i; - struct utmpx *u; + int ch, i, ulistsize; + struct utmpx *u, *ulist; while ((ch = getopt(argc, argv, "")) != -1) { usage(); @@ -74,12 +83,21 @@ main(int argc, char *argv[]) else { if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) errx(1, "failed to open lastlog database"); + ulist = NULL; + ulistsize = 0; while ((u = getutxent()) != NULL) { if (u->ut_type != USER_PROCESS) continue; - output(u); + if ((ulistsize % 16) == 0) + ulist = realloc(ulist, + (ulistsize + 16) * sizeof(struct utmpx)); + ulist[ulistsize++] = *u; } endutxent(); + + qsort(ulist, ulistsize, sizeof(struct utmpx), utcmp); + for (i = 0; i < ulistsize; i++) + output(&ulist[i]); } exit(0); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 12:07:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D85106566C; Sun, 11 Apr 2010 12:07:04 +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 45F518FC0A; Sun, 11 Apr 2010 12:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3BC74Cm092149; Sun, 11 Apr 2010 12:07:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BC74Lf092147; Sun, 11 Apr 2010 12:07:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201004111207.o3BC74Lf092147@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Apr 2010 12:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206472 - head/usr.sbin/lastlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 12:07:04 -0000 Author: ed Date: Sun Apr 11 12:07:03 2010 New Revision: 206472 URL: http://svn.freebsd.org/changeset/base/206472 Log: Don't forget to catch realloc() errors. Modified: head/usr.sbin/lastlogin/lastlogin.c Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 12:02:13 2010 (r206471) +++ head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 12:07:03 2010 (r206472) @@ -88,9 +88,12 @@ main(int argc, char *argv[]) while ((u = getutxent()) != NULL) { if (u->ut_type != USER_PROCESS) continue; - if ((ulistsize % 16) == 0) + if ((ulistsize % 16) == 0) { ulist = realloc(ulist, (ulistsize + 16) * sizeof(struct utmpx)); + if (ulist == NULL) + err(1, "malloc"); + } ulist[ulistsize++] = *u; } endutxent(); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 12:24:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0712B106564A; Sun, 11 Apr 2010 12:24:48 +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 E983E8FC18; Sun, 11 Apr 2010 12:24: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 o3BCOlCS096041; Sun, 11 Apr 2010 12:24:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BCOl4j096038; Sun, 11 Apr 2010 12:24:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004111224.o3BCOl4j096038@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 11 Apr 2010 12:24: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: r206473 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 12:24:48 -0000 Author: jilles Date: Sun Apr 11 12:24:47 2010 New Revision: 206473 URL: http://svn.freebsd.org/changeset/base/206473 Log: sh: Partially revert r206146, allowing double-quotes in arithmetic. These do pretty much nothing (except that parentheses are ignored), but people seem to use them and allowing them does not hurt much. Single-quotes seem not to be used and cause silently different behaviour with ksh93 character constants. Modified: head/bin/sh/mksyntax.c head/bin/sh/parser.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Sun Apr 11 12:07:03 2010 (r206472) +++ head/bin/sh/mksyntax.c Sun Apr 11 12:24:47 2010 (r206473) @@ -232,6 +232,7 @@ main(int argc __unused, char **argv __un add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); + add("\"", "CDQUOTE"); add("$", "CVAR"); add("}", "CENDVAR"); add("(", "CLP"); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Apr 11 12:07:03 2010 (r206472) +++ head/bin/sh/parser.c Sun Apr 11 12:24:47 2010 (r206473) @@ -1223,7 +1223,10 @@ readtoken1(int firstc, char const *initi if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); else { - state[level].syntax = BASESYNTAX; + if (state[level].category == TSTATE_ARITH) + state[level].syntax = ARISYNTAX; + else + state[level].syntax = BASESYNTAX; quotef++; } break; From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 13:46:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548EC106566B; Sun, 11 Apr 2010 13:46:43 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440F08FC13; Sun, 11 Apr 2010 13:46: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 o3BDkhRl014051; Sun, 11 Apr 2010 13:46:43 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BDkhX2014049; Sun, 11 Apr 2010 13:46:43 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004111346.o3BDkhX2014049@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 11 Apr 2010 13:46: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: r206474 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 13:46:43 -0000 Author: bschmidt Date: Sun Apr 11 13:46:42 2010 New Revision: 206474 URL: http://svn.freebsd.org/changeset/base/206474 Log: Add some missing protoypes. Approved by: rpaulo (mentor) MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Apr 11 12:24:47 2010 (r206473) +++ head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:46:42 2010 (r206474) @@ -82,11 +82,12 @@ static struct ieee80211vap *iwn_vap_crea const uint8_t mac[IEEE80211_ADDR_LEN]); static void iwn_vap_delete(struct ieee80211vap *); static int iwn_cleanup(device_t); -static int iwn_detach(device_t); +static int iwn_detach(device_t); int iwn_nic_lock(struct iwn_softc *); int iwn_eeprom_lock(struct iwn_softc *); int iwn_init_otprom(struct iwn_softc *); int iwn_read_prom_data(struct iwn_softc *, uint32_t, void *, int); +static void iwn_dma_map_addr(void *, bus_dma_segment_t *, int, int); static int iwn_dma_contig_alloc(struct iwn_softc *, struct iwn_dma_info *, void **, bus_size_t, bus_size_t, int); static void iwn_dma_contig_free(struct iwn_dma_info *); @@ -111,6 +112,11 @@ int iwn_read_eeprom(struct iwn_softc *, void iwn4965_read_eeprom(struct iwn_softc *); void iwn4965_print_power_group(struct iwn_softc *, int); void iwn5000_read_eeprom(struct iwn_softc *); +static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); +static void iwn_read_eeprom_band(struct iwn_softc *, int); +#if 0 /* HT */ +static void iwn_read_eeprom_ht40(struct iwn_softc *, int); +#endif static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); void iwn_read_eeprom_enhinfo(struct iwn_softc *); @@ -150,6 +156,7 @@ void iwn4965_update_sched(struct iwn_so void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, uint16_t); void iwn5000_reset_sched(struct iwn_softc *, int, int); +static uint8_t iwn_plcp_signal(int); int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *, struct iwn_tx_ring *); static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -195,6 +202,22 @@ int iwn_config(struct iwn_softc *); int iwn_scan(struct iwn_softc *); int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); +#if 0 /* HT */ +static int iwn_ampdu_rx_start(struct ieee80211com *, + struct ieee80211_node *, uint8_t); +static void iwn_ampdu_rx_stop(struct ieee80211com *, + struct ieee80211_node *, uint8_t); +static int iwn_ampdu_tx_start(struct ieee80211com *, + struct ieee80211_node *, uint8_t); +static void iwn_ampdu_tx_stop(struct ieee80211com *, + struct ieee80211_node *, uint8_t); +static void iwn4965_ampdu_tx_start(struct iwn_softc *, + struct ieee80211_node *, uint8_t, uint16_t); +static void iwn4965_ampdu_tx_stop(struct iwn_softc *, uint8_t, uint16_t); +static void iwn5000_ampdu_tx_start(struct iwn_softc *, + struct ieee80211_node *, uint8_t, uint16_t); +static void iwn5000_ampdu_tx_stop(struct iwn_softc *, uint8_t, uint16_t); +#endif int iwn5000_query_calibration(struct iwn_softc *); int iwn5000_send_calibration(struct iwn_softc *); int iwn5000_send_wimax_coex(struct iwn_softc *); @@ -225,6 +248,8 @@ static void iwn_scan_end(struct ieee802 static void iwn_set_channel(struct ieee80211com *); static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); +static struct iwn_eeprom_chan *iwn_find_eeprom_channel(struct iwn_softc *, + struct ieee80211_channel *); static int iwn_setregdomain(struct ieee80211com *, struct ieee80211_regdomain *, int, struct ieee80211_channel []); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 13:47:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9180D1065672; Sun, 11 Apr 2010 13:47:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 813CC8FC14; Sun, 11 Apr 2010 13:47: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 o3BDlkqF014318; Sun, 11 Apr 2010 13:47:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BDlkjL014316; Sun, 11 Apr 2010 13:47:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004111347.o3BDlkjL014316@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 11 Apr 2010 13:47: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: r206475 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 13:47:46 -0000 Author: bschmidt Date: Sun Apr 11 13:47:46 2010 New Revision: 206475 URL: http://svn.freebsd.org/changeset/base/206475 Log: iwn5000_reset_sched() is not used; #ifdef it. Approved by: rpaulo (mentor) MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:46:42 2010 (r206474) +++ head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:47:46 2010 (r206475) @@ -155,7 +155,9 @@ void iwn4965_update_sched(struct iwn_so uint16_t); void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, uint16_t); +#ifdef notyet void iwn5000_reset_sched(struct iwn_softc *, int, int); +#endif static uint8_t iwn_plcp_signal(int); int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *, struct iwn_tx_ring *); @@ -2818,6 +2820,7 @@ iwn5000_update_sched(struct iwn_softc *s } } +#ifdef notyet void iwn5000_reset_sched(struct iwn_softc *sc, int qid, int idx) { @@ -2832,6 +2835,7 @@ iwn5000_reset_sched(struct iwn_softc *sc BUS_DMASYNC_PREWRITE); } } +#endif static uint8_t iwn_plcp_signal(int rate) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 13:48:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7C151065670; Sun, 11 Apr 2010 13:48:52 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97B778FC13; Sun, 11 Apr 2010 13:48: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 o3BDmq1c014619; Sun, 11 Apr 2010 13:48:52 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BDmqMv014617; Sun, 11 Apr 2010 13:48:52 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004111348.o3BDmqMv014617@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 11 Apr 2010 13:48: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: r206476 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 13:48:54 -0000 Author: bschmidt Date: Sun Apr 11 13:48:52 2010 New Revision: 206476 URL: http://svn.freebsd.org/changeset/base/206476 Log: Hook ieee80211_media_change() to ieee80211_vap_attach(). Approved by: rpaulo (mentor) MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:47:46 2010 (r206475) +++ head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:48:52 2010 (r206476) @@ -787,8 +787,7 @@ iwn_vap_create(struct ieee80211com *ic, ieee80211_ratectl_init(vap); /* Complete setup. */ - ieee80211_vap_attach(vap, ieee80211_media_change, - ieee80211_media_status); + ieee80211_vap_attach(vap, iwn_media_change, ieee80211_media_status); ic->ic_opmode = opmode; return vap; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 13:51:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F0E106566B; Sun, 11 Apr 2010 13:51:20 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 427A88FC12; Sun, 11 Apr 2010 13:51: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 o3BDpKYu015179; Sun, 11 Apr 2010 13:51:20 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BDpKWP015177; Sun, 11 Apr 2010 13:51:20 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004111351.o3BDpKWP015177@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 11 Apr 2010 13:51: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: r206477 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 13:51:20 -0000 Author: bschmidt Date: Sun Apr 11 13:51:20 2010 New Revision: 206477 URL: http://svn.freebsd.org/changeset/base/206477 Log: Declare all functions as static. Approved by: rpaulo (mentor) MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:48:52 2010 (r206476) +++ head/sys/dev/iwn/if_iwn.c Sun Apr 11 13:51:20 2010 (r206477) @@ -74,8 +74,8 @@ __FBSDID("$FreeBSD$"); static int iwn_probe(device_t); static int iwn_attach(device_t); -const struct iwn_hal *iwn_hal_attach(struct iwn_softc *); -void iwn_radiotap_attach(struct iwn_softc *); +static const struct iwn_hal *iwn_hal_attach(struct iwn_softc *); +static void iwn_radiotap_attach(struct iwn_softc *); static struct ieee80211vap *iwn_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], @@ -83,35 +83,35 @@ static struct ieee80211vap *iwn_vap_crea static void iwn_vap_delete(struct ieee80211vap *); static int iwn_cleanup(device_t); static int iwn_detach(device_t); -int iwn_nic_lock(struct iwn_softc *); -int iwn_eeprom_lock(struct iwn_softc *); -int iwn_init_otprom(struct iwn_softc *); -int iwn_read_prom_data(struct iwn_softc *, uint32_t, void *, int); +static int iwn_nic_lock(struct iwn_softc *); +static int iwn_eeprom_lock(struct iwn_softc *); +static int iwn_init_otprom(struct iwn_softc *); +static int iwn_read_prom_data(struct iwn_softc *, uint32_t, void *, int); static void iwn_dma_map_addr(void *, bus_dma_segment_t *, int, int); static int iwn_dma_contig_alloc(struct iwn_softc *, struct iwn_dma_info *, void **, bus_size_t, bus_size_t, int); static void iwn_dma_contig_free(struct iwn_dma_info *); -int iwn_alloc_sched(struct iwn_softc *); -void iwn_free_sched(struct iwn_softc *); -int iwn_alloc_kw(struct iwn_softc *); -void iwn_free_kw(struct iwn_softc *); -int iwn_alloc_ict(struct iwn_softc *); -void iwn_free_ict(struct iwn_softc *); -int iwn_alloc_fwmem(struct iwn_softc *); -void iwn_free_fwmem(struct iwn_softc *); -int iwn_alloc_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); -void iwn_reset_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); -void iwn_free_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); -int iwn_alloc_tx_ring(struct iwn_softc *, struct iwn_tx_ring *, +static int iwn_alloc_sched(struct iwn_softc *); +static void iwn_free_sched(struct iwn_softc *); +static int iwn_alloc_kw(struct iwn_softc *); +static void iwn_free_kw(struct iwn_softc *); +static int iwn_alloc_ict(struct iwn_softc *); +static void iwn_free_ict(struct iwn_softc *); +static int iwn_alloc_fwmem(struct iwn_softc *); +static void iwn_free_fwmem(struct iwn_softc *); +static int iwn_alloc_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); +static void iwn_reset_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); +static void iwn_free_rx_ring(struct iwn_softc *, struct iwn_rx_ring *); +static int iwn_alloc_tx_ring(struct iwn_softc *, struct iwn_tx_ring *, int); -void iwn_reset_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); -void iwn_free_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); -void iwn5000_ict_reset(struct iwn_softc *); -int iwn_read_eeprom(struct iwn_softc *, +static void iwn_reset_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); +static void iwn_free_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); +static void iwn5000_ict_reset(struct iwn_softc *); +static int iwn_read_eeprom(struct iwn_softc *, uint8_t macaddr[IEEE80211_ADDR_LEN]); -void iwn4965_read_eeprom(struct iwn_softc *); -void iwn4965_print_power_group(struct iwn_softc *, int); -void iwn5000_read_eeprom(struct iwn_softc *); +static void iwn4965_read_eeprom(struct iwn_softc *); +static void iwn4965_print_power_group(struct iwn_softc *, int); +static void iwn5000_read_eeprom(struct iwn_softc *); static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); static void iwn_read_eeprom_band(struct iwn_softc *, int); #if 0 /* HT */ @@ -119,91 +119,91 @@ static void iwn_read_eeprom_ht40(struct #endif static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); -void iwn_read_eeprom_enhinfo(struct iwn_softc *); -struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, +static void iwn_read_eeprom_enhinfo(struct iwn_softc *); +static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -void iwn_newassoc(struct ieee80211_node *, int); -int iwn_media_change(struct ifnet *); -int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); -void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn_newassoc(struct ieee80211_node *, int); +static int iwn_media_change(struct ifnet *); +static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); +static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_timer_timeout(void *); static void iwn_calib_reset(struct iwn_softc *); -void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); #if 0 /* HT */ -void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); #endif -void iwn5000_rx_calib_results(struct iwn_softc *, +static void iwn5000_rx_calib_results(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -void iwn4965_tx_done(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn4965_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, +static void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, +static void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, uint8_t); -void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); -void iwn_notif_intr(struct iwn_softc *); -void iwn_wakeup_intr(struct iwn_softc *); -void iwn_rftoggle_intr(struct iwn_softc *); -void iwn_fatal_intr(struct iwn_softc *); -void iwn_intr(void *); -void iwn4965_update_sched(struct iwn_softc *, int, int, uint8_t, +static void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); +static void iwn_notif_intr(struct iwn_softc *); +static void iwn_wakeup_intr(struct iwn_softc *); +static void iwn_rftoggle_intr(struct iwn_softc *); +static void iwn_fatal_intr(struct iwn_softc *); +static void iwn_intr(void *); +static void iwn4965_update_sched(struct iwn_softc *, int, int, uint8_t, uint16_t); -void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, +static void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, uint16_t); #ifdef notyet -void iwn5000_reset_sched(struct iwn_softc *, int, int); +static void iwn5000_reset_sched(struct iwn_softc *, int, int); #endif static uint8_t iwn_plcp_signal(int); -int iwn_tx_data(struct iwn_softc *, struct mbuf *, +static int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *, struct iwn_tx_ring *); static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -void iwn_start(struct ifnet *); -void iwn_start_locked(struct ifnet *); +static void iwn_start(struct ifnet *); +static void iwn_start_locked(struct ifnet *); static void iwn_watchdog(struct iwn_softc *sc); -int iwn_ioctl(struct ifnet *, u_long, caddr_t); -int iwn_cmd(struct iwn_softc *, int, const void *, int, int); -int iwn4965_add_node(struct iwn_softc *, struct iwn_node_info *, +static int iwn_ioctl(struct ifnet *, u_long, caddr_t); +static int iwn_cmd(struct iwn_softc *, int, const void *, int, int); +static int iwn4965_add_node(struct iwn_softc *, struct iwn_node_info *, int); -int iwn5000_add_node(struct iwn_softc *, struct iwn_node_info *, +static int iwn5000_add_node(struct iwn_softc *, struct iwn_node_info *, int); -int iwn_set_link_quality(struct iwn_softc *, uint8_t, int); -int iwn_add_broadcast_node(struct iwn_softc *, int); -int iwn_wme_update(struct ieee80211com *); +static int iwn_set_link_quality(struct iwn_softc *, uint8_t, int); +static int iwn_add_broadcast_node(struct iwn_softc *, int); +static int iwn_wme_update(struct ieee80211com *); static void iwn_update_mcast(struct ifnet *); -void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t); -int iwn_set_critical_temp(struct iwn_softc *); -int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *); -void iwn4965_power_calibration(struct iwn_softc *, int); -int iwn4965_set_txpower(struct iwn_softc *, +static void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t); +static int iwn_set_critical_temp(struct iwn_softc *); +static int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *); +static void iwn4965_power_calibration(struct iwn_softc *, int); +static int iwn4965_set_txpower(struct iwn_softc *, struct ieee80211_channel *, int); -int iwn5000_set_txpower(struct iwn_softc *, +static int iwn5000_set_txpower(struct iwn_softc *, struct ieee80211_channel *, int); -int iwn4965_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); -int iwn5000_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); -int iwn_get_noise(const struct iwn_rx_general_stats *); -int iwn4965_get_temperature(struct iwn_softc *); -int iwn5000_get_temperature(struct iwn_softc *); -int iwn_init_sensitivity(struct iwn_softc *); -void iwn_collect_noise(struct iwn_softc *, +static int iwn4965_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); +static int iwn5000_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); +static int iwn_get_noise(const struct iwn_rx_general_stats *); +static int iwn4965_get_temperature(struct iwn_softc *); +static int iwn5000_get_temperature(struct iwn_softc *); +static int iwn_init_sensitivity(struct iwn_softc *); +static void iwn_collect_noise(struct iwn_softc *, const struct iwn_rx_general_stats *); -int iwn4965_init_gains(struct iwn_softc *); -int iwn5000_init_gains(struct iwn_softc *); -int iwn4965_set_gains(struct iwn_softc *); -int iwn5000_set_gains(struct iwn_softc *); -void iwn_tune_sensitivity(struct iwn_softc *, +static int iwn4965_init_gains(struct iwn_softc *); +static int iwn5000_init_gains(struct iwn_softc *); +static int iwn4965_set_gains(struct iwn_softc *); +static int iwn5000_set_gains(struct iwn_softc *); +static void iwn_tune_sensitivity(struct iwn_softc *, const struct iwn_rx_stats *); -int iwn_send_sensitivity(struct iwn_softc *); -int iwn_set_pslevel(struct iwn_softc *, int, int, int); -int iwn_config(struct iwn_softc *); -int iwn_scan(struct iwn_softc *); -int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); -int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); +static int iwn_send_sensitivity(struct iwn_softc *); +static int iwn_set_pslevel(struct iwn_softc *, int, int, int); +static int iwn_config(struct iwn_softc *); +static int iwn_scan(struct iwn_softc *); +static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); +static int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); #if 0 /* HT */ static int iwn_ampdu_rx_start(struct ieee80211com *, struct ieee80211_node *, uint8_t); @@ -220,31 +220,31 @@ static void iwn5000_ampdu_tx_start(struc struct ieee80211_node *, uint8_t, uint16_t); static void iwn5000_ampdu_tx_stop(struct iwn_softc *, uint8_t, uint16_t); #endif -int iwn5000_query_calibration(struct iwn_softc *); -int iwn5000_send_calibration(struct iwn_softc *); -int iwn5000_send_wimax_coex(struct iwn_softc *); -int iwn4965_post_alive(struct iwn_softc *); -int iwn5000_post_alive(struct iwn_softc *); -int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *, +static int iwn5000_query_calibration(struct iwn_softc *); +static int iwn5000_send_calibration(struct iwn_softc *); +static int iwn5000_send_wimax_coex(struct iwn_softc *); +static int iwn4965_post_alive(struct iwn_softc *); +static int iwn5000_post_alive(struct iwn_softc *); +static int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *, int); -int iwn4965_load_firmware(struct iwn_softc *); -int iwn5000_load_firmware_section(struct iwn_softc *, uint32_t, +static int iwn4965_load_firmware(struct iwn_softc *); +static int iwn5000_load_firmware_section(struct iwn_softc *, uint32_t, const uint8_t *, int); -int iwn5000_load_firmware(struct iwn_softc *); -int iwn_read_firmware(struct iwn_softc *); -int iwn_clock_wait(struct iwn_softc *); -int iwn_apm_init(struct iwn_softc *); -void iwn_apm_stop_master(struct iwn_softc *); -void iwn_apm_stop(struct iwn_softc *); -int iwn4965_nic_config(struct iwn_softc *); -int iwn5000_nic_config(struct iwn_softc *); -int iwn_hw_prepare(struct iwn_softc *); -int iwn_hw_init(struct iwn_softc *); -void iwn_hw_stop(struct iwn_softc *); -void iwn_init_locked(struct iwn_softc *); -void iwn_init(void *); -void iwn_stop_locked(struct iwn_softc *); -void iwn_stop(struct iwn_softc *); +static int iwn5000_load_firmware(struct iwn_softc *); +static int iwn_read_firmware(struct iwn_softc *); +static int iwn_clock_wait(struct iwn_softc *); +static int iwn_apm_init(struct iwn_softc *); +static void iwn_apm_stop_master(struct iwn_softc *); +static void iwn_apm_stop(struct iwn_softc *); +static int iwn4965_nic_config(struct iwn_softc *); +static int iwn5000_nic_config(struct iwn_softc *); +static int iwn_hw_prepare(struct iwn_softc *); +static int iwn_hw_init(struct iwn_softc *); +static void iwn_hw_stop(struct iwn_softc *); +static void iwn_init_locked(struct iwn_softc *); +static void iwn_init(void *); +static void iwn_stop_locked(struct iwn_softc *); +static void iwn_stop(struct iwn_softc *); static void iwn_scan_start(struct ieee80211com *); static void iwn_scan_end(struct ieee80211com *); static void iwn_set_channel(struct ieee80211com *); @@ -673,7 +673,7 @@ fail: return error; } -const struct iwn_hal * +static const struct iwn_hal * iwn_hal_attach(struct iwn_softc *sc) { sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xf; @@ -750,7 +750,7 @@ iwn_hal_attach(struct iwn_softc *sc) /* * Attach the interface to 802.11 radiotap. */ -void +static void iwn_radiotap_attach(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -802,7 +802,7 @@ iwn_vap_delete(struct ieee80211vap *vap) free(ivp, M_80211_VAP); } -int +static int iwn_cleanup(device_t dev) { struct iwn_softc *sc = device_get_softc(dev); @@ -857,7 +857,7 @@ iwn_detach(device_t dev) return 0; } -int +static int iwn_nic_lock(struct iwn_softc *sc) { int ntries; @@ -963,7 +963,7 @@ iwn_mem_set_region_4(struct iwn_softc *s iwn_mem_write(sc, addr, val); } -int +static int iwn_eeprom_lock(struct iwn_softc *sc) { int i, ntries; @@ -994,7 +994,7 @@ iwn_eeprom_unlock(struct iwn_softc *sc) * Initialize access by host to One Time Programmable ROM. * NB: This kind of ROM can be found on 1000 or 6000 Series only. */ -int +static int iwn_init_otprom(struct iwn_softc *sc) { uint16_t prev, base, next; @@ -1048,7 +1048,7 @@ iwn_init_otprom(struct iwn_softc *sc) return 0; } -int +static int iwn_read_prom_data(struct iwn_softc *sc, uint32_t addr, void *data, int count) { uint32_t val, tmp; @@ -1140,7 +1140,7 @@ fail: return error; } -void +static void iwn_dma_contig_free(struct iwn_dma_info *dma) { if (dma->tag != NULL) { @@ -1156,7 +1156,7 @@ iwn_dma_contig_free(struct iwn_dma_info } } -int +static int iwn_alloc_sched(struct iwn_softc *sc) { /* TX scheduler rings must be aligned on a 1KB boundary. */ @@ -1164,13 +1164,13 @@ iwn_alloc_sched(struct iwn_softc *sc) (void **)&sc->sched, sc->sc_hal->schedsz, 1024, BUS_DMA_NOWAIT); } -void +static void iwn_free_sched(struct iwn_softc *sc) { iwn_dma_contig_free(&sc->sched_dma); } -int +static int iwn_alloc_kw(struct iwn_softc *sc) { /* "Keep Warm" page must be aligned on a 4KB boundary. */ @@ -1178,13 +1178,13 @@ iwn_alloc_kw(struct iwn_softc *sc) BUS_DMA_NOWAIT); } -void +static void iwn_free_kw(struct iwn_softc *sc) { iwn_dma_contig_free(&sc->kw_dma); } -int +static int iwn_alloc_ict(struct iwn_softc *sc) { /* ICT table must be aligned on a 4KB boundary. */ @@ -1192,13 +1192,13 @@ iwn_alloc_ict(struct iwn_softc *sc) (void **)&sc->ict, IWN_ICT_SIZE, 4096, BUS_DMA_NOWAIT); } -void +static void iwn_free_ict(struct iwn_softc *sc) { iwn_dma_contig_free(&sc->ict_dma); } -int +static int iwn_alloc_fwmem(struct iwn_softc *sc) { /* Must be aligned on a 16-byte boundary. */ @@ -1206,13 +1206,13 @@ iwn_alloc_fwmem(struct iwn_softc *sc) sc->sc_hal->fwsz, 16, BUS_DMA_NOWAIT); } -void +static void iwn_free_fwmem(struct iwn_softc *sc) { iwn_dma_contig_free(&sc->fw_dma); } -int +static int iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) { bus_size_t size; @@ -1302,7 +1302,7 @@ fail: return error; } -void +static void iwn_reset_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) { int ntries; @@ -1326,7 +1326,7 @@ iwn_reset_rx_ring(struct iwn_softc *sc, sc->last_rx_valid = 0; } -void +static void iwn_free_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) { int i; @@ -1348,7 +1348,7 @@ iwn_free_rx_ring(struct iwn_softc *sc, s } } -int +static int iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) { bus_size_t size; @@ -1422,7 +1422,7 @@ fail: return error; } -void +static void iwn_reset_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) { int i; @@ -1445,7 +1445,7 @@ iwn_reset_tx_ring(struct iwn_softc *sc, ring->cur = 0; } -void +static void iwn_free_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) { int i; @@ -1467,7 +1467,7 @@ iwn_free_tx_ring(struct iwn_softc *sc, s } } -void +static void iwn5000_ict_reset(struct iwn_softc *sc) { /* Disable interrupts. */ @@ -1492,7 +1492,7 @@ iwn5000_ict_reset(struct iwn_softc *sc) IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask); } -int +static int iwn_read_eeprom(struct iwn_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) { const struct iwn_hal *hal = sc->sc_hal; @@ -1553,7 +1553,7 @@ iwn_read_eeprom(struct iwn_softc *sc, ui return 0; } -void +static void iwn4965_read_eeprom(struct iwn_softc *sc) { uint32_t addr; @@ -1601,7 +1601,7 @@ iwn4965_read_eeprom(struct iwn_softc *sc } #ifdef IWN_DEBUG -void +static void iwn4965_print_power_group(struct iwn_softc *sc, int i) { struct iwn4965_eeprom_band *band = &sc->bands[i]; @@ -1635,7 +1635,7 @@ iwn4965_print_power_group(struct iwn_sof } #endif -void +static void iwn5000_read_eeprom(struct iwn_softc *sc) { struct iwn5000_eeprom_calib_hdr hdr; @@ -1847,7 +1847,7 @@ iwn_read_eeprom_channels(struct iwn_soft #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) -void +static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { struct iwn_eeprom_enhinfo enhinfo[35]; @@ -1884,20 +1884,20 @@ iwn_read_eeprom_enhinfo(struct iwn_softc } } -struct ieee80211_node * +static struct ieee80211_node * iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } -void +static void iwn_newassoc(struct ieee80211_node *ni, int isnew) { /* XXX move */ ieee80211_ratectl_node_init(ni); } -int +static int iwn_media_change(struct ifnet *ifp) { int error = ieee80211_media_change(ifp); @@ -1905,7 +1905,7 @@ iwn_media_change(struct ifnet *ifp) return (error == ENETRESET ? 0 : error); } -int +static int iwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct iwn_vap *ivp = IWN_VAP(vap); @@ -1952,7 +1952,7 @@ iwn_newstate(struct ieee80211vap *vap, e * Process an RX_PHY firmware notification. This is usually immediately * followed by an MPDU_RX_DONE notification. */ -void +static void iwn_rx_phy(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -1996,7 +1996,7 @@ iwn_calib_reset(struct iwn_softc *sc) * Process an RX_DONE (4965AGN only) or MPDU_RX_DONE firmware notification. * Each MPDU_RX_DONE notification must be preceded by an RX_PHY one. */ -void +static void iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2146,7 +2146,7 @@ iwn_rx_done(struct iwn_softc *sc, struct #if 0 /* HT */ /* Process an incoming Compressed BlockAck. */ -void +static void iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2162,7 +2162,7 @@ iwn_rx_compressed_ba(struct iwn_softc *s * Process a CALIBRATION_RESULT notification sent by the initialization * firmware on response to a CMD_CALIB_CONFIG command (5000 only.) */ -void +static void iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2220,7 +2220,7 @@ iwn5000_rx_calib_results(struct iwn_soft * Process an RX_STATISTICS or BEACON_STATISTICS firmware notification. * The latter is sent by the firmware after each received beacon. */ -void +static void iwn_rx_statistics(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2277,7 +2277,7 @@ iwn_rx_statistics(struct iwn_softc *sc, * Process a TX_DONE firmware notification. Unfortunately, the 4965AGN * and 5000 adapters have different incompatible TX status formats. */ -void +static void iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2293,7 +2293,7 @@ iwn4965_tx_done(struct iwn_softc *sc, st iwn_tx_done(sc, desc, stat->ackfailcnt, le32toh(stat->status) & 0xff); } -void +static void iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { @@ -2317,7 +2317,7 @@ iwn5000_tx_done(struct iwn_softc *sc, st /* * Adapter-independent backend for TX_DONE firmware notifications. */ -void +static void iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt, uint8_t status) { @@ -2389,7 +2389,7 @@ iwn_tx_done(struct iwn_softc *sc, struct * Process a "command done" firmware notification. This is where we wakeup * processes waiting for a synchronous command completion. */ -void +static void iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc) { struct iwn_tx_ring *ring = &sc->txq[4]; @@ -2412,7 +2412,7 @@ iwn_cmd_done(struct iwn_softc *sc, struc /* * Process an INT_FH_RX or INT_SW_RX interrupt. */ -void +static void iwn_notif_intr(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -2590,7 +2590,7 @@ iwn_notif_intr(struct iwn_softc *sc) * Process an INT_WAKEUP interrupt raised when the microcontroller wakes up * from power-down sleep mode. */ -void +static void iwn_wakeup_intr(struct iwn_softc *sc) { int qid; @@ -2606,7 +2606,7 @@ iwn_wakeup_intr(struct iwn_softc *sc) } } -void +static void iwn_rftoggle_intr(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -2628,7 +2628,7 @@ iwn_rftoggle_intr(struct iwn_softc *sc) * we can't debug the firmware because it is neither open source nor free, it * can help us to identify certain classes of problems. */ -void +static void iwn_fatal_intr(struct iwn_softc *sc) { const struct iwn_hal *hal = sc->sc_hal; @@ -2688,7 +2688,7 @@ iwn_fatal_intr(struct iwn_softc *sc) printf(" rx ring: cur=%d\n", sc->rxq.cur); } -void +static void iwn_intr(void *arg) { struct iwn_softc *sc = arg; @@ -2786,7 +2786,7 @@ done: * Update TX scheduler ring when transmitting an 802.11 frame (4965AGN and * 5000 adapters use a slightly different format.) */ -void +static void iwn4965_update_sched(struct iwn_softc *sc, int qid, int idx, uint8_t id, uint16_t len) { @@ -2802,7 +2802,7 @@ iwn4965_update_sched(struct iwn_softc *s } } -void +static void iwn5000_update_sched(struct iwn_softc *sc, int qid, int idx, uint8_t id, uint16_t len) { @@ -2820,7 +2820,7 @@ iwn5000_update_sched(struct iwn_softc *s } #ifdef notyet -void +static void iwn5000_reset_sched(struct iwn_softc *sc, int qid, int idx) { uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx]; @@ -2848,7 +2848,7 @@ iwn_plcp_signal(int rate) { return 0; } -int +static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, struct iwn_tx_ring *ring) { @@ -3326,7 +3326,7 @@ iwn_raw_xmit(struct ieee80211_node *ni, return error; } -void +static void iwn_start(struct ifnet *ifp) { struct iwn_softc *sc = ifp->if_softc; @@ -3336,7 +3336,7 @@ iwn_start(struct ifnet *ifp) IWN_UNLOCK(sc); } -void +static void iwn_start_locked(struct ifnet *ifp) { struct iwn_softc *sc = ifp->if_softc; @@ -3379,7 +3379,7 @@ iwn_watchdog(struct iwn_softc *sc) } } -int +static int iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct iwn_softc *sc = ifp->if_softc; @@ -3425,7 +3425,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, /* * Send a command to the firmware. */ -int +static int iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) { struct iwn_tx_ring *ring = &sc->txq[4]; @@ -3498,7 +3498,7 @@ iwn_cmd(struct iwn_softc *sc, int code, return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz); } -int +static int iwn4965_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) { struct iwn4965_node_info hnode; @@ -3517,7 +3517,7 @@ iwn4965_add_node(struct iwn_softc *sc, s return iwn_cmd(sc, IWN_CMD_ADD_NODE, &hnode, sizeof hnode, async); } -int +static int iwn5000_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) { /* Direct mapping. */ @@ -3548,7 +3548,7 @@ static const uint8_t iwn_prev_ridx[] = { * Configure hardware link parameters for the specified * node operating on the specified channel. */ -int +static int iwn_set_link_quality(struct iwn_softc *sc, uint8_t id, int async) { struct ifnet *ifp = sc->sc_ifp; @@ -3621,7 +3621,7 @@ iwn_set_link_quality(struct iwn_softc *s /* * Broadcast node is used to send group-addressed and management frames. */ -int +static int iwn_add_broadcast_node(struct iwn_softc *sc, int async) { const struct iwn_hal *hal = sc->sc_hal; @@ -3641,7 +3641,7 @@ iwn_add_broadcast_node(struct iwn_softc return error; } -int +static int iwn_wme_update(struct ieee80211com *ic) { #define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */ @@ -3677,7 +3677,7 @@ iwn_update_mcast(struct ifnet *ifp) /* Ignore */ } -void +static void iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t on) { struct iwn_cmd_led led; @@ -3696,7 +3696,7 @@ iwn_set_led(struct iwn_softc *sc, uint8_ * Set the critical temperature at which the firmware will stop the radio * and notify us. */ -int +static int iwn_set_critical_temp(struct iwn_softc *sc) { struct iwn_critical_temp crit; @@ -3717,7 +3717,7 @@ iwn_set_critical_temp(struct iwn_softc * return iwn_cmd(sc, IWN_CMD_SET_CRITICAL_TEMP, &crit, sizeof crit, 0); } -int +static int iwn_set_timing(struct iwn_softc *sc, struct ieee80211_node *ni) { struct iwn_cmd_timing cmd; @@ -3739,7 +3739,7 @@ iwn_set_timing(struct iwn_softc *sc, str return iwn_cmd(sc, IWN_CMD_TIMING, &cmd, sizeof cmd, 1); } -void +static void iwn4965_power_calibration(struct iwn_softc *sc, int temp) { struct ifnet *ifp = sc->sc_ifp; @@ -3760,7 +3760,7 @@ iwn4965_power_calibration(struct iwn_sof * This function takes into account the regulatory information from EEPROM, * the current temperature and the current voltage. */ -int +static int iwn4965_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch, int async) { @@ -3912,7 +3912,7 @@ iwn4965_set_txpower(struct iwn_softc *sc #undef fdivround } -int +static int iwn5000_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch, int async) { @@ -3933,7 +3933,7 @@ iwn5000_set_txpower(struct iwn_softc *sc /* * Retrieve the maximum RSSI (in dBm) among receivers. */ -int +static int iwn4965_get_rssi(struct iwn_softc *sc, struct iwn_rx_stat *stat) { struct iwn4965_rx_phystat *phy = (void *)stat->phybuf; @@ -3964,7 +3964,7 @@ iwn4965_get_rssi(struct iwn_softc *sc, s return rssi - agc - IWN_RSSI_TO_DBM; } -int +static int iwn5000_get_rssi(struct iwn_softc *sc, struct iwn_rx_stat *stat) { struct iwn5000_rx_phystat *phy = (void *)stat->phybuf; @@ -3987,7 +3987,7 @@ iwn5000_get_rssi(struct iwn_softc *sc, s /* * Retrieve the average noise (in dBm) among receivers. */ -int +static int iwn_get_noise(const struct iwn_rx_general_stats *stats) { int i, total, nbant, noise; @@ -4006,7 +4006,7 @@ iwn_get_noise(const struct iwn_rx_genera /* * Compute temperature (in degC) from last received statistics. */ -int +static int iwn4965_get_temperature(struct iwn_softc *sc) { struct iwn_ucode_info *uc = &sc->ucode_info; @@ -4031,7 +4031,7 @@ iwn4965_get_temperature(struct iwn_softc return IWN_KTOC(temp); } -int +static int iwn5000_get_temperature(struct iwn_softc *sc) { int32_t temp; @@ -4052,7 +4052,7 @@ iwn5000_get_temperature(struct iwn_softc /* * Initialize sensitivity calibration state machine. */ -int +static int iwn_init_sensitivity(struct iwn_softc *sc) { const struct iwn_hal *hal = sc->sc_hal; @@ -4094,7 +4094,7 @@ iwn_init_sensitivity(struct iwn_softc *s * after association and use them to determine connected antennas and * to set differential gains. */ -void +static void iwn_collect_noise(struct iwn_softc *sc, const struct iwn_rx_general_stats *stats) { @@ -4142,7 +4142,7 @@ iwn_collect_noise(struct iwn_softc *sc, #endif } -int +static int iwn4965_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib_gain cmd; @@ -4155,7 +4155,7 @@ iwn4965_init_gains(struct iwn_softc *sc) return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 1); } -int +static int iwn5000_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib cmd; @@ -4169,7 +4169,7 @@ iwn5000_init_gains(struct iwn_softc *sc) return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 1); } -int +static int iwn4965_set_gains(struct iwn_softc *sc) { struct iwn_calib_state *calib = &sc->calib; @@ -4202,7 +4202,7 @@ iwn4965_set_gains(struct iwn_softc *sc) return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 1); } -int +static int iwn5000_set_gains(struct iwn_softc *sc) { struct iwn_calib_state *calib = &sc->calib; @@ -4240,7 +4240,7 @@ iwn5000_set_gains(struct iwn_softc *sc) * Tune RF RX sensitivity based on the number of false alarms detected * during the last beacon period. */ -void +static void iwn_tune_sensitivity(struct iwn_softc *sc, const struct iwn_rx_stats *stats) { #define inc(val, inc, max) \ @@ -4392,7 +4392,7 @@ iwn_tune_sensitivity(struct iwn_softc *s #undef inc } -int +static int iwn_send_sensitivity(struct iwn_softc *sc) { struct iwn_calib_state *calib = &sc->calib; @@ -4427,7 +4427,7 @@ iwn_send_sensitivity(struct iwn_softc *s * Set STA mode power saving level (between 0 and 5). * Level 0 is CAM (Continuously Aware Mode), 5 is for maximum power saving. */ -int +static int iwn_set_pslevel(struct iwn_softc *sc, int dtim, int level, int async) { const struct iwn_pmgt *pmgt; @@ -4478,7 +4478,7 @@ iwn_set_pslevel(struct iwn_softc *sc, in return iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, async); } -int +static int iwn_config(struct iwn_softc *sc) { const struct iwn_hal *hal = sc->sc_hal; @@ -4591,7 +4591,7 @@ iwn_config(struct iwn_softc *sc) return 0; } -int +static int iwn_scan(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -4762,7 +4762,7 @@ iwn_scan(struct iwn_softc *sc) return error; } -int +static int iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 15:31:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A871065672; Sun, 11 Apr 2010 15:31:09 +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 A740E8FC0A; Sun, 11 Apr 2010 15:31: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 o3BFV9su037165; Sun, 11 Apr 2010 15:31:09 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BFV9mH037163; Sun, 11 Apr 2010 15:31:09 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004111531.o3BFV9mH037163@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 11 Apr 2010 15:31: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: r206479 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 15:31:09 -0000 Author: ume Date: Sun Apr 11 15:31:09 2010 New Revision: 206479 URL: http://svn.freebsd.org/changeset/base/206479 Log: Fix grammar in comment. Submitted by: "b. f." MFC after: 3 days Modified: head/etc/rc.firewall Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Sun Apr 11 15:17:52 2010 (r206478) +++ head/etc/rc.firewall Sun Apr 11 15:31:09 2010 (r206479) @@ -425,11 +425,11 @@ case ${firewall_type} in # firewall_myservices: List of TCP ports on which this host # offers services. # firewall_allowservices: List of IPv4 and/or IPv6 addresses - # which has access to + # that have access to # $firewall_myservices. # firewall_trusted: List of IPv4 and/or IPv6 addresses - # which has full access to this host. - # Be very carefull when setting this. + # that have full access to this host. + # Be very careful when setting this. # This option can seriously degrade # the level of protection provided by # the firewall. From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 15:35:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8419C106564A; Sun, 11 Apr 2010 15:35:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7456B8FC0A; Sun, 11 Apr 2010 15:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3BFZIXj038129; Sun, 11 Apr 2010 15:35:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BFZIs8038127; Sun, 11 Apr 2010 15:35:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004111535.o3BFZIs8038127@svn.freebsd.org> From: Marius Strobl Date: Sun, 11 Apr 2010 15:35: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: r206480 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 15:35:18 -0000 Author: marius Date: Sun Apr 11 15:35:17 2010 New Revision: 206480 URL: http://svn.freebsd.org/changeset/base/206480 Log: Update for UltraSPARC-IV{,+} and SPARC64 V, VI, VII and VIIIfx CPUs. Modified: head/sys/sparc64/include/lsu.h Modified: head/sys/sparc64/include/lsu.h ============================================================================== --- head/sys/sparc64/include/lsu.h Sun Apr 11 15:31:09 2010 (r206479) +++ head/sys/sparc64/include/lsu.h Sun Apr 11 15:35:17 2010 (r206480) @@ -29,7 +29,7 @@ /* * Definitions for the Load-Store-Unit Control Register. This is called - * Data Cache Unit Control Register (DCUCR) for UltraSPARC-III. + * Data Cache Unit Control Register (DCUCR) for UltraSPARC-III and greater. */ #define LSU_IC (1UL << 0) #define LSU_DC (1UL << 1) @@ -41,7 +41,7 @@ #define LSU_FM_BITS 16 #define LSU_FM_MASK (((1UL << LSU_FM_BITS) - 1) << LSU_FM_SHIFT) -#define LSU_VM_SHIFT 25 +#define LSU_VM_SHIFT 25 #define LSU_VM_BITS 8 #define LSU_VM_MASK (((1UL << LSU_VM_BITS) - 1) << LSU_VM_SHIFT) @@ -65,4 +65,22 @@ #define LSU_CV (1UL << 48) #define LSU_CP (1UL << 49) +/* The following bit is valid for the UltraSPARC-IV only. */ +#define LSU_WIH (1UL << 4) + +/* The following bits are valid for the UltraSPARC-IV+ only. */ +#define LSU_PPS_SHIFT 50 +#define LSU_PPS_BITS 2 +#define LSU_PPS_MASK (((1UL << LSU_PPS_BITS) - 1) << LSU_PPS_SHIFT) + +#define LSU_IPS_SHIFT 52 +#define LSU_IPS_BITS 2 +#define LSU_IPS_MASK (((1UL << LSU_IPS_BITS) - 1) << LSU_IPS_SHIFT) + +#define LSU_PCM (1UL << 54) +#define LSU_WCE (1UL << 55) + +/* The following bit is valid for the SPARC64 V, VI, VII and VIIIfx only. */ +#define LSU_WEAK_SPCA (1UL << 41) + #endif /* _MACHINE_LSU_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:04:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE4A106564A; Sun, 11 Apr 2010 16:04:08 +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 DB90D8FC08; Sun, 11 Apr 2010 16:04: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 o3BG48Hx044437; Sun, 11 Apr 2010 16:04:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BG48rI044430; Sun, 11 Apr 2010 16:04:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111604.o3BG48rI044430@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 16:04: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: r206481 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:04:09 -0000 Author: bz Date: Sun Apr 11 16:04:08 2010 New Revision: 206481 URL: http://svn.freebsd.org/changeset/base/206481 Log: Plug reference leaks in the link-layer code ("new-arp") that previously prevented the link-layer entry from being freed. In both in.c and in6.c (though that code path seems to be basically dead) plug a reference leak in case of a pending callout being drained. In if_ether.c consistently add a reference before resetting the callout and in case we canceled a pending one remove the reference for that. In the final case in arptimer, before freeing the expired entry, remove the reference again and explicitly call callout_stop() to clear the active flag. In nd6.c:nd6_free() we are only ever called from the callout function and thus need to remove the reference there as well before calling into llentry_free(). In if_llatbl.c when freeing entire tables make sure that in case we cancel a pending callout to remove the reference as well. Reviewed by: qingli (earlier version) MFC after: 10 days Problem observed, patch tested by: simon on ipv6gw.f.o, Christian Kratzer (ck cksoft.de), Evgenii Davidov (dado korolev-net.ru) PR: kern/144564 Configurations still affected: with options FLOWTABLE Modified: head/sys/net/if_llatbl.c head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sun Apr 11 15:35:17 2010 (r206480) +++ head/sys/net/if_llatbl.c Sun Apr 11 16:04:08 2010 (r206481) @@ -170,9 +170,12 @@ lltable_free(struct lltable *llt) for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { + int canceled; - callout_drain(&lle->la_timer); + canceled = callout_drain(&lle->la_timer); LLE_WLOCK(lle); + if (canceled) + LLE_REMREF(lle); llentry_free(lle); } } Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Apr 11 15:35:17 2010 (r206480) +++ head/sys/netinet/if_ether.c Sun Apr 11 16:04:08 2010 (r206481) @@ -180,6 +180,8 @@ arptimer(void *arg) else { if (!callout_pending(&lle->la_timer) && callout_active(&lle->la_timer)) { + callout_stop(&lle->la_timer); + LLE_REMREF(lle); (void) llentry_free(lle); ARPSTAT_INC(timeouts); } @@ -382,9 +384,14 @@ retry: EHOSTUNREACH : EHOSTDOWN; if (renew) { + int canceled; + LLE_ADDREF(la); la->la_expire = time_second + V_arpt_down; - callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la); + canceled = callout_reset(&la->la_timer, hz * V_arpt_down, + arptimer, la); + if (canceled) + LLE_REMREF(la); la->la_asked++; LLE_WUNLOCK(la); arprequest(ifp, NULL, &SIN(dst)->sin_addr, @@ -696,9 +703,14 @@ match: EVENTHANDLER_INVOKE(arp_update_event, la); if (!(la->la_flags & LLE_STATIC)) { + int canceled; + + LLE_ADDREF(la); la->la_expire = time_second + V_arpt_keep; - callout_reset(&la->la_timer, hz * V_arpt_keep, - arptimer, la); + canceled = callout_reset(&la->la_timer, + hz * V_arpt_keep, arptimer, la); + if (canceled) + LLE_REMREF(la); } la->la_asked = 0; la->la_preempt = V_arp_maxtries; Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Apr 11 15:35:17 2010 (r206480) +++ head/sys/netinet/in.c Sun Apr 11 16:04:08 2010 (r206481) @@ -1357,8 +1357,12 @@ in_lltable_prefix_free(struct lltable *l if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), pfx, msk)) { - callout_drain(&lle->la_timer); + int canceled; + + canceled = callout_drain(&lle->la_timer); LLE_WLOCK(lle); + if (canceled) + LLE_REMREF(lle); llentry_free(lle); } } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Apr 11 15:35:17 2010 (r206480) +++ head/sys/netinet6/in6.c Sun Apr 11 16:04:08 2010 (r206481) @@ -2344,8 +2344,12 @@ in6_lltable_prefix_free(struct lltable * &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, &pfx->sin6_addr, &msk->sin6_addr)) { - callout_drain(&lle->la_timer); + int canceled; + + canceled = callout_drain(&lle->la_timer); LLE_WLOCK(lle); + if (canceled) + LLE_REMREF(lle); llentry_free(lle); } } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Apr 11 15:35:17 2010 (r206480) +++ head/sys/netinet6/nd6.c Sun Apr 11 16:04:08 2010 (r206481) @@ -1125,6 +1125,7 @@ nd6_free(struct llentry *ln, int gc) ifp = ln->lle_tbl->llt_ifp; IF_AFDATA_LOCK(ifp); LLE_WLOCK(ln); + LLE_REMREF(ln); llentry_free(ln); IF_AFDATA_UNLOCK(ifp); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:06:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 952DE106566B; Sun, 11 Apr 2010 16:06:09 +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 856F68FC14; Sun, 11 Apr 2010 16:06: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 o3BG691T044931; Sun, 11 Apr 2010 16:06:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BG69Zd044929; Sun, 11 Apr 2010 16:06:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201004111606.o3BG69Zd044929@svn.freebsd.org> From: Attilio Rao Date: Sun, 11 Apr 2010 16:06: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: r206482 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:06:09 -0000 Author: attilio Date: Sun Apr 11 16:06:09 2010 New Revision: 206482 URL: http://svn.freebsd.org/changeset/base/206482 Log: - Introduce a blessed list for sxlocks that prevents the deadlkres to panic on those ones. [0] - Fix ticks counter wrap-up Sponsored by: Sandvine Incorporated [0] Reported by: jilles [0] Tested by: jilles MFC: 1 week Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sun Apr 11 16:04:08 2010 (r206481) +++ head/sys/kern/kern_clock.c Sun Apr 11 16:06:09 2010 (r206482) @@ -162,6 +162,11 @@ SYSCTL_PROC(_kern, OID_AUTO, cp_times, C 0,0, sysctl_kern_cp_times, "LU", "per-CPU time statistics"); #ifdef DEADLKRES +static const char *blessed[] = { + "so_snd_sx", + "so_rcv_sx", + NULL +}; static int slptime_threshold = 1800; static int blktime_threshold = 900; static int sleepfreq = 3; @@ -172,7 +177,7 @@ deadlkres(void) struct proc *p; struct thread *td; void *wchan; - int blkticks, slpticks, slptype, tryl, tticks; + int blkticks, i, slpticks, slptype, tryl, tticks; tryl = 0; for (;;) { @@ -205,6 +210,10 @@ deadlkres(void) * turnstile channel is in good state. */ MPASS(td->td_blocked != NULL); + + /* Handle ticks wrap-up. */ + if (ticks < td->td_blktick) + continue; tticks = ticks - td->td_blktick; thread_unlock(td); if (tticks > blkticks) { @@ -222,6 +231,10 @@ deadlkres(void) } } else if (TD_IS_SLEEPING(td)) { + /* Handle ticks wrap-up. */ + if (ticks < td->td_blktick) + continue; + /* * Check if the thread is sleeping on a * lock, otherwise skip the check. @@ -242,7 +255,24 @@ deadlkres(void) * thresholds, this thread is * stuck for too long on a * sleepqueue. + * However, being on a + * sleepqueue, we might still + * check for the blessed + * list. */ + tryl = 0; + for (i = 0; blessed[i] != NULL; + i++) { + if (!strcmp(blessed[i], + td->td_wmesg)) { + tryl = 1; + break; + } + } + if (tryl != 0) { + tryl = 0; + continue; + } PROC_UNLOCK(p); sx_sunlock(&allproc_lock); panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:20:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACD7106566C; Sun, 11 Apr 2010 16:20:22 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay2.uni-muenster.de (ZIVM-RELAY2.UNI-MUENSTER.DE [128.176.192.13]) by mx1.freebsd.org (Postfix) with ESMTP id 54EE18FC0C; Sun, 11 Apr 2010 16:20:21 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.52,185,1270418400"; d="scan'208";a="241506458" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 11 Apr 2010 18:20:20 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 2FF081B0769; Sun, 11 Apr 2010 18:20:20 +0200 (CEST) Date: Sun, 11 Apr 2010 18:20:19 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Tim Kientzle Message-ID: 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 Subject: Re: svn commit: r206466 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:20:23 -0000 does this commit fix bin/144786 entirely? cheers. -- Alexander Best From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:26:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56187106566B; Sun, 11 Apr 2010 16:26:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45A7F8FC20; Sun, 11 Apr 2010 16:26: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 o3BGQ89T049336; Sun, 11 Apr 2010 16:26:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BGQ8Ah049332; Sun, 11 Apr 2010 16:26:08 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004111626.o3BGQ8Ah049332@svn.freebsd.org> From: Alan Cox Date: Sun, 11 Apr 2010 16:26: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: r206483 - in head/sys: kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:26:08 -0000 Author: alc Date: Sun Apr 11 16:26:07 2010 New Revision: 206483 URL: http://svn.freebsd.org/changeset/base/206483 Log: Initialize the virtual memory-related resource limits in a single place. Previously, one of these limits was initialized in two places to a different value in each place. Moreover, because an unsigned int was used to represent the amount of pageable physical memory, some of these limits were incorrectly initialized on 64-bit architectures. (Currently, this error is masked by login.conf's default settings.) Make vm_thread_swapin() and vm_thread_swapout() static. Submitted by: bde (an earlier version) Reviewed by: kib Modified: head/sys/kern/init_main.c head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Apr 11 16:06:09 2010 (r206482) +++ head/sys/kern/init_main.c Sun Apr 11 16:26:07 2010 (r206483) @@ -382,8 +382,9 @@ static void proc0_init(void *dummy __unused) { struct proc *p; - unsigned i; struct thread *td; + vm_paddr_t pageablemem; + int i; GIANT_REQUIRED; p = &proc0; @@ -493,10 +494,16 @@ proc0_init(void *dummy __unused) p->p_limit->pl_rlimit[RLIMIT_NOFILE].rlim_max = maxfiles; p->p_limit->pl_rlimit[RLIMIT_NPROC].rlim_cur = p->p_limit->pl_rlimit[RLIMIT_NPROC].rlim_max = maxproc; - i = ptoa(cnt.v_free_count); - p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = i; - p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_max = i; - p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3; + p->p_limit->pl_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz; + p->p_limit->pl_rlimit[RLIMIT_DATA].rlim_max = maxdsiz; + p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; + p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; + /* Cast to avoid overflow on i386/PAE. */ + pageablemem = ptoa((vm_paddr_t)cnt.v_free_count); + p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur = + p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem; + p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3; + p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_max = pageablemem; p->p_cpulimit = RLIM_INFINITY; p->p_stats = pstats_alloc(); Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sun Apr 11 16:06:09 2010 (r206482) +++ head/sys/vm/vm_extern.h Sun Apr 11 16:26:07 2010 (r206483) @@ -84,7 +84,5 @@ struct sf_buf *vm_imgact_map_page(vm_obj void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); -void vm_thread_swapin(struct thread *td); -void vm_thread_swapout(struct thread *td); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Apr 11 16:06:09 2010 (r206482) +++ head/sys/vm/vm_glue.c Sun Apr 11 16:26:07 2010 (r206483) @@ -99,12 +99,6 @@ extern int maxslp; /* * System initialization * - * Note: proc0 from proc.h - */ -static void vm_init_limits(void *); -SYSINIT(vm_limits, SI_SUB_VM_CONF, SI_ORDER_FIRST, vm_init_limits, &proc0); - -/* * THIS MUST BE THE LAST INITIALIZATION ITEM!!! * * Note: run scheduling should be divorced from the vm system. @@ -115,6 +109,8 @@ SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); +static void vm_thread_swapin(struct thread *td); +static void vm_thread_swapout(struct thread *td); #endif /* @@ -498,10 +494,11 @@ kstack_cache_init(void *nulll) MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, NULL); +#ifndef NO_SWAPPING /* * Allow a thread's kernel stack to be paged out. */ -void +static void vm_thread_swapout(struct thread *td) { vm_object_t ksobj; @@ -528,7 +525,7 @@ vm_thread_swapout(struct thread *td) /* * Bring the kernel stack for a specified thread back in. */ -void +static void vm_thread_swapin(struct thread *td) { vm_object_t ksobj; @@ -556,6 +553,7 @@ vm_thread_swapin(struct thread *td) pmap_qenter(td->td_kstack, ma, pages); cpu_thread_swapin(td); } +#endif /* !NO_SWAPPING */ /* * Implement fork's actions on an address space. @@ -629,38 +627,6 @@ vm_waitproc(p) vmspace_exitfree(p); /* and clean-out the vmspace */ } -/* - * Set default limits for VM system. - * Called for proc 0, and then inherited by all others. - * - * XXX should probably act directly on proc0. - */ -static void -vm_init_limits(udata) - void *udata; -{ - struct proc *p = udata; - struct plimit *limp; - int rss_limit; - - /* - * Set up the initial limits on process VM. Set the maximum resident - * set size to be half of (reasonably) available memory. Since this - * is a soft limit, it comes into effect only when the system is out - * of memory - half of main memory helps to favor smaller processes, - * and reduces thrashing of the object cache. - */ - limp = p->p_limit; - limp->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; - limp->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; - limp->pl_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz; - limp->pl_rlimit[RLIMIT_DATA].rlim_max = maxdsiz; - /* limit the limit to no less than 2MB */ - rss_limit = max(cnt.v_free_count, 512); - limp->pl_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit); - limp->pl_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY; -} - void faultin(p) struct proc *p; From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:27:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8AB3106564A; Sun, 11 Apr 2010 16:27:38 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FC08FC16; Sun, 11 Apr 2010 16:27: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 o3BGRcRX049726; Sun, 11 Apr 2010 16:27:38 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BGRcfo049724; Sun, 11 Apr 2010 16:27:38 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004111627.o3BGRcfo049724@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 16:27: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: r206484 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:27:38 -0000 Author: kientzle Date: Sun Apr 11 16:27:38 2010 New Revision: 206484 URL: http://svn.freebsd.org/changeset/base/206484 Log: Diff reduction against bsdtar 2.8.3 Modified: head/usr.bin/tar/subst.c Modified: head/usr.bin/tar/subst.c ============================================================================== --- head/usr.bin/tar/subst.c Sun Apr 11 16:26:07 2010 (r206483) +++ head/usr.bin/tar/subst.c Sun Apr 11 16:27:38 2010 (r206484) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #if HAVE_REGEX_H #include "bsdtar.h" -#include "err.h" #include #include @@ -39,6 +38,8 @@ __FBSDID("$FreeBSD$"); #define REG_BASIC 0 #endif +#include "err.h" + struct subst_rule { struct subst_rule *next; regex_t re; From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 16:28:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0691065673; Sun, 11 Apr 2010 16:28:10 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 828FE8FC2A; Sun, 11 Apr 2010 16:28: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 o3BGSAfj049871; Sun, 11 Apr 2010 16:28:10 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BGSAPE049869; Sun, 11 Apr 2010 16:28:10 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004111628.o3BGSAPE049869@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 16:28: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: r206485 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 16:28:10 -0000 Author: kientzle Date: Sun Apr 11 16:28:10 2010 New Revision: 206485 URL: http://svn.freebsd.org/changeset/base/206485 Log: Diff reduction against bsdtar 2.8.3 Modified: head/usr.bin/tar/tree.h Modified: head/usr.bin/tar/tree.h ============================================================================== --- head/usr.bin/tar/tree.h Sun Apr 11 16:27:38 2010 (r206484) +++ head/usr.bin/tar/tree.h Sun Apr 11 16:28:10 2010 (r206485) @@ -53,16 +53,17 @@ void tree_close(struct tree *); /* * tree_next() returns Zero if there is no next entry, non-zero if - * there is. Note that directories are potentially visited three - * times. Directories are always visited first as part of enumerating - * their parent. If tree_descend() is invoked at that time, the - * directory is added to a work list and will subsequently be visited - * two more times: once just after descending into the directory and - * again just after ascending back to the parent. + * there is. Note that directories are visited three times. + * Directories are always visited first as part of enumerating their + * parent; that is a "regular" visit. If tree_descend() is invoked at + * that time, the directory is added to a work list and will + * subsequently be visited two more times: once just after descending + * into the directory ("postdescent") and again just after ascending + * back to the parent ("postascent"). * * TREE_ERROR_DIR is returned if the descent failed (because the * directory couldn't be opened, for instance). This is returned - * instead of TREE_PREVISIT/TREE_POSTVISIT. TREE_ERROR_DIR is not a + * instead of TREE_POSTDESCENT/TREE_POSTASCENT. TREE_ERROR_DIR is not a * fatal error, but it does imply that the relevant subtree won't be * visited. TREE_ERROR_FATAL is returned for an error that left the * traversal completely hosed. Right now, this is only returned for @@ -96,10 +97,23 @@ void tree_descend(struct tree *); int tree_current_depth(struct tree *); /* - * The current full pathname, length of the full pathname, - * and a name that can be used to access the file. - * Because tree does use chdir extensively, the access path is - * almost never the same as the full current path. + * The current full pathname, length of the full pathname, and a name + * that can be used to access the file. Because tree does use chdir + * extensively, the access path is almost never the same as the full + * current path. + * + * TODO: Flesh out this interface to provide other information. In + * particular, Windows can provide file size, mode, and some permission + * information without invoking stat() at all. + * + * TODO: On platforms that support it, use openat()-style operations + * to eliminate the chdir() operations entirely while still supporting + * arbitrarily deep traversals. This makes access_path troublesome to + * support, of course, which means we'll need a rich enough interface + * that clients can function without it. (In particular, we'll need + * tree_current_open() that returns an open file descriptor.) + * + * TODO: Provide tree_current_archive_entry(). */ const char *tree_current_path(struct tree *); size_t tree_current_pathlen(struct tree *); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 17:31:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 347581065673; Sun, 11 Apr 2010 17:31:17 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id E772B8FC08; Sun, 11 Apr 2010 17:31:16 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o3BHVTfb013217; Sun, 11 Apr 2010 17:31:29 GMT (envelope-from kientzle@freebsd.org) Received: from horton.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id vf2v46srm6c735d7u5ahejn62i; Sun, 11 Apr 2010 17:31:29 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4BC20762.9030504@freebsd.org> Date: Sun, 11 Apr 2010 10:31:14 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20100314 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Alexander Best References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r206466 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 17:31:17 -0000 Alexander Best wrote: > does this commit fix bin/144786 entirely? It fixes the problems listed in that bug. In testing that bug, I've uncovered some other problems with the inclusion/exclusion logic that I'm still working through. Tim From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 18:41:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5116A106564A; Sun, 11 Apr 2010 18:41:32 +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 407A68FC13; Sun, 11 Apr 2010 18:41: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 o3BIfWXm079066; Sun, 11 Apr 2010 18:41:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BIfWxG079064; Sun, 11 Apr 2010 18:41:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111841.o3BIfWxG079064@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 18:41: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: r206486 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 18:41:32 -0000 Author: bz Date: Sun Apr 11 18:41:31 2010 New Revision: 206486 URL: http://svn.freebsd.org/changeset/base/206486 Log: Check that the interface is on the list of cloned interfaces before trying to remove it to avoid panics in case of two threads trying to remove it in parallel. PR: kern/116837 Submitted by: Takahiro Kurosawa (takahiro.kurosawa gmail.com) (orig version) MFC after: 10 days Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sun Apr 11 16:28:10 2010 (r206485) +++ head/sys/net/if_clone.c Sun Apr 11 18:41:31 2010 (r206486) @@ -234,6 +234,7 @@ int if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp) { int err; + struct ifnet *ifcifp; if (ifc->ifc_destroy == NULL) return(EOPNOTSUPP); @@ -246,8 +247,17 @@ if_clone_destroyif(struct if_clone *ifc, CURVNET_SET_QUIET(ifp->if_vnet); IF_CLONE_LOCK(ifc); - IFC_IFLIST_REMOVE(ifc, ifp); + LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) { + if (ifcifp == ifp) { + IFC_IFLIST_REMOVE(ifc, ifp); + break; + } + } IF_CLONE_UNLOCK(ifc); + if (ifcifp == NULL) { + CURVNET_RESTORE(); + return (ENXIO); /* ifp is not on the list. */ + } if_delgroup(ifp, ifc->ifc_name); From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 18:44:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71B76106564A; Sun, 11 Apr 2010 18:44:42 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 557EE8FC16; Sun, 11 Apr 2010 18:44: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 o3BIig7S079855; Sun, 11 Apr 2010 18:44:42 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BIigLU079853; Sun, 11 Apr 2010 18:44:42 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201004111844.o3BIigLU079853@svn.freebsd.org> From: Tim Kientzle Date: Sun, 11 Apr 2010 18:44: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: r206487 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 18:44:42 -0000 Author: kientzle Date: Sun Apr 11 18:44:42 2010 New Revision: 206487 URL: http://svn.freebsd.org/changeset/base/206487 Log: If a file is specifically both included and excluded, then: * It is not extracted (because it is excluded) * If it's not present in the archive, then an error is reported (because the file was requested and not found) * If it is present in the archive, no error is reported. Previously, this would always report an error because the exclusion prevented the entry from matching the inclusion. Also, tar is now more reluctant to report unmatched inclusions. Previously, "tar x file1 'file*'" against an archive that contained a single entry "file1" would match file1 and then report an error for the second pattern because it wasn't matched. It now considers both inclusions to be matched and reports no error. Modified: head/usr.bin/tar/matching.c Modified: head/usr.bin/tar/matching.c ============================================================================== --- head/usr.bin/tar/matching.c Sun Apr 11 18:41:31 2010 (r206486) +++ head/usr.bin/tar/matching.c Sun Apr 11 18:44:42 2010 (r206487) @@ -156,40 +156,41 @@ lafe_excluded(struct lafe_matching *matc if (matching == NULL) return (0); + /* Mark off any unmatched inclusions. */ + /* In particular, if a filename does appear in the archive and + * is explicitly included and excluded, then we don't report + * it as missing even though we don't extract it. + */ + matched = NULL; + for (match = matching->inclusions; match != NULL; match = match->next){ + if (match->matches == 0 + && match_inclusion(match, pathname)) { + matching->inclusions_unmatched_count--; + match->matches++; + matched = match; + } + } + /* Exclusions take priority */ for (match = matching->exclusions; match != NULL; match = match->next){ if (match_exclusion(match, pathname)) return (1); } - /* Then check for inclusions */ - matched = NULL; + /* It's not excluded and we found an inclusion above, so it's included. */ + if (matched != NULL) + return (0); + + + /* We didn't find an unmatched inclusion, check the remaining ones. */ for (match = matching->inclusions; match != NULL; match = match->next){ - if (match_inclusion(match, pathname)) { - /* - * If this pattern has never been matched, - * then we're done. - */ - if (match->matches == 0) { - match->matches++; - matching->inclusions_unmatched_count--; - return (0); - } - /* - * Otherwise, remember the match but keep checking - * in case we can tick off an unmatched pattern. - */ - matched = match; + /* We looked at previously-unmatched inclusions already. */ + if (match->matches > 0 + && match_inclusion(match, pathname)) { + match->matches++; + return (0); } } - /* - * We didn't find a pattern that had never been matched, but - * we did find a match, so count it and exit. - */ - if (matched != NULL) { - matched->matches++; - return (0); - } /* If there were inclusions, default is to exclude. */ if (matching->inclusions != NULL) From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 18:47:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C50A106566B; Sun, 11 Apr 2010 18:47:39 +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 2BC298FC14; Sun, 11 Apr 2010 18:47: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 o3BIldtt080556; Sun, 11 Apr 2010 18:47:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BIldr9080554; Sun, 11 Apr 2010 18:47:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111847.o3BIldr9080554@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 18:47: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: r206488 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 18:47:39 -0000 Author: bz Date: Sun Apr 11 18:47:38 2010 New Revision: 206488 URL: http://svn.freebsd.org/changeset/base/206488 Log: Take a reference to make sure that the interface cannot go away during if_clone_destroy() in case parallel threads try to. PR: kern/116837 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 10 days Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sun Apr 11 18:44:42 2010 (r206487) +++ head/sys/net/if_clone.c Sun Apr 11 18:47:38 2010 (r206488) @@ -196,10 +196,11 @@ if_clone_createif(struct if_clone *ifc, int if_clone_destroy(const char *name) { + int err; struct if_clone *ifc; struct ifnet *ifp; - ifp = ifunit(name); + ifp = ifunit_ref(name); if (ifp == NULL) return (ENXIO); @@ -221,10 +222,14 @@ if_clone_destroy(const char *name) } #endif IF_CLONERS_UNLOCK(); - if (ifc == NULL) + if (ifc == NULL) { + if_rele(ifp); return (EINVAL); + } - return (if_clone_destroyif(ifc, ifp)); + err = if_clone_destroyif(ifc, ifp); + if_rele(ifp); + return err; } /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 19:58:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935811065670; Sun, 11 Apr 2010 19:58:01 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829048FC1A; Sun, 11 Apr 2010 19:58:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3BJw1sl096005; Sun, 11 Apr 2010 19:58:01 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BJw1f3096003; Sun, 11 Apr 2010 19:58:01 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201004111958.o3BJw1f3096003@svn.freebsd.org> From: Rene Ladan Date: Sun, 11 Apr 2010 19:58: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: r206489 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 19:58:01 -0000 Author: rene (doc,ports committer) Date: Sun Apr 11 19:58:01 2010 New Revision: 206489 URL: http://svn.freebsd.org/changeset/base/206489 Log: Add myself to the ports committers graph Approved by: tabthorpe (mentor, implicit) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Apr 11 18:47:38 2010 (r206488) +++ head/share/misc/committers-ports.dot Sun Apr 11 19:58:01 2010 (r206489) @@ -136,6 +136,7 @@ pgj [label="Gabor Pali\npgj@FreeBSD.org\ philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] pgollucci [label="Philip M. Gollucci\npgollucci@FreeBSD.org\n2008/07/21"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] +rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"] @@ -347,6 +348,7 @@ tabthorpe -> avl tabthorpe -> jacula tabthorpe -> jadawin tabthorpe -> pgj +tabthorpe -> rene thierry -> jadawin From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 20:08:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B3B41065678; Sun, 11 Apr 2010 20:08:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 892C08FC22; Sun, 11 Apr 2010 20:08:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3BK8slY098461; Sun, 11 Apr 2010 20:08:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BK8sUg098459; Sun, 11 Apr 2010 20:08:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004112008.o3BK8sUg098459@svn.freebsd.org> From: Marius Strobl Date: Sun, 11 Apr 2010 20:08: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: r206490 - head/lib/libc/softfloat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 20:08:54 -0000 Author: marius Date: Sun Apr 11 20:08:54 2010 New Revision: 206490 URL: http://svn.freebsd.org/changeset/base/206490 Log: While SPARC V9 allows tininess to be detected either before or after rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tininess is detected before rounding therefore rounding up to the smallest normalized number should set the underflow flag. This change is needed for using SoftFloat on sparc64 for reference purposes. PR: 144900 Submitted by: Peter Jeremy Modified: head/lib/libc/softfloat/softfloat-specialize Modified: head/lib/libc/softfloat/softfloat-specialize ============================================================================== --- head/lib/libc/softfloat/softfloat-specialize Sun Apr 11 19:58:01 2010 (r206489) +++ head/lib/libc/softfloat/softfloat-specialize Sun Apr 11 20:08:54 2010 (r206490) @@ -44,6 +44,9 @@ Underflow tininess-detection mode, stati #ifdef SOFTFLOAT_FOR_GCC static #endif +#ifdef __sparc64__ +int8 float_detect_tininess = float_tininess_before_rounding; +#else int8 float_detect_tininess = float_tininess_after_rounding; /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 20:21:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA6D0106564A; Sun, 11 Apr 2010 20:21:34 +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 D91C58FC18; Sun, 11 Apr 2010 20:21: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 o3BKLYDF001406; Sun, 11 Apr 2010 20:21:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BKLYKO001404; Sun, 11 Apr 2010 20:21:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004112021.o3BKLYKO001404@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 11 Apr 2010 20:21: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: r206491 - head/tools/regression/bin/sh/parameters X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 20:21:35 -0000 Author: jilles Date: Sun Apr 11 20:21:34 2010 New Revision: 206491 URL: http://svn.freebsd.org/changeset/base/206491 Log: sh: Test that bogus values of PWD are not imported from the environment. Current versions pass this test trivially by never importing PWD, but I plan to change sh to import PWD if it is an absolute pathname for the current directory, possibly containing symlinks. Added: head/tools/regression/bin/sh/parameters/pwd1.0 (contents, props changed) Added: head/tools/regression/bin/sh/parameters/pwd1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parameters/pwd1.0 Sun Apr 11 20:21:34 2010 (r206491) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Check that bogus PWD values are not accepted from the environment. + +cd / || exit 3 +failures=0 +[ "$(PWD=foo sh -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty sh -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty/foo sh -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/bin/ls sh -c 'pwd')" = / ] || : $((failures += 1)) + +exit $((failures != 0)) From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 21:22:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC441065672; Sun, 11 Apr 2010 21:22:03 +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 798808FC20; Sun, 11 Apr 2010 21:22: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 o3BLM3RQ014706; Sun, 11 Apr 2010 21:22:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BLM3s1014704; Sun, 11 Apr 2010 21:22:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004112122.o3BLM3s1014704@svn.freebsd.org> From: Marius Strobl Date: Sun, 11 Apr 2010 21:22: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: r206492 - head/lib/libc/softfloat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 21:22:03 -0000 Author: marius Date: Sun Apr 11 21:22:02 2010 New Revision: 206492 URL: http://svn.freebsd.org/changeset/base/206492 Log: Add #endif missed in r206490. Modified: head/lib/libc/softfloat/softfloat-specialize Modified: head/lib/libc/softfloat/softfloat-specialize ============================================================================== --- head/lib/libc/softfloat/softfloat-specialize Sun Apr 11 20:21:34 2010 (r206491) +++ head/lib/libc/softfloat/softfloat-specialize Sun Apr 11 21:22:02 2010 (r206492) @@ -48,6 +48,7 @@ static int8 float_detect_tininess = float_tininess_before_rounding; #else int8 float_detect_tininess = float_tininess_after_rounding; +#endif /* ------------------------------------------------------------------------------- From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 22:44:32 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64C9106564A; Sun, 11 Apr 2010 22:44:32 +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 A42AC8FC17; Sun, 11 Apr 2010 22:44:32 +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 o3BMiV3q063673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Apr 2010 15:44:32 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4BC250CF.30600@errno.com> Date: Sun, 11 Apr 2010 15:44:31 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Rui Paulo References: <201004091206.o39C6JBo046371@svn.freebsd.org> In-Reply-To: <201004091206.o39C6JBo046371@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-CTc-dcc2-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r206419 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 22:44:33 -0000 Rui Paulo wrote: > Author: rpaulo > Date: Fri Apr 9 12:06:19 2010 > New Revision: 206419 > URL: http://svn.freebsd.org/changeset/base/206419 > > Log: > Use M_NOWAIT instead of M_WAITOK to avoid race conditions. > Can you describe these race conditions (or at least one of them)? Sam From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 22:50:27 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0881065672; Sun, 11 Apr 2010 22:50:27 +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 700168FC24; Sun, 11 Apr 2010 22:50:27 +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 o3BMoQVi063718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Apr 2010 15:50:27 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4BC25232.9070601@errno.com> Date: Sun, 11 Apr 2010 15:50:26 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Jack F Vogel References: <201004091842.o39IgFbb031014@svn.freebsd.org> In-Reply-To: <201004091842.o39IgFbb031014@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-CTc-dcc2-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r206429 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 22:50:27 -0000 Jack F Vogel wrote: > Author: jfv > Date: Fri Apr 9 18:42:15 2010 > New Revision: 206429 > URL: http://svn.freebsd.org/changeset/base/206429 > > Log: > Incorporate suggested improvements from yongari. > > Also, from feedback, make the multiqueue code an > option (EM_MULTIQUEUE) that is off by default. > Problems have been seen with UDP when its on. It is usually a good idea to say what the "suggested improvements" are as it's unlikely anyone looking at the commit will have the needed context (I certainly did not). It also seems that you roll-up unrelated changes in one commit; this is not advisable. Sam From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 08:27:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B24D9106564A; Mon, 12 Apr 2010 08:27:53 +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 A12D08FC17; Mon, 12 Apr 2010 08:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3C8RrEj069280; Mon, 12 Apr 2010 08:27:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3C8RrN6069279; Mon, 12 Apr 2010 08:27:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004120827.o3C8RrN6069279@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 12 Apr 2010 08:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206494 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 08:27:53 -0000 Author: luigi Date: Mon Apr 12 08:27:53 2010 New Revision: 206494 URL: http://svn.freebsd.org/changeset/base/206494 Log: fix a buffer overflow with large (100k+) number of input lines. MFC after: 3 days Modified: head/sbin/ipfw/main.c Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Sun Apr 11 21:59:23 2010 (r206493) +++ head/sbin/ipfw/main.c Mon Apr 12 08:27:53 2010 (r206494) @@ -553,11 +553,11 @@ ipfw_readfile(int ac, char *av[]) } while (fgets(buf, BUFSIZ, f)) { /* read commands */ - char linename[10]; + char linename[20]; char *args[2]; lineno++; - sprintf(linename, "Line %d", lineno); + snprintf(linename, sizeof(linename), "Line %d", lineno); setprogname(linename); /* XXX */ args[0] = progname; args[1] = buf; From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 12:28:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5136106566B; Mon, 12 Apr 2010 12:28:22 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D47128FC12; Mon, 12 Apr 2010 12:28: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 o3CCSMUK024515; Mon, 12 Apr 2010 12:28:22 GMT (envelope-from fluffy@svn.freebsd.org) Received: (from fluffy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CCSMLi024514; Mon, 12 Apr 2010 12:28:22 GMT (envelope-from fluffy@svn.freebsd.org) Message-Id: <201004121228.o3CCSMLi024514@svn.freebsd.org> From: Dima Panov Date: Mon, 12 Apr 2010 12:28: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: r206495 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 12:28:23 -0000 Author: fluffy (ports committer) Date: Mon Apr 12 12:28:22 2010 New Revision: 206495 URL: http://svn.freebsd.org/changeset/base/206495 Log: - Add myself to the ports committers graph Forgot to do it when gain my commit bit :) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Apr 12 08:27:53 2010 (r206494) +++ head/share/misc/committers-ports.dot Mon Apr 12 12:28:22 2010 (r206495) @@ -77,6 +77,7 @@ eik [label="Oliver Eikemeier\neik@FreeBS erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04"] farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] +fluffy [label="Dima Panov\nfluffy@FreeBSD.org\n2009/08/10"] flz [label="Florent Thoumie\nflz@FreeBSD.org\n2005/03/01"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2006/12/05"] gahr [label="Pietro Cerutti\ngahr@FreeBSD.org\n2008/02/20"] @@ -290,6 +291,7 @@ miwi -> avilla miwi -> beat miwi -> decke miwi -> farrokhi +miwi -> fluffy miwi -> gahr miwi -> makc miwi -> mandree @@ -345,6 +347,7 @@ steve -> netchild tabthorpe -> avilla tabthorpe -> avl +tabthorpe -> fluffy tabthorpe -> jacula tabthorpe -> jadawin tabthorpe -> pgj From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 13:46:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91356106564A; Mon, 12 Apr 2010 13:46:21 +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 666AC8FC1A; Mon, 12 Apr 2010 13:46: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 o3CDkLSg041761; Mon, 12 Apr 2010 13:46:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CDkLKV041760; Mon, 12 Apr 2010 13:46:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004121346.o3CDkLKV041760@svn.freebsd.org> From: Rui Paulo Date: Mon, 12 Apr 2010 13:46: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: r206496 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 13:46:21 -0000 Author: rpaulo Date: Mon Apr 12 13:46:20 2010 New Revision: 206496 URL: http://svn.freebsd.org/changeset/base/206496 Log: Remove svn:executable prop. Modified: Directory Properties: head/sys/dev/ath/ath_hal/ar5416/ar9160.ini (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 14:33:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 923E6106564A; Mon, 12 Apr 2010 14:33:58 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id B6DCE8FC28; Mon, 12 Apr 2010 14:33:57 +0000 (UTC) Received: by ewy24 with SMTP id 24so968512ewy.33 for ; Mon, 12 Apr 2010 07:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=Op6WhIDdIyb1Zq/CCiBOqDpZhj+7nObfTB8H/C2325s=; b=cwyGTvJ99b052O+9PZit2LkzkW+F/Ie7tLSeIIiLwA5Hn2nlYuqKPkqkbJP9Ks/MuR cccohOE03E3u1XP3+0/iLoTA6edHTLqngbak3d3K9kdLzpnToBv+x7wWD84iyg8UxJQB UBnRCud2Cg9uY/gcHIzqjRyHz3+5Loro6zayk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=FtJtRFfU20sY+KiMaUuz4+Sc+S1QTKROOKxaNplH/ZP5PDHvG64G+c9k70qql5faC6 a+Yj7NQYiJaK7nu/+/gQAzyBYt4kehJged0bdWVEE2vqmSSsUHGhYLGFHBhl3Mf2Um9s kF7tqDqabwReMuPIxnRzfuy9Y/B2cf4QcWUjg= Received: by 10.103.81.12 with SMTP id i12mr2058662mul.89.1271082836420; Mon, 12 Apr 2010 07:33:56 -0700 (PDT) Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id j10sm17587345mue.18.2010.04.12.07.33.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Apr 2010 07:33:54 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <4BC250CF.30600@errno.com> Date: Mon, 12 Apr 2010 15:33:52 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <256D847F-E64D-4802-8266-C2AC4DCDFF72@FreeBSD.org> References: <201004091206.o39C6JBo046371@svn.freebsd.org> <4BC250CF.30600@errno.com> To: Sam Leffler X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r206419 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 14:33:58 -0000 On 11 Apr 2010, at 23:44, Sam Leffler wrote: > Rui Paulo wrote: >> Author: rpaulo >> Date: Fri Apr 9 12:06:19 2010 >> New Revision: 206419 >> URL: http://svn.freebsd.org/changeset/base/206419 >> Log: >> Use M_NOWAIT instead of M_WAITOK to avoid race conditions. >> =20 >=20 > Can you describe these race conditions (or at least one of them)? Some drivers call ratectl functions with locks held. I saw similar = allocations in the net80211 stack that used M_NOWAIT and printed an = error if the allocation failed, but didn't notify the caller (for = example ieee80211_node_table_init()). If I use M_WAITOK here I'll also get WITNESS warnings. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 16:37:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D692D1065674; Mon, 12 Apr 2010 16:37:45 +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 C18E48FC1C; Mon, 12 Apr 2010 16:37: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 o3CGbjJY080073; Mon, 12 Apr 2010 16:37:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CGbjSK080066; Mon, 12 Apr 2010 16:37:45 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004121637.o3CGbjSK080066@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 12 Apr 2010 16:37: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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 16:37:45 -0000 Author: luigi Date: Mon Apr 12 16:37:45 2010 New Revision: 206497 URL: http://svn.freebsd.org/changeset/base/206497 Log: Bring in geom_sched, support for scheduling disk I/O requests in a device independent manner. Also include an example anticipatory scheduler, gsched_rr, which gives very nice performance improvements in presence of competing random access patterns. This is joint work with Fabio Checconi, developed last year and presented at BSDCan 2009. You can find details in the README file or at http://info.iet.unipi.it/~luigi/geom_sched/ Added: head/sbin/geom/class/sched/ head/sbin/geom/class/sched/Makefile (contents, props changed) head/sbin/geom/class/sched/geom_sched.c (contents, props changed) head/sbin/geom/class/sched/gsched.8 (contents, props changed) head/sys/geom/sched/ head/sys/geom/sched/README (contents, props changed) head/sys/geom/sched/g_sched.c (contents, props changed) head/sys/geom/sched/g_sched.h (contents, props changed) head/sys/geom/sched/gs_rr.c (contents, props changed) head/sys/geom/sched/gs_scheduler.h (contents, props changed) head/sys/geom/sched/subr_disk.c (contents, props changed) head/sys/modules/geom/geom_sched/ head/sys/modules/geom/geom_sched/Makefile (contents, props changed) head/sys/modules/geom/geom_sched/Makefile.inc (contents, props changed) head/sys/modules/geom/geom_sched/gs_sched/ head/sys/modules/geom/geom_sched/gs_sched/Makefile (contents, props changed) head/sys/modules/geom/geom_sched/gsched_rr/ head/sys/modules/geom/geom_sched/gsched_rr/Makefile (contents, props changed) Modified: head/sbin/geom/class/Makefile head/sys/modules/geom/Makefile Modified: head/sbin/geom/class/Makefile ============================================================================== --- head/sbin/geom/class/Makefile Mon Apr 12 13:46:20 2010 (r206496) +++ head/sbin/geom/class/Makefile Mon Apr 12 16:37:45 2010 (r206497) @@ -15,6 +15,7 @@ SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part SUBDIR+=raid3 +SUBDIR+=sched SUBDIR+=shsec SUBDIR+=stripe SUBDIR+=virstor Added: head/sbin/geom/class/sched/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/sched/Makefile Mon Apr 12 16:37:45 2010 (r206497) @@ -0,0 +1,19 @@ +# GEOM_LIBRARY_PATH +# $FreeBSD$ + +.PATH: /usr/src/sbin/geom/misc + +CFLAGS += -I/usr/src/sbin/geom + +CLASS=sched + +WARNS?= 6 +CLASS_DIR?=/lib/geom + +SHLIBDIR?=${CLASS_DIR} +SHLIB_NAME?=geom_${CLASS}.so +LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} +MAN= g${CLASS}.8 +SRCS+= geom_${CLASS}.c subr.c + +.include Added: head/sbin/geom/class/sched/geom_sched.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/sched/geom_sched.c Mon Apr 12 16:37:45 2010 (r206497) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo + * 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 AUTHORS 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 AUTHORS 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. + */ + +/* + * $Id$ + * $FreeBSD$ + * + * This file implements the userspace library used by the 'geom' + * command to load and manipulate disk schedulers. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "core/geom.h" +#include "misc/subr.h" + +#define G_SCHED_VERSION 0 + +uint32_t lib_version = G_LIB_VERSION; +uint32_t version = G_SCHED_VERSION; + +/* + * storage for parameters used by this geom class. + * Right now only the scheduler name is used. + */ +static char algo[] = "rr"; /* default scheduler */ + +/* + * Adapt to differences in geom library. + * in V1 struct g_command misses gc_argname, eld, and G_BOOL is undefined + */ +#if G_LIB_VERSION == 1 +#define G_ARGNAME +#define G_TYPE_BOOL G_TYPE_NUMBER +#else +#define G_ARGNAME NULL, +#endif + +static void +gcmd_createinsert(struct gctl_req *req, unsigned flags __unused) +{ + const char *reqalgo; + char name[64]; + + if (gctl_has_param(req, "algo")) + reqalgo = gctl_get_ascii(req, "algo"); + else + reqalgo = algo; + + snprintf(name, sizeof(name), "gsched_%s", reqalgo); + /* + * Do not complain about errors here, gctl_issue() + * will fail anyway. + */ + if (modfind(name) < 0) + kldload(name); + gctl_issue(req); +} + +struct g_command class_commands[] = { + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, + { + { 'a', "algo", algo, G_TYPE_STRING }, + G_OPT_SENTINEL + }, + G_ARGNAME "[-v] [-a algorithm_name] dev ..." + }, + { "insert", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, + { + { 'a', "algo", algo, G_TYPE_STRING }, + G_OPT_SENTINEL + }, + G_ARGNAME "[-v] [-a algorithm_name] dev ..." + }, + { "configure", G_FLAG_VERBOSE, NULL, + { + { 'a', "algo", algo, G_TYPE_STRING }, + G_OPT_SENTINEL + }, + G_ARGNAME "[-v] [-a algorithm_name] prov ..." + }, + { "destroy", G_FLAG_VERBOSE, NULL, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + G_ARGNAME "[-fv] prov ..." + }, + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + G_ARGNAME "[-v] prov ..." + }, + G_CMD_SENTINEL +}; Added: head/sbin/geom/class/sched/gsched.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/sched/gsched.8 Mon Apr 12 16:37:45 2010 (r206497) @@ -0,0 +1,161 @@ +.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo +.\" All rights reserved. +.\" $FreeBSD$ +.\" +.\" 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 AUTHORS 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 AUTHORS 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. +.\" +.Dd April 12, 2010 +.Dt GSCHED 8 +.Os +.Sh NAME +.Nm gsched +.Nd "control utility for disk scheduler GEOM class" +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl v +.Op Fl a Ar algorithm +.Ar provider ... +.Nm +.Cm insert +.Op Fl v +.Op Fl a Ar algorithm +.Ar provider ... +.Nm +.Cm configure +.Op Fl v +.Op Fl a Ar algorithm +.Ar node ... +.Nm +.Cm destroy +.Op Fl fv +.Ar node ... +.Nm +.Cm reset +.Op Fl v +.Ar node ... +.Nm +.Cm { list | status | load | unload } +.Sh DESCRIPTION +The +.Nm +utility (also callable as +.Nm geom sched ... ) +changes the scheduling policy of the requests going to a provider. +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm configure" +.It Cm create +Create a new provider and geom node using the specified scheduling algorithm. +.Ar algorithm +is the name of the scheduling algorithm used for the provider. +Available algorithms include: +.Ar rr , +which implements anticipatory scheduling with round robin service +among clients; +.Ar as , +which implements a simple form of anticipatory scheduling with +no per-client queue. +.Pp +If the operation succeeds, the new provider should appear with name +.Pa /dev/ Ns Ao Ar dev Ac Ns Pa .sched. . +The kernel module +.Pa geom_sched.ko +will be loaded if it is not loaded already. +.It Cm insert +Operates as "create", but the insertion is "transparent", +i.e. the existing provider is rerouted to the newly created geom, +which in turn forwards requests to the existing geom. +This operation allows one to start/stop a scheduling service +on an already existing provider. +.Pp +A subsequent 'destroy' will remove the newly created geom and +hook the provider back to the original geom. +.Ar algorithm +.It Cm configure +Configure existing scheduling provider. It supports the same options +as the +.Nm create +command. +.It Cm destroy +Destroy the geom specified in the parameter. +.It Cm reset +Do nothing. +.It Cm list | status | load | unload +See +.Xr geom 8 . +.El +.Pp +Additional options: +.Bl -tag -width ".Fl f" +.It Fl f +Force the removal of the specified provider. +.It Fl v +Be more verbose. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to control the behavior of the +.Nm SCHED +GEOM class. +The default value is shown next to each variable. +.Bl -tag -width indent +.It Va kern.geom.sched.debug : No 0 +Debug level of the +.Nm SCHED +GEOM class. +This can be set to a number between 0 and 2 inclusive. +If set to 0 minimal debug information is printed, and if set to 2 the +maximum amount of debug information is printed. +.El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. +.Sh EXAMPLES +The following example shows how to create a scheduling provider for disk +.Pa /dev/da0 +, and how to destroy it. +.Bd -literal -offset indent +# Load the geom_sched module: +kldload geom_sched +# Load some scheduler classes used by geom_sched: +kldload gsched_rr gsched_as +# Configure device ad0 to use scheduler 'rr': +geom sched insert -s rr ad0 +# Now provider ad0 uses the 'rr' algorithm; +# the new geom is ad0.sched. +# Remove the scheduler on the device: +geom sched destroy -v ad0.sched. +.Ed +.Pp +.Sh SEE ALSO +.Xr geom 4 , +.Xr geom 8 +.Sh HISTORY +The +.Nm +utility appeared in April 2010. +.Sh AUTHORS +.An Fabio Checconi Aq fabio@FreeBSD.org +.An Luigi Rizzo Aq luigi@FreeBSD.org Added: head/sys/geom/sched/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/sched/README Mon Apr 12 16:37:45 2010 (r206497) @@ -0,0 +1,162 @@ + + --- GEOM BASED DISK SCHEDULERS FOR FREEBSD --- + +This code contains a framework for GEOM-based disk schedulers and a +couple of sample scheduling algorithms that use the framework and +implement two forms of "anticipatory scheduling" (see below for more +details). + +As a quick example of what this code can give you, try to run "dd", +"tar", or some other program with highly SEQUENTIAL access patterns, +together with "cvs", "cvsup", "svn" or other highly RANDOM access patterns +(this is not a made-up example: it is pretty common for developers +to have one or more apps doing random accesses, and others that do +sequential accesses e.g., loading large binaries from disk, checking +the integrity of tarballs, watching media streams and so on). + +These are the results we get on a local machine (AMD BE2400 dual +core CPU, SATA 250GB disk): + + /mnt is a partition mounted on /dev/ad0s1f + + cvs: cvs -d /mnt/home/ncvs-local update -Pd /mnt/ports + dd-read: dd bs=128k of=/dev/null if=/dev/ad0 (or ad0-sched-) + dd-writew dd bs=128k if=/dev/zero of=/mnt/largefile + + NO SCHEDULER RR SCHEDULER + dd cvs dd cvs + + dd-read only 72 MB/s ---- 72 MB/s --- + dd-write only 55 MB/s --- 55 MB/s --- + dd-read+cvs 6 MB/s ok 30 MB/s ok + dd-write+cvs 55 MB/s slooow 14 MB/s ok + +As you can see, when a cvs is running concurrently with dd, the +performance drops dramatically, and depending on read or write mode, +one of the two is severely penalized. The use of the RR scheduler +in this example makes the dd-reader go much faster when competing +with cvs, and lets cvs progress when competing with a writer. + +To try it out: + +1. USERS OF FREEBSD 7, PLEASE READ CAREFULLY THE FOLLOWING: + + On loading, this module patches one kernel function (g_io_request()) + so that I/O requests ("bio's") carry a classification tag, useful + for scheduling purposes. + + ON FREEBSD 7, the tag is stored in an existing (though rarely used) + field of the "struct bio", a solution which makes this module + incompatible with other modules using it, such as ZFS and gjournal. + Additionally, g_io_request() is patched in-memory to add a call + to the function that initializes this field (i386/amd64 only; + for other architectures you need to manually patch sys/geom/geom_io.c). + See details in the file g_sched.c. + + On FreeBSD 8.0 and above, the above trick is not necessary, + as the struct bio contains dedicated fields for the classifier, + and hooks for request classifiers. + + If you don't like the above, don't run this code. + +2. PLEASE MAKE SURE THAT THE DISK THAT YOU WILL BE USING FOR TESTS + DOES NOT CONTAIN PRECIOUS DATA. + This is experimental code, so we make no guarantees, though + I am routinely using it on my desktop and laptop. + +3. EXTRACT AND BUILD THE PROGRAMS + A 'make install' in the directory should work (with root privs), + or you can even try the binary modules. + If you want to build the modules yourself, look at the Makefile. + +4. LOAD THE MODULE, CREATE A GEOM NODE, RUN TESTS + + The scheduler's module must be loaded first: + + # kldload gsched_rr + + substitute with gsched_as to test AS. Then, supposing that you are + using /dev/ad0 for testing, a scheduler can be attached to it with: + + # geom sched insert ad0 + + The scheduler is inserted transparently in the geom chain, so + mounted partitions and filesystems will keep working, but + now requests will go through the scheduler. + + To change scheduler on-the-fly, you can reconfigure the geom: + + # geom sched configure -a as ad0.sched. + + assuming that gsched_as was loaded previously. + +5. SCHEDULER REMOVAL + + In principle it is possible to remove the scheduler module + even on an active chain by doing + + # geom sched destroy ad0.sched. + + However, there is some race in the geom subsystem which makes + the removal unsafe if there are active requests on a chain. + So, in order to reduce the risk of data losses, make sure + you don't remove a scheduler from a chain with ongoing transactions. + +--- NOTES ON THE SCHEDULERS --- + +The important contribution of this code is the framework to experiment +with different scheduling algorithms. 'Anticipatory scheduling' +is a very powerful technique based on the following reasoning: + + The disk throughput is much better if it serves sequential requests. + If we have a mix of sequential and random requests, and we see a + non-sequential request, do not serve it immediately but instead wait + a little bit (2..5ms) to see if there is another one coming that + the disk can serve more efficiently. + +There are many details that should be added to make sure that the +mechanism is effective with different workloads and systems, to +gain a few extra percent in performance, to improve fairness, +insulation among processes etc. A discussion of the vast literature +on the subject is beyond the purpose of this short note. + +-------------------------------------------------------------------------- + +TRANSPARENT INSERT/DELETE + +geom_sched is an ordinary geom module, however it is convenient +to plug it transparently into the geom graph, so that one can +enable or disable scheduling on a mounted filesystem, and the +names in /etc/fstab do not depend on the presence of the scheduler. + +To understand how this works in practice, remember that in GEOM +we have "providers" and "geom" objects. +Say that we want to hook a scheduler on provider "ad0", +accessible through pointer 'pp'. Originally, pp is attached to +geom "ad0" (same name, different object) accessible through pointer old_gp + + BEFORE ---> [ pp --> old_gp ...] + +A normal "geom sched create ad0" call would create a new geom node +on top of provider ad0/pp, and export a newly created provider +("ad0.sched." accessible through pointer newpp). + + AFTER create ---> [ newpp --> gp --> cp ] ---> [ pp --> old_gp ... ] + +On top of newpp, a whole tree will be created automatically, and we +can e.g. mount partitions on /dev/ad0.sched.s1d, and those requests +will go through the scheduler, whereas any partition mounted on +the pre-existing device entries will not go through the scheduler. + +With the transparent insert mechanism, the original provider "ad0"/pp +is hooked to the newly created geom, as follows: + + AFTER insert ---> [ pp --> gp --> cp ] ---> [ newpp --> old_gp ... ] + +so anything that was previously using provider pp will now have +the requests routed through the scheduler node. + +A removal ("geom sched destroy ad0.sched.") will restore the original +configuration. + +# $FreeBSD$ Added: head/sys/geom/sched/g_sched.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/sched/g_sched.c Mon Apr 12 16:37:45 2010 (r206497) @@ -0,0 +1,1901 @@ +/*- + * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * 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 AUTHORS 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 AUTHORS 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. + */ + +/* + * $Id$ + * $FreeBSD$ + * + * Main control module for geom-based disk schedulers ('sched'). + * + * USER VIEW + * A 'sched' node is typically inserted transparently between + * an existing provider pp and its original geom gp + * + * [pp --> gp ..] + * + * using the command "geom sched insert " and + * resulting in the following topology + * + * [pp --> sched_gp --> cp] [new_pp --> gp ... ] + * + * Deletion "geom sched destroy .sched." restores the + * original chain. The normal "geom sched create " + * is also supported. + * + * INTERNALS + * Internally, the 'sched' uses the following data structures + * + * geom{} g_sched_softc{} g_gsched{} + * +----------+ +---------------+ +-------------+ + * | softc *-|--->| sc_gsched *-|-->| gs_init | + * | ... | | | | gs_fini | + * | | | [ hash table] | | gs_start | + * +----------+ | | | ... | + * | | +-------------+ + * | | + * | | g_*_softc{} + * | | +-------------+ + * | sc_data *-|-->| | + * +---------------+ | algorithm- | + * | specific | + * +-------------+ + * + * A g_sched_softc{} is created with a "geom sched insert" call. + * In turn this instantiates a specific scheduling algorithm, + * which sets sc_gsched to point to the algorithm callbacks, + * and calls gs_init() to create the g_*_softc{} . + * The other callbacks (gs_start, gs_next, ...) are invoked + * as needed + * + * g_sched_softc{} is defined in g_sched.h and mostly used here; + * g_gsched{}, and the gs_callbacks, are documented in gs_scheduler.h; + * g_*_softc{} is defined/implemented by each algorithm (gs_*.c) + * + * DATA MOVING + * When a bio is received on the provider, it goes to the + * g_sched_start() which calls gs_start() to initially queue it; + * then we call g_sched_dispatch() that loops around gs_next() + * to select zero or more bio's to be sent downstream. + * + * g_sched_dispatch() can also be called as a result of a timeout, + * e.g. when doing anticipation or pacing requests. + * + * When a bio comes back, it goes to g_sched_done() which in turn + * calls gs_done(). The latter does any necessary housekeeping in + * the scheduling algorithm, and may decide to call g_sched_dispatch() + * to send more bio's downstream. + * + * If an algorithm needs per-flow queues, these are created + * calling gs_init_class() and destroyed with gs_fini_class(), + * and they are also inserted in the hash table implemented in + * the g_sched_softc{} + * + * If an algorithm is replaced, or a transparently-inserted node is + * removed with "geom sched destroy", we need to remove all references + * to the g_*_softc{} and g_sched_softc from the bio's still in + * the scheduler. g_sched_forced_dispatch() helps doing this. + * XXX need to explain better. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* we access curthread */ +#include +#include "gs_scheduler.h" +#include "g_sched.h" /* geom hooks */ + +/* + * Size of the per-geom hash table storing traffic classes. + * We may decide to change it at a later time, it has no ABI + * implications as it is only used for run-time allocations. + */ +#define G_SCHED_HASH_SIZE 32 + +static int g_sched_destroy(struct g_geom *gp, boolean_t force); +static int g_sched_destroy_geom(struct gctl_req *req, + struct g_class *mp, struct g_geom *gp); +static void g_sched_config(struct gctl_req *req, struct g_class *mp, + const char *verb); +static struct g_geom *g_sched_taste(struct g_class *mp, + struct g_provider *pp, int flags __unused); +static void g_sched_dumpconf(struct sbuf *sb, const char *indent, + struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_sched_init(struct g_class *mp); +static void g_sched_fini(struct g_class *mp); + +struct g_class g_sched_class = { + .name = G_SCHED_CLASS_NAME, + .version = G_VERSION, + .ctlreq = g_sched_config, + .taste = g_sched_taste, + .destroy_geom = g_sched_destroy_geom, + .init = g_sched_init, + .fini = g_sched_fini +}; + +MALLOC_DEFINE(M_GEOM_SCHED, "GEOM_SCHED", "Geom schedulers data structures"); + +/* + * Global variables describing the state of the geom_sched module. + * There is only one static instance of this structure. + */ +LIST_HEAD(gs_list, g_gsched); /* type, link field */ +struct geom_sched_vars { + struct mtx gs_mtx; + struct gs_list gs_scheds; /* list of algorithms */ + u_int gs_debug; + u_int gs_sched_count; /* how many algorithms ? */ + u_int gs_patched; /* g_io_request was patched */ + + u_int gs_initialized; + u_int gs_expire_secs; /* expiration of hash entries */ + + struct bio_queue_head gs_pending; + u_int gs_npending; + + /* The following are for stats, usually protected by gs_mtx. */ + u_long gs_requests; /* total requests */ + u_long gs_done; /* total done */ + u_int gs_in_flight; /* requests in flight */ + u_int gs_writes_in_flight; + u_int gs_bytes_in_flight; + u_int gs_write_bytes_in_flight; + + char gs_names[256]; /* names of schedulers */ +}; + +static struct geom_sched_vars me = { + .gs_expire_secs = 10, +}; + +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, sched, CTLFLAG_RW, 0, + "GEOM_SCHED stuff"); + +SYSCTL_INT(_kern_geom_sched, OID_AUTO, in_flight_wb, CTLFLAG_RD, + &me.gs_write_bytes_in_flight, 0, "Write bytes in flight"); + +SYSCTL_INT(_kern_geom_sched, OID_AUTO, in_flight_b, CTLFLAG_RD, + &me.gs_bytes_in_flight, 0, "Bytes in flight"); + +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, in_flight_w, CTLFLAG_RD, + &me.gs_writes_in_flight, 0, "Write Requests in flight"); + +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, in_flight, CTLFLAG_RD, + &me.gs_in_flight, 0, "Requests in flight"); + +SYSCTL_ULONG(_kern_geom_sched, OID_AUTO, done, CTLFLAG_RD, + &me.gs_done, 0, "Total done"); + +SYSCTL_ULONG(_kern_geom_sched, OID_AUTO, requests, CTLFLAG_RD, + &me.gs_requests, 0, "Total requests"); + +SYSCTL_STRING(_kern_geom_sched, OID_AUTO, algorithms, CTLFLAG_RD, + &me.gs_names, 0, "Algorithm names"); + +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, alg_count, CTLFLAG_RD, + &me.gs_sched_count, 0, "Number of algorithms"); + +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, debug, CTLFLAG_RW, + &me.gs_debug, 0, "Debug level"); + +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, expire_secs, CTLFLAG_RW, + &me.gs_expire_secs, 0, "Expire time in seconds"); + +/* + * g_sched calls the scheduler algorithms with this lock held. + * The locking functions are exposed so the scheduler algorithms can also + * protect themselves e.g. when running a callout handler. + */ +void +g_sched_lock(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + + mtx_lock(&sc->sc_mtx); +} + +void +g_sched_unlock(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + + mtx_unlock(&sc->sc_mtx); +} + +/* + * Support functions to handle references to the module, + * which are coming from devices using this scheduler. + */ +static inline void +g_gsched_ref(struct g_gsched *gsp) +{ + + atomic_add_int(&gsp->gs_refs, 1); +} + +static inline void +g_gsched_unref(struct g_gsched *gsp) +{ + + atomic_add_int(&gsp->gs_refs, -1); +} + +/* + * Update the stats when this request is done. + */ +static void +g_sched_update_stats(struct bio *bio) +{ + + me.gs_done++; + me.gs_in_flight--; + me.gs_bytes_in_flight -= bio->bio_length; + if (bio->bio_cmd & BIO_WRITE) { + me.gs_writes_in_flight--; + me.gs_write_bytes_in_flight -= bio->bio_length; + } +} + +/* + * Dispatch any pending request. + */ +static void +g_sched_forced_dispatch(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + struct g_gsched *gsp = sc->sc_gsched; + struct bio *bp; + + KASSERT(mtx_owned(&sc->sc_mtx), + ("sc_mtx not owned during forced dispatch")); + + while ((bp = gsp->gs_next(sc->sc_data, 1)) != NULL) + g_io_request(bp, LIST_FIRST(&gp->consumer)); +} + +/* + * The main dispatch loop, called either here after the start + * routine, or by scheduling algorithms when they receive a timeout + * or a 'done' notification. Does not share code with the forced + * dispatch path, since the gs_done() callback can call us. + */ +void +g_sched_dispatch(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + struct g_gsched *gsp = sc->sc_gsched; + struct bio *bp; + + KASSERT(mtx_owned(&sc->sc_mtx), ("sc_mtx not owned during dispatch")); + + if ((sc->sc_flags & G_SCHED_FLUSHING)) + return; + + while ((bp = gsp->gs_next(sc->sc_data, 0)) != NULL) + g_io_request(bp, LIST_FIRST(&gp->consumer)); +} + +/* + * Recent (8.0 and above) versions of FreeBSD have support to + * register classifiers of disk requests. The classifier is + * invoked by g_io_request(), and stores the information into + * bp->bio_classifier1. + * + * Support for older versions, which is left here only for + * documentation purposes, relies on two hacks: + * 1. classification info is written into the bio_caller1 + * field of the topmost node in the bio chain. This field + * is rarely used, but this module is incompatible with + * those that use bio_caller1 for other purposes, + * such as ZFS and gjournal; + * 2. g_io_request() is patched in-memory when the module is + * loaded, so that the function calls a classifier as its + * first thing. g_io_request() is restored when the module + * is unloaded. This functionality is only supported for + * x86 and amd64, other architectures need source code changes. + */ + +/* + * Lookup the identity of the issuer of the original request. + * In the current implementation we use the curthread of the + * issuer, but different mechanisms may be implemented later + * so we do not make assumptions on the return value which for + * us is just an opaque identifier. + */ + +static inline u_long +g_sched_classify(struct bio *bp) +{ + +#if __FreeBSD_version > 800098 + /* we have classifier fields in the struct bio */ +#define HAVE_BIO_CLASSIFIER + return ((u_long)bp->bio_classifier1); +#else +#warning old version!!! + while (bp->bio_parent != NULL) + bp = bp->bio_parent; + + return ((u_long)bp->bio_caller1); +#endif +} + +/* Return the hash chain for the given key. */ +static inline struct g_hash * +g_sched_hash(struct g_sched_softc *sc, u_long key) +{ + + return (&sc->sc_hash[key & sc->sc_mask]); +} + +/* + * Helper function for the children classes, which takes + * a geom and a bio and returns the private descriptor + * associated to the request. This involves fetching + * the classification field and [al]locating the + * corresponding entry in the hash table. + */ +void * +g_sched_get_class(struct g_geom *gp, struct bio *bp) +{ + struct g_sched_softc *sc; + struct g_sched_class *gsc; + struct g_gsched *gsp; + struct g_hash *bucket; + u_long key; + + sc = gp->softc; + key = g_sched_classify(bp); + bucket = g_sched_hash(sc, key); + LIST_FOREACH(gsc, bucket, gsc_clist) { + if (key == gsc->gsc_key) { + gsc->gsc_refs++; + return (gsc->gsc_priv); + } + } + + gsp = sc->sc_gsched; + gsc = malloc(sizeof(*gsc) + gsp->gs_priv_size, + M_GEOM_SCHED, M_NOWAIT | M_ZERO); + if (!gsc) + return (NULL); + + if (gsp->gs_init_class(sc->sc_data, gsc->gsc_priv)) { + free(gsc, M_GEOM_SCHED); + return (NULL); + } + + gsc->gsc_refs = 2; /* 1 for the hash table, 1 for the caller. */ + gsc->gsc_key = key; + LIST_INSERT_HEAD(bucket, gsc, gsc_clist); + + gsc->gsc_expire = ticks + me.gs_expire_secs * hz; + + return (gsc->gsc_priv); +} + +/* + * Release a reference to the per-client descriptor, + */ +void +g_sched_put_class(struct g_geom *gp, void *priv) +{ + struct g_sched_class *gsc; + struct g_sched_softc *sc; + + gsc = g_sched_priv2class(priv); + gsc->gsc_expire = ticks + me.gs_expire_secs * hz; + + if (--gsc->gsc_refs > 0) + return; + + sc = gp->softc; + sc->sc_gsched->gs_fini_class(sc->sc_data, priv); + + LIST_REMOVE(gsc, gsc_clist); + free(gsc, M_GEOM_SCHED); +} + +static void +g_sched_hash_fini(struct g_geom *gp, struct g_hash *hp, u_long mask, + struct g_gsched *gsp, void *data) +{ + struct g_sched_class *cp, *cp2; + int i; + + if (!hp) + return; + + if (data && gsp->gs_hash_unref) + gsp->gs_hash_unref(data); + + for (i = 0; i < G_SCHED_HASH_SIZE; i++) { + LIST_FOREACH_SAFE(cp, &hp[i], gsc_clist, cp2) + g_sched_put_class(gp, cp->gsc_priv); + } + + hashdestroy(hp, M_GEOM_SCHED, mask); +} + +static struct g_hash * +g_sched_hash_init(struct g_gsched *gsp, u_long *mask, int flags) +{ + struct g_hash *hash; + + if (gsp->gs_priv_size == 0) + return (NULL); + + hash = hashinit_flags(G_SCHED_HASH_SIZE, M_GEOM_SCHED, mask, flags); + + return (hash); +} + +static void +g_sched_flush_classes(struct g_geom *gp) +{ + struct g_sched_softc *sc; + struct g_sched_class *cp, *cp2; + int i; + + sc = gp->softc; + + if (!sc->sc_hash || ticks - sc->sc_flush_ticks <= 0) + return; + + for (i = 0; i < G_SCHED_HASH_SIZE; i++) { + LIST_FOREACH_SAFE(cp, &sc->sc_hash[i], gsc_clist, cp2) { + if (cp->gsc_refs == 1 && ticks - cp->gsc_expire > 0) + g_sched_put_class(gp, cp->gsc_priv); + } + } + + sc->sc_flush_ticks = ticks + me.gs_expire_secs * hz; +} + +/* + * Wait for the completion of any outstanding request. To ensure + * that this does not take forever the caller has to make sure that + * no new request enter the scehduler before calling us. + * + * Must be called with the gp mutex held and topology locked. + */ +static int +g_sched_wait_pending(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + int endticks = ticks + hz; + + g_topology_assert(); + + while (sc->sc_pending && endticks - ticks >= 0) + msleep(gp, &sc->sc_mtx, 0, "sched_wait_pending", hz / 4); + + return (sc->sc_pending ? ETIMEDOUT : 0); +} + +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 18:28:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 838E0106564A; Mon, 12 Apr 2010 18:28:08 +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 7222F8FC1E; Mon, 12 Apr 2010 18:28: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 o3CIS8No004713; Mon, 12 Apr 2010 18:28:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CIS8Pt004711; Mon, 12 Apr 2010 18:28:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004121828.o3CIS8Pt004711@svn.freebsd.org> From: Warner Losh Date: Mon, 12 Apr 2010 18:28: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: r206501 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 18:28:08 -0000 Author: imp Date: Mon Apr 12 18:28:08 2010 New Revision: 206501 URL: http://svn.freebsd.org/changeset/base/206501 Log: bce, bwi, bwn, mfi, mpt and siba_bwn all now compile that arm and mips have added a BUS_SPACE_UNSPECIFIED definition. Add them back to the mix on these platforms. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Apr 12 17:44:42 2010 (r206500) +++ head/sys/modules/Makefile Mon Apr 12 18:28:08 2010 (r206501) @@ -35,15 +35,15 @@ SUBDIR= ${_3dfx} \ ata \ ath \ ${_auxio} \ - ${_bce} \ + bce \ bfe \ bge \ ${_bios} \ ${_bktr} \ ${_bm} \ bridgestp \ - ${_bwi} \ - ${_bwn} \ + bwi \ + bwn \ cam \ ${_canbepm} \ ${_canbus} \ @@ -176,13 +176,13 @@ SUBDIR= ${_3dfx} \ mcd \ md \ mem \ - ${_mfi} \ + mfi \ mii \ mlx \ ${_mly} \ mmc \ mmcsd \ - ${_mpt} \ + mpt \ mqueue \ msdosfs \ msdosfs_iconv \ @@ -252,7 +252,7 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ sf \ - ${_siba_bwn} \ + _siba_bwn \ siis \ sis \ sk \ @@ -321,12 +321,6 @@ _vpo= vpo .if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" # no BUS_SPACE_UNSPECIFIED -_bce= bce -_bwi= bwi -_bwn= bwn -_mfi= mfi -_mpt= mpt -_siba_bwn= siba_bwn # No barrier instruction support (specific to this driver) _sym= sym # no uart_cpu_$MACHINE_ARCH From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 20:12:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 997D41065674; Mon, 12 Apr 2010 20:12:50 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 540FF8FC18; Mon, 12 Apr 2010 20:12:50 +0000 (UTC) Received: by pwi9 with SMTP id 9so5286035pwi.13 for ; Mon, 12 Apr 2010 13:12:49 -0700 (PDT) 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:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lzLf+gE73PSofLC/iC4JNZgJsdpv3d5Ug9Ao0twLSR4=; b=vKFxWtBblEI+xZPtJvxFfoU/p9p9SrIjPVhAvTebEp39dzHHXrxOzBvFlQJG6Y5UVS wPDM3epY+HyAUpgxJghoOxjvgKlLtsZjh52zMVYzpIBYNBLO3hJXcy8M6VFeFIESqfcr bQ66n2nrz72GnoHHKtlquthwh1uqnD1SqcTJI= 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=cPxlFPHyreIX0SpmZrOxDuBUERjKtjqrM4udov6if/8UQhjhA9+4fI/IQ7OYpKcp6e 40lrLP1ijekZG9/zNYWYQve+oOTyEHMQmi2t7Qbcm6S76FlFcwOdngUu9azyajLGTFm3 NBgCsvmRlR/WP3tY1OwCXkr+VMyvjVw2faU7I= MIME-Version: 1.0 Received: by 10.231.213.16 with HTTP; Mon, 12 Apr 2010 13:12:45 -0700 (PDT) In-Reply-To: <201004121637.o3CGbjSK080066@svn.freebsd.org> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> Date: Mon, 12 Apr 2010 13:12:45 -0700 Received: by 10.141.15.4 with SMTP id s4mr1571256rvi.112.1271103165559; Mon, 12 Apr 2010 13:12:45 -0700 (PDT) Message-ID: From: Navdeep Parhar To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 20:12:50 -0000 On Mon, Apr 12, 2010 at 9:37 AM, Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 12 16:37:45 2010 > New Revision: 206497 > URL: http://svn.freebsd.org/changeset/base/206497 > > Log: > =A0Bring in geom_sched, support for scheduling disk I/O requests > =A0in a device independent manner. Also include an example anticipatory > =A0scheduler, gsched_rr, which gives very nice performance improvements > =A0in presence of competing random access patterns. > > =A0This is joint work with Fabio Checconi, developed last year > =A0and presented at BSDCan 2009. You can find details in the > =A0README file or at > > =A0http://info.iet.unipi.it/~luigi/geom_sched/ Doesn't build with "options KTR". cc1: warnings being treated as errors /usr/src/sys/modules/geom/geom_sched/gs_sched/../../../../geom/sched/g_sche= d.c: In function 'g_sched_issuer_pid': /usr/src/sys/modules/geom/geom_sched/gs_sched/../../../../geom/sched/g_sche= d.c:759: warning: implicit declaration of function 'g_sched_issuer' /usr/src/sys/modules/geom/geom_sched/gs_sched/../../../../geom/sched/g_sche= d.c:759: warning: nested extern declaration of 'g_sched_issuer' /usr/src/sys/modules/geom/geom_sched/gs_sched/../../../../geom/sched/g_sche= d.c:759: warning: initialization makes pointer from integer without a cast Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 20:49:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 588B21065670; Mon, 12 Apr 2010 20:49:33 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 8C13F8FC16; Mon, 12 Apr 2010 20:49:32 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 8E62E45F22; Mon, 12 Apr 2010 22:49:29 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4B9C445EE5; Mon, 12 Apr 2010 22:49:24 +0200 (CEST) Date: Mon, 12 Apr 2010 22:49:26 +0200 From: Pawel Jakub Dawidek To: Luigi Rizzo Message-ID: <20100412204926.GB1743@garage.freebsd.pl> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="24zk1gE8NUlDmwG9" Content-Disposition: inline In-Reply-To: <201004121637.o3CGbjSK080066@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 20:49:33 -0000 --24zk1gE8NUlDmwG9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 12, 2010 at 04:37:45PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 12 16:37:45 2010 > New Revision: 206497 > URL: http://svn.freebsd.org/changeset/base/206497 >=20 > Log: > Bring in geom_sched, support for scheduling disk I/O requests > in a device independent manner. Also include an example anticipatory > scheduler, gsched_rr, which gives very nice performance improvements > in presence of competing random access patterns. Nice work:) > Added: head/sbin/geom/class/sched/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/Makefile Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,19 @@ > +# GEOM_LIBRARY_PATH > +# $FreeBSD$ > + > +.PATH: /usr/src/sbin/geom/misc > + > +CFLAGS +=3D -I/usr/src/sbin/geom This doesn't look right. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --24zk1gE8NUlDmwG9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvDh1YACgkQForvXbEpPzS2EwCeKP8XHcrF0HrI/LdzVOAdbu1w DdYAn1NIxuo6+OGMhQNzBeXIb1ws5hlT =L+Jq -----END PGP SIGNATURE----- --24zk1gE8NUlDmwG9-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 20:54:51 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADB4106564A; Mon, 12 Apr 2010 20:54:51 +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 97B8E8FC08; Mon, 12 Apr 2010 20:54:50 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 77C21730A1; Mon, 12 Apr 2010 23:05:12 +0200 (CEST) Date: Mon, 12 Apr 2010 23:05:12 +0200 From: Luigi Rizzo To: Pawel Jakub Dawidek Message-ID: <20100412210512.GB94885@onelab2.iet.unipi.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100412204926.GB1743@garage.freebsd.pl> 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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 20:54:52 -0000 On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote: ... > > @@ -0,0 +1,19 @@ > > +# GEOM_LIBRARY_PATH > > +# $FreeBSD$ > > + > > +.PATH: /usr/src/sbin/geom/misc > > + > > +CFLAGS += -I/usr/src/sbin/geom > > This doesn't look right. probably a leftover from older versions of this code for 6.x . I will do more tests tomorrow (for 7.x at this point, there is no point in trying to support 6.x I believe) and try to remove it if not necessary. From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 21:03:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150851065705; Mon, 12 Apr 2010 21:03:00 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E02888FC25; Mon, 12 Apr 2010 21:02:58 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA04401; Tue, 13 Apr 2010 00:02:56 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1O1QmW-000Iu9-Cx; Tue, 13 Apr 2010 00:02:56 +0300 Message-ID: <4BC38A7F.4040003@freebsd.org> Date: Tue, 13 Apr 2010 00:02:55 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201004021522.o32FMNgu095467@svn.freebsd.org> In-Reply-To: <201004021522.o32FMNgu095467@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r206098 - head/sys/fs/msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 21:03:00 -0000 on 02/04/2010 18:22 Andriy Gapon said the following: > Author: avg > Date: Fri Apr 2 15:22:23 2010 > New Revision: 206098 > URL: http://svn.freebsd.org/changeset/base/206098 > > Log: > mountmsdosfs: reject too high value of bytes per cluster > > Bytes per cluster are calcuated as bytes per sector times sectors per > cluster. Too high value can overflow an internal variable with type > that can hold only values in valid range. Trying to use a wider type > results in an attempt to read more than MAXBSIZE at once, a panic. > Unfortunately, it is FreeBSD newfs_msdos that produces filesystems > with invalid parameters for certain types of media. Now that this change is MFC-ed I want to state for the record that I am not sure that this is the best or even correct fix. Couple of things are mixed here: 1. Constraint violation of original FAT spec with implied 512-byte sector size. 2. Violation of FreeBSD buffer cache limit on block size. The fix might be overly defensive. Perhaps msdos code needs to be taught how to properly handle bytes/cluster ratio greater than MAXBSIZE. Those two are not related and msdos code should know better than to make too large reads, it should split them in smaller reads of allowed size. > Reported by: Fabian Keil , > Paul B. Mahol > Discussed with: bde, kib > MFC after: 1 week > X-ToDo: fix newfs_msdos > > Modified: > head/sys/fs/msdosfs/msdosfs_vfsops.c > > Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c > ============================================================================== > --- head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Apr 2 15:12:31 2010 (r206097) > +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Apr 2 15:22:23 2010 (r206098) > @@ -580,6 +580,7 @@ mountmsdosfs(struct vnode *devvp, struct > || (pmp->pm_BytesPerSec & (pmp->pm_BytesPerSec - 1)) > || (pmp->pm_HugeSectors == 0) > || (pmp->pm_FATsecs == 0) > + || (SecPerClust * pmp->pm_BlkPerSec > MAXBSIZE / DEV_BSIZE) > ) { > error = EINVAL; > goto error_exit; -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 21:18:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D4801065676; Mon, 12 Apr 2010 21:18:28 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9568FC14; Mon, 12 Apr 2010 21:18:27 +0000 (UTC) Received: from [10.170.20.44] (nat-170-141-177-44.tn.gov [170.141.177.44]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id o3CLIPVx045336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Apr 2010 17:18:26 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) Message-ID: <4BC38E17.1040709@FreeBSD.org> Date: Mon, 12 Apr 2010 16:18:15 -0500 From: Robert Noland Organization: FreeBSD User-Agent: Thunderbird 2.0.0.19 (X11/20090218) MIME-Version: 1.0 To: Warner Losh References: <201004121828.o3CIS8Pt004711@svn.freebsd.org> In-Reply-To: <201004121828.o3CIS8Pt004711@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.1 required=5.0 tests=AWL, BAYES_00, FH_DATE_PAST_20XX, RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206501 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 21:18:28 -0000 Warner Losh wrote: > Author: imp > Date: Mon Apr 12 18:28:08 2010 > New Revision: 206501 > URL: http://svn.freebsd.org/changeset/base/206501 > > Log: > bce, bwi, bwn, mfi, mpt and siba_bwn all now compile that arm and mips > have added a BUS_SPACE_UNSPECIFIED definition. Add them back to the > mix on these platforms. > > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Mon Apr 12 17:44:42 2010 (r206500) > +++ head/sys/modules/Makefile Mon Apr 12 18:28:08 2010 (r206501) > @@ -35,15 +35,15 @@ SUBDIR= ${_3dfx} \ > ata \ > ath \ > ${_auxio} \ > - ${_bce} \ > + bce \ > bfe \ > bge \ > ${_bios} \ > ${_bktr} \ > ${_bm} \ > bridgestp \ > - ${_bwi} \ > - ${_bwn} \ > + bwi \ > + bwn \ > cam \ > ${_canbepm} \ > ${_canbus} \ > @@ -176,13 +176,13 @@ SUBDIR= ${_3dfx} \ > mcd \ > md \ > mem \ > - ${_mfi} \ > + mfi \ > mii \ > mlx \ > ${_mly} \ > mmc \ > mmcsd \ > - ${_mpt} \ > + mpt \ > mqueue \ > msdosfs \ > msdosfs_iconv \ > @@ -252,7 +252,7 @@ SUBDIR= ${_3dfx} \ > sdhci \ > sem \ > sf \ > - ${_siba_bwn} \ > + _siba_bwn \ This typo has broken the build. s/_siba_bwn/siba_bwn/ robert. > siis \ > sis \ > sk \ > @@ -321,12 +321,6 @@ _vpo= vpo > > .if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" > # no BUS_SPACE_UNSPECIFIED > -_bce= bce > -_bwi= bwi > -_bwn= bwn > -_mfi= mfi > -_mpt= mpt > -_siba_bwn= siba_bwn > # No barrier instruction support (specific to this driver) > _sym= sym > # no uart_cpu_$MACHINE_ARCH From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 21:33:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0FA61065673; Mon, 12 Apr 2010 21:33:06 +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 864198FC08; Mon, 12 Apr 2010 21:33: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 o3CLX6T5046814; Mon, 12 Apr 2010 21:33:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CLX69K046812; Mon, 12 Apr 2010 21:33:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004122133.o3CLX69K046812@svn.freebsd.org> From: Warner Losh Date: Mon, 12 Apr 2010 21:33: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: r206512 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 21:33:06 -0000 Author: imp Date: Mon Apr 12 21:33:06 2010 New Revision: 206512 URL: http://svn.freebsd.org/changeset/base/206512 Log: Doh! Last minute changes bites me in the butt.... Remove _ to make things build again. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Apr 12 21:29:04 2010 (r206511) +++ head/sys/modules/Makefile Mon Apr 12 21:33:06 2010 (r206512) @@ -252,7 +252,7 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ sf \ - _siba_bwn \ + siba_bwn \ siis \ sis \ sk \ From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 23:35:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607C81065674; Mon, 12 Apr 2010 23:35:58 +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 510B38FC15; Mon, 12 Apr 2010 23:35: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 o3CNZwbj075227; Mon, 12 Apr 2010 23:35:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CNZwNT075225; Mon, 12 Apr 2010 23:35:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004122335.o3CNZwNT075225@svn.freebsd.org> From: Warner Losh Date: Mon, 12 Apr 2010 23:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206530 - head/gnu/usr.bin/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 23:35:58 -0000 Author: imp Date: Mon Apr 12 23:35:58 2010 New Revision: 206530 URL: http://svn.freebsd.org/changeset/base/206530 Log: Simplify how we select which architectures to add gdbserver for. If the MD files exist, compile it, otherwise omit it. Modified: head/gnu/usr.bin/gdb/Makefile Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Mon Apr 12 23:22:32 2010 (r206529) +++ head/gnu/usr.bin/gdb/Makefile Mon Apr 12 23:35:58 2010 (r206530) @@ -3,8 +3,7 @@ SUBDIR= doc libgdb gdb gdbtui kgdb TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "arm" || \ - ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc" +.if exists(${.CURDIR}/gdbserver/reg-${TARGET_ARCH}.c) SUBDIR+=gdbserver .endif From owner-svn-src-head@FreeBSD.ORG Mon Apr 12 23:47:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FFD71065678; Mon, 12 Apr 2010 23:47:29 +0000 (UTC) (envelope-from sahil@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8105F8FC2E; Mon, 12 Apr 2010 23:47: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 o3CNlTMA077847; Mon, 12 Apr 2010 23:47:29 GMT (envelope-from sahil@svn.freebsd.org) Received: (from sahil@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CNlTtF077845; Mon, 12 Apr 2010 23:47:29 GMT (envelope-from sahil@svn.freebsd.org) Message-Id: <201004122347.o3CNlTtF077845@svn.freebsd.org> From: Sahil Tandon Date: Mon, 12 Apr 2010 23:47: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: r206532 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 23:47:29 -0000 Author: sahil (ports committer) Date: Mon Apr 12 23:47:29 2010 New Revision: 206532 URL: http://svn.freebsd.org/changeset/base/206532 Log: - Add an entry for myself to committers-ports.dot Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Apr 12 23:44:45 2010 (r206531) +++ head/share/misc/committers-ports.dot Mon Apr 12 23:47:29 2010 (r206532) @@ -140,6 +140,7 @@ rafan [label="Rong-En Fan\nrafan@FreeBSD rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] +sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"] sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n2003/10/21"] @@ -251,6 +252,7 @@ ijliao -> leeym itetcu -> araujo itetcu -> dryice +itetcu -> sahil joerg -> netchild @@ -360,6 +362,7 @@ tmclaugh -> xride will -> lioux +wxs -> sahil wxs -> skreuzer } From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 00:33:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D768E106566B; Tue, 13 Apr 2010 00:33:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C67708FC18; Tue, 13 Apr 2010 00:33: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 o3D0X74a088003; Tue, 13 Apr 2010 00:33:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D0X7r5087995; Tue, 13 Apr 2010 00:33:07 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004130033.o3D0X7r5087995@svn.freebsd.org> From: Ed Maste Date: Tue, 13 Apr 2010 00:33: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: r206534 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 00:33:07 -0000 Author: emaste Date: Tue Apr 13 00:33:07 2010 New Revision: 206534 URL: http://svn.freebsd.org/changeset/base/206534 Log: Whitespace cleanup, in advance of next sync with Adaptec's driver. No functional change. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aac_debug.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aac_pci.c head/sys/dev/aac/aacreg.h head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aac.c Tue Apr 13 00:33:07 2010 (r206534) @@ -2004,7 +2004,7 @@ aac_setup_intr(struct aac_softc *sc) } if (sc->flags & AAC_FLAGS_NEW_COMM) { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, NULL, + INTR_MPSAFE|INTR_TYPE_BIO, NULL, aac_new_intr, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, "can't set up interrupt\n"); return (EINVAL); Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aac_cam.c Tue Apr 13 00:33:07 2010 (r206534) @@ -395,7 +395,7 @@ aac_cam_action(struct cam_sim *sim, unio srb->cdb_len); /* Set command */ - fib->Header.Command = (sc->flags & AAC_FLAGS_SG_64BIT) ? + fib->Header.Command = (sc->flags & AAC_FLAGS_SG_64BIT) ? ScsiPortCommandU64 : ScsiPortCommand; /* Map the s/g list. XXX 32bit addresses only! */ @@ -512,7 +512,7 @@ aac_cam_complete(struct aac_command *cm) scsi_sense_len = sizeof(struct scsi_sense_data); bzero(&ccb->csio.sense_data, scsi_sense_len); - sense_len = (srbr->sense_len > + sense_len = (srbr->sense_len > scsi_sense_len) ? scsi_sense_len : srbr->sense_len; bcopy(&srbr->sense[0], &ccb->csio.sense_data, Modified: head/sys/dev/aac/aac_debug.c ============================================================================== --- head/sys/dev/aac/aac_debug.c Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aac_debug.c Tue Apr 13 00:33:07 2010 (r206534) @@ -62,62 +62,62 @@ aac_print_queues(struct aac_softc *sc) device_printf(sc->aac_dev, "FIB queue header at %p queues at %p\n", &sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][0], &sc->aac_queues->qt_HostNormCmdQueue[0]); - device_printf(sc->aac_dev, "HOST_NORM_CMD %d/%d (%d)\n", + device_printf(sc->aac_dev, "HOST_NORM_CMD %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][ - AAC_CONSUMER_INDEX], + AAC_CONSUMER_INDEX], AAC_HOST_NORM_CMD_ENTRIES); - device_printf(sc->aac_dev, "HOST_HIGH_CMD %d/%d (%d)\n", + device_printf(sc->aac_dev, "HOST_HIGH_CMD %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][ - AAC_CONSUMER_INDEX], + AAC_CONSUMER_INDEX], AAC_HOST_HIGH_CMD_ENTRIES); - device_printf(sc->aac_dev, "ADAP_NORM_CMD %d/%d (%d)\n", + device_printf(sc->aac_dev, "ADAP_NORM_CMD %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][ - AAC_CONSUMER_INDEX], + AAC_CONSUMER_INDEX], AAC_ADAP_NORM_CMD_ENTRIES); - device_printf(sc->aac_dev, "ADAP_HIGH_CMD %d/%d (%d)\n", + device_printf(sc->aac_dev, "ADAP_HIGH_CMD %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][ - AAC_CONSUMER_INDEX], + AAC_CONSUMER_INDEX], AAC_ADAP_HIGH_CMD_ENTRIES); - device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n", + device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][ AAC_CONSUMER_INDEX], AAC_HOST_NORM_RESP_ENTRIES); - device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n", + device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][ AAC_CONSUMER_INDEX], AAC_HOST_HIGH_RESP_ENTRIES); - device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n", + device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][ AAC_CONSUMER_INDEX], AAC_ADAP_NORM_RESP_ENTRIES); - device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n", + device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n", sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][ AAC_PRODUCER_INDEX], sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][ AAC_CONSUMER_INDEX], AAC_ADAP_HIGH_RESP_ENTRIES); - device_printf(sc->aac_dev, "AACQ_FREE %d/%d\n", + device_printf(sc->aac_dev, "AACQ_FREE %d/%d\n", sc->aac_qstat[AACQ_FREE].q_length, sc->aac_qstat[AACQ_FREE].q_max); - device_printf(sc->aac_dev, "AACQ_BIO %d/%d\n", + device_printf(sc->aac_dev, "AACQ_BIO %d/%d\n", sc->aac_qstat[AACQ_BIO].q_length, sc->aac_qstat[AACQ_BIO].q_max); - device_printf(sc->aac_dev, "AACQ_READY %d/%d\n", + device_printf(sc->aac_dev, "AACQ_READY %d/%d\n", sc->aac_qstat[AACQ_READY].q_length, sc->aac_qstat[AACQ_READY].q_max); - device_printf(sc->aac_dev, "AACQ_BUSY %d/%d\n", + device_printf(sc->aac_dev, "AACQ_BUSY %d/%d\n", sc->aac_qstat[AACQ_BUSY].q_length, sc->aac_qstat[AACQ_BUSY].q_max); } @@ -225,8 +225,8 @@ aac_print_fib(struct aac_softc *sc, stru if (br->Command == VM_CtBlockRead) { device_printf(sc->aac_dev, - " BlockRead: container %d 0x%x/%d\n", - br->ContainerId, br->BlockNumber, + " BlockRead: container %d 0x%x/%d\n", + br->ContainerId, br->BlockNumber, br->ByteCount); sg = &br->SgMap; } @@ -234,7 +234,7 @@ aac_print_fib(struct aac_softc *sc, stru device_printf(sc->aac_dev, " BlockWrite: container %d 0x%x/%d " "(%s)\n", bw->ContainerId, - bw->BlockNumber, bw->ByteCount, + bw->BlockNumber, bw->ByteCount, bw->Stable == CSTABLE ? "stable" : "unstable"); sg = &bw->SgMap; @@ -267,7 +267,7 @@ aac_print_aif(struct aac_softc *sc, stru device_printf(sc->aac_dev, "EventNotify(%d)\n", aif->seqNumber); switch(aif->data.EN.type) { case AifEnGeneric: /* Generic notification */ - device_printf(sc->aac_dev, "(Generic) %.*s\n", + device_printf(sc->aac_dev, "(Generic) %.*s\n", (int)sizeof(aif->data.EN.data.EG), aif->data.EN.data.EG.text); break; @@ -281,21 +281,21 @@ aac_print_aif(struct aac_softc *sc, stru case AifEnContainerChange: /* Adapter specific container * configuration change */ device_printf(sc->aac_dev, "(ContainerChange) " - "container %d,%d\n", - aif->data.EN.data.ECC.container[0], + "container %d,%d\n", + aif->data.EN.data.ECC.container[0], aif->data.EN.data.ECC.container[1]); break; case AifEnDeviceFailure: /* SCSI device failed */ device_printf(sc->aac_dev, "(DeviceFailure) " - "handle %d\n", + "handle %d\n", aif->data.EN.data.EDF.deviceHandle); break; case AifEnMirrorFailover: /* Mirror failover started */ device_printf(sc->aac_dev, "(MirrorFailover) " "container %d failed, " "migrating from slice %d to %d\n", - aif->data.EN.data.EMF.container, - aif->data.EN.data.EMF.failedSlice, + aif->data.EN.data.EMF.container, + aif->data.EN.data.EMF.failedSlice, aif->data.EN.data.EMF.creatingSlice); break; case AifEnContainerEvent: /* Significant container @@ -325,7 +325,7 @@ aac_print_aif(struct aac_softc *sc, stru device_printf(sc->aac_dev, "(EnclosureManagement) " "EMPID %d unit %d " "event %d\n", aif->data.EN.data.EEE.empID, - aif->data.EN.data.EEE.unitID, + aif->data.EN.data.EEE.unitID, aif->data.EN.data.EEE.eventType); break; case AifEnBatteryEvent: /* Significant NV battery @@ -348,14 +348,14 @@ aac_print_aif(struct aac_softc *sc, stru device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n"); break; case AifEnClusterEvent: /* Some cluster event */ - device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", + device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", aif->data.EN.data.ECLE.eventType); break; case AifEnDiskSetEvent: /* A disk set event occured. */ device_printf(sc->aac_dev, "(DiskSetEvent) event %d " "diskset %jd creator %jd\n", - aif->data.EN.data.EDS.eventType, - (intmax_t)aif->data.EN.data.EDS.DsNum, + aif->data.EN.data.EDS.eventType, + (intmax_t)aif->data.EN.data.EDS.DsNum, (intmax_t)aif->data.EN.data.EDS.CreatorId); break; case AifDenMorphComplete: /* A morph operation @@ -392,7 +392,7 @@ aac_print_aif(struct aac_softc *sc, stru } device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n", - aif->seqNumber, status, + aif->seqNumber, status, aif->data.PR[0].currentTick, aif->data.PR[0].finalTick); switch(aif->data.PR[0].jd.type) { @@ -418,12 +418,12 @@ aac_print_aif(struct aac_softc *sc, stru break; case AifJobCtrZero: /* Container clear operation */ device_printf(sc->aac_dev, - "(ContainerZero) container %d\n", + "(ContainerZero) container %d\n", aif->data.PR[0].jd.client.container.src); break; case AifJobCtrCopy: /* Container copy operation */ device_printf(sc->aac_dev, - "(ContainerCopy) container %d to %d\n", + "(ContainerCopy) container %d to %d\n", aif->data.PR[0].jd.client.container.src, aif->data.PR[0].jd.client.container.dst); break; @@ -456,12 +456,12 @@ aac_print_aif(struct aac_softc *sc, stru case AifJobCtrScrubRaid5: /* Container Scrub Raid5 * operation */ device_printf(sc->aac_dev, - "(ContainerScrubRaid5) container %d\n", + "(ContainerScrubRaid5) container %d\n", aif->data.PR[0].jd.client.container.src); break; case AifJobCtrMorph: /* Container morph operation */ device_printf(sc->aac_dev, - "(ContainerMorph) container %d\n", + "(ContainerMorph) container %d\n", aif->data.PR[0].jd.client.container.src); /* XXX two containers? */ break; @@ -476,13 +476,13 @@ aac_print_aif(struct aac_softc *sc, stru case AifJobCtrRebuildMirror: /* Container Rebuild Mirror * operation */ device_printf(sc->aac_dev, - "(ContainerRebuildMirror) container " + "(ContainerRebuildMirror) container " "%d\n", aif->data.PR[0].jd.client.container.src); break; case AifJobCtrCrazyCache: /* crazy cache */ device_printf(sc->aac_dev, - "(ContainerCrazyCache) container %d\n", + "(ContainerCrazyCache) container %d\n", aif->data.PR[0].jd.client.container.src); /* XXX two containers? */ break; Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aac_disk.c Tue Apr 13 00:33:07 2010 (r206534) @@ -87,7 +87,7 @@ DRIVER_MODULE(aacd, aac, aac_disk_driver /* * Handle open from generic layer. * - * This is called by the diskslice code on first open in order to get the + * This is called by the diskslice code on first open in order to get the * basic device geometry paramters. */ static int Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aac_pci.c Tue Apr 13 00:33:07 2010 (r206534) @@ -353,7 +353,7 @@ aac_pci_attach(device_t dev) /* assume failure is 'not configured' */ error = ENXIO; - /* + /* * Verify that the adapter is correctly set up in PCI space. */ command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); @@ -401,7 +401,7 @@ aac_pci_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for our PCI interface. - * + * * Note that some of these controllers are 64-bit capable. */ if (bus_dma_tag_create(NULL, /* parent */ @@ -419,7 +419,7 @@ aac_pci_attach(device_t dev) goto out; } - /* + /* * Detect the hardware interface version, set up the bus interface * indirection. */ Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aacreg.h Tue Apr 13 00:33:07 2010 (r206534) @@ -220,20 +220,20 @@ typedef enum { IsAdapterPaused = 704, SendHostTime = 705, RequestSupplementAdapterInfo = 706, /* Supp. Info for set in UCC - * use only if supported + * use only if supported * (RequestAdapterInfo first) */ LastMiscCommand = 707, - - OnLineDiagnostic = 800, - FduAdapterTest = 801, + + OnLineDiagnostic = 800, + FduAdapterTest = 801, RequestCompatibilityId = 802, AdapterEnvironmentInfo = 803, /* temp. sensors */ NvsramEventLog = 900, ResetNvsramEventLogPointers = 901, EnableEventLog = 902, DisableEventLog = 903, - EncryptedKeyTransportFIB= 904, - KeyableFeaturesFIB= 905 + EncryptedKeyTransportFIB= 904, + KeyableFeaturesFIB= 905 } AAC_FibCommands; /* @@ -283,7 +283,7 @@ typedef enum { #define AAC_ERROR_FIB_DEALLOCATION_FAILED 0x08 /* - * Adapter Init Structure: this is passed to the adapter with the + * Adapter Init Structure: this is passed to the adapter with the * AAC_MONKER_INITSTRUCT command to point it at our control structures. */ struct aac_adapter_init { @@ -329,14 +329,14 @@ typedef enum { CT_MORPH, CT_PASSTHRU, CT_RAID4, - CT_RAID10, /* stripe of mirror */ - CT_RAID00, /* stripe of stripe */ - CT_VOLUME_OF_MIRRORS, /* volume of mirror */ - CT_PSEUDO_RAID3, /* really raid4 */ - CT_RAID50, /* stripe of raid5 */ - CT_RAID5D, /* raid5 distributed hot-sparing */ + CT_RAID10, /* stripe of mirror */ + CT_RAID00, /* stripe of stripe */ + CT_VOLUME_OF_MIRRORS, /* volume of mirror */ + CT_PSEUDO_RAID3, /* really raid4 */ + CT_RAID50, /* stripe of raid5 */ + CT_RAID5D, /* raid5 distributed hot-sparing */ CT_RAID5D0, - CT_RAID1E, /* extended raid1 mirroring */ + CT_RAID1E, /* extended raid1 mirroring */ CT_RAID6, CT_RAID60, } AAC_FSAVolType; @@ -345,23 +345,23 @@ typedef enum { * Host-addressable object types */ typedef enum { - FT_REG = 1, /* regular file */ - FT_DIR, /* directory */ - FT_BLK, /* "block" device - reserved */ - FT_CHR, /* "character special" device - reserved */ - FT_LNK, /* symbolic link */ - FT_SOCK, /* socket */ - FT_FIFO, /* fifo */ - FT_FILESYS, /* ADAPTEC's "FSA"(tm) filesystem */ - FT_DRIVE, /* physical disk - addressable in scsi by b/t/l */ - FT_SLICE, /* virtual disk - raw volume - slice */ - FT_PARTITION, /* FSA partition - carved out of a slice - building + FT_REG = 1, /* regular file */ + FT_DIR, /* directory */ + FT_BLK, /* "block" device - reserved */ + FT_CHR, /* "character special" device - reserved */ + FT_LNK, /* symbolic link */ + FT_SOCK, /* socket */ + FT_FIFO, /* fifo */ + FT_FILESYS, /* ADAPTEC's "FSA"(tm) filesystem */ + FT_DRIVE, /* physical disk - addressable in scsi by b/t/l */ + FT_SLICE, /* virtual disk - raw volume - slice */ + FT_PARTITION, /* FSA partition - carved out of a slice - building * block for containers */ - FT_VOLUME, /* Container - Volume Set */ - FT_STRIPE, /* Container - Stripe Set */ - FT_MIRROR, /* Container - Mirror Set */ - FT_RAID5, /* Container - Raid 5 Set */ - FT_DATABASE /* Storage object with "foreign" content manager */ + FT_VOLUME, /* Container - Volume Set */ + FT_STRIPE, /* Container - Stripe Set */ + FT_MIRROR, /* Container - Mirror Set */ + FT_RAID5, /* Container - Raid 5 Set */ + FT_DATABASE /* Storage object with "foreign" content manager */ } AAC_FType; /* @@ -467,7 +467,7 @@ typedef enum { CPU_MIPS, CPU_XSCALE, CPU__last -} AAC_CpuType; +} AAC_CpuType; typedef enum { CPUI960_JX = 1, @@ -544,7 +544,7 @@ typedef enum { * XXX the aac-2622 with no battery present reports PLATFORM_BAT_OPT_PRESENT */ typedef enum -{ +{ PLATFORM_BAT_REQ_PRESENT = 1, /* BATTERY REQUIRED AND PRESENT */ PLATFORM_BAT_REQ_NOTPRESENT, /* BATTERY REQUIRED AND NOT PRESENT */ PLATFORM_BAT_OPT_PRESENT, /* BATTERY OPTIONAL AND PRESENT */ @@ -552,9 +552,9 @@ typedef enum PLATFORM_BAT_NOT_SUPPORTED /* BATTERY NOT SUPPORTED */ } AAC_BatteryPlatform; -/* +/* * options supported by this board - * there has to be a one to one mapping of these defines and the ones in + * there has to be a one to one mapping of these defines and the ones in * fsaapi.h, search for FSA_SUPPORT_SNAPSHOT */ #define AAC_SUPPORTED_SNAPSHOT 0x01 @@ -577,24 +577,24 @@ typedef enum #define AAC_SUPPORTED_64BIT_ARRAYSIZE 0x40000 #define AAC_SUPPORTED_HEAT_SENSOR 0x80000 -/* +/* * Structure used to respond to a RequestAdapterInfo fib. */ struct aac_adapter_info { - AAC_Platform PlatformBase; /* adapter type */ + AAC_Platform PlatformBase; /* adapter type */ AAC_CpuType CpuArchitecture; /* adapter CPU type */ - AAC_CpuSubType CpuVariant; /* adapter CPU subtype */ - u_int32_t ClockSpeed; /* adapter CPU clockspeed */ - u_int32_t ExecutionMem; /* adapter Execution Memory + AAC_CpuSubType CpuVariant; /* adapter CPU subtype */ + u_int32_t ClockSpeed; /* adapter CPU clockspeed */ + u_int32_t ExecutionMem; /* adapter Execution Memory * size */ - u_int32_t BufferMem; /* adapter Data Memory */ - u_int32_t TotalMem; /* adapter Total Memory */ + u_int32_t BufferMem; /* adapter Data Memory */ + u_int32_t TotalMem; /* adapter Total Memory */ struct FsaRevision KernelRevision; /* adapter Kernel Software * Revision */ struct FsaRevision MonitorRevision; /* adapter Monitor/Diagnostic * Software Revision */ struct FsaRevision HardwareRevision;/* TBD */ - struct FsaRevision BIOSRevision; /* adapter BIOS Revision */ + struct FsaRevision BIOSRevision; /* adapter BIOS Revision */ u_int32_t ClusteringEnabled; u_int32_t ClusterChannelMask; u_int64_t SerialNumber; @@ -604,7 +604,7 @@ struct aac_adapter_info { AAC_OemFlavor OemVariant; } __packed; -/* +/* * Structure used to respond to a RequestSupplementAdapterInfo fib. */ struct vpd_info { @@ -692,7 +692,7 @@ struct aac_supplement_adapter_info { #define AAC_KERNEL_PANIC 0x00000100 /* - * Data types relating to control and monitoring of the NVRAM/WriteCache + * Data types relating to control and monitoring of the NVRAM/WriteCache * subsystem. */ @@ -867,7 +867,7 @@ typedef enum { AifEnGeneric = 1, /* Generic notification */ AifEnTaskComplete, /* Task has completed */ AifEnConfigChange, /* Adapter config change occurred */ - AifEnContainerChange, /* Adapter specific container + AifEnContainerChange, /* Adapter specific container * configuration change */ AifEnDeviceFailure, /* SCSI device failed */ AifEnMirrorFailover, /* Mirror failover started */ @@ -881,7 +881,7 @@ typedef enum { AifEnBatteryEvent, /* Significant NV battery event */ AifEnAddContainer, /* A new container was created. */ AifEnDeleteContainer, /* A container was deleted. */ - AifEnSMARTEvent, /* SMART Event */ + AifEnSMARTEvent, /* SMART Event */ AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ AifEnDiskSetEvent, /* A disk set event occured. */ @@ -967,7 +967,7 @@ struct aac_AifEventNotify { /* * Adapter Initiated FIB command structures. Start with the adapter * initiated FIBs that really come from the adapter, and get responded - * to by the host. + * to by the host. */ #define AAC_AIF_REPORT_MAX_SIZE 64 @@ -1120,7 +1120,7 @@ typedef enum _VM_COMMANDS { VM_CtHostRead64, VM_CtHostWrite64, VM_DrvErrTblLog, /* drive error table/log type of command */ - VM_NameServe64 + VM_NameServe64 } AAC_VMCommand; /* @@ -1526,7 +1526,7 @@ enum { /* * The adapter can request the host print a message by setting the * DB_PRINTF flag in DOORBELL0. The driver responds by collecting the - * message from the printf buffer, clearing the DB_PRINTF flag in + * message from the printf buffer, clearing the DB_PRINTF flag in * DOORBELL0 and setting it in DOORBELL1. * (ODBR and IDBR respectively for the i960Rx adapters) */ Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Tue Apr 13 00:20:40 2010 (r206533) +++ head/sys/dev/aac/aacvar.h Tue Apr 13 00:33:07 2010 (r206534) @@ -56,7 +56,7 @@ */ /* - * The firmware interface allows for a 16-bit s/g list length. We limit + * The firmware interface allows for a 16-bit s/g list length. We limit * ourselves to a reasonable maximum and ensure alignment. */ #define AAC_MAXSGENTRIES 64 /* max S/G entries, limit 65535 */ @@ -78,7 +78,7 @@ #define AAC_PRINTF_BUFSIZE 256 /* - * We wait this many seconds for the adapter to come ready if it is still + * We wait this many seconds for the adapter to come ready if it is still * booting */ #define AAC_BOOT_TIMEOUT (3 * 60) @@ -126,7 +126,7 @@ struct aac_sim /* * Per-disk structure */ -struct aac_disk +struct aac_disk { device_t ad_dev; struct aac_softc *ad_controller; @@ -216,7 +216,7 @@ struct aac_common { AAC_QUEUE_ALIGN]; /* buffer for text messages from the controller */ - char ac_printf[AAC_PRINTF_BUFSIZE]; + char ac_printf[AAC_PRINTF_BUFSIZE]; /* fib for synchronous commands */ struct aac_fib ac_sync_fib; @@ -225,7 +225,7 @@ struct aac_common { /* * Interface operations */ -struct aac_interface +struct aac_interface { int (*aif_get_fwstatus)(struct aac_softc *sc); void (*aif_qnotify)(struct aac_softc *sc, int qbit); @@ -300,7 +300,7 @@ struct aac_fib_context { /* * Per-controller structure. */ -struct aac_softc +struct aac_softc { /* bus connections */ device_t aac_dev; @@ -347,7 +347,7 @@ struct aac_softc struct aac_command *aac_commands; /* command management */ - TAILQ_HEAD(,aac_command) aac_free; /* command structures + TAILQ_HEAD(,aac_command) aac_free; /* command structures * available for reuse */ TAILQ_HEAD(,aac_command) aac_ready; /* commands on hold for * controller resources */ @@ -416,7 +416,7 @@ struct aac_softc struct callout aac_daemontime; /* clock daemon callout */ - u_int32_t aac_max_fibs; /* max. FIB count */ + u_int32_t aac_max_fibs; /* max. FIB count */ u_int32_t aac_max_fibs_alloc; /* max. alloc. per alloc_commands() */ u_int32_t aac_max_fib_size; /* max. FIB size */ u_int32_t aac_sg_tablesize; /* max. sg count from host */ @@ -447,7 +447,7 @@ extern void aac_free(struct aac_softc * extern int aac_attach(struct aac_softc *sc); extern int aac_detach(device_t dev); extern int aac_shutdown(device_t dev); -extern int aac_suspend(device_t dev); +extern int aac_suspend(device_t dev); extern int aac_resume(device_t dev); extern void aac_new_intr(void *arg); extern int aac_filter(void *arg); @@ -561,7 +561,7 @@ aac_dequeue_ ## name (struct aac_softc * if ((cm = TAILQ_FIRST(&sc->aac_ ## name)) != NULL) { \ if ((cm->cm_flags & AAC_ON_ ## index) == 0) { \ printf("command %p not in queue, flags = %#x, " \ - "bit = %#x\n", cm, cm->cm_flags, \ + "bit = %#x\n", cm, cm->cm_flags, \ AAC_ON_ ## index); \ panic("command not in queue"); \ } \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 01:16:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70198106566B; Tue, 13 Apr 2010 01:16:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54CDC8FC14; Tue, 13 Apr 2010 01:16: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 o3D1GFng097819; Tue, 13 Apr 2010 01:16:15 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D1GFgQ097814; Tue, 13 Apr 2010 01:16:15 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004130116.o3D1GFgQ097814@svn.freebsd.org> From: Ed Maste Date: Tue, 13 Apr 2010 01:16: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: r206540 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 01:16:15 -0000 Author: emaste Date: Tue Apr 13 01:16:15 2010 New Revision: 206540 URL: http://svn.freebsd.org/changeset/base/206540 Log: Sync some minor items with the upstream driver. Should have no functional change. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_pci.c head/sys/dev/aac/aac_tables.h head/sys/dev/aac/aacreg.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Apr 13 01:04:11 2010 (r206539) +++ head/sys/dev/aac/aac.c Tue Apr 13 01:16:15 2010 (r206540) @@ -1880,7 +1880,7 @@ aac_init(struct aac_softc *sc) ip->InitFlags = 0; if (sc->flags & AAC_FLAGS_NEW_COMM) { - ip->InitFlags = INITFLAGS_NEW_COMM_SUPPORTED; + ip->InitFlags |= AAC_INITFLAGS_NEW_COMM_SUPPORTED; device_printf(sc->aac_dev, "New comm. interface enabled\n"); } Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Tue Apr 13 01:04:11 2010 (r206539) +++ head/sys/dev/aac/aac_pci.c Tue Apr 13 01:16:15 2010 (r206540) @@ -177,7 +177,7 @@ struct aac_ident {0x9005, 0x0285, 0x1014, 0x0312, AAC_HWIF_I960RX, 0, "IBM ServeRAID 8i"}, {0x9005, 0x0285, 0x9005, 0x0298, AAC_HWIF_I960RX, 0, - "Adaptec SAS RAID 4000SAS"}, + "Adaptec RAID 4000"}, {0x9005, 0x0285, 0x9005, 0x0299, AAC_HWIF_I960RX, 0, "Adaptec SAS RAID 4800SAS"}, {0x9005, 0x0285, 0x9005, 0x029a, AAC_HWIF_I960RX, 0, Modified: head/sys/dev/aac/aac_tables.h ============================================================================== --- head/sys/dev/aac/aac_tables.h Tue Apr 13 01:04:11 2010 (r206539) +++ head/sys/dev/aac/aac_tables.h Tue Apr 13 01:16:15 2010 (r206540) @@ -57,6 +57,7 @@ static struct aac_code_lookup aac_comman {"quota exceeded", 69}, {"stale file handle", 70}, {"too many levels of remote in path", 71}, + {"device busy (spinning up)", 72}, {"bad file handle", 10001}, {"not sync", 10002}, {"bad cookie", 10003}, @@ -68,6 +69,7 @@ static struct aac_code_lookup aac_comman {"not mounted", 10009}, {"in maintenance mode", 10010}, {"stale ACL", 10011}, + {"bus reset - command aborted", 20001}, {NULL, 0}, {"unknown command status", 0} }; Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Tue Apr 13 01:04:11 2010 (r206539) +++ head/sys/dev/aac/aacreg.h Tue Apr 13 01:16:15 2010 (r206540) @@ -306,7 +306,7 @@ struct aac_adapter_init { u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 u_int32_t MaxIoCommands; /* max outstanding commands */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ @@ -1081,6 +1081,7 @@ typedef enum { ST_DQUOT = 69, ST_STALE = 70, ST_REMOTE = 71, + ST_NOT_READY = 72, ST_BADHANDLE = 10001, ST_NOT_SYNC = 10002, ST_BAD_COOKIE = 10003, @@ -1091,7 +1092,8 @@ typedef enum { ST_JUKEBOX = 10008, ST_NOTMOUNTED = 10009, ST_MAINTMODE = 10010, - ST_STALEACL = 10011 + ST_STALEACL = 10011, + ST_BUS_RESET = 20001 } AAC_FSAStatus; /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 03:10:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1FC0106566C; Tue, 13 Apr 2010 03:10:38 +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 CDD9A8FC08; Tue, 13 Apr 2010 03:10: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 o3D3Ac4d023317; Tue, 13 Apr 2010 03:10:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D3Ac8G023315; Tue, 13 Apr 2010 03:10:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004130310.o3D3Ac8G023315@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 13 Apr 2010 03:10: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: r206541 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 03:10:39 -0000 Author: marcel Date: Tue Apr 13 03:10:38 2010 New Revision: 206541 URL: http://svn.freebsd.org/changeset/base/206541 Log: Sync up to SDM 2.2. Modified: head/sys/ia64/include/pal.h Modified: head/sys/ia64/include/pal.h ============================================================================== --- head/sys/ia64/include/pal.h Tue Apr 13 01:16:15 2010 (r206540) +++ head/sys/ia64/include/pal.h Tue Apr 13 03:10:38 2010 (r206541) @@ -54,11 +54,11 @@ #define PAL_VERSION 20 #define PAL_MC_CLEAR_LOG 21 #define PAL_MC_DRAIN 22 +#define PAL_MC_EXPECTED 23 #define PAL_MC_DYNAMIC_STATE 24 #define PAL_MC_ERROR_INFO 25 -#define PAL_MC_EXPECTED 23 +#define PAL_MC_RESUME 26 #define PAL_MC_REGISTER_MEM 27 -#define PAL_MC_RESUME 26 #define PAL_HALT 28 #define PAL_HALT_LIGHT 29 #define PAL_COPY_INFO 30 @@ -66,11 +66,16 @@ #define PAL_PMI_ENTRYPOINT 32 #define PAL_ENTER_IA_32_ENV 33 #define PAL_VM_PAGE_SIZE 34 -#define PAL_MEM_FOR_TEST 37 +#define PAL_TEST_INFO 37 #define PAL_CACHE_PROT_INFO 38 #define PAL_REGISTER_INFO 39 -#define PAL_SHUTDOWN 40 #define PAL_PREFETCH_VISIBILITY 41 +#define PAL_LOGICAL_TO_PHYSICAL 42 +#define PAL_CACHE_SHARED_INFO 43 +#define PAL_PSTATE_INFO 44 +#define PAL_SHUTDOWN 45 +#define PAL_GET_HW_POLICY 48 +#define PAL_SET_HW_POLICY 49 /* * Architected stacked calling convention procedures. @@ -81,6 +86,19 @@ #define PAL_CACHE_READ 259 #define PAL_CACHE_WRITE 260 #define PAL_VM_TR_READ 261 +#define PAL_GET_PSTATE 262 +#define PAL_SET_PSTATE 263 +#define PAL_VP_CREATE 265 +#define PAL_VP_ENV_INFO 266 +#define PAL_VP_EXIT_ENV 267 +#define PAL_VP_INIT_ENV 268 +#define PAL_VP_REGISTER 269 +#define PAL_VP_RESTORE 270 +#define PAL_VP_SAVE 271 +#define PAL_VP_TERMINATE 272 +#define PAL_BRAND_INFO 274 +#define PAL_MC_ERROR_INJECT 276 +#define PAL_MEMORY_BUFFER 277 /* * Default physical address of the Processor Interrupt Block (PIB). From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 06:27:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61211065672; Tue, 13 Apr 2010 06:27:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BC18FC08; Tue, 13 Apr 2010 06:27: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 o3D6R2R5066730; Tue, 13 Apr 2010 06:27:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D6R28c066727; Tue, 13 Apr 2010 06:27:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201004130627.o3D6R28c066727@svn.freebsd.org> From: Kevin Lo Date: Tue, 13 Apr 2010 06:27: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: r206544 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 06:27:02 -0000 Author: kevlo Date: Tue Apr 13 06:27:02 2010 New Revision: 206544 URL: http://svn.freebsd.org/changeset/base/206544 Log: The Quanta Q101 modem has a different type of cdrom driver disk, add the product id and use a standard scsi eject. Reviewed by: thompsa MFC after: 3 days 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 Tue Apr 13 06:05:15 2010 (r206543) +++ head/sys/dev/usb/serial/u3g.c Tue Apr 13 06:27:02 2010 (r206544) @@ -501,6 +501,7 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO), U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR), U3G_DEV(QUALCOMMINC, ZTE_STOR2, U3GINIT_SCSIEJECT), + U3G_DEV(QUANTA, Q101_STOR, U3GINIT_SCSIEJECT), U3G_DEV(SIERRA, TRUINSTALL, U3GINIT_SIERRA), #undef U3G_DEV }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Apr 13 06:05:15 2010 (r206543) +++ head/sys/dev/usb/usbdevs Tue Apr 13 06:27:02 2010 (r206544) @@ -2519,6 +2519,7 @@ product QUALCOMMINC E2003 0x2003 3G mode /* Quanta products */ product QUANTA RW6815_1 0x00ce HP iPAQ rw6815 product QUANTA RT3070 0x0304 RT3070 +product QUANTA Q101_STOR 0x1000 USB Q101 Storage product QUANTA Q101 0xea02 HSDPA modem product QUANTA Q111 0xea03 HSDPA modem product QUANTA GLX 0xea04 HSDPA modem From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 06:48:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C29106564A; Tue, 13 Apr 2010 06:48:37 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D368FC0C; Tue, 13 Apr 2010 06:48: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 o3D6mbTS071597; Tue, 13 Apr 2010 06:48:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D6mbX7071595; Tue, 13 Apr 2010 06:48:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004130648.o3D6mbX7071595@svn.freebsd.org> From: Alan Cox Date: Tue, 13 Apr 2010 06:48: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: r206545 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 06:48:37 -0000 Author: alc Date: Tue Apr 13 06:48:37 2010 New Revision: 206545 URL: http://svn.freebsd.org/changeset/base/206545 Log: Simplify vm_thread_swapin(). Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Apr 13 06:27:02 2010 (r206544) +++ head/sys/vm/vm_glue.c Tue Apr 13 06:48:37 2010 (r206545) @@ -536,7 +536,8 @@ vm_thread_swapin(struct thread *td) ksobj = td->td_kstack_obj; VM_OBJECT_LOCK(ksobj); for (i = 0; i < pages; i++) { - m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + VM_ALLOC_WIRED); if (m->valid != VM_PAGE_BITS_ALL) { rv = vm_pager_get_pages(ksobj, &m, 1, 0); if (rv != VM_PAGER_OK) @@ -544,9 +545,6 @@ vm_thread_swapin(struct thread *td) m = vm_page_lookup(ksobj, i); } ma[i] = m; - vm_page_lock_queues(); - vm_page_wire(m); - vm_page_unlock_queues(); vm_page_wakeup(m); } VM_OBJECT_UNLOCK(ksobj); From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 08:45:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DB9106566B; Tue, 13 Apr 2010 08:45:55 +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 95A5D8FC0A; Tue, 13 Apr 2010 08:45: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 o3D8jttH097469; Tue, 13 Apr 2010 08:45:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D8jt4n097467; Tue, 13 Apr 2010 08:45:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004130845.o3D8jt4n097467@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Apr 2010 08:45: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: r206546 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 08:45:55 -0000 Author: kib Date: Tue Apr 13 08:45:55 2010 New Revision: 206546 URL: http://svn.freebsd.org/changeset/base/206546 Log: Remove XXX comment. Add another comment, describing why f_vnode assignment is useful. MFC after: 3 days Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Apr 13 06:48:37 2010 (r206545) +++ head/sys/kern/vfs_syscalls.c Tue Apr 13 08:45:55 2010 (r206546) @@ -1124,7 +1124,12 @@ kern_openat(struct thread *td, int fd, c NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - fp->f_vnode = vp; /* XXX Does devfs need this? */ + /* + * Store the vnode, for any f_type. Typically, the vnode use + * count is decremented by direct call to vn_closefile() for + * files that switched type in the cdevsw fdopen() method. + */ + fp->f_vnode = vp; /* * If the file wasn't claimed by devfs bind it to the normal * vnode operations here. From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 08:52:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E065106564A; Tue, 13 Apr 2010 08:52:20 +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 8D2228FC0C; Tue, 13 Apr 2010 08:52: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 o3D8qKb6098938; Tue, 13 Apr 2010 08:52:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D8qKNd098936; Tue, 13 Apr 2010 08:52:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004130852.o3D8qKNd098936@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Apr 2010 08:52: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: r206547 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 08:52:20 -0000 Author: kib Date: Tue Apr 13 08:52:20 2010 New Revision: 206547 URL: http://svn.freebsd.org/changeset/base/206547 Log: Handle a case in kern_openat() when vn_open() change file type from DTYPE_VNODE. Only acquire locks for O_EXLOCK/O_SHLOCK if file type is still vnode, since we allow for fcntl(2) to process with advisory locks for DTYPE_VNODE only. Another reason is that all fo_close() routines need to check and release locks otherwise. For O_TRUNC, call fo_truncate() instead of truncating the vnode. Discussed with: rwatson MFC after: 2 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Apr 13 08:45:55 2010 (r206546) +++ head/sys/kern/vfs_syscalls.c Tue Apr 13 08:52:20 2010 (r206547) @@ -1047,8 +1047,6 @@ kern_openat(struct thread *td, int fd, c struct filedesc *fdp = p->p_fd; struct file *fp; struct vnode *vp; - struct vattr vat; - struct mount *mp; int cmode; struct file *nfp; int type, indx, error; @@ -1141,7 +1139,7 @@ kern_openat(struct thread *td, int fd, c } VOP_UNLOCK(vp, 0); - if (flags & (O_EXLOCK | O_SHLOCK)) { + if (fp->f_type == DTYPE_VNODE && (flags & (O_EXLOCK | O_SHLOCK)) != 0) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -1158,18 +1156,7 @@ kern_openat(struct thread *td, int fd, c atomic_set_int(&fp->f_flag, FHASLOCK); } if (flags & O_TRUNC) { - if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) - goto bad; - VATTR_NULL(&vat); - vat.va_size = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); -#ifdef MAC - error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_SETATTR(vp, &vat, td->td_ucred); - VOP_UNLOCK(vp, 0); - vn_finished_write(mp); + error = fo_truncate(fp, 0, td->td_ucred, td); if (error) goto bad; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 08:54:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509DE106566C; Tue, 13 Apr 2010 08:54:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC518FC17; Tue, 13 Apr 2010 08:54: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 o3D8ssjl099531; Tue, 13 Apr 2010 08:54:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D8ssgC099529; Tue, 13 Apr 2010 08:54:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004130854.o3D8ssgC099529@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Apr 2010 08:54: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: r206548 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 08:54:54 -0000 Author: kib Date: Tue Apr 13 08:54:53 2010 New Revision: 206548 URL: http://svn.freebsd.org/changeset/base/206548 Log: Update the list of the process flags for P_WKILLED. MFC after: 4 weeks Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Apr 13 08:52:20 2010 (r206547) +++ head/bin/ps/ps.1 Tue Apr 13 08:54:53 2010 (r206548) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 17, 2010 +.Dd April 13, 2010 .Dt PS 1 .Os .Sh NAME @@ -298,6 +298,7 @@ the include file .It Dv "P_WAITED" Ta No "0x01000 Someone is waiting for us" .It Dv "P_WEXIT" Ta No "0x02000 Working on exiting" .It Dv "P_EXEC" Ta No "0x04000 Process called exec" +.It Dv "P_WKILLED" Ta No "0x08000 Killed, shall go to kernel/user boundary ASAP" .It Dv "P_CONTINUED" Ta No "0x10000 Proc has continued from a stopped state" .It Dv "P_STOPPED_SIG" Ta No "0x20000 Stopped due to SIGSTOP/SIGTSTP" .It Dv "P_STOPPED_TRACE" Ta No "0x40000 Stopped because of tracing" From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 08:56:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64741065675; Tue, 13 Apr 2010 08:56:03 +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 AF89F8FC13; Tue, 13 Apr 2010 08:56:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3D8u3g6099847; Tue, 13 Apr 2010 08:56:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D8u3Nr099845; Tue, 13 Apr 2010 08:56:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004130856.o3D8u3Nr099845@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Apr 2010 08:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206549 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 08:56:03 -0000 Author: kib Date: Tue Apr 13 08:56:03 2010 New Revision: 206549 URL: http://svn.freebsd.org/changeset/base/206549 Log: Align the declaration for sa_sigaction with POSIX. MFC after: 3 days Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Tue Apr 13 08:54:53 2010 (r206548) +++ head/lib/libc/sys/sigaction.2 Tue Apr 13 08:56:03 2010 (r206549) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd June 7, 2004 +.Dd April 13, 2010 .Dt SIGACTION 2 .Os .Sh NAME @@ -42,7 +42,7 @@ struct sigaction { union { void (*__sa_handler)(int); - void (*__sa_sigaction)(int, struct __siginfo *, void *); + void (*__sa_sigaction)(int, siginfo_t *, void *); } __sigaction_u; /* signal handler */ int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 09:18:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86CA4106564A; Tue, 13 Apr 2010 09:18:54 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6D58FC24; Tue, 13 Apr 2010 09:18:53 +0000 (UTC) Received: by bwz8 with SMTP id 8so3950864bwz.3 for ; Tue, 13 Apr 2010 02:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=tHma7y76gWkRATNNSjSnj9ZUq+TQNOwPzJLs+5hPdBM=; b=PaHvgntbnJ2uYIVFHiC+XK5sjyFcKDdjD+wxH7ycfMfkXbWX1aktxKrgvLL2S5b3Mj 1tc7VYH/BHVdrjbr+jNoL7mY3sHxo3KJOMnRigvvods5Ier9q6gGe9I2ctcBUVVLw4kc M76HjG+zpzV6t0Y/mDRPykGvy1dLnUiqKvT1k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=bQlApyOwoNw7sC63La3wqfEMhBGENu0RxD11spC933VdvgG7iRMZ7AICz4rFsqLQaN PSi515h2jlQsoNkf+U/BAWzTUQ+YyAmqFC/Y76EVGZteIcuIaYUyPh5o1t3PQSrBN/f3 j7GMRjkr02SQkTPUlZRO35r7NZI0P58sJNBFA= Received: by 10.103.85.17 with SMTP id n17mr2854380mul.50.1271150332051; Tue, 13 Apr 2010 02:18:52 -0700 (PDT) Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id b9sm22029756mug.13.2010.04.13.02.18.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Apr 2010 02:18:49 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <20100412210512.GB94885@onelab2.iet.unipi.it> Date: Tue, 13 Apr 2010 10:18:48 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <445CC969-4E21-4EA8-BE19-1754F4B2C583@freebsd.org> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> To: Luigi Rizzo X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 09:18:54 -0000 On 12 Apr 2010, at 22:05, Luigi Rizzo wrote: > On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote: > ... >>> @@ -0,0 +1,19 @@ >>> +# GEOM_LIBRARY_PATH >>> +# $FreeBSD$ >>> + >>> +.PATH: /usr/src/sbin/geom/misc >>> + >>> +CFLAGS +=3D -I/usr/src/sbin/geom >>=20 >> This doesn't look right. >=20 > probably a leftover from older versions of this code for 6.x . > I will do more tests tomorrow (for 7.x at this point, there is > no point in trying to support 6.x I believe) and try to remove > it if not necessary. Even if you need geom/misc, this is not the correct way to include it. M=3D ${.CURDIR}/../../misc .PATH: ${M} CFLAGS+=3D-I${M} is probably what you want. There are many people out there (me included) = that don't use /usr/src. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 09:52:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFE4D106564A; Tue, 13 Apr 2010 09:52: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 AED838FC1C; Tue, 13 Apr 2010 09:52: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 o3D9qgiB012415; Tue, 13 Apr 2010 09:52:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D9qgJs012413; Tue, 13 Apr 2010 09:52:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004130952.o3D9qgJs012413@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Apr 2010 09:52: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: r206550 - head/sbin/geom/class/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 09:52:42 -0000 Author: luigi Date: Tue Apr 13 09:52:42 2010 New Revision: 206550 URL: http://svn.freebsd.org/changeset/base/206550 Log: use correct .PATH, remove unused CFLAGS Modified: head/sbin/geom/class/sched/Makefile Modified: head/sbin/geom/class/sched/Makefile ============================================================================== --- head/sbin/geom/class/sched/Makefile Tue Apr 13 08:56:03 2010 (r206549) +++ head/sbin/geom/class/sched/Makefile Tue Apr 13 09:52:42 2010 (r206550) @@ -1,9 +1,8 @@ # GEOM_LIBRARY_PATH # $FreeBSD$ -.PATH: /usr/src/sbin/geom/misc - -CFLAGS += -I/usr/src/sbin/geom +.PATH: ${.CURDIR}/../../misc +#CFLAGS += -I/usr/src/sbin/geom CLASS=sched From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 09:53:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB3310657C0; Tue, 13 Apr 2010 09:53:08 +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 BBE908FC24; Tue, 13 Apr 2010 09:53: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 o3D9r8VC012554; Tue, 13 Apr 2010 09:53:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D9r8r0012552; Tue, 13 Apr 2010 09:53:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004130953.o3D9r8r0012552@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Apr 2010 09:53: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: r206551 - head/sys/geom/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 09:53:08 -0000 Author: luigi Date: Tue Apr 13 09:53:08 2010 New Revision: 206551 URL: http://svn.freebsd.org/changeset/base/206551 Log: make code compile with KTR Modified: head/sys/geom/sched/g_sched.c Modified: head/sys/geom/sched/g_sched.c ============================================================================== --- head/sys/geom/sched/g_sched.c Tue Apr 13 09:52:42 2010 (r206550) +++ head/sys/geom/sched/g_sched.c Tue Apr 13 09:53:08 2010 (r206551) @@ -753,13 +753,6 @@ g_gsched_modevent(module_t mod, int cmd, #ifdef KTR #define TRC_BIO_EVENT(e, bp) g_sched_trace_bio_ ## e (bp) -static inline int -g_sched_issuer_pid(struct bio *bp) -{ - struct thread *thread = g_sched_issuer(bp); - - return (thread->td_tid); -} static inline char g_sched_type(struct bio *bp) @@ -776,7 +769,7 @@ static inline void g_sched_trace_bio_START(struct bio *bp) { - CTR5(KTR_GSCHED, "S %d %c %lu/%lu %lu", g_sched_issuer_pid(bp), + CTR5(KTR_GSCHED, "S %lu %c %lu/%lu %lu", g_sched_classify(bp), g_sched_type(bp), bp->bio_offset / ULONG_MAX, bp->bio_offset, bp->bio_length); } @@ -785,13 +778,13 @@ static inline void g_sched_trace_bio_DONE(struct bio *bp) { - CTR5(KTR_GSCHED, "D %d %c %lu/%lu %lu", g_sched_issuer_pid(bp), + CTR5(KTR_GSCHED, "D %lu %c %lu/%lu %lu", g_sched_classify(bp), g_sched_type(bp), bp->bio_offset / ULONG_MAX, bp->bio_offset, bp->bio_length); } -#else +#else /* !KTR */ #define TRC_BIO_EVENT(e, bp) -#endif +#endif /* !KTR */ /* * g_sched_done() and g_sched_start() dispatch the geom requests to From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 09:56:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D341065670; Tue, 13 Apr 2010 09:56:17 +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 5EEFB8FC19; Tue, 13 Apr 2010 09:56: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 o3D9uHwj013299; Tue, 13 Apr 2010 09:56:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3D9uHQU013292; Tue, 13 Apr 2010 09:56:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004130956.o3D9uHQU013292@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Apr 2010 09:56: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: r206552 - in head: sbin/geom/class/sched sys/geom/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 09:56:17 -0000 Author: luigi Date: Tue Apr 13 09:56:17 2010 New Revision: 206552 URL: http://svn.freebsd.org/changeset/base/206552 Log: fix copyright format, as requested by Joel Dahl Modified: head/sbin/geom/class/sched/geom_sched.c head/sbin/geom/class/sched/gsched.8 head/sys/geom/sched/g_sched.c head/sys/geom/sched/g_sched.h head/sys/geom/sched/gs_rr.c head/sys/geom/sched/gs_scheduler.h Modified: head/sbin/geom/class/sched/geom_sched.c ============================================================================== --- head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:53:08 2010 (r206551) +++ head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009 Fabio Checconi + * Copyright (c) 2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sbin/geom/class/sched/gsched.8 ============================================================================== --- head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:53:08 2010 (r206551) +++ head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:56:17 2010 (r206552) @@ -1,6 +1,6 @@ -.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo +.\" Copyright (c) 2009-2010 Fabio Checconi +.\" Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa .\" All rights reserved. -.\" $FreeBSD$ .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,6 +23,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" +.\" $FreeBSD$ +.\" .Dd April 12, 2010 .Dt GSCHED 8 .Os Modified: head/sys/geom/sched/g_sched.c ============================================================================== --- head/sys/geom/sched/g_sched.c Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/g_sched.c Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/g_sched.h ============================================================================== --- head/sys/geom/sched/g_sched.h Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/g_sched.h Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/gs_rr.c ============================================================================== --- head/sys/geom/sched/gs_rr.c Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/gs_rr.c Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/sched/gs_scheduler.h ============================================================================== --- head/sys/geom/sched/gs_scheduler.h Tue Apr 13 09:53:08 2010 (r206551) +++ head/sys/geom/sched/gs_scheduler.h Tue Apr 13 09:56:17 2010 (r206552) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 10:12:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D655106564A; Tue, 13 Apr 2010 10:12:59 +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 1ADD88FC21; Tue, 13 Apr 2010 10:12: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 o3DACwbj017107; Tue, 13 Apr 2010 10:12:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DACwMq017101; Tue, 13 Apr 2010 10:12:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004131012.o3DACwMq017101@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Apr 2010 10:12: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: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 10:12:59 -0000 Author: kib Date: Tue Apr 13 10:12:58 2010 New Revision: 206553 URL: http://svn.freebsd.org/changeset/base/206553 Log: Change printf() calls to uprintf() for sigreturn() and trap() complaints about inacessible or wrong mcontext, and for dreaded "kernel trap with interrupts disabled" situation. The later is changed when trap is generated from user mode (shall never be ?). Normalize the messages to include both pid and thread name. MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/amd64/amd64/machdep.c Tue Apr 13 10:12:58 2010 (r206553) @@ -424,13 +424,14 @@ sigreturn(td, uap) error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) { - printf("sigreturn (pid %d): copyin failed\n", p->p_pid); + uprintf("pid %d (%s): sigreturn copyin failed\n", + p->p_pid, td->td_name); return (error); } ucp = &uc; if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) { - printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid, - ucp->uc_mcontext.mc_flags); + uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid, + td->td_name, ucp->uc_mcontext.mc_flags); return (EINVAL); } regs = td->td_frame; @@ -449,8 +450,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid, - rflags); + uprintf("pid %d (%s): sigreturn rflags = 0x%lx\n", p->p_pid, + td->td_name, rflags); return (EINVAL); } @@ -461,7 +462,8 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", p->p_pid, + td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -473,7 +475,8 @@ sigreturn(td, uap) ret = set_fpcontext(td, &ucp->uc_mcontext); if (ret != 0) { - printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid); + uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n", + p->p_pid, td->td_name, ret); return (ret); } bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs)); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/amd64/amd64/trap.c Tue Apr 13 10:12:58 2010 (r206553) @@ -303,7 +303,7 @@ trap(struct trapframe *frame) * enabled later. */ if (ISPL(frame->tf_cs) == SEL_UPL) - printf( + uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); else if (type != T_NMI && type != T_BPTFLT && Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/amd64/ia32/ia32_signal.c Tue Apr 13 10:12:58 2010 (r206553) @@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -576,7 +577,8 @@ freebsd4_freebsd32_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("freebsd4_sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd32_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -658,7 +661,8 @@ freebsd32_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/i386/i386/machdep.c Tue Apr 13 10:12:58 2010 (r206553) @@ -944,7 +944,8 @@ freebsd4_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("freebsd4_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -955,7 +956,8 @@ freebsd4_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("freebsd4_sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -1056,7 +1058,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -1067,7 +1070,8 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Tue Apr 13 09:56:17 2010 (r206552) +++ head/sys/i386/i386/trap.c Tue Apr 13 10:12:58 2010 (r206553) @@ -277,7 +277,7 @@ trap(struct trapframe *frame) * enabled later. */ if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM)) - printf( + uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); else if (type != T_BPTFLT && type != T_TRCTRAP && @@ -507,7 +507,7 @@ trap(struct trapframe *frame) if (npxdna()) goto userout; #endif - printf("pid %d killed due to lack of floating point\n", + uprintf("pid %d killed due to lack of floating point\n", p->p_pid); i = SIGKILL; ucode = 0; From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 10:20:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 598C3106566B; Tue, 13 Apr 2010 10:20:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C30278FC1E; Tue, 13 Apr 2010 10:20:48 +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 o3DAKiql090947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Apr 2010 13:20:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3DAKh3S059700; Tue, 13 Apr 2010 13:20:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3DAKhuj059699; Tue, 13 Apr 2010 13:20:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Apr 2010 13:20:43 +0300 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100413102043.GF2415@deviant.kiev.zoral.com.ua> References: <201004131012.o3DACwMq017101@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1uCEzVPnDDIqSP+G" Content-Disposition: inline In-Reply-To: <201004131012.o3DACwMq017101@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=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 10:20:49 -0000 --1uCEzVPnDDIqSP+G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 13, 2010 at 10:12:58AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Apr 13 10:12:58 2010 > New Revision: 206553 > URL: http://svn.freebsd.org/changeset/base/206553 >=20 > Log: > Change printf() calls to uprintf() for sigreturn() and trap() complaints > about inacessible or wrong mcontext, and for dreaded "kernel trap with > interrupts disabled" situation. The later is changed when trap is > generated from user mode (shall never be ?). > =20 > Normalize the messages to include both pid and thread name. > =20 > MFC after: 1 week I think that printfs from sigreturn should be changed to signal delivery or even a call to trap_fatal(), but this is for other commit. Anyway, the current situation where messages could be found in daily periodic run (sigreturn pid 23334: cs=3D0xffff, so what ? pid is long time gone) is not very useful for noting the issue. --1uCEzVPnDDIqSP+G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvERXsACgkQC3+MBN1Mb4jjvgCeKgN7fJ5msD1niDo7W/mw+Z5a 1v8AoIEODNBD2WRAzjg50U4JWAUSFx1A =jfmE -----END PGP SIGNATURE----- --1uCEzVPnDDIqSP+G-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 12:10:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39EA1065670; Tue, 13 Apr 2010 12:10:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D95518FC0C; Tue, 13 Apr 2010 12:10: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 o3DCAtE9044794; Tue, 13 Apr 2010 12:10:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DCAtFF044792; Tue, 13 Apr 2010 12:10:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004131210.o3DCAtFF044792@svn.freebsd.org> From: Ed Maste Date: Tue, 13 Apr 2010 12:10: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: r206555 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 12:10:56 -0000 Author: emaste Date: Tue Apr 13 12:10:55 2010 New Revision: 206555 URL: http://svn.freebsd.org/changeset/base/206555 Log: Use enums in the aac_command_status_table rather than duplicating the same values in two places. Suggested by: Garrett Cooper Modified: head/sys/dev/aac/aac_tables.h Modified: head/sys/dev/aac/aac_tables.h ============================================================================== --- head/sys/dev/aac/aac_tables.h Tue Apr 13 10:23:03 2010 (r206554) +++ head/sys/dev/aac/aac_tables.h Tue Apr 13 12:10:55 2010 (r206555) @@ -34,42 +34,42 @@ * relevant only to FSA operations. */ static struct aac_code_lookup aac_command_status_table[] = { - {"OK", 0}, - {"operation not permitted", 1}, - {"not found", 2}, - {"I/O error", 5}, - {"device not configured", 6}, - {"too big", 7}, - {"permission denied", 13}, - {"file exists", 17}, - {"cross-device link", 18}, - {"operation not supported by device", 19}, - {"not a directory", 20}, - {"is a directory", 21}, - {"invalid argument", 22}, - {"file too large", 27}, - {"no space on device", 28}, - {"readonly filesystem", 30}, - {"too many links", 31}, - {"operation would block", 35}, - {"file name too long", 63}, - {"directory not empty", 66}, - {"quota exceeded", 69}, - {"stale file handle", 70}, - {"too many levels of remote in path", 71}, - {"device busy (spinning up)", 72}, - {"bad file handle", 10001}, - {"not sync", 10002}, - {"bad cookie", 10003}, - {"operation not supported", 10004}, - {"too small", 10005}, - {"server fault", 10006}, - {"bad type", 10007}, - {"jukebox", 10008}, - {"not mounted", 10009}, - {"in maintenance mode", 10010}, - {"stale ACL", 10011}, - {"bus reset - command aborted", 20001}, + {"OK", ST_OK}, + {"operation not permitted", ST_PERM}, + {"not found", ST_NOENT}, + {"I/O error", ST_IO}, + {"device not configured", ST_NXIO}, + {"too big", ST_E2BIG}, + {"permission denied", ST_ACCES}, + {"file exists", ST_EXIST}, + {"cross-device link", ST_XDEV}, + {"operation not supported by device", ST_NODEV}, + {"not a directory", ST_NOTDIR}, + {"is a directory", ST_ISDIR}, + {"invalid argument", ST_INVAL}, + {"file too large", ST_FBIG}, + {"no space on device", ST_NOSPC}, + {"readonly filesystem", ST_ROFS}, + {"too many links", ST_MLINK}, + {"operation would block", ST_WOULDBLOCK}, + {"file name too long", ST_NAMETOOLONG}, + {"directory not empty", ST_NOTEMPTY}, + {"quota exceeded", ST_DQUOT}, + {"stale file handle", ST_STALE}, + {"too many levels of remote in path", ST_REMOTE}, + {"device busy (spinning up)", ST_NOT_READY}, + {"bad file handle", ST_BADHANDLE}, + {"not sync", ST_NOT_SYNC}, + {"bad cookie", ST_BAD_COOKIE}, + {"operation not supported", ST_NOTSUPP}, + {"too small", ST_TOOSMALL}, + {"server fault", ST_SERVERFAULT}, + {"bad type", ST_BADTYPE}, + {"jukebox", ST_JUKEBOX}, + {"not mounted", ST_NOTMOUNTED}, + {"in maintenance mode", ST_MAINTMODE}, + {"stale ACL", ST_STALEACL}, + {"bus reset - command aborted", ST_BUS_RESET}, {NULL, 0}, {"unknown command status", 0} }; From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 15:51:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA871065672; Tue, 13 Apr 2010 15:51:26 +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 2A8038FC0A; Tue, 13 Apr 2010 15:51: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 o3DFpQpb094517; Tue, 13 Apr 2010 15:51:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DFpQGP094501; Tue, 13 Apr 2010 15:51:26 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004131551.o3DFpQGP094501@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 13 Apr 2010 15:51: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: r206556 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 15:51:26 -0000 Author: marcel Date: Tue Apr 13 15:51:25 2010 New Revision: 206556 URL: http://svn.freebsd.org/changeset/base/206556 Log: o s/u_int64_t/uint64_t/g o style(9) fixes. Modified: head/sys/ia64/include/pal.h Modified: head/sys/ia64/include/pal.h ============================================================================== --- head/sys/ia64/include/pal.h Tue Apr 13 12:10:55 2010 (r206555) +++ head/sys/ia64/include/pal.h Tue Apr 13 15:51:25 2010 (r206556) @@ -108,20 +108,19 @@ struct ia64_pal_result { int64_t pal_status; - u_int64_t pal_result[3]; + uint64_t pal_result[3]; }; -extern struct ia64_pal_result - ia64_call_pal_static(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_static_physical(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_stacked(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); -extern struct ia64_pal_result - ia64_call_pal_stacked_physical(u_int64_t proc, u_int64_t arg1, - u_int64_t arg2, u_int64_t arg3); +struct ia64_pal_result ia64_call_pal_static(uint64_t proc, uint64_t arg1, + uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_static_physical(uint64_t proc, + uint64_t arg1, uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_stacked(uint64_t proc, uint64_t arg1, + uint64_t arg2, uint64_t arg3); + +struct ia64_pal_result ia64_call_pal_stacked_physical(uint64_t proc, + uint64_t arg1, uint64_t arg2, uint64_t arg3); #endif /* _MACHINE_PAL_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 15:53:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA98B1065670; Tue, 13 Apr 2010 15:53:04 +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 912F48FC18; Tue, 13 Apr 2010 15:53: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 o3DFr4Tu094904; Tue, 13 Apr 2010 15:53:04 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DFr429094902; Tue, 13 Apr 2010 15:53:04 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004131553.o3DFr429094902@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 13 Apr 2010 15:53: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: r206557 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 15:53:04 -0000 Author: ume Date: Tue Apr 13 15:53:04 2010 New Revision: 206557 URL: http://svn.freebsd.org/changeset/base/206557 Log: Nuke the descriptions about ipv6_firewall_* as they were unified into firewall_*. MFC after: 3 days Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Apr 13 15:51:25 2010 (r206556) +++ head/share/man/man5/rc.conf.5 Tue Apr 13 15:53:04 2010 (r206557) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 09, 2010 +.Dd April 14, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -427,27 +427,11 @@ the kernel module will be loaded. See also .Va ipfilter_enable . -.It Va ipv6_firewall_enable -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_enable . -Set to -.Dq Li YES -to load IPv6 firewall rules at startup. -If the kernel was not built with -.Cd "options IPV6FIREWALL" , -the -.Pa ipfw.ko -kernel module will be loaded. .It Va firewall_script .Pq Vt str This variable specifies the full path to the firewall script to run. The default is .Pa /etc/rc.firewall . -.It Va ipv6_firewall_script -.Pq Vt str -The IPv6 equivalent of -.Va firewall_script . .It Va firewall_type .Pq Vt str Names the firewall type from the selection in @@ -471,19 +455,11 @@ basic protection for a LAN. .Pp If a filename is specified, the full path must be given. -.It Va ipv6_firewall_type -.Pq Vt str -The IPv6 equivalent of -.Va firewall_type . .It Va firewall_quiet .Pq Vt bool Set to .Dq Li YES to disable the display of firewall rules on the console during boot. -.It Va ipv6_firewall_quiet -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_quiet . .It Va firewall_logging .Pq Vt bool Set to @@ -492,10 +468,6 @@ to enable firewall event logging. This is equivalent to the .Dv IPFIREWALL_VERBOSE kernel option. -.It Va ipv6_firewall_logging -.Pq Vt bool -The IPv6 equivalent of -.Va firewall_logging . .It Va firewall_flags .Pq Vt str Flags passed to @@ -503,10 +475,6 @@ Flags passed to if .Va firewall_type specifies a filename. -.It Va ipv6_firewall_flags -.Pq Vt str -The IPv6 equivalent of -.Va firewall_flags . .It Va firewall_coscripts .Pq Vt str List of executables and/or rc scripts to run after firewall starts/stops. From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 15:55:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F74710656A5; Tue, 13 Apr 2010 15:55:19 +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 0F7C58FC24; Tue, 13 Apr 2010 15:55: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 o3DFtIbl095493; Tue, 13 Apr 2010 15:55:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DFtIwF095491; Tue, 13 Apr 2010 15:55:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004131555.o3DFtIwF095491@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 13 Apr 2010 15:55: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: r206558 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 15:55:19 -0000 Author: marcel Date: Tue Apr 13 15:55:18 2010 New Revision: 206558 URL: http://svn.freebsd.org/changeset/base/206558 Log: Change the (generic) argument to ia64_store_mca_state() from the cpuid to the struct pcpu of the CPU. We casting between pointer types only then. Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:53:04 2010 (r206557) +++ head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:55:18 2010 (r206558) @@ -152,13 +152,15 @@ cpu_topo(void) static void ia64_store_mca_state(void* arg) { - unsigned int ncpu = (unsigned int)(uintptr_t)arg; - struct thread* td; + struct pcpu *pc = arg; + struct thread *td = curthread; - /* ia64_mca_save_state() is CPU-sensitive, so bind ourself to our target CPU */ - td = curthread; + /* + * ia64_mca_save_state() is CPU-sensitive, so bind ourself to our + * target CPU. + */ thread_lock(td); - sched_bind(td, ncpu); + sched_bind(td, pc->pc_cpuid); thread_unlock(td); /* @@ -362,8 +364,7 @@ cpu_mp_unleash(void *dummy) SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; if (pc->pc_md.awake) { - kproc_create(ia64_store_mca_state, - (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, + kproc_create(ia64_store_mca_state, pc, NULL, 0, 0, "mca %u", pc->pc_cpuid); smp_cpus++; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 18:53:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D363C1065672; Tue, 13 Apr 2010 18:53:39 +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 A97088FC15; Tue, 13 Apr 2010 18:53: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 o3DIrdbx035081; Tue, 13 Apr 2010 18:53:39 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DIrdOT035078; Tue, 13 Apr 2010 18:53:39 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004131853.o3DIrdOT035078@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 13 Apr 2010 18:53: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: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 18:53:39 -0000 Author: jh Date: Tue Apr 13 18:53:39 2010 New Revision: 206560 URL: http://svn.freebsd.org/changeset/base/206560 Log: - Ignore and report duplicate and empty device names in devfs_populate_loop() instead of causing erratic behavior. Currently make_dev(9) can't fail, so there is no way to report an error to make_dev(9) callers. - Disallow using "." and ".." in device path names. It didn't work previously but now it is reported rather than panicing. - Treat multiple sequential slashes as single in device path names. Discussed with: pjd Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_int.h Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Tue Apr 13 18:46:18 2010 (r206559) +++ head/sys/fs/devfs/devfs_devs.c Tue Apr 13 18:53:39 2010 (r206560) @@ -408,6 +408,9 @@ devfs_populate_loop(struct devfs_mount * continue; KASSERT((cdp->cdp_flags & CDP_ACTIVE), ("Bogons, I tell ya'!")); + if (cdp->cdp_flags & CDP_INVALID) + continue; + if (dm->dm_idx <= cdp->cdp_maxdirent && cdp->cdp_dirents[dm->dm_idx] != NULL) { de = cdp->cdp_dirents[dm->dm_idx]; @@ -425,6 +428,8 @@ devfs_populate_loop(struct devfs_mount * dd = dm->dm_rootdir; s = cdp->cdp_c.si_name; for (;;) { + while (*s == '/') + s++; for (q = s; *q != '/' && *q != '\0'; q++) continue; if (*q != '/') @@ -434,6 +439,24 @@ devfs_populate_loop(struct devfs_mount * de = devfs_vmkdir(dm, s, q - s, dd, 0); s = q + 1; dd = de; + if (dd->de_flags & (DE_DOT | DE_DOTDOT)) + break; + } + + /* + * XXX: Ignore duplicate and empty device names. + * XXX: Currently there is no way to report the error to + * XXX: the make_dev(9) caller. + */ + if (dd->de_dirent->d_type != DT_DIR || + dd->de_flags & (DE_DOT | DE_DOTDOT) || q - s < 1 || + devfs_find(dd, s, q - s) != NULL) { + dev_lock(); + cdp->cdp_flags |= CDP_INVALID; + dev_unlock(); + printf("%s: %s: invalid or duplicate device name\n", + __func__, cdp->cdp_c.si_name); + return (1); } de = devfs_newdirent(s, q - s); Modified: head/sys/fs/devfs/devfs_int.h ============================================================================== --- head/sys/fs/devfs/devfs_int.h Tue Apr 13 18:46:18 2010 (r206559) +++ head/sys/fs/devfs/devfs_int.h Tue Apr 13 18:53:39 2010 (r206560) @@ -55,6 +55,7 @@ struct cdev_priv { u_int cdp_flags; #define CDP_ACTIVE (1 << 0) #define CDP_SCHED_DTR (1 << 1) +#define CDP_INVALID (1 << 2) u_int cdp_inuse; u_int cdp_maxdirent; From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 19:37:18 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9EC106566C; Tue, 13 Apr 2010 19:37:18 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 880758FC1A; Tue, 13 Apr 2010 19:37:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 67F479CB0E4; Tue, 13 Apr 2010 21:35:03 +0200 (CEST) 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 x5lKU-zrBDGu; Tue, 13 Apr 2010 21:35:00 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4CFEC9CB25F; Tue, 13 Apr 2010 21:35:00 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o3DJZ0Vg046947; Tue, 13 Apr 2010 21:35:00 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 13 Apr 2010 21:35:00 +0200 From: Roman Divacky To: Luigi Rizzo Message-ID: <20100413193500.GA46839@freebsd.org> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004121637.o3CGbjSK080066@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 19:37:18 -0000 you dont seem to have commited the anticipatory scheduler gsched_as. why? On Mon, Apr 12, 2010 at 04:37:45PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 12 16:37:45 2010 > New Revision: 206497 > URL: http://svn.freebsd.org/changeset/base/206497 > > Log: > Bring in geom_sched, support for scheduling disk I/O requests > in a device independent manner. Also include an example anticipatory > scheduler, gsched_rr, which gives very nice performance improvements > in presence of competing random access patterns. > > This is joint work with Fabio Checconi, developed last year > and presented at BSDCan 2009. You can find details in the > README file or at > > http://info.iet.unipi.it/~luigi/geom_sched/ > > Added: > head/sbin/geom/class/sched/ > head/sbin/geom/class/sched/Makefile (contents, props changed) > head/sbin/geom/class/sched/geom_sched.c (contents, props changed) > head/sbin/geom/class/sched/gsched.8 (contents, props changed) > head/sys/geom/sched/ > head/sys/geom/sched/README (contents, props changed) > head/sys/geom/sched/g_sched.c (contents, props changed) > head/sys/geom/sched/g_sched.h (contents, props changed) > head/sys/geom/sched/gs_rr.c (contents, props changed) > head/sys/geom/sched/gs_scheduler.h (contents, props changed) > head/sys/geom/sched/subr_disk.c (contents, props changed) > head/sys/modules/geom/geom_sched/ > head/sys/modules/geom/geom_sched/Makefile (contents, props changed) > head/sys/modules/geom/geom_sched/Makefile.inc (contents, props changed) > head/sys/modules/geom/geom_sched/gs_sched/ > head/sys/modules/geom/geom_sched/gs_sched/Makefile (contents, props changed) > head/sys/modules/geom/geom_sched/gsched_rr/ > head/sys/modules/geom/geom_sched/gsched_rr/Makefile (contents, props changed) > Modified: > head/sbin/geom/class/Makefile > head/sys/modules/geom/Makefile > > Modified: head/sbin/geom/class/Makefile > ============================================================================== > --- head/sbin/geom/class/Makefile Mon Apr 12 13:46:20 2010 (r206496) > +++ head/sbin/geom/class/Makefile Mon Apr 12 16:37:45 2010 (r206497) > @@ -15,6 +15,7 @@ SUBDIR+=multipath > SUBDIR+=nop > SUBDIR+=part > SUBDIR+=raid3 > +SUBDIR+=sched > SUBDIR+=shsec > SUBDIR+=stripe > SUBDIR+=virstor > > Added: head/sbin/geom/class/sched/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/Makefile Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,19 @@ > +# GEOM_LIBRARY_PATH > +# $FreeBSD$ > + > +.PATH: /usr/src/sbin/geom/misc > + > +CFLAGS += -I/usr/src/sbin/geom > + > +CLASS=sched > + > +WARNS?= 6 > +CLASS_DIR?=/lib/geom > + > +SHLIBDIR?=${CLASS_DIR} > +SHLIB_NAME?=geom_${CLASS}.so > +LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} > +MAN= g${CLASS}.8 > +SRCS+= geom_${CLASS}.c subr.c > + > +.include > > Added: head/sbin/geom/class/sched/geom_sched.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/geom_sched.c Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,123 @@ > +/*- > + * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo > + * 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 AUTHORS 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 AUTHORS 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. > + */ > + > +/* > + * $Id$ > + * $FreeBSD$ > + * > + * This file implements the userspace library used by the 'geom' > + * command to load and manipulate disk schedulers. > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include "core/geom.h" > +#include "misc/subr.h" > + > +#define G_SCHED_VERSION 0 > + > +uint32_t lib_version = G_LIB_VERSION; > +uint32_t version = G_SCHED_VERSION; > + > +/* > + * storage for parameters used by this geom class. > + * Right now only the scheduler name is used. > + */ > +static char algo[] = "rr"; /* default scheduler */ > + > +/* > + * Adapt to differences in geom library. > + * in V1 struct g_command misses gc_argname, eld, and G_BOOL is undefined > + */ > +#if G_LIB_VERSION == 1 > +#define G_ARGNAME > +#define G_TYPE_BOOL G_TYPE_NUMBER > +#else > +#define G_ARGNAME NULL, > +#endif > + > +static void > +gcmd_createinsert(struct gctl_req *req, unsigned flags __unused) > +{ > + const char *reqalgo; > + char name[64]; > + > + if (gctl_has_param(req, "algo")) > + reqalgo = gctl_get_ascii(req, "algo"); > + else > + reqalgo = algo; > + > + snprintf(name, sizeof(name), "gsched_%s", reqalgo); > + /* > + * Do not complain about errors here, gctl_issue() > + * will fail anyway. > + */ > + if (modfind(name) < 0) > + kldload(name); > + gctl_issue(req); > +} > + > +struct g_command class_commands[] = { > + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, > + { > + { 'a', "algo", algo, G_TYPE_STRING }, > + G_OPT_SENTINEL > + }, > + G_ARGNAME "[-v] [-a algorithm_name] dev ..." > + }, > + { "insert", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, > + { > + { 'a', "algo", algo, G_TYPE_STRING }, > + G_OPT_SENTINEL > + }, > + G_ARGNAME "[-v] [-a algorithm_name] dev ..." > + }, > + { "configure", G_FLAG_VERBOSE, NULL, > + { > + { 'a', "algo", algo, G_TYPE_STRING }, > + G_OPT_SENTINEL > + }, > + G_ARGNAME "[-v] [-a algorithm_name] prov ..." > + }, > + { "destroy", G_FLAG_VERBOSE, NULL, > + { > + { 'f', "force", NULL, G_TYPE_BOOL }, > + G_OPT_SENTINEL > + }, > + G_ARGNAME "[-fv] prov ..." > + }, > + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, > + G_ARGNAME "[-v] prov ..." > + }, > + G_CMD_SENTINEL > +}; > > Added: head/sbin/geom/class/sched/gsched.8 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/geom/class/sched/gsched.8 Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,161 @@ > +.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo > +.\" All rights reserved. > +.\" $FreeBSD$ > +.\" > +.\" 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 AUTHORS 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 AUTHORS 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. > +.\" > +.Dd April 12, 2010 > +.Dt GSCHED 8 > +.Os > +.Sh NAME > +.Nm gsched > +.Nd "control utility for disk scheduler GEOM class" > +.Sh SYNOPSIS > +.Nm > +.Cm create > +.Op Fl v > +.Op Fl a Ar algorithm > +.Ar provider ... > +.Nm > +.Cm insert > +.Op Fl v > +.Op Fl a Ar algorithm > +.Ar provider ... > +.Nm > +.Cm configure > +.Op Fl v > +.Op Fl a Ar algorithm > +.Ar node ... > +.Nm > +.Cm destroy > +.Op Fl fv > +.Ar node ... > +.Nm > +.Cm reset > +.Op Fl v > +.Ar node ... > +.Nm > +.Cm { list | status | load | unload } > +.Sh DESCRIPTION > +The > +.Nm > +utility (also callable as > +.Nm geom sched ... ) > +changes the scheduling policy of the requests going to a provider. > +.Pp > +The first argument to > +.Nm > +indicates an action to be performed: > +.Bl -tag -width ".Cm configure" > +.It Cm create > +Create a new provider and geom node using the specified scheduling algorithm. > +.Ar algorithm > +is the name of the scheduling algorithm used for the provider. > +Available algorithms include: > +.Ar rr , > +which implements anticipatory scheduling with round robin service > +among clients; > +.Ar as , > +which implements a simple form of anticipatory scheduling with > +no per-client queue. > +.Pp > +If the operation succeeds, the new provider should appear with name > +.Pa /dev/ Ns Ao Ar dev Ac Ns Pa .sched. . > +The kernel module > +.Pa geom_sched.ko > +will be loaded if it is not loaded already. > +.It Cm insert > +Operates as "create", but the insertion is "transparent", > +i.e. the existing provider is rerouted to the newly created geom, > +which in turn forwards requests to the existing geom. > +This operation allows one to start/stop a scheduling service > +on an already existing provider. > +.Pp > +A subsequent 'destroy' will remove the newly created geom and > +hook the provider back to the original geom. > +.Ar algorithm > +.It Cm configure > +Configure existing scheduling provider. It supports the same options > +as the > +.Nm create > +command. > +.It Cm destroy > +Destroy the geom specified in the parameter. > +.It Cm reset > +Do nothing. > +.It Cm list | status | load | unload > +See > +.Xr geom 8 . > +.El > +.Pp > +Additional options: > +.Bl -tag -width ".Fl f" > +.It Fl f > +Force the removal of the specified provider. > +.It Fl v > +Be more verbose. > +.El > +.Sh SYSCTL VARIABLES > +The following > +.Xr sysctl 8 > +variables can be used to control the behavior of the > +.Nm SCHED > +GEOM class. > +The default value is shown next to each variable. > +.Bl -tag -width indent > +.It Va kern.geom.sched.debug : No 0 > +Debug level of the > +.Nm SCHED > +GEOM class. > +This can be set to a number between 0 and 2 inclusive. > +If set to 0 minimal debug information is printed, and if set to 2 the > +maximum amount of debug information is printed. > +.El > +.Sh EXIT STATUS > +Exit status is 0 on success, and 1 if the command fails. > +.Sh EXAMPLES > +The following example shows how to create a scheduling provider for disk > +.Pa /dev/da0 > +, and how to destroy it. > +.Bd -literal -offset indent > +# Load the geom_sched module: > +kldload geom_sched > +# Load some scheduler classes used by geom_sched: > +kldload gsched_rr gsched_as > +# Configure device ad0 to use scheduler 'rr': > +geom sched insert -s rr ad0 > +# Now provider ad0 uses the 'rr' algorithm; > +# the new geom is ad0.sched. > +# Remove the scheduler on the device: > +geom sched destroy -v ad0.sched. > +.Ed > +.Pp > +.Sh SEE ALSO > +.Xr geom 4 , > +.Xr geom 8 > +.Sh HISTORY > +The > +.Nm > +utility appeared in April 2010. > +.Sh AUTHORS > +.An Fabio Checconi Aq fabio@FreeBSD.org > +.An Luigi Rizzo Aq luigi@FreeBSD.org > > Added: head/sys/geom/sched/README > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/geom/sched/README Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,162 @@ > + > + --- GEOM BASED DISK SCHEDULERS FOR FREEBSD --- > + > +This code contains a framework for GEOM-based disk schedulers and a > +couple of sample scheduling algorithms that use the framework and > +implement two forms of "anticipatory scheduling" (see below for more > +details). > + > +As a quick example of what this code can give you, try to run "dd", > +"tar", or some other program with highly SEQUENTIAL access patterns, > +together with "cvs", "cvsup", "svn" or other highly RANDOM access patterns > +(this is not a made-up example: it is pretty common for developers > +to have one or more apps doing random accesses, and others that do > +sequential accesses e.g., loading large binaries from disk, checking > +the integrity of tarballs, watching media streams and so on). > + > +These are the results we get on a local machine (AMD BE2400 dual > +core CPU, SATA 250GB disk): > + > + /mnt is a partition mounted on /dev/ad0s1f > + > + cvs: cvs -d /mnt/home/ncvs-local update -Pd /mnt/ports > + dd-read: dd bs=128k of=/dev/null if=/dev/ad0 (or ad0-sched-) > + dd-writew dd bs=128k if=/dev/zero of=/mnt/largefile > + > + NO SCHEDULER RR SCHEDULER > + dd cvs dd cvs > + > + dd-read only 72 MB/s ---- 72 MB/s --- > + dd-write only 55 MB/s --- 55 MB/s --- > + dd-read+cvs 6 MB/s ok 30 MB/s ok > + dd-write+cvs 55 MB/s slooow 14 MB/s ok > + > +As you can see, when a cvs is running concurrently with dd, the > +performance drops dramatically, and depending on read or write mode, > +one of the two is severely penalized. The use of the RR scheduler > +in this example makes the dd-reader go much faster when competing > +with cvs, and lets cvs progress when competing with a writer. > + > +To try it out: > + > +1. USERS OF FREEBSD 7, PLEASE READ CAREFULLY THE FOLLOWING: > + > + On loading, this module patches one kernel function (g_io_request()) > + so that I/O requests ("bio's") carry a classification tag, useful > + for scheduling purposes. > + > + ON FREEBSD 7, the tag is stored in an existing (though rarely used) > + field of the "struct bio", a solution which makes this module > + incompatible with other modules using it, such as ZFS and gjournal. > + Additionally, g_io_request() is patched in-memory to add a call > + to the function that initializes this field (i386/amd64 only; > + for other architectures you need to manually patch sys/geom/geom_io.c). > + See details in the file g_sched.c. > + > + On FreeBSD 8.0 and above, the above trick is not necessary, > + as the struct bio contains dedicated fields for the classifier, > + and hooks for request classifiers. > + > + If you don't like the above, don't run this code. > + > +2. PLEASE MAKE SURE THAT THE DISK THAT YOU WILL BE USING FOR TESTS > + DOES NOT CONTAIN PRECIOUS DATA. > + This is experimental code, so we make no guarantees, though > + I am routinely using it on my desktop and laptop. > + > +3. EXTRACT AND BUILD THE PROGRAMS > + A 'make install' in the directory should work (with root privs), > + or you can even try the binary modules. > + If you want to build the modules yourself, look at the Makefile. > + > +4. LOAD THE MODULE, CREATE A GEOM NODE, RUN TESTS > + > + The scheduler's module must be loaded first: > + > + # kldload gsched_rr > + > + substitute with gsched_as to test AS. Then, supposing that you are > + using /dev/ad0 for testing, a scheduler can be attached to it with: > + > + # geom sched insert ad0 > + > + The scheduler is inserted transparently in the geom chain, so > + mounted partitions and filesystems will keep working, but > + now requests will go through the scheduler. > + > + To change scheduler on-the-fly, you can reconfigure the geom: > + > + # geom sched configure -a as ad0.sched. > + > + assuming that gsched_as was loaded previously. > + > +5. SCHEDULER REMOVAL > + > + In principle it is possible to remove the scheduler module > + even on an active chain by doing > + > + # geom sched destroy ad0.sched. > + > + However, there is some race in the geom subsystem which makes > + the removal unsafe if there are active requests on a chain. > + So, in order to reduce the risk of data losses, make sure > + you don't remove a scheduler from a chain with ongoing transactions. > + > +--- NOTES ON THE SCHEDULERS --- > + > +The important contribution of this code is the framework to experiment > +with different scheduling algorithms. 'Anticipatory scheduling' > +is a very powerful technique based on the following reasoning: > + > + The disk throughput is much better if it serves sequential requests. > + If we have a mix of sequential and random requests, and we see a > + non-sequential request, do not serve it immediately but instead wait > + a little bit (2..5ms) to see if there is another one coming that > + the disk can serve more efficiently. > + > +There are many details that should be added to make sure that the > +mechanism is effective with different workloads and systems, to > +gain a few extra percent in performance, to improve fairness, > +insulation among processes etc. A discussion of the vast literature > +on the subject is beyond the purpose of this short note. > + > +-------------------------------------------------------------------------- > + > +TRANSPARENT INSERT/DELETE > + > +geom_sched is an ordinary geom module, however it is convenient > +to plug it transparently into the geom graph, so that one can > +enable or disable scheduling on a mounted filesystem, and the > +names in /etc/fstab do not depend on the presence of the scheduler. > + > +To understand how this works in practice, remember that in GEOM > +we have "providers" and "geom" objects. > +Say that we want to hook a scheduler on provider "ad0", > +accessible through pointer 'pp'. Originally, pp is attached to > +geom "ad0" (same name, different object) accessible through pointer old_gp > + > + BEFORE ---> [ pp --> old_gp ...] > + > +A normal "geom sched create ad0" call would create a new geom node > +on top of provider ad0/pp, and export a newly created provider > +("ad0.sched." accessible through pointer newpp). > + > + AFTER create ---> [ newpp --> gp --> cp ] ---> [ pp --> old_gp ... ] > + > +On top of newpp, a whole tree will be created automatically, and we > +can e.g. mount partitions on /dev/ad0.sched.s1d, and those requests > +will go through the scheduler, whereas any partition mounted on > +the pre-existing device entries will not go through the scheduler. > + > +With the transparent insert mechanism, the original provider "ad0"/pp > +is hooked to the newly created geom, as follows: > + > + AFTER insert ---> [ pp --> gp --> cp ] ---> [ newpp --> old_gp ... ] > + > +so anything that was previously using provider pp will now have > +the requests routed through the scheduler node. > + > +A removal ("geom sched destroy ad0.sched.") will restore the original > +configuration. > + > +# $FreeBSD$ > > Added: head/sys/geom/sched/g_sched.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/geom/sched/g_sched.c Mon Apr 12 16:37:45 2010 (r206497) > @@ -0,0 +1,1901 @@ > +/*- > + * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo > + * 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 AUTHORS 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 AUTHORS 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. > + */ > + > +/* > + * $Id$ > + * $FreeBSD$ > + * > + * Main control module for geom-based disk schedulers ('sched'). > + * > + * USER VIEW > + * A 'sched' node is typically inserted transparently between > + * an existing provider pp and its original geom gp > + * > + * [pp --> gp ..] > + * > + * using the command "geom sched insert " and > + * resulting in the following topology > + * > + * [pp --> sched_gp --> cp] [new_pp --> gp ... ] > + * > + * Deletion "geom sched destroy .sched." restores the > + * original chain. The normal "geom sched create " > + * is also supported. > + * > + * INTERNALS > + * Internally, the 'sched' uses the following data structures > + * > + * geom{} g_sched_softc{} g_gsched{} > + * +----------+ +---------------+ +-------------+ > + * | softc *-|--->| sc_gsched *-|-->| gs_init | > + * | ... | | | | gs_fini | > + * | | | [ hash table] | | gs_start | > + * +----------+ | | | ... | > + * | | +-------------+ > + * | | > + * | | g_*_softc{} > + * | | +-------------+ > + * | sc_data *-|-->| | > + * +---------------+ | algorithm- | > + * | specific | > + * +-------------+ > + * > + * A g_sched_softc{} is created with a "geom sched insert" call. > + * In turn this instantiates a specific scheduling algorithm, > + * which sets sc_gsched to point to the algorithm callbacks, > + * and calls gs_init() to create the g_*_softc{} . > + * The other callbacks (gs_start, gs_next, ...) are invoked > + * as needed > + * > + * g_sched_softc{} is defined in g_sched.h and mostly used here; > + * g_gsched{}, and the gs_callbacks, are documented in gs_scheduler.h; > + * g_*_softc{} is defined/implemented by each algorithm (gs_*.c) > + * > + * DATA MOVING > + * When a bio is received on the provider, it goes to the > + * g_sched_start() which calls gs_start() to initially queue it; > + * then we call g_sched_dispatch() that loops around gs_next() > + * to select zero or more bio's to be sent downstream. > + * > + * g_sched_dispatch() can also be called as a result of a timeout, > + * e.g. when doing anticipation or pacing requests. > + * > + * When a bio comes back, it goes to g_sched_done() which in turn > + * calls gs_done(). The latter does any necessary housekeeping in > + * the scheduling algorithm, and may decide to call g_sched_dispatch() > + * to send more bio's downstream. > + * > + * If an algorithm needs per-flow queues, these are created > + * calling gs_init_class() and destroyed with gs_fini_class(), > + * and they are also inserted in the hash table implemented in > + * the g_sched_softc{} > + * > + * If an algorithm is replaced, or a transparently-inserted node is > + * removed with "geom sched destroy", we need to remove all references > + * to the g_*_softc{} and g_sched_softc from the bio's still in > + * the scheduler. g_sched_forced_dispatch() helps doing this. > + * XXX need to explain better. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include /* we access curthread */ > +#include > +#include "gs_scheduler.h" > +#include "g_sched.h" /* geom hooks */ > + > +/* > + * Size of the per-geom hash table storing traffic classes. > + * We may decide to change it at a later time, it has no ABI > + * implications as it is only used for run-time allocations. > + */ > +#define G_SCHED_HASH_SIZE 32 > + > +static int g_sched_destroy(struct g_geom *gp, boolean_t force); > +static int g_sched_destroy_geom(struct gctl_req *req, > + struct g_class *mp, struct g_geom *gp); > +static void g_sched_config(struct gctl_req *req, struct g_class *mp, > + const char *verb); > +static struct g_geom *g_sched_taste(struct g_class *mp, > + struct g_provider *pp, int flags __unused); > +static void g_sched_dumpconf(struct sbuf *sb, const char *indent, > + struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); > +static void g_sched_init(struct g_class *mp); > +static void g_sched_fini(struct g_class *mp); > + > +struct g_class g_sched_class = { > + .name = G_SCHED_CLASS_NAME, > + .version = G_VERSION, > + .ctlreq = g_sched_config, > + .taste = g_sched_taste, > + .destroy_geom = g_sched_destroy_geom, > + .init = g_sched_init, > + .fini = g_sched_fini > +}; > + > +MALLOC_DEFINE(M_GEOM_SCHED, "GEOM_SCHED", "Geom schedulers data structures"); > + > +/* > + * Global variables describing the state of the geom_sched module. > + * There is only one static instance of this structure. > + */ > +LIST_HEAD(gs_list, g_gsched); /* type, link field */ > +struct geom_sched_vars { > + struct mtx gs_mtx; > + struct gs_list gs_scheds; /* list of algorithms */ > + u_int gs_debug; > + u_int gs_sched_count; /* how many algorithms ? */ > + u_int gs_patched; /* g_io_request was patched */ > + > + u_int gs_initialized; > + u_int gs_expire_secs; /* expiration of hash entries */ > + > + struct bio_queue_head gs_pending; > + u_int gs_npending; > + > + /* The following are for stats, usually protected by gs_mtx. */ > + u_long gs_requests; /* total requests */ > + u_long gs_done; /* total done */ > + u_int gs_in_flight; /* requests in flight */ > + u_int gs_writes_in_flight; > + u_int gs_bytes_in_flight; > + u_int gs_write_bytes_in_flight; > + > + char gs_names[256]; /* names of schedulers */ > +}; > + > +static struct geom_sched_vars me = { > + .gs_expire_secs = 10, > +}; > + > +SYSCTL_DECL(_kern_geom); > +SYSCTL_NODE(_kern_geom, OID_AUTO, sched, CTLFLAG_RW, 0, > + "GEOM_SCHED stuff"); > + > +SYSCTL_INT(_kern_geom_sched, OID_AUTO, in_flight_wb, CTLFLAG_RD, > + &me.gs_write_bytes_in_flight, 0, "Write bytes in flight"); > + > +SYSCTL_INT(_kern_geom_sched, OID_AUTO, in_flight_b, CTLFLAG_RD, > + &me.gs_bytes_in_flight, 0, "Bytes in flight"); > + > +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, in_flight_w, CTLFLAG_RD, > + &me.gs_writes_in_flight, 0, "Write Requests in flight"); > + > +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, in_flight, CTLFLAG_RD, > + &me.gs_in_flight, 0, "Requests in flight"); > + > +SYSCTL_ULONG(_kern_geom_sched, OID_AUTO, done, CTLFLAG_RD, > + &me.gs_done, 0, "Total done"); > + > +SYSCTL_ULONG(_kern_geom_sched, OID_AUTO, requests, CTLFLAG_RD, > + &me.gs_requests, 0, "Total requests"); > + > +SYSCTL_STRING(_kern_geom_sched, OID_AUTO, algorithms, CTLFLAG_RD, > + &me.gs_names, 0, "Algorithm names"); > + > +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, alg_count, CTLFLAG_RD, > + &me.gs_sched_count, 0, "Number of algorithms"); > + > +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, debug, CTLFLAG_RW, > + &me.gs_debug, 0, "Debug level"); > + > +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, expire_secs, CTLFLAG_RW, > + &me.gs_expire_secs, 0, "Expire time in seconds"); > + > +/* > + * g_sched calls the scheduler algorithms with this lock held. > + * The locking functions are exposed so the scheduler algorithms can also > + * protect themselves e.g. when running a callout handler. > + */ > +void > +g_sched_lock(struct g_geom *gp) > +{ > + struct g_sched_softc *sc = gp->softc; > + > + mtx_lock(&sc->sc_mtx); > +} > + > +void > +g_sched_unlock(struct g_geom *gp) > +{ > + struct g_sched_softc *sc = gp->softc; > + > + mtx_unlock(&sc->sc_mtx); > +} > + > +/* > + * Support functions to handle references to the module, > + * which are coming from devices using this scheduler. > + */ > +static inline void > +g_gsched_ref(struct g_gsched *gsp) > +{ > + > + atomic_add_int(&gsp->gs_refs, 1); > +} > + > +static inline void > +g_gsched_unref(struct g_gsched *gsp) > +{ > + > + atomic_add_int(&gsp->gs_refs, -1); > +} > + > +/* > + * Update the stats when this request is done. > + */ > +static void > +g_sched_update_stats(struct bio *bio) > +{ > + > + me.gs_done++; > + me.gs_in_flight--; > + me.gs_bytes_in_flight -= bio->bio_length; > + if (bio->bio_cmd & BIO_WRITE) { > + me.gs_writes_in_flight--; > + me.gs_write_bytes_in_flight -= bio->bio_length; > + } > +} > + > +/* > + * Dispatch any pending request. > + */ > +static void > +g_sched_forced_dispatch(struct g_geom *gp) > +{ > + struct g_sched_softc *sc = gp->softc; > + struct g_gsched *gsp = sc->sc_gsched; > + struct bio *bp; > + > + KASSERT(mtx_owned(&sc->sc_mtx), > + ("sc_mtx not owned during forced dispatch")); > + > + while ((bp = gsp->gs_next(sc->sc_data, 1)) != NULL) > + g_io_request(bp, LIST_FIRST(&gp->consumer)); > +} > + > +/* > + * The main dispatch loop, called either here after the start > + * routine, or by scheduling algorithms when they receive a timeout > + * or a 'done' notification. Does not share code with the forced > + * dispatch path, since the gs_done() callback can call us. > + */ > +void > +g_sched_dispatch(struct g_geom *gp) > +{ > + struct g_sched_softc *sc = gp->softc; > + struct g_gsched *gsp = sc->sc_gsched; > + struct bio *bp; > + > + KASSERT(mtx_owned(&sc->sc_mtx), ("sc_mtx not owned during dispatch")); > + > + if ((sc->sc_flags & G_SCHED_FLUSHING)) > + return; > + > + while ((bp = gsp->gs_next(sc->sc_data, 0)) != NULL) > + g_io_request(bp, LIST_FIRST(&gp->consumer)); > +} > + > +/* > + * Recent (8.0 and above) versions of FreeBSD have support to > + * register classifiers of disk requests. The classifier is > + * invoked by g_io_request(), and stores the information into > + * bp->bio_classifier1. > + * > + * Support for older versions, which is left here only for > + * documentation purposes, relies on two hacks: > + * 1. classification info is written into the bio_caller1 > + * field of the topmost node in the bio chain. This field > + * is rarely used, but this module is incompatible with > + * those that use bio_caller1 for other purposes, > + * such as ZFS and gjournal; > + * 2. g_io_request() is patched in-memory when the module is > + * loaded, so that the function calls a classifier as its > + * first thing. g_io_request() is restored when the module > + * is unloaded. This functionality is only supported for > + * x86 and amd64, other architectures need source code changes. > + */ > + > +/* > + * Lookup the identity of the issuer of the original request. > + * In the current implementation we use the curthread of the > + * issuer, but different mechanisms may be implemented later > + * so we do not make assumptions on the return value which for > + * us is just an opaque identifier. > + */ > + > +static inline u_long > +g_sched_classify(struct bio *bp) > +{ > + > +#if __FreeBSD_version > 800098 > + /* we have classifier fields in the struct bio */ > +#define HAVE_BIO_CLASSIFIER > + return ((u_long)bp->bio_classifier1); > +#else > +#warning old version!!! > + while (bp->bio_parent != NULL) > + bp = bp->bio_parent; > + > + return ((u_long)bp->bio_caller1); > +#endif > +} > + > +/* Return the hash chain for the given key. */ > +static inline struct g_hash * > +g_sched_hash(struct g_sched_softc *sc, u_long key) > +{ > + > + return (&sc->sc_hash[key & sc->sc_mask]); > +} > + > +/* > + * Helper function for the children classes, which takes > + * a geom and a bio and returns the private descriptor > + * associated to the request. This involves fetching > + * the classification field and [al]locating the > + * corresponding entry in the hash table. > + */ > +void * > +g_sched_get_class(struct g_geom *gp, struct bio *bp) > +{ > + struct g_sched_softc *sc; > + struct g_sched_class *gsc; > + struct g_gsched *gsp; > + struct g_hash *bucket; > + u_long key; > + > + sc = gp->softc; > + key = g_sched_classify(bp); > + bucket = g_sched_hash(sc, key); > + LIST_FOREACH(gsc, bucket, gsc_clist) { > + if (key == gsc->gsc_key) { > + gsc->gsc_refs++; > + return (gsc->gsc_priv); > + } > + } > + > + gsp = sc->sc_gsched; > + gsc = malloc(sizeof(*gsc) + gsp->gs_priv_size, > + M_GEOM_SCHED, M_NOWAIT | M_ZERO); > + if (!gsc) > + return (NULL); > + > + if (gsp->gs_init_class(sc->sc_data, gsc->gsc_priv)) { > + free(gsc, M_GEOM_SCHED); > + return (NULL); > + } > + > + gsc->gsc_refs = 2; /* 1 for the hash table, 1 for the caller. */ > + gsc->gsc_key = key; > + LIST_INSERT_HEAD(bucket, gsc, gsc_clist); > + > + gsc->gsc_expire = ticks + me.gs_expire_secs * hz; > + > + return (gsc->gsc_priv); > +} > + > +/* > + * Release a reference to the per-client descriptor, > + */ > +void > +g_sched_put_class(struct g_geom *gp, void *priv) > +{ > + struct g_sched_class *gsc; > + struct g_sched_softc *sc; > + > + gsc = g_sched_priv2class(priv); > + gsc->gsc_expire = ticks + me.gs_expire_secs * hz; > + > + if (--gsc->gsc_refs > 0) > + return; > + > + sc = gp->softc; > + sc->sc_gsched->gs_fini_class(sc->sc_data, priv); > + > + LIST_REMOVE(gsc, gsc_clist); > + free(gsc, M_GEOM_SCHED); > +} > + > +static void > +g_sched_hash_fini(struct g_geom *gp, struct g_hash *hp, u_long mask, > + struct g_gsched *gsp, void *data) > +{ > + struct g_sched_class *cp, *cp2; > + int i; > + > + if (!hp) > + return; > + > + if (data && gsp->gs_hash_unref) > + gsp->gs_hash_unref(data); > + > + for (i = 0; i < G_SCHED_HASH_SIZE; i++) { > + LIST_FOREACH_SAFE(cp, &hp[i], gsc_clist, cp2) > + g_sched_put_class(gp, cp->gsc_priv); > + } > + > + hashdestroy(hp, M_GEOM_SCHED, mask); > +} > + > +static struct g_hash * > +g_sched_hash_init(struct g_gsched *gsp, u_long *mask, int flags) > +{ > + struct g_hash *hash; > + > + if (gsp->gs_priv_size == 0) > + return (NULL); > + > + hash = hashinit_flags(G_SCHED_HASH_SIZE, M_GEOM_SCHED, mask, flags); > + > + return (hash); > +} > + > +static void > +g_sched_flush_classes(struct g_geom *gp) > +{ > + struct g_sched_softc *sc; > + struct g_sched_class *cp, *cp2; > + int i; > + > + sc = gp->softc; > + > + if (!sc->sc_hash || ticks - sc->sc_flush_ticks <= 0) > + return; > + > + for (i = 0; i < G_SCHED_HASH_SIZE; i++) { > + LIST_FOREACH_SAFE(cp, &sc->sc_hash[i], gsc_clist, cp2) { > + if (cp->gsc_refs == 1 && ticks - cp->gsc_expire > 0) > + g_sched_put_class(gp, cp->gsc_priv); > + } > + } > + > + sc->sc_flush_ticks = ticks + me.gs_expire_secs * hz; > +} > + > +/* > + * Wait for the completion of any outstanding request. To ensure > + * that this does not take forever the caller has to make sure that > + * no new request enter the scehduler before calling us. > + * > + * Must be called with the gp mutex held and topology locked. > + */ > +static int > +g_sched_wait_pending(struct g_geom *gp) > +{ > + struct g_sched_softc *sc = gp->softc; > + int endticks = ticks + hz; > + > + g_topology_assert(); > + > + while (sc->sc_pending && endticks - ticks >= 0) > + msleep(gp, &sc->sc_mtx, 0, "sched_wait_pending", hz / 4); > + > + return (sc->sc_pending ? ETIMEDOUT : 0); > +} > + > +static int > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 19:43:01 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ABCF106566B; Tue, 13 Apr 2010 19:43:01 +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 459CE8FC0C; Tue, 13 Apr 2010 19:43:01 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id AE9F2730A1; Tue, 13 Apr 2010 21:53:26 +0200 (CEST) Date: Tue, 13 Apr 2010 21:53:26 +0200 From: Luigi Rizzo To: Roman Divacky Message-ID: <20100413195326.GA47657@onelab2.iet.unipi.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100413193500.GA46839@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100413193500.GA46839@freebsd.org> 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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 19:43:01 -0000 On Tue, Apr 13, 2010 at 09:35:00PM +0200, Roman Divacky wrote: > you dont seem to have commited the anticipatory scheduler gsched_as. > > why? gsched_rr has anticipation too, and is the "production quality" one, so i only included that one in the svn repository. You can find other schedulers in the tarball on the web page, but gsched_as is only a proof of concept, and others need more debugging and cleanup before being imported. cheers luigi From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 20:07:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5F681065672; Tue, 13 Apr 2010 20:07:52 +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 955588FC12; Tue, 13 Apr 2010 20:07: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 o3DK7qvM051560; Tue, 13 Apr 2010 20:07:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DK7qcq051557; Tue, 13 Apr 2010 20:07:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004132007.o3DK7qcq051557@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 13 Apr 2010 20:07: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: r206563 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 20:07:52 -0000 Author: yongari Date: Tue Apr 13 20:07:52 2010 New Revision: 206563 URL: http://svn.freebsd.org/changeset/base/206563 Log: Add Agere ET1011 PHY which is found on Belkin F5D5055 USB controller. Unlike Agere ET1011C, Agere ET1011 does not seem to need special DSP programming to workaround silicon bug. Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/truephy.c Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Tue Apr 13 19:58:32 2010 (r206562) +++ head/sys/dev/mii/miidevs Tue Apr 13 20:07:52 2010 (r206563) @@ -102,6 +102,7 @@ oui xxREALTEK 0x000732 */ /* Agere Systems PHYs */ +model AGERE ET1011 0x0001 ET1011 10/100/1000baseT PHY model AGERE ET1011C 0x0004 ET1011C 10/100/1000baseT PHY /* Altima Communications PHYs */ Modified: head/sys/dev/mii/truephy.c ============================================================================== --- head/sys/dev/mii/truephy.c Tue Apr 13 19:58:32 2010 (r206562) +++ head/sys/dev/mii/truephy.c Tue Apr 13 20:07:52 2010 (r206563) @@ -76,6 +76,7 @@ static device_method_t truephy_methods[] }; static const struct mii_phydesc truephys[] = { + MII_PHY_DESC(AGERE, ET1011), MII_PHY_DESC(AGERE, ET1011C), MII_PHY_END }; @@ -161,7 +162,10 @@ truephy_attach(device_t dev) mii->mii_instance++; - truephy_reset(sc); + if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011) + mii_phy_reset(sc); + else + truephy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 20:50:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFD7106564A; Tue, 13 Apr 2010 20:50: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 6F6F28FC12; Tue, 13 Apr 2010 20:50: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 o3DKoxSC061509; Tue, 13 Apr 2010 20:50:59 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DKoxEw061507; Tue, 13 Apr 2010 20:50:59 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201004132050.o3DKoxEw061507@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 13 Apr 2010 20:50: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: r206568 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 20:50:59 -0000 Author: edwin Date: Tue Apr 13 20:50:59 2010 New Revision: 206568 URL: http://svn.freebsd.org/changeset/base/206568 Log: Allerheilingen -> Allerheiligen Submitted by: Ronald Klop Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Tue Apr 13 20:47:11 2010 (r206567) +++ head/usr.bin/calendar/calendars/calendar.dutch Tue Apr 13 20:50:59 2010 (r206568) @@ -18,7 +18,7 @@ mei/01 Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag okt/04 Dierendag -nov/01 Allerheilingen +nov/01 Allerheiligen nov/02 Allerzielen nov/11 Sint Maarten nov/11 Elfde-van-de-elfde From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 21:32:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40D3106566B; Tue, 13 Apr 2010 21:32:06 +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 B3D038FC20; Tue, 13 Apr 2010 21:32: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 o3DLW6jm070738; Tue, 13 Apr 2010 21:32:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DLW66a070735; Tue, 13 Apr 2010 21:32:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004132132.o3DLW66a070735@svn.freebsd.org> From: Warner Losh Date: Tue, 13 Apr 2010 21:32: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: r206569 - in head/sys/modules: . uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 21:32:06 -0000 Author: imp Date: Tue Apr 13 21:32:06 2010 New Revision: 206569 URL: http://svn.freebsd.org/changeset/base/206569 Log: Only compile in uart_cpu_$MACHINE.c if it exists. I'm not sure how useful it will be, but we really need to be keying off something other than MACHINE for this anyway since on arm and mips we have lots of these running around (one for each SoC family)... Modified: head/sys/modules/Makefile head/sys/modules/uart/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Apr 13 20:50:59 2010 (r206568) +++ head/sys/modules/Makefile Tue Apr 13 21:32:06 2010 (r206569) @@ -280,7 +280,7 @@ SUBDIR= ${_3dfx} \ twe \ tx \ txp \ - ${_uart} \ + uart \ ubsec \ udf \ udf_iconv \ @@ -323,8 +323,6 @@ _vpo= vpo # no BUS_SPACE_UNSPECIFIED # No barrier instruction support (specific to this driver) _sym= sym -# no uart_cpu_$MACHINE_ARCH -_uart= uart # intr_disable() is a macro, causes problems _cxgb= cxgb .endif Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Tue Apr 13 20:50:59 2010 (r206568) +++ head/sys/modules/uart/Makefile Tue Apr 13 21:32:06 2010 (r206569) @@ -16,7 +16,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u uart_if.c uart_if.h uart_subr.c uart_tty.c .if ${MACHINE} == "sun4v" SRCS+= uart_cpu_sparc64.c -.else +.elif exists(${CURDIR}/uart_cpu_${MACHINE}.c) SRCS+= uart_cpu_${MACHINE}.c .endif SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 22:20:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C6A1065676; Tue, 13 Apr 2010 22:20:13 +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 164778FC2A; Tue, 13 Apr 2010 22:20: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 o3DMKCNj081384; Tue, 13 Apr 2010 22:20:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DMKCxf081383; Tue, 13 Apr 2010 22:20:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004132220.o3DMKCxf081383@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 13 Apr 2010 22:20: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: r206570 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 22:20:13 -0000 Author: marcel Date: Tue Apr 13 22:20:12 2010 New Revision: 206570 URL: http://svn.freebsd.org/changeset/base/206570 Log: Populate the sysctl tree with any MCA records we collected. The sequence number is used as the name of a sysctl node, under which we add the MCA records using the CPU id as the leaf name. Add the hw.mca.inject sysctl to provide a way to inject MC errors and trigger machine checks. PR: ia64/113102 Modified: head/sys/ia64/ia64/mca.c head/sys/ia64/include/mca.h Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Tue Apr 13 21:32:06 2010 (r206569) +++ head/sys/ia64/ia64/mca.c Tue Apr 13 22:20:12 2010 (r206570) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Marcel Moolenaar + * Copyright (c) 2002-2010 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -44,19 +45,19 @@ MALLOC_DEFINE(M_MCA, "MCA", "Machine Che struct mca_info { STAILQ_ENTRY(mca_info) mi_link; - char mi_name[32]; + u_long mi_seqnr; + u_int mi_cpuid; size_t mi_recsz; char mi_record[0]; }; -static STAILQ_HEAD(, mca_info) mca_records = - STAILQ_HEAD_INITIALIZER(mca_records); +STAILQ_HEAD(mca_info_list, mca_info); -int64_t mca_info_size[SAL_INFO_TYPES]; -vm_offset_t mca_info_block; -struct mtx mca_info_block_lock; +static int64_t mca_info_size[SAL_INFO_TYPES]; +static vm_offset_t mca_info_block; +static struct mtx mca_info_block_lock; -SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, 0, "MCA container"); +SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, NULL, "MCA container"); static int mca_count; /* Number of records stored. */ static int mca_first; /* First (lowest) record ID. */ @@ -69,6 +70,32 @@ SYSCTL_INT(_hw_mca, OID_AUTO, first, CTL SYSCTL_INT(_hw_mca, OID_AUTO, last, CTLFLAG_RD, &mca_last, 0, "Last record id"); +static struct mtx mca_sysctl_lock; + +static int +mca_sysctl_inject(SYSCTL_HANDLER_ARGS) +{ + struct ia64_pal_result res; + u_int val; + int error; + + val = 0; + error = sysctl_wire_old_buffer(req, sizeof(u_int)); + if (!error) + error = sysctl_handle_int(oidp, &val, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + /* For example: val=137 causes a fatal CPU error. */ + res = ia64_call_pal_stacked(PAL_MC_ERROR_INJECT, val, 0, 0); + printf("%s: %#lx, %#lx, %#lx, %#lx\n", __func__, res.pal_status, + res.pal_result[0], res.pal_result[1], res.pal_result[2]); + return (0); +} +SYSCTL_PROC(_hw_mca, OID_AUTO, inject, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, + mca_sysctl_inject, "I", "set to trigger a MCA"); + static int mca_sysctl_handler(SYSCTL_HANDLER_ARGS) { @@ -85,27 +112,8 @@ mca_sysctl_handler(SYSCTL_HANDLER_ARGS) return (error); } -void -ia64_mca_populate(void) -{ - struct mca_info *rec; - - mtx_lock_spin(&mca_info_block_lock); - while (!STAILQ_EMPTY(&mca_records)) { - rec = STAILQ_FIRST(&mca_records); - STAILQ_REMOVE_HEAD(&mca_records, mi_link); - mtx_unlock_spin(&mca_info_block_lock); - (void)SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), - OID_AUTO, rec->mi_name, CTLTYPE_OPAQUE | CTLFLAG_RD, - rec->mi_record, rec->mi_recsz, mca_sysctl_handler, "S,MCA", - "Error record"); - mtx_lock_spin(&mca_info_block_lock); - } - mtx_unlock_spin(&mca_info_block_lock); -} - -void -ia64_mca_save_state(int type) +static void +ia64_mca_collect_state(int type, struct mca_info_list *reclst) { struct ia64_sal_result result; struct mca_record_header *hdr; @@ -123,13 +131,13 @@ ia64_mca_save_state(int type) if (mca_info_block == 0) return; - mtx_lock_spin(&mca_info_block_lock); while (1) { + mtx_lock_spin(&mca_info_block_lock); result = ia64_sal_entry(SAL_GET_STATE_INFO, type, 0, mca_info_block, 0, 0, 0, 0); if (result.sal_status < 0) { mtx_unlock_spin(&mca_info_block_lock); - return; + break; } hdr = (struct mca_record_header *)mca_info_block; @@ -142,9 +150,10 @@ ia64_mca_save_state(int type) M_NOWAIT | M_ZERO); if (rec == NULL) /* XXX: Not sure what to do. */ - return; + break; - sprintf(rec->mi_name, "%lld", (long long)seqnr); + rec->mi_seqnr = seqnr; + rec->mi_cpuid = PCPU_GET(cpuid); mtx_lock_spin(&mca_info_block_lock); @@ -163,7 +172,6 @@ ia64_mca_save_state(int type) if (seqnr != hdr->rh_seqnr) { mtx_unlock_spin(&mca_info_block_lock); free(rec, M_MCA); - mtx_lock_spin(&mca_info_block_lock); continue; } } @@ -171,23 +179,51 @@ ia64_mca_save_state(int type) rec->mi_recsz = recsz; bcopy((char*)mca_info_block, rec->mi_record, recsz); - if (mca_count > 0) { - if (seqnr < mca_first) - mca_first = seqnr; - else if (seqnr > mca_last) - mca_last = seqnr; - } else - mca_first = mca_last = seqnr; - - mca_count++; - STAILQ_INSERT_TAIL(&mca_records, rec, mi_link); - /* * Clear the state so that we get any other records when * they exist. */ result = ia64_sal_entry(SAL_CLEAR_STATE_INFO, type, 0, 0, 0, 0, 0, 0); + + mtx_unlock_spin(&mca_info_block_lock); + + STAILQ_INSERT_TAIL(reclst, rec, mi_link); + } +} + +void +ia64_mca_save_state(int type) +{ + char name[64]; + struct mca_info_list reclst = STAILQ_HEAD_INITIALIZER(reclst); + struct mca_info *rec; + struct sysctl_oid *oid; + + ia64_mca_collect_state(type, &reclst); + + STAILQ_FOREACH(rec, &reclst, mi_link) { + sprintf(name, "%lu", rec->mi_seqnr); + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), + OID_AUTO, name, CTLFLAG_RW, NULL, name); + if (oid == NULL) + continue; + + mtx_lock(&mca_sysctl_lock); + if (mca_count > 0) { + if (rec->mi_seqnr < mca_first) + mca_first = rec->mi_seqnr; + else if (rec->mi_seqnr > mca_last) + mca_last = rec->mi_seqnr; + } else + mca_first = mca_last = rec->mi_seqnr; + mca_count++; + mtx_unlock(&mca_sysctl_lock); + + sprintf(name, "%u", rec->mi_cpuid); + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), rec->mi_cpuid, + name, CTLTYPE_OPAQUE | CTLFLAG_RD, rec->mi_record, + rec->mi_recsz, mca_sysctl_handler, "S,MCA", "MCA record"); } } @@ -237,7 +273,14 @@ ia64_mca_init(void) * should be rare. On top of that, performance is not an issue when * dealing with machine checks... */ - mtx_init(&mca_info_block_lock, "MCA spin lock", NULL, MTX_SPIN); + mtx_init(&mca_info_block_lock, "MCA info lock", NULL, MTX_SPIN); + + /* + * Serialize sysctl operations with a sleep lock. Note that this + * implies that we update the sysctl tree in a context that allows + * sleeping. + */ + mtx_init(&mca_sysctl_lock, "MCA sysctl lock", NULL, MTX_DEF); /* * Get and save any processor and platfom error records. Note that in Modified: head/sys/ia64/include/mca.h ============================================================================== --- head/sys/ia64/include/mca.h Tue Apr 13 21:32:06 2010 (r206569) +++ head/sys/ia64/include/mca.h Tue Apr 13 22:20:12 2010 (r206570) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Marcel Moolenaar + * Copyright (c) 2002-2010 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -240,7 +240,6 @@ struct mca_pcidev_reg { #ifdef _KERNEL void ia64_mca_init(void); -void ia64_mca_populate(void); void ia64_mca_save_state(int); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 13 22:27:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16317106564A; Tue, 13 Apr 2010 22:27:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E08208FC0C; Tue, 13 Apr 2010 22:27: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 o3DMRdIh083081; Tue, 13 Apr 2010 22:27:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3DMRdgF083079; Tue, 13 Apr 2010 22:27:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004132227.o3DMRdgF083079@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 13 Apr 2010 22:27: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: r206571 - head/sbin/mca X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 22:27:40 -0000 Author: marcel Date: Tue Apr 13 22:27:39 2010 New Revision: 206571 URL: http://svn.freebsd.org/changeset/base/206571 Log: The sequence number is now a node under which the MCA records are hung by CPU id. When showing the MCA record, print the MIB as a comment. PR: ia64/113102 Modified: head/sbin/mca/mca.c Modified: head/sbin/mca/mca.c ============================================================================== --- head/sbin/mca/mca.c Tue Apr 13 22:20:12 2010 (r206570) +++ head/sbin/mca/mca.c Tue Apr 13 22:27:39 2010 (r206571) @@ -53,10 +53,12 @@ __FBSDID("$FreeBSD$"); #define BCD(x) ((x >> 4) * 10 + (x & 15)) +#define HW_MCA_MAX_CPUID 255 + static char hw_mca_count[] = "hw.mca.count"; static char hw_mca_first[] = "hw.mca.first"; static char hw_mca_last[] = "hw.mca.last"; -static char hw_mca_recid[] = "hw.mca.%d"; +static char hw_mca_recid[] = "hw.mca.%lu.%u"; static char default_dumpfile[] = "/var/log/mca.log"; @@ -372,10 +374,13 @@ show_section(struct mca_section_header * } static void -show(char *data) +show(char *data, const char *mib) { size_t reclen, seclen; + if (mib != NULL) + printf("\n", mib); + printf("\n"); reclen = show_header((void*)data) - sizeof(struct mca_record_header); data += sizeof(struct mca_record_header); @@ -402,7 +407,7 @@ showall(char *buf, size_t buflen) if (buflen < reclen) return; - show(buf); + show(buf, NULL); buf += reclen; buflen -= reclen; @@ -442,7 +447,7 @@ main(int argc, char **argv) char *buf; size_t len; int ch, error, fd; - int count, first, last; + int count, first, last, cpuid; while ((ch = getopt(argc, argv, "df:")) != -1) { switch(ch) { @@ -481,12 +486,19 @@ main(int argc, char **argv) if (error) err(1, hw_mca_last); + cpuid = 0; while (count && first <= last) { - sprintf(mib, hw_mca_recid, first); - len = 0; - error = sysctlbyname(mib, NULL, &len, NULL, 0); - if (error == ENOENT) { + do { + sprintf(mib, hw_mca_recid, first, cpuid); + len = 0; + error = sysctlbyname(mib, NULL, &len, NULL, 0); + if (error != ENOENT) + break; + cpuid++; + } while (cpuid <= HW_MCA_MAX_CPUID); + if (error == ENOENT && cpuid > HW_MCA_MAX_CPUID) { first++; + cpuid = 0; continue; } if (error) @@ -503,11 +515,15 @@ main(int argc, char **argv) if (fl_dump) dump(buf); else - show(buf); + show(buf, mib); free(buf); - first++; count--; + if (cpuid == HW_MCA_MAX_CPUID) { + first++; + cpuid = 0; + } else + cpuid++; } } else { fd = open(file, O_RDONLY); From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 01:29:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A8BC106564A; Wed, 14 Apr 2010 01:29:31 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0BF8FC12; Wed, 14 Apr 2010 01:29: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 o3E1TVdG023941; Wed, 14 Apr 2010 01:29:31 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3E1TVY8023939; Wed, 14 Apr 2010 01:29:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201004140129.o3E1TVY8023939@svn.freebsd.org> From: Neel Natu Date: Wed, 14 Apr 2010 01:29: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: r206582 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 01:29:31 -0000 Author: neel Date: Wed Apr 14 01:29:31 2010 New Revision: 206582 URL: http://svn.freebsd.org/changeset/base/206582 Log: Revert the vm_machdep.c part of r205072. This causes a panic in vm_thread_dispose() when it tries to add this kstack to the kstack cache. This happens only when 'td_kstack' is not (PAGE_SIZE * 2) bytes aligned and we have unmapped the page at that address in cpu_thread_alloc. Pointed out by: nwhitehorn@ Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:24:09 2010 (r206581) +++ head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:29:31 2010 (r206582) @@ -214,16 +214,6 @@ cpu_thread_swapin(struct thread *td) { pt_entry_t *pte; int i; - vm_offset_t unused_kstack_page; - - /* - * Unmap the unused kstack page. - */ - unused_kstack_page = td->td_kstack; - if (td->td_md.md_realstack == td->td_kstack) - unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE; - - pmap_kremove(unused_kstack_page); /* * The kstack may be at a different physical address now. @@ -249,19 +239,13 @@ cpu_thread_swapout(struct thread *td) void cpu_thread_alloc(struct thread *td) { - vm_offset_t unused_kstack_page; pt_entry_t *pte; int i; - if (td->td_kstack & (1 << PAGE_SHIFT)) { + if (td->td_kstack & (1 << PAGE_SHIFT)) td->td_md.md_realstack = td->td_kstack + PAGE_SIZE; - unused_kstack_page = td->td_kstack; - } else { + else td->td_md.md_realstack = td->td_kstack; - unused_kstack_page = td->td_kstack + - (KSTACK_PAGES - 1) * PAGE_SIZE; - } - pmap_kremove(unused_kstack_page); td->td_pcb = (struct pcb *)(td->td_md.md_realstack + (td->td_kstack_pages - 1) * PAGE_SIZE) - 1; From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 01:57:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 304F31065676; Wed, 14 Apr 2010 01:57:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20D088FC16; Wed, 14 Apr 2010 01:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3E1vsHs030215; Wed, 14 Apr 2010 01:57:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3E1vsLt030213; Wed, 14 Apr 2010 01:57:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201004140157.o3E1vsLt030213@svn.freebsd.org> From: Neel Natu Date: Wed, 14 Apr 2010 01:57: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: r206584 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 01:57:54 -0000 Author: neel Date: Wed Apr 14 01:57:53 2010 New Revision: 206584 URL: http://svn.freebsd.org/changeset/base/206584 Log: Destroy the pmap 'pm_mutex' in pmap_release() otherwise we will panic subsequently in pmap_pinit() with the following signature: panic: lock "pmap" 0xc7878bc8 already initialized This bug was uncovered by the changes made to vm_map.c in r206140. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Apr 14 01:43:25 2010 (r206583) +++ head/sys/mips/mips/pmap.c Wed Apr 14 01:57:53 2010 (r206584) @@ -1263,6 +1263,7 @@ pmap_release(pmap_t pmap) ptdpg->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(ptdpg); + PMAP_LOCK_DESTROY(pmap); } /* From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 07:07:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88653106566B; Wed, 14 Apr 2010 07:07:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 763EE8FC0A; Wed, 14 Apr 2010 07:07: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 o3E77hgd098890; Wed, 14 Apr 2010 07:07:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3E77h8L098888; Wed, 14 Apr 2010 07:07:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201004140707.o3E77h8L098888@svn.freebsd.org> From: Kevin Lo Date: Wed, 14 Apr 2010 07:07: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: r206595 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 07:07:43 -0000 Author: kevlo Date: Wed Apr 14 07:07:43 2010 New Revision: 206595 URL: http://svn.freebsd.org/changeset/base/206595 Log: Eliminate duplicate comment Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Apr 14 06:56:48 2010 (r206594) +++ head/sys/dev/usb/usbdevs Wed Apr 14 07:07:43 2010 (r206595) @@ -2516,7 +2516,6 @@ product QUALCOMMINC E2002 0x2002 3G mode product QUALCOMMINC E2003 0x2003 3G modem /* Quanta products */ -/* Quanta products */ product QUANTA RW6815_1 0x00ce HP iPAQ rw6815 product QUANTA RT3070 0x0304 RT3070 product QUANTA Q101_STOR 0x1000 USB Q101 Storage From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 07:46:22 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFA2106564A; Wed, 14 Apr 2010 07:46:22 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id CECC98FC12; Wed, 14 Apr 2010 07:46:20 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 51A7045CD9; Wed, 14 Apr 2010 09:46:18 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 57C6345C9B; Wed, 14 Apr 2010 09:46:13 +0200 (CEST) Date: Wed, 14 Apr 2010 09:46:17 +0200 From: Pawel Jakub Dawidek To: Luigi Rizzo Message-ID: <20100414074616.GA1657@garage.freebsd.pl> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20100412210512.GB94885@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 07:46:22 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 12, 2010 at 11:05:12PM +0200, Luigi Rizzo wrote: > On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote: > ... > > > @@ -0,0 +1,19 @@ > > > +# GEOM_LIBRARY_PATH > > > +# $FreeBSD$ > > > + > > > +.PATH: /usr/src/sbin/geom/misc > > > + > > > +CFLAGS +=3D -I/usr/src/sbin/geom > >=20 > > This doesn't look right. >=20 > probably a leftover from older versions of this code for 6.x . > I will do more tests tomorrow (for 7.x at this point, there is > no point in trying to support 6.x I believe) and try to remove > it if not necessary. As Rui said you should use ${.CURDIR} instead of hardcoding /usr/src/. BTW. So you decided to implement insert/remove functionality after all. I have some questions: - It is implemented as internal gsched hack, which is a pity, because this might be very useful functionality for other classes in the future. Is there a plan to make it more general and move it to the GEOM itself? - Why g_sched_flush_pending() operates on global structure? I think it will break if you try to insert and remove at the same time. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvFcsgACgkQForvXbEpPzSgTQCgk300EKdL36NzV2dwl5K2E59L cA0AoMICf8zhh4mTBF6i9i4Gh5f1jD5t =W8nO -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 07:58:42 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC931106566B; Wed, 14 Apr 2010 07:58:42 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id F371B8FC0C; Wed, 14 Apr 2010 07:58:41 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 18C6145EEF; Wed, 14 Apr 2010 09:58:40 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 13EB445CDD; Wed, 14 Apr 2010 09:58:35 +0200 (CEST) Date: Wed, 14 Apr 2010 09:58:38 +0200 From: Pawel Jakub Dawidek To: Luigi Rizzo Message-ID: <20100414075838.GB1657@garage.freebsd.pl> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> <20100414074616.GA1657@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" Content-Disposition: inline In-Reply-To: <20100414074616.GA1657@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 07:58:42 -0000 --xXmbgvnjoT4axfJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 14, 2010 at 09:46:17AM +0200, Pawel Jakub Dawidek wrote: > BTW. So you decided to implement insert/remove functionality after all. > I have some questions: >=20 > - It is implemented as internal gsched hack, which is a pity, because > this might be very useful functionality for other classes in the future. > Is there a plan to make it more general and move it to the GEOM itself? >=20 > - Why g_sched_flush_pending() operates on global structure? I think it > will break if you try to insert and remove at the same time. One more thing:) If I read code correctly, new provider has different name than the original one. If my userland tool send command to my class and my class tries to find provider by name by scaning existing geoms, it won't find it, because provider's name is different. Wouldn't it better to change old provider's name and use the name old provider had for new provider? Sounds hackish... Another thing that comes to my mind is possibility to create providers that are not represented in /dev/. Name collision wouldn't be a problem then. Also, it seems nicer to not polute /dev/ with such proxy-providers. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvFda4ACgkQForvXbEpPzSslgCg+NK3e2MBqRWd0jy/8NjcWCc5 +M8AnAlsYy+4vJ+ZHReOg+5aPEPd1p2Q =8nnJ -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 08:06:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 613D31065673; Wed, 14 Apr 2010 08:06:05 +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 1B0628FC1A; Wed, 14 Apr 2010 08:06:04 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 255D373098; Wed, 14 Apr 2010 10:16:30 +0200 (CEST) Date: Wed, 14 Apr 2010 10:16:30 +0200 From: Luigi Rizzo To: Pawel Jakub Dawidek , fabio@gandalf.sssup.it Message-ID: <20100414081630.GA74130@onelab2.iet.unipi.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> <20100414074616.GA1657@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414074616.GA1657@garage.freebsd.pl> 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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 08:06:05 -0000 [Cc-ing Fabio as he may have more details] On Wed, Apr 14, 2010 at 09:46:17AM +0200, Pawel Jakub Dawidek wrote: > On Mon, Apr 12, 2010 at 11:05:12PM +0200, Luigi Rizzo wrote: > > On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote: > > ... > > > > @@ -0,0 +1,19 @@ > > > > +# GEOM_LIBRARY_PATH > > > > +# $FreeBSD$ > > > > + > > > > +.PATH: /usr/src/sbin/geom/misc > > > > + > > > > +CFLAGS += -I/usr/src/sbin/geom > > > > > > This doesn't look right. > > > > probably a leftover from older versions of this code for 6.x . > > I will do more tests tomorrow (for 7.x at this point, there is > > no point in trying to support 6.x I believe) and try to remove > > it if not necessary. > > As Rui said you should use ${.CURDIR} instead of hardcoding /usr/src/. I thought i already fixed this yesterday. > BTW. So you decided to implement insert/remove functionality after all. > I have some questions: > > - It is implemented as internal gsched hack, which is a pity, because > this might be very useful functionality for other classes in the future. > Is there a plan to make it more general and move it to the GEOM itself? yes there is such a plan -- of course if nobody has objections. In principle it is only a library extensions with no modifications to geom internals. However, when we developed that last year, we hit some corner case where removal of an active node causes either a race or (if you try to protect from the race) a livelock. Fixing this may require some small cleanup to geom internals (we discusses the issue with phk at last EuroBSDCon. Fabio may give you more details, as far as i remember the problem was that some geom code takes shortcuts instead of following a chain of pointers, and this can end up in the wrong place in case of a removal.) For this reason, at this time i am not recommending to remove a node from a chain with outstanding transactions until the issue is solved. > - Why g_sched_flush_pending() operates on global structure? I think it > will break if you try to insert and remove at the same time. i need to check this. cheers luigi From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 08:40:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9038A1065670; Wed, 14 Apr 2010 08:40:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 071F88FC0A; Wed, 14 Apr 2010 08:40:41 +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 o3E8ebst001396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3E8ebB4092175; Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3E8ebxg092174; Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 14 Apr 2010 11:40:37 +0300 From: Kostik Belousov To: Jaakko Heinonen Message-ID: <20100414084037.GK2415@deviant.kiev.zoral.com.ua> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pJtUjZ2dt//FV8b" Content-Disposition: inline In-Reply-To: <201004131853.o3DIrdOT035078@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=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 08:40:42 -0000 --+pJtUjZ2dt//FV8b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 13, 2010 at 06:53:39PM +0000, Jaakko Heinonen wrote: > Author: jh > Date: Tue Apr 13 18:53:39 2010 > New Revision: 206560 > URL: http://svn.freebsd.org/changeset/base/206560 >=20 > Log: > - Ignore and report duplicate and empty device names in devfs_populate_= loop() > instead of causing erratic behavior. Currently make_dev(9) can't fail= , so > there is no way to report an error to make_dev(9) callers. > - Disallow using "." and ".." in device path names. It didn't work prev= iously > but now it is reported rather than panicing. > - Treat multiple sequential slashes as single in device path names. > =20 > Discussed with: pjd I think that this could be done more clean. Main motivation of not changing make_dev(9) seems to be desire to avoid handling impossible errors for creation of simple-named devices, where device name is fully controlled by driver. On the other hand, make_dev(9) is sometimes used to create devfs node with externally-supplied name, that does not obey devfs naming rules, or cause some other irregularity. The make_dev_credf() signature can be changed to return int error code instead of void, and a flag, lets call it MAKEDEV_CHECKNAME, added, that specifies that make_dev_credf() is allowed to fail with error EINVAL if supplied name is not sane. If flag is not supplied, make_dev_credf() should KASSERT or even just panic(9) if name does not pass internal validation. Small comment about the patch itself: Collapsion of the consequent '/' may be done in make_dev_credv() immediately after vsnprintf(). --+pJtUjZ2dt//FV8b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvFf4QACgkQC3+MBN1Mb4g7jACfVTb9ZWTjg48Rii94b+inlhgB OlEAn0V+ywtGfpP5BRG5PgI6fIXZYp2v =rqAv -----END PGP SIGNATURE----- --+pJtUjZ2dt//FV8b-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 12:49:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57DCD1065672; Wed, 14 Apr 2010 12:49:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 1332B8FC12; Wed, 14 Apr 2010 12:49:18 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 8A96F13987E; Wed, 14 Apr 2010 15:49:13 +0300 (EEST) Date: Wed, 14 Apr 2010 15:49:13 +0300 From: Jaakko Heinonen To: Kostik Belousov Message-ID: <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414084037.GK2415@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: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 12:49:19 -0000 Thank you for your comments. On 2010-04-14, Kostik Belousov wrote: > The make_dev_credf() signature can be changed to return int error code > instead of void, and a flag, lets call it MAKEDEV_CHECKNAME, added, make_dev_credf() returns struct cdev *, not void. > that specifies that make_dev_credf() is allowed to fail with error > EINVAL if supplied name is not sane. If flag is not supplied, > make_dev_credf() should KASSERT or even just panic(9) if name > does not pass internal validation. Otherwise sounds reasonable suggestion. However changes are needed in devfs. Currently devfs_populate_loop() is not along the make_dev*() code path but make_dev(9) increases a generation counter and devfs_populate_loop() gets called sometimes later. To make things more complex there may be several devfs mounts with different symlinks (files). Actually my change doesn't work correctly in all cases with multiple devfs mounts and has another bug with cdp use counts. I am considering reverting the change. -- Jaakko From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 13:03:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF231065675; Wed, 14 Apr 2010 13:03:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CC2598FC12; Wed, 14 Apr 2010 13:03:47 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3ED3hcn026143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Apr 2010 16:03:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3ED3h1q099664; Wed, 14 Apr 2010 16:03:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3ED3hqf099663; Wed, 14 Apr 2010 16:03:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 14 Apr 2010 16:03:43 +0300 From: Kostik Belousov To: Jaakko Heinonen Message-ID: <20100414130343.GO2415@deviant.kiev.zoral.com.ua> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MU/JeB64KdLsYIeZ" Content-Disposition: inline In-Reply-To: <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:03:48 -0000 --MU/JeB64KdLsYIeZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 14, 2010 at 03:49:13PM +0300, Jaakko Heinonen wrote: >=20 > Thank you for your comments. >=20 > On 2010-04-14, Kostik Belousov wrote: > > The make_dev_credf() signature can be changed to return int error code > > instead of void, and a flag, lets call it MAKEDEV_CHECKNAME, added, >=20 > make_dev_credf() returns struct cdev *, not void. Oops, forgot about this. We will need to change its signature more radically, but I still think that this worth it. >=20 > > that specifies that make_dev_credf() is allowed to fail with error > > EINVAL if supplied name is not sane. If flag is not supplied, > > make_dev_credf() should KASSERT or even just panic(9) if name > > does not pass internal validation. >=20 > Otherwise sounds reasonable suggestion. However changes are needed in > devfs. Currently devfs_populate_loop() is not along the make_dev*() > code path but make_dev(9) increases a generation counter and > devfs_populate_loop() gets called sometimes later. To make things more > complex there may be several devfs mounts with different symlinks (files). Right, my point of my suggestion was to not modify populate_loop() at all. >=20 > Actually my change doesn't work correctly in all cases with multiple > devfs mounts and has another bug with cdp use counts. I am considering > reverting the change. >=20 > --=20 > Jaakko --MU/JeB64KdLsYIeZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvFvS4ACgkQC3+MBN1Mb4jP6gCeIrq+1mGt6ZA00453/M3EWYBg 3m8AoN6neQ1qNvWkkvFI1QDpD3Pd4YHL =2xwd -----END PGP SIGNATURE----- --MU/JeB64KdLsYIeZ-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 13:44:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B4A106566C; Wed, 14 Apr 2010 13:44:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9688FC0A; Wed, 14 Apr 2010 13:44: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 o3EDiNEJ087792; Wed, 14 Apr 2010 13:44:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EDiNYa087790; Wed, 14 Apr 2010 13:44:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004141344.o3EDiNYa087790@svn.freebsd.org> From: Ed Maste Date: Wed, 14 Apr 2010 13:44: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: r206597 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:44:23 -0000 Author: emaste Date: Wed Apr 14 13:44:22 2010 New Revision: 206597 URL: http://svn.freebsd.org/changeset/base/206597 Log: Linux puts a blank line between each CPU. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Apr 14 07:29:25 2010 (r206596) +++ head/sys/compat/linprocfs/linprocfs.c Wed Apr 14 13:44:22 2010 (r206597) @@ -274,7 +274,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "cpu family\t: %d\n" "model\t\t: %d\n" "model name\t: %s\n" - "stepping\t: %d\n", + "stepping\t: %d\n\n", i, cpu_vendor, class, cpu, model, cpu_id & 0xf); /* XXX per-cpu vendor / class / model / id? */ } From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 14:20:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1DCD106566C; Wed, 14 Apr 2010 14:20:05 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 5E81B8FC1B; Wed, 14 Apr 2010 14:20:05 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 42F0413980F; Wed, 14 Apr 2010 17:20:00 +0300 (EEST) Date: Wed, 14 Apr 2010 17:20:00 +0300 From: Jaakko Heinonen To: Kostik Belousov Message-ID: <20100414141959.GA3276@a91-153-117-195.elisa-laajakaista.fi> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> <20100414130343.GO2415@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414130343.GO2415@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: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 14:20:05 -0000 On 2010-04-14, Kostik Belousov wrote: > > Otherwise sounds reasonable suggestion. However changes are needed in > > devfs. Currently devfs_populate_loop() is not along the make_dev*() > > code path but make_dev(9) increases a generation counter and > > devfs_populate_loop() gets called sometimes later. To make things more > > complex there may be several devfs mounts with different symlinks (files). > Right, my point of my suggestion was to not modify populate_loop() at all. How you would detect an attempt to create a duplicate file then? Please note that there may be directories and user created symbolic links. The file set may be different on different devfs mounts. -- Jaakko From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 15:29:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B1C1065673; Wed, 14 Apr 2010 15:29:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 835B98FC0A; Wed, 14 Apr 2010 15:29: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 o3EFTWld011508; Wed, 14 Apr 2010 15:29:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EFTWd9011506; Wed, 14 Apr 2010 15:29:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004141529.o3EFTWd9011506@svn.freebsd.org> From: Alexander Motin Date: Wed, 14 Apr 2010 15:29: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: r206604 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 15:29:32 -0000 Author: mav Date: Wed Apr 14 15:29:32 2010 New Revision: 206604 URL: http://svn.freebsd.org/changeset/base/206604 Log: For early ALI chips do not announce I/O sizes that require unsupported 48bit DMA commands. 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 Wed Apr 14 15:23:16 2010 (r206603) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Wed Apr 14 15:29:32 2010 (r206604) @@ -184,8 +184,11 @@ ata_ali_ch_attach(device_t dev) 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) + if (ctlr->chip->chiprev <= 0xc4) { ch->flags |= ATA_NO_48BIT_DMA; + if (ch->dma.max_iosize > 256 * 512) + ch->dma.max_iosize = 256 * 512; + } return 0; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 15:42:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4216B1065670; Wed, 14 Apr 2010 15:42:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id AED4F8FC12; Wed, 14 Apr 2010 15:42:52 +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 o3EFgmco040831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Apr 2010 18:42:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3EFgmqD000803; Wed, 14 Apr 2010 18:42:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3EFgmqA000802; Wed, 14 Apr 2010 18:42:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 14 Apr 2010 18:42:48 +0300 From: Kostik Belousov To: Jaakko Heinonen Message-ID: <20100414154248.GR2415@deviant.kiev.zoral.com.ua> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> <20100414130343.GO2415@deviant.kiev.zoral.com.ua> <20100414141959.GA3276@a91-153-117-195.elisa-laajakaista.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a2fP9eRwxR5lvdkO" Content-Disposition: inline In-Reply-To: <20100414141959.GA3276@a91-153-117-195.elisa-laajakaista.fi> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 15:42:53 -0000 --a2fP9eRwxR5lvdkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 14, 2010 at 05:20:00PM +0300, Jaakko Heinonen wrote: > On 2010-04-14, Kostik Belousov wrote: > > > Otherwise sounds reasonable suggestion. However changes are needed in > > > devfs. Currently devfs_populate_loop() is not along the make_dev*() > > > code path but make_dev(9) increases a generation counter and > > > devfs_populate_loop() gets called sometimes later. To make things more > > > complex there may be several devfs mounts with different symlinks (fi= les). > > Right, my point of my suggestion was to not modify populate_loop() at a= ll. >=20 > How you would detect an attempt to create a duplicate file then? Please > note that there may be directories and user created symbolic links. The > file set may be different on different devfs mounts. First, I think we shall sort dirent->dd_dlist so that symlinks are located before any other entries, and allow for duplication of any name with the name of symlink. I remember there was a PR to change devfs_symlink() so that symlink is added to dd_dlist into head, not to a tail, as it is done now. The change itself is not enough, but together with other parts of this it might be ok. Assume that all full devfs pathes except symlinks are stored somewhere with type information for the component at the end. Then, just iterating this set at make_dev() time, we can verify that name is not a duplicate, and that the path components are not already used as device name (only as directories). The pathes storage need to be protected by dev_mtx.=20 Possibly, the cdev_priv.c_dev.__si_namebuf may be reused at the cost of long check at the make_dev() time. The symlink creation shall also put the path of its containing directory into the store. What do you think of this ? --a2fP9eRwxR5lvdkO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvF4ncACgkQC3+MBN1Mb4j3BQCfWYVWBBAd+a+QAtgdSQ7u6Be7 NcoAn0geNdMZXjY5ETj7UheQCBm48/CZ =BOJe -----END PGP SIGNATURE----- --a2fP9eRwxR5lvdkO-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 16:52:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 742B5106566B; Wed, 14 Apr 2010 16:52:02 +0000 (UTC) (envelope-from fabio@freebsd.org) Received: from sssup.it (ms01.sssup.it [193.205.80.99]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7C88FC22; Wed, 14 Apr 2010 16:52:01 +0000 (UTC) Received: from [10.30.3.72] (HELO smaug.retis) by sssup.it (CommuniGate Pro SMTP 5.3.2) with ESMTP id 59390896; Wed, 14 Apr 2010 17:50:54 +0200 Received: by smaug.retis (Postfix, from userid 1000) id 5024D5B76F; Wed, 14 Apr 2010 18:05:54 +0200 (CEST) Date: Wed, 14 Apr 2010 18:05:54 +0200 From: Fabio Checconi To: Luigi Rizzo Message-ID: <20100414160554.GB3188@gandalf.sssup.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> <20100414074616.GA1657@garage.freebsd.pl> <20100414081630.GA74130@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414081630.GA74130@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.20 (2009-10-28) Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 16:52:02 -0000 > From: Luigi Rizzo > Date: Wed, Apr 14, 2010 10:16:30AM +0200 > > [Cc-ing Fabio as he may have more details] > ... > > BTW. So you decided to implement insert/remove functionality after all. > > I have some questions: > > > > - It is implemented as internal gsched hack, which is a pity, because > > this might be very useful functionality for other classes in the future. > > Is there a plan to make it more general and move it to the GEOM itself? > > yes there is such a plan -- of course if nobody has objections. > In principle it is only a library extensions with no modifications > to geom internals. > > However, when we developed that last year, we hit some corner case > where removal of an active node causes either a race or (if you try > to protect from the race) a livelock. Fixing this may require some > small cleanup to geom internals (we discusses the issue with phk > at last EuroBSDCon. Fabio may give you more details, as far as i > remember the problem was that some geom code takes shortcuts instead > of following a chain of pointers, and this can end up in the wrong > place in case of a removal.) > > For this reason, at this time i am not recommending to remove a > node from a chain with outstanding transactions until the issue is solved. > I'm not sure I remember all the details, the major issues were: - g_disk_done() dereferences bio->parent->bio_to->geom->softc, thus changing bio_to->geom on the fly was not possible with pending request (they would find a wrong softc when bubbling up). For this reason we added a loop in g_insert_proxy() to wait for all the pending requests to be completed prior to inserting the proxy; but: - g_slice_finish_hot() completes requests in the event handling path, thus said loop (executed from an event handler) could result in a deadlock. To avoid this (it should be far from being frequent, considering the usages of hotspots in the slice code) g_insert_proxy() fails if it takes too long to complete the old requests. - Some classes (from a quick look I've seen only g_mirror, but I'm pretty sure there were some other ones) cache pointers to their providers. With these classes this implementation does not work. For the scheduler this is not a big issue, because its natural position is as close as possible to the disk device, but makes the mechanism quite hard to use in a more generic context. > > - Why g_sched_flush_pending() operates on global structure? I think it > > will break if you try to insert and remove at the same time. > If I'm not wrong, this should be safe because the global list is used only under critical sections protected by the topology lock. From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 17:09:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D0F106566B; Wed, 14 Apr 2010 17:09:54 +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 22D988FC19; Wed, 14 Apr 2010 17:09:53 +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 o3EH9qZm047793; Wed, 14 Apr 2010 19:09:52 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o3EH9qiS047792; Wed, 14 Apr 2010 19:09:52 +0200 (CEST) (envelope-from marius) Date: Wed, 14 Apr 2010 19:09:52 +0200 From: Marius Strobl To: Alexander Motin Message-ID: <20100414170952.GA23301@alchemy.franken.de> References: <201004141529.o3EFTWd9011506@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004141529.o3EFTWd9011506@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206604 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 17:09:54 -0000 On Wed, Apr 14, 2010 at 03:29:32PM +0000, Alexander Motin wrote: > Author: mav > Date: Wed Apr 14 15:29:32 2010 > New Revision: 206604 > URL: http://svn.freebsd.org/changeset/base/206604 > > Log: > For early ALI chips do not announce I/O sizes that require unsupported > 48bit DMA commands. Wouldn't it make more sense to limit the I/O size based ATA_NO_48BIT_DMA in a central place rather than letting each chipset driver deal with it? Marius From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 17:44:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E78106564A; Wed, 14 Apr 2010 17:44:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 162588FC29; Wed, 14 Apr 2010 17:44:30 +0000 (UTC) Received: by bwz6 with SMTP id 6so395518bwz.13 for ; Wed, 14 Apr 2010 10:44:29 -0700 (PDT) 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=lVUQafcY8476Z1Kn0v8PhQmShLbvS7DKHE5KCBl+FJg=; b=sPzt8DO64SGECq6ImzaEl+285cbiVcfWBjC6Y74YT597uz3ij/KV/zUIlHjXqVZuSe o79i3pi3ZbqGT4XmC7PAMlcGpqLJIISxgOPCagBlUOpeMqjBm0sBCYpRapojz8IHfuDH KvCzXZ6syPb5CzwLV4xM2C2RjlpX798R9kgg8= 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=dMFP+baJygbzjY1n02PbLPnGil0eMtVPFrYOhuhd2UtPs5KhJWG/gXmLdEifkyz0Lc 4SUgaHrIoAgI3y65GDoXH8MOgGEPZn3ojCw/WjXlrPqNWRRPxe9aejDUU+LYzGbreR24 KQzRiAH2Sg8Dwt4yV2FjXQZ5lYC/+6oHIQSo4= Received: by 10.103.76.26 with SMTP id d26mr4320175mul.115.1271267069479; Wed, 14 Apr 2010 10:44:29 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id i5sm3407341mue.19.2010.04.14.10.44.27 (version=SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 10:44:28 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BC5FEF3.2090801@FreeBSD.org> Date: Wed, 14 Apr 2010 20:44:19 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Marius Strobl References: <201004141529.o3EFTWd9011506@svn.freebsd.org> <20100414170952.GA23301@alchemy.franken.de> In-Reply-To: <20100414170952.GA23301@alchemy.franken.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206604 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 17:44:32 -0000 Marius Strobl wrote: > On Wed, Apr 14, 2010 at 03:29:32PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Wed Apr 14 15:29:32 2010 >> New Revision: 206604 >> URL: http://svn.freebsd.org/changeset/base/206604 >> >> Log: >> For early ALI chips do not announce I/O sizes that require unsupported >> 48bit DMA commands. > > Wouldn't it make more sense to limit the I/O size based ATA_NO_48BIT_DMA > in a central place rather than letting each chipset driver deal with it? This driver is the only place where this flag is set now. And looking that 48bit is almost mandatory now, unlikely it will be ever needed again. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 18:29:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6861065672; Wed, 14 Apr 2010 18:29:01 +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 BA0228FC19; Wed, 14 Apr 2010 18:29: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 o3EIT1jt051473; Wed, 14 Apr 2010 18:29:01 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EIT13q051471; Wed, 14 Apr 2010 18:29:01 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004141829.o3EIT13q051471@svn.freebsd.org> From: Jack F Vogel Date: Wed, 14 Apr 2010 18:29: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: r206614 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:29:01 -0000 Author: jfv Date: Wed Apr 14 18:29:01 2010 New Revision: 206614 URL: http://svn.freebsd.org/changeset/base/206614 Log: Remove multiqueue stack related stuff form lem, it is unneeded for legacy hardware. Also remove some TSO related cruft. Add some watchdog_time setting that was missing, thanks to Mikolaj Golub for pointing that out. Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Apr 14 17:52:00 2010 (r206613) +++ head/sys/dev/e1000/if_lem.c Wed Apr 14 18:29:01 2010 (r206614) @@ -39,9 +39,6 @@ #include #include -#if __FreeBSD_version >= 800000 -#include -#endif #include #include #include @@ -94,7 +91,7 @@ int lem_display_debug_stats = 0; /********************************************************************* * Legacy Em Driver version: *********************************************************************/ -char lem_driver_version[] = "1.0.0"; +char lem_driver_version[] = "1.0.1"; /********************************************************************* @@ -177,11 +174,6 @@ static int lem_suspend(device_t); static int lem_resume(device_t); static void lem_start(struct ifnet *); static void lem_start_locked(struct ifnet *ifp); -#if __FreeBSD_version >= 800000 -static int lem_mq_start(struct ifnet *, struct mbuf *); -static int lem_mq_start_locked(struct ifnet *, struct mbuf *); -static void lem_qflush(struct ifnet *); -#endif static int lem_ioctl(struct ifnet *, u_long, caddr_t); static void lem_init(void *); static void lem_init_locked(struct adapter *); @@ -304,12 +296,6 @@ MODULE_DEPEND(lem, ether, 1, 1, 1); #define EM_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) -#define M_TSO_LEN 66 - -/* Allow common code without TSO */ -#ifndef CSUM_TSO -#define CSUM_TSO 0 -#endif static int lem_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int lem_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); @@ -827,118 +813,6 @@ lem_resume(device_t dev) } -/********************************************************************* - * Transmit entry point - * - * em_start is called by the stack to initiate a transmit. - * The driver will remain in this routine as long as there are - * packets to transmit and transmit resources are available. - * In case resources are not available stack is notified and - * the packet is requeued. - **********************************************************************/ - -#if __FreeBSD_version >= 800000 -static int -lem_mq_start_locked(struct ifnet *ifp, struct mbuf *m) -{ - struct adapter *adapter = ifp->if_softc; - struct mbuf *next; - int error = E1000_SUCCESS; - - EM_TX_LOCK_ASSERT(adapter); - /* To allow being called from a tasklet */ - if (m == NULL) - goto process; - - if (((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) - || (!adapter->link_active)) { - error = drbr_enqueue(ifp, adapter->br, m); - return (error); - } else if (drbr_empty(ifp, adapter->br) && - (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) { - if ((error = lem_xmit(adapter, &m)) != 0) { - if (m) - error = drbr_enqueue(ifp, adapter->br, m); - return (error); - } else { - /* - * We've bypassed the buf ring so we need to update - * ifp directly - */ - drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); - /* - ** Send a copy of the frame to the BPF - ** listener and set the watchdog on. - */ - ETHER_BPF_MTAP(ifp, m); - adapter->watchdog_check = TRUE; - } - } else if ((error = drbr_enqueue(ifp, adapter->br, m)) != 0) - return (error); - -process: - if (drbr_empty(ifp, adapter->br)) - return(error); - /* Process the queue */ - while (TRUE) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - break; - next = drbr_dequeue(ifp, adapter->br); - if (next == NULL) - break; - if ((error = lem_xmit(adapter, &next)) != 0) { - if (next != NULL) - error = drbr_enqueue(ifp, adapter->br, next); - break; - } - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); - ETHER_BPF_MTAP(ifp, next); - /* Set the watchdog */ - adapter->watchdog_check = TRUE; - } - - if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - - return (error); -} - -/* -** Multiqueue capable stack interface, this is not -** yet truely multiqueue, but that is coming... -*/ -static int -lem_mq_start(struct ifnet *ifp, struct mbuf *m) -{ - - struct adapter *adapter = ifp->if_softc; - int error = 0; - - if (EM_TX_TRYLOCK(adapter)) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - error = lem_mq_start_locked(ifp, m); - EM_TX_UNLOCK(adapter); - } else - error = drbr_enqueue(ifp, adapter->br, m); - - return (error); -} - -static void -lem_qflush(struct ifnet *ifp) -{ - struct mbuf *m; - struct adapter *adapter = (struct adapter *)ifp->if_softc; - - EM_TX_LOCK(adapter); - while ((m = buf_ring_dequeue_sc(adapter->br)) != NULL) - m_freem(m); - if_qflush(ifp); - EM_TX_UNLOCK(adapter); -} -#endif /* FreeBSD_version */ - static void lem_start_locked(struct ifnet *ifp) { @@ -975,6 +849,7 @@ lem_start_locked(struct ifnet *ifp) /* Set timeout in case hardware has problems transmitting. */ adapter->watchdog_check = TRUE; + adapter->watchdog_time = ticks; } if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) ifp->if_drv_flags |= IFF_DRV_OACTIVE; @@ -1151,12 +1026,6 @@ lem_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_HWCSUM; reinit = 1; } -#if __FreeBSD_version >= 700000 - if (mask & IFCAP_TSO4) { - ifp->if_capenable ^= IFCAP_TSO4; - reinit = 1; - } -#endif if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = 1; @@ -1279,10 +1148,6 @@ lem_init_locked(struct adapter *adapter) if (adapter->hw.mac.type >= e1000_82543) { if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); -#if __FreeBSD_version >= 700000 - if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_TSO; -#endif } /* Configure for OS presence */ @@ -1394,13 +1259,8 @@ lem_poll(struct ifnet *ifp, enum poll_cm EM_TX_LOCK(adapter); lem_txeof(adapter); -#if __FreeBSD_version >= 800000 - if (!drbr_empty(ifp, adapter->br)) - lem_mq_start_locked(ifp, NULL); -#else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) lem_start_locked(ifp); -#endif EM_TX_UNLOCK(adapter); return (rx_done); } @@ -1494,14 +1354,8 @@ lem_handle_rxtx(void *context, int pendi taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); EM_TX_LOCK(adapter); lem_txeof(adapter); - -#if __FreeBSD_version >= 800000 - if (!drbr_empty(ifp, adapter->br)) - lem_mq_start_locked(ifp, NULL); -#else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) lem_start_locked(ifp); -#endif EM_TX_UNLOCK(adapter); } @@ -1852,15 +1706,17 @@ lem_xmit(struct adapter *adapter, struct if (mtag != NULL) { ctxd->upper.fields.special = htole16(VLAN_TAG_VALUE(mtag)); + ctxd->lower.data |= htole32(E1000_TXD_CMD_VLE); + } #else /* FreeBSD 7 */ if (m_head->m_flags & M_VLANTAG) { /* Set the vlan id. */ ctxd->upper.fields.special = htole16(m_head->m_pkthdr.ether_vtag); -#endif /* Tell hardware to add tag */ ctxd->lower.data |= htole32(E1000_TXD_CMD_VLE); } +#endif tx_buffer->m_head = m_head; tx_buffer_mapped->map = tx_buffer->map; @@ -2544,12 +2400,6 @@ lem_setup_interface(device_t dev, struct ifp->if_capabilities = ifp->if_capenable = 0; -#if __FreeBSD_version >= 800000 - /* Multiqueue tx functions */ - ifp->if_transmit = lem_mq_start; - ifp->if_qflush = lem_qflush; - adapter->br = buf_ring_alloc(4096, M_DEVBUF, M_WAITOK, &adapter->tx_mtx); -#endif if (adapter->hw.mac.type >= e1000_82543) { int version_cap; #if __FreeBSD_version < 700000 @@ -4549,10 +4399,6 @@ lem_print_hw_stats(struct adapter *adapt (long long)adapter->stats.gprc); device_printf(dev, "Good Packets Xmtd = %lld\n", (long long)adapter->stats.gptc); - device_printf(dev, "TSO Contexts Xmtd = %lld\n", - (long long)adapter->stats.tsctc); - device_printf(dev, "TSO Contexts Failed = %lld\n", - (long long)adapter->stats.tsctfc); } /********************************************************************** From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 18:29:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47CAC1065676; Wed, 14 Apr 2010 18:29:27 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36CAC8FC21; Wed, 14 Apr 2010 18:29: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 o3EITRw7051608; Wed, 14 Apr 2010 18:29:27 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EITRVS051602; Wed, 14 Apr 2010 18:29:27 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201004141829.o3EITRVS051602@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 14 Apr 2010 18:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206615 - in head/lib/libc: gen locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:29:27 -0000 Author: uqs Date: Wed Apr 14 18:29:26 2010 New Revision: 206615 URL: http://svn.freebsd.org/changeset/base/206615 Log: mdoc: remove .Pp where not needed This trips up mdocml and can simply go away. Reviewed by: ru Approved by: philip, ed (mentors) Modified: head/lib/libc/gen/confstr.3 head/lib/libc/gen/sysconf.3 head/lib/libc/gen/sysctl.3 head/lib/libc/locale/isalnum.3 head/lib/libc/locale/isalpha.3 Modified: head/lib/libc/gen/confstr.3 ============================================================================== --- head/lib/libc/gen/confstr.3 Wed Apr 14 18:29:01 2010 (r206614) +++ head/lib/libc/gen/confstr.3 Wed Apr 14 18:29:26 2010 (r206615) @@ -79,7 +79,6 @@ The copied value is always null terminat The available values are as follows: .Pp .Bl -tag -width 6n -.Pp .It Li _CS_PATH Return a value for the .Ev PATH Modified: head/lib/libc/gen/sysconf.3 ============================================================================== --- head/lib/libc/gen/sysconf.3 Wed Apr 14 18:29:01 2010 (r206614) +++ head/lib/libc/gen/sysconf.3 Wed Apr 14 18:29:26 2010 (r206615) @@ -60,9 +60,7 @@ Shell programmers who need access to the utility. .Pp The available values are as follows: -.Pp .Bl -tag -width 6n -.Pp .It Li _SC_ARG_MAX The maximum bytes of argument to .Xr execve 2 . @@ -165,9 +163,7 @@ otherwise \-1. .El .Pp These values also exist, but may not be standard: -.Pp .Bl -tag -width 6n -.Pp .It Li _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible that the product of this value and the value of Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Wed Apr 14 18:29:01 2010 (r206614) +++ head/lib/libc/gen/sysctl.3 Wed Apr 14 18:29:26 2010 (r206615) @@ -286,7 +286,6 @@ privilege may change the value. .It "HW_MACHINE_ARCH string no" .It "HW_REALMEM integer no" .El -.Pp .Bl -tag -width 6n .It Li HW_MACHINE The machine class. @@ -352,7 +351,6 @@ information. .It "KERN_VERSION string no" .It "KERN_VNODE struct vnode no" .El -.Pp .Bl -tag -width 6n .It Li KERN_ARGMAX The maximum bytes of argument to @@ -543,7 +541,6 @@ privilege may change the value. .It "PF_INET IPv4 values yes" .It "PF_INET6 IPv6 values yes" .El -.Pp .Bl -tag -width 6n .It Li PF_ROUTE Return the entire routing table or a subset of it. @@ -650,7 +647,6 @@ privilege may change the value. .It "USER_TZNAME_MAX integer no" .El .Bl -tag -width 6n -.Pp .It Li USER_BC_BASE_MAX The maximum ibase/obase values in the .Xr bc 1 @@ -740,7 +736,6 @@ privilege may change the value. .It "VM_V_INACTIVE_TARGET integer yes" .It "VM_V_PAGEOUT_FREE_MIN integer yes" .El -.Pp .Bl -tag -width 6n .It Li VM_LOADAVG Return the load average history. Modified: head/lib/libc/locale/isalnum.3 ============================================================================== --- head/lib/libc/locale/isalnum.3 Wed Apr 14 18:29:01 2010 (r206614) +++ head/lib/libc/locale/isalnum.3 Wed Apr 14 18:29:26 2010 (r206615) @@ -59,7 +59,6 @@ or the value of .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): -.Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" .It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" Modified: head/lib/libc/locale/isalpha.3 ============================================================================== --- head/lib/libc/locale/isalpha.3 Wed Apr 14 18:29:01 2010 (r206614) +++ head/lib/libc/locale/isalpha.3 Wed Apr 14 18:29:26 2010 (r206615) @@ -59,7 +59,6 @@ or the value of .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): -.Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" .It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 18:29:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1D91065673; Wed, 14 Apr 2010 18:29:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 382FF8FC1D; Wed, 14 Apr 2010 18:29: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 o3EITZ2Z051677; Wed, 14 Apr 2010 18:29:35 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EITZ9I051676; Wed, 14 Apr 2010 18:29:35 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201004141829.o3EITZ9I051676@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 14 Apr 2010 18:29: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: r206616 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:29:35 -0000 Author: uqs Date: Wed Apr 14 18:29:34 2010 New Revision: 206616 URL: http://svn.freebsd.org/changeset/base/206616 Log: mdoc: don't abuse Bo/Pc to get what looks like an interval Be explicit and use the general bracketing form plus symbols which are to be interpreted mathematically in this case. Complaint by: mdocml Reviewed by: ru Approved by: philip, ed (mentors) Modified: head/lib/libc/gen/frexp.3 Modified: head/lib/libc/gen/frexp.3 ============================================================================== --- head/lib/libc/gen/frexp.3 Wed Apr 14 18:29:26 2010 (r206615) +++ head/lib/libc/gen/frexp.3 Wed Apr 14 18:29:34 2010 (r206616) @@ -70,7 +70,7 @@ such that is a .Vt double with magnitude in the interval -.Bo 1/2 , 1 Pc +.Eo [ 1/2 , 1 Ec ) or zero, and .Fa value equals From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 18:29:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D15FA10657E1; Wed, 14 Apr 2010 18:29:40 +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 AB3B08FC13; Wed, 14 Apr 2010 18:29:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3EITeeJ051715; Wed, 14 Apr 2010 18:29:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EITeji051712; Wed, 14 Apr 2010 18:29:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004141829.o3EITeji051712@svn.freebsd.org> From: Rui Paulo Date: Wed, 14 Apr 2010 18:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206617 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:29:40 -0000 Author: rpaulo Date: Wed Apr 14 18:29:40 2010 New Revision: 206617 URL: http://svn.freebsd.org/changeset/base/206617 Log: Make this code a little more portable by wrapping the mtx calls into macros. MFC after: 1 week Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Wed Apr 14 18:29:34 2010 (r206616) +++ head/sys/net80211/ieee80211_freebsd.h Wed Apr 14 18:29:40 2010 (r206617) @@ -148,6 +148,16 @@ typedef struct mtx acl_lock_t; mtx_assert((&(_as)->as_lock), MA_OWNED) /* + * Scan table definitions. + */ +typedef struct mtx ieee80211_scan_table_lock_t; +#define IEEE80211_SCAN_TABLE_LOCK_INIT(_st, _name) \ + mtx_init(&(_st)->st_lock, _name, "802.11 scan table", MTX_DEF) +#define IEEE80211_SCAN_TABLE_LOCK_DESTROY(_st) mtx_destroy(&(_st)->st_lock) +#define IEEE80211_SCAN_TABLE_LOCK(_st) mtx_lock(&(_st)->st_lock) +#define IEEE80211_SCAN_TABLE_UNLOCK(_st) mtx_unlock(&(_st)->st_lock) + +/* * Node reference counting definitions. * * ieee80211_node_initref initialize the reference count to 1 Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Apr 14 18:29:34 2010 (r206616) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Apr 14 18:29:40 2010 (r206617) @@ -97,7 +97,7 @@ struct sta_entry { CTASSERT(MAX_IEEE_CHAN >= 256); struct sta_table { - struct mtx st_lock; /* on scan table */ + ieee80211_scan_table_lock_t st_lock; /* on scan table */ TAILQ_HEAD(, sta_entry) st_entry; /* all entries */ LIST_HEAD(, sta_entry) st_hash[STA_HASHSIZE]; struct mtx st_scanlock; /* on st_scaniter */ @@ -161,7 +161,7 @@ sta_attach(struct ieee80211_scan_state * M_80211_SCAN, M_NOWAIT | M_ZERO); if (st == NULL) return 0; - mtx_init(&st->st_lock, "scantable", "802.11 scan table", MTX_DEF); + IEEE80211_SCAN_TABLE_LOCK_INIT(st, "scantable"); mtx_init(&st->st_scanlock, "scangen", "802.11 scangen", MTX_DEF); TAILQ_INIT(&st->st_entry); ss->ss_priv = st; @@ -179,7 +179,7 @@ sta_detach(struct ieee80211_scan_state * if (st != NULL) { sta_flush_table(st); - mtx_destroy(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK_DESTROY(st); mtx_destroy(&st->st_scanlock); free(st, M_80211_SCAN); KASSERT(nrefs > 0, ("imbalanced attach/detach")); @@ -196,9 +196,9 @@ sta_flush(struct ieee80211_scan_state *s { struct sta_table *st = ss->ss_priv; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); sta_flush_table(st); - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); ss->ss_last = 0; return 0; } @@ -244,14 +244,14 @@ sta_add(struct ieee80211_scan_state *ss, hash = STA_HASH(macaddr); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) goto found; se = (struct sta_entry *) malloc(sizeof(struct sta_entry), M_80211_SCAN, M_NOWAIT | M_ZERO); if (se == NULL) { - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return 0; } se->se_scangen = st->st_scaniter-1; @@ -370,7 +370,7 @@ found: if (rssi > st->st_maxrssi[sp->bchan]) st->st_maxrssi[sp->bchan] = rssi; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); /* * If looking for a quick choice and nothing's @@ -1132,7 +1132,7 @@ sta_update_notseen(struct sta_table *st) { struct sta_entry *se; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { /* * If seen the reset and don't bump the count; @@ -1146,7 +1146,7 @@ sta_update_notseen(struct sta_table *st) else se->se_notseen++; } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static void @@ -1154,11 +1154,11 @@ sta_dec_fails(struct sta_table *st) { struct sta_entry *se; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) if (se->se_fails) se->se_fails--; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static struct sta_entry * @@ -1169,7 +1169,7 @@ select_bss(struct ieee80211_scan_state * IEEE80211_DPRINTF(vap, debug, " %s\n", "macaddr bssid chan rssi rate flag wep essid"); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { ieee80211_ies_expand(&se->base.se_ies); if (match_bss(vap, ss, se, debug) == 0) { @@ -1179,7 +1179,7 @@ select_bss(struct ieee80211_scan_state * selbs = se; } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return selbs; } @@ -1258,11 +1258,11 @@ sta_lookup(struct sta_table *st, const u struct sta_entry *se; int hash = STA_HASH(macaddr); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) break; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return se; /* NB: unlocked */ } @@ -1382,18 +1382,18 @@ sta_iterate(struct ieee80211_scan_state mtx_lock(&st->st_scanlock); gen = st->st_scaniter++; restart: - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { if (se->se_scangen != gen) { se->se_scangen = gen; /* update public state */ se->base.se_age = ticks - se->se_lastupdate; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); (*f)(arg, &se->base); goto restart; } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); mtx_unlock(&st->st_scanlock); } @@ -1510,7 +1510,7 @@ adhoc_pick_channel(struct ieee80211_scan bestchan = NULL; bestrssi = -1; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); for (i = 0; i < ss->ss_last; i++) { c = ss->ss_chans[i]; /* never consider a channel with radar */ @@ -1532,7 +1532,7 @@ adhoc_pick_channel(struct ieee80211_scan if (bestchan == NULL || maxrssi < bestrssi) bestchan = c; } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return bestchan; } @@ -1638,7 +1638,7 @@ adhoc_age(struct ieee80211_scan_state *s struct sta_table *st = ss->ss_priv; struct sta_entry *se, *next; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH_SAFE(se, &st->st_entry, se_list, next) { if (se->se_notseen > STA_PURGE_SCANS) { TAILQ_REMOVE(&st->st_entry, se, se_list); @@ -1647,7 +1647,7 @@ adhoc_age(struct ieee80211_scan_state *s free(se, M_80211_SCAN); } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static const struct ieee80211_scanner adhoc_default = { From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 18:56:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2188A1065672; Wed, 14 Apr 2010 18:56:08 +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 119658FC16; Wed, 14 Apr 2010 18:56: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 o3EIu7rN057639; Wed, 14 Apr 2010 18:56:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EIu75u057637; Wed, 14 Apr 2010 18:56:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004141856.o3EIu75u057637@svn.freebsd.org> From: Warner Losh Date: Wed, 14 Apr 2010 18:56: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: r206618 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:56:08 -0000 Author: imp Date: Wed Apr 14 18:56:07 2010 New Revision: 206618 URL: http://svn.freebsd.org/changeset/base/206618 Log: Add note about TARGET_ARCH Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Apr 14 18:29:40 2010 (r206617) +++ head/Makefile.inc1 Wed Apr 14 18:56:07 2010 (r206618) @@ -15,6 +15,7 @@ # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # TARGET="machine" to crossbuild world for a different machine type +# TARGET_ARCH= may be required when a TARGET supports multiple endians # # The intended user-driven targets are: From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 19:03:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F2E106566C; Wed, 14 Apr 2010 19:03:27 +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 E18438FC17; Wed, 14 Apr 2010 19:03: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 o3EJ3R7E059384; Wed, 14 Apr 2010 19:03:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EJ3RCI059382; Wed, 14 Apr 2010 19:03:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004141903.o3EJ3RCI059382@svn.freebsd.org> From: Warner Losh Date: Wed, 14 Apr 2010 19:03: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: r206619 - head/contrib/binutils/bfd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:03:28 -0000 Author: imp Date: Wed Apr 14 19:03:27 2010 New Revision: 206619 URL: http://svn.freebsd.org/changeset/base/206619 Log: Add armeb-*-freebsd* to the list of known architectures. This is like arm-*-freebsd*, except it defaults to big endian builds instead of little endian builds. Modified: head/contrib/binutils/bfd/config.bfd Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Wed Apr 14 18:56:07 2010 (r206618) +++ head/contrib/binutils/bfd/config.bfd Wed Apr 14 19:03:27 2010 (r206619) @@ -221,6 +221,10 @@ case "${targ}" in targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; + armeb-*-freebsd*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) targ_defvec=bfd_elf32_littlearm_vec From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 19:06:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7477D106566C; Wed, 14 Apr 2010 19:06:39 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 641C68FC0A; Wed, 14 Apr 2010 19:06: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 o3EJ6dd0060156; Wed, 14 Apr 2010 19:06:39 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EJ6dQt060154; Wed, 14 Apr 2010 19:06:39 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201004141906.o3EJ6dQt060154@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 14 Apr 2010 19: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: r206621 - head/usr.bin/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:06:39 -0000 Author: uqs Date: Wed Apr 14 19:06:39 2010 New Revision: 206621 URL: http://svn.freebsd.org/changeset/base/206621 Log: Add and expand $FreeBSD$ keyword to allow committing to this file. Modified: head/usr.bin/csup/cpasswd.1 (contents, props changed) Modified: head/usr.bin/csup/cpasswd.1 ============================================================================== --- head/usr.bin/csup/cpasswd.1 Wed Apr 14 19:04:38 2010 (r206620) +++ head/usr.bin/csup/cpasswd.1 Wed Apr 14 19:06:39 2010 (r206621) @@ -27,7 +27,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $Id: cvpasswd.1,v 1.4 2003/03/04 18:24:42 jdp Exp $ -.\" $FreeBSD $ +.\" $FreeBSD$ .\" .Dd June 27, 2007 .Os FreeBSD From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 19:08:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 135CC1065675; Wed, 14 Apr 2010 19:08:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20988FC1E; Wed, 14 Apr 2010 19:08: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 o3EJ87f0060603; Wed, 14 Apr 2010 19:08:07 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EJ86u3060516; Wed, 14 Apr 2010 19:08:06 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201004141908.o3EJ86u3060516@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 14 Apr 2010 19:08: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: r206622 - in head: bin/pwait contrib/com_err gnu/usr.bin/gdb/kgdb lib/libc/gen lib/libc/posix1e lib/libc/stdlib lib/libcam lib/libcompat/4.1 lib/libcompat/4.4 lib/libedit lib/libelf lib... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:08:08 -0000 Author: uqs Date: Wed Apr 14 19:08:06 2010 New Revision: 206622 URL: http://svn.freebsd.org/changeset/base/206622 Log: mdoc: order prologue macros consistently by Dd/Dt/Os Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors) Modified: head/bin/pwait/pwait.1 head/contrib/com_err/compile_et.1 head/gnu/usr.bin/gdb/kgdb/kgdb.1 head/lib/libc/gen/check_utility_compat.3 head/lib/libc/gen/dladdr.3 head/lib/libc/gen/dlinfo.3 head/lib/libc/gen/dllockinit.3 head/lib/libc/gen/dlopen.3 head/lib/libc/gen/fmtcheck.3 head/lib/libc/gen/ftok.3 head/lib/libc/gen/getutxent.3 head/lib/libc/gen/setproctitle.3 head/lib/libc/gen/stringlist.3 head/lib/libc/posix1e/mac_prepare.3 head/lib/libc/stdlib/hcreate.3 head/lib/libc/stdlib/ptsname.3 head/lib/libcam/cam.3 head/lib/libcam/cam_cdbparse.3 head/lib/libcompat/4.1/cftime.3 head/lib/libcompat/4.4/cuserid.3 head/lib/libedit/editline.3 head/lib/libedit/editrc.5 head/lib/libelf/elf.3 head/lib/libelf/elf_begin.3 head/lib/libelf/elf_cntl.3 head/lib/libelf/elf_end.3 head/lib/libelf/elf_errmsg.3 head/lib/libelf/elf_fill.3 head/lib/libelf/elf_flagdata.3 head/lib/libelf/elf_getarhdr.3 head/lib/libelf/elf_getarsym.3 head/lib/libelf/elf_getbase.3 head/lib/libelf/elf_getdata.3 head/lib/libelf/elf_getident.3 head/lib/libelf/elf_getphnum.3 head/lib/libelf/elf_getscn.3 head/lib/libelf/elf_getshnum.3 head/lib/libelf/elf_getshstrndx.3 head/lib/libelf/elf_hash.3 head/lib/libelf/elf_kind.3 head/lib/libelf/elf_memory.3 head/lib/libelf/elf_next.3 head/lib/libelf/elf_rand.3 head/lib/libelf/elf_rawfile.3 head/lib/libelf/elf_strptr.3 head/lib/libelf/elf_update.3 head/lib/libelf/elf_version.3 head/lib/libelf/gelf.3 head/lib/libelf/gelf_checksum.3 head/lib/libelf/gelf_fsize.3 head/lib/libelf/gelf_getcap.3 head/lib/libelf/gelf_getclass.3 head/lib/libelf/gelf_getdyn.3 head/lib/libelf/gelf_getehdr.3 head/lib/libelf/gelf_getmove.3 head/lib/libelf/gelf_getphdr.3 head/lib/libelf/gelf_getrel.3 head/lib/libelf/gelf_getrela.3 head/lib/libelf/gelf_getshdr.3 head/lib/libelf/gelf_getsym.3 head/lib/libelf/gelf_getsyminfo.3 head/lib/libelf/gelf_getsymshndx.3 head/lib/libelf/gelf_newehdr.3 head/lib/libelf/gelf_newphdr.3 head/lib/libelf/gelf_update_ehdr.3 head/lib/libelf/gelf_xlatetof.3 head/lib/libgssapi/gss_accept_sec_context.3 head/lib/libgssapi/gss_acquire_cred.3 head/lib/libgssapi/gss_add_cred.3 head/lib/libgssapi/gss_add_oid_set_member.3 head/lib/libgssapi/gss_canonicalize_name.3 head/lib/libgssapi/gss_compare_name.3 head/lib/libgssapi/gss_context_time.3 head/lib/libgssapi/gss_create_empty_oid_set.3 head/lib/libgssapi/gss_delete_sec_context.3 head/lib/libgssapi/gss_display_name.3 head/lib/libgssapi/gss_display_status.3 head/lib/libgssapi/gss_duplicate_name.3 head/lib/libgssapi/gss_export_name.3 head/lib/libgssapi/gss_export_sec_context.3 head/lib/libgssapi/gss_get_mic.3 head/lib/libgssapi/gss_import_name.3 head/lib/libgssapi/gss_import_sec_context.3 head/lib/libgssapi/gss_indicate_mechs.3 head/lib/libgssapi/gss_init_sec_context.3 head/lib/libgssapi/gss_inquire_context.3 head/lib/libgssapi/gss_inquire_cred.3 head/lib/libgssapi/gss_inquire_cred_by_mech.3 head/lib/libgssapi/gss_inquire_mechs_for_name.3 head/lib/libgssapi/gss_inquire_names_for_mech.3 head/lib/libgssapi/gss_process_context_token.3 head/lib/libgssapi/gss_release_buffer.3 head/lib/libgssapi/gss_release_cred.3 head/lib/libgssapi/gss_release_name.3 head/lib/libgssapi/gss_release_oid_set.3 head/lib/libgssapi/gss_test_oid_set_member.3 head/lib/libgssapi/gss_unwrap.3 head/lib/libgssapi/gss_verify_mic.3 head/lib/libgssapi/gss_wrap.3 head/lib/libgssapi/gss_wrap_size_limit.3 head/lib/libmemstat/libmemstat.3 head/lib/libpmc/pmc.3 head/lib/libpmc/pmc.atom.3 head/lib/libpmc/pmc.core.3 head/lib/libpmc/pmc.core2.3 head/lib/libpmc/pmc.corei7.3 head/lib/libpmc/pmc.corei7uc.3 head/lib/libpmc/pmc.iaf.3 head/lib/libpmc/pmc.k7.3 head/lib/libpmc/pmc.k8.3 head/lib/libpmc/pmc.p4.3 head/lib/libpmc/pmc.p5.3 head/lib/libpmc/pmc.p6.3 head/lib/libpmc/pmc.tsc.3 head/lib/libpmc/pmc.ucf.3 head/lib/libpmc/pmc.westmere.3 head/lib/libpmc/pmc.westmereuc.3 head/lib/libpmc/pmc_allocate.3 head/lib/libpmc/pmc_attach.3 head/lib/libpmc/pmc_capabilities.3 head/lib/libpmc/pmc_configure_logfile.3 head/lib/libpmc/pmc_disable.3 head/lib/libpmc/pmc_event_names_of_class.3 head/lib/libpmc/pmc_get_driver_stats.3 head/lib/libpmc/pmc_get_msr.3 head/lib/libpmc/pmc_init.3 head/lib/libpmc/pmc_name_of_capability.3 head/lib/libpmc/pmc_read.3 head/lib/libpmc/pmc_set.3 head/lib/libpmc/pmc_start.3 head/lib/libpmc/pmclog.3 head/lib/libthr/libthr.3 head/lib/libugidfw/bsde_get_rule.3 head/lib/libugidfw/bsde_get_rule_count.3 head/lib/libugidfw/bsde_parse_rule.3 head/lib/libugidfw/bsde_rule_to_string.3 head/lib/libugidfw/libugidfw.3 head/lib/libulog/ulog_login.3 head/lib/libulog/utempter_add_record.3 head/lib/libutil/_secure_path.3 head/lib/libutil/auth.3 head/lib/libutil/hexdump.3 head/lib/libutil/kinfo_getfile.3 head/lib/libutil/kinfo_getvmmap.3 head/lib/libutil/kld.3 head/lib/libutil/login_auth.3 head/lib/libutil/login_cap.3 head/lib/libutil/login_class.3 head/lib/libutil/login_ok.3 head/lib/libutil/login_times.3 head/lib/libutil/login_tty.3 head/lib/libutil/property.3 head/lib/libutil/pty.3 head/lib/libutil/realhostname.3 head/lib/libutil/realhostname_sa.3 head/lib/libutil/trimdomain.3 head/lib/libutil/uucplock.3 head/sbin/iscontrol/iscsi.conf.5 head/sbin/spppcontrol/spppcontrol.8 head/share/man/man3/sysexits.3 head/share/man/man3/tgmath.3 head/share/man/man4/audit.4 head/share/man/man4/auditpipe.4 head/share/man/man4/coda.4 head/share/man/man4/gbde.4 head/share/man/man4/geom.4 head/share/man/man4/geom_fox.4 head/share/man/man4/geom_linux_lvm.4 head/share/man/man4/geom_uzip.4 head/share/man/man4/ipw.4 head/share/man/man4/iscsi_initiator.4 head/share/man/man4/iwi.4 head/share/man/man4/iwn.4 head/share/man/man4/kbdmux.4 head/share/man/man4/lp.4 head/share/man/man4/mac.4 head/share/man/man4/mac_biba.4 head/share/man/man4/mac_bsdextended.4 head/share/man/man4/mac_ifoff.4 head/share/man/man4/mac_lomac.4 head/share/man/man4/mac_mls.4 head/share/man/man4/mac_none.4 head/share/man/man4/mac_partition.4 head/share/man/man4/mac_seeotheruids.4 head/share/man/man4/mac_stub.4 head/share/man/man4/mac_test.4 head/share/man/man4/ng_netflow.4 head/share/man/man4/orm.4 head/share/man/man4/ral.4 head/share/man/man4/rp.4 head/share/man/man4/rum.4 head/share/man/man4/run.4 head/share/man/man4/sched_4bsd.4 head/share/man/man4/sched_ule.4 head/share/man/man4/si.4 head/share/man/man4/tap.4 head/share/man/man4/uhso.4 head/share/man/man4/upgt.4 head/share/man/man4/ural.4 head/share/man/man4/vkbd.4 head/share/man/man4/wpi.4 head/share/man/man5/ar.5 head/share/man/man7/clocks.7 head/share/man/man7/maclabel.7 head/share/man/man8/picobsd.8 head/share/man/man8/rescue.8 head/share/man/man9/CTASSERT.9 head/share/man/man9/DELAY.9 head/share/man/man9/KASSERT.9 head/share/man/man9/VFS.9 head/share/man/man9/VFS_CHECKEXP.9 head/share/man/man9/VFS_FHTOVP.9 head/share/man/man9/VFS_MOUNT.9 head/share/man/man9/VFS_QUOTACTL.9 head/share/man/man9/VFS_ROOT.9 head/share/man/man9/VFS_STATFS.9 head/share/man/man9/VFS_SYNC.9 head/share/man/man9/VFS_UNMOUNT.9 head/share/man/man9/VFS_VGET.9 head/share/man/man9/VOP_ACCESS.9 head/share/man/man9/VOP_ACLCHECK.9 head/share/man/man9/VOP_ADVLOCK.9 head/share/man/man9/VOP_ATTRIB.9 head/share/man/man9/VOP_BWRITE.9 head/share/man/man9/VOP_CREATE.9 head/share/man/man9/VOP_FSYNC.9 head/share/man/man9/VOP_GETACL.9 head/share/man/man9/VOP_GETEXTATTR.9 head/share/man/man9/VOP_GETPAGES.9 head/share/man/man9/VOP_GETVOBJECT.9 head/share/man/man9/VOP_INACTIVE.9 head/share/man/man9/VOP_IOCTL.9 head/share/man/man9/VOP_LINK.9 head/share/man/man9/VOP_LISTEXTATTR.9 head/share/man/man9/VOP_LOCK.9 head/share/man/man9/VOP_LOOKUP.9 head/share/man/man9/VOP_OPENCLOSE.9 head/share/man/man9/VOP_PATHCONF.9 head/share/man/man9/VOP_PRINT.9 head/share/man/man9/VOP_RDWR.9 head/share/man/man9/VOP_READDIR.9 head/share/man/man9/VOP_READLINK.9 head/share/man/man9/VOP_REALLOCBLKS.9 head/share/man/man9/VOP_REMOVE.9 head/share/man/man9/VOP_RENAME.9 head/share/man/man9/VOP_REVOKE.9 head/share/man/man9/VOP_SETACL.9 head/share/man/man9/VOP_SETEXTATTR.9 head/share/man/man9/VOP_STRATEGY.9 head/share/man/man9/VOP_VPTOCNP.9 head/share/man/man9/VOP_VPTOFH.9 head/share/man/man9/accept_filter.9 head/share/man/man9/accf_data.9 head/share/man/man9/accf_dns.9 head/share/man/man9/accf_http.9 head/share/man/man9/acl.9 head/share/man/man9/atomic.9 head/share/man/man9/cr_cansee.9 head/share/man/man9/cr_seeothergids.9 head/share/man/man9/cr_seeotheruids.9 head/share/man/man9/devfs_set_cdevpriv.9 head/share/man/man9/devtoname.9 head/share/man/man9/extattr.9 head/share/man/man9/firmware.9 head/share/man/man9/hexdump.9 head/share/man/man9/ifnet.9 head/share/man/man9/make_dev.9 head/share/man/man9/namei.9 head/share/man/man9/p_candebug.9 head/share/man/man9/p_cansee.9 head/share/man/man9/pfind.9 head/share/man/man9/pgfind.9 head/share/man/man9/prison_check.9 head/share/man/man9/random.9 head/share/man/man9/rijndael.9 head/share/man/man9/rtalloc.9 head/share/man/man9/rtentry.9 head/share/man/man9/sleep.9 head/share/man/man9/spl.9 head/share/man/man9/uio.9 head/share/man/man9/usbdi.9 head/share/man/man9/vaccess.9 head/share/man/man9/vaccess_acl_nfs4.9 head/share/man/man9/vaccess_acl_posix1e.9 head/share/man/man9/vcount.9 head/share/man/man9/vget.9 head/share/man/man9/vm_map_entry_resize_free.9 head/share/man/man9/vnode.9 head/share/man/man9/vput.9 head/share/man/man9/vref.9 head/share/man/man9/vrefcnt.9 head/share/man/man9/vrele.9 head/usr.bin/ar/ar.1 head/usr.bin/c89/c89.1 head/usr.bin/c99/c99.1 head/usr.bin/column/column.1 head/usr.bin/comm/comm.1 head/usr.bin/csup/cpasswd.1 head/usr.bin/csup/csup.1 head/usr.bin/enigma/enigma.1 head/usr.bin/hexdump/od.1 head/usr.bin/killall/killall.1 head/usr.bin/lockf/lockf.1 head/usr.bin/wtmpcvt/wtmpcvt.1 head/usr.sbin/asf/asf.8 head/usr.sbin/burncd/burncd.8 head/usr.sbin/ctm/ctm/ctm.1 head/usr.sbin/ctm/ctm/ctm.5 head/usr.sbin/devinfo/devinfo.8 head/usr.sbin/fdformat/fdformat.1 head/usr.sbin/fdread/fdread.1 head/usr.sbin/fdwrite/fdwrite.1 head/usr.sbin/fifolog/fifolog_create/fifolog.1 head/usr.sbin/flowctl/flowctl.8 head/usr.sbin/mtest/mtest.8 head/usr.sbin/periodic/periodic.8 head/usr.sbin/pmcannotate/pmcannotate.8 head/usr.sbin/pmccontrol/pmccontrol.8 head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pppctl/pppctl.8 head/usr.sbin/setfmac/setfsmac.8 head/usr.sbin/setpmac/setpmac.8 head/usr.sbin/uhsoctl/uhsoctl.1 Modified: head/bin/pwait/pwait.1 ============================================================================== --- head/bin/pwait/pwait.1 Wed Apr 14 19:06:39 2010 (r206621) +++ head/bin/pwait/pwait.1 Wed Apr 14 19:08:06 2010 (r206622) @@ -33,8 +33,8 @@ .\" $FreeBSD$ .\" .Dd November 1, 2009 -.Os .Dt PWAIT 1 +.Os .Sh NAME .Nm pwait .Nd wait for processes to terminate Modified: head/contrib/com_err/compile_et.1 ============================================================================== --- head/contrib/com_err/compile_et.1 Wed Apr 14 19:06:39 2010 (r206621) +++ head/contrib/com_err/compile_et.1 Wed Apr 14 19:08:06 2010 (r206622) @@ -4,8 +4,8 @@ .\" $FreeBSD$ .\" .Dd November 22, 1988 -.Os .Dt COMPILE_ET 1 +.Os .Sh NAME .Nm compile_et .Nd error table compiler Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kgdb.1 Wed Apr 14 19:06:39 2010 (r206621) +++ head/gnu/usr.bin/gdb/kgdb/kgdb.1 Wed Apr 14 19:08:06 2010 (r206622) @@ -25,8 +25,8 @@ .\" $FreeBSD$ .\" .Dd October 11, 2006 -.Os .Dt KGDB 1 +.Os .Sh NAME .Nm kgdb .Nd "kernel debugger" Modified: head/lib/libc/gen/check_utility_compat.3 ============================================================================== --- head/lib/libc/gen/check_utility_compat.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/check_utility_compat.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd October 27, 2002 -.Os .Dt CHECK_UTILITY_COMPAT 3 +.Os .Sh NAME .Nm check_utility_compat .Nd "determine whether a utility should be compatible" Modified: head/lib/libc/gen/dladdr.3 ============================================================================== --- head/lib/libc/gen/dladdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/dladdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd February 5, 1998 -.Os .Dt DLADDR 3 +.Os .Sh NAME .Nm dladdr .Nd find the shared object containing a given address Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/dlinfo.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd February 14, 2003 -.Os .Dt DLINFO 3 +.Os .Sh NAME .Nm dlinfo .Nd information about dynamically loaded object Modified: head/lib/libc/gen/dllockinit.3 ============================================================================== --- head/lib/libc/gen/dllockinit.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/dllockinit.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd July 5, 2000 -.Os .Dt DLLOCKINIT 3 +.Os .Sh NAME .Nm dllockinit .Nd register thread locking methods with the dynamic linker Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/dlopen.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -33,8 +33,8 @@ .\" $FreeBSD$ .\" .Dd July 7, 2009 -.Os .Dt DLOPEN 3 +.Os .Sh NAME .Nm dlopen , .Nm dlsym , Modified: head/lib/libc/gen/fmtcheck.3 ============================================================================== --- head/lib/libc/gen/fmtcheck.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/fmtcheck.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -26,8 +26,8 @@ .\" .\" $FreeBSD$ .Dd October 16, 2002 -.Os .Dt FMTCHECK 3 +.Os .Sh NAME .Nm fmtcheck .Nd sanitizes user-supplied Modified: head/lib/libc/gen/ftok.3 ============================================================================== --- head/lib/libc/gen/ftok.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/ftok.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .Dd July 9, 2009 -.Os .Dt FTOK 3 +.Os .Sh NAME .Nm ftok .Nd create IPC identifier from path name Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/getutxent.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -25,8 +25,8 @@ .\" $FreeBSD$ .\" .Dd January 8, 2010 -.Os .Dt GETUTXENT 3 +.Os .Sh NAME .Nm endutxent , .Nm getutxent , Modified: head/lib/libc/gen/setproctitle.3 ============================================================================== --- head/lib/libc/gen/setproctitle.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/setproctitle.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -21,8 +21,8 @@ .\" .\" The following requests are required for all man pages. .Dd December 16, 1995 -.Os .Dt SETPROCTITLE 3 +.Os .Sh NAME .Nm setproctitle .Nd set process title Modified: head/lib/libc/gen/stringlist.3 ============================================================================== --- head/lib/libc/gen/stringlist.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/gen/stringlist.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd November 28, 1999 -.Os .Dt STRINGLIST 3 +.Os .Sh NAME .Nm stringlist , .Nm sl_init , Modified: head/lib/libc/posix1e/mac_prepare.3 ============================================================================== --- head/lib/libc/posix1e/mac_prepare.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/posix1e/mac_prepare.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -31,8 +31,8 @@ .\" $FreeBSD$ .\" .Dd August 22, 2003 -.Os .Dt MAC_PREPARE 3 +.Os .Sh NAME .Nm mac_prepare , mac_prepare_type , mac_prepare_file_label , .Nm mac_prepare_ifnet_label , mac_prepare_process_label Modified: head/lib/libc/stdlib/hcreate.3 ============================================================================== --- head/lib/libc/stdlib/hcreate.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/stdlib/hcreate.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd July 6, 2008 -.Os .Dt HCREATE 3 +.Os .Sh NAME .Nm hcreate , hdestroy , hsearch .Nd manage hash search table Modified: head/lib/libc/stdlib/ptsname.3 ============================================================================== --- head/lib/libc/stdlib/ptsname.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libc/stdlib/ptsname.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd August 20, 2008 -.Os .Dt PTSNAME 3 +.Os .Sh NAME .Nm grantpt , .Nm ptsname , Modified: head/lib/libcam/cam.3 ============================================================================== --- head/lib/libcam/cam.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libcam/cam.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" $FreeBSD$ .\" .Dd October 10, 1998 -.Os .Dt CAM 3 +.Os .Sh NAME .Nm cam_open_device , .Nm cam_open_spec_device , Modified: head/lib/libcam/cam_cdbparse.3 ============================================================================== --- head/lib/libcam/cam_cdbparse.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libcam/cam_cdbparse.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -62,8 +62,8 @@ .\" .\" .Dd October 13, 1998 -.Os .Dt CAM_CDBPARSE 3 +.Os .Sh NAME .Nm csio_build , .Nm csio_build_visit , Modified: head/lib/libcompat/4.1/cftime.3 ============================================================================== --- head/lib/libcompat/4.1/cftime.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libcompat/4.1/cftime.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -35,8 +35,8 @@ .\" $FreeBSD$ .\" .Dd June 15, 1993 -.Os .Dt CFTIME 3 +.Os .Sh NAME .Nm cftime , .Nm ascftime Modified: head/lib/libcompat/4.4/cuserid.3 ============================================================================== --- head/lib/libcompat/4.4/cuserid.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libcompat/4.4/cuserid.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd April 10, 1995 -.Os .Dt CUSERID 3 +.Os .Sh NAME .Nm cuserid .Nd get user name associated with effective UID Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libedit/editline.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd January 12, 2007 -.Os .Dt EDITLINE 3 +.Os .Sh NAME .Nm editline , .Nm el_init , Modified: head/lib/libedit/editrc.5 ============================================================================== --- head/lib/libedit/editrc.5 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libedit/editrc.5 Wed Apr 14 19:08:06 2010 (r206622) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd October 18, 2003 -.Os .Dt EDITRC 5 +.Os .Sh NAME .Nm editrc .Nd configuration file for editline library Modified: head/lib/libelf/elf.3 ============================================================================== --- head/lib/libelf/elf.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 21, 2007 -.Os .Dt ELF 3 +.Os .Sh NAME .Nm elf .Nd API for manipulating ELF objects Modified: head/lib/libelf/elf_begin.3 ============================================================================== --- head/lib/libelf/elf_begin.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_begin.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 21, 2006 -.Os .Dt ELF_BEGIN 3 +.Os .Sh NAME .Nm elf_begin .Nd open an ELF file or ar(1) archive Modified: head/lib/libelf/elf_cntl.3 ============================================================================== --- head/lib/libelf/elf_cntl.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_cntl.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 9, 2006 -.Os .Dt ELF_CNTL 3 +.Os .Sh NAME .Nm elf_cntl .Nd control an elf file descriptor Modified: head/lib/libelf/elf_end.3 ============================================================================== --- head/lib/libelf/elf_end.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_end.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 29, 2006 -.Os .Dt ELF_END 3 +.Os .Sh NAME .Nm elf_end .Nd release an ELF descriptor Modified: head/lib/libelf/elf_errmsg.3 ============================================================================== --- head/lib/libelf/elf_errmsg.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_errmsg.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 11, 2006 -.Os .Dt ELF_ERRMSG 3 +.Os .Sh NAME .Nm elf_errmsg , .Nm elf_errno Modified: head/lib/libelf/elf_fill.3 ============================================================================== --- head/lib/libelf/elf_fill.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_fill.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 11, 2006 -.Os .Dt ELF_FILL 3 +.Os .Sh NAME .Nm elf_fill .Nd set fill byte for inter-section padding Modified: head/lib/libelf/elf_flagdata.3 ============================================================================== --- head/lib/libelf/elf_flagdata.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_flagdata.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt ELF_FLAGDATA 3 +.Os .Sh NAME .Nm elf_flagdata , .Nm elf_flagehdr , Modified: head/lib/libelf/elf_getarhdr.3 ============================================================================== --- head/lib/libelf/elf_getarhdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getarhdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARHDR 3 +.Os .Sh NAME .Nm elf_getarhdr .Nd retrieve ar(1) header for an archive member Modified: head/lib/libelf/elf_getarsym.3 ============================================================================== --- head/lib/libelf/elf_getarsym.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getarsym.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARSYM 3 +.Os .Sh NAME .Nm elf_getarsym .Nd retrieve the symbol table of an archive Modified: head/lib/libelf/elf_getbase.3 ============================================================================== --- head/lib/libelf/elf_getbase.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getbase.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 11, 2006 -.Os .Dt ELF_GETBASE 3 +.Os .Sh NAME .Nm elf_getbase .Nd get the base offset for an object file Modified: head/lib/libelf/elf_getdata.3 ============================================================================== --- head/lib/libelf/elf_getdata.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getdata.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 26, 2006 -.Os .Dt ELF_GETDATA 3 +.Os .Sh NAME .Nm elf_getdata , .Nm elf_newdata , Modified: head/lib/libelf/elf_getident.3 ============================================================================== --- head/lib/libelf/elf_getident.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getident.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt ELF_GETIDENT 3 +.Os .Sh NAME .Nm elf_getident .Nd return the initial bytes of a file Modified: head/lib/libelf/elf_getphnum.3 ============================================================================== --- head/lib/libelf/elf_getphnum.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getphnum.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt ELF_GETPHNUM 3 +.Os .Sh NAME .Nm elf_getphnum .Nd return the number of program headers in an ELF file Modified: head/lib/libelf/elf_getscn.3 ============================================================================== --- head/lib/libelf/elf_getscn.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getscn.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt ELF_GETSCN 3 +.Os .Sh NAME .Nm elf_getscn , .Nm elf_ndxscn , Modified: head/lib/libelf/elf_getshnum.3 ============================================================================== --- head/lib/libelf/elf_getshnum.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getshnum.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 31, 2006 -.Os .Dt ELF_GETSHNUM 3 +.Os .Sh NAME .Nm elf_getshnum .Nd return the number of sections in an ELF file Modified: head/lib/libelf/elf_getshstrndx.3 ============================================================================== --- head/lib/libelf/elf_getshstrndx.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_getshstrndx.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 31, 2006 -.Os .Dt ELF_GETSHSTRNDX 3 +.Os .Sh NAME .Nm elf_getshstrndx , .Nm elf_setshstrndx Modified: head/lib/libelf/elf_hash.3 ============================================================================== --- head/lib/libelf/elf_hash.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_hash.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_HASH 3 +.Os .Sh NAME .Nm elf_hash .Nd compute a hash value for a string Modified: head/lib/libelf/elf_kind.3 ============================================================================== --- head/lib/libelf/elf_kind.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_kind.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 1, 2006 -.Os .Dt ELF_KIND 3 +.Os .Sh NAME .Nm elf_kind .Nd determine ELF file type Modified: head/lib/libelf/elf_memory.3 ============================================================================== --- head/lib/libelf/elf_memory.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_memory.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 28, 2006 -.Os .Dt ELF_MEMORY 3 +.Os .Sh NAME .Nm elf_memory .Nd process an ELF or ar(1) archive mapped into memory Modified: head/lib/libelf/elf_next.3 ============================================================================== --- head/lib/libelf/elf_next.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_next.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 17, 2006 -.Os .Dt ELF_NEXT 3 +.Os .Sh NAME .Nm elf_next .Nd provide sequential access to the next archive member Modified: head/lib/libelf/elf_rand.3 ============================================================================== --- head/lib/libelf/elf_rand.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_rand.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 17, 2006 -.Os .Dt ELF_RAND 3 +.Os .Sh NAME .Nm elf_rand .Nd provide sequential access to the next archive member Modified: head/lib/libelf/elf_rawfile.3 ============================================================================== --- head/lib/libelf/elf_rawfile.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_rawfile.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt ELF_RAWFILE 3 +.Os .Sh NAME .Nm elf_rawfile .Nd return uninterpreted contents of an ELF file Modified: head/lib/libelf/elf_strptr.3 ============================================================================== --- head/lib/libelf/elf_strptr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_strptr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt ELF_STRPTR 3 +.Os .Sh NAME .Nm elf_strptr .Nd retrieve a string pointer in a string table Modified: head/lib/libelf/elf_update.3 ============================================================================== --- head/lib/libelf/elf_update.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_update.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd March 19, 2008 -.Os .Dt ELF_UPDATE 3 +.Os .Sh NAME .Nm elf_update .Nd update an ELF descriptor Modified: head/lib/libelf/elf_version.3 ============================================================================== --- head/lib/libelf/elf_version.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/elf_version.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 1, 2006 -.Os .Dt ELF_VERSION 3 +.Os .Sh NAME .Nm elf_version .Nd retrieve or set ELF library operating version Modified: head/lib/libelf/gelf.3 ============================================================================== --- head/lib/libelf/gelf.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd September 1, 2006 -.Os .Dt GELF 3 +.Os .Sh NAME .Nm GElf .Nd class-independent API for ELF manipulation Modified: head/lib/libelf/gelf_checksum.3 ============================================================================== --- head/lib/libelf/gelf_checksum.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_checksum.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_CHECKSUM 3 +.Os .Sh NAME .Nm elf32_checksum , .Nm elf64_checksum , Modified: head/lib/libelf/gelf_fsize.3 ============================================================================== --- head/lib/libelf/gelf_fsize.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_fsize.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd February 5, 2008 -.Os .Dt GELF_FSIZE 3 +.Os .Sh NAME .Nm gelf_fsize , .Nm elf32_fsize , Modified: head/lib/libelf/gelf_getcap.3 ============================================================================== --- head/lib/libelf/gelf_getcap.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getcap.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETCAP 3 +.Os .Sh NAME .Nm gelf_getcap , .Nm gelf_update_cap Modified: head/lib/libelf/gelf_getclass.3 ============================================================================== --- head/lib/libelf/gelf_getclass.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getclass.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt GELF_GETCLASS 3 +.Os .Sh NAME .Nm gelf_getclass .Nd retrieve the class of an ELF descriptor Modified: head/lib/libelf/gelf_getdyn.3 ============================================================================== --- head/lib/libelf/gelf_getdyn.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getdyn.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETDYN 3 +.Os .Sh NAME .Nm gelf_getdyn , .Nm gelf_update_dyn Modified: head/lib/libelf/gelf_getehdr.3 ============================================================================== --- head/lib/libelf/gelf_getehdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getehdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt GELF_GETEHDR 3 +.Os .Sh NAME .Nm elf32_getehdr , .Nm elf64_getehdr , Modified: head/lib/libelf/gelf_getmove.3 ============================================================================== --- head/lib/libelf/gelf_getmove.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getmove.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETMOVE 3 +.Os .Sh NAME .Nm gelf_getmove , .Nm gelf_update_move Modified: head/lib/libelf/gelf_getphdr.3 ============================================================================== --- head/lib/libelf/gelf_getphdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getphdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 21, 2007 -.Os .Dt GELF_GETPHDR 3 +.Os .Sh NAME .Nm elf32_getphdr , .Nm elf64_getphdr , Modified: head/lib/libelf/gelf_getrel.3 ============================================================================== --- head/lib/libelf/gelf_getrel.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getrel.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETREL 3 +.Os .Sh NAME .Nm gelf_getrel , .Nm gelf_update_rel Modified: head/lib/libelf/gelf_getrela.3 ============================================================================== --- head/lib/libelf/gelf_getrela.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getrela.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETRELA 3 +.Os .Sh NAME .Nm gelf_getrela , .Nm gelf_update_rela Modified: head/lib/libelf/gelf_getshdr.3 ============================================================================== --- head/lib/libelf/gelf_getshdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getshdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 27, 2006 -.Os .Dt GELF_GETSHDR 3 +.Os .Sh NAME .Nm elf32_getshdr , .Nm elf64_getshdr , Modified: head/lib/libelf/gelf_getsym.3 ============================================================================== --- head/lib/libelf/gelf_getsym.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getsym.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYM 3 +.Os .Sh NAME .Nm gelf_getsym , .Nm gelf_update_sym Modified: head/lib/libelf/gelf_getsyminfo.3 ============================================================================== --- head/lib/libelf/gelf_getsyminfo.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getsyminfo.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYMINFO 3 +.Os .Sh NAME .Nm gelf_getsyminfo , .Nm gelf_update_syminfo Modified: head/lib/libelf/gelf_getsymshndx.3 ============================================================================== --- head/lib/libelf/gelf_getsymshndx.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_getsymshndx.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd November 5, 2006 -.Os .Dt GELF_GETSYMSHNDX 3 +.Os .Sh NAME .Nm gelf_getsymshndx , .Nm gelf_update_symshndx Modified: head/lib/libelf/gelf_newehdr.3 ============================================================================== --- head/lib/libelf/gelf_newehdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_newehdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWEHDR 3 +.Os .Sh NAME .Nm elf32_newehdr , .Nm elf64_newehdr , Modified: head/lib/libelf/gelf_newphdr.3 ============================================================================== --- head/lib/libelf/gelf_newphdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_newphdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWPHDR 3 +.Os .Sh NAME .Nm elf32_newphdr , .Nm elf64_newphdr , Modified: head/lib/libelf/gelf_update_ehdr.3 ============================================================================== --- head/lib/libelf/gelf_update_ehdr.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_update_ehdr.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 27, 2006 -.Os .Dt GELF_UPDATE_EHDR 3 +.Os .Sh NAME .Nm gelf_update_ehdr , .Nm gelf_update_phdr , Modified: head/lib/libelf/gelf_xlatetof.3 ============================================================================== --- head/lib/libelf/gelf_xlatetof.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libelf/gelf_xlatetof.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 24, 2006 -.Os .Dt GELF_XLATETOF 3 +.Os .Sh NAME .Nm elf32_xlate , .Nm elf64_xlate , Modified: head/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_accept_sec_context.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ACCEPT_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_accept_sec_context .Nd Accept a security context initiated by a peer application Modified: head/lib/libgssapi/gss_acquire_cred.3 ============================================================================== --- head/lib/libgssapi/gss_acquire_cred.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_acquire_cred.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ACQUIRE_CRED 3 PRM +.Os .Sh NAME .Nm gss_acquire_cred .Nd Obtain a GSS-API credential handle for pre-existing credentials Modified: head/lib/libgssapi/gss_add_cred.3 ============================================================================== --- head/lib/libgssapi/gss_add_cred.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_add_cred.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ADD_CRED 3 PRM +.Os .Sh NAME .Nm gss_add_cred .Nd Construct credentials incrementally Modified: head/lib/libgssapi/gss_add_oid_set_member.3 ============================================================================== --- head/lib/libgssapi/gss_add_oid_set_member.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_add_oid_set_member.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ADD_OID_SET_MEMBER 3 PRM +.Os .Sh NAME .Nm gss_add_oid_set_member .Nd Add an object identifier to a set Modified: head/lib/libgssapi/gss_canonicalize_name.3 ============================================================================== --- head/lib/libgssapi/gss_canonicalize_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_canonicalize_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CANONICALIZE_NAME 3 PRM +.Os .Sh NAME .Nm gss_canonicalize_name .Nd Convert an internal name to an MN Modified: head/lib/libgssapi/gss_compare_name.3 ============================================================================== --- head/lib/libgssapi/gss_compare_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_compare_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_COMPARE_NAME PRM +.Os .Sh NAME .Nm gss_compare_name .Nd Compare two internal-form names Modified: head/lib/libgssapi/gss_context_time.3 ============================================================================== --- head/lib/libgssapi/gss_context_time.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_context_time.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CONTEXT_TIME 3 PRM +.Os .Sh NAME .Nm gss_context_time .Nd Determine for how long a context will remain valid Modified: head/lib/libgssapi/gss_create_empty_oid_set.3 ============================================================================== --- head/lib/libgssapi/gss_create_empty_oid_set.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_create_empty_oid_set.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CREATE_EMPTY_OID_SET 3 PRM +.Os .Sh NAME .Nm gss_create_empty_oid_set .Nd Create a set containing no object identifiers Modified: head/lib/libgssapi/gss_delete_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_delete_sec_context.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_delete_sec_context.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_DELETE_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_delete_sec_context .Nd Discard a security context Modified: head/lib/libgssapi/gss_display_name.3 ============================================================================== --- head/lib/libgssapi/gss_display_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_display_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_DISPLAY_NAME 3 PRM +.Os .Sh NAME .Nm gss_display_name .Nd Convert internal-form name to text Modified: head/lib/libgssapi/gss_display_status.3 ============================================================================== --- head/lib/libgssapi/gss_display_status.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_display_status.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_DISPLAY_STATUS 3 PRM +.Os .Sh NAME .Nm gss_display_status .Nd Convert a GSS-API status code to text Modified: head/lib/libgssapi/gss_duplicate_name.3 ============================================================================== --- head/lib/libgssapi/gss_duplicate_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_duplicate_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_DUPLICATE_NAME 3 PRM +.Os .Sh NAME .Nm gss_duplicate_name .Nd Create a copy of an internal name Modified: head/lib/libgssapi/gss_export_name.3 ============================================================================== --- head/lib/libgssapi/gss_export_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_export_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_EXPORT_NAME 3 PRM +.Os .Sh NAME .Nm gss_export_name .Nd Convert an MN to export form Modified: head/lib/libgssapi/gss_export_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_export_sec_context.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_export_sec_context.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_EXPORT_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_export_sec_context .Nd Transfer a security context to another process Modified: head/lib/libgssapi/gss_get_mic.3 ============================================================================== --- head/lib/libgssapi/gss_get_mic.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_get_mic.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_GET_MIC 3 PRM +.Os .Sh NAME .Nm gss_get_mic , .Nm gss_sign Modified: head/lib/libgssapi/gss_import_name.3 ============================================================================== --- head/lib/libgssapi/gss_import_name.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_import_name.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_IMPORT_NAME 3 PRM +.Os .Sh NAME .Nm gss_import_name .Nd Convert a contiguous string name to internal-form Modified: head/lib/libgssapi/gss_import_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_import_sec_context.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_import_sec_context.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_IMPORT_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_import_sec_context .Nd Import a transferred context Modified: head/lib/libgssapi/gss_indicate_mechs.3 ============================================================================== --- head/lib/libgssapi/gss_indicate_mechs.3 Wed Apr 14 19:06:39 2010 (r206621) +++ head/lib/libgssapi/gss_indicate_mechs.3 Wed Apr 14 19:08:06 2010 (r206622) @@ -28,8 +28,8 @@ .\" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:04:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D93E106567A; Wed, 14 Apr 2010 20:04:55 +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 6CE438FC13; Wed, 14 Apr 2010 20:04: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 o3EK4tIb073209; Wed, 14 Apr 2010 20:04:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EK4tZa073207; Wed, 14 Apr 2010 20:04:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004142004.o3EK4tZa073207@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Apr 2010 20:04: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: r206623 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:04:55 -0000 Author: kib Date: Wed Apr 14 20:04:55 2010 New Revision: 206623 URL: http://svn.freebsd.org/changeset/base/206623 Log: ld_gs_base is executing with stack containing only the frame, temporary pushed %rflags has been popped already. Pointy hat to: kib MFC after: 3 days Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Apr 14 19:08:06 2010 (r206622) +++ head/sys/amd64/amd64/exception.S Wed Apr 14 20:04:55 2010 (r206623) @@ -815,7 +815,6 @@ fsbase_load_fault: ALIGN_TEXT .globl gsbase_load_fault gsbase_load_fault: - popfq movl $T_PROTFLT,TF_TRAPNO(%rsp) movq %rsp, %rdi call trap From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:31:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678FB1065672; Wed, 14 Apr 2010 20:31:06 +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 548558FC1A; Wed, 14 Apr 2010 20:31: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 o3EKV636078980; Wed, 14 Apr 2010 20:31:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EKV6hR078975; Wed, 14 Apr 2010 20:31:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004142031.o3EKV6hR078975@svn.freebsd.org> From: Warner Losh Date: Wed, 14 Apr 2010 20:31: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: r206624 - head/gnu/usr.bin/gdb/gdbserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:31:06 -0000 Author: imp Date: Wed Apr 14 20:31:06 2010 New Revision: 206624 URL: http://svn.freebsd.org/changeset/base/206624 Log: Make this directory more regular. Since it is one we control, use the freebsd-based names for filenames. This allows us to eliminate almost all of the uses of ${MACHINE_ARCH} here to do special things, and instead we use it to include filenames. This makes new architectures easier to support. Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c - copied unchanged from r206623, head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c head/gnu/usr.bin/gdb/gdbserver/reg-amd64.c - copied unchanged from r206623, head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c head/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c - copied unchanged from r206623, head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c Deleted: head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbserver/Makefile Wed Apr 14 20:04:55 2010 (r206623) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Wed Apr 14 20:31:06 2010 (r206624) @@ -14,20 +14,9 @@ SRCS= inferiors.c mem-break.c regcache.c server.c signals.c target.c utils.c SRCS+= fbsd-low.c -.if ${MACHINE_ARCH} == "amd64" -SRCS+= fbsd-amd64-low.c i387-fp.c reg-x86-64.c -.endif - -.if ${MACHINE_ARCH} == "arm" -SRCS+= fbsd-arm-low.c reg-arm.c -.endif - -.if ${MACHINE_ARCH} == "i386" -SRCS+= fbsd-i386-low.c i387-fp.c reg-i386.c -.endif - -.if ${MACHINE_ARCH} == "powerpc" -SRCS+= fbsd-ppc-low.c reg-ppc.c +SRCS+= fbsd-${MACHINE_ARCH}-low.c reg-${MACHINE_ARCH}.c +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +SRCS+= i387-fp.c .endif #CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} Copied: head/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c (from r206623, head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c Wed Apr 14 20:31:06 2010 (r206624, copy of r206623, head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c) @@ -0,0 +1,156 @@ +/* FreeBSD/PowerPC specific low level interface, for the remote server for + GDB. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "server.h" +#include "fbsd-low.h" + +#include +#include + +#define ppc_num_regs 71 + +/* Currently, don't check/send MQ. */ +static int ppc_regmap[] = + { 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 44, 48, 52, 56, 60, + 64, 68, 72, 76, 80, 84, 88, 92, + 96, 100, 104, 108, 112, 116, 120, 124, +#if 0 + /* + * XXX on FreeBSD the gdbserver for PowerPC was only tested with FPU-less + * cores i.e. e500. Let's leave the original FPR references around in case + * someone picks up and brings support for AIM-like FPU machines. + */ + PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24, + PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56, + PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88, + PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120, + PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152, + PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184, + PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, + PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, +#endif + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 144, -1, 132, 128, 140, 136, -1 + }; + +static int +ppc_cannot_store_register (int regno) +{ + /* Some kernels do not allow us to store fpscr. */ + if (regno == find_regno ("fpscr")) + return 2; + + return 0; +} + +static int +ppc_cannot_fetch_register (int regno) +{ + return 0; +} + +static CORE_ADDR +ppc_get_pc (void) +{ + unsigned long pc; + + collect_register_by_name ("pc", &pc); + return (CORE_ADDR) pc; +} + +static void +ppc_set_pc (CORE_ADDR pc) +{ + unsigned long newpc = pc; + + supply_register_by_name ("pc", &newpc); +} + +/* Correct in either endianness. Note that this file is + for PowerPC only, not PowerPC64. + This instruction is "twge r2, r2", which GDB uses as a software + breakpoint. */ +static const unsigned long ppc_breakpoint = 0x7d821008; +#define ppc_breakpoint_len 4 + +static int +ppc_breakpoint_at (CORE_ADDR where) +{ + unsigned long insn; + + (*the_target->read_memory) (where, (char *) &insn, 4); + if (insn == ppc_breakpoint) + return 1; + /* If necessary, recognize more trap instructions here. GDB only uses the + one. */ + return 0; +} + +static void +ppc_fill_gregset (void *buf) +{ + int i; + + for (i = 0; i < ppc_num_regs; i++) + if (ppc_regmap[i] != -1) + collect_register (i, ((char *) buf) + ppc_regmap[i]); + +} + +static void +ppc_store_gregset (const void *buf) +{ + int i; + + for (i = 0; i < ppc_num_regs; i++) + if (ppc_regmap[i] != -1) + supply_register (i, ((char *) buf) + ppc_regmap[i]); + +} + +struct regset_info target_regsets[] = { + { PT_GETREGS, PT_SETREGS, sizeof (struct reg), + GENERAL_REGS, + ppc_fill_gregset, ppc_store_gregset }, + { 0, 0, -1, -1, NULL, NULL } +}; + +struct fbsd_target_ops the_low_target = { + ppc_num_regs, + ppc_regmap, + ppc_cannot_fetch_register, + ppc_cannot_store_register, + ppc_get_pc, + ppc_set_pc, + (const char *) &ppc_breakpoint, + ppc_breakpoint_len, + NULL, + 0, + ppc_breakpoint_at, +}; Copied: head/gnu/usr.bin/gdb/gdbserver/reg-amd64.c (from r206623, head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/reg-amd64.c Wed Apr 14 20:31:06 2010 (r206624, copy of r206623, head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c) @@ -0,0 +1,99 @@ +/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ + +/* A register protocol for GDB, the GNU debugger. + Copyright 2001, 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-x86-64.dat''. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "regdef.h" +#include "regcache.h" + +struct reg regs_x86_64[] = { + { "rax", 0, 64 }, + { "rbx", 64, 64 }, + { "rcx", 128, 64 }, + { "rdx", 192, 64 }, + { "rsi", 256, 64 }, + { "rdi", 320, 64 }, + { "rbp", 384, 64 }, + { "rsp", 448, 64 }, + { "r8", 512, 64 }, + { "r9", 576, 64 }, + { "r10", 640, 64 }, + { "r11", 704, 64 }, + { "r12", 768, 64 }, + { "r13", 832, 64 }, + { "r14", 896, 64 }, + { "r15", 960, 64 }, + { "rip", 1024, 64 }, + { "eflags", 1088, 32 }, + { "cs", 1120, 32 }, + { "ss", 1152, 32 }, + { "ds", 1184, 32 }, + { "es", 1216, 32 }, + { "fs", 1248, 32 }, + { "gs", 1280, 32 }, + { "st0", 1312, 80 }, + { "st1", 1392, 80 }, + { "st2", 1472, 80 }, + { "st3", 1552, 80 }, + { "st4", 1632, 80 }, + { "st5", 1712, 80 }, + { "st6", 1792, 80 }, + { "st7", 1872, 80 }, + { "fctrl", 1952, 32 }, + { "fstat", 1984, 32 }, + { "ftag", 2016, 32 }, + { "fiseg", 2048, 32 }, + { "fioff", 2080, 32 }, + { "foseg", 2112, 32 }, + { "fooff", 2144, 32 }, + { "fop", 2176, 32 }, + { "xmm0", 2208, 128 }, + { "xmm1", 2336, 128 }, + { "xmm2", 2464, 128 }, + { "xmm3", 2592, 128 }, + { "xmm4", 2720, 128 }, + { "xmm5", 2848, 128 }, + { "xmm6", 2976, 128 }, + { "xmm7", 3104, 128 }, + { "xmm8", 3232, 128 }, + { "xmm9", 3360, 128 }, + { "xmm10", 3488, 128 }, + { "xmm11", 3616, 128 }, + { "xmm12", 3744, 128 }, + { "xmm13", 3872, 128 }, + { "xmm14", 4000, 128 }, + { "xmm15", 4128, 128 }, + { "mxcsr", 4256, 32 }, +}; + +const char *expedite_regs_x86_64[] = { "rbp", "rsp", "rip", 0 }; + +void +init_registers () +{ + set_register_cache (regs_x86_64, + sizeof (regs_x86_64) / sizeof (regs_x86_64[0])); + gdbserver_expedite_regs = expedite_regs_x86_64; +} Copied: head/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c (from r206623, head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c Wed Apr 14 20:31:06 2010 (r206624, copy of r206623, head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c) @@ -0,0 +1,113 @@ +/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ + +/* A register protocol for GDB, the GNU debugger. + Copyright 2001, 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-ppc.dat''. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "regdef.h" +#include "regcache.h" + +struct reg regs_ppc[] = { + { "r0", 0, 32 }, + { "r1", 32, 32 }, + { "r2", 64, 32 }, + { "r3", 96, 32 }, + { "r4", 128, 32 }, + { "r5", 160, 32 }, + { "r6", 192, 32 }, + { "r7", 224, 32 }, + { "r8", 256, 32 }, + { "r9", 288, 32 }, + { "r10", 320, 32 }, + { "r11", 352, 32 }, + { "r12", 384, 32 }, + { "r13", 416, 32 }, + { "r14", 448, 32 }, + { "r15", 480, 32 }, + { "r16", 512, 32 }, + { "r17", 544, 32 }, + { "r18", 576, 32 }, + { "r19", 608, 32 }, + { "r20", 640, 32 }, + { "r21", 672, 32 }, + { "r22", 704, 32 }, + { "r23", 736, 32 }, + { "r24", 768, 32 }, + { "r25", 800, 32 }, + { "r26", 832, 32 }, + { "r27", 864, 32 }, + { "r28", 896, 32 }, + { "r29", 928, 32 }, + { "r30", 960, 32 }, + { "r31", 992, 32 }, + { "f0", 1024, 64 }, + { "f1", 1088, 64 }, + { "f2", 1152, 64 }, + { "f3", 1216, 64 }, + { "f4", 1280, 64 }, + { "f5", 1344, 64 }, + { "f6", 1408, 64 }, + { "f7", 1472, 64 }, + { "f8", 1536, 64 }, + { "f9", 1600, 64 }, + { "f10", 1664, 64 }, + { "f11", 1728, 64 }, + { "f12", 1792, 64 }, + { "f13", 1856, 64 }, + { "f14", 1920, 64 }, + { "f15", 1984, 64 }, + { "f16", 2048, 64 }, + { "f17", 2112, 64 }, + { "f18", 2176, 64 }, + { "f19", 2240, 64 }, + { "f20", 2304, 64 }, + { "f21", 2368, 64 }, + { "f22", 2432, 64 }, + { "f23", 2496, 64 }, + { "f24", 2560, 64 }, + { "f25", 2624, 64 }, + { "f26", 2688, 64 }, + { "f27", 2752, 64 }, + { "f28", 2816, 64 }, + { "f29", 2880, 64 }, + { "f30", 2944, 64 }, + { "f31", 3008, 64 }, + { "pc", 3072, 32 }, + { "ps", 3104, 32 }, + { "cr", 3136, 32 }, + { "lr", 3168, 32 }, + { "ctr", 3200, 32 }, + { "xer", 3232, 32 }, + { "fpscr", 3264, 32 }, +}; + +const char *expedite_regs_ppc[] = { "r1", "pc", 0 }; + +void +init_registers () +{ + set_register_cache (regs_ppc, + sizeof (regs_ppc) / sizeof (regs_ppc[0])); + gdbserver_expedite_regs = expedite_regs_ppc; +} From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:45:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2915A106564A; Wed, 14 Apr 2010 20:45:34 +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 1540A8FC36; Wed, 14 Apr 2010 20:45: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 o3EKjY9V082307; Wed, 14 Apr 2010 20:45:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EKjXs4082300; Wed, 14 Apr 2010 20:45:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004142045.o3EKjXs4082300@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 14 Apr 2010 20:45: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: r206625 - in head/sys: amd64/conf boot/forth conf dev/sge i386/conf modules modules/sge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:45:34 -0000 Author: yongari Date: Wed Apr 14 20:45:33 2010 New Revision: 206625 URL: http://svn.freebsd.org/changeset/base/206625 Log: Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. This driver was written by Alexander Pohoyda and greatly enhanced by Nikolay Denev. I don't have these hardwares but this driver was tested by Nikolay Denev and xclin. Because SiS didn't release data sheet for this controller, programming information came from Linux driver and OpenSolaris. Unlike other open source driver for SiS190/191, sge(4) takes full advantage of TX/RX checksum offloading and does not require additional copy operation in RX handler. The controller seems to have advanced offloading features like VLAN hardware tag insertion/stripping, TCP segmentation offload(TSO) as well as jumbo frame support but these features are not available yet. Special thanks to xclin cs dot nctu dot edu dot tw> who sent fix for receiving VLAN oversized frames. Added: head/sys/dev/sge/ head/sys/dev/sge/if_sge.c (contents, props changed) head/sys/dev/sge/if_sgereg.h (contents, props changed) head/sys/modules/sge/ head/sys/modules/sge/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Apr 14 20:31:06 2010 (r206624) +++ head/sys/amd64/conf/GENERIC Wed Apr 14 20:45:33 2010 (r206625) @@ -224,6 +224,7 @@ device pcn # AMD Am79C97x PCI 10/100 ( device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Wed Apr 14 20:31:06 2010 (r206624) +++ head/sys/boot/forth/loader.conf Wed Apr 14 20:45:33 2010 (r206625) @@ -271,6 +271,7 @@ if_rl_load="NO" # RealTek 8129/8139 if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet if_sbni_load="NO" # Granch SBNI12 leased line adapters if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire") +if_sge_load="NO" # Silicon Integrated Systems SiS190/191 if_sis_load="NO" # Silicon Integrated Systems SiS 900/7016 if_sk_load="NO" # SysKonnect SK-984x series PCI Gigabit Ethernet if_sn_load="NO" # SMC 91Cxx Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Apr 14 20:31:06 2010 (r206624) +++ head/sys/conf/NOTES Wed Apr 14 20:45:33 2010 (r206625) @@ -1952,6 +1952,7 @@ device xmphy # XaQti XMAC II # This includes dual and quad port cards, as well as one 100baseFX card. # Most of these are 64-bit PCI devices, except for one single port # card which is 32-bit. +# sge: Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet adapter # sis: Support for NICs based on the Silicon Integrated Systems SiS 900, # SiS 7016 and NS DP83815 PCI fast ethernet controller chips. # sk: Support for the SysKonnect SK-984x series PCI gigabit ethernet NICs. @@ -2046,6 +2047,7 @@ device re # RealTek 8139C+/8169/8169S/ device rl # RealTek 8129/8139 device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 14 20:31:06 2010 (r206624) +++ head/sys/conf/files Wed Apr 14 20:45:33 2010 (r206625) @@ -1490,6 +1490,7 @@ dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci pci dev/sf/if_sf.c optional sf pci +dev/sge/if_sge.c optional sge pci dev/si/si.c optional si dev/si/si2_z280.c optional si dev/si/si3_t225.c optional si Added: head/sys/dev/sge/if_sge.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sge/if_sge.c Wed Apr 14 20:45:33 2010 (r206625) @@ -0,0 +1,1745 @@ +/*- + * Copyright (c) 2008-2010 Nikolay Denev + * Copyright (c) 2007-2008 Alexander Pohoyda + * Copyright (c) 1997, 1998, 1999 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHORS OR + * THE VOICES IN THEIR HEADS 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$"); + +/* + * SiS 190/191 PCI Ethernet NIC driver. + * + * Adapted to SiS 190 NIC by Alexander Pohoyda based on the original + * SiS 900 driver by Bill Paul, using SiS 190/191 Solaris driver by + * Masayuki Murayama and SiS 190/191 GNU/Linux driver by K.M. Liu + * . Thanks to Pyun YongHyeon for + * review and very useful comments. + * + * Adapted to SiS 191 NIC by Nikolay Denev with further ideas from the + * Linux and Solaris drivers. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "if_sgereg.h" + +MODULE_DEPEND(sge, pci, 1, 1, 1); +MODULE_DEPEND(sge, ether, 1, 1, 1); +MODULE_DEPEND(sge, miibus, 1, 1, 1); + +/* "device miibus0" required. See GENERIC if you get errors here. */ +#include "miibus_if.h" + +/* + * Various supported device vendors/types and their names. + */ +static struct sge_type sge_devs[] = { + { SIS_VENDORID, SIS_DEVICEID_190, "SiS190 Fast Ethernet" }, + { SIS_VENDORID, SIS_DEVICEID_191, "SiS191 Fast/Gigabit Ethernet" }, + { 0, 0, NULL } +}; + +static int sge_probe(device_t); +static int sge_attach(device_t); +static int sge_detach(device_t); +static int sge_shutdown(device_t); +static int sge_suspend(device_t); +static int sge_resume(device_t); + +static int sge_miibus_readreg(device_t, int, int); +static int sge_miibus_writereg(device_t, int, int, int); +static void sge_miibus_statchg(device_t); + +static int sge_newbuf(struct sge_softc *, int); +static int sge_encap(struct sge_softc *, struct mbuf **); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void + sge_fixup_rx(struct mbuf *); +#endif +static __inline void + sge_discard_rxbuf(struct sge_softc *, int); +static void sge_rxeof(struct sge_softc *); +static void sge_txeof(struct sge_softc *); +static void sge_intr(void *); +static void sge_tick(void *); +static void sge_start(struct ifnet *); +static void sge_start_locked(struct ifnet *); +static int sge_ioctl(struct ifnet *, u_long, caddr_t); +static void sge_init(void *); +static void sge_init_locked(struct sge_softc *); +static void sge_stop(struct sge_softc *); +static void sge_watchdog(struct sge_softc *); +static int sge_ifmedia_upd(struct ifnet *); +static void sge_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int sge_get_mac_addr_apc(struct sge_softc *, uint8_t *); +static int sge_get_mac_addr_eeprom(struct sge_softc *, uint8_t *); +static uint16_t sge_read_eeprom(struct sge_softc *, int); + +static void sge_rxfilter(struct sge_softc *); +static void sge_reset(struct sge_softc *); +static int sge_list_rx_init(struct sge_softc *); +static int sge_list_rx_free(struct sge_softc *); +static int sge_list_tx_init(struct sge_softc *); +static int sge_list_tx_free(struct sge_softc *); + +static int sge_dma_alloc(struct sge_softc *); +static void sge_dma_free(struct sge_softc *); +static void sge_dma_map_addr(void *, bus_dma_segment_t *, int, int); + +static device_method_t sge_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sge_probe), + DEVMETHOD(device_attach, sge_attach), + DEVMETHOD(device_detach, sge_detach), + DEVMETHOD(device_suspend, sge_suspend), + DEVMETHOD(device_resume, sge_resume), + DEVMETHOD(device_shutdown, sge_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* MII interface */ + DEVMETHOD(miibus_readreg, sge_miibus_readreg), + DEVMETHOD(miibus_writereg, sge_miibus_writereg), + DEVMETHOD(miibus_statchg, sge_miibus_statchg), + + KOBJMETHOD_END +}; + +static driver_t sge_driver = { + "sge", sge_methods, sizeof(struct sge_softc) +}; + +static devclass_t sge_devclass; + +DRIVER_MODULE(sge, pci, sge_driver, sge_devclass, 0, 0); +DRIVER_MODULE(miibus, sge, miibus_driver, miibus_devclass, 0, 0); + +/* + * Register space access macros. + */ +#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->sge_res, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->sge_res, reg, val) +#define CSR_WRITE_1(cs, reg, val) bus_write_1(sc->sge_res, reg, val) + +#define CSR_READ_4(sc, reg) bus_read_4(sc->sge_res, reg) +#define CSR_READ_2(sc, reg) bus_read_2(sc->sge_res, reg) +#define CSR_READ_1(sc, reg) bus_read_1(sc->sge_res, reg) + +/* Define to show Tx/Rx error status. */ +#undef SGE_SHOW_ERRORS + +#define SGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +static void +sge_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *p; + + if (error != 0) + return; + KASSERT(nseg == 1, ("too many DMA segments, %d should be 1", nseg)); + p = arg; + *p = segs->ds_addr; +} + +/* + * Read a sequence of words from the EEPROM. + */ +static uint16_t +sge_read_eeprom(struct sge_softc *sc, int offset) +{ + uint32_t val; + int i; + + KASSERT(offset <= EI_OFFSET, ("EEPROM offset too big")); + CSR_WRITE_4(sc, ROMInterface, + EI_REQ | EI_OP_RD | (offset << EI_OFFSET_SHIFT)); + DELAY(500); + for (i = 0; i < SGE_TIMEOUT; i++) { + val = CSR_READ_4(sc, ROMInterface); + if ((val & EI_REQ) == 0) + break; + DELAY(100); + } + if (i == SGE_TIMEOUT) { + device_printf(sc->sge_dev, + "EEPROM read timeout : 0x%08x\n", val); + return (0xffff); + } + + return ((val & EI_DATA) >> EI_DATA_SHIFT); +} + +static int +sge_get_mac_addr_eeprom(struct sge_softc *sc, uint8_t *dest) +{ + uint16_t val; + int i; + + val = sge_read_eeprom(sc, EEPROMSignature); + if (val == 0xffff || val == 0) { + device_printf(sc->sge_dev, + "invalid EEPROM signature : 0x%04x\n", val); + return (EINVAL); + } + + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { + val = sge_read_eeprom(sc, EEPROMMACAddr + i / 2); + dest[i + 0] = (uint8_t)val; + dest[i + 1] = (uint8_t)(val >> 8); + } + + if ((sge_read_eeprom(sc, EEPROMInfo) & 0x80) != 0) + sc->sge_flags |= SGE_FLAG_RGMII; + return (0); +} + +/* + * For SiS96x, APC CMOS RAM is used to store ethernet address. + * APC CMOS RAM is accessed through ISA bridge. + */ +static int +sge_get_mac_addr_apc(struct sge_softc *sc, uint8_t *dest) +{ +#if defined(__amd64__) || defined(__i386__) + devclass_t pci; + device_t bus, dev = NULL; + device_t *kids; + struct apc_tbl { + uint16_t vid; + uint16_t did; + } *tp, apc_tbls[] = { + { SIS_VENDORID, 0x0965 }, + { SIS_VENDORID, 0x0966 }, + { SIS_VENDORID, 0x0968 } + }; + uint8_t reg; + int busnum, cnt, i, j, numkids; + + cnt = sizeof(apc_tbls) / sizeof(apc_tbls[0]); + pci = devclass_find("pci"); + for (busnum = 0; busnum < devclass_get_maxunit(pci); busnum++) { + bus = devclass_get_device(pci, busnum); + if (!bus) + continue; + if (device_get_children(bus, &kids, &numkids) != 0) + continue; + for (i = 0; i < numkids; i++) { + dev = kids[i]; + if (pci_get_class(dev) == PCIC_BRIDGE && + pci_get_subclass(dev) == PCIS_BRIDGE_ISA) { + tp = apc_tbls; + for (j = 0; j < cnt; j++) { + if (pci_get_vendor(dev) == tp->vid && + pci_get_device(dev) == tp->did) { + free(kids, M_TEMP); + goto apc_found; + } + tp++; + } + } + } + free(kids, M_TEMP); + } + device_printf(sc->sge_dev, "couldn't find PCI-ISA bridge\n"); + return (EINVAL); +apc_found: + /* Enable port 0x78 and 0x79 to access APC registers. */ + reg = pci_read_config(dev, 0x48, 1); + pci_write_config(dev, 0x48, reg & ~0x02, 1); + DELAY(50); + pci_read_config(dev, 0x48, 1); + /* Read stored ethernet address. */ + for (i = 0; i < ETHER_ADDR_LEN; i++) { + outb(0x78, 0x09 + i); + dest[i] = inb(0x79); + } + outb(0x78, 0x12); + if ((inb(0x79) & 0x80) != 0) + sc->sge_flags |= SGE_FLAG_RGMII; + /* Restore access to APC registers. */ + pci_write_config(dev, 0x48, reg, 1); + + return (0); +#else + return (EINVAL); +#endif +} + +static int +sge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct sge_softc *sc; + uint32_t val; + int i; + + sc = device_get_softc(dev); + CSR_WRITE_4(sc, GMIIControl, (phy << GMI_PHY_SHIFT) | + (reg << GMI_REG_SHIFT) | GMI_OP_RD | GMI_REQ); + DELAY(10); + for (i = 0; i < SGE_TIMEOUT; i++) { + val = CSR_READ_4(sc, GMIIControl); + if ((val & GMI_REQ) == 0) + break; + DELAY(10); + } + if (i == SGE_TIMEOUT) { + device_printf(sc->sge_dev, "PHY read timeout : %d\n", reg); + return (0); + } + return ((val & GMI_DATA) >> GMI_DATA_SHIFT); +} + +static int +sge_miibus_writereg(device_t dev, int phy, int reg, int data) +{ + struct sge_softc *sc; + uint32_t val; + int i; + + sc = device_get_softc(dev); + CSR_WRITE_4(sc, GMIIControl, (phy << GMI_PHY_SHIFT) | + (reg << GMI_REG_SHIFT) | (data << GMI_DATA_SHIFT) | + GMI_OP_WR | GMI_REQ); + DELAY(10); + for (i = 0; i < SGE_TIMEOUT; i++) { + val = CSR_READ_4(sc, GMIIControl); + if ((val & GMI_REQ) == 0) + break; + DELAY(10); + } + if (i == SGE_TIMEOUT) + device_printf(sc->sge_dev, "PHY write timeout : %d\n", reg); + return (0); +} + +static void +sge_miibus_statchg(device_t dev) +{ + struct sge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint32_t ctl, speed; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->sge_miibus); + ifp = sc->sge_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + speed = 0; + sc->sge_flags &= ~SGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + sc->sge_flags |= SGE_FLAG_LINK; + speed = SC_SPEED_10; + break; + case IFM_100_TX: + sc->sge_flags |= SGE_FLAG_LINK; + speed = SC_SPEED_100; + break; + case IFM_1000_T: + if ((sc->sge_flags & SGE_FLAG_FASTETHER) == 0) { + sc->sge_flags |= SGE_FLAG_LINK; + speed = SC_SPEED_1000; + } + break; + default: + break; + } + } + if ((sc->sge_flags & SGE_FLAG_LINK) == 0) + return; + /* Reprogram MAC to resolved speed/duplex/flow-control parameters. */ + ctl = CSR_READ_4(sc, StationControl); + ctl &= ~(0x0f000000 | SC_FDX | SC_SPEED_MASK); + if (speed == SC_SPEED_1000) { + ctl |= 0x07000000; + sc->sge_flags |= SGE_FLAG_SPEED_1000; + } else { + ctl |= 0x04000000; + sc->sge_flags &= ~SGE_FLAG_SPEED_1000; + } +#ifdef notyet + if ((sc->sge_flags & SGE_FLAG_GMII) != 0) + ctl |= 0x03000000; +#endif + ctl |= speed; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + ctl |= SC_FDX; + sc->sge_flags |= SGE_FLAG_FDX; + } else + sc->sge_flags &= ~SGE_FLAG_FDX; + CSR_WRITE_4(sc, StationControl, ctl); + if ((sc->sge_flags & SGE_FLAG_RGMII) != 0) { + CSR_WRITE_4(sc, RGMIIDelay, 0x0441); + CSR_WRITE_4(sc, RGMIIDelay, 0x0440); + } +} + +static void +sge_rxfilter(struct sge_softc *sc) +{ + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t crc, hashes[2]; + uint16_t rxfilt; + + SGE_LOCK_ASSERT(sc); + + ifp = sc->sge_ifp; + hashes[0] = hashes[1] = 0; + rxfilt = AcceptMyPhys; + if ((ifp->if_flags & IFF_BROADCAST) != 0) + rxfilt |= AcceptBroadcast; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxfilt |= AcceptAllPhys; + rxfilt |= AcceptMulticast; + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + goto done; + } + rxfilt |= AcceptMulticast; + /* Now program new ones. */ + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + hashes[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); + } + if_maddr_runlock(ifp); +done: + CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); + CSR_WRITE_4(sc, RxHashTable, hashes[0]); + CSR_WRITE_4(sc, RxHashTable2, hashes[1]); +} + +static void +sge_reset(struct sge_softc *sc) +{ + + CSR_WRITE_4(sc, IntrMask, 0); + CSR_WRITE_4(sc, IntrStatus, 0xffffffff); + + /* Soft reset. */ + CSR_WRITE_4(sc, IntrControl, 0x8000); + CSR_READ_4(sc, IntrControl); + DELAY(100); + CSR_WRITE_4(sc, IntrControl, 0); + /* Stop MAC. */ + CSR_WRITE_4(sc, TX_CTL, 0x1a00); + CSR_WRITE_4(sc, RX_CTL, 0x1a00); + + CSR_WRITE_4(sc, IntrMask, 0); + CSR_WRITE_4(sc, IntrStatus, 0xffffffff); + + CSR_WRITE_4(sc, GMIIControl, 0); +} + +/* + * Probe for an SiS chip. Check the PCI vendor and device + * IDs against our list and return a device name if we find a match. + */ +static int +sge_probe(device_t dev) +{ + struct sge_type *t; + + t = sge_devs; + while (t->sge_name != NULL) { + if ((pci_get_vendor(dev) == t->sge_vid) && + (pci_get_device(dev) == t->sge_did)) { + device_set_desc(dev, t->sge_name); + return (BUS_PROBE_DEFAULT); + } + t++; + } + + return (ENXIO); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +sge_attach(device_t dev) +{ + struct sge_softc *sc; + struct ifnet *ifp; + uint8_t eaddr[ETHER_ADDR_LEN]; + int error = 0, rid; + + sc = device_get_softc(dev); + sc->sge_dev = dev; + + mtx_init(&sc->sge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->sge_stat_ch, &sc->sge_mtx, 0); + + /* + * Map control/status registers. + */ + pci_enable_busmaster(dev); + + /* Allocate resources. */ + sc->sge_res_id = PCIR_BAR(0); + sc->sge_res_type = SYS_RES_MEMORY; + sc->sge_res = bus_alloc_resource_any(dev, sc->sge_res_type, + &sc->sge_res_id, RF_ACTIVE); + if (sc->sge_res == NULL) { + device_printf(dev, "couldn't allocate resource\n"); + error = ENXIO; + goto fail; + } + + rid = 0; + sc->sge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sge_irq == NULL) { + device_printf(dev, "couldn't allocate IRQ resources\n"); + error = ENXIO; + goto fail; + } + sc->sge_rev = pci_get_revid(dev); + if (pci_get_device(dev) == SIS_DEVICEID_190) + sc->sge_flags |= SGE_FLAG_FASTETHER; + /* Reset the adapter. */ + sge_reset(sc); + + /* Get MAC address from the EEPROM. */ + if ((pci_read_config(dev, 0x73, 1) & 0x01) != 0) + sge_get_mac_addr_apc(sc, eaddr); + else + sge_get_mac_addr_eeprom(sc, eaddr); + + if ((error = sge_dma_alloc(sc)) != 0) + goto fail; + + ifp = sc->sge_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "cannot allocate ifnet structure.\n"); + error = ENOSPC; + goto fail; + } + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = sge_ioctl; + ifp->if_start = sge_start; + ifp->if_init = sge_init; + ifp->if_snd.ifq_drv_maxlen = SGE_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = SGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + /* + * Do MII setup. + */ + if (mii_phy_probe(dev, &sc->sge_miibus, sge_ifmedia_upd, + sge_ifmedia_sts)) { + device_printf(dev, "no PHY found!\n"); + error = ENXIO; + goto fail; + } + + /* + * Call MI attach routine. + */ + ether_ifattach(ifp, eaddr); + + /* VLAN setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable = ifp->if_capabilities; + /* 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->sge_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, sge_intr, sc, &sc->sge_intrhand); + if (error) { + device_printf(dev, "couldn't set up irq\n"); + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error) + sge_detach(dev); + + return (error); +} + +/* + * Shutdown hardware and free up resources. This can be called any + * time after the mutex has been initialized. It is called in both + * the error case in attach and the normal detach case so it needs + * to be careful about only freeing resources that have actually been + * allocated. + */ +static int +sge_detach(device_t dev) +{ + struct sge_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = sc->sge_ifp; + /* These should only be active if attach succeeded. */ + if (device_is_attached(dev)) { + ether_ifdetach(ifp); + SGE_LOCK(sc); + sge_stop(sc); + SGE_UNLOCK(sc); + callout_drain(&sc->sge_stat_ch); + } + if (sc->sge_miibus) + device_delete_child(dev, sc->sge_miibus); + bus_generic_detach(dev); + + if (sc->sge_intrhand) + bus_teardown_intr(dev, sc->sge_irq, sc->sge_intrhand); + if (sc->sge_irq) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sge_irq); + if (sc->sge_res) + bus_release_resource(dev, sc->sge_res_type, sc->sge_res_id, + sc->sge_res); + if (ifp) + if_free(ifp); + sge_dma_free(sc); + mtx_destroy(&sc->sge_mtx); + + return (0); +} + +/* + * Stop all chip I/O so that the kernel's probe routines don't + * get confused by errant DMAs when rebooting. + */ +static int +sge_shutdown(device_t dev) +{ + struct sge_softc *sc; + + sc = device_get_softc(dev); + SGE_LOCK(sc); + sge_stop(sc); + SGE_UNLOCK(sc); + return (0); +} + +static int +sge_suspend(device_t dev) +{ + struct sge_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + SGE_LOCK(sc); + ifp = sc->sge_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + sge_stop(sc); + SGE_UNLOCK(sc); + return (0); +} + +static int +sge_resume(device_t dev) +{ + struct sge_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + SGE_LOCK(sc); + ifp = sc->sge_ifp; + if ((ifp->if_flags & IFF_UP) != 0) + sge_init_locked(sc); + SGE_UNLOCK(sc); + return (0); +} + +static int +sge_dma_alloc(struct sge_softc *sc) +{ + struct sge_chain_data *cd; + struct sge_list_data *ld; + int error, i; + + cd = &sc->sge_cdata; + ld = &sc->sge_ldata; + error = bus_dma_tag_create(bus_get_dma_tag(sc->sge_dev), + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 1, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &cd->sge_tag); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create parent DMA tag.\n"); + goto fail; + } + + /* RX descriptor ring */ + error = bus_dma_tag_create(cd->sge_tag, + SGE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + SGE_RX_RING_SZ, 1, /* maxsize,nsegments */ + SGE_RX_RING_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &cd->sge_rx_tag); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create Rx ring DMA tag.\n"); + goto fail; + } + /* Allocate DMA'able memory and load DMA map for RX ring. */ + error = bus_dmamem_alloc(cd->sge_rx_tag, (void **)&ld->sge_rx_ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &cd->sge_rx_dmamap); + if (error != 0) { + device_printf(sc->sge_dev, + "could not allocate DMA'able memory for Rx ring.\n"); + goto fail; + } + error = bus_dmamap_load(cd->sge_rx_tag, cd->sge_rx_dmamap, + ld->sge_rx_ring, SGE_RX_RING_SZ, sge_dma_map_addr, + &ld->sge_rx_paddr, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sge_dev, + "could not load DMA'able memory for Rx ring.\n"); + } + + /* TX descriptor ring */ + error = bus_dma_tag_create(cd->sge_tag, + SGE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + SGE_TX_RING_SZ, 1, /* maxsize,nsegments */ + SGE_TX_RING_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &cd->sge_tx_tag); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create Rx ring DMA tag.\n"); + goto fail; + } + /* Allocate DMA'able memory and load DMA map for TX ring. */ + error = bus_dmamem_alloc(cd->sge_tx_tag, (void **)&ld->sge_tx_ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &cd->sge_tx_dmamap); + if (error != 0) { + device_printf(sc->sge_dev, + "could not allocate DMA'able memory for Tx ring.\n"); + goto fail; + } + error = bus_dmamap_load(cd->sge_tx_tag, cd->sge_tx_dmamap, + ld->sge_tx_ring, SGE_TX_RING_SZ, sge_dma_map_addr, + &ld->sge_tx_paddr, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sge_dev, + "could not load DMA'able memory for Rx ring.\n"); + goto fail; + } + + /* Create DMA tag for Tx buffers. */ + error = bus_dma_tag_create(cd->sge_tag, 1, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * SGE_MAXTXSEGS, + SGE_MAXTXSEGS, MCLBYTES, 0, NULL, NULL, &cd->sge_txmbuf_tag); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create Tx mbuf DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Rx buffers. */ + error = bus_dma_tag_create(cd->sge_tag, SGE_RX_BUF_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, 0, NULL, NULL, &cd->sge_rxmbuf_tag); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create Rx mbuf DMA tag.\n"); + goto fail; + } + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < SGE_TX_RING_CNT; i++) { + error = bus_dmamap_create(cd->sge_txmbuf_tag, 0, + &cd->sge_tx_map[i]); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create Tx DMA map.\n"); + goto fail; + } + } + /* Create spare DMA map for Rx buffer. */ + error = bus_dmamap_create(cd->sge_rxmbuf_tag, 0, &cd->sge_rx_spare_map); + if (error != 0) { + device_printf(sc->sge_dev, + "could not create spare Rx DMA map.\n"); + goto fail; + } + /* Create DMA maps for Rx buffers. */ + for (i = 0; i < SGE_RX_RING_CNT; i++) { + error = bus_dmamap_create(cd->sge_rxmbuf_tag, 0, + &cd->sge_rx_map[i]); + if (error) { + device_printf(sc->sge_dev, + "could not create Rx DMA map.\n"); + goto fail; + } + } +fail: + return (error); +} + +static void +sge_dma_free(struct sge_softc *sc) +{ + struct sge_chain_data *cd; + struct sge_list_data *ld; + int i; + + cd = &sc->sge_cdata; + ld = &sc->sge_ldata; + /* Rx ring. */ + if (cd->sge_rx_tag != NULL) { + if (cd->sge_rx_dmamap != NULL) + bus_dmamap_unload(cd->sge_rx_tag, cd->sge_rx_dmamap); + if (cd->sge_rx_dmamap != NULL && ld->sge_rx_ring != NULL) + bus_dmamem_free(cd->sge_rx_tag, ld->sge_rx_ring, + cd->sge_rx_dmamap); + ld->sge_rx_ring = NULL; + cd->sge_rx_dmamap = NULL; + bus_dma_tag_destroy(cd->sge_rx_tag); + cd->sge_rx_tag = NULL; + } + /* Tx ring. */ + if (cd->sge_tx_tag != NULL) { + if (cd->sge_tx_dmamap != NULL) + bus_dmamap_unload(cd->sge_tx_tag, cd->sge_tx_dmamap); + if (cd->sge_tx_dmamap != NULL && ld->sge_tx_ring != NULL) + bus_dmamem_free(cd->sge_tx_tag, ld->sge_tx_ring, + cd->sge_tx_dmamap); + ld->sge_tx_ring = NULL; + cd->sge_tx_dmamap = NULL; + bus_dma_tag_destroy(cd->sge_tx_tag); + cd->sge_tx_tag = NULL; + } + /* Rx buffers. */ + if (cd->sge_rxmbuf_tag != NULL) { + for (i = 0; i < SGE_RX_RING_CNT; i++) { + if (cd->sge_rx_map[i] != NULL) { + bus_dmamap_destroy(cd->sge_rxmbuf_tag, + cd->sge_rx_map[i]); + cd->sge_rx_map[i] = NULL; + } + } + if (cd->sge_rx_spare_map != NULL) { + bus_dmamap_destroy(cd->sge_rxmbuf_tag, + cd->sge_rx_spare_map); + cd->sge_rx_spare_map = NULL; + } + bus_dma_tag_destroy(cd->sge_rxmbuf_tag); + cd->sge_rxmbuf_tag = NULL; + } + /* Tx buffers. */ + if (cd->sge_txmbuf_tag != NULL) { + for (i = 0; i < SGE_TX_RING_CNT; i++) { + if (cd->sge_tx_map[i] != NULL) { + bus_dmamap_destroy(cd->sge_txmbuf_tag, + cd->sge_tx_map[i]); + cd->sge_tx_map[i] = NULL; + } + } + bus_dma_tag_destroy(cd->sge_txmbuf_tag); + cd->sge_txmbuf_tag = NULL; + } + if (cd->sge_tag != NULL) + bus_dma_tag_destroy(cd->sge_tag); + cd->sge_tag = NULL; +} + +/* + * Initialize the TX descriptors. + */ +static int +sge_list_tx_init(struct sge_softc *sc) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:50:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F7E106564A; Wed, 14 Apr 2010 20:50:08 +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 E5C198FC0C; Wed, 14 Apr 2010 20:50: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 o3EKo7R9083471; Wed, 14 Apr 2010 20:50:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EKo7A8083469; Wed, 14 Apr 2010 20:50:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004142050.o3EKo7A8083469@svn.freebsd.org> From: Warner Losh Date: Wed, 14 Apr 2010 20:50: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: r206627 - head/sys/contrib/ipfilter/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:50:08 -0000 Author: imp Date: Wed Apr 14 20:50:07 2010 New Revision: 206627 URL: http://svn.freebsd.org/changeset/base/206627 Log: We don't need the definition for in_cksum repeated here since we get it from machine/in_cksum.h. This definition prevents us from using hand-tuned assembler versions of in_cksum. # this fixes the modules build on arm for ipfilter. Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Wed Apr 14 20:48:13 2010 (r206626) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Wed Apr 14 20:50:07 2010 (r206627) @@ -975,7 +975,6 @@ typedef u_int32_t u_32_t; # define SPL_NET(x) ; # define SPL_IMP(x) ; # define SPL_SCHED(x) ; -extern int in_cksum __P((struct mbuf *, int)); # else # define SPL_SCHED(x) x = splhigh() # endif /* __FreeBSD_version >= 500043 */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:54:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C32EF106564A; Wed, 14 Apr 2010 20:54: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 B1FC38FC15; Wed, 14 Apr 2010 20:54: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 o3EKsNNp084460; Wed, 14 Apr 2010 20:54:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EKsNLh084458; Wed, 14 Apr 2010 20:54:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004142054.o3EKsNLh084458@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 14 Apr 2010 20:54: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: r206628 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:54:23 -0000 Author: yongari Date: Wed Apr 14 20:54:23 2010 New Revision: 206628 URL: http://svn.freebsd.org/changeset/base/206628 Log: Add sge(4) to the list of supported network interface. Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Wed Apr 14 20:50:07 2010 (r206627) +++ head/usr.sbin/sysinstall/devices.c Wed Apr 14 20:54:23 2010 (r206628) @@ -150,6 +150,7 @@ static struct _devname { NETWORK("rue", "RealTek USB Ethernet card"), NETWORK("rum", "Ralink Technology USB IEEE 802.11 wireless adapter"), NETWORK("sf", "Adaptec AIC-6915 PCI Ethernet card"), + NETWORK("sge", "Silicon Integrated Systems SiS190/191 Ethernet"), NETWORK("sis", "SiS 900/SiS 7016 PCI Ethernet card"), #ifdef PC98 NETWORK("snc", "SONIC Ethernet card"), From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 20:55:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790381065670; Wed, 14 Apr 2010 20:55:33 +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 67D3D8FC12; Wed, 14 Apr 2010 20:55: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 o3EKtXif084759; Wed, 14 Apr 2010 20:55:33 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EKtXpp084756; Wed, 14 Apr 2010 20:55:33 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004142055.o3EKtXpp084756@svn.freebsd.org> From: Jack F Vogel Date: Wed, 14 Apr 2010 20:55: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: r206629 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:55:33 -0000 Author: jfv Date: Wed Apr 14 20:55:33 2010 New Revision: 206629 URL: http://svn.freebsd.org/changeset/base/206629 Log: Add a missing fragment in the tx msix handler to invoke another if all work is not done. Sync the igb driver with changes suggested by yongari and made in em, these made sense to be in both drivers. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Apr 14 20:54:23 2010 (r206628) +++ head/sys/dev/e1000/if_em.c Wed Apr 14 20:55:33 2010 (r206629) @@ -93,7 +93,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.0.4"; +char em_driver_version[] = "7.0.5"; /********************************************************************* @@ -1484,12 +1484,17 @@ em_msix_tx(void *arg) { struct tx_ring *txr = arg; struct adapter *adapter = txr->adapter; + bool more; ++txr->tx_irq; EM_TX_LOCK(txr); - em_txeof(txr); + more = em_txeof(txr); EM_TX_UNLOCK(txr); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); + if (more) + taskqueue_enqueue(txr->tq, &txr->tx_task); + else + /* Reenable this interrupt */ + E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); return; } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Apr 14 20:54:23 2010 (r206628) +++ head/sys/dev/e1000/if_igb.c Wed Apr 14 20:55:33 2010 (r206629) @@ -99,7 +99,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 1.9.4"; +char igb_driver_version[] = "version - 1.9.5"; /********************************************************************* @@ -758,8 +758,15 @@ igb_start_locked(struct tx_ring *txr, st if (!adapter->link_active) return; - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + /* Call cleanup if number of TX descriptors low */ + if (txr->tx_avail <= IGB_TX_CLEANUP_THRESHOLD) + igb_txeof(txr); + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + if (txr->tx_avail <= IGB_TX_OP_THRESHOLD) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -779,6 +786,7 @@ igb_start_locked(struct tx_ring *txr, st ETHER_BPF_MTAP(ifp, m_head); /* Set watchdog on */ + txr->watchdog_time = ticks; txr->watchdog_check = TRUE; } } @@ -817,8 +825,6 @@ igb_mq_start(struct ifnet *ifp, struct m /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; - else - i = curcpu % adapter->num_queues; txr = &adapter->tx_rings[i]; @@ -847,6 +853,10 @@ igb_mq_start_locked(struct ifnet *ifp, s return (err); } + /* Call cleanup if number of TX descriptors low */ + if (txr->tx_avail <= IGB_TX_CLEANUP_THRESHOLD) + igb_txeof(txr); + enq = 0; if (m == NULL) { next = drbr_dequeue(ifp, txr->br); @@ -856,6 +866,7 @@ igb_mq_start_locked(struct ifnet *ifp, s next = drbr_dequeue(ifp, txr->br); } else next = m; + /* Process the queue */ while (next != NULL) { if ((err = igb_xmit(txr, &next)) != 0) { @@ -877,6 +888,7 @@ igb_mq_start_locked(struct ifnet *ifp, s if (enq > 0) { /* Set the watchdog */ txr->watchdog_check = TRUE; + txr->watchdog_time = ticks; } return (err); } @@ -1248,19 +1260,13 @@ igb_handle_que(void *context, int pendin struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - u32 loop = IGB_MAX_LOOP; bool more; - /* RX first */ - do { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { more = igb_rxeof(que, -1); - } while (loop-- && more); - if (IGB_TX_TRYLOCK(txr)) { - loop = IGB_MAX_LOOP; - do { - more = igb_txeof(txr); - } while (loop-- && more); + IGB_TX_LOCK(txr); + igb_txeof(txr); #if __FreeBSD_version >= 800000 igb_mq_start_locked(ifp, txr, NULL); #else @@ -1268,6 +1274,10 @@ igb_handle_que(void *context, int pendin igb_start_locked(txr, ifp); #endif IGB_TX_UNLOCK(txr); + if (more) { + taskqueue_enqueue(que->tq, &que->que_task); + return; + } } /* Reenable this interrupt */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 21:01:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC1EB1065670; Wed, 14 Apr 2010 21:01:30 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6258FC21; Wed, 14 Apr 2010 21:01:28 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id D6A8545CDD; Wed, 14 Apr 2010 23:01:26 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id BD0A245C9B; Wed, 14 Apr 2010 23:01:14 +0200 (CEST) Date: Wed, 14 Apr 2010 23:01:17 +0200 From: Pawel Jakub Dawidek To: Fabio Checconi Message-ID: <20100414210117.GA2252@garage.freebsd.pl> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> <20100414074616.GA1657@garage.freebsd.pl> <20100414081630.GA74130@onelab2.iet.unipi.it> <20100414160554.GB3188@gandalf.sssup.it> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <20100414160554.GB3188@gandalf.sssup.it> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, Luigi Rizzo , svn-src-all@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:01:31 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 14, 2010 at 06:05:54PM +0200, Fabio Checconi wrote: > - Some classes (from a quick look I've seen only g_mirror, but I'm > pretty sure there were some other ones) cache pointers to their > providers. With these classes this implementation does not work. This can be easly changed to go though geom to provider. Many of my classes do that. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvGLRwACgkQForvXbEpPzSWcwCgrbkP5DHO0mRp8RryCBZATjDz LgsAoJROy5Ip4w6egknaX5mNY6FM88Vf =WM+7 -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 21:27:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F4EB1065686; Wed, 14 Apr 2010 21:27:49 +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 F0C228FC26; Wed, 14 Apr 2010 21:27: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 o3ELRm80092056; Wed, 14 Apr 2010 21:27:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ELRmaa092050; Wed, 14 Apr 2010 21:27:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004142127.o3ELRmaa092050@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 14 Apr 2010 21:27: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: r206631 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:27:49 -0000 Author: yongari Date: Wed Apr 14 21:27:48 2010 New Revision: 206631 URL: http://svn.freebsd.org/changeset/base/206631 Log: Add sge(4) man page and hook up sge(4) to the build. Also add Xr to appropriate man pages. Added: head/share/man/man4/sge.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Apr 14 20:59:37 2010 (r206630) +++ head/share/man/man4/Makefile Wed Apr 14 21:27:48 2010 (r206631) @@ -350,6 +350,7 @@ MAN= aac.4 \ sem.4 \ ses.4 \ sf.4 \ + sge.4 \ si.4 \ siba.4 \ sio.4 \ Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Wed Apr 14 20:59:37 2010 (r206630) +++ head/share/man/man4/altq.4 Wed Apr 14 21:27:48 2010 (r206631) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2009 +.Dd April 14, 2010 .Dt ALTQ 4 .Os .Sh NAME @@ -151,6 +151,7 @@ They have been applied to the following .Xr rl 4 , .Xr rum 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Wed Apr 14 20:59:37 2010 (r206630) +++ head/share/man/man4/miibus.4 Wed Apr 14 21:27:48 2010 (r206631) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt MIIBUS 4 .Os .Sh NAME @@ -97,6 +97,8 @@ RealTek 8129/8139 RealTek RTL8150 USB To Fast Ethernet .It Xr sf 4 Adaptec AIC-6915 +.It Xr sge 4 +Silicon Integrated Systems SiS190/191 Ethernet .It Xr sis 4 Silicon Integrated Systems SiS 900/SiS 7016 .It Xr sk 4 @@ -158,6 +160,7 @@ but as a result are not well behaved new .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Added: head/share/man/man4/sge.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/sge.4 Wed Apr 14 21:27:48 2010 (r206631) @@ -0,0 +1,120 @@ +.\" Copyright (c) 2010 Pyun YongHyeon +.\" 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 April 14, 2010 +.Dt SGE 4 +.Os +.Sh NAME +.Nm sge +.Nd Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device sge" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sge="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for SiS190 Fast Ethernet +controllers and SiS191 Fast/Gigabit Ethernet controllers. +.Pp +All LOMs supported by the +.Nm +driver have TCP/UDP/IP checksum offload for transmit and receive. +Due to lack of documentation more offloading features like TCP +segmentation offload (TSO), hardware VLAN tag stripping/insertion +features, Wake On Lan (WOL), Jumbo frame and an interrupt moderation +mechanism are not supported yet. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseTX +Set 1000baseTX operation over twisted pair. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +SiS190 Fast Ethernet controller +.It +SiS191 Fast/Gigabit Ethernet controller +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Alexander Pohoyda +.Aq alexander.pohoyda@gmx.net . +And enhanced by +.An Nikolay Denev +.Aq ndenev@gmail.com . +It first appeared in +.Fx 8.1 . Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Wed Apr 14 20:59:37 2010 (r206630) +++ head/share/man/man4/vlan.4 Wed Apr 14 21:27:48 2010 (r206631) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt VLAN 4 .Os .Sh NAME @@ -172,6 +172,7 @@ natively: .Xr nve 4 , .Xr rl 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 21:42:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F82106564A; Wed, 14 Apr 2010 21:42:29 +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 5625E8FC14; Wed, 14 Apr 2010 21:42: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 o3ELgTXt095332; Wed, 14 Apr 2010 21:42:29 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ELgTT0095330; Wed, 14 Apr 2010 21:42:29 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201004142142.o3ELgTT0095330@svn.freebsd.org> From: Julian Elischer Date: Wed, 14 Apr 2010 21:42: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: r206632 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:42:29 -0000 Author: julian Date: Wed Apr 14 21:42:29 2010 New Revision: 206632 URL: http://svn.freebsd.org/changeset/base/206632 Log: Change the semantics of the debug.ktr.alq_enable control so that when you disable alq, it acts as if alq had not been enabled in the build. in other words, the rest of ktr is still available for use. If you really don't want that as well, set the mask to 0. MFC after:3 weeks Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Wed Apr 14 21:27:48 2010 (r206631) +++ head/sys/kern/kern_ktr.c Wed Apr 14 21:42:29 2010 (r206632) @@ -199,9 +199,8 @@ ktr_tracepoint(u_int mask, const char *f struct ktr_entry *entry; #ifdef KTR_ALQ struct ale *ale = NULL; -#else - int newindex, saveindex; #endif + int newindex, saveindex; #if defined(KTR_VERBOSE) || defined(KTR_ALQ) struct thread *td; #endif @@ -221,27 +220,30 @@ ktr_tracepoint(u_int mask, const char *f td->td_pflags |= TDP_INKTR; #endif #ifdef KTR_ALQ - if (ktr_alq_enabled && - td->td_critnest == 0 && - (td->td_flags & TDF_IDLETD) == 0 && - td != ald_thread) { - if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) - goto done; - if ((ale = alq_get(ktr_alq, ALQ_NOWAIT)) == NULL) { - ktr_alq_failed++; + if (ktr_alq_enabled) { + if (td->td_critnest == 0 && + (td->td_flags & TDF_IDLETD) == 0 && + td != ald_thread) { + if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) + goto done; + if ((ale = alq_get(ktr_alq, ALQ_NOWAIT)) == NULL) { + ktr_alq_failed++; + goto done; + } + ktr_alq_cnt++; + entry = (struct ktr_entry *)ale->ae_data; + } else { goto done; } - ktr_alq_cnt++; - entry = (struct ktr_entry *)ale->ae_data; } else - goto done; -#else - do { - saveindex = ktr_idx; - newindex = (saveindex + 1) & (KTR_ENTRIES - 1); - } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); - entry = &ktr_buf[saveindex]; #endif + { + do { + saveindex = ktr_idx; + newindex = (saveindex + 1) & (KTR_ENTRIES - 1); + } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); + entry = &ktr_buf[saveindex]; + } entry->ktr_timestamp = KTR_TIME; entry->ktr_cpu = cpu; entry->ktr_thread = curthread; @@ -271,7 +273,7 @@ ktr_tracepoint(u_int mask, const char *f entry->ktr_parms[4] = arg5; entry->ktr_parms[5] = arg6; #ifdef KTR_ALQ - if (ale) + if (ktr_alq_enabled && ale) alq_post(ktr_alq, ale); done: #endif @@ -295,7 +297,9 @@ DB_SHOW_COMMAND(ktr, db_ktr_all) tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); tstate.first = -1; - db_ktr_verbose = index(modif, 'v') != NULL; + db_ktr_verbose = 0; + db_ktr_verbose |= (index(modif, 'v') != NULL) ? 2 : 0; + db_ktr_verbose |= (index(modif, 'V') != NULL) ? 1 : 0; /* just timestap please */ if (index(modif, 'a') != NULL) { db_disable_pager(); while (cncheckc() != -1) @@ -329,9 +333,11 @@ db_mach_vtrace(void) db_printf(":cpu%d", kp->ktr_cpu); #endif db_printf(")"); - if (db_ktr_verbose) { - db_printf(" %10.10lld %s.%d", (long long)kp->ktr_timestamp, - kp->ktr_file, kp->ktr_line); + if (db_ktr_verbose >= 1) { + db_printf(" %10.10lld", (long long)kp->ktr_timestamp); + } + if (db_ktr_verbose >= 2) { + db_printf(" %s.%d", kp->ktr_file, kp->ktr_line); } db_printf(": "); db_printf(kp->ktr_desc, kp->ktr_parms[0], kp->ktr_parms[1], From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 21:44:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0AC51065675; Wed, 14 Apr 2010 21:44:14 +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 AF2A98FC14; Wed, 14 Apr 2010 21:44: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 o3ELiEcU095784; Wed, 14 Apr 2010 21:44:14 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ELiET2095782; Wed, 14 Apr 2010 21:44:14 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201004142144.o3ELiET2095782@svn.freebsd.org> From: Julian Elischer Date: Wed, 14 Apr 2010 21:44: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: r206633 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:44:14 -0000 Author: julian Date: Wed Apr 14 21:44:14 2010 New Revision: 206633 URL: http://svn.freebsd.org/changeset/base/206633 Log: Man page change to documant slight change in ktr_alq behaviour. Modified: head/share/man/man4/ktr.4 Modified: head/share/man/man4/ktr.4 ============================================================================== --- head/share/man/man4/ktr.4 Wed Apr 14 21:42:29 2010 (r206632) +++ head/share/man/man4/ktr.4 Wed Apr 14 21:44:14 2010 (r206633) @@ -122,7 +122,7 @@ option sets the flag to one. The KTR buffer can be examined from within .Xr ddb 4 via the -.Ic show ktr Op Cm /v +.Ic show ktr Op Cm /vV command. This command displays the contents of the trace buffer one page at a time. At the @@ -136,6 +136,10 @@ If the .Cm /v modifier is specified, then they are displayed in addition to the normal output. +If the +.Cm /V +modifier is specified, then just the timestamp is displayed in +addition to the normal output. Note that the events are displayed in reverse chronological order. That is, the most recent events are displayed first. .Ss Logging ktr to Disk @@ -167,7 +171,9 @@ the next invocation. enables logging of .Nm entries to disk if it is set to one. -Setting this to 0 will terminate logging. +Setting this to 0 will terminate logging to disk and revert to +logging to the normal ktr ring buffer. +Data is not sent to the ring buffer while logging to disk. .It Va debug.ktr.alq_max is the maximum number of entries that will be recorded to disk, or 0 for infinite. From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 21:53:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88032106566C; Wed, 14 Apr 2010 21:53:27 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9438FC12; Wed, 14 Apr 2010 21:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ELrR7R097887; Wed, 14 Apr 2010 21:53:27 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ELrRv9097883; Wed, 14 Apr 2010 21:53:27 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004142153.o3ELrRv9097883@svn.freebsd.org> From: Fabien Thomas Date: Wed, 14 Apr 2010 21:53: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: r206635 - head/usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:53:27 -0000 Author: fabient Date: Wed Apr 14 21:53:27 2010 New Revision: 206635 URL: http://svn.freebsd.org/changeset/base/206635 Log: Move fatal error at the right place. Fix exit from top mode when checking if PMC is available. MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c head/usr.sbin/pmcstat/pmcpl_gprof.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Apr 14 21:46:22 2010 (r206634) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Apr 14 21:53:27 2010 (r206635) @@ -581,6 +581,8 @@ pmcpl_cg_topdisplay(void) struct pmcstat_pmcrecord *pmcr; pmcr = pmcstat_pmcindex_to_pmcr(pmcstat_pmcinfilter); + if (!pmcr) + err(EX_SOFTWARE, "ERROR: invalid pmcindex"); /* * We pull out all callgraph nodes in the top-level hash table Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_gprof.c Wed Apr 14 21:46:22 2010 (r206634) +++ head/usr.sbin/pmcstat/pmcpl_gprof.c Wed Apr 14 21:53:27 2010 (r206635) @@ -171,6 +171,8 @@ pmcstat_gmon_create_name(const char *sam char fullpath[PATH_MAX]; pmcname = pmcstat_pmcid_to_name(pmcid); + if (!pmcname) + err(EX_SOFTWARE, "ERROR: cannot find pmcid"); (void) snprintf(fullpath, sizeof(fullpath), "%s/%s/%s", samplesdir, pmcname, Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Wed Apr 14 21:46:22 2010 (r206634) +++ head/usr.sbin/pmcstat/pmcstat_log.c Wed Apr 14 21:53:27 2010 (r206635) @@ -1050,7 +1050,6 @@ pmcstat_pmcid_to_name(pmc_id_t pmcid) if (pr->pr_pmcid == pmcid) return (pmcstat_string_unintern(pr->pr_pmcname)); - err(EX_SOFTWARE, "ERROR: cannot find pmcid"); return NULL; } @@ -1083,7 +1082,6 @@ pmcstat_pmcindex_to_pmcr(int pmcin) if (pr->pr_pmcin == pmcin) return pr; - err(EX_SOFTWARE, "ERROR: invalid pmcindex"); return NULL; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 22:02:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39D95106566B; Wed, 14 Apr 2010 22:02:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27B6B8FC18; Wed, 14 Apr 2010 22:02: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 o3EM2KmF099981; Wed, 14 Apr 2010 22:02:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EM2KPU099977; Wed, 14 Apr 2010 22:02:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004142202.o3EM2KPU099977@svn.freebsd.org> From: Xin LI Date: Wed, 14 Apr 2010 22:02: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: r206637 - in head: sbin/ifconfig share/man/man4 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 22:02:20 -0000 Author: delphij Date: Wed Apr 14 22:02:19 2010 New Revision: 206637 URL: http://svn.freebsd.org/changeset/base/206637 Log: When an underlying ioctl(2) handler returns an error, our ioctl(2) interface considers that it hits a fatal error, and will not copyout the request structure back for _IOW and _IOWR ioctls, keeping them untouched. The previous implementation of the SIOCGIFDESCR ioctl intends to feed the buffer length back to userland. However, if we return an error, the feedback would be defeated and ifconfig(8) would trap into an infinite loop. This commit changes SIOCGIFDESCR to set buffer field to NULL to indicate the previous ENAMETOOLONG case. Reported by: bschmidt MFC after: 2 weeks Modified: head/sbin/ifconfig/ifconfig.c head/share/man/man4/netintro.4 head/sys/net/if.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Wed Apr 14 21:59:22 2010 (r206636) +++ head/sbin/ifconfig/ifconfig.c Wed Apr 14 22:02:19 2010 (r206637) @@ -922,19 +922,20 @@ status(const struct afswtch *afp, const ifr.ifr_buffer.buffer = descr; ifr.ifr_buffer.length = descrlen; if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) { - if (strlen(descr) > 0) - printf("\tdescription: %s\n", descr); - break; - } else if (errno == ENAMETOOLONG) - descrlen = ifr.ifr_buffer.length; - else - break; - } else { + if (ifr.ifr_buffer.buffer == descr) { + if (strlen(descr) > 0) + printf("\tdescription: %s\n", + descr); + } else if (ifr.ifr_buffer.length > descrlen) { + descrlen = ifr.ifr_buffer.length; + continue; + } + } + } else warn("unable to allocate memory for interface" "description"); - break; - } - }; + break; + } if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) { if (ifr.ifr_curcap != 0) { Modified: head/share/man/man4/netintro.4 ============================================================================== --- head/share/man/man4/netintro.4 Wed Apr 14 21:59:22 2010 (r206636) +++ head/share/man/man4/netintro.4 Wed Apr 14 22:02:19 2010 (r206637) @@ -32,7 +32,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd April 14, 2010 .Dt NETINTRO 4 .Os .Sh NAME @@ -292,8 +292,11 @@ field of struct passed in as parameter, and the length would include the terminating nul character. If there is not enough space to hold the interface length, -no copy would be done and an -error would be returned. +no copy would be done and the +.Va buffer +field of +.Va ifru_buffer +would be set to NULL. The kernel will store the buffer length in the .Va length field upon return, regardless whether the buffer itself is Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Apr 14 21:59:22 2010 (r206636) +++ head/sys/net/if.c Wed Apr 14 22:02:19 2010 (r206637) @@ -2049,14 +2049,13 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, case SIOCGIFDESCR: error = 0; sx_slock(&ifdescr_sx); - if (ifp->if_description == NULL) { - ifr->ifr_buffer.length = 0; + if (ifp->if_description == NULL) error = ENOMSG; - } else { + else { /* space for terminating nul */ descrlen = strlen(ifp->if_description) + 1; if (ifr->ifr_buffer.length < descrlen) - error = ENAMETOOLONG; + ifr->ifr_buffer.buffer = NULL; else error = copyout(ifp->if_description, ifr->ifr_buffer.buffer, descrlen); From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 22:03:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331B4106566B; Wed, 14 Apr 2010 22:03:49 +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 21CF28FC1C; Wed, 14 Apr 2010 22:03: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 o3EM3nLT000449; Wed, 14 Apr 2010 22:03:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EM3n7T000447; Wed, 14 Apr 2010 22:03:49 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201004142203.o3EM3n7T000447@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 14 Apr 2010 22:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206638 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 22:03:49 -0000 Author: gavin Date: Wed Apr 14 22:03:48 2010 New Revision: 206638 URL: http://svn.freebsd.org/changeset/base/206638 Log: Use the UIPROTO_BOOT_KEYBOARD #define from usb.h rather than a local (almost identically named) local #define. Reviewed by: hselasky Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed Apr 14 22:02:19 2010 (r206637) +++ head/sys/dev/usb/input/ukbd.c Wed Apr 14 22:03:48 2010 (r206638) @@ -102,8 +102,6 @@ TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_d TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif -#define UPROTO_BOOT_KEYBOARD 1 - #define UKBD_EMULATE_ATSCANCODE 1 #define UKBD_DRIVER_NAME "ukbd" #define UKBD_NMOD 8 /* units */ @@ -770,7 +768,7 @@ ukbd_probe(device_t dev) return (ENXIO); if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && - (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) { + (uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD)) { if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) return (ENXIO); else From owner-svn-src-head@FreeBSD.ORG Wed Apr 14 23:06:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3EB5106564A; Wed, 14 Apr 2010 23:06:07 +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 98B778FC0A; Wed, 14 Apr 2010 23: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 o3EN67ES014142; Wed, 14 Apr 2010 23:06:07 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3EN67gI014138; Wed, 14 Apr 2010 23:06:07 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201004142306.o3EN67gI014138@svn.freebsd.org> From: Julian Elischer Date: Wed, 14 Apr 2010 23:06: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: r206639 - in head/sys: ddb net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 23:06:07 -0000 Author: julian Date: Wed Apr 14 23:06:07 2010 New Revision: 206639 URL: http://svn.freebsd.org/changeset/base/206639 Log: Move two copies of the same definition to a common include file. MFC after: 3 weeks Modified: head/sys/ddb/db_sym.c head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/ddb/db_sym.c ============================================================================== --- head/sys/ddb/db_sym.c Wed Apr 14 22:03:48 2010 (r206638) +++ head/sys/ddb/db_sym.c Wed Apr 14 23:06:07 2010 (r206639) @@ -64,12 +64,6 @@ static boolean_t db_line_at_pc(c_db_sym_ static int db_cpu = -1; #ifdef VIMAGE -extern uintptr_t *__start_set_vnet; -extern uintptr_t *__stop_set_vnet; - -#define VNET_START (uintptr_t)&__start_set_vnet -#define VNET_STOP (uintptr_t)&__stop_set_vnet - static void *db_vnet = NULL; #endif Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed Apr 14 22:03:48 2010 (r206638) +++ head/sys/net/vnet.c Wed Apr 14 23:06:07 2010 (r206639) @@ -154,15 +154,6 @@ struct vnet *vnet0; */ /* - * Location of the kernel's 'set_vnet' linker set. - */ -extern uintptr_t *__start_set_vnet; -extern uintptr_t *__stop_set_vnet; - -#define VNET_START (uintptr_t)&__start_set_vnet -#define VNET_STOP (uintptr_t)&__stop_set_vnet - -/* * Number of bytes of data in the 'set_vnet' linker set, and hence the total * size of all kernel virtualized global variables, and the malloc(9) type * that will be used to allocate it. Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Apr 14 22:03:48 2010 (r206638) +++ head/sys/net/vnet.h Wed Apr 14 23:06:07 2010 (r206639) @@ -92,6 +92,15 @@ struct vnet { #include /* + * Location of the kernel's 'set_vnet' linker set. + */ +extern uintptr_t *__start_set_vnet; +extern uintptr_t *__stop_set_vnet; + +#define VNET_START (uintptr_t)&__start_set_vnet +#define VNET_STOP (uintptr_t)&__stop_set_vnet + +/* * Functions to allocate and destroy virtual network stacks. */ struct vnet *vnet_alloc(void); From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 06:19:04 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFE44106566B; Thu, 15 Apr 2010 06:19:04 +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 661BE8FC12; Thu, 15 Apr 2010 06:19:04 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C8FE573098; Thu, 15 Apr 2010 08:29:31 +0200 (CEST) Date: Thu, 15 Apr 2010 08:29:31 +0200 From: Luigi Rizzo To: Pawel Jakub Dawidek Message-ID: <20100415062931.GA92769@onelab2.iet.unipi.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <20100412204926.GB1743@garage.freebsd.pl> <20100412210512.GB94885@onelab2.iet.unipi.it> <20100414074616.GA1657@garage.freebsd.pl> <20100414081630.GA74130@onelab2.iet.unipi.it> <20100414160554.GB3188@gandalf.sssup.it> <20100414210117.GA2252@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414210117.GA2252@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Fabio Checconi Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 06:19:04 -0000 On Wed, Apr 14, 2010 at 11:01:17PM +0200, Pawel Jakub Dawidek wrote: > On Wed, Apr 14, 2010 at 06:05:54PM +0200, Fabio Checconi wrote: > > - Some classes (from a quick look I've seen only g_mirror, but I'm > > pretty sure there were some other ones) cache pointers to their > > providers. With these classes this implementation does not work. > > This can be easly changed to go though geom to provider. Many of my > classes do that. Absolutely. The above was just to explain why we only implemented insert/remove within geom_sched instead of globally. If/when we make the feature globally available, we also need to inspect all classes to make sure that there are no surprises. cheers luigi > > -- > Pawel Jakub Dawidek http://www.wheelsystems.com > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 08:29:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890DB106564A; Thu, 15 Apr 2010 08:29:14 +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 77D698FC13; Thu, 15 Apr 2010 08:29:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3F8TEkO042466; Thu, 15 Apr 2010 08:29:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3F8TEa4042464; Thu, 15 Apr 2010 08:29:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004150829.o3F8TEa4042464@svn.freebsd.org> From: Andriy Gapon Date: Thu, 15 Apr 2010 08:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206648 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 08:29:14 -0000 Author: avg Date: Thu Apr 15 08:29:14 2010 New Revision: 206648 URL: http://svn.freebsd.org/changeset/base/206648 Log: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize CD_FLAG_VALID_TOC is not required for setting those media properties. PR: kern/145385 Submitted by: Juergen Lock a slightly different version Tested by: Pavel Sukhoy , Markus Wild , Juergen Lock , uqs MFC after: 1 week Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Apr 15 08:20:57 2010 (r206647) +++ head/sys/cam/scsi/scsi_cd.c Thu Apr 15 08:29:14 2010 (r206648) @@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph) softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC); cdprevent(periph, PR_ALLOW); return (error); - } else + } else { softc->flags |= CD_FLAG_VALID_MEDIA; + softc->disk->d_sectorsize = softc->params.blksize; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } /* * Now we check the table of contents. This (currently) is only @@ -2863,9 +2867,6 @@ cdcheckmedia(struct cam_periph *periph) } softc->flags |= CD_FLAG_VALID_TOC; - softc->disk->d_sectorsize = softc->params.blksize; - softc->disk->d_mediasize = - (off_t)softc->params.blksize * softc->params.disksize; bailout: From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 08:32:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6AE21065676; Thu, 15 Apr 2010 08:32:50 +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 95CE68FC21; Thu, 15 Apr 2010 08:32: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 o3F8Wo4a043308; Thu, 15 Apr 2010 08:32:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3F8Wo2h043306; Thu, 15 Apr 2010 08:32:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004150832.o3F8Wo2h043306@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 15 Apr 2010 08:32: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: r206649 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 08:32:50 -0000 Author: kib Date: Thu Apr 15 08:32:50 2010 New Revision: 206649 URL: http://svn.freebsd.org/changeset/base/206649 Log: Still reference struct __sigaction with clarification when this form of argument declaration is needed. Discussed with: bde MFC after: 3 days Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Thu Apr 15 08:29:14 2010 (r206648) +++ head/lib/libc/sys/sigaction.2 Thu Apr 15 08:32:50 2010 (r206649) @@ -496,6 +496,16 @@ or .Dv SIG_IGN this way. .Pp +If preprocessing symbol +.Va _POSIX_C_SOURCE +with the value >= 199309 is not defined, the following declaration for +the handler shall be used: +.Bl -tag -offset indent -width short +.It Tn POSIX Dv SA_SIGINFO : +.Ft void +.Fn handler int "struct __sigaction *" "void *" ; +.El +.Pp If the .Dv SA_SIGINFO flag is not set, the handler function should match From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 08:39:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65D94106564A; Thu, 15 Apr 2010 08:39: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 554C68FC13; Thu, 15 Apr 2010 08:39: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 o3F8duc2044971; Thu, 15 Apr 2010 08:39:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3F8duH0044969; Thu, 15 Apr 2010 08:39:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004150839.o3F8duH0044969@svn.freebsd.org> From: Andriy Gapon Date: Thu, 15 Apr 2010 08:39: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: r206650 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 08:39:56 -0000 Author: avg Date: Thu Apr 15 08:39:56 2010 New Revision: 206650 URL: http://svn.freebsd.org/changeset/base/206650 Log: g_io_check: respond to zero pp->mediasize with ENXIO Previsouly this condition was reported with EIO by bio_offset > mediasize check. Perhaps that check should be extended to bio_offset+bio_length > mediasize. MFC after: 1 week Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Thu Apr 15 08:32:50 2010 (r206649) +++ head/sys/geom/geom_io.c Thu Apr 15 08:39:56 2010 (r206650) @@ -309,8 +309,8 @@ g_io_check(struct bio *bp) case BIO_READ: case BIO_WRITE: case BIO_DELETE: - /* Zero sectorsize is a probably lack of media */ - if (pp->sectorsize == 0) + /* Zero sectorsize or mediasize is probably a lack of media. */ + if (pp->sectorsize == 0 || pp->mediasize == 0) return (ENXIO); /* Reject I/O not on sector boundary */ if (bp->bio_offset % pp->sectorsize) From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 09:22:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68B061065678; Thu, 15 Apr 2010 09:22:14 +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 584AF8FC0C; Thu, 15 Apr 2010 09:22: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 o3F9MEDG054259; Thu, 15 Apr 2010 09:22:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3F9ME1n054257; Thu, 15 Apr 2010 09:22:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004150922.o3F9ME1n054257@svn.freebsd.org> From: Andriy Gapon Date: Thu, 15 Apr 2010 09:22: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: r206651 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 09:22:14 -0000 Author: avg Date: Thu Apr 15 09:22:14 2010 New Revision: 206651 URL: http://svn.freebsd.org/changeset/base/206651 Log: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize [Forced commit to correct PR number.] CD_FLAG_VALID_TOC is not required for setting those media properties. PR: kern/138789 Submitted by: Juergen Lock a slightly different version Tested by: Pavel Sukhoy , Markus Wild , Juergen Lock , uqs MFC after: 1 week Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 11:17:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8018A106566C; Thu, 15 Apr 2010 11:17:33 +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 70F528FC13; Thu, 15 Apr 2010 11:17: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 o3FBHXR1081103; Thu, 15 Apr 2010 11:17:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FBHXAB081101; Thu, 15 Apr 2010 11:17:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004151117.o3FBHXAB081101@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Apr 2010 11:17: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: r206652 - head/sys/dev/siis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 11:17:33 -0000 Author: mav Date: Thu Apr 15 11:17:33 2010 New Revision: 206652 URL: http://svn.freebsd.org/changeset/base/206652 Log: Explicitly enable PCI busmastering on attach. Now SiI3124 with siis(4) successfully works on sparc64 (SunBlade 100). H/W donated by: Gheorghe Ardelean Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Thu Apr 15 09:22:14 2010 (r206651) +++ head/sys/dev/siis/siis.c Thu Apr 15 11:17:33 2010 (r206652) @@ -164,6 +164,7 @@ siis_attach(device_t dev) rman_fini(&ctlr->sc_iomem); return (error); } + pci_enable_busmaster(dev); /* Reset controller */ siis_resume(dev); /* Number of HW channels */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 12:40:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8E5F106564A; Thu, 15 Apr 2010 12:40:33 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99D448FC20; Thu, 15 Apr 2010 12:40: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 o3FCeXQM000168; Thu, 15 Apr 2010 12:40:33 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FCeX1J000166; Thu, 15 Apr 2010 12:40:33 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <201004151240.o3FCeX1J000166@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Thu, 15 Apr 2010 12:40: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: r206659 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 12:40:33 -0000 Author: vanhu Date: Thu Apr 15 12:40:33 2010 New Revision: 206659 URL: http://svn.freebsd.org/changeset/base/206659 Log: Locks SPTREE when setting some SP entries to state DEAD. This can prevent kernel panics when updating SPs while there is some traffic for them. Obtained from: NETASQ MFC after: 1m Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Thu Apr 15 12:40:02 2010 (r206658) +++ head/sys/netipsec/key.c Thu Apr 15 12:40:33 2010 (r206659) @@ -1882,7 +1882,9 @@ key_spdadd(so, m, mhp) newsp = key_getsp(&spidx); if (mhp->msg->sadb_msg_type == SADB_X_SPDUPDATE) { if (newsp) { + SPTREE_LOCK(); newsp->state = IPSEC_SPSTATE_DEAD; + SPTREE_UNLOCK(); KEY_FREESP(&newsp); } } else { @@ -2117,7 +2119,9 @@ key_spddelete(so, m, mhp) /* save policy id to buffer to be returned. */ xpl0->sadb_x_policy_id = sp->id; + SPTREE_LOCK(); sp->state = IPSEC_SPSTATE_DEAD; + SPTREE_UNLOCK(); KEY_FREESP(&sp); { @@ -2184,7 +2188,9 @@ key_spddelete2(so, m, mhp) return key_senderror(so, m, EINVAL); } + SPTREE_LOCK(); sp->state = IPSEC_SPSTATE_DEAD; + SPTREE_UNLOCK(); KEY_FREESP(&sp); { From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 13:02:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D8861065672; Thu, 15 Apr 2010 13:02:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id BB6028FC19; Thu, 15 Apr 2010 13:02:01 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 524AD1518AD; Thu, 15 Apr 2010 16:01:56 +0300 (EEST) Date: Thu, 15 Apr 2010 16:01:56 +0300 From: Jaakko Heinonen To: Kostik Belousov Message-ID: <20100415130155.GA3017@a91-153-117-195.elisa-laajakaista.fi> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> <20100414130343.GO2415@deviant.kiev.zoral.com.ua> <20100414141959.GA3276@a91-153-117-195.elisa-laajakaista.fi> <20100414154248.GR2415@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100414154248.GR2415@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: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 13:02:03 -0000 On 2010-04-14, Kostik Belousov wrote: > First, I think we shall sort dirent->dd_dlist so that symlinks are > located before any other entries, and allow for duplication of > any name with the name of symlink. What will happen when user deletes a symlink covering a device? Uncovering the device may a bit surprising? If user created directories will be allowed one day, they will face the same problem. > I remember there was a PR to change devfs_symlink() so that symlink is > added to dd_dlist into head, not to a tail, as it is done now. kern/114057 > Assume that all full devfs pathes except symlinks are stored somewhere > with type information for the component at the end. > Then, just iterating this set at make_dev() time, we can verify that > name is not a duplicate, and that the path components are not already > used as device name (only as directories). > The pathes storage need to be protected by dev_mtx. > > Possibly, the cdev_priv.c_dev.__si_namebuf may be reused at the > cost of long check at the make_dev() time. Could you elaborate on this? I am not sure if I understand what you mean with __si_namebuf reuse. > What do you think of this ? I don't see anything obviously wrong with it. -- Jaakko From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 13:26:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCCFC1065672; Thu, 15 Apr 2010 13:26:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 697D98FC1B; Thu, 15 Apr 2010 13:26:32 +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 o3FDQSUP050415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 16:26:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3FDQS3r033642; Thu, 15 Apr 2010 16:26:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3FDQS5h033641; Thu, 15 Apr 2010 16:26:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Apr 2010 16:26:28 +0300 From: Kostik Belousov To: Jaakko Heinonen Message-ID: <20100415132628.GE2415@deviant.kiev.zoral.com.ua> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> <20100414084037.GK2415@deviant.kiev.zoral.com.ua> <20100414124912.GA2950@a91-153-117-195.elisa-laajakaista.fi> <20100414130343.GO2415@deviant.kiev.zoral.com.ua> <20100414141959.GA3276@a91-153-117-195.elisa-laajakaista.fi> <20100414154248.GR2415@deviant.kiev.zoral.com.ua> <20100415130155.GA3017@a91-153-117-195.elisa-laajakaista.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RQwN4daKXWcbejL/" Content-Disposition: inline In-Reply-To: <20100415130155.GA3017@a91-153-117-195.elisa-laajakaista.fi> 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=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 13:26:34 -0000 --RQwN4daKXWcbejL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 15, 2010 at 04:01:56PM +0300, Jaakko Heinonen wrote: > On 2010-04-14, Kostik Belousov wrote: > > First, I think we shall sort dirent->dd_dlist so that symlinks are > > located before any other entries, and allow for duplication of > > any name with the name of symlink. >=20 > What will happen when user deletes a symlink covering a device? > Uncovering the device may a bit surprising? If user created directories > will be allowed one day, they will face the same problem. Yes, device will be uncovered if it is there, the same with the directory. Use case I have in mind when I wrote this is the following: assume we have devices named dev1 and dev2, and two jails, j1 and j2, each with its own devfs mount. Also, assume that some program A has hardcoded /dev/dev1 as the name of device to operate, and it is run both in j1 and j2. Further, j1 is given access to /dev/dev1 only, while j2 is given access to /dev/dev2 only. Then administrator of j1 can create a symlink /dev/dev -> dev1, while administrator of j2 symlinks /dev/dev ->dev2, and both j1 and j2 would operate properly. This is not that perversed as it sounds, I think it is an essence of symlink usage on devfs. >=20 > > I remember there was a PR to change devfs_symlink() so that symlink is > > added to dd_dlist into head, not to a tail, as it is done now. >=20 > kern/114057 >=20 > > Assume that all full devfs pathes except symlinks are stored somewhere > > with type information for the component at the end. > > Then, just iterating this set at make_dev() time, we can verify that > > name is not a duplicate, and that the path components are not already > > used as device name (only as directories). > > The pathes storage need to be protected by dev_mtx.=20 > >=20 > > Possibly, the cdev_priv.c_dev.__si_namebuf may be reused at the > > cost of long check at the make_dev() time. >=20 > Could you elaborate on this? I am not sure if I understand what you mean > with __si_namebuf reuse. I mean that we do not to create the structure that mirrors the directory/no= des hierarchy for devfs dirents, but can dynamically parse __si_namebuf at the make_dev() time, iterating over all nodes using cdevp_list. For symlinks, it seems the easiest route is to have separate ref-counted structures containing the pathes for owning directories. >=20 > > What do you think of this ? >=20 > I don't see anything obviously wrong with it. >=20 > --=20 > Jaakko --RQwN4daKXWcbejL/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvHFAMACgkQC3+MBN1Mb4gTSwCgpRgYstpHdZl967cwjRk3JvKK TF8AoJKdJfcBSHJsILcn3WGRQ3yV2Dez =Pe7P -----END PGP SIGNATURE----- --RQwN4daKXWcbejL/-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 13:50:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72A53106566C; Thu, 15 Apr 2010 13:50:55 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613D18FC12; Thu, 15 Apr 2010 13:50: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 o3FDotVv015867; Thu, 15 Apr 2010 13:50:55 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FDotFC015864; Thu, 15 Apr 2010 13:50:55 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201004151350.o3FDotFC015864@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 15 Apr 2010 13:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206662 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 13:50:55 -0000 Author: gallatin Date: Thu Apr 15 13:50:55 2010 New Revision: 206662 URL: http://svn.freebsd.org/changeset/base/206662 Log: Cleanup if_media handling in mxge(4) - Re-probe xfp / sfp+ socket on link events, in case user has changed transceiver - correctly report current media to avoid confusing lagg (reported by Panasas) - Report link speed (submitted by yongari) Reviewed by: yongari (earlier version) MFC after: 7 days Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Apr 15 12:46:16 2010 (r206661) +++ head/sys/dev/mxge/if_mxge.c Thu Apr 15 13:50:55 2010 (r206662) @@ -883,6 +883,9 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t case MXGEFW_CMD_ERROR_BUSY: err = EBUSY; break; + case MXGEFW_CMD_ERROR_I2C_ABSENT: + err = ENXIO; + break; default: device_printf(sc->dev, "mxge: command %d " @@ -2782,37 +2785,25 @@ static struct mxge_media_type mxge_sfp_m }; static void -mxge_set_media(mxge_softc_t *sc, int type) +mxge_media_set(mxge_softc_t *sc, int media_type) { - sc->media_flags |= type; - ifmedia_add(&sc->media, sc->media_flags, 0, NULL); - ifmedia_set(&sc->media, sc->media_flags); -} + + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, + 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | media_type); + sc->current_media = media_type; + sc->media.ifm_media = sc->media.ifm_cur->ifm_media; +} -/* - * Determine the media type for a NIC. Some XFPs will identify - * themselves only when their link is up, so this is initiated via a - * link up interrupt. However, this can potentially take up to - * several milliseconds, so it is run via the watchdog routine, rather - * than in the interrupt handler itself. This need only be done - * once, not each time the link is up. - */ static void -mxge_media_probe(mxge_softc_t *sc) +mxge_media_init(mxge_softc_t *sc) { - mxge_cmd_t cmd; - char *cage_type; char *ptr; - struct mxge_media_type *mxge_media_types = NULL; - int i, err, ms, mxge_media_type_entries; - uint32_t byte; - - sc->need_media_probe = 0; + int i; - /* if we've already set a media type, we're done */ - if (sc->media_flags != (IFM_ETHER | IFM_AUTO)) - return; + ifmedia_removeall(&sc->media); + mxge_media_set(sc, IFM_AUTO); /* * parse the product code to deterimine the interface type @@ -2823,6 +2814,7 @@ mxge_media_probe(mxge_softc_t *sc) ptr = sc->product_code_string; if (ptr == NULL) { device_printf(sc->dev, "Missing product code\n"); + return; } for (i = 0; i < 3; i++, ptr++) { @@ -2835,17 +2827,44 @@ mxge_media_probe(mxge_softc_t *sc) } if (*ptr == 'C') { /* -C is CX4 */ - mxge_set_media(sc, IFM_10G_CX4); - return; - } - else if (*ptr == 'Q') { + sc->connector = MXGE_CX4; + mxge_media_set(sc, IFM_10G_CX4); + } else if (*ptr == 'Q') { /* -Q is Quad Ribbon Fiber */ + sc->connector = MXGE_QRF; device_printf(sc->dev, "Quad Ribbon Fiber Media\n"); /* FreeBSD has no media type for Quad ribbon fiber */ - return; + } else if (*ptr == 'R') { + /* -R is XFP */ + sc->connector = MXGE_XFP; + } else if (*ptr == 'S' || *(ptr +1) == 'S') { + /* -S or -2S is SFP+ */ + sc->connector = MXGE_SFP; + } else { + device_printf(sc->dev, "Unknown media type: %c\n", *ptr); } +} - if (*ptr == 'R') { +/* + * Determine the media type for a NIC. Some XFPs will identify + * themselves only when their link is up, so this is initiated via a + * link up interrupt. However, this can potentially take up to + * several milliseconds, so it is run via the watchdog routine, rather + * than in the interrupt handler itself. + */ +static void +mxge_media_probe(mxge_softc_t *sc) +{ + mxge_cmd_t cmd; + char *cage_type; + + struct mxge_media_type *mxge_media_types = NULL; + int i, err, ms, mxge_media_type_entries; + uint32_t byte; + + sc->need_media_probe = 0; + + if (sc->connector == MXGE_XFP) { /* -R is XFP */ mxge_media_types = mxge_xfp_media_types; mxge_media_type_entries = @@ -2853,9 +2872,7 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_xfp_media_types[0]); byte = MXGE_XFP_COMPLIANCE_BYTE; cage_type = "XFP"; - } - - if (*ptr == 'S' || *(ptr +1) == 'S') { + } else if (sc->connector == MXGE_SFP) { /* -S or -2S is SFP+ */ mxge_media_types = mxge_sfp_media_types; mxge_media_type_entries = @@ -2863,10 +2880,8 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_sfp_media_types[0]); cage_type = "SFP+"; byte = 3; - } - - if (mxge_media_types == NULL) { - device_printf(sc->dev, "Unknown media type: %c\n", *ptr); + } else { + /* nothing to do; media type cannot change */ return; } @@ -2909,7 +2924,10 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, mxge_media_types[0].flag); + if (sc->current_media != mxge_media_types[0].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[0].flag); + } return; } for (i = 1; i < mxge_media_type_entries; i++) { @@ -2919,12 +2937,16 @@ mxge_media_probe(mxge_softc_t *sc) cage_type, mxge_media_types[i].name); - mxge_set_media(sc, mxge_media_types[i].flag); + if (sc->current_media != mxge_media_types[i].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[i].flag); + } return; } } - device_printf(sc->dev, "%s media 0x%x unknown\n", cage_type, - cmd.data0); + if (mxge_verbose) + device_printf(sc->dev, "%s media 0x%x unknown\n", + cage_type, cmd.data0); return; } @@ -2988,10 +3010,12 @@ mxge_intr(void *arg) sc->link_state = stats->link_up; if (sc->link_state) { if_link_state_change(sc->ifp, LINK_STATE_UP); + sc->ifp->if_baudrate = IF_Gbps(10UL); if (mxge_verbose) device_printf(sc->dev, "link up\n"); } else { if_link_state_change(sc->ifp, LINK_STATE_DOWN); + sc->ifp->if_baudrate = 0; if (mxge_verbose) device_printf(sc->dev, "link down\n"); } @@ -4026,9 +4050,9 @@ mxge_media_status(struct ifnet *ifp, str if (sc == NULL) return; ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER | IFM_FDX; ifmr->ifm_status |= sc->link_state ? IFM_ACTIVE : 0; - ifmr->ifm_active = IFM_AUTO | IFM_ETHER; - ifmr->ifm_active |= sc->link_state ? IFM_FDX : 0; + ifmr->ifm_active |= sc->current_media; } static int @@ -4135,6 +4159,9 @@ mxge_ioctl(struct ifnet *ifp, u_long com break; case SIOCGIFMEDIA: + mtx_lock(&sc->driver_mtx); + mxge_media_probe(sc); + mtx_unlock(&sc->driver_mtx); err = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->media, command); break; @@ -4766,7 +4793,7 @@ mxge_attach(device_t dev) /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); - mxge_set_media(sc, IFM_ETHER | IFM_AUTO); + mxge_media_init(sc); mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Thu Apr 15 12:46:16 2010 (r206661) +++ head/sys/dev/mxge/if_mxge_var.h Thu Apr 15 13:50:55 2010 (r206662) @@ -268,6 +268,8 @@ struct mxge_softc { int num_slices; int rx_ring_size; int dying; + int connector; + int current_media; mxge_dma_t dmabench_dma; struct callout co_hdl; struct taskqueue *tq; @@ -293,6 +295,12 @@ struct mxge_softc { #define MXGE_MIN_THROTTLE 416 #define MXGE_MAX_THROTTLE 4096 +/* Types of connectors on NICs supported by this driver */ +#define MXGE_CX4 0 +#define MXGE_XFP 1 +#define MXGE_SFP 2 +#define MXGE_QRF 3 + #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) #define MXGE_LOWPART_TO_U32(X) ((uint32_t)(X)) From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 14:26:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C51D106566B; Thu, 15 Apr 2010 14:26:52 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B97D8FC0A; Thu, 15 Apr 2010 14:26: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 o3FEQqXi024416; Thu, 15 Apr 2010 14:26:52 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FEQqWs024414; Thu, 15 Apr 2010 14:26:52 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201004151426.o3FEQqWs024414@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 15 Apr 2010 14:26: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: r206663 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 14:26:52 -0000 Author: gallatin Date: Thu Apr 15 14:26:52 2010 New Revision: 206663 URL: http://svn.freebsd.org/changeset/base/206663 Log: Add missing IFCAP_LINKSTATE to mxge Submitted by: yongari Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Apr 15 13:50:55 2010 (r206662) +++ head/sys/dev/mxge/if_mxge.c Thu Apr 15 14:26:52 2010 (r206663) @@ -4759,7 +4759,7 @@ mxge_attach(device_t dev) ifp->if_baudrate = IF_Gbps(10UL); ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 | - IFCAP_VLAN_MTU; + IFCAP_VLAN_MTU | IFCAP_LINKSTATE; #ifdef INET ifp->if_capabilities |= IFCAP_LRO; #endif From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 14:38:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C65106566C; Thu, 15 Apr 2010 14:38:29 +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 5776E8FC12; Thu, 15 Apr 2010 14:38:27 +0000 (UTC) Received: by people.fsn.hu (Postfix, from userid 1001) id B2C8D28440F; Thu, 15 Apr 2010 16:38:25 +0200 (CEST) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000015, version=1.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MF-ACE0E1EA [pR: 10.2068] X-CRM114-CacheID: sfid-20100415_16382_42E318B0 X-CRM114-Status: Good ( pR: 10.2068 ) X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Apr 15 16:38:25 2010 X-DSPAM-Confidence: 0.9910 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4bc724e1916091155713286 X-DSPAM-Factors: 27, wrote, 0.00390, >+>, 0.00425, wrote+>, 0.00498, >, 0.00583, >, 0.00583, From*Attila Nagy , 0.00602, file+or, 0.01000, User-Agent*rv+1.8.1.23), 0.01000, requests, 0.01000, Subject*svn, 0.01000, User-Agent*Mnenhy/0.7.6.0, 0.01000, (the, 0.01000, README, 0.01000, Message-ID*fsn.hu>, 0.01000, support+for, 0.01000, User-Agent*Mozilla/5.0+(X11, 0.01000, manner, 0.01000, User-Agent*1.8.1.23), 0.01000, >+and, 0.01000, Subject*commit, 0.01000, User-Agent*i686+en, 0.01000, User-Agent*Thunderbird/2.0.0.23, 0.01000, User-Agent*U+Linux, 0.01000, From*Nagy, 0.01000, From*Attila, 0.01000, >+This, 0.01000, X-Spambayes-Classification: ham; 0.00 Message-ID: <4BC724DF.7010907@fsn.hu> Date: Thu, 15 Apr 2010 16:38:23 +0200 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: Luigi Rizzo References: <201004121637.o3CGbjSK080066@svn.freebsd.org> In-Reply-To: <201004121637.o3CGbjSK080066@svn.freebsd.org> X-Stationery: 0.5.1 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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 14:38:29 -0000 On 04/12/2010 06:37 PM, Luigi Rizzo wrote: > Bring in geom_sched, support for scheduling disk I/O requests > in a device independent manner. Also include an example anticipatory > scheduler, gsched_rr, which gives very nice performance improvements > in presence of competing random access patterns. > > This is joint work with Fabio Checconi, developed last year > and presented at BSDCan 2009. You can find details in the > README file or at > Are there any plans to bring in something like Linux's ionice (or even better solutions)? Is it possible to do it easily at all (the user and GEOM are seemingly very far from each other)? From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 15:05:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 157BD1065675; Thu, 15 Apr 2010 15:05:30 +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 C936C8FC1A; Thu, 15 Apr 2010 15:05:29 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 9413173098; Thu, 15 Apr 2010 17:15:57 +0200 (CEST) Date: Thu, 15 Apr 2010 17:15:57 +0200 From: Luigi Rizzo To: Attila Nagy , fabio@gandalf.sssup.it Message-ID: <20100415151557.GA98341@onelab2.iet.unipi.it> References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <4BC724DF.7010907@fsn.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BC724DF.7010907@fsn.hu> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 15:05:30 -0000 On Thu, Apr 15, 2010 at 04:38:23PM +0200, Attila Nagy wrote: > On 04/12/2010 06:37 PM, Luigi Rizzo wrote: > > Bring in geom_sched, support for scheduling disk I/O requests > > in a device independent manner. Also include an example anticipatory > > scheduler, gsched_rr, which gives very nice performance improvements > > in presence of competing random access patterns. > > > > This is joint work with Fabio Checconi, developed last year > > and presented at BSDCan 2009. You can find details in the > > README file or at > > > Are there any plans to bring in something like Linux's ionice (or even > better solutions)? Is it possible to do it easily at all (the user and > GEOM are seemingly very far from each other)? I can easily[*] modify the I/O priority/weight of process or threads, but you have to keep in mind that once a request is intercepted by the filesystem code (e.g. for delayed writes, or avoid duplication of pending reads), by the time it hits the disk it is not trivial to tell who should be charged for it. This is an area where we still need to experiment a bit (especially to find on which process issues which request, say for metadata, delayed writes, shared reads). [*] the 'easy' way is put the information in an external hash table and look it up using as a search key either of uid, gid, . I think we did something like this in the GSOC2005 project on disk scheduling. A more intrusive way involves extending the struct thread with an extra field to store the io priority. cheers luigi From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 15:10:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D332D1065672; Thu, 15 Apr 2010 15:10:46 +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 A86F18FC15; Thu, 15 Apr 2010 15:10: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 o3FFAkwR034447; Thu, 15 Apr 2010 15:10:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FFAkRP034444; Thu, 15 Apr 2010 15:10:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004151510.o3FFAkRP034444@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Apr 2010 15:10: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: r206664 - head/usr.sbin/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 15:10:46 -0000 Author: imp Date: Thu Apr 15 15:10:46 2010 New Revision: 206664 URL: http://svn.freebsd.org/changeset/base/206664 Log: Allow option aliasing. Lines of the form: OLD_OPT = NEW_OPT in options* files will now map OLD_OPT to NEW_OPT with a friendly message. This is indented for situations where we need to preserve an interface in the config file in an upwards compatible fashion on a stable branch. Reviewed by: nwhitehorn@ MFC after: 3 days Modified: head/usr.sbin/config/config.h head/usr.sbin/config/mkoptions.c Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Thu Apr 15 14:26:52 2010 (r206663) +++ head/usr.sbin/config/config.h Thu Apr 15 15:10:46 2010 (r206664) @@ -129,6 +129,8 @@ SLIST_HEAD(opt_head, opt) opt, mkopt, rm struct opt_list { char *o_name; char *o_file; + int o_flags; +#define OL_ALIAS 1 SLIST_ENTRY(opt_list) o_next; }; Modified: head/usr.sbin/config/mkoptions.c ============================================================================== --- head/usr.sbin/config/mkoptions.c Thu Apr 15 14:26:52 2010 (r206663) +++ head/usr.sbin/config/mkoptions.c Thu Apr 15 15:10:46 2010 (r206664) @@ -94,6 +94,17 @@ options(void) SLIST_INSERT_HEAD(&opt, op, op_next); read_options(); + SLIST_FOREACH(op, &opt, op_next) { + SLIST_FOREACH(ol, &otab, o_next) { + if (eq(op->op_name, ol->o_name) && + (ol->o_flags & OL_ALIAS)) { + printf("Mapping option %s to %s.\n", + op->op_name, ol->o_file); + op->op_name = ol->o_file; + break; + } + } + } SLIST_FOREACH(ol, &otab, o_next) do_option(ol->o_name); SLIST_FOREACH(op, &opt, op_next) { @@ -124,7 +135,6 @@ do_option(char *name) int tidy; file = tooption(name); - /* * Check to see if the option was specified.. */ @@ -292,6 +302,7 @@ read_options(void) struct opt_list *po; int first = 1; char genopt[MAXPATHLEN]; + int flags = 0; SLIST_INIT(&otab); (void) snprintf(fname, sizeof(fname), "../../conf/options"); @@ -301,6 +312,7 @@ openit: return; } next: + flags = 0; wd = get_word(fp); if (wd == (char *)EOF) { (void) fclose(fp); @@ -332,6 +344,18 @@ next: (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s)); val = genopt; free(s); + } else if (eq(val, "=")) { + val = get_word(fp); + if (val == (char *)EOF) { + printf("%s: unexpected end of file\n", fname); + exit(1); + } + if (val == 0) { + printf("%s: Expected a right hand side at %s\n", fname, + this); + exit(1); + } + flags |= OL_ALIAS; } val = ns(val); @@ -348,6 +372,7 @@ next: err(EXIT_FAILURE, "calloc"); po->o_name = this; po->o_file = val; + po->o_flags = flags; SLIST_INSERT_HEAD(&otab, po, o_next); goto next; From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 16:34:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 380CC106566B; Thu, 15 Apr 2010 16:34:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 261DF8FC17; Thu, 15 Apr 2010 16:34: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 o3FGY764053200; Thu, 15 Apr 2010 16:34:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FGY7wX053198; Thu, 15 Apr 2010 16:34:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004151634.o3FGY7wX053198@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 15 Apr 2010 16:34: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: r206665 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:34:07 -0000 Author: pjd Date: Thu Apr 15 16:34:06 2010 New Revision: 206665 URL: http://svn.freebsd.org/changeset/base/206665 Log: Use lower priority for GELI worker threads. This improves system responsiveness under heavy GELI load. MFC after: 3 days Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Apr 15 15:10:46 2010 (r206664) +++ head/sys/geom/eli/g_eli.c Thu Apr 15 16:34:06 2010 (r206665) @@ -340,7 +340,7 @@ g_eli_worker(void *arg) } #endif thread_lock(curthread); - sched_prio(curthread, PRIBIO); + sched_prio(curthread, PUSER); if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0) sched_bind(curthread, wr->w_number); thread_unlock(curthread); @@ -361,8 +361,7 @@ g_eli_worker(void *arg) mtx_unlock(&sc->sc_queue_mtx); kproc_exit(0); } - msleep(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, - "geli:w", 0); + msleep(sc, &sc->sc_queue_mtx, PDROP, "geli:w", 0); continue; } mtx_unlock(&sc->sc_queue_mtx); From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 16:35:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E897F1065670; Thu, 15 Apr 2010 16:35:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6E9B8FC18; Thu, 15 Apr 2010 16:35: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 o3FGZYtD053534; Thu, 15 Apr 2010 16:35:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FGZYUi053532; Thu, 15 Apr 2010 16:35:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004151635.o3FGZYUi053532@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 15 Apr 2010 16:35: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: r206666 - head/sbin/geom/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:35:35 -0000 Author: pjd Date: Thu Apr 15 16:35:34 2010 New Revision: 206666 URL: http://svn.freebsd.org/changeset/base/206666 Log: Flush disk write cache after storing and clearing metadata. Modified: head/sbin/geom/misc/subr.c Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Thu Apr 15 16:34:06 2010 (r206665) +++ head/sbin/geom/misc/subr.c Thu Apr 15 16:35:34 2010 (r206666) @@ -236,6 +236,7 @@ g_metadata_store(const char *name, u_cha error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); @@ -293,6 +294,7 @@ g_metadata_clear(const char *name, const error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 16:40:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 589E01065673; Thu, 15 Apr 2010 16:40:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C12E8FC1D; Thu, 15 Apr 2010 16:40: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 o3FGeswl054748; Thu, 15 Apr 2010 16:40:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FGesMD054745; Thu, 15 Apr 2010 16:40:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004151640.o3FGesMD054745@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 15 Apr 2010 16:40: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: r206667 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:40:55 -0000 Author: pjd Date: Thu Apr 15 16:40:54 2010 New Revision: 206667 URL: http://svn.freebsd.org/changeset/base/206667 Log: Fix 3-way deadlock that can happen because of ZFS and vnode lock order reversal. thread0 (vfs_fhtovp) thread1 (vop_getattr) thread2 (zfs_recv) -------------------- --------------------- ------------------ vn_lock rrw_enter_read rrw_enter_write (hangs) rrw_enter_read (hangs) vn_lock (hangs) Submitted by: Attila Nagy MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Apr 15 16:35:34 2010 (r206666) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Apr 15 16:40:54 2010 (r206667) @@ -868,13 +868,15 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t ZFS_ENTER_NOERROR(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); + + ZFS_EXIT(zfsvfs); + if (error == 0) { *vpp = ZTOV(rootzp); error = vn_lock(*vpp, flags); (*vpp)->v_vflag |= VV_ROOT; } - ZFS_EXIT(zfsvfs); return (error); } @@ -1143,13 +1145,13 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla VN_RELE(ZTOV(zp)); err = EINVAL; } + ZFS_EXIT(zfsvfs); if (err != 0) *vpp = NULL; else { *vpp = ZTOV(zp); vn_lock(*vpp, flags); } - ZFS_EXIT(zfsvfs); return (err); } @@ -1237,8 +1239,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno } else { VN_HOLD(*vpp); } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); ZFS_EXIT(zfsvfs); + vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); return (0); } @@ -1259,10 +1261,11 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno return (EINVAL); } + ZFS_EXIT(zfsvfs); + *vpp = ZTOV(zp); vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); vnode_create_vobject(*vpp, zp->z_phys->zp_size, curthread); - ZFS_EXIT(zfsvfs); return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Apr 15 16:35:34 2010 (r206666) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Apr 15 16:40:54 2010 (r206667) @@ -1209,15 +1209,17 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode ltype = VOP_ISLOCKED(dvp); VOP_UNLOCK(dvp, 0); } + ZFS_EXIT(zfsvfs); error = vn_lock(*vpp, cnp->cn_lkflags); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, ltype | LK_RETRY); if (error != 0) { VN_RELE(*vpp); *vpp = NULL; - ZFS_EXIT(zfsvfs); return (error); } + } else { + ZFS_EXIT(zfsvfs); } #ifdef FREEBSD_NAMECACHE @@ -1237,8 +1239,6 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } #endif - ZFS_EXIT(zfsvfs); - return (error); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 16:43:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058D0106566C; Thu, 15 Apr 2010 16:43:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3348FC24; Thu, 15 Apr 2010 16:43: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 o3FGhhP0055372; Thu, 15 Apr 2010 16:43:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FGhhR4055370; Thu, 15 Apr 2010 16:43:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004151643.o3FGhhR4055370@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 15 Apr 2010 16:43: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: r206668 - head/etc/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:43:44 -0000 Author: pjd Date: Thu Apr 15 16:43:43 2010 New Revision: 206668 URL: http://svn.freebsd.org/changeset/base/206668 Log: Use spaces instead of tab for indent here. Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Apr 15 16:40:54 2010 (r206667) +++ head/etc/mtree/BSD.include.dist Thu Apr 15 16:43:43 2010 (r206668) @@ -104,8 +104,8 @@ .. lmc .. - mfi - .. + mfi + .. mpt mpilib .. From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 16:49:25 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59177106566B; Thu, 15 Apr 2010 16:49:25 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 0AD138FC17; Thu, 15 Apr 2010 16:49:25 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (Postfix) with ESMTPS id 43FE75C5F; Thu, 15 Apr 2010 18:49:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1271350164; bh=jrOJMiXuO0OGOlt2ij/nQxtG/e8veZTmtMvJVOIZsvA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=fuGTltj90OVsotQncfFyU6pQEsPTyR4UPlfWQDuZOuZtSbajTWOrr/6bYiwx4yEUz veihQcGh8g2xke53D355XQ7Uj4ZQzcFdESyIRmmjAmyxkvGw27nEKUHinmtne42kdh T9IUIDcQYGOOrYG59Y+hjatOKs7PxZyisVQPaDNI= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o3FGnNHF007011; Thu, 15 Apr 2010 18:49:23 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Thu, 15 Apr 2010 18:49:23 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Luigi Rizzo Message-ID: <20100415164922.GD92627@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Luigi Rizzo , Attila Nagy , fabio@gandalf.sssup.it, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org References: <201004121637.o3CGbjSK080066@svn.freebsd.org> <4BC724DF.7010907@fsn.hu> <20100415151557.GA98341@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100415151557.GA98341@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, Attila Nagy , Luigi Rizzo , src-committers@FreeBSD.org, fabio@gandalf.sssup.it Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:49:25 -0000 On Thu, 15.04.2010 at 17:15:57 +0200, Luigi Rizzo wrote: > On Thu, Apr 15, 2010 at 04:38:23PM +0200, Attila Nagy wrote: > > On 04/12/2010 06:37 PM, Luigi Rizzo wrote: > > > Bring in geom_sched, support for scheduling disk I/O requests > > > in a device independent manner. Also include an example anticipatory > > > scheduler, gsched_rr, which gives very nice performance improvements > > > in presence of competing random access patterns. > > > > > > This is joint work with Fabio Checconi, developed last year > > > and presented at BSDCan 2009. You can find details in the > > > README file or at > > > > > Are there any plans to bring in something like Linux's ionice (or even > > better solutions)? Is it possible to do it easily at all (the user and > > GEOM are seemingly very far from each other)? > > I can easily[*] modify the I/O priority/weight of process or threads, > but you have to keep in mind that once a request is intercepted by > the filesystem code (e.g. for delayed writes, or avoid duplication > of pending reads), by the time it hits the disk it is not trivial > to tell who should be charged for it. > > This is an area where we still need to experiment a bit > (especially to find on which process issues which request, > say for metadata, delayed writes, shared reads). > > [*] the 'easy' way is put the information in an external hash table > and look it up using as a search key either of uid, gid, thread *>. I think we did something like this in the GSOC2005 > project on disk scheduling. A more intrusive way involves extending > the struct thread with an extra field to store the io priority. What would already be helpful, is an I/O time measurement of the overall system and have that displayed in, eg., vmstat like Linux and Solaris do. It gives a better measure of if a system is CPU bound or I/O bound or neither. Can the scheduler help here? Uli From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 17:04:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABAE0106564A; Thu, 15 Apr 2010 17:04:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99EA98FC1C; Thu, 15 Apr 2010 17:04: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 o3FH48tr059921; Thu, 15 Apr 2010 17:04:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FH48bQ059919; Thu, 15 Apr 2010 17:04:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004151704.o3FH48bQ059919@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 15 Apr 2010 17:04: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: r206669 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:04:08 -0000 Author: pjd Date: Thu Apr 15 17:04:08 2010 New Revision: 206669 URL: http://svn.freebsd.org/changeset/base/206669 Log: Increase ggate queue size to maximum value. HAST was not able to stand heavy random load. Reported by: Hiroyuki Yamagami MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Apr 15 16:43:43 2010 (r206668) +++ head/sbin/hastd/primary.c Thu Apr 15 17:04:08 2010 (r206669) @@ -682,7 +682,7 @@ init_ggate(struct hast_resource *res) ggiocreate.gctl_mediasize = res->hr_datasize; ggiocreate.gctl_sectorsize = res->hr_local_sectorsize; ggiocreate.gctl_flags = 0; - ggiocreate.gctl_maxcount = 128; + ggiocreate.gctl_maxcount = G_GATE_MAX_QUEUE_SIZE; ggiocreate.gctl_timeout = 0; ggiocreate.gctl_unit = G_GATE_NAME_GIVEN; snprintf(ggiocreate.gctl_name, sizeof(ggiocreate.gctl_name), "hast/%s", From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 17:10:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44B041065672; Thu, 15 Apr 2010 17:10:07 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id EEF088FC0C; Thu, 15 Apr 2010 17:10:06 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 3FD3EEB87E; Thu, 15 Apr 2010 13:10:06 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 15 Apr 2010 13:10:06 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=lAC8osRRBXUX8lyZfDLaqg0BWi8=; b=Lh08jqzt+uAk/F5BEkpMDP0MPLSCcGa4PIIm4nSssZdV+14WGogoXjtSPvA2Cyh97XBLvCZh3IaiaJws253l2ji5Hsc9vI76YwuYi50IK/OBNtn/y1lGrQGZlM6i7rsq3L9Gs3HYn8pJ3aMjUz3DQZyWGq5oS5RGJOIu//ZfywM= X-Sasl-enc: N9PeOu4oYWVwrgRwRFv8WwzGse7IT0ZnYdegFOz0qcL/ 1271351405 Received: from anglepoise.lon.incunabulum.net (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6E1A2EAE9; Thu, 15 Apr 2010 13:10:05 -0400 (EDT) Message-ID: <4BC7486C.9010804@incunabulum.net> Date: Thu, 15 Apr 2010 18:10:04 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100406 Thunderbird/3.0.4 MIME-Version: 1.0 To: Bruce M Simpson References: <201004101205.o3AC5VGp074266@svn.freebsd.org> In-Reply-To: <201004101205.o3AC5VGp074266@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206452 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:10:07 -0000 On 04/10/10 13:05, Bruce M Simpson wrote: > Log: > Fix a few issues related to the legacy 4.4 BSD multicast APIs. > > IPv4 addresses can and do change during normal operation. Testing by > pfSense developers exposed an issue where OpenOSPFD was using the IPv4 > address to leave the OSPF link-scope multicast groups on a dynamic > OpenVPN tun interface, rather than using RFC 3678 with the interface > index, which won't be raced when the interface's addresses change. > I should point out that IP multicast is counter-intuitive in many areas. It seems that knowledge of how to work with it effectively is not that widespread. People who have a need to use it, often have very specific requirements. IP multicast group membership is always scoped to physical links [1]. The 4.4BSD API originally used the "primary IP address" to identify each link. Unfortunately this is not a persistent identifier, especially so in the use-case which had problems. In the updated API specified in RFC 3678, the primary key for multicast memberships, changes to the interface index. routed(8) in FreeBSD's SVN tree uses this new API; thanks to phk for reviewing and testing my change. In the case of OpenOSPFD+OpenVPN, the issue manifested itself in situations where this "primary IP address" changed. OpenVPN shims address assignment as part of its wire protocol, which is where the address change originates. This is purely a by-product of using an API which depends on using an IPv4 address as a key (IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP), when that key may change at any time. There's some time domain uncertainty with that change. PF_ROUTE is an out-of-band mechanism used by OpenOSPFD to learn about the address change, and it is dispatched separately from the change itself; there may be queueing and context switches involved. It also creates some ambiguity for in_multi instances, which the kernel may not be able to resolve, if that key has been blown away. Fortunately, such ambiguity is private to each socket. Furthermore, this makes IGMP somewhat unreliable, although mechanisms do exist in the protocol to work-around the end-station's identifier being lost in this way. The upstream IGMP querier (usually the mcast router) will hold state based on the end-station's "primary IP address", this will eventually time out due to unanswered queries. MLD side-steps this by always requiring an IPv6 link-scope address in control traffic. Using the more recent multicast RFCs, supported now by Windows, Linux, OpenSolaris, and now FreeBSD, can side-step these issues; it is the preferred API. P.S. HEAD was probably already resilient against this for joins. I plan to MFC a similar version of this change to 8 soon. [1] sendto() to an IP multicast address, without an interface specified, makes no sense -- unless the host is also an mcast forwarder. You can get away with default route resolution through the routing tables up to a point, but if your box is multihomed, all bets are off. From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 17:17:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50BD5106566B; Thu, 15 Apr 2010 17:17:03 +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 3F1478FC08; Thu, 15 Apr 2010 17:17: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 o3FHH3WW062884; Thu, 15 Apr 2010 17:17:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FHH34u062882; Thu, 15 Apr 2010 17:17:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004151717.o3FHH34u062882@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 15 Apr 2010 17:17: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: r206671 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:17:03 -0000 Author: kib Date: Thu Apr 15 17:17:02 2010 New Revision: 206671 URL: http://svn.freebsd.org/changeset/base/206671 Log: Fix typo. MFC after: 3 days Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Apr 15 17:10:46 2010 (r206670) +++ head/sys/kern/vfs_cache.c Thu Apr 15 17:17:02 2010 (r206671) @@ -610,7 +610,7 @@ cache_enter(dvp, vp, cnp) CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, - ("cahe_enter: Adding a doomed vnode")); + ("cache_enter: Adding a doomed vnode")); if (!doingcache) return; From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 17:24:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE9861065672; Thu, 15 Apr 2010 17:24: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 9D1338FC25; Thu, 15 Apr 2010 17:24:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3FHOLka064517; Thu, 15 Apr 2010 17:24:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FHOL5r064515; Thu, 15 Apr 2010 17:24:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004151724.o3FHOL5r064515@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 15 Apr 2010 17:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206672 - head/sys/dev/sge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:24:21 -0000 Author: yongari Date: Thu Apr 15 17:24:21 2010 New Revision: 206672 URL: http://svn.freebsd.org/changeset/base/206672 Log: Fix include path. Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 15 17:17:02 2010 (r206671) +++ head/sys/dev/sge/if_sge.c Thu Apr 15 17:24:21 2010 (r206672) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "if_sgereg.h" +#include MODULE_DEPEND(sge, pci, 1, 1, 1); MODULE_DEPEND(sge, ether, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 17:36:37 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55EBB106564A; Thu, 15 Apr 2010 17:36:37 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC3D8FC1A; Thu, 15 Apr 2010 17:36:36 +0000 (UTC) Received: from critter.freebsd.dk (critter-phk.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 7CEC9900AD; Thu, 15 Apr 2010 17:36:35 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id o3FHaYO6001920; Thu, 15 Apr 2010 17:36:34 GMT (envelope-from phk@critter.freebsd.dk) To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 15 Apr 2010 18:49:23 +0200." <20100415164922.GD92627@acme.spoerlein.net> Date: Thu, 15 Apr 2010 17:36:34 +0000 Message-ID: <1919.1271352994@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Luigi Rizzo , src-committers@FreeBSD.org, fabio@gandalf.sssup.it, svn-src-head@FreeBSD.org, Attila Nagy , Luigi Rizzo Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:36:37 -0000 In message <20100415164922.GD92627@acme.spoerlein.net>, Ulrich =?utf-8?B?U3DDtn JsZWlu?= writes: >What would already be helpful, is an I/O time measurement of the overall >system and have that displayed in, eg., vmstat like Linux and Solaris >do. It gives a better measure of if a system is CPU bound or I/O bound >or neither. gstat(8) ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 19:15:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B286C106566B; Thu, 15 Apr 2010 19:15: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 A19A18FC15; Thu, 15 Apr 2010 19:15: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 o3FJF5Pj092484; Thu, 15 Apr 2010 19:15:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FJF5wP092481; Thu, 15 Apr 2010 19:15:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004151915.o3FJF5wP092481@svn.freebsd.org> From: Xin LI Date: Thu, 15 Apr 2010 19:15: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: r206675 - head/contrib/netcat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 19:15:05 -0000 Author: delphij Date: Thu Apr 15 19:15:05 2010 New Revision: 206675 URL: http://svn.freebsd.org/changeset/base/206675 Log: Diff reduction with OpenBSD: - Remove unused locally added variable; - Deprecate -o: it's the default behavior on OpenBSD. X-MFC: along with nc 4.7. Modified: head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Thu Apr 15 18:30:21 2010 (r206674) +++ head/contrib/netcat/nc.1 Thu Apr 15 19:15:05 2010 (r206675) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2010 +.Dd April 15, 2010 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklnorStUuvz +.Op Fl 46DdEhklnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -159,15 +159,6 @@ socket option. .It Fl O Ar length Specifies the size of the TCP send buffer. When -.It Fl o -.Dq Once-only mode . -By default, -.Nm -does not terminate on EOF condition on input, -but continues until the network side has been closed down. -Specifying -.Fl o -will make it terminate on EOF as well. .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Thu Apr 15 18:30:21 2010 (r206674) +++ head/contrib/netcat/netcat.c Thu Apr 15 19:15:05 2010 (r206675) @@ -72,14 +72,12 @@ #define PORT_MAX_LEN 6 /* Command Line Options */ -int Eflag; /* Use IPsec ESP */ int dflag; /* detached, no stdin */ unsigned int iflag; /* Interval Flag */ int jflag; /* use jumbo frames if we can */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ int nflag; /* Don't do name look up */ -int oflag; /* Once only: stop on EOF */ int FreeBSD_Oflag; /* Do not use TCP options */ char *Pflag; /* Proxy username */ char *pflag; /* Localport flag */ @@ -151,7 +149,7 @@ main(int argc, char *argv[]) sv = NULL; while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -214,7 +212,7 @@ main(int argc, char *argv[]) nflag = 1; break; case 'o': - oflag = 1; + fprintf(stderr, "option -o is deprecated.\n"); break; case 'P': Pflag = optarg; @@ -282,8 +280,6 @@ main(int argc, char *argv[]) case 'T': Tflag = parse_iptos(optarg); break; - case 0: - break; default: usage(1); } @@ -729,10 +725,9 @@ readwrite(int nfd) } if (!dflag && pfd[1].revents & POLLIN) { - if ((n = read(wfd, buf, plen)) < 0 || - (oflag && n == 0)) { + if ((n = read(wfd, buf, plen)) < 0) return; - } else if (n == 0) { + else if (n == 0) { shutdown(nfd, SHUT_WR); pfd[1].fd = -1; pfd[1].events = 0; @@ -945,7 +940,6 @@ help(void) \t-n Suppress name/port resolutions\n\ \t--no-tcpopt Disable TCP options\n\ \t-O length TCP send buffer length\n\ - \t-o Terminate on EOF on input\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-r Randomize remote ports\n\ @@ -995,9 +989,9 @@ usage(int ret) { fprintf(stderr, #ifdef IPSEC - "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" "\t [-V fib] [-w timeout] [-X proxy_protocol]\n" From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 19:45:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F01106564A; Thu, 15 Apr 2010 19:45:03 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE2608FC15; Thu, 15 Apr 2010 19:45: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 o3FJj3Jv099612; Thu, 15 Apr 2010 19:45:03 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FJj3fO099609; Thu, 15 Apr 2010 19:45:03 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004151945.o3FJj3fO099609@svn.freebsd.org> From: Fabien Thomas Date: Thu, 15 Apr 2010 19:45: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: r206684 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 19:45:04 -0000 Author: fabient Date: Thu Apr 15 19:45:03 2010 New Revision: 206684 URL: http://svn.freebsd.org/changeset/base/206684 Log: - Fix a typo OFFCORE_REQUESTS.ANY.RFO is B0H10H and not 80H10H. - Enable missing PARTIAL_ADDRESS_ALIAS for Core i7. MFC after: 3 days Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 15 19:31:21 2010 (r206683) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 15 19:45:03 2010 (r206684) @@ -603,7 +603,7 @@ static struct iap_event_descr iap_events IAPDESCR(06H_0FH, 0x06, 0x0F, IAP_F_FM | IAP_F_I7O), IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), - IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM), + IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA), @@ -1053,6 +1053,7 @@ static struct iap_event_descr iap_events IAPDESCR(B0H_02H, 0xB0, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O), IAPDESCR(B0H_04H, 0xB0, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O), IAPDESCR(B0H_08H, 0xB0, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O), + IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O), IAPDESCR(B0H_20H, 0xB0, 0x20, IAP_F_FM | IAP_F_I7O), IAPDESCR(B0H_40H, 0xB0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O), Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Thu Apr 15 19:31:21 2010 (r206683) +++ head/sys/dev/hwpmc/pmc_events.h Thu Apr 15 19:45:03 2010 (r206684) @@ -2207,7 +2207,7 @@ __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND. __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND.READ_CODE", IAP_EVENT_B0H_02H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND.RFO", IAP_EVENT_B0H_04H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.READ", IAP_EVENT_B0H_08H) \ -__PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.RFO", IAP_EVENT_80H_10H) \ +__PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.RFO", IAP_EVENT_B0H_10H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS.L1D_WRITEBACK", IAP_EVENT_B0H_40H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY", IAP_EVENT_B0H_80H) \ __PMC_EV_ALIAS("UOPS_EXECUTED.PORT0", IAP_EVENT_B1H_01H) \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 21:18:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85488106566B; Thu, 15 Apr 2010 21:18:24 +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 762598FC08; Thu, 15 Apr 2010 21:18: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 o3FLIOMJ020561; Thu, 15 Apr 2010 21:18:24 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FLIOWJ020559; Thu, 15 Apr 2010 21:18:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201004152118.o3FLIOWJ020559@svn.freebsd.org> From: Doug Barton Date: Thu, 15 Apr 2010 21:18: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: r206686 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 21:18:24 -0000 Author: dougb Date: Thu Apr 15 21:18:24 2010 New Revision: 206686 URL: http://svn.freebsd.org/changeset/base/206686 Log: If a service is running, make 'stop' work even if ${name}_enable is not set. PR: conf/130414 Submitted by: Dominic Fandrey Reviewed by: freebsd-rc@ Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Apr 15 20:48:57 2010 (r206685) +++ head/etc/rc.subr Thu Apr 15 21:18:24 2010 (r206686) @@ -646,12 +646,12 @@ run_rc_command() if [ "$_elem" != "$rc_arg" ]; then continue fi - # if ${rcvar} is set, and $1 is not - # "rcvar", then run + # if ${rcvar} is set, $1 is not "rcvar" + # and ${rc_pid} is not set, then run # checkyesno ${rcvar} # and return if that failed # - if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then + if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then if [ -n "${rc_quiet}" ]; then return 0 From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 21:27:35 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FAEA106566B; Thu, 15 Apr 2010 21:27:35 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id E82C98FC14; Thu, 15 Apr 2010 21:27:34 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o3FLRYl1017309; Thu, 15 Apr 2010 17:27:34 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o3FLRYXR017308; Thu, 15 Apr 2010 17:27:34 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 15 Apr 2010 17:27:34 -0400 From: David Schultz To: Juli Mallett Message-ID: <20100415212734.GA17239@zim.MIT.EDU> Mail-Followup-To: Juli Mallett , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201003310212.o2V2CO7b063419@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201003310212.o2V2CO7b063419@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r205954 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 21:27:35 -0000 On Wed, Mar 31, 2010, Juli Mallett wrote: > Be like stdlib.h and bring in a wchar_t definition and use it to prototype > wcstoimax and wcstoumax, rather than spelling it __wchar_t. This is necessary > to use these functions in C++ where wchar_t is different to __wchar_t and is > a built-in type. I don't think this change is correct for C mode. POSIX says wchar_t is *supposed* to be defined by stdlib.h and wchar.h, but its definition is namespace pollution elsewhere. > It may be better to use __wchar_t here and to simply define __wchar_t as being > wchar_t in C++ mode rather than to bring in wchar_t That may be better. From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 21:41:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D361065670; Thu, 15 Apr 2010 21:41:07 +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 837488FC21; Thu, 15 Apr 2010 21:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3FLf7cJ025587; Thu, 15 Apr 2010 21:41:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FLf7WX025585; Thu, 15 Apr 2010 21:41:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004152141.o3FLf7WX025585@svn.freebsd.org> From: Andriy Gapon Date: Thu, 15 Apr 2010 21:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206687 - head/usr.bin/indent X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 21:41:07 -0000 Author: avg Date: Thu Apr 15 21:41:07 2010 New Revision: 206687 URL: http://svn.freebsd.org/changeset/base/206687 Log: indent(1): don't treat bare '_t' as a type name when -ta is used It seems that identifier "_t" is sometimes used as a variable name, even in our tree. Not that I endorse that, but still it's better to require at least one character before _t suffix to consider an identifier to be a type name. Reported by: Alex Vasylenko MFC after: 1 week Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Thu Apr 15 21:18:24 2010 (r206686) +++ head/usr.bin/indent/lexi.c Thu Apr 15 21:41:07 2010 (r206687) @@ -251,9 +251,10 @@ lexi(void) if (auto_typedefs) { const char *q = s_token; + size_t q_len = strlen(q); /* Check if we have an "_t" in the end */ - if (q[0] && q[1] && - (strcmp(q + strlen(q) - 2, "_t") == 0)) { + if (q_len > 2 && + (strcmp(q + q_len - 2, "_t") == 0)) { ps.its_a_keyword = true; ps.last_u_d = true; goto found_auto_typedef; From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 22:57:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0731065672; Thu, 15 Apr 2010 22:57:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5098FC15; Thu, 15 Apr 2010 22:57: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 o3FMvUgw042713; Thu, 15 Apr 2010 22:57:30 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FMvUqC042707; Thu, 15 Apr 2010 22:57:30 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004152257.o3FMvUqC042707@svn.freebsd.org> From: Rick Macklem Date: Thu, 15 Apr 2010 22:57: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: r206688 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 22:57:31 -0000 Author: rmacklem Date: Thu Apr 15 22:57:30 2010 New Revision: 206688 URL: http://svn.freebsd.org/changeset/base/206688 Log: The experimental NFS client was not filling in recovery credentials for opens done locally in the client when a delegation for the file was held. This could cause the client to crash in crsetgroups() when recovering from a server crash/reboot. This patch fills in the recovery credentials for this case, in order to avoid the client crash. Also, add KASSERT()s to the credential copy functions, to catch any other cases where the credentials aren't filled in correctly. MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfsclstate.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Apr 15 21:41:07 2010 (r206687) +++ head/sys/fs/nfs/nfs_commonport.c Thu Apr 15 22:57:30 2010 (r206688) @@ -225,6 +225,8 @@ void newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) { + KASSERT(nfscr->nfsc_ngroups >= 0, + ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid = nfscr->nfsc_uid; crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups); } Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Thu Apr 15 21:41:07 2010 (r206687) +++ head/sys/fs/nfs/nfsclstate.h Thu Apr 15 22:57:30 2010 (r206688) @@ -140,6 +140,7 @@ struct nfsclopen { #define NFSCLOPEN_OK 0 #define NFSCLOPEN_DOOPEN 1 #define NFSCLOPEN_DOOPENDOWNGRADE 2 +#define NFSCLOPEN_SETCRED 3 struct nfscllockowner { LIST_ENTRY(nfscllockowner) nfsl_list; Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Apr 15 21:41:07 2010 (r206687) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Apr 15 22:57:30 2010 (r206688) @@ -978,6 +978,8 @@ newnfs_copyincred(struct ucred *cr, stru { int i; + KASSERT(cr->cr_ngroups >= 0, + ("newnfs_copyincred: negative cr_ngroups")); nfscr->nfsc_uid = cr->cr_uid; nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, NFS_MAXGRPS + 1); for (i = 0; i < nfscr->nfsc_ngroups; i++) Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 15 21:41:07 2010 (r206687) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 15 22:57:30 2010 (r206688) @@ -278,7 +278,13 @@ else printf(" fhl=0\n"); error = EIO; } newnfs_copyincred(cred, &op->nfso_cred); - } + } else if (ret == NFSCLOPEN_SETCRED) + /* + * This is a new local open on a delegation. It needs + * to have credentials so that an open can be done + * against the server during recovery. + */ + newnfs_copyincred(cred, &op->nfso_cred); /* * nfso_opencnt is the count of how many VOP_OPEN()s have Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 21:41:07 2010 (r206687) +++ head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 22:57:30 2010 (r206688) @@ -274,8 +274,13 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i *owpp = owp; if (opp != NULL) *opp = op; - if (retp != NULL) - *retp = NFSCLOPEN_OK; + if (retp != NULL) { + if (nfhp != NULL && dp != NULL && nop == NULL) + /* new local open on delegation */ + *retp = NFSCLOPEN_SETCRED; + else + *retp = NFSCLOPEN_OK; + } /* * Now, check the mode on the open and return the appropriate From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 23:21:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94E6C106566B; Thu, 15 Apr 2010 23:21:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85B7F8FC1A; Thu, 15 Apr 2010 23:21: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 o3FNLOCG047977; Thu, 15 Apr 2010 23:21:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FNLOW4047975; Thu, 15 Apr 2010 23:21:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004152321.o3FNLOW4047975@svn.freebsd.org> From: Xin LI Date: Thu, 15 Apr 2010 23:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206689 - head/contrib/netcat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 23:21:24 -0000 Author: delphij Date: Thu Apr 15 23:21:24 2010 New Revision: 206689 URL: http://svn.freebsd.org/changeset/base/206689 Log: Utilize IP_BINDANY which provided the same semantics of OpenBSD's SO_BINDANY. Modified: head/contrib/netcat/netcat.c Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Thu Apr 15 22:57:30 2010 (r206688) +++ head/contrib/netcat/netcat.c Thu Apr 15 23:21:24 2010 (r206689) @@ -570,10 +570,8 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; -#ifdef SO_BINDANY - /* try SO_BINDANY, but don't insist */ - setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); -#endif + /* try IP_BINDANY, but don't insist */ + setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on)); memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; From owner-svn-src-head@FreeBSD.ORG Thu Apr 15 23:56:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B491106564A; Thu, 15 Apr 2010 23:56:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BCA48FC1B; Thu, 15 Apr 2010 23:56: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 o3FNu54g055617; Thu, 15 Apr 2010 23:56:05 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3FNu54x055615; Thu, 15 Apr 2010 23:56:05 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004152356.o3FNu54x055615@svn.freebsd.org> From: Rick Macklem Date: Thu, 15 Apr 2010 23:56: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: r206690 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 23:56:05 -0000 Author: rmacklem Date: Thu Apr 15 23:56:05 2010 New Revision: 206690 URL: http://svn.freebsd.org/changeset/base/206690 Log: Add mutex lock calls to 2 cases in the experimental NFS client's renew thread where they were missing. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 23:21:24 2010 (r206689) +++ head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 23:56:05 2010 (r206690) @@ -2318,7 +2318,9 @@ nfscl_renewthread(struct nfsclclient *cl int error, cbpathdown, islept, igotlock, ret, clearok; cred = newnfs_getcred(); + NFSLOCKCLSTATE(); clp->nfsc_flags |= NFSCLFLAGS_HASTHREAD; + NFSUNLOCKCLSTATE(); for(;;) { newnfs_setroot(cred); cbpathdown = 0; @@ -2331,9 +2333,11 @@ nfscl_renewthread(struct nfsclclient *cl error = nfsrpc_renew(clp, cred, p); if (error == NFSERR_CBPATHDOWN) cbpathdown = 1; - else if (error == NFSERR_STALECLIENTID) + else if (error == NFSERR_STALECLIENTID) { + NFSLOCKCLSTATE(); clp->nfsc_flags |= NFSCLFLAGS_RECOVER; - else if (error == NFSERR_EXPIRED) + NFSUNLOCKCLSTATE(); + } else if (error == NFSERR_EXPIRED) (void) nfscl_hasexpired(clp, clidrev, p); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 02:56:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E653106564A; Fri, 16 Apr 2010 02:56:24 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF6C8FC14; Fri, 16 Apr 2010 02:56: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 o3G2uOP2095624; Fri, 16 Apr 2010 02:56:24 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3G2uOH0095621; Fri, 16 Apr 2010 02:56:24 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004160256.o3G2uOH0095621@svn.freebsd.org> From: Juli Mallett Date: Fri, 16 Apr 2010 02:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206695 - in head: . sys/mips/include sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 02:56:24 -0000 Author: jmallett Date: Fri Apr 16 02:56:24 2010 New Revision: 206695 URL: http://svn.freebsd.org/changeset/base/206695 Log: Remove some unused header files. Deleted: head/sys/mips/include/archtype.h head/sys/mips/include/defs.h head/sys/mips/include/queue.h head/sys/mips/include/rm7000.h head/sys/mips/include/segments.h Modified: head/ObsoleteFiles.inc head/sys/mips/mips/trap.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Apr 16 02:16:58 2010 (r206694) +++ head/ObsoleteFiles.inc Fri Apr 16 02:56:24 2010 (r206695) @@ -14,6 +14,14 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100415: [mips] removed unused headers +.if ${TARGET_ARCH} == "mips" +OLD_FILES+=usr/include/machine/archtype.h +OLD_FILES+=usr/include/machine/segments.h +OLD_FILES+=usr/include/machine/rm7000.h +OLD_FILES+=usr/include/machine/defs.h +OLD_FILES+=usr/include/machine/queue.h +.endif # 20100326: [ia64] removed .if ${TARGET_ARCH} == "ia64" OLD_FILES+=usr/include/machine/nexusvar.h Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Fri Apr 16 02:16:58 2010 (r206694) +++ head/sys/mips/mips/trap.c Fri Apr 16 02:56:24 2010 (r206695) @@ -83,8 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #ifdef DDB From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 06:47:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B34B1065672; Fri, 16 Apr 2010 06:47:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7048FC22; Fri, 16 Apr 2010 06:47: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 o3G6lUNn046713; Fri, 16 Apr 2010 06:47:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3G6lUfL046711; Fri, 16 Apr 2010 06:47:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004160647.o3G6lUfL046711@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 16 Apr 2010 06:47: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: r206696 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 06:47:30 -0000 Author: pjd Date: Fri Apr 16 06:47:29 2010 New Revision: 206696 URL: http://svn.freebsd.org/changeset/base/206696 Log: Fix control socket leak when worker process exits. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Fri Apr 16 02:56:24 2010 (r206695) +++ head/sbin/hastd/hastd.c Fri Apr 16 06:47:29 2010 (r206696) @@ -137,6 +137,7 @@ child_exit(void) pjdlog_error("Worker process failed (pid=%u, status=%d).", (unsigned int)pid, WEXITSTATUS(status)); } + proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { sleep(1); From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 06:49:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 471521065670; Fri, 16 Apr 2010 06:49:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3752D8FC19; Fri, 16 Apr 2010 06:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3G6nDdS047111; Fri, 16 Apr 2010 06:49:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3G6nDIk047109; Fri, 16 Apr 2010 06:49:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004160649.o3G6nDIk047109@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 16 Apr 2010 06:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206697 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 06:49:13 -0000 Author: pjd Date: Fri Apr 16 06:49:12 2010 New Revision: 206697 URL: http://svn.freebsd.org/changeset/base/206697 Log: Fix log size calculation which caused message truncation. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Fri Apr 16 06:47:29 2010 (r206696) +++ head/sbin/hastd/pjdlog.c Fri Apr 16 06:49:12 2010 (r206697) @@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debugle len = snprintf(log, sizeof(log), "%s", pjdlog_prefix); if ((size_t)len < sizeof(log)) - len = vsnprintf(log + len, sizeof(log) - len, fmt, ap); + len += vsnprintf(log + len, sizeof(log) - len, fmt, ap); if (error != -1 && (size_t)len < sizeof(log)) { (void)snprintf(log + len, sizeof(log) - len, ": %s.", strerror(error)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 07:02:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46BE51065672; Fri, 16 Apr 2010 07:02:29 +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 1DA068FC19; Fri, 16 Apr 2010 07: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 o3G72TY6050116; Fri, 16 Apr 2010 07:02:29 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3G72Sq1050113; Fri, 16 Apr 2010 07:02:29 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004160702.o3G72Sq1050113@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 16 Apr 2010 07:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206698 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 07:02:29 -0000 Author: jh Date: Fri Apr 16 07:02:28 2010 New Revision: 206698 URL: http://svn.freebsd.org/changeset/base/206698 Log: Revert r206560. The change doesn't work correctly in all cases with multiple devfs mounts. Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_int.h Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Apr 16 06:49:12 2010 (r206697) +++ head/sys/fs/devfs/devfs_devs.c Fri Apr 16 07:02:28 2010 (r206698) @@ -408,9 +408,6 @@ devfs_populate_loop(struct devfs_mount * continue; KASSERT((cdp->cdp_flags & CDP_ACTIVE), ("Bogons, I tell ya'!")); - if (cdp->cdp_flags & CDP_INVALID) - continue; - if (dm->dm_idx <= cdp->cdp_maxdirent && cdp->cdp_dirents[dm->dm_idx] != NULL) { de = cdp->cdp_dirents[dm->dm_idx]; @@ -428,8 +425,6 @@ devfs_populate_loop(struct devfs_mount * dd = dm->dm_rootdir; s = cdp->cdp_c.si_name; for (;;) { - while (*s == '/') - s++; for (q = s; *q != '/' && *q != '\0'; q++) continue; if (*q != '/') @@ -439,24 +434,6 @@ devfs_populate_loop(struct devfs_mount * de = devfs_vmkdir(dm, s, q - s, dd, 0); s = q + 1; dd = de; - if (dd->de_flags & (DE_DOT | DE_DOTDOT)) - break; - } - - /* - * XXX: Ignore duplicate and empty device names. - * XXX: Currently there is no way to report the error to - * XXX: the make_dev(9) caller. - */ - if (dd->de_dirent->d_type != DT_DIR || - dd->de_flags & (DE_DOT | DE_DOTDOT) || q - s < 1 || - devfs_find(dd, s, q - s) != NULL) { - dev_lock(); - cdp->cdp_flags |= CDP_INVALID; - dev_unlock(); - printf("%s: %s: invalid or duplicate device name\n", - __func__, cdp->cdp_c.si_name); - return (1); } de = devfs_newdirent(s, q - s); Modified: head/sys/fs/devfs/devfs_int.h ============================================================================== --- head/sys/fs/devfs/devfs_int.h Fri Apr 16 06:49:12 2010 (r206697) +++ head/sys/fs/devfs/devfs_int.h Fri Apr 16 07:02:28 2010 (r206698) @@ -55,7 +55,6 @@ struct cdev_priv { u_int cdp_flags; #define CDP_ACTIVE (1 << 0) #define CDP_SCHED_DTR (1 << 1) -#define CDP_INVALID (1 << 2) u_int cdp_inuse; u_int cdp_maxdirent; From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 08:23:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA1F106564A; Fri, 16 Apr 2010 08:23:31 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 58A298FC13; Fri, 16 Apr 2010 08:23:31 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2DBA7.dip.t-dialin.net [217.226.219.167]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 964BC844AE6; Fri, 16 Apr 2010 10:23:22 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 6A4C05149; Fri, 16 Apr 2010 10:23:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1271406199; bh=WDrVEFz3uUvoBkatEmhMQxKreRDpN0I19/qrqhbEXVo=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=mnrRb+cgNhUOtglP1Rhjxl1Zocq2xyXo+OuT5Zpc4DjwfeHInI9N64fukh/RSOqKZ 6cKaTzdbbiWUG+Cu9mTkvtclQ82Ami3Rknc7oGpfKOYY/qq+IntnEgoNvEupnGcyyt uOF9RcS2zX6EhYvYMfppuCqNlh5FLgvb6045uViAO1ndWKZnX/HU1HAArDaHhK19cx o5UUJlaLT7DT5lTLfzV3pPnP+LFaxDSlBB3t1zVAR7Ntg+tIU4cZzr0EYkoi6q5c7Y e5BftC5crhJAsa9PXxg2Z4EyXB4DF37I0kTbA4RVUkDt/aG6jp5aW8+ITHPkPpa6aU TKX95mJ1LOGYA== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o3G8NIdb031947; Fri, 16 Apr 2010 10:23:18 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Fri, 16 Apr 2010 10:23:18 +0200 Message-ID: <20100416102318.16752py80bkf418g@webmail.leidinger.net> Date: Fri, 16 Apr 2010 10:23:18 +0200 From: Alexander Leidinger To: Bruce Simpson References: <201004101205.o3AC5VGp074266@svn.freebsd.org> <4BC7486C.9010804@incunabulum.net> In-Reply-To: <4BC7486C.9010804@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 964BC844AE6.A43A3 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.286, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_PH 0.08, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1272011006.23922@q8e508vajMnSkvOryAvVLA X-EBL-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206452 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 08:23:32 -0000 Quoting Bruce Simpson (from Thu, 15 Apr 2010 18:10:04 +0100): > On 04/10/10 13:05, Bruce M Simpson wrote: >> Log: >> Fix a few issues related to the legacy 4.4 BSD multicast APIs. >> >> IPv4 addresses can and do change during normal operation. Testing by >> pfSense developers exposed an issue where OpenOSPFD was using the IPv4 >> address to leave the OSPF link-scope multicast groups on a dynamic >> OpenVPN tun interface, rather than using RFC 3678 with the interface >> index, which won't be raced when the interface's addresses change. >> > > I should point out that IP multicast is counter-intuitive in many > areas. It seems that knowledge of how to work with it effectively is > not that widespread. People who have a need to use it, often have > very specific requirements. > > IP multicast group membership is always scoped to physical links > [1]. The 4.4BSD API originally used the "primary IP address" to > identify each link. Unfortunately this is not a persistent > identifier, especially so in the use-case which had problems. Is/was this the reason why multicast does not work in jails? > In the updated API specified in RFC 3678, the primary key for > multicast memberships, changes to the interface index. routed(8) in > FreeBSD's SVN tree uses this new API; thanks to phk for reviewing > and testing my change. Will this change make it possible to use multicast in jails now? Bye, Alexander. -- Dentist, n.: A Prestidigitator who, putting metal in one's mouth, pulls coins out of one's pockets. -- Ambrose Bierce, "The Devil's Dictionary" http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 09:33:00 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39046106566C; Fri, 16 Apr 2010 09:33:00 +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 C17258FC16; Fri, 16 Apr 2010 09:32:59 +0000 (UTC) Received: from c122-106-149-225.carlnfd1.nsw.optusnet.com.au (c122-106-149-225.carlnfd1.nsw.optusnet.com.au [122.106.149.225]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3G9WtAV019423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Apr 2010 19:32:57 +1000 Date: Fri, 16 Apr 2010 19:32:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: David Schultz In-Reply-To: <20100415212734.GA17239@zim.MIT.EDU> Message-ID: <20100416185222.X1124@delplex.bde.org> References: <201003310212.o2V2CO7b063419@svn.freebsd.org> <20100415212734.GA17239@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Juli Mallett , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r205954 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 09:33:00 -0000 On Thu, 15 Apr 2010, David Schultz wrote: > On Wed, Mar 31, 2010, Juli Mallett wrote: >> Be like stdlib.h and bring in a wchar_t definition and use it to prototype >> wcstoimax and wcstoumax, rather than spelling it __wchar_t. This is necessary >> to use these functions in C++ where wchar_t is different to __wchar_t and is >> a built-in type. > > I don't think this change is correct for C mode. POSIX says > wchar_t is *supposed* to be defined by stdlib.h and wchar.h, but ^stddef.h, > its definition is namespace pollution elsewhere. C99 says the same, at least in old drafts. C99 also says that for the functions in that use wchar_t, both and must be included (by giving both of these headers in the synopses for these functions, and no explicit alternatives anywhere). However, this is unusable and close to unimplementable, especially the latter: - including without including should work when these functions are not used. FreeBSD used to use the usual implementation involving underscored named to make this case works without polluting with wchar_t. It is hard to make this case work while detecting the error in the case where these functions are used but is not included. - it is even harder and even sillier to detect the error in the case where these functions are used and some other header that declares wchar_t is included, but is not included :-). Perhaps fine print in C99 overrides the silly literal requirement, but I couldn't find it. POSIX (at least in old 2001 draft 7) is only slightly different here. It only mentions in the synopses, but gives in examples. But current POSIX (at least in the most recent html man page for wcstoimax found by google) has caught down to C99: it now specifies and in the synopsis, and doesn't say anything about alternatives to in the synopses, and doesn't say anything special about wchar_t. I couldn't find anything useful about this problem using google. I found mainly confusion about it in FOSS mailing lists, with no signs of standards being aware of it. IMO, the functions using wchar_t should never have been put in . The corresponding problem for was carefully avoided by putting all the stdio functions that use wchar_t in (where it causes corresponding problems for stdio types like FILE (*)). However, these functions have been misplaced for so long that the shouldn't be moved, and the easiest fix is to standardize the pollution. (*) The problems for FILE in are handled equally badly by standards and equally well by FreeBSD (compared with old-FreeBSD for wchar_t in ). FILE would be namespace pollution in , and FreeBSD is careful not to add it, and standards require inclusion of both and before using functions that use both FILE and wchar_t, but the latter is unusuable and close to unimplementable, as above. Now the functions are reasonably well placed (you wouldn't want a header just to hold them), and again the easiest fix is to standardize the pollution. At least the pollution wouldn't go all the way to . Bruce From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 10:21:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0492D106566C; Fri, 16 Apr 2010 10:21:11 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id C430B8FC08; Fri, 16 Apr 2010 10:21:10 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id CB044E66F9; Fri, 16 Apr 2010 06:21:09 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 16 Apr 2010 06:21:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=hT/m9ijtTfBZHcfVsbwCtNCwXl0=; b=DxBEVCth4yeKeE+o6XDKqqNxAoT/JOHnGtVwdZ1o22u5GG1WkHOSSTZzF6LM+bh9PBK6vgX0O7u5jrkq7pKAIHK7x5Jzd+wFCK7mEdcch0zna6zH2QBbCHkU8Z/asIv2SBkXttr6Qee6s4bN/WDTFVpXQlvO5+MUzb5DgxtHKVo= X-Sasl-enc: fGz0AGuH8Y7teyjeGf7NBWZs2Vnfyi7kFHMp8eQoNJ2n 1271413269 Received: from anglepoise.lon.incunabulum.net (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 300B937F86; Fri, 16 Apr 2010 06:21:09 -0400 (EDT) Message-ID: <4BC83A12.2080700@incunabulum.net> Date: Fri, 16 Apr 2010 11:21:06 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100406 Thunderbird/3.0.4 MIME-Version: 1.0 To: Alexander Leidinger References: <201004101205.o3AC5VGp074266@svn.freebsd.org> <4BC7486C.9010804@incunabulum.net> <20100416102318.16752py80bkf418g@webmail.leidinger.net> In-Reply-To: <20100416102318.16752py80bkf418g@webmail.leidinger.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206452 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 10:21:11 -0000 On 04/16/10 09:23, Alexander Leidinger wrote: > >> IP multicast group membership is always scoped to physical links [1]. >> The 4.4BSD API originally used the "primary IP address" to identify >> each link. Unfortunately this is not a persistent identifier, >> especially so in the use-case which had problems. > > > Is/was this the reason why multicast does not work in jails? The above point is totally unrelated to jail. I think the problem with jail is the fact that to receive multicast, sockets normally need to be bound to INADDR_ANY. Obviously, jail changes socket behaviour in interesting ways. This may require refactoring udp_input() considerably. We use the 4.4BSD legacy LIST_FOREACH() loop to deliver, rather than using a fan-in map (which is the Windows/Solaris approach). Linux also has 4.4BSD semantics, but can work around this by examining the SO_BINDTODEVICE option in the same path. From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 10:40:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC9D106566B; Fri, 16 Apr 2010 10:40:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id F2B6A8FC15; Fri, 16 Apr 2010 10:40:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 5753941C795; Fri, 16 Apr 2010 12:40:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id zjSWnFBwEG+n; Fri, 16 Apr 2010 12:40:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id DD92541C756; Fri, 16 Apr 2010 12:40:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id DE2914448EC; Fri, 16 Apr 2010 10:39:38 +0000 (UTC) Date: Fri, 16 Apr 2010 10:39:38 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Bruce Simpson In-Reply-To: <4BC83A12.2080700@incunabulum.net> Message-ID: <20100416103826.X40281@maildrop.int.zabbadoz.net> References: <201004101205.o3AC5VGp074266@svn.freebsd.org> <4BC7486C.9010804@incunabulum.net> <20100416102318.16752py80bkf418g@webmail.leidinger.net> <4BC83A12.2080700@incunabulum.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexander Leidinger , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206452 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 10:40:09 -0000 On Fri, 16 Apr 2010, Bruce Simpson wrote: > On 04/16/10 09:23, Alexander Leidinger wrote: >> >>> IP multicast group membership is always scoped to physical links [1]. The >>> 4.4BSD API originally used the "primary IP address" to identify each link. >>> Unfortunately this is not a persistent identifier, especially so in the >>> use-case which had problems. >> >> >> Is/was this the reason why multicast does not work in jails? > > The above point is totally unrelated to jail. > > I think the problem with jail is the fact that to receive multicast, sockets > normally need to be bound to INADDR_ANY. Obviously, jail changes socket > behaviour in interesting ways. > > This may require refactoring udp_input() considerably. We use the 4.4BSD > legacy LIST_FOREACH() loop to deliver, rather than using a fan-in map (which > is the Windows/Solaris approach). > > Linux also has 4.4BSD semantics, but can work around this by examining the > SO_BINDTODEVICE option in the same path. SO_BINDTODEVICE would not be enough of a check unless the interface could be dedicated to a jail which classic jails did and do not support. Virtual network stacks will be the solution for this. -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 11:11:38 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D816106564A; Fri, 16 Apr 2010 11:11:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 901318FC19; Fri, 16 Apr 2010 11:11:37 +0000 (UTC) Received: from c122-106-149-225.carlnfd1.nsw.optusnet.com.au (c122-106-149-225.carlnfd1.nsw.optusnet.com.au [122.106.149.225]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3GBBXIT017868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Apr 2010 21:11:36 +1000 Date: Fri, 16 Apr 2010 21:11:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andriy Gapon In-Reply-To: <201004152141.o3FLf7WX025585@svn.freebsd.org> Message-ID: <20100416210721.W1238@delplex.bde.org> References: <201004152141.o3FLf7WX025585@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: r206687 - head/usr.bin/indent X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 11:11:38 -0000 On Thu, 15 Apr 2010, Andriy Gapon wrote: > Log: > indent(1): don't treat bare '_t' as a type name when -ta is used > > It seems that identifier "_t" is sometimes used as a variable name, > even in our tree. Not that I endorse that, but still it's better > to require at least one character before _t suffix to consider > an identifier to be a type name. > > Reported by: Alex Vasylenko > MFC after: 1 week Funny. POSIX reserves "_t" as a suffix in header files, so unless it also requires a non-null prefix, "_t" is reserved in POSIX. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 11:34:22 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id DFB451065675 for ; Fri, 16 Apr 2010 11:34:22 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id ECB9C1782E9 for ; Fri, 16 Apr 2010 11:34:21 +0000 (UTC) Received: (qmail 63881 invoked from network); 16 Apr 2010 11:34:21 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2010 11:34:21 -0000 Message-ID: <4BC84B3D.90302@freebsd.org> Date: Fri, 16 Apr 2010 04:34:21 -0700 From: Colin Percival User-Agent: Thunderbird 2.0.0.24 (X11/20100329) MIME-Version: 1.0 To: Bruce Evans References: <201004152141.o3FLf7WX025585@svn.freebsd.org> <20100416210721.W1238@delplex.bde.org> In-Reply-To: <20100416210721.W1238@delplex.bde.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r206687 - head/usr.bin/indent X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 11:34:23 -0000 Bruce Evans wrote: > On Thu, 15 Apr 2010, Andriy Gapon wrote: >> It seems that identifier "_t" is sometimes used as a variable name, >> even in our tree. [...] > > Funny. POSIX reserves "_t" as a suffix in header files, so unless it > also requires a non-null prefix, "_t" is reserved in POSIX. I think you must be reading a different version of POSIX to me. My version says that symbols ending with "_t" may be defined in any header; but not that they cannot be used in non-headers. If one wished to write code which was guaranteed to work on any conforming POSIX system, one would naturally wish to avoid symbols which might legitimately be defined in headers; but as long as we're concerned with one specific system which happens to not define the symbol "_t" in any header, this is a non-issue. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 12:49:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61B81065786; Fri, 16 Apr 2010 12:49:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 4345B8FC1A; Fri, 16 Apr 2010 12:49:51 +0000 (UTC) Received: from besplex.bde.org (c122-106-149-225.carlnfd1.nsw.optusnet.com.au [122.106.149.225]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3GCnmmK013322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Apr 2010 22:49:50 +1000 Date: Fri, 16 Apr 2010 22:49:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival In-Reply-To: <4BC84B3D.90302@freebsd.org> Message-ID: <20100416222439.M2697@besplex.bde.org> References: <201004152141.o3FLf7WX025585@svn.freebsd.org> <20100416210721.W1238@delplex.bde.org> <4BC84B3D.90302@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, Bruce Evans Subject: Re: svn commit: r206687 - head/usr.bin/indent X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 12:49:52 -0000 On Fri, 16 Apr 2010, Colin Percival wrote: > Bruce Evans wrote: >> On Thu, 15 Apr 2010, Andriy Gapon wrote: >>> It seems that identifier "_t" is sometimes used as a variable name, >>> even in our tree. [...] >> >> Funny. POSIX reserves "_t" as a suffix in header files, so unless it >> also requires a non-null prefix, "_t" is reserved in POSIX. > > I think you must be reading a different version of POSIX to me. My version says > that symbols ending with "_t" may be defined in any header; but not that they > cannot be used in non-headers. No, it seems to be almost the same version, but my reading is more lawerly :-). I looked mainly at POSIX.1-1996. They are reserved if any POSIX header is included. I thought that they were reserved only for typedefed names, but can't see any restriction in the 1996 version. Whether they can be used in a non-header that includes a POSIX header depends on scope rules. They can't be used at file scope for obvious reasons. If they are only reserved for typedefed names, then they can be used for other names in inner scope, provided you compile with a C compiler (no -Wshadow -Werror). If they are reserved for any use, then it is hard to think of any valid use in a non-header. Uses like "auto int foo_t;" would fail if foo_t were a macro which expands to almost anything. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 16:33:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B9F91065679; Fri, 16 Apr 2010 16:33:05 +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 50CFC8FC15; Fri, 16 Apr 2010 16:33: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 o3GGX5RP077703; Fri, 16 Apr 2010 16:33:05 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GGX5Pi077701; Fri, 16 Apr 2010 16:33:05 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004161633.o3GGX5Pi077701@svn.freebsd.org> From: Jack F Vogel Date: Fri, 16 Apr 2010 16:33: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: r206705 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 16:33:05 -0000 Author: jfv Date: Fri Apr 16 16:33:05 2010 New Revision: 206705 URL: http://svn.freebsd.org/changeset/base/206705 Log: Remove the tx queue selection based on the cpu whe no flowid is present, this was causing some bad reordering, now just use 0. Also, add a few watchdog bits, and tx handler bits that were corrected in igb. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Apr 16 16:15:30 2010 (r206704) +++ head/sys/dev/ixgbe/ixgbe.c Fri Apr 16 16:33:05 2010 (r206705) @@ -759,6 +759,7 @@ ixgbe_start_locked(struct tx_ring *txr, /* Set watchdog on */ txr->watchdog_check = TRUE; + txr->watchdog_time = ticks; } return; @@ -798,8 +799,6 @@ ixgbe_mq_start(struct ifnet *ifp, struct /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; - else /* use the cpu we're on */ - i = curcpu % adapter->num_queues; txr = &adapter->tx_rings[i]; @@ -856,8 +855,11 @@ ixgbe_mq_start_locked(struct ifnet *ifp, next = drbr_dequeue(ifp, txr->br); } - if (enqueued > 0) + if (enqueued > 0) { + /* Set watchdog on */ txr->watchdog_check = TRUE; + txr->watchdog_time = ticks; + } return (err); } @@ -1251,16 +1253,12 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - u32 loop = MAX_LOOP; - bool more_rx, more_tx; - - IXGBE_TX_LOCK(txr); - do { - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); - more_tx = ixgbe_txeof(txr); - } while (loop-- && (more_rx || more_tx)); + bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + more = ixgbe_rxeof(que, adapter->rx_process_limit); + IXGBE_TX_LOCK(txr); + ixgbe_txeof(txr); #if __FreeBSD_version >= 800000 if (!drbr_empty(ifp, txr->br)) ixgbe_mq_start_locked(ifp, txr, NULL); @@ -1268,11 +1266,16 @@ ixgbe_handle_que(void *context, int pend if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ixgbe_start_locked(txr, ifp); #endif + IXGBE_TX_UNLOCK(txr); + if (more) { + taskqueue_enqueue(que->tq, &que->que_task); + return; + } } - IXGBE_TX_UNLOCK(txr); /* Reenable this interrupt */ ixgbe_enable_queue(adapter, que->msix); + return; } @@ -1718,7 +1721,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m * hardware that this frame is available to transmit. */ ++txr->total_packets; - txr->watchdog_time = ticks; IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(txr->me), i); /* Do a clean if descriptors are low */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 16:49:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14FE2106566B; Fri, 16 Apr 2010 16:49:42 +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 A8F748FC1A; Fri, 16 Apr 2010 16:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3GGngGD081396; Fri, 16 Apr 2010 16:49:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GGngSk081394; Fri, 16 Apr 2010 16:49:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004161649.o3GGngSk081394@svn.freebsd.org> From: Rui Paulo Date: Fri, 16 Apr 2010 16:49: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: r206706 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 16:49:43 -0000 Author: rpaulo Date: Fri Apr 16 16:49:42 2010 New Revision: 206706 URL: http://svn.freebsd.org/changeset/base/206706 Log: Add ubthidhci. MFC after: 2 days Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Fri Apr 16 16:33:05 2010 (r206705) +++ head/etc/rc.d/Makefile Fri Apr 16 16:49:42 2010 (r206706) @@ -50,6 +50,10 @@ FILES+= sshd FILES+= nscd .endif +.if ${MK_BLUETOOTH} != "no" +FILES+= ubthidhci +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 20:04:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCB13106566C; Fri, 16 Apr 2010 20: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 CB2778FC19; Fri, 16 Apr 2010 20:04: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 o3GK4jSX030819; Fri, 16 Apr 2010 20:04:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GK4jZk030811; Fri, 16 Apr 2010 20:04:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004162004.o3GK4jZk030811@svn.freebsd.org> From: Xin LI Date: Fri, 16 Apr 2010 20:04: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: r206708 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 20:04:46 -0000 Author: delphij Date: Fri Apr 16 20:04:45 2010 New Revision: 206708 URL: http://svn.freebsd.org/changeset/base/206708 Log: MFV: libz 1.2.4.3. Modified: head/lib/libz/ChangeLog head/lib/libz/README head/lib/libz/deflate.c head/lib/libz/gzguts.h head/lib/libz/gzlib.c head/lib/libz/inftrees.c head/lib/libz/minigzip.c head/lib/libz/zconf.h head/lib/libz/zlib.3 head/lib/libz/zlib.h head/lib/libz/zutil.h Directory Properties: head/lib/libz/ (props changed) Modified: head/lib/libz/ChangeLog ============================================================================== --- head/lib/libz/ChangeLog Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/ChangeLog Fri Apr 16 20:04:45 2010 (r206708) @@ -1,6 +1,34 @@ ChangeLog file for zlib +Changes in 1.2.4.3 (10 Apr 2010) +- Only use CROSS_PREFIX in configure for ar and ranlib if they exist +- Use CROSS_PREFIX for nm [Bar-Lev] +- Assume _LARGEFILE64_SOURCE defined is equivalent to true +- Avoid use of undefined symbols in #if with && and || +- Make *64 prototypes in gzguts.h consistent with functions +- Add -shared load option for MinGW in configure [Bowler] +- Move z_off64_t to public interface, use instead of off64_t +- Remove ! from shell test in configure (not portable to Solaris) +- Change +0 macro tests to -0 for possibly increased portability + +Changes in 1.2.4.2 (9 Apr 2010) +- Add consistent carriage returns to readme.txt's in masmx86 and masmx64 +- Really provide prototypes for *64 functions when building without LFS +- Only define unlink() in minigzip.c if unistd.h not included +- Update README to point to contrib/vstudio project files +- Move projects/vc6 to old/ and remove projects/ +- Include stdlib.h in minigzip.c for setmode() definition under WinCE +- Clean up assembler builds in win32/Makefile.msc [Rowe] +- Include sys/types.h for Microsoft for off_t definition +- Fix memory leak on error in gz_open() +- Symbolize nm as $NM in configure [Weigelt] +- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt] +- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined +- Fix bug in gzeof() to take into account unused input data +- Avoid initialization of structures with variables in puff.c +- Updated win32/README-WIN32.txt [Rowe] + Changes in 1.2.4.1 (28 Mar 2010) - Remove the use of [a-z] constructs for sed in configure [gentoo 310225] - Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech] Modified: head/lib/libz/README ============================================================================== --- head/lib/libz/README Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/README Fri Apr 16 20:04:45 2010 (r206708) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.4.1 is a general purpose data compression library. All the code is +zlib 1.2.4.3 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -16,7 +16,8 @@ minigzip.c. To compile all files and run the test program, follow the instructions given at the top of Makefile.in. In short "./configure; make test", and if that goes well, "make install" should work for most flavors of Unix. For Windows, use one -of the special makefiles in win32/ or projects/ . For VMS, use make_vms.com. +of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use +make_vms.com. Questions about zlib should be sent to , or to Gilles Vollant for the Windows DLL version. The zlib home page is @@ -30,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.4.1 are documented in the file ChangeLog. +The changes made in version 1.2.4.3 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . Modified: head/lib/libz/deflate.c ============================================================================== --- head/lib/libz/deflate.c Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/deflate.c Fri Apr 16 20:04:45 2010 (r206708) @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.4.1 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.4.3 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot Modified: head/lib/libz/gzguts.h ============================================================================== --- head/lib/libz/gzguts.h Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/gzguts.h Fri Apr 16 20:04:45 2010 (r206708) @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#if _LARGEFILE64_SOURCE == 1 +#ifdef _LARGEFILE64_SOURCE # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif @@ -56,10 +56,12 @@ # endif #endif -#if _LARGEFILE64_SOURCE == 1 -# define z_off64_t off64_t -#else -# define z_off64_t z_off_t +/* provide prototypes for these when building zlib without LFS */ +#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); #endif /* default i/o buffer size -- double this for output when reading */ Modified: head/lib/libz/gzlib.c ============================================================================== --- head/lib/libz/gzlib.c Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/gzlib.c Fri Apr 16 20:04:45 2010 (r206708) @@ -8,7 +8,7 @@ #include "gzguts.h" #include "zutil.h" -#if _LARGEFILE64_SOURCE == 1 && _LFS64_LARGEFILE == 1 +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 # define LSEEK lseek64 #else # define LSEEK lseek @@ -175,6 +175,7 @@ local gzFile gz_open(path, fd, mode) O_APPEND))), 0666); if (state->fd == -1) { + free(state->path); free(state); return NULL; } @@ -435,7 +436,8 @@ int ZEXPORT gzeof(file) return 0; /* return end-of-file state */ - return state->mode == GZ_READ ? (state->eof && state->have == 0) : 0; + return state->mode == GZ_READ ? + (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0; } /* -- see zlib.h -- */ Modified: head/lib/libz/inftrees.c ============================================================================== --- head/lib/libz/inftrees.c Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/inftrees.c Fri Apr 16 20:04:45 2010 (r206708) @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.4.1 Copyright 1995-2010 Mark Adler "; + " inflate 1.2.4.3 Copyright 1995-2010 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 67, 206}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 195, 66}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, Modified: head/lib/libz/minigzip.c ============================================================================== --- head/lib/libz/minigzip.c Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/minigzip.c Fri Apr 16 20:04:45 2010 (r206708) @@ -32,6 +32,9 @@ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include # include +# ifdef UNDER_CE +# include +# endif # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) #else # define SET_BINARY_MODE(file) @@ -50,9 +53,11 @@ # include /* for fileno */ #endif +#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ extern int unlink OF((const char *)); #endif +#endif #if defined(UNDER_CE) # include Modified: head/lib/libz/zconf.h ============================================================================== --- head/lib/libz/zconf.h Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/zconf.h Fri Apr 16 20:04:45 2010 (r206708) @@ -364,8 +364,11 @@ typedef uLong FAR uLongf; # define Z_HAVE_UNISTD_H #endif -#if defined(Z_HAVE_UNISTD_H) +#ifdef STDC # include /* for off_t */ +#endif + +#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_* and off_t */ # ifdef VMS # include /* for off_t */ @@ -384,7 +387,6 @@ typedef uLong FAR uLongf; /* * This is hard-configured for FreeBSD. */ -#include #define z_off_t off_t #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 @@ -394,6 +396,12 @@ typedef uLong FAR uLongf; # define z_off_t long #endif +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 +# define z_off64_t off64_t +#else +# define z_off64_t z_off_t +#endif + #if defined(__OS400__) # define NO_vsnprintf #endif Modified: head/lib/libz/zlib.3 ============================================================================== --- head/lib/libz/zlib.3 Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/zlib.3 Fri Apr 16 20:04:45 2010 (r206708) @@ -1,4 +1,4 @@ -.TH ZLIB 3 "28 Mar 2010" +.TH ZLIB 3 "10 Apr 2010" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -125,7 +125,7 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS -Version 1.2.4.1 +Version 1.2.4.3 Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org) and Mark Adler (madler@alumni.caltech.edu). .LP Modified: head/lib/libz/zlib.h ============================================================================== --- head/lib/libz/zlib.h Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/zlib.h Fri Apr 16 20:04:45 2010 (r206708) @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.4.1, March 28th, 2010 + version 1.2.4.3, April 10th, 2010 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler @@ -37,12 +37,12 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.4.1" -#define ZLIB_VERNUM 0x1241 +#define ZLIB_VERSION "1.2.4.3" +#define ZLIB_VERNUM 0x1243 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 4 -#define ZLIB_VER_SUBREVISION 1 +#define ZLIB_VER_SUBREVISION 3 /* The 'zlib' compression library provides in-memory compression and @@ -1556,18 +1556,51 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF( inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, sizeof(z_stream)) +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); +#endif +#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# ifdef _LARGEFILE64_SOURCE + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +# endif +#else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); +#endif +/* hack for buggy compilers */ #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ + struct internal_state {int dummy;}; #endif +/* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); Modified: head/lib/libz/zutil.h ============================================================================== --- head/lib/libz/zutil.h Fri Apr 16 17:27:20 2010 (r206707) +++ head/lib/libz/zutil.h Fri Apr 16 20:04:45 2010 (r206708) @@ -154,20 +154,10 @@ extern const char * const z_errmsg[10]; #pragma warn -8066 #endif -#if _LARGEFILE64_SOURCE == 1 && _LFS64_LARGEFILE == 1 -# define z_off64_t off64_t -#else -# define z_off64_t z_off_t -#endif - /* provide prototypes for these when building zlib without LFS */ -#if _LARGEFILE64_SOURCE != 1 || _LFS64_LARGEFILE != 1 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN off_t ZEXPORT gzseek64 OF((gzFile, off_t, int)); - ZEXTERN off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off_t)); +#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); #endif /* common defaults */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 20:07:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30981065676; Fri, 16 Apr 2010 20:07:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D30FF8FC21; Fri, 16 Apr 2010 20:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3GK7ODN031580; Fri, 16 Apr 2010 20:07:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GK7Omt031578; Fri, 16 Apr 2010 20:07:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004162007.o3GK7Omt031578@svn.freebsd.org> From: Xin LI Date: Fri, 16 Apr 2010 20:07: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: r206709 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 20:07:25 -0000 Author: delphij Date: Fri Apr 16 20:07:24 2010 New Revision: 206709 URL: http://svn.freebsd.org/changeset/base/206709 Log: Expose a few symbols as public interface rather than private. Note: the *64 interfaces are no longer exposed via zlib.h but were keep as public interfaces; Note 2: this commit would break applications that uses the moved symbols directly. Modified: head/lib/libz/Symbol.map Modified: head/lib/libz/Symbol.map ============================================================================== --- head/lib/libz/Symbol.map Fri Apr 16 20:04:45 2010 (r206708) +++ head/lib/libz/Symbol.map Fri Apr 16 20:07:24 2010 (r206709) @@ -4,11 +4,13 @@ ZLIB_1.2.4.0 { adler32; + adler32_combine; adler32_combine64; compress; compress2; compressBound; crc32; + crc32_combine; crc32_combine64; deflate; deflateBound; @@ -35,15 +37,19 @@ ZLIB_1.2.4.0 { gzflush; gzgetc; gzgets; + gzoffset; gzoffset64; + gzopen; gzopen64; gzprintf; gzputc; gzputs; gzread; gzrewind; + gzseek; gzseek64; gzsetparams; + gztell; gztell64; gzungetc; gzwrite; @@ -80,13 +86,7 @@ ZLIBprivate_1.0 { _tr_init; _tr_stored_block; _tr_tally; - adler32_combine; - crc32_combine; gz_error; - gzoffset; - gzopen; - gzseek; - gztell; inflate_fast; inflate_table; longest_match; From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 22:15:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA14106564A; Fri, 16 Apr 2010 22:15:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDC828FC13; Fri, 16 Apr 2010 22:15: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 o3GMFQM0063558; Fri, 16 Apr 2010 22:15:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GMFQdK063557; Fri, 16 Apr 2010 22:15:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004162215.o3GMFQdK063557@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 16 Apr 2010 22:15: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: r206710 - head/tools/regression/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 22:15:27 -0000 Author: jilles Date: Fri Apr 16 22:15:26 2010 New Revision: 206710 URL: http://svn.freebsd.org/changeset/base/206710 Log: Add some tests for fnmatch(3). MFC after: 1 week Added: head/tools/regression/lib/libc/gen/test-fnmatch.c (contents, props changed) Modified: head/tools/regression/lib/libc/gen/Makefile Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Fri Apr 16 20:07:24 2010 (r206709) +++ head/tools/regression/lib/libc/gen/Makefile Fri Apr 16 22:15:26 2010 (r206710) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-fmtcheck test-fpclassify test-wordexp +TESTS= test-fmtcheck test-fnmatch test-fpclassify test-wordexp .PHONY: tests tests: ${TESTS} Added: head/tools/regression/lib/libc/gen/test-fnmatch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/gen/test-fnmatch.c Fri Apr 16 22:15:26 2010 (r206710) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2010 Jilles Tjoelker + * 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 + +struct testcase { + const char *pattern; + const char *string; + int flags; + int result; +} testcases[] = { + "", "", 0, 0, + "a", "a", 0, 0, + "a", "b", 0, FNM_NOMATCH, + "a", "A", 0, FNM_NOMATCH, + "*", "a", 0, 0, + "*", "aa", 0, 0, + "*a", "a", 0, 0, + "*a", "b", 0, FNM_NOMATCH, + "*a*", "b", 0, FNM_NOMATCH, + "*a*b*", "ab", 0, 0, + "*a*b*", "qaqbq", 0, 0, + "*a*bb*", "qaqbqbbq", 0, 0, + "*a*bc*", "qaqbqbcq", 0, 0, + "*a*bb*", "qaqbqbb", 0, 0, + "*a*bc*", "qaqbqbc", 0, 0, + "*a*bb", "qaqbqbb", 0, 0, + "*a*bc", "qaqbqbc", 0, 0, + "*a*bb", "qaqbqbbq", 0, FNM_NOMATCH, + "*a*bc", "qaqbqbcq", 0, FNM_NOMATCH, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0, + ".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH, + ".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0, + ".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0, + "*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH, + "??????????*", "123456789", 0, FNM_NOMATCH, + "*??????????", "123456789", 0, FNM_NOMATCH, + "*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0, + "??????????*", "1234567890", 0, 0, + "*??????????", "1234567890", 0, 0, + "*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0, + "??????????*", "12345678901", 0, 0, + "*??????????", "12345678901", 0, 0, + "[x]", "x", 0, 0, + "[*]", "*", 0, 0, + "[?]", "?", 0, 0, + "[", "[", 0, 0, + "[[]", "[", 0, 0, + "[[]", "x", 0, FNM_NOMATCH, + "[*]", "", 0, FNM_NOMATCH, + "[*]", "x", 0, FNM_NOMATCH, + "[?]", "x", 0, FNM_NOMATCH, + "*[*]*", "foo*foo", 0, 0, + "*[*]*", "foo", 0, FNM_NOMATCH, + "[0-9]", "0", 0, 0, + "[0-9]", "5", 0, 0, + "[0-9]", "9", 0, 0, + "[0-9]", "/", 0, FNM_NOMATCH, + "[0-9]", ":", 0, FNM_NOMATCH, + "[0-9]", "*", 0, FNM_NOMATCH, + "[!0-9]", "0", 0, FNM_NOMATCH, + "[!0-9]", "5", 0, FNM_NOMATCH, + "[!0-9]", "9", 0, FNM_NOMATCH, + "[!0-9]", "/", 0, 0, + "[!0-9]", ":", 0, 0, + "[!0-9]", "*", 0, 0, + "*[0-9]", "a0", 0, 0, + "*[0-9]", "a5", 0, 0, + "*[0-9]", "a9", 0, 0, + "*[0-9]", "a/", 0, FNM_NOMATCH, + "*[0-9]", "a:", 0, FNM_NOMATCH, + "*[0-9]", "a*", 0, FNM_NOMATCH, + "*[!0-9]", "a0", 0, FNM_NOMATCH, + "*[!0-9]", "a5", 0, FNM_NOMATCH, + "*[!0-9]", "a9", 0, FNM_NOMATCH, + "*[!0-9]", "a/", 0, 0, + "*[!0-9]", "a:", 0, 0, + "*[!0-9]", "a*", 0, 0, + "*[0-9]", "a00", 0, 0, + "*[0-9]", "a55", 0, 0, + "*[0-9]", "a99", 0, 0, + "*[0-9]", "a0a0", 0, 0, + "*[0-9]", "a5a5", 0, 0, + "*[0-9]", "a9a9", 0, 0, + "\\*", "*", 0, 0, + "\\?", "?", 0, 0, + "\\[x]", "[x]", 0, 0, + "\\[", "[", 0, 0, + "\\\\", "\\", 0, 0, + "*\\**", "foo*foo", 0, 0, + "*\\**", "foo", 0, FNM_NOMATCH, + "*\\\\*", "foo\\foo", 0, 0, + "*\\\\*", "foo", 0, FNM_NOMATCH, + "\\(", "(", 0, 0, + "\\a", "a", 0, 0, + "\\*", "a", 0, FNM_NOMATCH, + "\\?", "a", 0, FNM_NOMATCH, + "\\*", "\\*", 0, FNM_NOMATCH, + "\\?", "\\?", 0, FNM_NOMATCH, + "\\[x]", "\\[x]", 0, FNM_NOMATCH, + "\\[x]", "\\x", 0, FNM_NOMATCH, + "\\[", "\\[", 0, FNM_NOMATCH, + "\\(", "\\(", 0, FNM_NOMATCH, + "\\a", "\\a", 0, FNM_NOMATCH, + "\\*", "\\*", FNM_NOESCAPE, 0, + "\\?", "\\?", FNM_NOESCAPE, 0, + "\\", "\\", FNM_NOESCAPE, 0, + "\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH, + "\\\\", "\\\\", FNM_NOESCAPE, 0, + "*\\*", "foo\\foo", FNM_NOESCAPE, 0, + "*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH, + "*", ".", FNM_PERIOD, FNM_NOMATCH, + "?", ".", FNM_PERIOD, FNM_NOMATCH, + ".*", ".", 0, 0, + ".*", "..", 0, 0, + ".*", ".a", 0, 0, + "[0-9]", ".", FNM_PERIOD, FNM_NOMATCH, + "a*", "a.", 0, 0, + "a/a", "a/a", FNM_PATHNAME, 0, + "a/*", "a/a", FNM_PATHNAME, 0, + "*/a", "a/a", FNM_PATHNAME, 0, + "*/*", "a/a", FNM_PATHNAME, 0, + "a*b/*", "abbb/x", FNM_PATHNAME, 0, + "a*b/*", "abbb/.x", FNM_PATHNAME, 0, + "*", "a/a", FNM_PATHNAME, FNM_NOMATCH, + "*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH, + "b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, + "b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, + "b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, + "b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, + "a", "A", FNM_CASEFOLD, 0, + "A", "a", FNM_CASEFOLD, 0, + "[a]", "A", FNM_CASEFOLD, 0, + "[A]", "a", FNM_CASEFOLD, 0, + "a", "b", FNM_CASEFOLD, FNM_NOMATCH, + "a", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "*", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, + "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, +}; + +static const char * +flags_to_string(int flags) +{ + static const int flagvalues[] = { FNM_NOESCAPE, FNM_PATHNAME, + FNM_PERIOD, FNM_LEADING_DIR, FNM_CASEFOLD, 0 }; + static const char flagnames[] = "FNM_NOESCAPE\0FNM_PATHNAME\0FNM_PERIOD\0FNM_LEADING_DIR\0FNM_CASEFOLD\0"; + static char result[sizeof(flagnames) + 3 * sizeof(int) + 2]; + char *p; + size_t i, len; + const char *fp; + + p = result; + fp = flagnames; + for (i = 0; flagvalues[i] != 0; i++) { + len = strlen(fp); + if (flags & flagvalues[i]) { + if (p != result) + *p++ = '|'; + memcpy(p, fp, len); + p += len; + flags &= ~flagvalues[i]; + } + fp += len + 1; + } + if (p == result) + memcpy(p, "0", 2); + else if (flags != 0) + sprintf(p, "%d", flags); + else + *p = '\0'; + return result; +} + +int +main(int argc, char *argv[]) +{ + size_t i, n; + int flags, result, extra, errors; + struct testcase *t; + + n = sizeof(testcases) / sizeof(testcases[0]); + errors = 0; + printf("1..%zu\n", n); + for (i = 0; i < n; i++) { + t = &testcases[i]; + flags = t->flags; + extra = 0; + do { + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + if (strchr(t->pattern, '\\') == NULL && + !(flags & FNM_NOESCAPE)) { + flags |= FNM_NOESCAPE; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if (strchr(t->pattern, '\\') != NULL && + strchr(t->string, '\\') == NULL && + t->result == FNM_NOMATCH && + !(flags & (FNM_NOESCAPE | FNM_LEADING_DIR))) { + flags |= FNM_NOESCAPE; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if ((t->string[0] != '.' || t->pattern[0] == '.' || + t->result == FNM_NOMATCH) && + !(flags & (FNM_PATHNAME | FNM_PERIOD))) { + flags |= FNM_PERIOD; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if ((strchr(t->string, '/') == NULL || + t->result == FNM_NOMATCH) && + !(flags & FNM_PATHNAME)) { + flags |= FNM_PATHNAME; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if ((((t->string[0] != '.' || t->pattern[0] == '.') && + strstr(t->string, "/.") == NULL) || + t->result == FNM_NOMATCH) && + flags & FNM_PATHNAME && !(flags & FNM_PERIOD)) { + flags |= FNM_PERIOD; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if ((((t->string[0] != '.' || t->pattern[0] == '.') && + strchr(t->string, '/') == NULL) || + t->result == FNM_NOMATCH) && + !(flags & (FNM_PATHNAME | FNM_PERIOD))) { + flags |= FNM_PATHNAME | FNM_PERIOD; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if ((strchr(t->string, '/') == NULL || t->result == 0) + && !(flags & FNM_LEADING_DIR)) { + flags |= FNM_LEADING_DIR; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if (t->result == 0 && !(flags & FNM_CASEFOLD)) { + flags |= FNM_CASEFOLD; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + if (strchr(t->pattern, '\\') == NULL && + t->result == 0 && + !(flags & (FNM_NOESCAPE | FNM_CASEFOLD))) { + flags |= FNM_NOESCAPE | FNM_CASEFOLD; + result = fnmatch(t->pattern, t->string, flags); + if (result != t->result) + break; + flags = t->flags; + extra++; + } + } while (0); + if (result == t->result) + printf("ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d (+%d)\n", + i + 1, t->pattern, t->string, + flags_to_string(flags), + result, extra); + else { + printf("not ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d != %d\n", + i + 1, t->pattern, t->string, + flags_to_string(flags), + result, t->result); + errors = 1; + } + } + + return (errors); +} From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 22:29:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF7A106566C; Fri, 16 Apr 2010 22:29:25 +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 042E68FC0A; Fri, 16 Apr 2010 22:29: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 o3GMTOug066700; Fri, 16 Apr 2010 22:29:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GMTOJe066697; Fri, 16 Apr 2010 22:29:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004162229.o3GMTOJe066697@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 16 Apr 2010 22:29: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: r206711 - in head: lib/libc/gen tools/regression/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 22:29:25 -0000 Author: jilles Date: Fri Apr 16 22:29:24 2010 New Revision: 206711 URL: http://svn.freebsd.org/changeset/base/206711 Log: fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen. Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD) PR: 116074 MFC after: 1 week Modified: head/lib/libc/gen/fnmatch.c head/tools/regression/lib/libc/gen/test-fnmatch.c Modified: head/lib/libc/gen/fnmatch.c ============================================================================== --- head/lib/libc/gen/fnmatch.c Fri Apr 16 22:15:26 2010 (r206710) +++ head/lib/libc/gen/fnmatch.c Fri Apr 16 22:29:24 2010 (r206711) @@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$"); #define RANGE_ERROR (-1) static int rangematch(const char *, wchar_t, int, char **, mbstate_t *); -static int fnmatch1(const char *, const char *, int, mbstate_t, mbstate_t); +static int fnmatch1(const char *, const char *, const char *, int, mbstate_t, + mbstate_t); int fnmatch(pattern, string, flags) @@ -76,22 +77,21 @@ fnmatch(pattern, string, flags) { static const mbstate_t initial; - return (fnmatch1(pattern, string, flags, initial, initial)); + return (fnmatch1(pattern, string, string, flags, initial, initial)); } static int -fnmatch1(pattern, string, flags, patmbs, strmbs) - const char *pattern, *string; +fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs) + const char *pattern, *string, *stringstart; int flags; mbstate_t patmbs, strmbs; { - const char *stringstart; char *newp; char c; wchar_t pc, sc; size_t pclen, sclen; - for (stringstart = string;;) { + for (;;) { pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs); if (pclen == (size_t)-1 || pclen == (size_t)-2) return (FNM_NOMATCH); @@ -145,8 +145,8 @@ fnmatch1(pattern, string, flags, patmbs, /* General case, use recursion. */ while (sc != EOS) { - if (!fnmatch1(pattern, string, - flags & ~FNM_PERIOD, patmbs, strmbs)) + if (!fnmatch1(pattern, string, stringstart, + flags, patmbs, strmbs)) return (0); sclen = mbrtowc(&sc, string, MB_LEN_MAX, &strmbs); Modified: head/tools/regression/lib/libc/gen/test-fnmatch.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-fnmatch.c Fri Apr 16 22:15:26 2010 (r206710) +++ head/tools/regression/lib/libc/gen/test-fnmatch.c Fri Apr 16 22:29:24 2010 (r206711) @@ -174,6 +174,7 @@ struct testcase { "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, + "a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, }; static const char * From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 22:30:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59E4C106564A; Fri, 16 Apr 2010 22:30:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 175BC8FC17; Fri, 16 Apr 2010 22:30:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 77D2241C7AE; Sat, 17 Apr 2010 00:30:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 5iO1t4IQeHrc; Sat, 17 Apr 2010 00:30:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 0E5F341C7AD; Sat, 17 Apr 2010 00:30:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 7EE0F4448EC; Fri, 16 Apr 2010 22:27:57 +0000 (UTC) Date: Fri, 16 Apr 2010 22:27:57 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Doug Barton In-Reply-To: <201004090135.o391Z9q2092650@svn.freebsd.org> Message-ID: <20100416214823.Q40281@maildrop.int.zabbadoz.net> References: <201004090135.o391Z9q2092650@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206408 - in head: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 22:30:07 -0000 On Fri, 9 Apr 2010, Doug Barton wrote: Hi, first off all it would have been easier to figure a few things out, if the several different things had been individual commits or if the commit hadn't happed in the middle of a discussion that died with this. The comments below are on the first four things I could figure out easily. > Author: dougb > Date: Fri Apr 9 01:35:09 2010 > New Revision: 206408 > URL: http://svn.freebsd.org/changeset/base/206408 > > Log: ... > 6. Add support for the [NO]RTADV options in ifconfig_getargs() and > ipv6_autoconfif(). In the latter, include support for the explicit > addition of [-]accept_rtadv in ifconfig__ipv6 as is done > in the current code. So usually we seem to use the upper case pseudo arguments like DHCP, SYNCDHCP, WPA, .. in combination with an actual command to start apart from ifconfig. Now RTADV does not do that but it passes accept_rtadv or -accept_rtadv to ifconfig. So if you need a command alias for that it should probably be in ifconfig and discussed separately. Please revert this part. > Switch ipv6_prefer to YES. If ipv6_enable is not set this will have > no effect. This changed the default. I am pretty sure this is going to bite massively. Why do we need opt-out rather than the previous opt-in here? I have no idea where in the commit message it was but I must have missed it. Anyway, with this change the link-local addresses are there by default (even though luckily still disabled -- though I not entirely sure that this would hold for all possible combinations) even if there is no IPv6 configured. We didn't have this on say stable/7 unless explicitly configured (globally) and I am not sure for how many releases. This should be reverted. It should be added that I think these defaults will hell confuse people even more as things are there even though not configured and are not working because they are disabled. The learning curve to figure that out is way higher than simply "nothing there -> put and ifconfig_IF_ipv6 line into rc.conf". > 5. In rc.d/netoptions, add code for an ipv6_privacy option to use > RFC 4193 style pseudo-random addresses .. > Add a default for ipv6_privacy (NO). I think this is the only option I can say I feel ok with so far. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 22:37:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC40B1065674 for ; Fri, 16 Apr 2010 22:37:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id 234058FC1E for ; Fri, 16 Apr 2010 22:37:39 +0000 (UTC) Received: (qmail 26740 invoked by uid 399); 16 Apr 2010 22:37:38 -0000 Received: from localhost (HELO ?192.168.0.145?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 16 Apr 2010 22:37:38 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BC8E6B0.2060709@FreeBSD.org> Date: Fri, 16 Apr 2010 15:37:36 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201004090135.o391Z9q2092650@svn.freebsd.org> <20100416214823.Q40281@maildrop.int.zabbadoz.net> In-Reply-To: <20100416214823.Q40281@maildrop.int.zabbadoz.net> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 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: r206408 - in head: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 22:37:40 -0000 Rather than have the discussion about this here I'm going to respond to your message on -current where the most recent discussion about this took place. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 23:42:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610521065673; Fri, 16 Apr 2010 23:42:19 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51EF48FC20; Fri, 16 Apr 2010 23:42: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 o3GNgJJC082776; Fri, 16 Apr 2010 23:42:19 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GNgJsd082774; Fri, 16 Apr 2010 23:42:19 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004162342.o3GNgJsd082774@svn.freebsd.org> From: Juli Mallett Date: Fri, 16 Apr 2010 23:42: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: r206712 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 23:42:19 -0000 Author: jmallett Date: Fri Apr 16 23:42:19 2010 New Revision: 206712 URL: http://svn.freebsd.org/changeset/base/206712 Log: Set KERNLOADADDR and TARGET_BIG_ENDIAN for SWARM. Modified: head/sys/mips/conf/SWARM Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Fri Apr 16 22:29:24 2010 (r206711) +++ head/sys/mips/conf/SWARM Fri Apr 16 23:42:19 2010 (r206712) @@ -19,8 +19,13 @@ options CFE_CONSOLE options CFE_ENV options ALT_BREAK_TO_DEBUGGER +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN=defined makeoptions LDSCRIPT_NAME= ldscript.mips.cfe +makeoptions KERNLOADADDR=0x81000000 + #cpu CPU_MIPS64 #options ISA_MIPS64 #makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 23:46:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99DF61065670; Fri, 16 Apr 2010 23:46:30 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89F5C8FC13; Fri, 16 Apr 2010 23:46: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 o3GNkUiL083744; Fri, 16 Apr 2010 23:46:30 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GNkUkk083742; Fri, 16 Apr 2010 23:46:30 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004162346.o3GNkUkk083742@svn.freebsd.org> From: Juli Mallett Date: Fri, 16 Apr 2010 23:46: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: r206713 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 23:46:30 -0000 Author: jmallett Date: Fri Apr 16 23:46:30 2010 New Revision: 206713 URL: http://svn.freebsd.org/changeset/base/206713 Log: o) Fix the intr_* functions to not spam the whole status register, just the IE bit. o) Remove some unused inlines. o) Generate CP0 access functions for 64-bit TLB registers when building for n64. o) Add an inline function version of the COP0_SYNC macro. Modified: head/sys/mips/include/cpufunc.h Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Fri Apr 16 23:42:19 2010 (r206712) +++ head/sys/mips/include/cpufunc.h Fri Apr 16 23:46:30 2010 (r206713) @@ -1,5 +1,29 @@ /* $OpenBSD: pio.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */ +/*- + * Copyright (c) 2002-2004 Juli Mallett. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ /* * Copyright (c) 1995-1999 Per Fogelstrom. All rights reserved. * @@ -59,14 +83,16 @@ mips_barrier(void) } static __inline void +mips_cp0_sync(void) +{ + __asm __volatile (__XSTRING(COP0_SYNC)); +} + +static __inline void mips_wbflush(void) { __asm __volatile ("sync" : : : "memory"); mips_barrier(); -#if 0 - __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ - : : "r" (flag)); -#endif } static __inline void @@ -82,54 +108,7 @@ mips_write_membar(void) } #ifdef _KERNEL - -static __inline void -mips_tlbp(void) -{ - __asm __volatile ("tlbp"); - mips_barrier(); -#if 0 - register_t ret; - register_t tmp; - - __asm __volatile("mfc0 %0, $12\n" /* MIPS_COP_0_STATUS */ - "and %1, %0, $~1\n" /* MIPS_SR_INT_IE */ - "mtc0 %1, $12\n" /* MIPS_COP_0_STATUS */ - : "=r" (ret), "=r" (tmp)); - return (ret); -#endif -} - -static __inline void -mips_tlbr(void) -{ - __asm __volatile ("tlbr"); - mips_barrier(); -} - -static __inline void -mips_tlbwi(void) -{ - __asm __volatile ("tlbwi"); - mips_barrier(); -#if 0 - __asm __volatile("mfc %0, $12\n" /* MIPS_COP_0_STATUS */ - "or %0, %0, $1\n" /* MIPS_SR_INT_IE */ - "mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ - : "=r" (tmp)); -#endif -} - -static __inline void -mips_tlbwr(void) -{ - __asm __volatile ("tlbwr"); - mips_barrier(); -} - - -#if 0 /* XXX mips64 */ - +#if defined(__mips_n32) || defined(__mips_n64) #define MIPS_RDRW64_COP0(n,r) \ static __inline uint64_t \ mips_rd_ ## n (void) \ @@ -152,10 +131,12 @@ mips_wr_ ## n (uint64_t a0) \ mips_barrier(); \ } struct __hack +#if defined(__mips_n64) MIPS_RDRW64_COP0(entrylo0, MIPS_COP_0_TLB_LO0); MIPS_RDRW64_COP0(entrylo1, MIPS_COP_0_TLB_LO1); MIPS_RDRW64_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RDRW64_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +#endif MIPS_RDRW64_COP0(xcontext, MIPS_COP_0_TLB_XCONTEXT); #undef MIPS_RDRW64_COP0 @@ -230,12 +211,15 @@ MIPS_RDRW32_COP0(cause, MIPS_COP_0_CAUSE MIPS_RDRW32_COP0(status, MIPS_COP_0_STATUS); /* XXX: Some of these registers are specific to MIPS32. */ +#if !defined(__mips_n64) MIPS_RDRW32_COP0(entrylo0, MIPS_COP_0_TLB_LO0); MIPS_RDRW32_COP0(entrylo1, MIPS_COP_0_TLB_LO1); -MIPS_RDRW32_COP0(entrylow, MIPS_COP_0_TLB_LOW); MIPS_RDRW32_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RDRW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +#endif MIPS_RDRW32_COP0(prid, MIPS_COP_0_PRID); +/* XXX 64-bit? */ +MIPS_RDRW32_COP0_SEL(prid, MIPS_COP_0_PRID, 1); MIPS_RDRW32_COP0(watchlo, MIPS_COP_0_WATCH_LO); MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 1); MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 2); @@ -250,7 +234,6 @@ MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0 MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 2); MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 3); - #undef MIPS_RDRW32_COP0 static __inline register_t @@ -261,7 +244,7 @@ intr_disable(void) s = mips_rd_status(); mips_wr_status(s & ~MIPS_SR_INT_IE); - return (s); + return (s & MIPS_SR_INT_IE); } static __inline register_t @@ -275,7 +258,13 @@ intr_enable(void) return (s); } -#define intr_restore(s) mips_wr_status((s)) +static __inline void +intr_restore(register_t ie) +{ + if (ie == MIPS_SR_INT_IE) { + intr_enable(); + } +} static __inline void breakpoint(void) From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 23:48:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DA8106564A; Fri, 16 Apr 2010 23:48:28 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451448FC0C; Fri, 16 Apr 2010 23:48: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 o3GNmSJ1084222; Fri, 16 Apr 2010 23:48:28 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GNmS0c084217; Fri, 16 Apr 2010 23:48:28 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004162348.o3GNmS0c084217@svn.freebsd.org> From: Juli Mallett Date: Fri, 16 Apr 2010 23:48: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: r206714 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 23:48:28 -0000 Author: jmallett Date: Fri Apr 16 23:48:28 2010 New Revision: 206714 URL: http://svn.freebsd.org/changeset/base/206714 Log: o) Use the direct map where possible for uiomove_fromphys, based on code from sparc64. o) Use uiomove_fromphys rather than the broken fpage mechanism for /dev/mem. o) Update sf_buf allocator to not share buffers and to do a pmap_qremove when done with an sf_buf so as to better track valid mappings. Modified: head/sys/mips/include/sf_buf.h head/sys/mips/mips/mem.c head/sys/mips/mips/uio_machdep.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/sf_buf.h ============================================================================== --- head/sys/mips/include/sf_buf.h Fri Apr 16 23:46:30 2010 (r206713) +++ head/sys/mips/include/sf_buf.h Fri Apr 16 23:48:28 2010 (r206714) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003, 2005 Alan L. Cox + * Copyright (c) 2003 Alan L. Cox * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,29 +23,20 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: src/sys/i386/include/sf_buf.h,v 1.4 2005/02/13 06:23:13 alc * $FreeBSD$ */ #ifndef _MACHINE_SF_BUF_H_ -#define _MACHINE_SF_BUF_H_ +#define _MACHINE_SF_BUF_H_ #include -#include -#include -#include struct vm_page; struct sf_buf { - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ + SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ struct vm_page *m; /* currently mapped page */ vm_offset_t kva; /* va of mapping */ - int ref_count; /* usage of this mapping */ -#ifdef SMP - cpumask_t cpumask; /* cpus on which mapping is valid */ -#endif }; static __inline vm_offset_t Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Fri Apr 16 23:46:30 2010 (r206713) +++ head/sys/mips/mips/mem.c Fri Apr 16 23:48:28 2010 (r206714) @@ -1,13 +1,12 @@ -/* $OpenBSD: mem.c,v 1.2 1998/08/31 17:42:34 millert Exp $ */ -/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */ -/* +/*- * Copyright (c) 1988 University of Utah. - * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. + * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer - * Science Department and Ralph Campbell. + * Science Department, and code derived from software contributed to + * Berkeley by William Jolitz. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,161 +32,136 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)mem.c 8.3 (Berkeley) 1/12/94 - * JNPR: mem.c,v 1.3 2007/08/09 11:23:32 katta Exp $ + * from: Utah $Hdr: mem.c 1.13 89/10/08$ + * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 */ +#include +__FBSDID("$FreeBSD$"); + /* * Memory special file */ -#include -__FBSDID("$FreeBSD$"); - #include -#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include +#include #include -#include -#include -#include -#include + #include -#include +#include + +#include +#include +#include +#include + #include +struct mem_range_softc mem_range_softc; -extern struct sysmaps sysmaps_pcpu[]; -/*ARGSUSED*/ +/* ARGSUSED */ int -memrw(dev, uio, flags) - struct cdev *dev; - struct uio *uio; - int flags; +memrw(struct cdev *dev, struct uio *uio, int flags) { - register vm_offset_t v; - register int c; - register struct iovec *iov; + struct iovec *iov; int error = 0; + vm_offset_t va, eva, off, v; + vm_prot_t prot; + struct vm_page m; + vm_page_t marr; + vm_size_t cnt; + + cnt = 0; + error = 0; + + GIANT_REQUIRED; - while (uio->uio_resid > 0 && error == 0) { + while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; if (iov->iov_len == 0) { uio->uio_iov++; uio->uio_iovcnt--; if (uio->uio_iovcnt < 0) - panic("mmrw"); + panic("memrw"); continue; } - - /* minor device 0 is physical memory */ if (dev2unit(dev) == CDEV_MINOR_MEM) { v = uio->uio_offset; - c = iov->iov_len; - vm_offset_t va; - vm_paddr_t pa; - register int o; - - if (is_cacheable_mem(v) && - is_cacheable_mem(v + c - 1)) { - struct fpage *fp; - struct sysmaps *sysmaps; - - sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; - mtx_lock(&sysmaps->lock); - sched_pin(); - - fp = &sysmaps->fp[PMAP_FPAGE1]; - pa = uio->uio_offset & ~PAGE_MASK; - va = pmap_map_fpage(pa, fp, FALSE); - o = (int)uio->uio_offset & PAGE_MASK; - c = (u_int)(PAGE_SIZE - - ((uintptr_t)iov->iov_base & PAGE_MASK)); - c = min(c, (u_int)(PAGE_SIZE - o)); - c = min(c, (u_int)iov->iov_len); - error = uiomove((caddr_t)(va + o), (int)c, uio); - pmap_unmap_fpage(pa, fp); - sched_unpin(); - mtx_unlock(&sysmaps->lock); - } else - return (EFAULT); - continue; + off = uio->uio_offset & PAGE_MASK; + cnt = PAGE_SIZE - ((vm_offset_t)iov->iov_base & + PAGE_MASK); + cnt = min(cnt, PAGE_SIZE - off); + cnt = min(cnt, iov->iov_len); + + m.phys_addr = trunc_page(v); + marr = &m; + error = uiomove_fromphys(&marr, off, cnt, uio); } - - /* minor device 1 is kernel memory */ else if (dev2unit(dev) == CDEV_MINOR_KMEM) { - v = uio->uio_offset; - c = min(iov->iov_len, MAXPHYS); + va = uio->uio_offset; - vm_offset_t addr, eaddr; - vm_offset_t wired_tlb_virtmem_end; - - /* - * Make sure that all of the pages are currently - * resident so that we don't create any zero-fill pages. + va = trunc_page(uio->uio_offset); + eva = round_page(uio->uio_offset + + iov->iov_len); + + /* + * Make sure that all the pages are currently resident + * so that we don't create any zero-fill pages. */ - addr = trunc_page(uio->uio_offset); - eaddr = round_page(uio->uio_offset + c); - if (addr > (vm_offset_t) VM_MIN_KERNEL_ADDRESS) { - wired_tlb_virtmem_end = VM_MIN_KERNEL_ADDRESS + - VM_KERNEL_ALLOC_OFFSET; - if ((addr < wired_tlb_virtmem_end) && - (eaddr >= wired_tlb_virtmem_end)) - addr = wired_tlb_virtmem_end; - - if (addr >= wired_tlb_virtmem_end) { - for (; addr < eaddr; addr += PAGE_SIZE) - if (pmap_extract(kernel_pmap, - addr) == 0) - return EFAULT; - - if (!kernacc( - (caddr_t)(uintptr_t)uio->uio_offset, c, - uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE)) - return (EFAULT); - } - } - else if (MIPS_IS_KSEG0_ADDR(v)) { - if (MIPS_KSEG0_TO_PHYS(v + c) >= ctob(physmem)) - return (EFAULT); - } - else if (MIPS_IS_KSEG1_ADDR(v)) { - if (MIPS_KSEG1_TO_PHYS(v + c) >= ctob(physmem)) + for (; va < eva; va += PAGE_SIZE) + if (pmap_extract(kernel_pmap, va) == 0) return (EFAULT); - } - else + + prot = (uio->uio_rw == UIO_READ) + ? VM_PROT_READ : VM_PROT_WRITE; + + va = uio->uio_offset; + if (kernacc((void *) va, iov->iov_len, prot) + == FALSE) return (EFAULT); + error = uiomove((void *)va, iov->iov_len, uio); - error = uiomove((caddr_t)v, c, uio); continue; } - } + return (error); } -/*ARGSUSED*/ +/* + * allow user processes to MMAP some memory sections + * instead of going through read/write + */ int -memmmap(struct cdev *dev, vm_ooffset_t off, vm_paddr_t *paddr, +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { + /* + * /dev/mem is the only one that makes sense through this + * interface. For /dev/kmem any physaddr we return here + * could be transient and hence incorrect or invalid at + * a later time. + */ + if (dev2unit(dev) != CDEV_MINOR_MEM) + return (-1); + + *paddr = offset; - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/mips/mips/uio_machdep.c ============================================================================== --- head/sys/mips/mips/uio_machdep.c Fri Apr 16 23:46:30 2010 (r206713) +++ head/sys/mips/mips/uio_machdep.c Fri Apr 16 23:48:28 2010 (r206714) @@ -32,8 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 - * from: src/sys/i386/i386/uio_machdep.c,v 1.8 2005/02/13 23:09:36 alc + * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 */ #include @@ -44,17 +43,18 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include +#include /* - * Implement uiomove(9) from physical memory using sf_bufs to reduce - * the creation and destruction of ephemeral mappings. + * Implement uiomove(9) from physical memory using a combination + * of the direct mapping and sf_bufs to reduce the creation and + * destruction of ephemeral mappings. */ int uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) @@ -64,6 +64,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offs struct iovec *iov; void *cp; vm_offset_t page_offset; + vm_paddr_t pa; + vm_page_t m; size_t cnt; int error = 0; int save = 0; @@ -85,10 +87,16 @@ uiomove_fromphys(vm_page_t ma[], vm_offs if (cnt > n) cnt = n; page_offset = offset & PAGE_MASK; - cnt = min(cnt, PAGE_SIZE - page_offset); - sched_pin(); - sf = sf_buf_alloc(ma[offset >> PAGE_SHIFT], SFB_CPUPRIVATE); - cp = (char *)sf_buf_kva(sf) + page_offset; + cnt = ulmin(cnt, PAGE_SIZE - page_offset); + m = ma[offset >> PAGE_SHIFT]; + pa = VM_PAGE_TO_PHYS(m); + if (pa < MIPS_KSEG0_LARGEST_PHYS) { + cp = (char *)MIPS_PHYS_TO_KSEG0(pa); + sf = NULL; + } else { + sf = sf_buf_alloc(m, 0); + cp = (char *)sf_buf_kva(sf) + page_offset; + } switch (uio->uio_segflg) { case UIO_USERSPACE: if (ticks - PCPU_GET(switchticks) >= hogticks) @@ -98,8 +106,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offs else error = copyin(iov->iov_base, cp, cnt); if (error) { - sf_buf_free(sf); - sched_unpin(); + if (sf != NULL) + sf_buf_free(sf); goto out; } break; @@ -112,8 +120,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offs case UIO_NOCOPY: break; } - sf_buf_free(sf); - sched_unpin(); + if (sf != NULL) + sf_buf_free(sf); iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Apr 16 23:46:30 2010 (r206713) +++ head/sys/mips/mips/vm_machdep.c Fri Apr 16 23:48:28 2010 (r206714) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -63,12 +64,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include -#include #include -#include +#include +#include +#include +#include +#include #include #include @@ -81,26 +85,18 @@ __FBSDID("$FreeBSD$"); static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); -LIST_HEAD(sf_head, sf_buf); - - /* - * A hash table of active sendfile(2) buffers + * Expanded sf_freelist head. Really an SLIST_HEAD() in disguise, with the + * sf_freelist head with the sf_lock mutex. */ -static struct sf_head *sf_buf_active; -static u_long sf_buf_hashmask; - -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) +static struct { + SLIST_HEAD(, sf_buf) sf_head; + struct mtx sf_lock; +} sf_freelist; -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; static u_int sf_buf_alloc_want; /* - * A lock used to synchronize access to the hash table and free list - */ -static struct mtx sf_buf_lock; - -/* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child * ready to run and return to user mode. @@ -471,56 +467,34 @@ sf_buf_init(void *arg) nsfbufs = NSFBUFS; TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); - TAILQ_INIT(&sf_buf_freelist); + mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF); + SLIST_INIT(&sf_freelist.sf_head); sf_base = kmem_alloc_nofault(kernel_map, nsfbufs * PAGE_SIZE); sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, M_NOWAIT | M_ZERO); for (i = 0; i < nsfbufs; i++) { sf_bufs[i].kva = sf_base + i * PAGE_SIZE; - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); + SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list); } sf_buf_alloc_want = 0; - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); } /* - * Allocate an sf_buf for the given vm_page. On this machine, however, there - * is no sf_buf object. Instead, an opaque pointer to the given vm_page is - * returned. + * Get an sf_buf from the freelist. Will block if none are available. */ struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { - struct sf_head *hash_list; struct sf_buf *sf; int error; - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; - mtx_lock(&sf_buf_lock); - LIST_FOREACH(sf, hash_list, list_entry) { - if (sf->m == m) { - sf->ref_count++; - if (sf->ref_count == 1) { - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - } - /* - * Flush all mappings in order to have up to date - * physycal memory - */ - pmap_flush_pvcache(sf->m); - mips_dcache_inv_range(sf->kva, PAGE_SIZE); - goto done; - } - } - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { + mtx_lock(&sf_freelist.sf_lock); + while ((sf = SLIST_FIRST(&sf_freelist.sf_head)) == NULL) { if (flags & SFB_NOWAIT) - goto done; + break; sf_buf_alloc_want++; mbstat.sf_allocwait++; - error = msleep(&sf_buf_freelist, &sf_buf_lock, + error = msleep(&sf_freelist, &sf_freelist.sf_lock, (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); sf_buf_alloc_want--; @@ -528,42 +502,33 @@ sf_buf_alloc(struct vm_page *m, int flag * If we got a signal, don't risk going back to sleep. */ if (error) - goto done; + break; } - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - if (sf->m != NULL) - LIST_REMOVE(sf, list_entry); - LIST_INSERT_HEAD(hash_list, sf, list_entry); - sf->ref_count = 1; - sf->m = m; - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - pmap_qenter(sf->kva, &sf->m, 1); -done: - mtx_unlock(&sf_buf_lock); + if (sf != NULL) { + SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list); + sf->m = m; + nsfbufsused++; + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); + pmap_qenter(sf->kva, &sf->m, 1); + } + mtx_unlock(&sf_freelist.sf_lock); return (sf); } /* - * Free the sf_buf. In fact, do nothing because there are no resources - * associated with the sf_buf. + * Release resources back to the system. */ void sf_buf_free(struct sf_buf *sf) { - mtx_lock(&sf_buf_lock); - sf->ref_count--; - /* - * Make sure all changes in KVA end up in physical memory - */ - mips_dcache_wbinv_range(sf->kva, PAGE_SIZE); - if (sf->ref_count == 0) { - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); - nsfbufsused--; - if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); - } - mtx_unlock(&sf_buf_lock); + + pmap_qremove(sf->kva, 1); + mtx_lock(&sf_freelist.sf_lock); + SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); + nsfbufsused--; + if (sf_buf_alloc_want > 0) + wakeup_one(&sf_freelist); + mtx_unlock(&sf_freelist.sf_lock); } /* From owner-svn-src-head@FreeBSD.ORG Fri Apr 16 23:54:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 926321065672; Fri, 16 Apr 2010 23:54:56 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8281E8FC08; Fri, 16 Apr 2010 23:54:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3GNsuhN085666; Fri, 16 Apr 2010 23:54:56 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3GNsu07085663; Fri, 16 Apr 2010 23:54:56 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004162354.o3GNsu07085663@svn.freebsd.org> From: Juli Mallett Date: Fri, 16 Apr 2010 23:54: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: r206715 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 23:54:56 -0000 Author: jmallett Date: Fri Apr 16 23:54:56 2010 New Revision: 206715 URL: http://svn.freebsd.org/changeset/base/206715 Log: Adjust limits and formats for ABIs with 64-bit longs. Modified: head/sys/mips/include/_inttypes.h head/sys/mips/include/_limits.h Modified: head/sys/mips/include/_inttypes.h ============================================================================== --- head/sys/mips/include/_inttypes.h Fri Apr 16 23:48:28 2010 (r206714) +++ head/sys/mips/include/_inttypes.h Fri Apr 16 23:54:56 2010 (r206715) @@ -38,177 +38,183 @@ * Macros for format specifiers. */ +#if defined(__mips_n64) +#define PRI64 "l" +#else +#define PRI64 "ll" +#endif + /* fprintf(3) macros for signed integers. */ #define PRId8 "d" /* int8_t */ #define PRId16 "d" /* int16_t */ #define PRId32 "d" /* int32_t */ -#define PRId64 "lld" /* int64_t */ +#define PRId64 PRI64"d" /* int64_t */ #define PRIdLEAST8 "d" /* int_least8_t */ #define PRIdLEAST16 "d" /* int_least16_t */ #define PRIdLEAST32 "d" /* int_least32_t */ -#define PRIdLEAST64 "lld" /* int_least64_t */ +#define PRIdLEAST64 PRI64"d" /* int_least64_t */ #define PRIdFAST8 "d" /* int_fast8_t */ #define PRIdFAST16 "d" /* int_fast16_t */ #define PRIdFAST32 "d" /* int_fast32_t */ -#define PRIdFAST64 "lld" /* int_fast64_t */ +#define PRIdFAST64 PRI64"d" /* int_fast64_t */ #define PRIdMAX "jd" /* intmax_t */ -#define PRIdPTR "d" /* intptr_t */ +#define PRIdPTR "ld" /* intptr_t */ #define PRIi8 "i" /* int8_t */ #define PRIi16 "i" /* int16_t */ #define PRIi32 "i" /* int32_t */ -#define PRIi64 "lli" /* int64_t */ +#define PRIi64 PRI64"i" /* int64_t */ #define PRIiLEAST8 "i" /* int_least8_t */ #define PRIiLEAST16 "i" /* int_least16_t */ #define PRIiLEAST32 "i" /* int_least32_t */ -#define PRIiLEAST64 "lli" /* int_least64_t */ +#define PRIiLEAST64 PRI64"i" /* int_least64_t */ #define PRIiFAST8 "i" /* int_fast8_t */ #define PRIiFAST16 "i" /* int_fast16_t */ #define PRIiFAST32 "i" /* int_fast32_t */ -#define PRIiFAST64 "lli" /* int_fast64_t */ +#define PRIiFAST64 PRI64"i" /* int_fast64_t */ #define PRIiMAX "ji" /* intmax_t */ -#define PRIiPTR "i" /* intptr_t */ +#define PRIiPTR "li" /* intptr_t */ /* fprintf(3) macros for unsigned integers. */ #define PRIo8 "o" /* uint8_t */ #define PRIo16 "o" /* uint16_t */ #define PRIo32 "o" /* uint32_t */ -#define PRIo64 "llo" /* uint64_t */ +#define PRIo64 PRI64"o" /* uint64_t */ #define PRIoLEAST8 "o" /* uint_least8_t */ #define PRIoLEAST16 "o" /* uint_least16_t */ #define PRIoLEAST32 "o" /* uint_least32_t */ -#define PRIoLEAST64 "llo" /* uint_least64_t */ +#define PRIoLEAST64 PRI64"o" /* uint_least64_t */ #define PRIoFAST8 "o" /* uint_fast8_t */ #define PRIoFAST16 "o" /* uint_fast16_t */ #define PRIoFAST32 "o" /* uint_fast32_t */ -#define PRIoFAST64 "llo" /* uint_fast64_t */ +#define PRIoFAST64 PRI64"o" /* uint_fast64_t */ #define PRIoMAX "jo" /* uintmax_t */ -#define PRIoPTR "o" /* uintptr_t */ +#define PRIoPTR "lo" /* uintptr_t */ #define PRIu8 "u" /* uint8_t */ #define PRIu16 "u" /* uint16_t */ #define PRIu32 "u" /* uint32_t */ -#define PRIu64 "llu" /* uint64_t */ +#define PRIu64 PRI64"u" /* uint64_t */ #define PRIuLEAST8 "u" /* uint_least8_t */ #define PRIuLEAST16 "u" /* uint_least16_t */ #define PRIuLEAST32 "u" /* uint_least32_t */ -#define PRIuLEAST64 "llu" /* uint_least64_t */ +#define PRIuLEAST64 PRI64"u" /* uint_least64_t */ #define PRIuFAST8 "u" /* uint_fast8_t */ #define PRIuFAST16 "u" /* uint_fast16_t */ #define PRIuFAST32 "u" /* uint_fast32_t */ -#define PRIuFAST64 "llu" /* uint_fast64_t */ +#define PRIuFAST64 PRI64"u" /* uint_fast64_t */ #define PRIuMAX "ju" /* uintmax_t */ -#define PRIuPTR "u" /* uintptr_t */ +#define PRIuPTR "lu" /* uintptr_t */ #define PRIx8 "x" /* uint8_t */ #define PRIx16 "x" /* uint16_t */ #define PRIx32 "x" /* uint32_t */ -#define PRIx64 "llx" /* uint64_t */ +#define PRIx64 PRI64"x" /* uint64_t */ #define PRIxLEAST8 "x" /* uint_least8_t */ #define PRIxLEAST16 "x" /* uint_least16_t */ #define PRIxLEAST32 "x" /* uint_least32_t */ -#define PRIxLEAST64 "llx" /* uint_least64_t */ +#define PRIxLEAST64 PRI64"x" /* uint_least64_t */ #define PRIxFAST8 "x" /* uint_fast8_t */ #define PRIxFAST16 "x" /* uint_fast16_t */ #define PRIxFAST32 "x" /* uint_fast32_t */ -#define PRIxFAST64 "llx" /* uint_fast64_t */ +#define PRIxFAST64 PRI64"x" /* uint_fast64_t */ #define PRIxMAX "jx" /* uintmax_t */ -#define PRIxPTR "x" /* uintptr_t */ +#define PRIxPTR "lx" /* uintptr_t */ #define PRIX8 "X" /* uint8_t */ #define PRIX16 "X" /* uint16_t */ #define PRIX32 "X" /* uint32_t */ -#define PRIX64 "llX" /* uint64_t */ +#define PRIX64 PRI64"X" /* uint64_t */ #define PRIXLEAST8 "X" /* uint_least8_t */ #define PRIXLEAST16 "X" /* uint_least16_t */ #define PRIXLEAST32 "X" /* uint_least32_t */ -#define PRIXLEAST64 "llX" /* uint_least64_t */ +#define PRIXLEAST64 PRI64"X" /* uint_least64_t */ #define PRIXFAST8 "X" /* uint_fast8_t */ #define PRIXFAST16 "X" /* uint_fast16_t */ #define PRIXFAST32 "X" /* uint_fast32_t */ -#define PRIXFAST64 "llX" /* uint_fast64_t */ +#define PRIXFAST64 PRI64"X" /* uint_fast64_t */ #define PRIXMAX "jX" /* uintmax_t */ -#define PRIXPTR "X" /* uintptr_t */ +#define PRIXPTR "lX" /* uintptr_t */ /* fscanf(3) macros for signed integers. */ #define SCNd8 "hhd" /* int8_t */ #define SCNd16 "hd" /* int16_t */ #define SCNd32 "d" /* int32_t */ -#define SCNd64 "lld" /* int64_t */ +#define SCNd64 PRI64"d" /* int64_t */ #define SCNdLEAST8 "hhd" /* int_least8_t */ #define SCNdLEAST16 "hd" /* int_least16_t */ #define SCNdLEAST32 "d" /* int_least32_t */ -#define SCNdLEAST64 "lld" /* int_least64_t */ +#define SCNdLEAST64 PRI64"d" /* int_least64_t */ #define SCNdFAST8 "d" /* int_fast8_t */ #define SCNdFAST16 "d" /* int_fast16_t */ #define SCNdFAST32 "d" /* int_fast32_t */ -#define SCNdFAST64 "lld" /* int_fast64_t */ +#define SCNdFAST64 PRI64"d" /* int_fast64_t */ #define SCNdMAX "jd" /* intmax_t */ -#define SCNdPTR "d" /* intptr_t */ +#define SCNdPTR "ld" /* intptr_t */ #define SCNi8 "hhi" /* int8_t */ #define SCNi16 "hi" /* int16_t */ #define SCNi32 "i" /* int32_t */ -#define SCNi64 "lli" /* int64_t */ +#define SCNi64 PRI64"i" /* int64_t */ #define SCNiLEAST8 "hhi" /* int_least8_t */ #define SCNiLEAST16 "hi" /* int_least16_t */ #define SCNiLEAST32 "i" /* int_least32_t */ -#define SCNiLEAST64 "lli" /* int_least64_t */ +#define SCNiLEAST64 PRI64"i" /* int_least64_t */ #define SCNiFAST8 "i" /* int_fast8_t */ #define SCNiFAST16 "i" /* int_fast16_t */ #define SCNiFAST32 "i" /* int_fast32_t */ -#define SCNiFAST64 "lli" /* int_fast64_t */ +#define SCNiFAST64 PRI64"i" /* int_fast64_t */ #define SCNiMAX "ji" /* intmax_t */ -#define SCNiPTR "i" /* intptr_t */ +#define SCNiPTR "li" /* intptr_t */ /* fscanf(3) macros for unsigned integers. */ #define SCNo8 "hho" /* uint8_t */ #define SCNo16 "ho" /* uint16_t */ #define SCNo32 "o" /* uint32_t */ -#define SCNo64 "llo" /* uint64_t */ +#define SCNo64 PRI64"o" /* uint64_t */ #define SCNoLEAST8 "hho" /* uint_least8_t */ #define SCNoLEAST16 "ho" /* uint_least16_t */ #define SCNoLEAST32 "o" /* uint_least32_t */ -#define SCNoLEAST64 "llo" /* uint_least64_t */ +#define SCNoLEAST64 PRI64"o" /* uint_least64_t */ #define SCNoFAST8 "o" /* uint_fast8_t */ #define SCNoFAST16 "o" /* uint_fast16_t */ #define SCNoFAST32 "o" /* uint_fast32_t */ -#define SCNoFAST64 "llo" /* uint_fast64_t */ +#define SCNoFAST64 PRI64"o" /* uint_fast64_t */ #define SCNoMAX "jo" /* uintmax_t */ -#define SCNoPTR "o" /* uintptr_t */ +#define SCNoPTR "lo" /* uintptr_t */ #define SCNu8 "hhu" /* uint8_t */ #define SCNu16 "hu" /* uint16_t */ #define SCNu32 "u" /* uint32_t */ -#define SCNu64 "llu" /* uint64_t */ +#define SCNu64 PRI64"u" /* uint64_t */ #define SCNuLEAST8 "hhu" /* uint_least8_t */ #define SCNuLEAST16 "hu" /* uint_least16_t */ #define SCNuLEAST32 "u" /* uint_least32_t */ -#define SCNuLEAST64 "llu" /* uint_least64_t */ +#define SCNuLEAST64 PRI64"u" /* uint_least64_t */ #define SCNuFAST8 "u" /* uint_fast8_t */ #define SCNuFAST16 "u" /* uint_fast16_t */ #define SCNuFAST32 "u" /* uint_fast32_t */ -#define SCNuFAST64 "llu" /* uint_fast64_t */ +#define SCNuFAST64 PRI64"u" /* uint_fast64_t */ #define SCNuMAX "ju" /* uintmax_t */ -#define SCNuPTR "u" /* uintptr_t */ +#define SCNuPTR "lu" /* uintptr_t */ #define SCNx8 "hhx" /* uint8_t */ #define SCNx16 "hx" /* uint16_t */ #define SCNx32 "x" /* uint32_t */ -#define SCNx64 "llx" /* uint64_t */ +#define SCNx64 PRI64"x" /* uint64_t */ #define SCNxLEAST8 "hhx" /* uint_least8_t */ #define SCNxLEAST16 "hx" /* uint_least16_t */ #define SCNxLEAST32 "x" /* uint_least32_t */ -#define SCNxLEAST64 "llx" /* uint_least64_t */ +#define SCNxLEAST64 PRI64"x" /* uint_least64_t */ #define SCNxFAST8 "x" /* uint_fast8_t */ #define SCNxFAST16 "x" /* uint_fast16_t */ #define SCNxFAST32 "x" /* uint_fast32_t */ -#define SCNxFAST64 "llx" /* uint_fast64_t */ +#define SCNxFAST64 PRI64"x" /* uint_fast64_t */ #define SCNxMAX "jx" /* uintmax_t */ -#define SCNxPTR "x" /* uintptr_t */ +#define SCNxPTR "lx" /* uintptr_t */ #endif /* !_MACHINE_INTTYPES_H_ */ Modified: head/sys/mips/include/_limits.h ============================================================================== --- head/sys/mips/include/_limits.h Fri Apr 16 23:48:28 2010 (r206714) +++ head/sys/mips/include/_limits.h Fri Apr 16 23:54:56 2010 (r206715) @@ -34,6 +34,10 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ +#if _MIPS_SZLONG == 64 +#define _LARGE_LONG +#endif + /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -76,9 +80,9 @@ #define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ #define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ -#define __SSIZE_MAX __INT_MAX /* max value for a ssize_t */ +#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ -#define __SIZE_T_MAX __UINT_MAX /* max value for a size_t */ +#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ #define __OFF_MAX __LLONG_MAX /* max value for an off_t */ #define __OFF_MIN __LLONG_MIN /* min value for an off_t */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 00:05:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792BE106564A; Sat, 17 Apr 2010 00:05:22 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 688078FC17; Sat, 17 Apr 2010 00:05: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 o3H05MRK088012; Sat, 17 Apr 2010 00:05:22 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H05Mlc088005; Sat, 17 Apr 2010 00:05:22 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170005.o3H05Mlc088005@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 00:05: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: r206716 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 00:05:22 -0000 Author: jmallett Date: Sat Apr 17 00:05:22 2010 New Revision: 206716 URL: http://svn.freebsd.org/changeset/base/206716 Log: o) Remove code related to VM_ALLOC_WIRED_TLB_PG_POOL, VM_KERNEL_ALLOC_OFFSET and floating pages. They are unused and unsupported. Modified: head/sys/mips/include/pmap.h head/sys/mips/include/vmparam.h head/sys/mips/mips/genassym.c head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/include/pmap.h Sat Apr 17 00:05:22 2010 (r206716) @@ -160,14 +160,8 @@ typedef struct pv_entry { extern vm_offset_t phys_avail[PHYS_AVAIL_ENTRIES + 2]; extern vm_offset_t physmem_desc[PHYS_AVAIL_ENTRIES + 2]; -extern char *ptvmmap; /* poor name! */ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -extern pd_entry_t *segbase; - -extern vm_paddr_t mips_wired_tlb_physmem_start; -extern vm_paddr_t mips_wired_tlb_physmem_end; -extern u_int need_wired_tlb_page_pool; #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) @@ -189,37 +183,6 @@ void pmap_update_page(pmap_t pmap, vm_of void pmap_flush_pvcache(vm_page_t m); /* - * floating virtual pages (FPAGES) - * - * These are the reserved virtual memory areas which can be - * mapped to any physical memory. - */ -#define FPAGES 2 -#define FPAGES_SHARED 2 -#define FSPACE ((FPAGES * MAXCPU + FPAGES_SHARED) * PAGE_SIZE) -#define PMAP_FPAGE1 0x00 /* Used by pmap_zero_page & - * pmap_copy_page */ -#define PMAP_FPAGE2 0x01 /* Used by pmap_copy_page */ - -#define PMAP_FPAGE3 0x00 /* Used by pmap_zero_page_idle */ -#define PMAP_FPAGE_KENTER_TEMP 0x01 /* Used by coredump */ - -struct fpage { - vm_offset_t kva; - u_int state; -}; - -struct sysmaps { - struct mtx lock; - struct fpage fp[FPAGES]; -}; - -vm_offset_t -pmap_map_fpage(vm_paddr_t pa, struct fpage *fp, - boolean_t check_unmaped); -void pmap_unmap_fpage(vm_paddr_t pa, struct fpage *fp); - -/* * Function to save TLB contents so that they may be inspected in the debugger. */ extern void pmap_save_tlb(void); Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/include/vmparam.h Sat Apr 17 00:05:22 2010 (r206716) @@ -101,12 +101,8 @@ #define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS #define VM_MAX_ADDRESS ((vm_offset_t)0x80000000) -#ifndef VM_KERNEL_ALLOC_OFFSET -#define VM_KERNEL_ALLOC_OFFSET ((vm_offset_t)0x00000000) -#endif - #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000) -#define VM_KERNEL_WIRED_ADDR_END (VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET) +#define VM_KERNEL_WIRED_ADDR_END (VM_MIN_KERNEL_ADDRESS) #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) /* Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/mips/genassym.c Sat Apr 17 00:05:22 2010 (r206716) @@ -87,7 +87,6 @@ ASSYM(PC_CURPMAP, offsetof(struct pcpu, ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); -ASSYM(VM_KERNEL_ALLOC_OFFSET, VM_KERNEL_ALLOC_OFFSET); ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(SIGFPE, SIGFPE); ASSYM(PAGE_SHIFT, PAGE_SHIFT); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/mips/machdep.c Sat Apr 17 00:05:22 2010 (r206716) @@ -142,10 +142,6 @@ vm_offset_t physmem_desc[PHYS_AVAIL_ENTR struct platform platform; #endif -vm_paddr_t mips_wired_tlb_physmem_start; -vm_paddr_t mips_wired_tlb_physmem_end; -u_int need_wired_tlb_page_pool; - static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/mips/pmap.c Sat Apr 17 00:05:22 2010 (r206716) @@ -161,10 +161,6 @@ static uma_zone_t pvzone; static struct vm_object pvzone_obj; static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; -struct fpage fpages_shared[FPAGES_SHARED]; - -struct sysmaps sysmaps_pcpu[MAXCPU]; - static PMAP_INLINE void free_pv_entry(pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t locked_pmap); static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem); @@ -188,7 +184,6 @@ static int pmap_unuse_pt(pmap_t, vm_offs static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot); static void pmap_TLB_invalidate_kernel(vm_offset_t); static void pmap_TLB_update_kernel(vm_offset_t, pt_entry_t); -static void pmap_init_fpage(void); #ifdef SMP static void pmap_invalidate_page_action(void *arg); @@ -355,7 +350,7 @@ again: kstack0 = pmap_steal_memory(KSTACK_PAGES << PAGE_SHIFT); - virtual_avail = VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET; + virtual_avail = VM_MIN_KERNEL_ADDRESS; virtual_end = VM_MAX_KERNEL_ADDRESS; #ifdef SMP @@ -480,8 +475,6 @@ void pmap_init(void) { - if (need_wired_tlb_page_pool) - pmap_init_fpage(); /* * Initialize the address space (zone) for the pv entries. Set a * high water mark so that the system can recover from excessive @@ -805,136 +798,6 @@ pmap_qremove(vm_offset_t va, int count) * Page table page management routines..... ***************************************************/ -/* - * floating pages (FPAGES) management routines - * - * FPAGES are the reserved virtual memory areas which can be - * mapped to any physical memory. This gets used typically - * in the following functions: - * - * pmap_zero_page - * pmap_copy_page - */ - -/* - * Create the floating pages, aka FPAGES! - */ -static void -pmap_init_fpage() -{ - vm_offset_t kva; - int i, j; - struct sysmaps *sysmaps; - - /* - * We allocate a total of (FPAGES*MAXCPU + FPAGES_SHARED + 1) pages - * at first. FPAGES & FPAGES_SHARED should be EVEN Then we'll adjust - * 'kva' to be even-page aligned so that the fpage area can be wired - * in the TLB with a single TLB entry. - */ - kva = kmem_alloc_nofault(kernel_map, - (FPAGES * MAXCPU + 1 + FPAGES_SHARED) * PAGE_SIZE); - if ((void *)kva == NULL) - panic("pmap_init_fpage: fpage allocation failed"); - - /* - * Make up start at an even page number so we can wire down the - * fpage area in the tlb with a single tlb entry. - */ - if ((((vm_offset_t)kva) >> PGSHIFT) & 1) { - /* - * 'kva' is not even-page aligned. Adjust it and free the - * first page which is unused. - */ - kmem_free(kernel_map, (vm_offset_t)kva, NBPG); - kva = ((vm_offset_t)kva) + NBPG; - } else { - /* - * 'kva' is even page aligned. We don't need the last page, - * free it. - */ - kmem_free(kernel_map, ((vm_offset_t)kva) + FSPACE, NBPG); - } - - for (i = 0; i < MAXCPU; i++) { - sysmaps = &sysmaps_pcpu[i]; - mtx_init(&sysmaps->lock, "SYSMAPS", NULL, MTX_DEF); - - /* Assign FPAGES pages to the CPU */ - for (j = 0; j < FPAGES; j++) - sysmaps->fp[j].kva = kva + (j) * PAGE_SIZE; - kva = ((vm_offset_t)kva) + (FPAGES * PAGE_SIZE); - } - - /* - * An additional 2 pages are needed, one for pmap_zero_page_idle() - * and one for coredump. These pages are shared by all cpu's - */ - fpages_shared[PMAP_FPAGE3].kva = kva; - fpages_shared[PMAP_FPAGE_KENTER_TEMP].kva = kva + PAGE_SIZE; -} - -/* - * Map the page to the fpage virtual address as specified thru' fpage id - */ -vm_offset_t -pmap_map_fpage(vm_paddr_t pa, struct fpage *fp, boolean_t check_unmaped) -{ - vm_offset_t kva; - register pt_entry_t *pte; - pt_entry_t npte; - - KASSERT(curthread->td_pinned > 0, ("curthread not pinned")); - /* - * Check if the fpage is free - */ - if (fp->state) { - if (check_unmaped == TRUE) - pmap_unmap_fpage(pa, fp); - else - panic("pmap_map_fpage: fpage is busy"); - } - fp->state = TRUE; - kva = fp->kva; - - npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pte = pmap_pte(kernel_pmap, kva); - *pte = npte; - - pmap_TLB_update_kernel(kva, npte); - - return (kva); -} - -/* - * Unmap the page from the fpage virtual address as specified thru' fpage id - */ -void -pmap_unmap_fpage(vm_paddr_t pa, struct fpage *fp) -{ - vm_offset_t kva; - register pt_entry_t *pte; - - KASSERT(curthread->td_pinned > 0, ("curthread not pinned")); - /* - * Check if the fpage is busy - */ - if (!(fp->state)) { - panic("pmap_unmap_fpage: fpage is free"); - } - kva = fp->kva; - - pte = pmap_pte(kernel_pmap, kva); - *pte = PTE_G; - pmap_TLB_invalidate_kernel(kva); - - fp->state = FALSE; - - /* - * Should there be any flush operation at the end? - */ -} - /* Revision 1.507 * * Simplify the reference counting of page table pages. Specifically, use @@ -1051,10 +914,6 @@ pmap_pinit(pmap_t pmap) req = VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_ZERO; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) - req |= VM_ALLOC_WIRED_TLB_PG_POOL; -#endif /* * allocate the page directory page */ @@ -1105,10 +964,6 @@ _pmap_allocpte(pmap_t pmap, unsigned pte ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); req = VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) - req |= VM_ALLOC_WIRED_TLB_PG_POOL; -#endif /* * Find or fabricate a new pagetable page */ @@ -1279,7 +1134,7 @@ pmap_growkernel(vm_offset_t addr) mtx_assert(&kernel_map->system_mtx, MA_OWNED); if (kernel_vm_end == 0) { - kernel_vm_end = VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET; + kernel_vm_end = VM_MIN_KERNEL_ADDRESS; nkpt = 0; while (segtab_pde(kernel_segmap, kernel_vm_end)) { kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & @@ -1308,10 +1163,6 @@ pmap_growkernel(vm_offset_t addr) * This index is bogus, but out of the way */ req = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) - req |= VM_ALLOC_WIRED_TLB_PG_POOL; -#endif nkpg = vm_page_alloc(NULL, nkpt, req); if (!nkpg) panic("pmap_growkernel: no memory to grow kernel"); @@ -2155,12 +2006,6 @@ pmap_kenter_temporary(vm_paddr_t pa, int printf("%s: ERROR!!! More than one page of virtual address mapping not supported\n", __func__); -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) { - va = pmap_map_fpage(pa, &fpages_shared[PMAP_FPAGE_KENTER_TEMP], - TRUE); - } else -#endif if (pa < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(pa); } else { @@ -2312,26 +2157,7 @@ pmap_zero_page(vm_page_t m) vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); int int_level; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) { - struct fpage *fp1; - struct sysmaps *sysmaps; - - sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; - mtx_lock(&sysmaps->lock); - sched_pin(); - fp1 = &sysmaps->fp[PMAP_FPAGE1]; - va = pmap_map_fpage(phys, fp1, FALSE); - bzero((caddr_t)va, PAGE_SIZE); - pmap_unmap_fpage(phys, fp1); - sched_unpin(); - mtx_unlock(&sysmaps->lock); - /* - * Should you do cache flush? - */ - } else -#endif if (phys < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(phys); @@ -2358,7 +2184,6 @@ pmap_zero_page(vm_page_t m) sched_unpin(); PMAP_LGMEM_UNLOCK(sysm); } - } /* @@ -2373,24 +2198,7 @@ pmap_zero_page_area(vm_page_t m, int off vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); int int_level; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) { - struct fpage *fp1; - struct sysmaps *sysmaps; - - sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; - mtx_lock(&sysmaps->lock); - sched_pin(); - fp1 = &sysmaps->fp[PMAP_FPAGE1]; - va = pmap_map_fpage(phys, fp1, FALSE); - bzero((caddr_t)va + off, size); - pmap_unmap_fpage(phys, fp1); - - sched_unpin(); - mtx_unlock(&sysmaps->lock); - } else -#endif if (phys < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(phys); bzero((char *)(caddr_t)va + off, size); @@ -2423,15 +2231,7 @@ pmap_zero_page_idle(vm_page_t m) vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); int int_level; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) { - sched_pin(); - va = pmap_map_fpage(phys, &fpages_shared[PMAP_FPAGE3], FALSE); - bzero((caddr_t)va, PAGE_SIZE); - pmap_unmap_fpage(phys, &fpages_shared[PMAP_FPAGE3]); - sched_unpin(); - } else -#endif + if (phys < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(phys); bzero((caddr_t)va, PAGE_SIZE); @@ -2472,95 +2272,67 @@ pmap_copy_page(vm_page_t src, vm_page_t vm_paddr_t phy_src = VM_PAGE_TO_PHYS(src); vm_paddr_t phy_dst = VM_PAGE_TO_PHYS(dst); int int_level; -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - if (need_wired_tlb_page_pool) { - struct fpage *fp1, *fp2; - struct sysmaps *sysmaps; - - sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; - mtx_lock(&sysmaps->lock); - sched_pin(); - - fp1 = &sysmaps->fp[PMAP_FPAGE1]; - fp2 = &sysmaps->fp[PMAP_FPAGE2]; - - va_src = pmap_map_fpage(phy_src, fp1, FALSE); - va_dst = pmap_map_fpage(phy_dst, fp2, FALSE); - - bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE); - - pmap_unmap_fpage(phy_src, fp1); - pmap_unmap_fpage(phy_dst, fp2); - sched_unpin(); - mtx_unlock(&sysmaps->lock); + if ((phy_src < MIPS_KSEG0_LARGEST_PHYS) && (phy_dst < MIPS_KSEG0_LARGEST_PHYS)) { + /* easy case, all can be accessed via KSEG0 */ /* - * Should you flush the cache? + * Flush all caches for VA that are mapped to this page + * to make sure that data in SDRAM is up to date */ - } else -#endif - { - if ((phy_src < MIPS_KSEG0_LARGEST_PHYS) && (phy_dst < MIPS_KSEG0_LARGEST_PHYS)) { - /* easy case, all can be accessed via KSEG0 */ - /* - * Flush all caches for VA that are mapped to this page - * to make sure that data in SDRAM is up to date - */ - pmap_flush_pvcache(src); - mips_dcache_wbinv_range_index( - MIPS_PHYS_TO_KSEG0(phy_dst), NBPG); + pmap_flush_pvcache(src); + mips_dcache_wbinv_range_index( + MIPS_PHYS_TO_KSEG0(phy_dst), NBPG); + va_src = MIPS_PHYS_TO_KSEG0(phy_src); + va_dst = MIPS_PHYS_TO_KSEG0(phy_dst); + bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE); + mips_dcache_wbinv_range(va_dst, PAGE_SIZE); + } else { + int cpu; + struct local_sysmaps *sysm; + + cpu = PCPU_GET(cpuid); + sysm = &sysmap_lmem[cpu]; + PMAP_LGMEM_LOCK(sysm); + sched_pin(); + int_level = disableintr(); + if (phy_src < MIPS_KSEG0_LARGEST_PHYS) { + /* one side needs mapping - dest */ va_src = MIPS_PHYS_TO_KSEG0(phy_src); + sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); + sysm->valid2 = 1; + va_dst = (vm_offset_t)sysm->CADDR2; + } else if (phy_dst < MIPS_KSEG0_LARGEST_PHYS) { + /* one side needs mapping - src */ va_dst = MIPS_PHYS_TO_KSEG0(phy_dst); - bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE); - mips_dcache_wbinv_range(va_dst, PAGE_SIZE); + sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); + va_src = (vm_offset_t)sysm->CADDR1; + sysm->valid1 = 1; } else { - int cpu; - struct local_sysmaps *sysm; - - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - PMAP_LGMEM_LOCK(sysm); - sched_pin(); - int_level = disableintr(); - if (phy_src < MIPS_KSEG0_LARGEST_PHYS) { - /* one side needs mapping - dest */ - va_src = MIPS_PHYS_TO_KSEG0(phy_src); - sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); - sysm->valid2 = 1; - va_dst = (vm_offset_t)sysm->CADDR2; - } else if (phy_dst < MIPS_KSEG0_LARGEST_PHYS) { - /* one side needs mapping - src */ - va_dst = MIPS_PHYS_TO_KSEG0(phy_dst); - sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - va_src = (vm_offset_t)sysm->CADDR1; - sysm->valid1 = 1; - } else { - /* all need mapping */ - sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); - sysm->valid1 = sysm->valid2 = 1; - va_src = (vm_offset_t)sysm->CADDR1; - va_dst = (vm_offset_t)sysm->CADDR2; - } - bcopy((void *)va_src, (void *)va_dst, PAGE_SIZE); - if (sysm->valid1) { - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - sysm->CMAP1 = 0; - sysm->valid1 = 0; - } - if (sysm->valid2) { - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR2); - sysm->CMAP2 = 0; - sysm->valid2 = 0; - } - restoreintr(int_level); - sched_unpin(); - PMAP_LGMEM_UNLOCK(sysm); + /* all need mapping */ + sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); + pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); + sysm->valid1 = sysm->valid2 = 1; + va_src = (vm_offset_t)sysm->CADDR1; + va_dst = (vm_offset_t)sysm->CADDR2; + } + bcopy((void *)va_src, (void *)va_dst, PAGE_SIZE); + if (sysm->valid1) { + pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); + sysm->CMAP1 = 0; + sysm->valid1 = 0; + } + if (sysm->valid2) { + pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR2); + sysm->CMAP2 = 0; + sysm->valid2 = 0; } + restoreintr(int_level); + sched_unpin(); + PMAP_LGMEM_UNLOCK(sysm); } } @@ -3308,11 +3080,6 @@ pmap_kextract(vm_offset_t va) else if (va >= MIPS_KSEG1_START && va < MIPS_KSEG2_START) pa = MIPS_KSEG1_TO_PHYS(va); -#ifdef VM_ALLOC_WIRED_TLB_PG_POOL - else if (need_wired_tlb_page_pool && ((va >= VM_MIN_KERNEL_ADDRESS) && - (va < (VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET)))) - pa = MIPS_KSEG0_TO_PHYS(va); -#endif else if (va >= MIPS_KSEG2_START && va < VM_MAX_KERNEL_ADDRESS) { pt_entry_t *ptep; Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Fri Apr 16 23:54:56 2010 (r206715) +++ head/sys/mips/mips/swtch.S Sat Apr 17 00:05:22 2010 (r206716) @@ -340,7 +340,7 @@ blocked_loop: lw a2, TD_PCB(a1) sw a2, PC_CURPCB(a3) lw v0, TD_REALKSTACK(a1) - li s0, (MIPS_KSEG2_START+VM_KERNEL_ALLOC_OFFSET) # If Uarea addr is below kseg2, + li s0, MIPS_KSEG2_START # If Uarea addr is below kseg2, bltu v0, s0, sw2 # no need to insert in TLB. lw a1, TD_UPTE+0(s7) # t0 = first u. pte lw a2, TD_UPTE+4(s7) # t1 = 2nd u. pte From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 01:17:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4845106567B; Sat, 17 Apr 2010 01:17:31 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2CC48FC2E; Sat, 17 Apr 2010 01:17: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 o3H1HVH9003966; Sat, 17 Apr 2010 01:17:31 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H1HVi0003950; Sat, 17 Apr 2010 01:17:31 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170117.o3H1HVi0003950@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 01:17: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: r206717 - in head: . sys/mips/include sys/mips/mips sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 01:17:31 -0000 Author: jmallett Date: Sat Apr 17 01:17:31 2010 New Revision: 206717 URL: http://svn.freebsd.org/changeset/base/206717 Log: o) Use inline functions to access coprocessor 0 registers rather than external ones implemented using assembly. o) Use TRAPF_USERMODE() consistently rather than USERMODE(). Eliminate as a result. o) Use intr_*() rather than *intr(), consistently. o) Use register_t instead of u_int in some trap code. o) Merge some more endian-related macros to machine/asm.h from NetBSD. o) Add PTR_LI macro, which loads an address with the correct sign-extension for a pointer. o) Restore interrupts when bailing out due to an excessive IRQ in nexus_setup_intr(). o) Remove unused functions from psraccess.S. o) Enter temporary virtual entries for large memory access into the page tables rather than simply hoping they stay resident in the TLB and we don't need to do a refill for them. o) Abstract out large memory mapping setup/teardown using some macros. o) Do mips_dcache_wbinv_range() when using temporary virtual addresses just like we do when we can use the direct map. Deleted: head/sys/mips/include/psl.h Modified: head/ObsoleteFiles.inc head/sys/mips/include/asm.h head/sys/mips/include/cpu.h head/sys/mips/include/db_machdep.h head/sys/mips/include/param.h head/sys/mips/include/profile.h head/sys/mips/include/trap.h head/sys/mips/mips/machdep.c head/sys/mips/mips/mp_machdep.c head/sys/mips/mips/nexus.c head/sys/mips/mips/pmap.c head/sys/mips/mips/psraccess.S head/sys/mips/mips/tick.c head/sys/mips/mips/trap.c head/sys/mips/rmi/clock.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Apr 17 00:05:22 2010 (r206716) +++ head/ObsoleteFiles.inc Sat Apr 17 01:17:31 2010 (r206717) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100416: [mips] removed +.if ${TARGET_ARCH} == "mips" +OLD_FILES+=usr/include/machine/psl.h +.endif # 20100415: [mips] removed unused headers .if ${TARGET_ARCH} == "mips" OLD_FILES+=usr/include/machine/archtype.h Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/asm.h Sat Apr 17 01:17:31 2010 (r206717) @@ -98,23 +98,6 @@ #define _C_LABEL(x) x -/* - * Endian-independent assembly-code aliases for unaligned memory accesses. - */ -#if BYTE_ORDER == LITTLE_ENDIAN -#define LWLO lwl -#define LWHI lwr -#define SWLO swl -#define SWHI swr -#endif - -#if BYTE_ORDER == BIG_ENDIAN -#define LWLO lwr -#define LWHI lwl -#define SWLO swr -#define SWHI swl -#endif - #ifdef USE_AENT #define AENT(x) \ .aent x, 0 @@ -306,28 +289,32 @@ _C_LABEL(x): /* * Call ast if required + * + * XXX Do we really need to disable interrupts? */ #define DO_AST \ 44: \ - PTR_LA s0, _C_LABEL(disableintr) ;\ - jalr s0 ;\ - nop ;\ - move a0, v0 ;\ + mfc0 t0, MIPS_COP_0_STATUS ;\ + and a0, t0, MIPS_SR_INT_IE ;\ + xor t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ GET_CPU_PCPU(s1) ;\ - lw s3, PC_CURPCB(s1) ;\ - lw s1, PC_CURTHREAD(s1) ;\ + PTR_L s3, PC_CURPCB(s1) ;\ + PTR_L s1, PC_CURTHREAD(s1) ;\ lw s2, TD_FLAGS(s1) ;\ li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ and s2, s0 ;\ - PTR_LA s0, _C_LABEL(restoreintr) ;\ - jalr s0 ;\ - nop ;\ + mfc0 t0, MIPS_COP_0_STATUS ;\ + or t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ beq s2, zero, 4f ;\ nop ;\ PTR_LA s0, _C_LABEL(ast) ;\ jalr s0 ;\ PTR_ADDU a0, s3, U_PCB_REGS ;\ - j 44b ;\ + j 44b ;\ nop ;\ 4: @@ -383,6 +370,45 @@ _C_LABEL(x): #define CALLFRAME_RA (CALLFRAME_SIZ - 1 * SZREG) /* + * Endian-independent assembly-code aliases for unaligned memory accesses. + */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +# define LWHI lwr +# define LWLO lwl +# define SWHI swr +# define SWLO swl +# if SZREG == 4 +# define REG_LHI lwr +# define REG_LLO lwl +# define REG_SHI swr +# define REG_SLO swl +# else +# define REG_LHI ldr +# define REG_LLO ldl +# define REG_SHI sdr +# define REG_SLO sdl +# endif +#endif + +#if _BYTE_ORDER == _BIG_ENDIAN +# define LWHI lwl +# define LWLO lwr +# define SWHI swl +# define SWLO swr +# if SZREG == 4 +# define REG_LHI lwl +# define REG_LLO lwr +# define REG_SHI swl +# define REG_SLO swr +# else +# define REG_LHI ldl +# define REG_LLO ldr +# define REG_SHI sdl +# define REG_SLO sdr +# endif +#endif + +/* * While it would be nice to be compatible with the SGI * REG_L and REG_S macros, because they do not take parameters, it * is impossible to use them with the _MIPS_SIM_ABIX32 model. @@ -402,6 +428,7 @@ _C_LABEL(x): #define PTR_SUBIU subu #define PTR_L lw #define PTR_LA la +#define PTR_LI li #define PTR_S sw #define PTR_SLL sll #define PTR_SLLV sllv @@ -424,6 +451,7 @@ _C_LABEL(x): #define PTR_SUBIU dsubu #define PTR_L ld #define PTR_LA dla +#define PTR_LI dli #define PTR_S sd #define PTR_SLL dsll #define PTR_SLLV dsllv @@ -765,7 +793,7 @@ _C_LABEL(x): #endif #define GET_CPU_PCPU(reg) \ - lw reg, _C_LABEL(pcpup); + PTR_L reg, _C_LABEL(pcpup); /* * Description of the setjmp buffer Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/cpu.h Sat Apr 17 01:17:31 2010 (r206717) @@ -47,7 +47,6 @@ #ifndef _MACHINE_CPU_H_ #define _MACHINE_CPU_H_ -#include #include #define MIPS_KSEG0_LARGEST_PHYS 0x20000000 @@ -334,6 +333,7 @@ #define cpu_swapout(p) panic("cpu_swapout: can't get here"); #ifndef _LOCORE +#include #include /* * Arguments to hardclock and gatherstats encapsulate the previous @@ -342,7 +342,6 @@ #define clockframe trapframe /* Use normal trap frame */ #define CLKF_USERMODE(framep) ((framep)->sr & SR_KSU_USER) -#define CLKF_BASEPRI(framep) ((framep)->cpl == 0) #define CLKF_PC(framep) ((framep)->pc) #define CLKF_INTR(framep) (0) #define MIPS_CLKF_INTR() (intr_nesting_level >= 1) @@ -351,6 +350,11 @@ #define cpu_getstack(td) ((td)->td_frame->sp) /* + * A machine-independent interface to the CPU's counter. + */ +#define get_cyclecount() mips_rd_count() + +/* * CPU identification, from PRID register. */ union cpuprid { @@ -542,18 +546,6 @@ extern int intr_nesting_level; * Low level access routines to CPU registers */ -void setsoftintr0(void); -void clearsoftintr0(void); -void setsoftintr1(void); -void clearsoftintr1(void); - - -u_int32_t mips_cp0_status_read(void); -void mips_cp0_status_write(u_int32_t); - -int disableintr(void); -void restoreintr(int); -int enableintr(void); int Mips_TLBGetPID(void); void swi_vm(void *); @@ -562,7 +554,6 @@ void cpu_reset(void); u_int32_t set_intr_mask(u_int32_t); u_int32_t get_intr_mask(void); -u_int32_t get_cyclecount(void); #define cpu_spinwait() /* nothing */ Modified: head/sys/mips/include/db_machdep.h ============================================================================== --- head/sys/mips/include/db_machdep.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/db_machdep.h Sat Apr 17 01:17:31 2010 (r206717) @@ -38,7 +38,6 @@ #define _MIPS_DB_MACHDEP_H_ #include -#include #include #include Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/param.h Sat Apr 17 01:17:31 2010 (r206717) @@ -46,9 +46,7 @@ #include #ifdef _KERNEL -#ifdef _LOCORE -#include -#else +#ifndef _LOCORE #include #endif #endif Modified: head/sys/mips/include/profile.h ============================================================================== --- head/sys/mips/include/profile.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/profile.h Sat Apr 17 01:17:31 2010 (r206717) @@ -84,17 +84,17 @@ #ifdef SMP extern int mcount_lock; #define MCOUNT_ENTER(s) { \ - s = disable_intr(); \ + s = intr_disable(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; \ } #define MCOUNT_EXIT(s) { \ atomic_store_rel_int(&mcount_lock, 0); \ - enableintr(s); \ + intr_restore(s); \ } #else -#define MCOUNT_ENTER(s) { s = disable_intr(); } -#define MCOUNT_EXIT(s) (enableintr(s)) +#define MCOUNT_ENTER(s) { s = intr_disable(); } +#define MCOUNT_EXIT(s) (intr_restore(s)) #endif /* REVISIT for mips */ Modified: head/sys/mips/include/trap.h ============================================================================== --- head/sys/mips/include/trap.h Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/include/trap.h Sat Apr 17 01:17:31 2010 (r206717) @@ -74,17 +74,17 @@ #if !defined(SMP) && (defined(DDB) || defined(DEBUG)) struct trapdebug { /* trap history buffer for debugging */ - u_int status; - u_int cause; - u_int vadr; - u_int pc; - u_int ra; - u_int sp; - u_int code; + register_t status; + register_t cause; + register_t vadr; + register_t pc; + register_t ra; + register_t sp; + register_t code; }; #define trapdebug_enter(x, cd) { \ - intrmask_t s = disableintr(); \ + register_t s = intr_disable(); \ trp->status = x->sr; \ trp->cause = x->cause; \ trp->vadr = x->badvaddr; \ @@ -94,7 +94,7 @@ struct trapdebug { /* trap history buff trp->code = cd; \ if (++trp == &trapdebug[TRAPSIZE]) \ trp = trapdebug; \ - restoreintr(s); \ + intr_restore(s); \ } #define TRAPSIZE 10 /* Trap log buffer length */ @@ -116,7 +116,7 @@ void MipsTLBMissException(void); void MipsUserGenException(void); void MipsUserIntr(void); -u_int trap(struct trapframe *); +register_t trap(struct trapframe *); #ifndef LOCORE /* XXX */ int check_address(void *); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/machdep.c Sat Apr 17 01:17:31 2010 (r206717) @@ -370,11 +370,10 @@ mips_vector_init(void) * when handler is installed for it */ set_intr_mask(ALL_INT_MASK); - enableintr(); + intr_enable(); /* Clear BEV in SR so we start handling our own exceptions */ - mips_cp0_status_write(mips_cp0_status_read() & ~SR_BOOT_EXC_VEC); - + mips_wr_status(mips_rd_status() & ~SR_BOOT_EXC_VEC); } /* @@ -471,7 +470,7 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_intr = disableintr(); + td->td_md.md_saved_intr = intr_disable(); td->td_md.md_spinlock_count++; critical_enter(); } @@ -485,16 +484,7 @@ spinlock_exit(void) critical_exit(); td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - restoreintr(td->td_md.md_saved_intr); -} - -u_int32_t -get_cyclecount(void) -{ - u_int32_t count; - - mfc0_macro(count, 9); - return (count); + intr_restore(td->td_md.md_saved_intr); } /* @@ -503,7 +493,7 @@ get_cyclecount(void) void cpu_idle(int busy) { - if (mips_cp0_status_read() & SR_INT_ENAB) + if (mips_rd_status() & SR_INT_ENAB) __asm __volatile ("wait"); else panic("ints disabled in idleproc!"); Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/mp_machdep.c Sat Apr 17 01:17:31 2010 (r206717) @@ -296,7 +296,7 @@ smp_init_secondary(u_int32_t cpuid) */ mips_wr_compare(mips_rd_count() + counter_freq / hz); - enableintr(); + intr_enable(); /* enter the scheduler */ sched_throw(NULL); Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/nexus.c Sat Apr 17 01:17:31 2010 (r206717) @@ -166,16 +166,19 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { + register_t s; int irq; - intrmask_t s = disableintr(); + s = intr_disable(); irq = rman_get_start(res); - if (irq >= NUM_MIPS_IRQS) + if (irq >= NUM_MIPS_IRQS) { + intr_restore(s); return (0); + } cpu_establish_hardintr(device_get_nameunit(child), filt, intr, arg, irq, flags, cookiep); - restoreintr(s); + intr_restore(s); return (0); } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/pmap.c Sat Apr 17 01:17:31 2010 (r206717) @@ -194,10 +194,7 @@ static void pmap_update_page_action(void struct local_sysmaps { struct mtx lock; - pt_entry_t CMAP1; - pt_entry_t CMAP2; - caddr_t CADDR1; - caddr_t CADDR2; + vm_offset_t base; uint16_t valid1, valid2; }; @@ -211,6 +208,59 @@ struct local_sysmaps { static struct local_sysmaps sysmap_lmem[MAXCPU]; caddr_t virtual_sys_start = (caddr_t)0; +#define PMAP_LMEM_MAP1(va, phys) \ + int cpu; \ + struct local_sysmaps *sysm; \ + pt_entry_t *pte, npte; \ + \ + cpu = PCPU_GET(cpuid); \ + sysm = &sysmap_lmem[cpu]; \ + PMAP_LGMEM_LOCK(sysm); \ + intr = intr_disable(); \ + sched_pin(); \ + va = sysm->base; \ + npte = mips_paddr_to_tlbpfn(phys) | \ + PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + pte = pmap_pte(kernel_pmap, va); \ + *pte = npte; \ + sysm->valid1 = 1; + +#define PMAP_LMEM_MAP2(va1, phys1, va2, phys2) \ + int cpu; \ + struct local_sysmaps *sysm; \ + pt_entry_t *pte, npte; \ + \ + cpu = PCPU_GET(cpuid); \ + sysm = &sysmap_lmem[cpu]; \ + PMAP_LGMEM_LOCK(sysm); \ + intr = intr_disable(); \ + sched_pin(); \ + va1 = sysm->base; \ + va2 = sysm->base + PAGE_SIZE; \ + npte = mips_paddr_to_tlbpfn(phys2) | \ + PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + pte = pmap_pte(kernel_pmap, va1); \ + *pte = npte; \ + npte = mips_paddr_to_tlbpfn(phys2) | \ + PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + pte = pmap_pte(kernel_pmap, va2); \ + *pte = npte; \ + sysm->valid1 = 1; \ + sysm->valid2 = 1; + +#define PMAP_LMEM_UNMAP() \ + pte = pmap_pte(kernel_pmap, sysm->base); \ + *pte = PTE_G; \ + pmap_invalidate_page(kernel_pmap, sysm->base); \ + sysm->valid1 = 0; \ + pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE); \ + *pte = PTE_G; \ + pmap_invalidate_page(kernel_pmap, sysm->base + PAGE_SIZE); \ + sysm->valid2 = 0; \ + sched_unpin(); \ + intr_restore(intr); \ + PMAP_LGMEM_UNLOCK(sysm); + pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va) { @@ -382,12 +432,8 @@ again: */ if (memory_larger_than_512meg) { for (i = 0; i < MAXCPU; i++) { - sysmap_lmem[i].CMAP1 = PTE_G; - sysmap_lmem[i].CMAP2 = PTE_G; - sysmap_lmem[i].CADDR1 = (caddr_t)virtual_avail; - virtual_avail += PAGE_SIZE; - sysmap_lmem[i].CADDR2 = (caddr_t)virtual_avail; - virtual_avail += PAGE_SIZE; + sysmap_lmem[i].base = virtual_avail; + virtual_avail += PAGE_SIZE * 2; sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0; PMAP_LGMEM_LOCK_INIT(&sysmap_lmem[i]); } @@ -2001,7 +2047,7 @@ void * pmap_kenter_temporary(vm_paddr_t pa, int i) { vm_offset_t va; - int int_level; + register_t intr; if (i != 0) printf("%s: ERROR!!! More than one page of virtual address mapping not supported\n", __func__); @@ -2011,20 +2057,24 @@ pmap_kenter_temporary(vm_paddr_t pa, int } else { int cpu; struct local_sysmaps *sysm; + pt_entry_t *pte, npte; + /* If this is used other than for dumps, we may need to leave * interrupts disasbled on return. If crash dumps don't work when * we get to this point, we might want to consider this (leaving things * disabled as a starting point ;-) */ - int_level = disableintr(); + intr = intr_disable(); cpu = PCPU_GET(cpuid); sysm = &sysmap_lmem[cpu]; /* Since this is for the debugger, no locks or any other fun */ - sysm->CMAP1 = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + pte = pmap_pte(kernel_pmap, sysm->base); + *pte = npte; sysm->valid1 = 1; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - va = (vm_offset_t)sysm->CADDR1; - restoreintr(int_level); + pmap_update_page(kernel_pmap, sysm->base, npte); + va = sysm->base; + intr_restore(intr); } return ((void *)va); } @@ -2033,7 +2083,7 @@ void pmap_kenter_temporary_free(vm_paddr_t pa) { int cpu; - int int_level; + register_t intr; struct local_sysmaps *sysm; if (pa < MIPS_KSEG0_LARGEST_PHYS) { @@ -2043,10 +2093,13 @@ pmap_kenter_temporary_free(vm_paddr_t pa cpu = PCPU_GET(cpuid); sysm = &sysmap_lmem[cpu]; if (sysm->valid1) { - int_level = disableintr(); - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - restoreintr(int_level); - sysm->CMAP1 = 0; + pt_entry_t *pte; + + intr = intr_disable(); + pte = pmap_pte(kernel_pmap, sysm->base); + *pte = PTE_G; + pmap_invalidate_page(kernel_pmap, sysm->base); + intr_restore(intr); sysm->valid1 = 0; } } @@ -2156,33 +2209,20 @@ pmap_zero_page(vm_page_t m) { vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - int int_level; + register_t intr; if (phys < MIPS_KSEG0_LARGEST_PHYS) { - va = MIPS_PHYS_TO_KSEG0(phys); bzero((caddr_t)va, PAGE_SIZE); mips_dcache_wbinv_range(va, PAGE_SIZE); } else { - int cpu; - struct local_sysmaps *sysm; + PMAP_LMEM_MAP1(va, phys); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - PMAP_LGMEM_LOCK(sysm); - sched_pin(); - int_level = disableintr(); - sysm->CMAP1 = mips_paddr_to_tlbpfn(phys) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - sysm->valid1 = 1; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - bzero(sysm->CADDR1, PAGE_SIZE); - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - restoreintr(int_level); - sysm->CMAP1 = 0; - sysm->valid1 = 0; - sched_unpin(); - PMAP_LGMEM_UNLOCK(sysm); + bzero((caddr_t)va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); + + PMAP_LMEM_UNMAP(); } } @@ -2197,31 +2237,19 @@ pmap_zero_page_area(vm_page_t m, int off { vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - int int_level; + register_t intr; if (phys < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(phys); bzero((char *)(caddr_t)va + off, size); mips_dcache_wbinv_range(va + off, size); } else { - int cpu; - struct local_sysmaps *sysm; + PMAP_LMEM_MAP1(va, phys); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - PMAP_LGMEM_LOCK(sysm); - int_level = disableintr(); - sched_pin(); - sysm->CMAP1 = mips_paddr_to_tlbpfn(phys) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - sysm->valid1 = 1; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - bzero((char *)sysm->CADDR1 + off, size); - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - restoreintr(int_level); - sysm->CMAP1 = 0; - sysm->valid1 = 0; - sched_unpin(); - PMAP_LGMEM_UNLOCK(sysm); + bzero((char *)va + off, size); + mips_dcache_wbinv_range(va + off, size); + + PMAP_LMEM_UNMAP(); } } @@ -2230,33 +2258,20 @@ pmap_zero_page_idle(vm_page_t m) { vm_offset_t va; vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - int int_level; + register_t intr; if (phys < MIPS_KSEG0_LARGEST_PHYS) { va = MIPS_PHYS_TO_KSEG0(phys); bzero((caddr_t)va, PAGE_SIZE); mips_dcache_wbinv_range(va, PAGE_SIZE); } else { - int cpu; - struct local_sysmaps *sysm; + PMAP_LMEM_MAP1(va, phys); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - PMAP_LGMEM_LOCK(sysm); - int_level = disableintr(); - sched_pin(); - sysm->CMAP1 = mips_paddr_to_tlbpfn(phys) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - sysm->valid1 = 1; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - bzero(sysm->CADDR1, PAGE_SIZE); - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - restoreintr(int_level); - sysm->CMAP1 = 0; - sysm->valid1 = 0; - sched_unpin(); - PMAP_LGMEM_UNLOCK(sysm); - } + bzero((caddr_t)va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); + PMAP_LMEM_UNMAP(); + } } /* @@ -2271,7 +2286,7 @@ pmap_copy_page(vm_page_t src, vm_page_t vm_offset_t va_src, va_dst; vm_paddr_t phy_src = VM_PAGE_TO_PHYS(src); vm_paddr_t phy_dst = VM_PAGE_TO_PHYS(dst); - int int_level; + register_t intr; if ((phy_src < MIPS_KSEG0_LARGEST_PHYS) && (phy_dst < MIPS_KSEG0_LARGEST_PHYS)) { /* easy case, all can be accessed via KSEG0 */ @@ -2281,58 +2296,18 @@ pmap_copy_page(vm_page_t src, vm_page_t */ pmap_flush_pvcache(src); mips_dcache_wbinv_range_index( - MIPS_PHYS_TO_KSEG0(phy_dst), NBPG); + MIPS_PHYS_TO_KSEG0(phy_dst), PAGE_SIZE); va_src = MIPS_PHYS_TO_KSEG0(phy_src); va_dst = MIPS_PHYS_TO_KSEG0(phy_dst); bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE); mips_dcache_wbinv_range(va_dst, PAGE_SIZE); } else { - int cpu; - struct local_sysmaps *sysm; + PMAP_LMEM_MAP2(va_src, phy_src, va_dst, phy_dst); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - PMAP_LGMEM_LOCK(sysm); - sched_pin(); - int_level = disableintr(); - if (phy_src < MIPS_KSEG0_LARGEST_PHYS) { - /* one side needs mapping - dest */ - va_src = MIPS_PHYS_TO_KSEG0(phy_src); - sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); - sysm->valid2 = 1; - va_dst = (vm_offset_t)sysm->CADDR2; - } else if (phy_dst < MIPS_KSEG0_LARGEST_PHYS) { - /* one side needs mapping - src */ - va_dst = MIPS_PHYS_TO_KSEG0(phy_dst); - sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - va_src = (vm_offset_t)sysm->CADDR1; - sysm->valid1 = 1; - } else { - /* all need mapping */ - sysm->CMAP1 = mips_paddr_to_tlbpfn(phy_src) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - sysm->CMAP2 = mips_paddr_to_tlbpfn(phy_dst) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR1, sysm->CMAP1); - pmap_TLB_update_kernel((vm_offset_t)sysm->CADDR2, sysm->CMAP2); - sysm->valid1 = sysm->valid2 = 1; - va_src = (vm_offset_t)sysm->CADDR1; - va_dst = (vm_offset_t)sysm->CADDR2; - } bcopy((void *)va_src, (void *)va_dst, PAGE_SIZE); - if (sysm->valid1) { - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR1); - sysm->CMAP1 = 0; - sysm->valid1 = 0; - } - if (sysm->valid2) { - pmap_TLB_invalidate_kernel((vm_offset_t)sysm->CADDR2); - sysm->CMAP2 = 0; - sysm->valid2 = 0; - } - restoreintr(int_level); - sched_unpin(); - PMAP_LGMEM_UNLOCK(sysm); + mips_dcache_wbinv_range(va_dst, PAGE_SIZE); + + PMAP_LMEM_UNMAP(); } } @@ -3085,34 +3060,11 @@ pmap_kextract(vm_offset_t va) /* Is the kernel pmap initialized? */ if (kernel_pmap->pm_active) { - if (va >= (vm_offset_t)virtual_sys_start) { - /* Its inside the virtual address range */ - ptep = pmap_pte(kernel_pmap, va); - if (ptep) - pa = mips_tlbpfn_to_paddr(*ptep) | - (va & PAGE_MASK); - } else { - int i; - - /* - * its inside the special mapping area, I - * don't think this should happen, but if it - * does I want it toa all work right :-) - * Note if it does happen, we assume the - * caller has the lock? FIXME, this needs to - * be checked FIXEM - RRS. - */ - for (i = 0; i < MAXCPU; i++) { - if ((sysmap_lmem[i].valid1) && ((vm_offset_t)sysmap_lmem[i].CADDR1 == va)) { - pa = mips_tlbpfn_to_paddr(sysmap_lmem[i].CMAP1); - break; - } - if ((sysmap_lmem[i].valid2) && ((vm_offset_t)sysmap_lmem[i].CADDR2 == va)) { - pa = mips_tlbpfn_to_paddr(sysmap_lmem[i].CMAP2); - break; - } - } - } + /* Its inside the virtual address range */ + ptep = pmap_pte(kernel_pmap, va); + if (ptep) + pa = mips_tlbpfn_to_paddr(*ptep) | + (va & PAGE_MASK); } } return pa; Modified: head/sys/mips/mips/psraccess.S ============================================================================== --- head/sys/mips/mips/psraccess.S Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/psraccess.S Sat Apr 17 01:17:31 2010 (r206717) @@ -53,109 +53,6 @@ .set noreorder # Noreorder is default style! -/* - * Set/clear software interrupt. - */ - -LEAF(setsoftintr0) - mfc0 v0, COP_0_CAUSE_REG # read cause register - nop - or v0, v0, SOFT_INT_MASK_0 # set soft clock interrupt - mtc0 v0, COP_0_CAUSE_REG # save it - j ra - nop -END(setsoftintr0) - -LEAF(clearsoftintr0) - mfc0 v0, COP_0_CAUSE_REG # read cause register - nop - and v0, v0, ~SOFT_INT_MASK_0 # clear soft clock interrupt - mtc0 v0, COP_0_CAUSE_REG # save it - j ra - nop -END(clearsoftintr0) - -LEAF(setsoftintr1) - mfc0 v0, COP_0_CAUSE_REG # read cause register - nop - or v0, v0, SOFT_INT_MASK_1 # set soft net interrupt - mtc0 v0, COP_0_CAUSE_REG # save it - j ra - nop -END(setsoftintr1) - -LEAF(clearsoftintr1) - mfc0 v0, COP_0_CAUSE_REG # read cause register - nop - and v0, v0, ~SOFT_INT_MASK_1 # clear soft net interrupt - mtc0 v0, COP_0_CAUSE_REG # save it - j ra - nop -END(clearsoftintr1) - -/* - * Set/change interrupt priority routines. - * These routines return the previous state. - */ -LEAF(restoreintr) - mfc0 t0,COP_0_STATUS_REG - and t1,t0,SR_INT_ENAB - beq a0,t1,1f - xor t0,SR_INT_ENAB - - .set noreorder - - mtc0 t0,COP_0_STATUS_REG - nop - nop - nop - nop -1: - j ra - nop -END(restoreintr) - -/* - * Set/change interrupt priority routines. - * These routines return the previous state. - */ - -LEAF(enableintr) -#ifdef TARGET_OCTEON - .set mips64r2 - ei v0 - and v0, SR_INT_ENAB # return old interrupt enable bit - .set mips0 -#else - mfc0 v0, COP_0_STATUS_REG # read status register - nop - or v1, v0, SR_INT_ENAB - mtc0 v1, COP_0_STATUS_REG # enable all interrupts - and v0, SR_INT_ENAB # return old interrupt enable -#endif - j ra - nop -END(enableintr) - - -LEAF(disableintr) -#ifdef TARGET_OCTEON - .set mips64r2 - di v0 - and v0, SR_INT_ENAB # return old interrupt enable bit - .set mips0 -#else - mfc0 v0, COP_0_STATUS_REG # read status register - nop - and v1, v0, ~SR_INT_ENAB - mtc0 v1, COP_0_STATUS_REG # disable all interrupts - MIPS_CPU_NOP_DELAY - and v0, SR_INT_ENAB # return old interrupt enable -#endif - j ra - nop -END(disableintr) - LEAF(set_intr_mask) li t0, SR_INT_MASK # 1 means masked so invert. not a0, a0 # 1 means masked so invert. @@ -182,17 +79,3 @@ LEAF(get_intr_mask) nop END(get_intr_mask) - -/* - * u_int32_t mips_cp0_config1_read(void) - * - * Return the current value of the CP0 Config (Select 1) register. - */ -LEAF(mips_cp0_config1_read) - .set push - .set mips32 - mfc0 v0, COP_0_CONFIG, 1 - j ra - nop - .set pop -END(mips_cp0_config1_read) Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/tick.c Sat Apr 17 01:17:31 2010 (r206717) @@ -301,16 +301,16 @@ clock_intr(void *arg) if (cpu_ticks->hard_ticks >= cycles_per_hz) { cpu_ticks->hard_ticks -= cycles_per_hz; if (PCPU_GET(cpuid) == 0) - hardclock(USERMODE(tf->sr), tf->pc); + hardclock(TRAPF_USERMODE(tf), tf->pc); else - hardclock_cpu(USERMODE(tf->sr)); + hardclock_cpu(TRAPF_USERMODE(tf)); } /* Fire statclock at stathz. */ cpu_ticks->stat_ticks += delta; if (cpu_ticks->stat_ticks >= cycles_per_stathz) { cpu_ticks->stat_ticks -= cycles_per_stathz; - statclock(USERMODE(tf->sr)); + statclock(TRAPF_USERMODE(tf)); } /* Fire profclock at profhz, but only when needed. */ @@ -318,7 +318,7 @@ clock_intr(void *arg) if (cpu_ticks->prof_ticks >= cycles_per_profhz) { cpu_ticks->prof_ticks -= cycles_per_profhz; if (profprocs != 0) - profclock(USERMODE(tf->sr), tf->pc); + profclock(TRAPF_USERMODE(tf), tf->pc); } critical_exit(); #if 0 /* TARGET_OCTEON */ Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Apr 17 00:05:22 2010 (r206716) +++ head/sys/mips/mips/trap.c Sat Apr 17 01:17:31 2010 (r206717) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -272,7 +271,7 @@ extern char *syscallnames[]; * In the case of a kernel trap, we return the pc where to resume if * p->p_addr->u_pcb.pcb_onfault is set, otherwise, return old pc. */ -u_int +register_t trap(struct trapframe *trapframe) { int type, usermode; @@ -293,7 +292,7 @@ trap(struct trapframe *trapframe) trapdebug_enter(trapframe, 0); type = (trapframe->cause & CR_EXC_CODE) >> CR_EXC_CODE_SHIFT; - if (USERMODE(trapframe->sr)) { + if (TRAPF_USERMODE(trapframe)) { type |= T_USER; usermode = 1; } else { @@ -307,9 +306,9 @@ trap(struct trapframe *trapframe) */ if (trapframe->sr & SR_INT_ENAB) { set_intr_mask(~(trapframe->sr & ALL_INT_MASK)); - enableintr(); + intr_enable(); } else { - disableintr(); + intr_disable(); } #ifdef TRAP_DEBUG @@ -983,9 +982,10 @@ out: void trapDump(char *msg) { - int i, s; + register_t s; + int i; - s = disableintr(); + s = intr_disable(); printf("trapDump(%s)\n", msg); for (i = 0; i < TRAPSIZE; i++) { if (trp == trapdebug) { @@ -1003,9 +1003,8 @@ trapDump(char *msg) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 01:49:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED091065679; Sat, 17 Apr 2010 01:49:50 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4F9E8FC19; Sat, 17 Apr 2010 01: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 o3H1noXv011020; Sat, 17 Apr 2010 01:49:50 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H1nohX011017; Sat, 17 Apr 2010 01:49:50 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170149.o3H1nohX011017@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 01: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: r206718 - in head/sys/mips: conf mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 01:49:51 -0000 Author: jmallett Date: Sat Apr 17 01:49:50 2010 New Revision: 206718 URL: http://svn.freebsd.org/changeset/base/206718 Log: o) Back out my previous change to SWARM; some of it was to address an issue that turned out to be unrelated, and the rest was, as pointed out by Neel, just wrong-headed. o) Tweak mem.c to fix use of /dev/kmem for direct-mapped addresses. Modified: head/sys/mips/conf/SWARM head/sys/mips/mips/mem.c Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Sat Apr 17 01:17:31 2010 (r206717) +++ head/sys/mips/conf/SWARM Sat Apr 17 01:49:50 2010 (r206718) @@ -19,13 +19,8 @@ options CFE_CONSOLE options CFE_ENV options ALT_BREAK_TO_DEBUGGER -# Don't build any modules yet. -makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions LDSCRIPT_NAME= ldscript.mips.cfe -makeoptions KERNLOADADDR=0x81000000 - #cpu CPU_MIPS64 #options ISA_MIPS64 #makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Sat Apr 17 01:17:31 2010 (r206717) +++ head/sys/mips/mips/mem.c Sat Apr 17 01:49:50 2010 (r206718) @@ -120,21 +120,23 @@ memrw(struct cdev *dev, struct uio *uio, * Make sure that all the pages are currently resident * so that we don't create any zero-fill pages. */ - - for (; va < eva; va += PAGE_SIZE) - if (pmap_extract(kernel_pmap, va) == 0) + if (va >= VM_MIN_KERNEL_ADDRESS && + eva <= VM_MAX_KERNEL_ADDRESS) { + for (; va < eva; va += PAGE_SIZE) + if (pmap_extract(kernel_pmap, va) == 0) + return (EFAULT); + + prot = (uio->uio_rw == UIO_READ) + ? VM_PROT_READ : VM_PROT_WRITE; + + va = uio->uio_offset; + if (kernacc((void *) va, iov->iov_len, prot) + == FALSE) return (EFAULT); - - prot = (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE; + } va = uio->uio_offset; - if (kernacc((void *) va, iov->iov_len, prot) - == FALSE) - return (EFAULT); - error = uiomove((void *)va, iov->iov_len, uio); - continue; } } From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 03:08:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8050E106564A; Sat, 17 Apr 2010 03:08:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CEFF8FC14; Sat, 17 Apr 2010 03:08: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 o3H38DuT028614; Sat, 17 Apr 2010 03:08:13 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H38DMI028603; Sat, 17 Apr 2010 03:08:13 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170308.o3H38DMI028603@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 03:08: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: r206721 - in head/sys/mips: cavium cavium/dev/rgmii mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 03:08:13 -0000 Author: jmallett Date: Sat Apr 17 03:08:13 2010 New Revision: 206721 URL: http://svn.freebsd.org/changeset/base/206721 Log: o) Add SMP support for Octeon using U-Boot to launch all the processors at the same time. o) Remove some unused trivial uart functions from octeon_machdep now that the uart part is fully working and they are unused. o) Use __func__ instead of __FUNCTION__. o) Use intr_*() instead of other routines that do the same thing. o) Remove some duplicate printfs from the Octeon port, as well as duplicate setting of Maxmem. o) Use the right frequency divider on Octeon. o) Use PCPU_GET(cpuid) consistently to get the cpuid of the running core. o) Remove some unused macros in the Octeon port. o) Use mips_sync() around use of the global dpcpu, whose value may not be visible to APs at first. o) When loading the first thread's stack, use macros to make the code correct for n64 as well. o) Remove stub, do-nothing FAU init/enable/disable functions from the RGMX driver. Added: head/sys/mips/cavium/octeon_mp.c (contents, props changed) Deleted: head/sys/mips/cavium/dev/rgmii/octeon_fau.c Modified: head/sys/mips/cavium/asm_octeon.S head/sys/mips/cavium/dev/rgmii/octeon_fau.h head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_pcmap_regs.h head/sys/mips/mips/locore.S head/sys/mips/mips/mp_machdep.c head/sys/mips/mips/mpboot.S Modified: head/sys/mips/cavium/asm_octeon.S ============================================================================== --- head/sys/mips/cavium/asm_octeon.S Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/asm_octeon.S Sat Apr 17 03:08:13 2010 (r206721) @@ -1,182 +1,66 @@ -/***********************license start*************** - * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights - * reserved. +/*- + * Copyright (c) 2004-2010 Juli Mallett + * 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. * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * 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. - * - * * Neither the name of Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * - ***********************license end**************************************/ - -/* $FreeBSD$ */ + * $FreeBSD$ + */ #include -#include -#include -#include -#include - -#include "assym.s" - - -#define CPU_DISABLE_INTERRUPTS(reg, reg2, reg3) \ - mfc0 reg, MIPS_COP_0_STATUS; \ - nop; \ - move reg3, reg; \ - li reg2, ~MIPS_SR_INT_IE; \ - and reg, reg2, reg; \ - mtc0 reg, MIPS_COP_0_STATUS; \ - COP0_SYNC + .set noreorder - - -#define CPU_ENABLE_INTERRUPTS(reg, reg3) \ - mfc0 reg, MIPS_COP_0_STATUS; \ - nop; \ - or reg, reg, reg3; \ - mtc0 reg, MIPS_COP_0_STATUS; \ - COP0_SYNC - - -#define PUSHR(reg) \ - addiu sp,sp,-16 ; \ - sd reg, 8(sp) ; \ - nop ; - -#define POPR(reg) \ - ld reg, 8(sp) ; \ - addiu sp,sp,16 ; \ - nop ; - - - - +#ifdef SMP /* - * octeon_ciu_get_interrupt_reg_addr - * - * Given Int-X, En-X combination, return the CIU Interrupt Enable Register addr - * a0 = ciu Int-X: 0/1 - * a1 = ciu EN-0: 0/1 + * This function must be implemented in assembly because it is called early + * in AP boot without a valid stack. */ -LEAF(octeon_ciu_get_interrupt_reg_addr) - .set noreorder - .set mips3 - - beqz a0, ciu_get_interrupt_reg_addr_Int_0 - nop - -ciu_get_interrupt_reg_addr_Int_1: - beqz a1, ciu_get_interrupt_reg_addr_Int_1_En_0 - nop - -ciu_get_interrupt_reg_addr_Int_1_En1: - li a0, OCTEON_CIU_ADDR_HI - dsll32 a0, a0, 0 - nop - ori a0, OCTEON_CIU_EN1_INT1_LO - j ciu_get_interrupt_reg_addr_ret - nop - -ciu_get_interrupt_reg_addr_Int_1_En_0: - li a0, OCTEON_CIU_ADDR_HI - dsll32 a0, a0, 0 - nop - ori a0, OCTEON_CIU_EN0_INT1_LO - j ciu_get_interrupt_reg_addr_ret - nop - -ciu_get_interrupt_reg_addr_Int_0: - beqz a1, ciu_get_interrupt_reg_addr_Int_0_En_0 - nop - -ciu_get_interrupt_reg_addr_Int_0_En_1: - li a0, OCTEON_CIU_ADDR_HI - dsll32 a0, a0, 0 - nop - ori a0, OCTEON_CIU_EN1_INT0_LO - j ciu_get_interrupt_reg_addr_ret - nop - -ciu_get_interrupt_reg_addr_Int_0_En_0: - li a0, OCTEON_CIU_ADDR_HI - dsll32 a0, a0, 0 - nop - ori a0, OCTEON_CIU_EN0_INT0_LO - - -ciu_get_interrupt_reg_addr_ret: - j ra - nop - - .set mips0 - .set reorder -END(octeon_ciu_get_interrupt_reg_addr) +LEAF(platform_processor_id) + .set push + .set mips32r2 + jr ra + rdhwr v0, $0 + .set pop +END(platform_processor_id) - - /* - * octeon_ciu_mask_all_interrupts - * - * a0 = ciu Interrupt-X: 0/1 - * a1 = ciu Enable-X: 0/1 + * Called on APs to wait until they are told to launch. */ -LEAF(octeon_ciu_mask_all_interrupts) - .set noreorder - .set mips3 - - PUSHR(ra) - PUSHR(s0) - - move t0, a0 - move t1, a1 - li a0, MIPS_SR_INT_IE - CPU_DISABLE_INTERRUPTS(a2, a1, s0) - move a0, t0 - move t1, a1 - jal octeon_ciu_get_interrupt_reg_addr - nop - ld a2, 0(a0) # Dummy read - nop - move a2, zero # Clear all - sd a2, 0(a0) # Write new Enable bits - nop - CPU_ENABLE_INTERRUPTS(a2, s0) - - POPR(s0) - POPR(ra) - j ra # Return - nop # (bd slot) - - .set mips0 - .set reorder -END(octeon_ciu_mask_all_interrupts) - +LEAF(octeon_ap_wait) + jal platform_processor_id + nop + +1: ll t0, octeon_ap_boot + bne v0, t0, 1b + nop + + move t0, zero + sc t0, octeon_ap_boot + + beqz t0, 1b + nop + + j mpentry + nop +END(octeon_ap_wait) +#endif Modified: head/sys/mips/cavium/dev/rgmii/octeon_fau.h ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_fau.h Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/dev/rgmii/octeon_fau.h Sat Apr 17 03:08:13 2010 (r206721) @@ -217,9 +217,4 @@ static inline void octeon_fau_atomic_add } -extern void octeon_fau_init(void); -extern void octeon_fau_enable(void); -extern void octeon_fau_disable(void); - - #endif /* ___OCTEON_FAU__H___ */ Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c Sat Apr 17 03:08:13 2010 (r206721) @@ -1481,7 +1481,7 @@ static void octeon_config_hw_units_post_ oct_write64(OCTEON_POW_WORKQUEUE_INT_THRESHOLD(OCTEON_POW_RX_GROUP_NUM), thr.word64); #endif - ciu_enable_interrupts(OCTEON_CORE_ID, OCTEON_RGMX_CIU_INTX, OCTEON_RGMX_CIU_ENX, + ciu_enable_interrupts(PCPU_GET(cpuid), OCTEON_RGMX_CIU_INTX, OCTEON_RGMX_CIU_ENX, (OCTEON_POW_RX_GROUP_MASK | CIU_GENTIMER_BITS_ENABLE(CIU_GENTIMER_NUM_1)), CIU_MIPS_IP2); Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/files.octeon1 Sat Apr 17 03:08:13 2010 (r206721) @@ -1,8 +1,7 @@ # $FreeBSD$ # Octeon Support Files # -mips/mips/mp_machdep.c optional smp -mips/cavium/dev/rgmii/octeon_fau.c optional rgmii +mips/cavium/asm_octeon.S optional smp mips/cavium/dev/rgmii/octeon_fpa.c optional rgmii mips/cavium/dev/rgmii/octeon_ipd.c optional rgmii mips/cavium/dev/rgmii/octeon_pko.c optional rgmii @@ -10,6 +9,7 @@ mips/cavium/dev/rgmii/octeon_rgmx.c opt mips/cavium/obio.c optional uart mips/cavium/octeon_ebt3000_cf.c optional cf mips/cavium/octeon_machdep.c standard +mips/cavium/octeon_mp.c optional smp mips/cavium/uart_bus_octeonusart.c optional uart mips/cavium/uart_cpu_octeonusart.c optional uart mips/cavium/uart_dev_oct16550.c optional uart Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/octeon_machdep.c Sat Apr 17 03:08:13 2010 (r206721) @@ -111,25 +111,6 @@ platform_reset(void) oct_write64(OCTEON_CIU_SOFT_RST, 1); } - -static inline uint32_t -octeon_disable_interrupts(void) -{ - uint32_t status_bits; - - status_bits = mips_rd_status(); - mips_wr_status(status_bits & ~MIPS_SR_INT_IE); - return (status_bits); -} - - -static inline void -octeon_set_interrupts(uint32_t status_bits) -{ - mips_wr_status(status_bits); -} - - void octeon_led_write_char(int char_position, char val) { @@ -203,82 +184,6 @@ octeon_led_run_wheel(int *prog_count, in *prog_count &= 0x7; } -#define LSR_DATAREADY 0x01 /* Data ready */ -#define LSR_THRE 0x20 /* Transmit holding register empty */ -#define LSR_TEMT 0x40 /* Transmitter Empty. THR, TSR & FIFO */ -#define USR_TXFIFO_NOTFULL 0x02 /* Uart TX FIFO Not full */ - -/* - * octeon_uart_write_byte - * - * Put out a single byte off of uart port. - */ - -void -octeon_uart_write_byte(int uart_index, uint8_t ch) -{ - uint64_t val, val2; - if (uart_index < 0 || uart_index > 1) - return; - - while (1) { - val = oct_read64(OCTEON_MIO_UART0_LSR + (uart_index * 0x400)); - val2 = oct_read64(OCTEON_MIO_UART0_USR + (uart_index * 0x400)); - if ((((uint8_t) val) & LSR_THRE) || - (((uint8_t) val2) & USR_TXFIFO_NOTFULL)) { - break; - } - } - - /* Write the byte */ - oct_write8(OCTEON_MIO_UART0_THR + (uart_index * 0x400), (uint64_t) ch); - - /* Force Flush the IOBus */ - oct_read64(OCTEON_MIO_BOOT_BIST_STAT); -} - - -void -octeon_uart_write_byte0(uint8_t ch) -{ - uint64_t val, val2; - - while (1) { - val = oct_read64(OCTEON_MIO_UART0_LSR); - val2 = oct_read64(OCTEON_MIO_UART0_USR); - if ((((uint8_t) val) & LSR_THRE) || - (((uint8_t) val2) & USR_TXFIFO_NOTFULL)) { - break; - } - } - - /* Write the byte */ - oct_write8(OCTEON_MIO_UART0_THR, (uint64_t) ch); - - /* Force Flush the IOBus */ - oct_read64(OCTEON_MIO_BOOT_BIST_STAT); -} - -/* - * octeon_uart_write_string - * - */ -void -octeon_uart_write_string(int uart_index, const char *str) -{ - /* Just loop writing one byte at a time */ - - while (*str) { - octeon_uart_write_byte(uart_index, *str); - if (*str == '\n') { - octeon_uart_write_byte(uart_index, '\r'); - } - str++; - } -} - -static char wstr[30]; - void octeon_led_write_hex(uint32_t wl) { @@ -289,44 +194,6 @@ octeon_led_write_hex(uint32_t wl) } -void octeon_uart_write_hex2(uint32_t wl, uint32_t wh) -{ - sprintf(wstr, "0x%X-0x%X ", wh, wl); - octeon_uart_write_string(0, wstr); -} - -void -octeon_uart_write_hex(uint32_t wl) -{ - sprintf(wstr, " 0x%X ", wl); - octeon_uart_write_string(0, wstr); -} - -/* - * octeon_wait_uart_flush - */ -void -octeon_wait_uart_flush(int uart_index, uint8_t ch) -{ - uint64_t val; - int64_t val3; - uint32_t cpu_status_bits; - - if (uart_index < 0 || uart_index > 1) - return; - - cpu_status_bits = octeon_disable_interrupts(); - /* Force Flush the IOBus */ - oct_read64(OCTEON_MIO_BOOT_BIST_STAT); - for (val3 = 0xfffffffff; val3 > 0; val3--) { - val = oct_read64(OCTEON_MIO_UART0_LSR + (uart_index * 0x400)); - if (((uint8_t) val) & LSR_TEMT) - break; - } - octeon_set_interrupts(cpu_status_bits); -} - - /* * octeon_debug_symbol * @@ -450,17 +317,17 @@ ciu_get_en_reg_addr_new(int corenum, int /* XXX kasserts? */ if (enx < CIU_EN_0 || enx > CIU_EN_1) { printf("%s: invalid enx value %d, should be %d or %d\n", - __FUNCTION__, enx, CIU_EN_0, CIU_EN_1); + __func__, enx, CIU_EN_0, CIU_EN_1); return 0; } if (intx < CIU_INT_0 || intx > CIU_INT_1) { printf("%s: invalid intx value %d, should be %d or %d\n", - __FUNCTION__, enx, CIU_INT_0, CIU_INT_1); + __func__, enx, CIU_INT_0, CIU_INT_1); return 0; } if (ciu_ip < CIU_MIPS_IP2 || ciu_ip > CIU_MIPS_IP3) { printf("%s: invalid ciu_ip value %d, should be %d or %d\n", - __FUNCTION__, ciu_ip, CIU_MIPS_IP2, CIU_MIPS_IP3); + __func__, ciu_ip, CIU_MIPS_IP2, CIU_MIPS_IP3); return 0; } @@ -517,7 +384,7 @@ ciu_clear_int_summary(int core_num, int core_num, intx, enx, write_bits); #endif - cpu_status_bits = octeon_disable_interrupts(); + cpu_status_bits = intr_disable(); ciu_intr_sum_reg_addr = ciu_get_intr_sum_reg_addr(core_num, intx, enx); @@ -535,7 +402,7 @@ ciu_clear_int_summary(int core_num, int printf(" Readback: 0x%llX\n\n ", (uint64_t) oct_read64(ciu_intr_sum_reg_addr)); #endif - octeon_set_interrupts(cpu_status_bits); + intr_restore(cpu_status_bits); } /* @@ -550,7 +417,7 @@ ciu_disable_intr(int core_num, int intx, if (core_num == CIU_THIS_CORE) core_num = octeon_get_core_num(); - cpu_status_bits = octeon_disable_interrupts(); + cpu_status_bits = intr_disable(); ciu_intr_reg_addr = ciu_get_intr_en_reg_addr(core_num, intx, enx); @@ -559,7 +426,7 @@ ciu_disable_intr(int core_num, int intx, oct_write64(ciu_intr_reg_addr, 0LL); oct_read64(OCTEON_MIO_BOOT_BIST_STAT); /* Bus Barrier */ - octeon_set_interrupts(cpu_status_bits); + intr_restore(cpu_status_bits); } void @@ -580,7 +447,7 @@ ciu_dump_interrutps_enabled(int core_num #endif if (!ciu_intr_reg_addr) { - printf("Bad call to %s\n", __FUNCTION__); + printf("Bad call to %s\n", __func__); while(1); return; } @@ -612,7 +479,7 @@ void ciu_enable_interrupts(int core_num, core_num, intx, enx, ciu_ip, set_these_interrupt_bits); #endif - cpu_status_bits = octeon_disable_interrupts(); + cpu_status_bits = intr_disable(); #ifndef OCTEON_SMP_1 ciu_intr_reg_addr = ciu_get_intr_en_reg_addr(core_num, intx, enx); @@ -621,7 +488,7 @@ void ciu_enable_interrupts(int core_num, #endif if (!ciu_intr_reg_addr) { - printf("Bad call to %s\n", __FUNCTION__); + printf("Bad call to %s\n", __func__); while(1); return; /* XXX */ } @@ -634,7 +501,7 @@ void ciu_enable_interrupts(int core_num, #endif ciu_intr_bits |= set_these_interrupt_bits; oct_write64(ciu_intr_reg_addr, ciu_intr_bits); -#ifdef OCTEON_SMP +#ifdef SMP mips_wbflush(); #endif oct_read64(OCTEON_MIO_BOOT_BIST_STAT); /* Bus Barrier */ @@ -644,7 +511,7 @@ void ciu_enable_interrupts(int core_num, (uint64_t)oct_read64(ciu_intr_reg_addr)); #endif - octeon_set_interrupts(cpu_status_bits); + intr_restore(cpu_status_bits); } unsigned long @@ -659,12 +526,8 @@ octeon_memory_init(void) uint32_t realmem_bytes; if (octeon_board_real()) { - printf("octeon_dram == %jx\n", (intmax_t)octeon_dram); - printf("reduced to ram: %u MB", (uint32_t)octeon_dram >> 20); - realmem_bytes = (octeon_dram - PAGE_SIZE); realmem_bytes &= ~(PAGE_SIZE - 1); - printf("Real memory bytes is %x\n", realmem_bytes); } else { /* Simulator we limit to 96 meg */ realmem_bytes = (96 << 20); @@ -678,8 +541,6 @@ octeon_memory_init(void) phys_avail[1] = realmem_bytes; realmem_bytes -= OCTEON_DRAM_FIRST_256_END; realmem_bytes &= ~(PAGE_SIZE - 1); - printf("phys_avail[0] = %#lx phys_avail[1] = %#lx\n", - (long)phys_avail[0], (long)phys_avail[1]); } else { /* Simulator gets 96Meg period. */ phys_avail[1] = (96 << 20); @@ -705,23 +566,14 @@ octeon_memory_init(void) realmem_bytes &= ~(PAGE_SIZE - 1); /* Now map the rest of the memory */ phys_avail[2] = 0x20000000; - printf("realmem_bytes is now at %x\n", realmem_bytes); phys_avail[3] = ((uint32_t) 0x20000000 + realmem_bytes); - printf("Next block of memory goes from %#lx to %#lx\n", - (long)phys_avail[2], (long)phys_avail[3]); physmem += btoc(phys_avail[3] - phys_avail[2]); - } else { - printf("realmem_bytes is %d\n", realmem_bytes); } realmem = physmem; printf("Total DRAM Size %#X\n", (uint32_t) octeon_dram); printf("Bank 0 = %#08lX -> %#08lX\n", (long)phys_avail[0], (long)phys_avail[1]); printf("Bank 1 = %#08lX -> %#08lX\n", (long)phys_avail[2], (long)phys_avail[3]); - printf("physmem: %#lx\n", physmem); - - Maxmem = physmem; - } void @@ -760,7 +612,15 @@ platform_start(__register_t a0, __regist kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); #endif platform_counter_freq = octeon_get_clock_rate(); - mips_timer_init_params(platform_counter_freq, 1); + mips_timer_init_params(platform_counter_freq, 0); + +#ifdef SMP + /* + * Clear any pending IPIs and enable the IPI interrupt. + */ + oct_write64(OCTEON_CIU_MBOX_CLRX(0), 0xffffffff); + ciu_enable_interrupts(0, CIU_INT_1, CIU_EN_0, OCTEON_CIU_ENABLE_MBOX_INTR, CIU_MIPS_IP3); +#endif } /* impSTART: This stuff should move back into the Cavium SDK */ @@ -982,7 +842,7 @@ octeon_boot_params_init(register_t ptr) printf("Boot Descriptor Ver: %u -> %u/%u", octeon_bd_ver, octeon_cvmx_bd_ver/100, octeon_cvmx_bd_ver%100); - printf(" CPU clock: %uMHz\n", octeon_cpu_clock/1000000); + printf(" CPU clock: %uMHz Core Mask: %#x\n", octeon_cpu_clock/1000000, octeon_core_mask); printf(" Dram: %u MB", (uint32_t)(octeon_dram >> 20)); printf(" Board Type: %u Revision: %u/%u\n", octeon_board_type, octeon_board_rev_major, octeon_board_rev_minor); Added: head/sys/mips/cavium/octeon_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_mp.c Sat Apr 17 03:08:13 2010 (r206721) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2004-2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include + +unsigned octeon_ap_boot = ~0; + +void +platform_ipi_send(int cpuid) +{ + oct_write64(OCTEON_CIU_MBOX_SETX(cpuid), 1); + mips_wbflush(); +} + +void +platform_ipi_clear(void) +{ + uint64_t action; + + action = oct_read64(OCTEON_CIU_MBOX_CLRX(PCPU_GET(cpuid))); + KASSERT(action == 1, ("unexpected IPIs: %#jx", (uintmax_t)action)); + oct_write64(OCTEON_CIU_MBOX_CLRX(PCPU_GET(cpuid)), action); +} + +int +platform_ipi_intrnum(void) +{ + return (1); +} + +void +platform_init_ap(int cpuid) +{ + /* + * Set the exception base. + */ + mips_wr_prid1(0x80000000 | cpuid); + + /* + * Set up interrupts, clear IPIs and unmask the IPI interrupt. + */ + octeon_ciu_reset(); + + oct_write64(OCTEON_CIU_MBOX_CLRX(cpuid), 0xffffffff); + ciu_enable_interrupts(cpuid, CIU_INT_1, CIU_EN_0, OCTEON_CIU_ENABLE_MBOX_INTR, CIU_MIPS_IP3); + + mips_wbflush(); +} + +int +platform_num_processors(void) +{ + return (fls(octeon_core_mask)); +} + +int +platform_start_ap(int cpuid) +{ + if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0) + return (-1); + for (;;) { + DELAY(1000); + if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0) + return (0); + printf("Waiting for cpu%d to start\n", cpuid); + } +} Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Sat Apr 17 03:08:13 2010 (r206721) @@ -54,14 +54,6 @@ #ifndef LOCORE -/* XXXimp: From Cavium's include/pcpu.h, need to port that over */ -#ifndef OCTEON_SMP -#define OCTEON_CORE_ID 0 -#else -extern struct pcpu *cpuid_to_pcpu[]; -#define OCTEON_CORE_ID (mips_rd_coreid()) -#endif - /* * Utility inlines & macros */ @@ -324,62 +316,6 @@ static inline void oct_write32 (uint64_t #define OCTEON_SCRATCH_2 32 -static inline uint64_t oct_mf_chord (void) -{ - uint64_t dest; - - __asm __volatile ( ".set push\n" - ".set noreorder\n" - ".set noat\n" - ".set mips64\n" - "dmfc2 $1, 0x400\n" - "move %0, $1\n" - ".set pop\n" - : "=r" (dest) : : "$1"); - return dest; -} - - -#define MIPS64_DMFCz(cop,regnum,cp0reg,select) \ - .word (0x40200000 | (cop << 25) | (regnum << 16) | (cp0reg << 11) | select) - - -#define mips64_getcpz_xstr(s) mips64_getcpz_str(s) -#define mips64_getcpz_str(s) #s - -#define mips64_dgetcpz(cop,cpzreg,sel,val_ptr) \ - ({ __asm __volatile( \ - ".set push\n" \ - ".set mips3\n" \ - ".set noreorder\n" \ - ".set noat\n" \ - mips64_getcpz_xstr(MIPS64_DMFCz(cop,1,cpzreg,sel)) "\n" \ - "nop\n" \ - "nop\n" \ - "nop\n" \ - "nop\n" \ - "sd $1,0(%0)\n" \ - ".set pop" \ - : /* no outputs */ : "r" (val_ptr) : "$1"); \ - }) - - -#define mips64_dgetcp2(cp2reg,sel,retval_ptr) \ - mips64_dgetcpz(2,cp2reg,sel,retval_ptr) - - -#define OCTEON_MF_CHORD(dest) mips64_dgetcp2(0x400, 0, &dest) - - - -#define OCTEON_RDHWR(result, regstr) \ - __asm __volatile ( \ - ".set mips3\n" \ - "rdhwr %0,$" OCTEON_TMP_STR(regstr) "\n" \ - ".set mips\n" \ - : "=d" (result)); - -#define CVMX_MF_CHORD(dest) OCTEON_RDHWR(dest, 30) #define OCTEON_CHORD_HEX(dest_ptr) \ ({ __asm __volatile( \ @@ -397,15 +333,6 @@ static inline uint64_t oct_mf_chord (voi : /* no outputs */ : "r" (dest_ptr) : "$2"); \ }) - - -#define OCTEON_MF_CHORD_BAD(dest) \ - __asm __volatile ( \ - ".set mips3\n" \ - "dmfc2 %0, 0x400\n" \ - ".set mips0\n" \ - : "=&r" (dest) : ) - static inline uint64_t oct_scratch_read64 (uint64_t address) { return(*((volatile uint64_t *)(OCTEON_SCRATCH_BASE + address))); @@ -417,17 +344,6 @@ static inline void oct_scratch_write64 ( } -#define OCTEON_READ_CSR32(addr, val) \ - addr_ptr = addr; \ - oct_read_32_ptr(&addr_ptr, &val); - -#define OCTEON_WRITE_CSR32(addr, val, val_dummy) \ - addr_ptr = addr; \ - oct_write_32_ptr(&addr_ptr, &val); \ - oct_read64(OCTEON_MIO_BOOT_BIST_STAT); - - - /* * Octeon Address Space Definitions */ @@ -791,12 +707,6 @@ extern void octeon_led_write_hexchar(int extern void octeon_led_write_hex(uint32_t wl); extern void octeon_led_write_string(const char *str); extern void octeon_reset(void); -extern void octeon_uart_write_byte(int uart_index, uint8_t ch); -extern void octeon_uart_write_string(int uart_index, const char *str); -extern void octeon_uart_write_hex(uint32_t wl); -extern void octeon_uart_write_hex2(uint32_t wl, uint32_t wh); -extern void octeon_wait_uart_flush(int uart_index, uint8_t ch); -extern void octeon_uart_write_byte0(uint8_t ch); extern void octeon_led_write_char0(char val); extern void octeon_led_run_wheel(int *pos, int led_position); extern void octeon_debug_symbol(void); Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/mips/locore.S Sat Apr 17 03:08:13 2010 (r206721) @@ -162,6 +162,18 @@ VECTOR(_locore, unknown) sw a2, _C_LABEL(fenvp) #endif +#if defined(TARGET_OCTEON) && defined(SMP) + .set push + .set mips32r2 + rdhwr t2, $0 + beqz t2, 1f + nop + j octeon_ap_wait + nop + .set pop +1: +#endif + /* * Initialize stack and call machine startup. */ @@ -178,10 +190,10 @@ VECTOR(_locore, unknown) nop PTR_LA sp, _C_LABEL(thread0) - lw a0, TD_PCB(sp) - li t0, ~7 + PTR_L a0, TD_PCB(sp) + REG_LI t0, ~7 and a0, a0, t0 - subu sp, a0, CALLFRAME_SIZ + PTR_SUBU sp, a0, CALLFRAME_SIZ jal _C_LABEL(mi_startup) # mi_startup(frame) sw zero, CALLFRAME_SIZ - 8(sp) # Zero out old fp for debugger Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/mips/mp_machdep.c Sat Apr 17 03:08:13 2010 (r206721) @@ -157,6 +157,8 @@ start_ap(int cpuid) cpus = mp_naps; dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE); + mips_sync(); + if (platform_start_ap(cpuid) != 0) return (-1); /* could not start AP */ @@ -246,6 +248,8 @@ smp_init_secondary(u_int32_t cpuid) mips_dcache_wbinv_all(); mips_icache_sync_all(); + mips_sync(); + MachSetPID(0); pcpu_init(PCPU_ADDR(cpuid), cpuid, sizeof(struct pcpu)); Modified: head/sys/mips/mips/mpboot.S ============================================================================== --- head/sys/mips/mips/mpboot.S Sat Apr 17 02:28:28 2010 (r206720) +++ head/sys/mips/mips/mpboot.S Sat Apr 17 03:08:13 2010 (r206721) @@ -36,8 +36,21 @@ .set noat .set noreorder +#ifdef TARGET_OCTEON +#define CLEAR_STATUS \ + mfc0 a0, COP_0_STATUS_REG ;\ + li a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \ + or a0, a0, a2 ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER | MIPS_SR_BEV) ; \ + and a0, a0, a2 ; \ + mtc0 a0, COP_0_STATUS_REG +#else +#define CLEAR_STATUS \ + mtc0 zero, COP_0_STATUS_REG +#endif + GLOBAL(mpentry) - mtc0 zero, COP_0_STATUS_REG /* disable interrupts */ + CLEAR_STATUS /* disable interrupts */ mtc0 zero, COP_0_CAUSE_REG /* clear soft interrupts */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 07:20:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECDED106566B; Sat, 17 Apr 2010 07:20:01 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9D9D8FC12; Sat, 17 Apr 2010 07:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3H7K1c2085667; Sat, 17 Apr 2010 07:20:01 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H7K18m085656; Sat, 17 Apr 2010 07:20:01 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170720.o3H7K18m085656@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 07:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206746 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 07:20:02 -0000 Author: jmallett Date: Sat Apr 17 07:20:01 2010 New Revision: 206746 URL: http://svn.freebsd.org/changeset/base/206746 Log: o) Add NPDEPG, like NPTEPG but for PDEs. o) Remove NBPG, PGOFSET and PGSHIFT. Use the standard names. o) Remove some unused macros and move things from param.h to vmparam.h that belong in the latter. (Actually, all of the kernel segment values, virtual addresses, etc., belong in one place, but this is a step in the right direction.) Modified: head/sys/mips/include/param.h head/sys/mips/include/pte.h head/sys/mips/include/vmparam.h head/sys/mips/mips/exception.S head/sys/mips/mips/genassym.c head/sys/mips/mips/locore.S head/sys/mips/mips/mpboot.S head/sys/mips/mips/pmap.c head/sys/mips/mips/support.S head/sys/mips/mips/tlb.S head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/include/param.h Sat Apr 17 07:20:01 2010 (r206746) @@ -100,28 +100,14 @@ #define CACHE_LINE_SHIFT 6 #define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) -#define NBPG 4096 /* bytes/page */ -#define PGOFSET (NBPG-1) /* byte offset into page */ -#define PGSHIFT 12 /* LOG2(NBPG) */ - #define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */ #define PAGE_SIZE (1<> PGSHIFT) - #define BLKDEV_IOSIZE 2048 /* xxx: Why is this 1/2 page? */ #define MAXDUMPPGS 1 /* xxx: why is this only one? */ @@ -137,8 +123,8 @@ #define UPAGES 2 /* pages ("clicks") (4096 bytes) to disk blocks */ -#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT)) -#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT)) +#define ctod(x) ((x) << (PAGE_SHIFT - DEV_BSHIFT)) +#define dtoc(x) ((x) >> (PAGE_SHIFT - DEV_BSHIFT)) /* * Map a ``block device block'' to a file system block. @@ -149,18 +135,18 @@ #define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE)) /* - * Conversion macros + * Mach derived conversion macros */ -#define mips_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG-1)) -#define mips_trunc_page(x) ((unsigned long)(x) & ~(NBPG-1)) -#define mips_btop(x) ((unsigned long)(x) >> PGSHIFT) -#define mips_ptob(x) ((unsigned long)(x) << PGSHIFT) -#define round_page mips_round_page -#define trunc_page mips_trunc_page -#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) +#define round_page(x) (((unsigned long)(x) + PAGE_MASK) & ~PAGE_MASK) +#define trunc_page(x) ((unsigned long)(x) & ~PAGE_MASK) + +#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) +#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) + +#define mips_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) +#define mips_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) #ifndef _KERNEL #define DELAY(n) { register int N = (n); while (--N > 0); } Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/include/pte.h Sat Apr 17 07:20:01 2010 (r206746) @@ -126,7 +126,7 @@ typedef pt_entry_t *pd_entry_t; #define pfn_to_vad(x) (((x) & PTE_FRAME) << PTE_SHIFT) /* User virtual to pte offset in page table */ -#define vad_to_pte_offset(adr) (((adr) >> PGSHIFT) & (NPTEPG -1)) +#define vad_to_pte_offset(adr) (((adr) >> PAGE_SHIFT) & (NPTEPG -1)) #define mips_pg_v(entry) ((entry) & PTE_V) #define mips_pg_wired(entry) ((entry) & PTE_WIRED) Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/include/vmparam.h Sat Apr 17 07:20:01 2010 (r206746) @@ -97,13 +97,19 @@ /* user/kernel map constants */ #define VM_MIN_ADDRESS ((vm_offset_t)0x00000000) +#define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) + +#define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) #define VM_MAXUSER_ADDRESS ((vm_offset_t)0x80000000) #define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS -#define VM_MAX_ADDRESS ((vm_offset_t)0x80000000) #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000) -#define VM_KERNEL_WIRED_ADDR_END (VM_MIN_KERNEL_ADDRESS) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) +#if 0 +#define KERNBASE (VM_MIN_KERNEL_ADDRESS) +#else +#define KERNBASE ((vm_offset_t)(intptr_t)(int32_t)0x80000000) +#endif /* * Disable superpage reservations. (not sure if this is right @@ -175,23 +181,8 @@ */ #define VM_NFREEORDER 9 -/* - * XXXMIPS: This values need to be changed!!! - */ -#if 0 -#define VM_MIN_ADDRESS ((vm_offset_t)0x0000000000010000) -#define VM_MAXUSER_ADDRESS ((vm_offset_t)MIPS_KSEG0_START-1) -#define VM_MAX_ADDRESS ((vm_offset_t)0x0000000100000000) -#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)MIPS_KSEG3_START) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)MIPS_KSEG3_END) -#define KERNBASE (VM_MIN_KERNEL_ADDRESS) - -/* virtual sizes (bytes) for various kernel submaps */ -#define VM_KMEM_SIZE (16*1024*1024) /* XXX ??? */ -#endif - -#define NBSEG 0x400000 /* bytes/segment */ -#define SEGOFSET (NBSEG-1) /* byte offset into segment */ #define SEGSHIFT 22 /* LOG2(NBSEG) */ +#define NBSEG (1 << SEGSHIFT) /* bytes/segment */ +#define SEGOFSET (NBSEG-1) /* byte offset into segment */ #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/exception.S Sat Apr 17 07:20:01 2010 (r206746) @@ -158,7 +158,7 @@ MipsDoTLBMiss: lw k1, 0(k1) #08: k1=seg entry mfc0 k0, COP_0_BAD_VADDR #09: k0=bad address (again) beq k1, zero, 2f #0a: ==0 -- no page table - srl k0, PGSHIFT - 2 #0b: k0=VPN (aka va>>10) + srl k0, PAGE_SHIFT - 2 #0b: k0=VPN (aka va>>10) andi k0, k0, ((NPTEPG/2) - 1) << 3 #0c: k0=page tab offset #xxx mips64 unsafe? @@ -860,7 +860,7 @@ NLEAF(MipsTLBInvalidException) nop mfc0 k0, COP_0_BAD_VADDR - srl k0, PGSHIFT - 2 + srl k0, PAGE_SHIFT - 2 andi k0, 0xffc addu k1, k1, k0 @@ -944,7 +944,7 @@ tlb_insert_random: sll k1, k1, PAGE_SHIFT + 1 PTR_LA k0, _C_LABEL(pcpu_space) - addiu k0, (NBPG * 2) + addiu k0, (PAGE_SIZE * 2) addu k0, k0, k1 /* Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/genassym.c Sat Apr 17 07:20:01 2010 (r206746) @@ -90,8 +90,7 @@ ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADD ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(SIGFPE, SIGFPE); ASSYM(PAGE_SHIFT, PAGE_SHIFT); -ASSYM(PGSHIFT, PGSHIFT); -ASSYM(NBPG, NBPG); +ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(SEGSHIFT, SEGSHIFT); ASSYM(NPTEPG, NPTEPG); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/locore.S Sat Apr 17 07:20:01 2010 (r206746) @@ -178,7 +178,7 @@ VECTOR(_locore, unknown) * Initialize stack and call machine startup. */ PTR_LA sp, _C_LABEL(pcpu_space) - addiu sp, (NBPG * 2) - CALLFRAME_SIZ + addiu sp, (PAGE_SIZE * 2) - CALLFRAME_SIZ sw zero, CALLFRAME_SIZ - 4(sp) # Zero out old ra for debugger sw zero, CALLFRAME_SIZ - 8(sp) # Zero out old fp for debugger Modified: head/sys/mips/mips/mpboot.S ============================================================================== --- head/sys/mips/mips/mpboot.S Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/mpboot.S Sat Apr 17 07:20:01 2010 (r206746) @@ -66,7 +66,7 @@ GLOBAL(mpentry) * Initialize stack and call machine startup */ PTR_LA sp, _C_LABEL(pcpu_space) - addiu sp, (NBPG * 2) - CALLFRAME_SIZ + addiu sp, (PAGE_SIZE * 2) - CALLFRAME_SIZ sll t0, s0, PAGE_SHIFT + 1 addu sp, sp, t0 Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/pmap.c Sat Apr 17 07:20:01 2010 (r206746) @@ -609,7 +609,7 @@ pmap_invalidate_page_action(void *arg) pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; return; } - va = pmap_va_asid(pmap, (va & ~PGOFSET)); + va = pmap_va_asid(pmap, (va & ~PAGE_MASK)); mips_TBIS(va); } @@ -765,7 +765,7 @@ pmap_kremove(vm_offset_t va) /* * Write back all caches from the page being destroyed */ - mips_dcache_wbinv_range_index(va, NBPG); + mips_dcache_wbinv_range_index(va, PAGE_SIZE); pte = pmap_pte(kernel_pmap, va); *pte = PTE_G; @@ -1516,7 +1516,7 @@ pmap_remove_page(struct pmap *pmap, vm_o /* * Write back all caches from the page being destroyed */ - mips_dcache_wbinv_range_index(va, NBPG); + mips_dcache_wbinv_range_index(va, PAGE_SIZE); /* * get a local va for mappings for this pmap. @@ -1603,7 +1603,7 @@ pmap_remove_all(vm_page_t m) * the page being destroyed */ if (m->md.pv_list_count == 1) - mips_dcache_wbinv_range_index(pv->pv_va, NBPG); + mips_dcache_wbinv_range_index(pv->pv_va, PAGE_SIZE); pv->pv_pmap->pm_stats.resident_count--; @@ -1902,8 +1902,8 @@ validate: */ if (!is_kernel_pmap(pmap) && (pmap == &curproc->p_vmspace->vm_pmap) && (prot & VM_PROT_EXECUTE)) { - mips_icache_sync_range(va, NBPG); - mips_dcache_wbinv_range(va, NBPG); + mips_icache_sync_range(va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); } vm_page_unlock_queues(); PMAP_UNLOCK(pmap); @@ -2032,8 +2032,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * unresolvable TLB miss may occur. */ if (pmap == &curproc->p_vmspace->vm_pmap) { va &= ~PAGE_MASK; - mips_icache_sync_range(va, NBPG); - mips_dcache_wbinv_range(va, NBPG); + mips_icache_sync_range(va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); } } return (mpte); @@ -3078,7 +3078,7 @@ pmap_flush_pvcache(vm_page_t m) if (m != NULL) { for (pv = TAILQ_FIRST(&m->md.pv_list); pv; pv = TAILQ_NEXT(pv, pv_list)) { - mips_dcache_wbinv_range_index(pv->pv_va, NBPG); + mips_dcache_wbinv_range_index(pv->pv_va, PAGE_SIZE); } } } Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/support.S Sat Apr 17 07:20:01 2010 (r206746) @@ -210,7 +210,7 @@ END(fillw) * mem_zero_page(addr); */ LEAF(mem_zero_page) - li v0, NBPG + li v0, PAGE_SIZE 1: subu v0, 8 sd zero, 0(a0) Modified: head/sys/mips/mips/tlb.S ============================================================================== --- head/sys/mips/mips/tlb.S Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/tlb.S Sat Apr 17 07:20:01 2010 (r206746) @@ -240,7 +240,7 @@ LEAF(Mips_TLBFlush) # MIPS_KSEG0_START + 2 * i * PAGE_SIZE; # One bogus value for every TLB entry might cause MCHECK exception # - sll t3, t1, PGSHIFT + 1 + sll t3, t1, PAGE_SHIFT + 1 li v0, MIPS_KSEG0_START # invalid address addu v0, t3 /* @@ -299,7 +299,7 @@ LEAF(Mips_TLBFlushAddr) # address calculated by following expression: # MIPS_KSEG0_START + 2 * i * PAGE_SIZE; # One bogus value for every TLB entry might cause MCHECK exception - sll v0, PGSHIFT + 1 + sll v0, PAGE_SHIFT + 1 addu t1, v0 _MTC0 t1, COP_0_TLB_HI # Mark entry high as invalid @@ -482,7 +482,7 @@ LEAF(mips_TBIAP) # MIPS_KSEG0_START + 2 * i * PAGE_SIZE; # One bogus value for every TLB entry might cause MCHECK exception # - sll t3, t1, PGSHIFT + 1 + sll t3, t1, PAGE_SHIFT + 1 li v0, MIPS_KSEG0_START # invalid address addu v0, t3 @@ -507,7 +507,7 @@ LEAF(mips_TBIAP) tlbwi # invalidate the TLB entry 2: addu t1, t1, 1 - addu v0, 1 << (PGSHIFT + 1) + addu v0, 1 << (PAGE_SHIFT + 1) bne t1, t2, 1b nop Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/trap.c Sat Apr 17 07:20:01 2010 (r206746) @@ -378,12 +378,12 @@ trap(struct trapframe *trapframe) if (!(pte = pmap_segmap(kernel_pmap, trapframe->badvaddr))) panic("trap: ktlbmod: invalid segmap"); - pte += (trapframe->badvaddr >> PGSHIFT) & (NPTEPG - 1); + pte += (trapframe->badvaddr >> PAGE_SHIFT) & (NPTEPG - 1); entry = *pte; #ifdef SMP /* It is possible that some other CPU changed m-bit */ if (!mips_pg_v(entry) || (entry & mips_pg_m_bit())) { - trapframe->badvaddr &= ~PGOFSET; + trapframe->badvaddr &= ~PAGE_MASK; pmap_update_page(kernel_pmap, trapframe->badvaddr, entry); PMAP_UNLOCK(kernel_pmap); @@ -401,7 +401,7 @@ trap(struct trapframe *trapframe) } entry |= mips_pg_m_bit(); *pte = entry; - trapframe->badvaddr &= ~PGOFSET; + trapframe->badvaddr &= ~PAGE_MASK; pmap_update_page(kernel_pmap, trapframe->badvaddr, entry); pa = mips_tlbpfn_to_paddr(entry); if (!page_is_managed(pa)) @@ -421,12 +421,12 @@ trap(struct trapframe *trapframe) PMAP_LOCK(pmap); if (!(pte = pmap_segmap(pmap, trapframe->badvaddr))) panic("trap: utlbmod: invalid segmap"); - pte += (trapframe->badvaddr >> PGSHIFT) & (NPTEPG - 1); + pte += (trapframe->badvaddr >> PAGE_SHIFT) & (NPTEPG - 1); entry = *pte; #ifdef SMP /* It is possible that some other CPU changed m-bit */ if (!mips_pg_v(entry) || (entry & mips_pg_m_bit())) { - trapframe->badvaddr = (trapframe->badvaddr & ~PGOFSET); + trapframe->badvaddr = (trapframe->badvaddr & ~PAGE_MASK); pmap_update_page(pmap, trapframe->badvaddr, entry); PMAP_UNLOCK(pmap); goto out; @@ -445,7 +445,7 @@ trap(struct trapframe *trapframe) } entry |= mips_pg_m_bit(); *pte = entry; - trapframe->badvaddr = (trapframe->badvaddr & ~PGOFSET); + trapframe->badvaddr = (trapframe->badvaddr & ~PAGE_MASK); pmap_update_page(pmap, trapframe->badvaddr, entry); trapframe->badvaddr |= (pmap->pm_asid[PCPU_GET(cpuid)].asid << VMTLB_PID_SHIFT); pa = mips_tlbpfn_to_paddr(entry); Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sat Apr 17 04:54:38 2010 (r206745) +++ head/sys/mips/mips/vm_machdep.c Sat Apr 17 07:20:01 2010 (r206746) @@ -219,7 +219,7 @@ cpu_thread_swapin(struct thread *td) */ if (!(pte = pmap_segmap(kernel_pmap, td->td_md.md_realstack))) panic("cpu_thread_swapin: invalid segmap"); - pte += ((vm_offset_t)td->td_md.md_realstack >> PGSHIFT) & (NPTEPG - 1); + pte += ((vm_offset_t)td->td_md.md_realstack >> PAGE_SHIFT) & (NPTEPG - 1); for (i = 0; i < KSTACK_PAGES - 1; i++) { td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); @@ -249,7 +249,7 @@ cpu_thread_alloc(struct thread *td) if (!(pte = pmap_segmap(kernel_pmap, td->td_md.md_realstack))) panic("cpu_thread_alloc: invalid segmap"); - pte += ((vm_offset_t)td->td_md.md_realstack >> PGSHIFT) & (NPTEPG - 1); + pte += ((vm_offset_t)td->td_md.md_realstack >> PAGE_SHIFT) & (NPTEPG - 1); for (i = 0; i < KSTACK_PAGES - 1; i++) { td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 09:42:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56759106564A; Sat, 17 Apr 2010 09:42:07 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43E518FC0C; Sat, 17 Apr 2010 09:42: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 o3H9g7KN017265; Sat, 17 Apr 2010 09:42:07 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3H9g7cF017258; Sat, 17 Apr 2010 09:42:07 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004170942.o3H9g7cF017258@svn.freebsd.org> From: Juli Mallett Date: Sat, 17 Apr 2010 09:42: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: r206749 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 09:42:07 -0000 Author: jmallett Date: Sat Apr 17 09:42:07 2010 New Revision: 206749 URL: http://svn.freebsd.org/changeset/base/206749 Log: o) Make pcb_onfault a pointer rather than an obscure integer value. o) Mask off PAGE_MASK bits in pmap_update_page, etc., rather than modifying the badvaddr in trapframe. Some nearby interfaces already did this. o) Make PTEs "unsigned int" for now, not "unsigned long" -- we are only ready for them to be 32-bit on 64-bit platforms. o) Rather than using pmap_segmap and calculating the offset into the page table by hand in trap.c, use pmap_pte(). o) Remove unused quad_syscall variable in trap.c. o) Log things for illegal instructions like we do for bad page faults. o) Various cast cleanups related to how to print registers. o) When logging page faults, show the page table information not just for the program counter, but for the fault address. o) Modify support.S to use ABI-neutral macros for operating on pointers. o) Consistently use CALLFRAME_SIZ rather than STAND_FRAME_SIZE, etc. o) Remove unused insque/remque functions. o) Remove some coprocessor 0 accessor functions implemented in assembly that are unused and have inline assembly counterparts. Modified: head/sys/mips/include/cpu.h head/sys/mips/include/pcb.h head/sys/mips/include/pte.h head/sys/mips/mips/pmap.c head/sys/mips/mips/support.S head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Sat Apr 17 09:37:08 2010 (r206748) +++ head/sys/mips/include/cpu.h Sat Apr 17 09:42:07 2010 (r206749) @@ -458,13 +458,9 @@ extern union cpuprid fpu_id; struct tlb; struct user; -u_int32_t mips_cp0_config1_read(void); int Mips_ConfigCache(void); void Mips_SetWIRED(int); void Mips_SetPID(int); -u_int Mips_GetCOUNT(void); -void Mips_SetCOMPARE(u_int); -u_int Mips_GetCOMPARE(void); void Mips_SyncCache(void); void Mips_SyncDCache(vm_offset_t, int); Modified: head/sys/mips/include/pcb.h ============================================================================== --- head/sys/mips/include/pcb.h Sat Apr 17 09:37:08 2010 (r206748) +++ head/sys/mips/include/pcb.h Sat Apr 17 09:42:07 2010 (r206749) @@ -51,7 +51,7 @@ struct pcb { struct trapframe pcb_regs; /* saved CPU and registers */ __register_t pcb_context[14]; /* kernel context for resume */ - int pcb_onfault; /* for copyin/copyout faults */ + void *pcb_onfault; /* for copyin/copyout faults */ register_t pcb_tpc; }; Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Sat Apr 17 09:37:08 2010 (r206748) +++ head/sys/mips/include/pte.h Sat Apr 17 09:42:07 2010 (r206749) @@ -83,7 +83,7 @@ struct tlb { int tlb_lo1; }; -typedef unsigned long pt_entry_t; +typedef unsigned int pt_entry_t; typedef pt_entry_t *pd_entry_t; #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Apr 17 09:37:08 2010 (r206748) +++ head/sys/mips/mips/pmap.c Sat Apr 17 09:42:07 2010 (r206749) @@ -660,7 +660,7 @@ pmap_update_page_action(void *arg) pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; return; } - va = pmap_va_asid(pmap, va); + va = pmap_va_asid(pmap, (va & ~PAGE_MASK)); MachTLBUpdate(va, pte); } @@ -669,6 +669,8 @@ pmap_TLB_update_kernel(vm_offset_t va, p { u_int32_t pid; + va &= ~PAGE_MASK; + MachTLBGetPID(pid); va = va | (pid << VMTLB_PID_SHIFT); @@ -1885,7 +1887,7 @@ validate: if (origpte & PTE_M) { KASSERT((origpte & PTE_RW), ("pmap_enter: modified page not writable:" - " va: %p, pte: 0x%lx", (void *)va, origpte)); + " va: %p, pte: 0x%x", (void *)va, origpte)); if (page_is_managed(opa)) vm_page_dirty(om); } @@ -2381,7 +2383,7 @@ pmap_remove_pages(pmap_t pmap) m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(tpte)); KASSERT(m < &vm_page_array[vm_page_array_size], - ("pmap_remove_pages: bad tpte %lx", tpte)); + ("pmap_remove_pages: bad tpte %x", tpte)); pv->pv_pmap->pm_stats.resident_count--; Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Sat Apr 17 09:37:08 2010 (r206748) +++ head/sys/mips/mips/support.S Sat Apr 17 09:42:07 2010 (r206749) @@ -103,47 +103,22 @@ * Primitives */ -/* - * This table is indexed by u.u_pcb.pcb_onfault in trap(). - * The reason for using this table rather than storing an address in - * u.u_pcb.pcb_onfault is simply to make the code faster. - */ - .globl onfault_table - .data - .align 3 -onfault_table: - .word 0 # invalid index number -#define BADERR 1 - .word baderr -#define COPYERR 2 - .word copyerr -#define FSWBERR 3 - .word fswberr -#define FSWINTRBERR 4 - .word fswintrberr -#if defined(DDB) || defined(DEBUG) -#define DDBERR 5 - .word ddberr -#else - .word 0 -#endif - .text /* * See if access to addr with a len type instruction causes a machine check. - * len is length of access (1=byte, 2=short, 4=long) + * len is length of access (1=byte, 2=short, 4=int) * * badaddr(addr, len) * char *addr; * int len; */ LEAF(badaddr) - li v0, BADERR + PTR_LA v0, baderr GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) + PTR_L v1, PC_CURPCB(v1) bne a1, 1, 2f - sw v0, U_PCB_ONFAULT(v1) + PTR_S v0, U_PCB_ONFAULT(v1) b 5f lbu v0, (a0) 2: @@ -154,7 +129,7 @@ LEAF(badaddr) 4: lw v0, (a0) 5: - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero # made it w/o errors baderr: @@ -169,24 +144,24 @@ END(badaddr) * string is too long, return ENAMETOOLONG; else return 0. */ LEAF(copystr) - move t0, a2 - beq a2, zero, 4f + move t0, a2 + beq a2, zero, 4f 1: - lbu v0, 0(a0) - subu a2, a2, 1 - beq v0, zero, 2f - sb v0, 0(a1) # each byte until NIL - addu a0, a0, 1 - bne a2, zero, 1b # less than maxlen - addu a1, a1, 1 + lbu v0, 0(a0) + PTR_SUBU a2, a2, 1 + beq v0, zero, 2f + sb v0, 0(a1) # each byte until NIL + PTR_ADDU a0, a0, 1 + bne a2, zero, 1b # less than maxlen + PTR_ADDU a1, a1, 1 4: - li v0, ENAMETOOLONG # run out of space + li v0, ENAMETOOLONG # run out of space 2: - beq a3, zero, 3f # return num. of copied bytes - subu a2, t0, a2 # if the 4th arg was non-NULL - sw a2, 0(a3) + beq a3, zero, 3f # return num. of copied bytes + PTR_SUBU a2, t0, a2 # if the 4th arg was non-NULL + PTR_S a2, 0(a3) 3: - j ra # v0 is 0 or ENAMETOOLONG + j ra # v0 is 0 or ENAMETOOLONG nop END(copystr) @@ -196,12 +171,12 @@ END(copystr) */ LEAF(fillw) 1: - addiu a2, a2, -1 - sh a0, 0(a1) - bne a2,zero, 1b - addiu a1, a1, 2 + PTR_ADDU a2, a2, -1 + sh a0, 0(a1) + bne a2,zero, 1b + PTR_ADDU a1, a1, 2 - jr ra + jr ra nop END(fillw) @@ -210,13 +185,13 @@ END(fillw) * mem_zero_page(addr); */ LEAF(mem_zero_page) - li v0, PAGE_SIZE + li v0, PAGE_SIZE 1: - subu v0, 8 - sd zero, 0(a0) - bne zero, v0, 1b - addu a0, 8 - jr ra + PTR_SUBU v0, 8 + sd zero, 0(a0) + bne zero, v0, 1b + PTR_ADDU a0, 8 + jr ra nop END(mem_zero_page) @@ -228,56 +203,56 @@ END(mem_zero_page) * a2 = count */ LEAF(insb) - beq a2, zero, 2f - addu a2, a1 + beq a2, zero, 2f + PTR_ADDU a2, a1 1: - lbu v0, 0(a0) - addiu a1, 1 - bne a1, a2, 1b - sb v0, -1(a1) + lbu v0, 0(a0) + PTR_ADDU a1, 1 + bne a1, a2, 1b + sb v0, -1(a1) 2: - jr ra + jr ra nop END(insb) LEAF(insw) - beq a2, zero, 2f - addu a2, a2 - addu a2, a1 -1: - lhu v0, 0(a0) - addiu a1, 2 - bne a1, a2, 1b - sh v0, -2(a1) + beq a2, zero, 2f + PTR_ADDU a2, a2 + PTR_ADDU a2, a1 +1: + lhu v0, 0(a0) + PTR_ADDU a1, 2 + bne a1, a2, 1b + sh v0, -2(a1) 2: - jr ra + jr ra nop END(insw) LEAF(insl) - beq a2, zero, 2f - sll a2, 2 - addu a2, a1 -1: - lw v0, 0(a0) - addiu a1, 4 - bne a1, a2, 1b - sw v0, -4(a1) + beq a2, zero, 2f + sll a2, 2 + PTR_ADDU a2, a1 +1: + lw v0, 0(a0) + PTR_ADDU a1, 4 + bne a1, a2, 1b + sw v0, -4(a1) 2: - jr ra + jr ra nop END(insl) LEAF(outsb) - beq a2, zero, 2f - addu a2, a1 + beq a2, zero, 2f + PTR_ADDU a2, a1 1: - lbu v0, 0(a1) - addiu a1, 1 - bne a1, a2, 1b - sb v0, 0(a0) + lbu v0, 0(a1) + PTR_ADDU a1, 1 + bne a1, a2, 1b + sb v0, 0(a0) 2: - jr ra + jr ra nop END(outsb) @@ -343,22 +318,22 @@ END(outsl) * u_int maxlength; * u_int *lencopied; */ -NON_LEAF(copyinstr, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) - sw ra, STAND_RA_OFFSET(sp) +NON_LEAF(copyinstr, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space - li v0, COPYERR + REG_S ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) + PTR_L v1, PC_CURPCB(v1) jal _C_LABEL(copystr) - sw v0, U_PCB_ONFAULT(v1) - lw ra, STAND_RA_OFFSET(sp) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw zero, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra - addu sp, sp, STAND_FRAME_SIZE + PTR_ADDU sp, sp, CALLFRAME_SIZ END(copyinstr) /* @@ -371,22 +346,22 @@ END(copyinstr) * u_int maxlength; * u_int *lencopied; */ -NON_LEAF(copyoutstr, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) - sw ra, STAND_RA_OFFSET(sp) +NON_LEAF(copyoutstr, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr blt a1, zero, _C_LABEL(copyerr) # make sure address is in user space - li v0, COPYERR + REG_S ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) + PTR_L v1, PC_CURPCB(v1) jal _C_LABEL(copystr) - sw v0, U_PCB_ONFAULT(v1) - lw ra, STAND_RA_OFFSET(sp) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw zero, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra - addu sp, sp, STAND_FRAME_SIZE + PTR_ADDU sp, sp, CALLFRAME_SIZ END(copyoutstr) /* @@ -396,21 +371,21 @@ END(copyoutstr) * caddr_t *to; (kernel destination address) * unsigned len; */ -NON_LEAF(copyin, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) - sw ra, STAND_RA_OFFSET(sp) +NON_LEAF(copyin, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space - li v0, COPYERR + REG_S ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) + PTR_L v1, PC_CURPCB(v1) jal _C_LABEL(bcopy) - sw v0, U_PCB_ONFAULT(v1) - lw ra, STAND_RA_OFFSET(sp) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) # bcopy modified v1, so reload - sw zero, U_PCB_ONFAULT(v1) - addu sp, sp, STAND_FRAME_SIZE + PTR_L v1, PC_CURPCB(v1) # bcopy modified v1, so reload + PTR_S zero, U_PCB_ONFAULT(v1) + PTR_ADDU sp, sp, CALLFRAME_SIZ j ra move v0, zero END(copyin) @@ -422,31 +397,28 @@ END(copyin) * caddr_t *to; (user destination address) * unsigned len; */ -NON_LEAF(copyout, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) - sw ra, STAND_RA_OFFSET(sp) +NON_LEAF(copyout, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr blt a1, zero, _C_LABEL(copyerr) # make sure address is in user space - li v0, COPYERR + REG_S ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) + PTR_L v1, PC_CURPCB(v1) jal _C_LABEL(bcopy) - sw v0, U_PCB_ONFAULT(v1) - lw ra, STAND_RA_OFFSET(sp) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) # bcopy modified v1, so reload - sw zero, U_PCB_ONFAULT(v1) - addu sp, sp, STAND_FRAME_SIZE + PTR_L v1, PC_CURPCB(v1) # bcopy modified v1, so reload + PTR_S zero, U_PCB_ONFAULT(v1) + PTR_ADDU sp, sp, CALLFRAME_SIZ j ra move v0, zero END(copyout) LEAF(copyerr) - lw ra, STAND_RA_OFFSET(sp) - GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw zero, U_PCB_ONFAULT(v1) - addu sp, sp, STAND_FRAME_SIZE + REG_L ra, CALLFRAME_RA(sp) + PTR_ADDU sp, sp, CALLFRAME_SIZ j ra li v0, EFAULT # return error END(copyerr) @@ -460,51 +432,55 @@ END(copyerr) LEAF(fuword) ALEAF(fuword32) ALEAF(fuiword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) lw v0, 0(a0) # fetch word j ra - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) END(fuword) LEAF(fusword) ALEAF(fuisword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) lhu v0, 0(a0) # fetch short j ra - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) END(fusword) LEAF(fubyte) ALEAF(fuibyte) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) lbu v0, 0(a0) # fetch byte j ra - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) END(fubyte) LEAF(suword32) #ifndef __mips_n64 XLEAF(suword) #endif + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sw a1, 0(a0) # store word - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero END(suword32) @@ -512,13 +488,14 @@ END(suword32) #ifdef __mips_n64 LEAF(suword64) XLEAF(suword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sd a1, 0(a0) # store word - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero END(suword64) @@ -537,11 +514,12 @@ LEAF(casuword32) #ifndef __mips_n64 XLEAF(casuword) #endif + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) 1: move t0, a2 ll v0, 0(a0) @@ -555,7 +533,7 @@ XLEAF(casuword) 2: li v0, -1 3: - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) jr ra nop END(casuword32) @@ -563,11 +541,12 @@ END(casuword32) #ifdef __mips_n64 LEAF(casuword64) XLEAF(casuword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) 1: move t0, a2 lld v0, 0(a0) @@ -581,7 +560,7 @@ XLEAF(casuword) 2: li v0, -1 3: - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) jr ra nop END(casuword64) @@ -593,13 +572,14 @@ END(casuword64) * Have to flush instruction cache afterwards. */ LEAF(suiword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sw a1, 0(a0) # store word - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j _C_LABEL(Mips_SyncICache) # FlushICache sets v0 = 0. (Ugly) li a1, 4 # size of word END(suiword) @@ -610,26 +590,28 @@ END(suiword) */ LEAF(susword) ALEAF(suisword) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sh a1, 0(a0) # store short - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero END(susword) LEAF(subyte) ALEAF(suibyte) + PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space - li v0, FSWBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sb a1, 0(a0) # store byte - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero END(subyte) @@ -645,24 +627,26 @@ END(fswberr) * The important thing is to prevent sleep() and switch(). */ LEAF(fuswintr) + PTR_LA v0, fswintrberr blt a0, zero, fswintrberr # make sure address is in user space - li v0, FSWINTRBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) lhu v0, 0(a0) # fetch short j ra - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) END(fuswintr) LEAF(suswintr) + PTR_LA v0, fswintrberr blt a0, zero, fswintrberr # make sure address is in user space - li v0, FSWINTRBERR + nop GET_CPU_PCPU(v1) - lw v1, PC_CURPCB(v1) - sw v0, U_PCB_ONFAULT(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) sh a1, 0(a0) # store short - sw zero, U_PCB_ONFAULT(v1) + PTR_S zero, U_PCB_ONFAULT(v1) j ra move v0, zero END(suswintr) @@ -673,111 +657,6 @@ LEAF(fswintrberr) END(fswintrberr) /* - * Insert 'p' after 'q'. - * _insque(p, q) - * caddr_t p, q; - */ -LEAF(_insque) - lw v0, 0(a1) # v0 = q->next - sw a1, 4(a0) # p->prev = q - sw v0, 0(a0) # p->next = q->next - sw a0, 4(v0) # q->next->prev = p - j ra - sw a0, 0(a1) # q->next = p -END(_insque) - -/* - * Remove item 'p' from queue. - * _remque(p) - * caddr_t p; - */ -LEAF(_remque) - lw v0, 0(a0) # v0 = p->next - lw v1, 4(a0) # v1 = p->prev - nop - sw v0, 0(v1) # p->prev->next = p->next - j ra - sw v1, 4(v0) # p->next->prev = p->prev -END(_remque) - -/*-------------------------------------------------------------------------- - * - * Mips_GetCOUNT -- - * - * Mips_GetCOUNT() - * - * Results: - * Returns the current COUNT reg. - * - * Side effects: - * None. - * - *-------------------------------------------------------------------------- - */ -LEAF(Mips_GetCOUNT) - mfc0 v0, COP_0_COUNT - nop #??? - nop #??? - j ra - nop -END(Mips_GetCOUNT) - -/*-------------------------------------------------------------------------- - * - * Mips_SetCOMPARE -- - * - * Mips_SetCOMPARE() - * - * Results: - * Sets a new value to the COMPARE register. - * - * Side effects: - * The COMPARE equal interrupt is acknowledged. - * - *-------------------------------------------------------------------------- - */ -LEAF(Mips_SetCOMPARE) - mtc0 a0, COP_0_COMPARE - j ra - nop -END(Mips_SetCOMPARE) - -LEAF(Mips_GetCOMPARE) - mfc0 v0, COP_0_COMPARE - j ra - nop -END(Mips_GetCOMPARE) - -/* - * u_int32_t mips_cp0_status_read(void) - * - * Return the current value of the CP0 Status register. - */ -LEAF(mips_cp0_status_read) - mfc0 v0, COP_0_STATUS_REG - j ra - nop -END(mips_cp0_status_read) - -/* - * void mips_cp0_status_write(u_int32_t) - * - * Set the value of the CP0 Status register. - * - * Note: This is almost certainly not the way you want to write a - * "permanent" value to to the CP0 Status register, since it gets - * saved in trap frames and restores. - */ -LEAF(mips_cp0_status_write) - mtc0 a0, COP_0_STATUS_REG - nop - nop - j ra - nop -END(mips_cp0_status_write) - - -/* * memcpy(to, from, len) * {ov}bcopy(from, to, len) */ @@ -789,7 +668,7 @@ LEAF(memcpy) ALEAF(bcopy) ALEAF(ovbcopy) .set noreorder - addu t0, a0, a2 # t0 = end of s1 region + PTR_ADDU t0, a0, a2 # t0 = end of s1 region sltu t1, a1, t0 sltu t2, a0, a1 and t1, t1, t2 # t1 = true if from < to < (from+len) @@ -797,11 +676,11 @@ ALEAF(ovbcopy) slt t2, a2, 12 # check for small copy ble a2, zero, 2f - addu t1, a1, a2 # t1 = end of to region + PTR_ADDU t1, a1, a2 # t1 = end of to region 1: lb v1, -1(t0) # copy bytes backwards, - subu t0, t0, 1 # doesnt happen often so do slow way - subu t1, t1, 1 + PTR_SUBU t0, t0, 1 # doesnt happen often so do slow way + PTR_SUBU t1, t1, 1 bne t0, a0, 1b sb v1, 0(t1) 2: @@ -811,59 +690,59 @@ forward: bne t2, zero, smallcpy # do a small bcopy xor v1, a0, a1 # compare low two bits of addresses and v1, v1, 3 - subu a3, zero, a1 # compute # bytes to word align address + PTR_SUBU a3, zero, a1 # compute # bytes to word align address beq v1, zero, aligned # addresses can be word aligned and a3, a3, 3 beq a3, zero, 1f - subu a2, a2, a3 # subtract from remaining count + PTR_SUBU a2, a2, a3 # subtract from remaining count LWHI v1, 0(a0) # get next 4 bytes (unaligned) LWLO v1, 3(a0) - addu a0, a0, a3 + PTR_ADDU a0, a0, a3 SWHI v1, 0(a1) # store 1, 2, or 3 bytes to align a1 - addu a1, a1, a3 + PTR_ADDU a1, a1, a3 1: and v1, a2, 3 # compute number of words left - subu a3, a2, v1 + PTR_SUBU a3, a2, v1 move a2, v1 - addu a3, a3, a0 # compute ending address + PTR_ADDU a3, a3, a0 # compute ending address 2: LWHI v1, 0(a0) # copy words a0 unaligned, a1 aligned LWLO v1, 3(a0) - addu a0, a0, 4 + PTR_ADDU a0, a0, 4 sw v1, 0(a1) - addu a1, a1, 4 + PTR_ADDU a1, a1, 4 bne a0, a3, 2b nop # We have to do this mmu-bug. b smallcpy nop aligned: beq a3, zero, 1f - subu a2, a2, a3 # subtract from remaining count + PTR_SUBU a2, a2, a3 # subtract from remaining count LWHI v1, 0(a0) # copy 1, 2, or 3 bytes to align - addu a0, a0, a3 + PTR_ADDU a0, a0, a3 SWHI v1, 0(a1) - addu a1, a1, a3 + PTR_ADDU a1, a1, a3 1: and v1, a2, 3 # compute number of whole words left - subu a3, a2, v1 + PTR_SUBU a3, a2, v1 move a2, v1 - addu a3, a3, a0 # compute ending address + PTR_ADDU a3, a3, a0 # compute ending address 2: lw v1, 0(a0) # copy words - addu a0, a0, 4 + PTR_ADDU a0, a0, 4 sw v1, 0(a1) bne a0, a3, 2b - addu a1, a1, 4 + PTR_ADDU a1, a1, 4 smallcpy: ble a2, zero, 2f - addu a3, a2, a0 # compute ending address + PTR_ADDU a3, a2, a0 # compute ending address 1: lbu v1, 0(a0) # copy bytes - addu a0, a0, 1 + PTR_ADDU a0, a0, 1 sb v1, 0(a1) bne a0, a3, 1b - addu a1, a1, 1 # MMU BUG ? can not do -1(a1) at 0x80000000!! + PTR_ADDU a1, a1, 1 # MMU BUG ? can not do -1(a1) at 0x80000000!! 2: j ra nop @@ -883,19 +762,19 @@ LEAF(memset) sll t2, t1, 16 # shift that left 16 or t1, t2, t1 # or together - subu t0, zero, a0 # compute # bytes to word align address + PTR_SUBU t0, zero, a0 # compute # bytes to word align address and t0, t0, 3 beq t0, zero, 1f # skip if word aligned - subu a2, a2, t0 # subtract from remaining count + PTR_SUBU a2, a2, t0 # subtract from remaining count SWHI t1, 0(a0) # store 1, 2, or 3 bytes to align - addu a0, a0, t0 + PTR_ADDU a0, a0, t0 1: and v1, a2, 3 # compute number of whole words left - subu t0, a2, v1 - subu a2, a2, t0 - addu t0, t0, a0 # compute ending address + PTR_SUBU t0, a2, v1 + PTR_SUBU a2, a2, t0 + PTR_ADDU t0, t0, a0 # compute ending address 2: - addu a0, a0, 4 # clear words + PTR_ADDU a0, a0, 4 # clear words #ifdef MIPS3_5900 nop nop @@ -907,9 +786,9 @@ LEAF(memset) memsetsmallclr: ble a2, zero, 2f - addu t0, a2, a0 # compute ending address + PTR_ADDU t0, a2, a0 # compute ending address 1: - addu a0, a0, 1 # clear bytes + PTR_ADDU a0, a0, 1 # clear bytes #ifdef MIPS3_5900 nop nop @@ -931,26 +810,26 @@ LEAF(bzero) ALEAF(blkclr) .set noreorder blt a1, 12, smallclr # small amount to clear? - subu a3, zero, a0 # compute # bytes to word align address + PTR_SUBU a3, zero, a0 # compute # bytes to word align address and a3, a3, 3 beq a3, zero, 1f # skip if word aligned - subu a1, a1, a3 # subtract from remaining count + PTR_SUBU a1, a1, a3 # subtract from remaining count SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align - addu a0, a0, a3 + PTR_ADDU a0, a0, a3 1: and v0, a1, 3 # compute number of words left - subu a3, a1, v0 + PTR_SUBU a3, a1, v0 move a1, v0 - addu a3, a3, a0 # compute ending address + PTR_ADDU a3, a3, a0 # compute ending address 2: - addu a0, a0, 4 # clear words + PTR_ADDU a0, a0, 4 # clear words bne a0, a3, 2b # unrolling loop does not help sw zero, -4(a0) # since we are limited by memory speed smallclr: ble a1, zero, 2f - addu a3, a1, a0 # compute ending address + PTR_ADDU a3, a1, a0 # compute ending address 1: - addu a0, a0, 1 # clear bytes + PTR_ADDU a0, a0, 1 # clear bytes bne a0, a3, 1b sb zero, -1(a0) 2: @@ -967,66 +846,66 @@ LEAF(bcmp) blt a2, 16, smallcmp # is it worth any trouble? xor v0, a0, a1 # compare low two bits of addresses and v0, v0, 3 - subu a3, zero, a1 # compute # bytes to word align address + PTR_SUBU a3, zero, a1 # compute # bytes to word align address bne v0, zero, unalignedcmp # not possible to align addresses and a3, a3, 3 beq a3, zero, 1f - subu a2, a2, a3 # subtract from remaining count + PTR_SUBU a2, a2, a3 # subtract from remaining count move v0, v1 # init v0,v1 so unmodified bytes match LWHI v0, 0(a0) # read 1, 2, or 3 bytes LWHI v1, 0(a1) - addu a1, a1, a3 + PTR_ADDU a1, a1, a3 bne v0, v1, nomatch - addu a0, a0, a3 + PTR_ADDU a0, a0, a3 1: and a3, a2, ~3 # compute number of whole words left - subu a2, a2, a3 # which has to be >= (16-3) & ~3 - addu a3, a3, a0 # compute ending address + PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3 + PTR_ADDU a3, a3, a0 # compute ending address 2: lw v0, 0(a0) # compare words lw v1, 0(a1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 11:40:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED31A1065674; Sat, 17 Apr 2010 11:40:39 +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 DD14D8FC1C; Sat, 17 Apr 2010 11:40: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 o3HBedfE045228; Sat, 17 Apr 2010 11:40:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HBed7i045226; Sat, 17 Apr 2010 11:40:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004171140.o3HBed7i045226@svn.freebsd.org> From: Rui Paulo Date: Sat, 17 Apr 2010 11:40: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: r206755 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 11:40:40 -0000 Author: rpaulo Date: Sat Apr 17 11:40:39 2010 New Revision: 206755 URL: http://svn.freebsd.org/changeset/base/206755 Log: Add another ICH7M chipset that works. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Apr 17 11:38:18 2010 (r206754) +++ head/sys/dev/ahci/ahci.c Sat Apr 17 11:40:39 2010 (r206755) @@ -126,6 +126,7 @@ static struct { {0x26838086, 0x00, "Intel ESB2", 0}, {0x27c18086, 0x00, "Intel ICH7", 0}, {0x27c38086, 0x00, "Intel ICH7", 0}, + {0x27c48086, 0x00, "Intel ICH7M", 0}, {0x27c58086, 0x00, "Intel ICH7M", 0}, {0x27c68086, 0x00, "Intel ICH7M", 0}, {0x28218086, 0x00, "Intel ICH8", 0}, From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 12:22:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1103106566B; Sat, 17 Apr 2010 12:22:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B70908FC1F; Sat, 17 Apr 2010 12:22: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 o3HCMiNB054598; Sat, 17 Apr 2010 12:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HCMiD3054594; Sat, 17 Apr 2010 12:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201004171222.o3HCMiD3054594@svn.freebsd.org> From: Michael Tuexen Date: Sat, 17 Apr 2010 12:22: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: r206758 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 12:22:45 -0000 Author: tuexen Date: Sat Apr 17 12:22:44 2010 New Revision: 206758 URL: http://svn.freebsd.org/changeset/base/206758 Log: Fix a bug where SACKs are not sent when they should. Move some protection code to INVARIANTS. Cleanups. MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Apr 17 12:01:50 2010 (r206757) +++ head/sys/netinet/sctp_indata.c Sat Apr 17 12:22:44 2010 (r206758) @@ -1466,7 +1466,7 @@ sctp_process_a_data_chunk(struct sctp_tc asoc->send_sack = 1; } protocol_id = ch->dp.protocol_id; - ordered = ((ch->ch.chunk_flags & SCTP_DATA_UNORDERED) == 0); + ordered = ((chunk_flags & SCTP_DATA_UNORDERED) == 0); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(tsn, asoc->cumulative_tsn, asoc->highest_tsn_inside_map, SCTP_MAP_TSN_ENTERS); } @@ -2300,7 +2300,12 @@ sctp_slide_mapping_arrays(struct sctp_tc if ((asoc->cumulative_tsn == highest_tsn) && (at >= 8)) { /* The complete array was completed by a single FR */ /* highest becomes the cum-ack */ - int clr, i; + int clr; + +#ifdef INVARIANTS + unsigned int i; + +#endif /* clear the array */ clr = ((at + 7) >> 3); @@ -2309,12 +2314,14 @@ sctp_slide_mapping_arrays(struct sctp_tc } memset(asoc->mapping_array, 0, clr); memset(asoc->nr_mapping_array, 0, clr); +#ifdef INVARIANTS for (i = 0; i < asoc->mapping_array_size; i++) { if ((asoc->mapping_array[i]) || (asoc->nr_mapping_array[i])) { printf("Error Mapping array's not clean at clear\n"); sctp_print_mapping_array(asoc); } } +#endif asoc->mapping_array_base_tsn = asoc->cumulative_tsn + 1; asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map = asoc->cumulative_tsn; } else if (at >= 8) { @@ -2371,10 +2378,8 @@ sctp_slide_mapping_arrays(struct sctp_tc int ii; for (ii = 0; ii < distance; ii++) { - asoc->mapping_array[ii] = - asoc->mapping_array[slide_from + ii]; - asoc->nr_mapping_array[ii] = - asoc->nr_mapping_array[slide_from + ii]; + asoc->mapping_array[ii] = asoc->mapping_array[slide_from + ii]; + asoc->nr_mapping_array[ii] = asoc->nr_mapping_array[slide_from + ii]; } for (ii = distance; ii < asoc->mapping_array_size; ii++) { @@ -2808,8 +2813,8 @@ sctp_process_data(struct mbuf **mm, int stcb->asoc.send_sack = 1; } /* Start a sack timer or QUEUE a SACK for sending */ - if ((stcb->asoc.cumulative_tsn == stcb->asoc.highest_tsn_inside_map) && - (stcb->asoc.mapping_array[0] != 0xff)) { + if ((stcb->asoc.cumulative_tsn == stcb->asoc.highest_tsn_inside_nr_map) && + (stcb->asoc.nr_mapping_array[0] != 0xff)) { if ((stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) || (stcb->asoc.delayed_ack == 0) || (stcb->asoc.numduptsns) || From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 14:35:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CE37106564A; Sat, 17 Apr 2010 14:35:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AED98FC18; Sat, 17 Apr 2010 14:35: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 o3HEZlJ8083781; Sat, 17 Apr 2010 14:35:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HEZktM083776; Sat, 17 Apr 2010 14:35:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004171435.o3HEZktM083776@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 17 Apr 2010 14:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206759 - in head: bin/sh tools/regression/bin/sh/parameters X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 14:35:47 -0000 Author: jilles Date: Sat Apr 17 14:35:46 2010 New Revision: 206759 URL: http://svn.freebsd.org/changeset/base/206759 Log: sh: On startup of the shell, use PWD from the environment if it is valid. Unset PWD if it is incorrect and no value for it can be determined. This preserves the logical current directory across shell invocations. Example (assuming /home is a symlink): $ cd $ pwd /home/foo $ sh $ pwd /home/foo Formerly the second pwd would show the physical path (symlinks resolved). Added: head/tools/regression/bin/sh/parameters/pwd2.0 (contents, props changed) Modified: head/bin/sh/cd.c head/bin/sh/cd.h head/bin/sh/main.c Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Sat Apr 17 12:22:44 2010 (r206758) +++ head/bin/sh/cd.c Sat Apr 17 14:35:46 2010 (r206759) @@ -70,6 +70,7 @@ STATIC int docd(char *, int, int); STATIC char *getcomponent(void); STATIC char *findcwd(char *); STATIC void updatepwd(char *); +STATIC char *getpwd(void); STATIC char *getpwd2(void); STATIC char *curdir = NULL; /* current working directory */ @@ -351,7 +352,7 @@ pwdcmd(int argc, char **argv) /* * Get the current directory and cache the result in curdir. */ -char * +STATIC char * getpwd(void) { char *p; @@ -374,7 +375,6 @@ getpwd(void) STATIC char * getpwd2(void) { - struct stat stdot, stpwd; char *pwd; int i; @@ -387,12 +387,29 @@ getpwd2(void) break; } - pwd = getenv("PWD"); + return NULL; +} + +/* + * Initialize PWD in a new shell. + * If the shell is interactive, we need to warn if this fails. + */ +void +pwd_init(int warn) +{ + char *pwd; + struct stat stdot, stpwd; + + pwd = lookupvar("PWD"); if (pwd && *pwd == '/' && stat(".", &stdot) != -1 && stat(pwd, &stpwd) != -1 && stdot.st_dev == stpwd.st_dev && stdot.st_ino == stpwd.st_ino) { - return pwd; + if (curdir) + ckfree(curdir); + curdir = savestr(pwd); } - return NULL; + if (getpwd() == NULL && warn) + out2fmt_flush("sh: cannot determine working directory\n"); + setvar("PWD", curdir, VEXPORT); } Modified: head/bin/sh/cd.h ============================================================================== --- head/bin/sh/cd.h Sat Apr 17 12:22:44 2010 (r206758) +++ head/bin/sh/cd.h Sat Apr 17 14:35:46 2010 (r206759) @@ -29,6 +29,6 @@ * $FreeBSD$ */ -char *getpwd(void); +void pwd_init(int); int cdcmd (int, char **); int pwdcmd(int, char **); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sat Apr 17 12:22:44 2010 (r206758) +++ head/bin/sh/main.c Sat Apr 17 14:35:46 2010 (r206759) @@ -153,10 +153,7 @@ main(int argc, char *argv[]) init(); setstackmark(&smark); procargs(argc, argv); - if (getpwd() == NULL && iflag) - out2fmt_flush("sh: cannot determine working directory\n"); - if (getpwd() != NULL) - setvar ("PWD", getpwd(), VEXPORT); + pwd_init(iflag); if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { Added: head/tools/regression/bin/sh/parameters/pwd2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parameters/pwd2.0 Sat Apr 17 14:35:46 2010 (r206759) @@ -0,0 +1,24 @@ +# $FreeBSD$ +# Check that PWD is exported and accepted from the environment. +set -e + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd -P $T +TP=$(pwd) +mkdir test1 +ln -s test1 link +cd link +[ "$PWD" = "$TP/link" ] +[ "$(pwd)" = "$TP/link" ] +[ "$(pwd -P)" = "$TP/test1" ] +[ "$(sh -c pwd)" = "$TP/link" ] +[ "$(sh -c pwd\ -P)" = "$TP/test1" ] +cd .. +[ "$(pwd)" = "$TP" ] +cd -P link +[ "$PWD" = "$TP/test1" ] +[ "$(pwd)" = "$TP/test1" ] +[ "$(pwd -P)" = "$TP/test1" ] +[ "$(sh -c pwd)" = "$TP/test1" ] +[ "$(sh -c pwd\ -P)" = "$TP/test1" ] From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 15:52:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1363C1065675; Sat, 17 Apr 2010 15:52:51 +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 01CA08FC1F; Sat, 17 Apr 2010 15:52: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 o3HFqo9b001520; Sat, 17 Apr 2010 15:52:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HFqopa001518; Sat, 17 Apr 2010 15:52:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004171552.o3HFqopa001518@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 17 Apr 2010 15:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206760 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 15:52:51 -0000 Author: jilles Date: Sat Apr 17 15:52:50 2010 New Revision: 206760 URL: http://svn.freebsd.org/changeset/base/206760 Log: getcwd(3): Clarify that EACCES may or may not be checked. POSIX permits but does not require checking access on the current and parent directories. Because various programs do not like it if getcwd(3) fails, it seems best to avoid checking access as much as possible. There are various reports in GNATS about this (search for getcwd). Our getcwd(3) implementation first queries the kernel for the pathname directly, which does not check any permissions but sometimes fails, and then falls back to reading all parent directories for the names. PR: standards/44425 MFC after: 2 weeks Modified: head/lib/libc/gen/getcwd.3 Modified: head/lib/libc/gen/getcwd.3 ============================================================================== --- head/lib/libc/gen/getcwd.3 Sat Apr 17 14:35:46 2010 (r206759) +++ head/lib/libc/gen/getcwd.3 Sat Apr 17 15:52:50 2010 (r206760) @@ -28,7 +28,7 @@ .\" @(#)getcwd.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 24, 1997 +.Dd April 17, 2010 .Dt GETCWD 3 .Os .Sh NAME @@ -108,8 +108,6 @@ The function will fail if: .Bl -tag -width Er -.It Bq Er EACCES -Read or search permission was denied for a component of the pathname. .It Bq Er EINVAL The .Fa size @@ -124,6 +122,16 @@ The argument is greater than zero but smaller than the length of the pathname plus 1. .El +.Pp +The +.Fn getcwd +function +may fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Read or search permission was denied for a component of the pathname. +This is only checked in limited cases, depending on implementation details. +.El .Sh SEE ALSO .Xr chdir 2 , .Xr fchdir 2 , From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 17:02:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADAE9106566B; Sat, 17 Apr 2010 17:02:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEC58FC19; Sat, 17 Apr 2010 17:02: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 o3HH2HNK016838; Sat, 17 Apr 2010 17:02:17 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HH2H3W016836; Sat, 17 Apr 2010 17:02:17 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004171702.o3HH2H3W016836@svn.freebsd.org> From: Alan Cox Date: Sat, 17 Apr 2010 17:02: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: r206761 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 17:02:17 -0000 Author: alc Date: Sat Apr 17 17:02:17 2010 New Revision: 206761 URL: http://svn.freebsd.org/changeset/base/206761 Log: Setting PG_REFERENCED on the requested page in swap_pager_getpages() is either redundant or harmful, depending on the caller. For example, when called by vm_fault(), it is redundant. However, when called by vm_thread_swapin(), it is harmful. Specifically, if the thread is later swapped out, having PG_REFERENCED set on its stack pages leads the page daemon to reactivate these stack pages and delay their reclamation. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Apr 17 15:52:50 2010 (r206760) +++ head/sys/vm/swap_pager.c Sat Apr 17 17:02:17 2010 (r206761) @@ -1101,8 +1101,7 @@ swap_pager_getpages(vm_object_t object, * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the * loops are set up such that the case(s) are handled implicitly. * - * The swp_*() calls must be made at splvm(). vm_page_free() does - * not need to be, but it will go a little faster if it is. + * The swp_*() calls must be made with the object locked. */ blk = swp_pager_meta_ctl(mreq->object, mreq->pindex, 0); @@ -1212,9 +1211,6 @@ swap_pager_getpages(vm_object_t object, VM_OBJECT_LOCK(object); while ((mreq->oflags & VPO_SWAPINPROG) != 0) { mreq->oflags |= VPO_WANTED; - vm_page_lock_queues(); - vm_page_flag_set(mreq, PG_REFERENCED); - vm_page_unlock_queues(); PCPU_INC(cnt.v_intrans); if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) { printf( From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:13:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7319106564A; Sat, 17 Apr 2010 18:13:52 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B673F8FC18; Sat, 17 Apr 2010 18:13: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 o3HIDqJ0032566; Sat, 17 Apr 2010 18:13:52 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIDqHN032564; Sat, 17 Apr 2010 18:13:52 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004171813.o3HIDqHN032564@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 17 Apr 2010 18:13: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: r206763 - head/sys/dev/ipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:13:52 -0000 Author: bschmidt Date: Sat Apr 17 18:13:52 2010 New Revision: 206763 URL: http://svn.freebsd.org/changeset/base/206763 Log: Fix comment about ipw_assoc and remove some whitespaces; no functional changes. Approved by: rpaulo (mentor) Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Apr 17 17:40:12 2010 (r206762) +++ head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:13:52 2010 (r206763) @@ -888,10 +888,10 @@ ipw_newstate(struct ieee80211vap *vap, e /* * XXX when joining an ibss network we are called * with a SCAN -> RUN transition on scan complete. - * Use that to call ipw_auth_and_assoc. On completing - * the join we are then called again with an - * AUTH -> RUN transition and we want to do nothing. - * This is all totally bogus and needs to be redone. + * Use that to call ipw_assoc. On completing the + * join we are then called again with an AUTH -> RUN + * transition and we want to do nothing. This is + * all totally bogus and needs to be redone. */ if (ostate == IEEE80211_S_SCAN) ipw_assoc(ic, vap); @@ -909,7 +909,7 @@ ipw_newstate(struct ieee80211vap *vap, e case IEEE80211_S_ASSOC: /* - * If we are not transitioning from AUTH the resend the + * If we are not transitioning from AUTH then resend the * association request. */ if (ostate != IEEE80211_S_AUTH) @@ -1070,7 +1070,7 @@ ipw_rx_newstate_intr(struct ipw_softc *s case IPW_STATE_DISABLED: /* XXX? is this right? */ - sc->flags &= ~(IPW_FLAG_HACK | IPW_FLAG_SCANNING | + sc->flags &= ~(IPW_FLAG_HACK | IPW_FLAG_SCANNING | IPW_FLAG_ASSOCIATING | IPW_FLAG_ASSOCIATED); DPRINTFN(2, ("Firmware disabled (%s flags 0x%x)\n", IEEESTATE(vap), sc->flags)); From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:14:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 354F81065678; Sat, 17 Apr 2010 18:14:50 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24B908FC08; Sat, 17 Apr 2010 18:14: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 o3HIEoPY032836; Sat, 17 Apr 2010 18:14:50 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIEo2b032834; Sat, 17 Apr 2010 18:14:50 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004171814.o3HIEo2b032834@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 17 Apr 2010 18:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206764 - head/sys/dev/ipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:14:50 -0000 Author: bschmidt Date: Sat Apr 17 18:14:49 2010 New Revision: 206764 URL: http://svn.freebsd.org/changeset/base/206764 Log: Pass correct RSSI to ieee80211_input*(). Approved by: rpaulo (mentor) Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:13:52 2010 (r206763) +++ head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:14:49 2010 (r206764) @@ -1234,10 +1234,10 @@ ipw_rx_data_intr(struct ipw_softc *sc, s IPW_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); if (ni != NULL) { - (void) ieee80211_input(ni, m, rssi, nf); + (void) ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else - (void) ieee80211_input_all(ic, m, rssi, nf); + (void) ieee80211_input_all(ic, m, rssi - nf, nf); IPW_LOCK(sc); bus_dmamap_sync(sc->rbd_dmat, sc->rbd_map, BUS_DMASYNC_PREWRITE); From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:16:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D14F106567A; Sat, 17 Apr 2010 18:16:14 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CDB88FC0C; Sat, 17 Apr 2010 18:16: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 o3HIGEZM033176; Sat, 17 Apr 2010 18:16:14 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIGECx033174; Sat, 17 Apr 2010 18:16:14 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004171816.o3HIGECx033174@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 17 Apr 2010 18:16: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: r206765 - head/sys/dev/ipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:16:14 -0000 Author: bschmidt Date: Sat Apr 17 18:16:14 2010 New Revision: 206765 URL: http://svn.freebsd.org/changeset/base/206765 Log: - Make ipw usable again by moving directly into ASSOC state. - No need to manually switch to RUN state, assoc response takes care of that. Approved by: rpaulo (mentor) Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:14:49 2010 (r206764) +++ head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:16:14 2010 (r206765) @@ -904,6 +904,13 @@ ipw_newstate(struct ieee80211vap *vap, e break; case IEEE80211_S_AUTH: + /* + * Move to ASSOC state after the ipw_assoc() call. Firmware + * takes care of authentication, after the call we'll receive + * only an assoc response which would otherwise be discared + * if we are still in AUTH state. + */ + nstate = IEEE80211_S_ASSOC; ipw_assoc(ic, vap); break; @@ -1021,7 +1028,6 @@ ipw_rx_newstate_intr(struct ipw_softc *s } sc->flags &= ~IPW_FLAG_ASSOCIATING; sc->flags |= IPW_FLAG_ASSOCIATED; - ieee80211_new_state(vap, IEEE80211_S_RUN, -1); break; case IPW_STATE_SCANNING: From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:17:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 623F71065674; Sat, 17 Apr 2010 18:17:25 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51FA98FC15; Sat, 17 Apr 2010 18:17: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 o3HIHPut033476; Sat, 17 Apr 2010 18:17:25 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIHPdp033474; Sat, 17 Apr 2010 18:17:25 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004171817.o3HIHPdp033474@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 17 Apr 2010 18:17: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: r206766 - head/sys/dev/ipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:17:25 -0000 Author: bschmidt Date: Sat Apr 17 18:17:25 2010 New Revision: 206766 URL: http://svn.freebsd.org/changeset/base/206766 Log: Use iv_appie_wpa, with this commit WPA works again. Approved by: rpaulo (mentor) Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:16:14 2010 (r206765) +++ head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:17:25 2010 (r206766) @@ -2266,8 +2266,8 @@ ipw_assoc(struct ieee80211com *ic, struc if (error != 0) goto done; - if (vap->iv_appie_assocreq != NULL) { - struct ieee80211_appie *ie = vap->iv_appie_assocreq; + if (vap->iv_appie_wpa != NULL) { + struct ieee80211_appie *ie = vap->iv_appie_wpa; error = ipw_setwpaie(sc, ie->ie_data, ie->ie_len); if (error != 0) goto done; From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:18:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD83106564A; Sat, 17 Apr 2010 18:18:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0B38FC19; Sat, 17 Apr 2010 18:18: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 o3HIIkR4033806; Sat, 17 Apr 2010 18:18:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIIkJC033803; Sat, 17 Apr 2010 18:18:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004171818.o3HIIkJC033803@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 17 Apr 2010 18:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206767 - head/sys/dev/ipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:18:46 -0000 Author: bschmidt Date: Sat Apr 17 18:18:46 2010 New Revision: 206767 URL: http://svn.freebsd.org/changeset/base/206767 Log: Remove IPW_LOCK_DECL and fix various LORs. Approved by: rpaulo (mentor) Modified: head/sys/dev/ipw/if_ipw.c head/sys/dev/ipw/if_ipwvar.h Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:17:25 2010 (r206766) +++ head/sys/dev/ipw/if_ipw.c Sat Apr 17 18:18:46 2010 (r206767) @@ -1040,8 +1040,10 @@ ipw_rx_newstate_intr(struct ipw_softc *s * we checked the 802.11 layer state. */ if (sc->flags & IPW_FLAG_ASSOCIATED) { + IPW_UNLOCK(sc); /* XXX probably need to issue disassoc to fw */ ieee80211_beacon_miss(ic); + IPW_LOCK(sc); } break; @@ -1060,7 +1062,9 @@ ipw_rx_newstate_intr(struct ipw_softc *s break; } if (sc->flags & IPW_FLAG_SCANNING) { + IPW_UNLOCK(sc); ieee80211_scan_done(vap); + IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; sc->sc_scan_timer = 0; } @@ -1070,8 +1074,11 @@ ipw_rx_newstate_intr(struct ipw_softc *s DPRINTFN(2, ("Association lost (%s flags 0x%x)\n", IEEESTATE(vap), sc->flags)); sc->flags &= ~(IPW_FLAG_ASSOCIATING | IPW_FLAG_ASSOCIATED); - if (vap->iv_state == IEEE80211_S_RUN) + if (vap->iv_state == IEEE80211_S_RUN) { + IPW_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + IPW_LOCK(sc); + } break; case IPW_STATE_DISABLED: @@ -1170,7 +1177,6 @@ ipw_rx_data_intr(struct ipw_softc *sc, s bus_addr_t physaddr; int error; int8_t rssi, nf; - IPW_LOCK_DECL; DPRINTFN(5, ("received frame len=%u, rssi=%u\n", le32toh(status->len), status->rssi)); @@ -1384,8 +1390,11 @@ ipw_fatal_error_intr(struct ipw_softc *s struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); device_printf(sc->sc_dev, "firmware error\n"); - if (vap != NULL) + if (vap != NULL) { + IPW_UNLOCK(sc); ieee80211_cancel_scan(vap); + IPW_LOCK(sc); + } ieee80211_runtask(ic, &sc->sc_init_task); } @@ -1394,7 +1403,6 @@ ipw_intr(void *arg) { struct ipw_softc *sc = arg; uint32_t r; - IPW_LOCK_DECL; IPW_LOCK(sc); @@ -1724,7 +1732,6 @@ static void ipw_start(struct ifnet *ifp) { struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_start_locked(ifp); @@ -1781,7 +1788,9 @@ ipw_watchdog(void *arg) DPRINTFN(3, ("Scan timeout\n")); /* End the scan */ if (sc->flags & IPW_FLAG_SCANNING) { + IPW_UNLOCK(sc); ieee80211_scan_done(TAILQ_FIRST(&ic->ic_vaps)); + IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; } } @@ -1797,7 +1806,6 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; - IPW_LOCK_DECL; switch (cmd) { case SIOCSIFFLAGS: @@ -2207,7 +2215,6 @@ ipw_assoc(struct ieee80211com *ic, struc struct ipw_security security; uint32_t data; int error; - IPW_LOCK_DECL; IPW_LOCK(sc); error = ipw_disable(sc); @@ -2297,7 +2304,6 @@ ipw_disassoc(struct ieee80211com *ic, st struct ifnet *ifp = vap->iv_ic->ic_ifp; struct ieee80211_node *ni = vap->iv_bss; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); DPRINTF(("Disassociate from %6D\n", ni->ni_bssid, ":")); @@ -2333,7 +2339,6 @@ ipw_init(void *priv) struct ipw_softc *sc = priv; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_init_locked(sc); @@ -2540,7 +2545,6 @@ static void ipw_stop(void *priv) { struct ipw_softc *sc = priv; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_stop_locked(sc); @@ -2667,7 +2671,6 @@ ipw_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_scan(sc); @@ -2679,7 +2682,6 @@ ipw_set_channel(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -2707,7 +2709,6 @@ ipw_scan_end(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; Modified: head/sys/dev/ipw/if_ipwvar.h ============================================================================== --- head/sys/dev/ipw/if_ipwvar.h Sat Apr 17 18:17:25 2010 (r206766) +++ head/sys/dev/ipw/if_ipwvar.h Sat Apr 17 18:18:46 2010 (r206767) @@ -164,13 +164,6 @@ struct ipw_softc { * NB.: This models the only instance of async locking in ipw_init_locked * and must be kept in sync. */ -#define IPW_LOCK_DECL int __waslocked = 0 -#define IPW_LOCK(sc) do { \ - if (!(__waslocked = mtx_owned(&(sc)->sc_mtx))) \ - mtx_lock(&sc->sc_mtx); \ -} while (0) -#define IPW_UNLOCK(sc) do { \ - if (!__waslocked) \ - mtx_unlock(&sc->sc_mtx); \ -} while (0) +#define IPW_LOCK(sc) mtx_lock(&sc->sc_mtx); +#define IPW_UNLOCK(sc) mtx_unlock(&sc->sc_mtx); #define IPW_LOCK_ASSERT(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:35:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7099F106564A; Sat, 17 Apr 2010 18:35:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 607958FC19; Sat, 17 Apr 2010 18:35: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 o3HIZ7W5037485; Sat, 17 Apr 2010 18:35:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HIZ7i3037483; Sat, 17 Apr 2010 18:35:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004171835.o3HIZ7i3037483@svn.freebsd.org> From: Alan Cox Date: Sat, 17 Apr 2010 18:35: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: r206768 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:35:07 -0000 Author: alc Date: Sat Apr 17 18:35:07 2010 New Revision: 206768 URL: http://svn.freebsd.org/changeset/base/206768 Log: In vm_object_backing_scan(), setting PG_REFERENCED on a page before sleeping on that page is nonsensical. Doing so reduces the likelihood that the page daemon will reclaim the page before the thread waiting in vm_object_backing_scan() is reawakened. However, it does not guarantee that the page is not reclaimed, so vm_object_backing_scan() restarts after reawakening. More importantly, this muddles the meaning of PG_REFERENCED. There is no reason to believe that the caller of vm_object_backing_scan() is going to use (i.e., access) the contents of the page. There is especially no reason to believe that an access is more likely because vm_object_backing_scan() had to sleep on the page. Discussed with: kib MFC after: 3 weeks Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Apr 17 18:18:46 2010 (r206767) +++ head/sys/vm/vm_object.c Sat Apr 17 18:35:07 2010 (r206768) @@ -1553,9 +1553,6 @@ vm_object_backing_scan(vm_object_t objec } } else if (op & OBSC_COLLAPSE_WAIT) { if ((p->oflags & VPO_BUSY) || p->busy) { - vm_page_lock_queues(); - vm_page_flag_set(p, PG_REFERENCED); - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); p->oflags |= VPO_WANTED; msleep(p, VM_OBJECT_MTX(backing_object), From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 18:48:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BDCB106566B; Sat, 17 Apr 2010 18:48:18 +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 5B3378FC13; Sat, 17 Apr 2010 18:48: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 o3HImIHP040384; Sat, 17 Apr 2010 18:48:18 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HImI3u040381; Sat, 17 Apr 2010 18:48:18 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201004171848.o3HImI3u040381@svn.freebsd.org> From: Doug Barton Date: Sat, 17 Apr 2010 18:48: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: r206769 - in head: etc/defaults share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 18:48:18 -0000 Author: dougb Date: Sat Apr 17 18:48:18 2010 New Revision: 206769 URL: http://svn.freebsd.org/changeset/base/206769 Log: In case a user wants to configure only an IPv6 link-local address add an example that shows how to do it. Modified: head/etc/defaults/rc.conf head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Apr 17 18:35:07 2010 (r206768) +++ head/etc/defaults/rc.conf Sat Apr 17 18:48:18 2010 (r206769) @@ -211,6 +211,7 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_ed0_ipv6="RTADV" # Sample IPv6 entry for RA/rtsol(8) +#ifconfig_ed0_ipv6="inet6 auto_linklocal" # To configure only link-local #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Apr 17 18:35:07 2010 (r206768) +++ head/share/man/man5/rc.conf.5 Sat Apr 17 18:48:18 2010 (r206769) @@ -1303,6 +1303,13 @@ interface: ifconfig_ed0_ipv6="RTADV" .Ed .Pp +To configure only a link-local address on the +.Dq Li ed0 +interface: +.Bd -literal +ifconfig_ed0_ipv6="inet6 auto_linklocal" +.Ed +.Pp To disable RA the .Dq Li NORTADV option is available, although not required if manual From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 21:14:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 857EB106566B; Sat, 17 Apr 2010 21:14:37 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75B3B8FC12; Sat, 17 Apr 2010 21:14: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 o3HLEbXb073134; Sat, 17 Apr 2010 21:14:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HLEbrV073132; Sat, 17 Apr 2010 21:14:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004172114.o3HLEbrV073132@svn.freebsd.org> From: Alan Cox Date: Sat, 17 Apr 2010 21:14: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: r206770 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 21:14:37 -0000 Author: alc Date: Sat Apr 17 21:14:37 2010 New Revision: 206770 URL: http://svn.freebsd.org/changeset/base/206770 Log: In vm_object_madvise() setting PG_REFERENCED on a page before sleeping on that page only makes sense if the advice is MADV_WILLNEED. In that case, the intention is to activate the page, so discouraging the page daemon from reclaiming the page makes sense. In contrast, in the other cases, MADV_DONTNEED and MADV_FREE, it makes no sense whatsoever to discourage the page daemon from reclaiming the page by setting PG_REFERENCED. Wrap a nearby line. Discussed with: kib MFC after: 3 weeks Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Apr 17 18:48:18 2010 (r206769) +++ head/sys/vm/vm_object.c Sat Apr 17 21:14:37 2010 (r206770) @@ -1205,12 +1205,19 @@ shadowlookup: goto unlock_tobject; } if ((m->oflags & VPO_BUSY) || m->busy) { - vm_page_flag_set(m, PG_REFERENCED); + if (advise == MADV_WILLNEED) + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_flag_set(m, PG_REFERENCED); vm_page_unlock_queues(); if (object != tobject) VM_OBJECT_UNLOCK(object); m->oflags |= VPO_WANTED; - msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo", 0); + msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo", + 0); VM_OBJECT_LOCK(object); goto relookup; } From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 21:31:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FA91065675; Sat, 17 Apr 2010 21:31:43 +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 170C68FC12; Sat, 17 Apr 2010 21:31: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 o3HLVgDA076913; Sat, 17 Apr 2010 21:31:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HLVghk076911; Sat, 17 Apr 2010 21:31:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004172131.o3HLVghk076911@svn.freebsd.org> From: Rui Paulo Date: Sat, 17 Apr 2010 21:31: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: r206771 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 21:31:43 -0000 Author: rpaulo Date: Sat Apr 17 21:31:42 2010 New Revision: 206771 URL: http://svn.freebsd.org/changeset/base/206771 Log: Use ubthidhci_enable="NO" to avoid the bootup warning. Submitted by: Jilles Tjoelker MFC after: 3 days Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Apr 17 21:14:37 2010 (r206770) +++ head/etc/defaults/rc.conf Sat Apr 17 21:31:42 2010 (r206771) @@ -437,7 +437,7 @@ rfcomm_pppd_server_two_channel="3" # Ove #rfcomm_pppd_server_two_register_sp="NO" # Override SP and DUN register #rfcomm_pppd_server_two_register_dun="NO" # for 'two' -#ubthidhci_enable="YES" # Switch an USB BT controller present on +ubthidhci_enable="NO" # Switch an USB BT controller present on #ubthidhci_busnum="3" # bus 3 and addr 2 from HID mode to HCI mode. #ubthidhci_addr="2" # Check usbconfig list to find the correct # numbers for your system. From owner-svn-src-head@FreeBSD.ORG Sat Apr 17 22:39:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110861065670; Sat, 17 Apr 2010 22:39:54 +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 DB5008FC1A; Sat, 17 Apr 2010 22:39: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 o3HMdrNY092170; Sat, 17 Apr 2010 22:39:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3HMdrJY092168; Sat, 17 Apr 2010 22:39:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004172239.o3HMdrJY092168@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 17 Apr 2010 22:39: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: r206773 - head/bin/ln X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 22:39:54 -0000 Author: jilles Date: Sat Apr 17 22:39:53 2010 New Revision: 206773 URL: http://svn.freebsd.org/changeset/base/206773 Log: ln: Refuse deleting a directory entry by hardlinking it to itself. Two pathnames refer to the same directory entry iff the directories match and the final components' names match. Example: (assuming file1 is an existing file) ln -f file1 file1 This now fails while leaving file1 intact. It used to delete file1 and then complain it cannot be linked because it is gone. With -i, this error is detected before the question is asked. MFC after: 2 weeks Modified: head/bin/ln/ln.c Modified: head/bin/ln/ln.c ============================================================================== --- head/bin/ln/ln.c Sat Apr 17 22:38:16 2010 (r206772) +++ head/bin/ln/ln.c Sat Apr 17 22:39:53 2010 (r206773) @@ -172,6 +172,52 @@ main(int argc, char *argv[]) exit(exitval); } +/* + * Two pathnames refer to the same directory entry if the directories match + * and the final components' names match. + */ +static int +samedirent(const char *path1, const char *path2) +{ + const char *file1, *file2; + char pathbuf[PATH_MAX]; + struct stat sb1, sb2; + + if (strcmp(path1, path2) == 0) + return 1; + file1 = strrchr(path1, '/'); + if (file1 != NULL) + file1++; + else + file1 = path1; + file2 = strrchr(path2, '/'); + if (file2 != NULL) + file2++; + else + file2 = path2; + if (strcmp(file1, file2) != 0) + return 0; + if (file1 - path1 >= PATH_MAX || file2 - path2 >= PATH_MAX) + return 0; + if (file1 == path1) + memcpy(pathbuf, ".", 2); + else { + memcpy(pathbuf, path1, file1 - path1); + pathbuf[file1 - path1] = '\0'; + } + if (stat(pathbuf, &sb1) != 0) + return 0; + if (file2 == path2) + memcpy(pathbuf, ".", 2); + else { + memcpy(pathbuf, path2, file2 - path2); + pathbuf[file2 - path2] = '\0'; + } + if (stat(pathbuf, &sb2) != 0) + return 0; + return sb1.st_dev == sb2.st_dev && sb1.st_ino == sb2.st_ino; +} + int linkit(const char *source, const char *target, int isdir) { @@ -215,7 +261,6 @@ linkit(const char *source, const char *t target = path; } - exists = !lstat(target, &sb); /* * If the link source doesn't exist, and a symbolic link was * requested, and -w was specified, give a warning. @@ -242,8 +287,20 @@ linkit(const char *source, const char *t warn("warning: %s", source); } } + + /* + * If the file exists, first check it is not the same directory entry. + */ + exists = !lstat(target, &sb); + if (exists) { + if (!sflag && samedirent(source, target)) { + warnx("%s and %s are the same directory entry", + source, target); + return (1); + } + } /* - * If the file exists, then unlink it forcibly if -f was specified + * Then unlink it forcibly if -f was specified * and interactively if -i was specified. */ if (fflag && exists) {