From owner-svn-src-all@FreeBSD.ORG Sun May 26 02:45:49 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69C921C7; Sun, 26 May 2013 02:45:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 02BF3399; Sun, 26 May 2013 02:45:48 +0000 (UTC) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4Q2jXLx027840; Sun, 26 May 2013 12:45:33 +1000 Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4Q2jIai023179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 May 2013 12:45:21 +1000 Date: Sun, 26 May 2013 12:45:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@FreeBSD.org Subject: Re: svn commit: r250986 - head/sys/dev/usb In-Reply-To: Message-ID: <20130526122502.P847@besplex.bde.org> References: <201305251709.r4PH9xfv015285@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=sQw_kobpeVwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FG3D6h2hVzcA:10 a=6I5d2MoRAAAA:8 a=6Rb0blR-ypmRijCZwjYA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 02:45:49 -0000 On Sat, 25 May 2013 mdf@FreeBSD.org wrote: > On Sat, May 25, 2013 at 10:09 AM, Hans Petter Selasky > wrote: >> ... >> Log: >> Fix some statical clang analyzer warnings. >> ... >> ============================================================================== >> --- head/sys/dev/usb/usb_msctest.c Sat May 25 16:58:12 2013 >> (r250985) >> +++ head/sys/dev/usb/usb_msctest.c Sat May 25 17:09:58 2013 >> (r250986) >> @@ -802,7 +802,6 @@ usb_msc_eject(struct usb_device *udev, u >> if (sc == NULL) >> return (USB_ERR_INVAL); >> >> - err = 0; >> switch (method) { >> case MSC_EJECT_STOPUNIT: >> err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, >> @@ -844,6 +843,7 @@ usb_msc_eject(struct usb_device *udev, u >> break; >> default: >> DPRINTF("Unknown eject method (%d)\n", method); >> + err = 0; >> break; >> } >> DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); >> > > I don't know about the top one, but the bottom two are the safer way to > code, and should not have been changed. Unless we feel guaranteed the > compiler can detect all uninitialized use and will break the build, an > early initialization to a sane value is absolutely the right thing to do, > even if it will be overwritten. If the compiler feels sure the > initialization isn't needed, it does not have to emit the code. But any > coding change after the (missing) initialization can create a bug now > (well, it depends on how the code is structured, but from the three lines > of context svn diff provides it's not clear a bug couldn't easily be > introduced). No, initializing a variable early to a sane value obfuscates the code and makes it impossible for the compiler to detect that the variable is not properly intialized. Initializing early to an insane value that will be overwritten in all cases is not so bad. This makes it clear to human readers that the initial value should not be used, and gives runtime errors if it is used (best an immediate trap), but still prevents the compiler detecting that the variable is not properly initialized. Hmm, it would be useful to have a compiler flag for initializing all local variables to trap representations on entry to functions. This gives the runtime check in addition to the compiler check, without writing huge code to initialize all the variables. Then early initialization would break to sane values would break this feature. Of course, in practical code, you often reuse a variable without uninitializing it (by setting it to an insane value) after each of its uses becomes dead. Then you lose the compiler check. If the uses are unrelated, then it is a style bug (optimization for 30 year old compilers with no lifetime analysis) to use the same variable for them all. Otherwise, it is too painful to uninitialize variables or use block scope for them to make their lifetimes more obvious to all readers. One exception is when pointer variables are set to NULL after they are freed even when the pointers are not expected to be reused. This is done mainly for non-local variables. Bruce From owner-svn-src-all@FreeBSD.ORG Sun May 26 03:48:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A9EB7CAB; Sun, 26 May 2013 03:48:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9488BA; Sun, 26 May 2013 03:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4Q3mfxR037423; Sun, 26 May 2013 03:48:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4Q3mftJ037418; Sun, 26 May 2013 03:48:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305260348.r4Q3mftJ037418@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 26 May 2013 03:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250994 - in stable/9/contrib: gcc gcclibs/libcpp gcclibs/libcpp/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 03:48:41 -0000 Author: pfg Date: Sun May 26 03:48:40 2013 New Revision: 250994 URL: http://svnweb.freebsd.org/changeset/base/250994 Log: MFC r250566: Add support for "d" floating-point suffix, as defined by draft N1312 of TR 24732. Emit pedantic warning if the feature is being used. Obtained from: OpenBSD Modified: stable/9/contrib/gcc/c-lex.c stable/9/contrib/gcclibs/libcpp/expr.c stable/9/contrib/gcclibs/libcpp/include/cpplib.h Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcc/c-lex.c ============================================================================== --- stable/9/contrib/gcc/c-lex.c Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcc/c-lex.c Sun May 26 03:48:40 2013 (r250994) @@ -640,6 +640,13 @@ interpret_float (const cpp_token *token, char *copy; size_t copylen; + /* Default (no suffix) is double. */ + if (flags & CPP_N_DEFAULT) + { + flags ^= CPP_N_DEFAULT; + flags |= CPP_N_MEDIUM; + } + /* Decode type based on width and properties. */ if (flags & CPP_N_DFLOAT) if ((flags & CPP_N_WIDTH) == CPP_N_LARGE) Modified: stable/9/contrib/gcclibs/libcpp/expr.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/expr.c Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcclibs/libcpp/expr.c Sun May 26 03:48:40 2013 (r250994) @@ -82,7 +82,7 @@ static void check_promotion (cpp_reader static unsigned int interpret_float_suffix (const uchar *s, size_t len) { - size_t f = 0, l = 0, i = 0, d = 0; + size_t f = 0, l = 0, i = 0, d = 0, d0 = 0; while (len--) switch (s[len]) @@ -101,7 +101,12 @@ interpret_float_suffix (const uchar *s, return 0; } - if (f + l > 1 || i > 1) + if (d == 1 && !f && !l) { + d = 0; + d0 = 1; + } + + if (f + d0 + l > 1 || i > 1) return 0; /* Allow dd, df, dl suffixes for decimal float constants. */ @@ -110,7 +115,8 @@ interpret_float_suffix (const uchar *s, return ((i ? CPP_N_IMAGINARY : 0) | (f ? CPP_N_SMALL : - l ? CPP_N_LARGE : CPP_N_MEDIUM) + d0 ? CPP_N_MEDIUM : + l ? CPP_N_LARGE : CPP_N_DEFAULT) | (d ? CPP_N_DFLOAT : 0)); } @@ -261,6 +267,13 @@ cpp_classify_number (cpp_reader *pfile, "traditional C rejects the \"%.*s\" suffix", (int) (limit - str), str); + /* A suffix for double is a GCC extension via decimal float support. + If the suffix also specifies an imaginary value we'll catch that + later. */ + if ((result == CPP_N_MEDIUM) && CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "suffix for double constant is a GCC extension"); + /* Radix must be 10 for decimal floats. */ if ((result & CPP_N_DFLOAT) && radix != 10) { Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/include/cpplib.h Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcclibs/libcpp/include/cpplib.h Sun May 26 03:48:40 2013 (r250994) @@ -749,6 +749,7 @@ struct cpp_num #define CPP_N_UNSIGNED 0x1000 /* Properties. */ #define CPP_N_IMAGINARY 0x2000 #define CPP_N_DFLOAT 0x4000 +#define CPP_N_DEFAULT 0x8000 /* Classify a CPP_NUMBER token. The return value is a combination of the flags from the above sets. */ From owner-svn-src-all@FreeBSD.ORG Sun May 26 08:25:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0DD912B0; Sun, 26 May 2013 08:25:27 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE19E17; Sun, 26 May 2013 08:25:26 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id m17so4059478vca.16 for ; Sun, 26 May 2013 01:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=GQQ27jolNAcWW3cB266oOnWa7/58CONd9dDhOWBRhwM=; b=GLG4XHsYOt0t2cK4KX91FlpbKPks6sqB6ADbUnUi3ehHGAMy+Z81o0rldVs6xPvElp HunGDSl5oncb+R7/OViJnnMVJ9R1fYmcsGGT7noz5KGHpU/tKSpnhFYp5QmGbYxW8dmd 9omaDG0sl337GJthFX36d/Uwo1XDIpmnGFH1bK03SAEnKETaol/Be9cRsUCmfHCBLU9P +mTb3O4UioqteA236dwwqkRAgXYwNBS8W+lIkz7lewiipOcafjKynF1SDQRjxHqZY+3B WWrupxKY4KA5yoTxHNTxH/NxFaZEGySf3QZhxKB6A770JU7MZp44MZ3cdpcnONa2J/Ci UCuA== MIME-Version: 1.0 X-Received: by 10.220.223.202 with SMTP id il10mr12735700vcb.4.1369556719517; Sun, 26 May 2013 01:25:19 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Sun, 26 May 2013 01:25:19 -0700 (PDT) In-Reply-To: <20130525195659.GB26980@stack.nl> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> <20130525195659.GB26980@stack.nl> Date: Sun, 26 May 2013 10:25:19 +0200 X-Google-Sender-Auth: MpTAdsO2_8018T3bDoO_5JFvyCs Message-ID: Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale From: Ed Schouten To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gabor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 08:25:27 -0000 Hi Jilles, 2013/5/25 Jilles Tjoelker : > It seems better to implement c16rtomb_l() and mbrtoc16_l() in the same > way, rather than duplicating the UTF-16 coding and passing a pointer to > a mbstate_t which actually has only 120 bytes of storage rather than the > required 128 bytes. Done! Could you please take another look? http://80386.nl/pub/uchar-iconv.txt (refresh!) Thanks, -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Sun May 26 09:25:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C62AFDA; Sun, 26 May 2013 09:25:15 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA50FBA; Sun, 26 May 2013 09:25:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4Q9PEDB047753; Sun, 26 May 2013 09:25:14 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4Q9PE5T047752; Sun, 26 May 2013 09:25:14 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201305260925.r4Q9PE5T047752@svn.freebsd.org> From: Antoine Brodin Date: Sun, 26 May 2013 09:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250995 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 09:25:15 -0000 Author: antoine Date: Sun May 26 09:25:14 2013 New Revision: 250995 URL: http://svnweb.freebsd.org/changeset/base/250995 Log: Move libmd.so.5 to the proper place and add missing lib32 entry. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun May 26 03:48:40 2013 (r250994) +++ head/ObsoleteFiles.inc Sun May 26 09:25:14 2013 (r250995) @@ -257,7 +257,9 @@ OLD_FILES+=usr/share/man/man1/yyfix.1.gz # 20120505: new clang import installed a redundant internal header OLD_FILES+=usr/include/clang/3.1/stdalign.h # 20120428: MD2 removed from libmd +OLD_LIBS+=lib/libmd.so.5 OLD_FILES+=usr/include/md2.h +OLD_LIBS+=usr/lib32/libmd.so.5 OLD_FILES+=usr/share/man/man3/MD2Data.3.gz OLD_FILES+=usr/share/man/man3/MD2End.3.gz OLD_FILES+=usr/share/man/man3/MD2File.3.gz @@ -824,7 +826,6 @@ OLD_LIBS+=lib/libipx.so.4 OLD_LIBS+=lib/libkiconv.so.3 OLD_LIBS+=lib/libkvm.so.4 OLD_LIBS+=lib/libmd.so.4 -OLD_LIBS+=lib/libmd.so.5 OLD_LIBS+=lib/libncurses.so.7 OLD_LIBS+=lib/libncursesw.so.7 OLD_LIBS+=lib/libnvpair.so.1 From owner-svn-src-all@FreeBSD.ORG Sun May 26 11:03:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A008910; Sun, 26 May 2013 11:03:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id D0278224; Sun, 26 May 2013 11:03:35 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r4QB3NvA031023 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 26 May 2013 11:03:25 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250986 - head/sys/dev/usb From: David Chisnall In-Reply-To: <20130526122502.P847@besplex.bde.org> Date: Sun, 26 May 2013 12:02:09 +0100 Content-Transfer-Encoding: 7bit Message-Id: <9848640B-3442-45E5-A59E-FFFABA992CB1@FreeBSD.org> References: <201305251709.r4PH9xfv015285@svn.freebsd.org> <20130526122502.P847@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1503) Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 11:03:36 -0000 On 26 May 2013, at 03:45, Bruce Evans wrote: > Hmm, it would be useful to have a compiler flag for initializing all > local variables to trap representations on entry to functions. The clang memory sanitizer does this. David From owner-svn-src-all@FreeBSD.ORG Sun May 26 12:36:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D94A92C; Sun, 26 May 2013 12:36:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F393B6A0; Sun, 26 May 2013 12:36:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QCauEK009644; Sun, 26 May 2013 12:36:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QCaufA009642; Sun, 26 May 2013 12:36:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305261236.r4QCaufA009642@svn.freebsd.org> From: Rick Macklem Date: Sun, 26 May 2013 12:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250996 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 12:36:57 -0000 Author: rmacklem Date: Sun May 26 12:36:56 2013 New Revision: 250996 URL: http://svnweb.freebsd.org/changeset/base/250996 Log: MFC: r250580 Add support for the eofflag to nfs_readdir() in the new NFS client so that it works under a unionfs mount. Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Sun May 26 09:25:14 2013 (r250995) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Sun May 26 12:36:56 2013 (r250996) @@ -2207,6 +2207,8 @@ nfs_readdir(struct vop_readdir_args *ap) int error = 0; struct vattr vattr; + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; if (vp->v_type != VDIR) return(EPERM); @@ -2221,6 +2223,8 @@ nfs_readdir(struct vop_readdir_args *ap) !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { mtx_unlock(&np->n_mtx); NFSINCRGLOBAL(newnfsstats.direofcache_hits); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; return (0); } else mtx_unlock(&np->n_mtx); @@ -2233,8 +2237,11 @@ nfs_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; error = ncl_bioread(vp, uio, 0, ap->a_cred); - if (!error && uio->uio_resid == tresid) + if (!error && uio->uio_resid == tresid) { NFSINCRGLOBAL(newnfsstats.direofcache_misses); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + } return (error); } From owner-svn-src-all@FreeBSD.ORG Sun May 26 14:14:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B19A6A16; Sun, 26 May 2013 14:14:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3E3D9E1; Sun, 26 May 2013 14:14:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEEgYG041908; Sun, 26 May 2013 14:14:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEEgC3041907; Sun, 26 May 2013 14:14:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305261414.r4QEEgC3041907@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 May 2013 14:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250997 - head/contrib/llvm/lib/Transforms/Vectorize X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:14:42 -0000 Author: dim Date: Sun May 26 14:14:42 2013 New Revision: 250997 URL: http://svnweb.freebsd.org/changeset/base/250997 Log: Pull in r182656 from upstream llvm trunk: LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases. Fixes PR16139. This should fix clang assertion failures when optimizing at -O3, similar to: Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"), function canVectorize, file contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171. Reported by: O. Hartmann PR: ports/178332, ports/178977 MFC after: 3 days Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 26 12:36:56 2013 (r250996) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 26 14:14:42 2013 (r250997) @@ -2169,7 +2169,10 @@ bool LoopVectorizationLegality::canVecto } bool LoopVectorizationLegality::canVectorize() { - assert(TheLoop->getLoopPreheader() && "No preheader!!"); + // We must have a loop in canonical form. Loops with indirectbr in them cannot + // be canonicalized. + if (!TheLoop->getLoopPreheader()) + return false; // We can only vectorize innermost loops. if (TheLoop->getSubLoopsVector().size()) From owner-svn-src-all@FreeBSD.ORG Sun May 26 14:35:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0AE18470; Sun, 26 May 2013 14:35:36 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1779D05; Sun, 26 May 2013 14:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEZZ8a048848; Sun, 26 May 2013 14:35:35 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEZZAp048847; Sun, 26 May 2013 14:35:35 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305261435.r4QEZZAp048847@svn.freebsd.org> From: Jeremie Le Hen Date: Sun, 26 May 2013 14:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250998 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:35:36 -0000 Author: jlh Date: Sun May 26 14:35:35 2013 New Revision: 250998 URL: http://svnweb.freebsd.org/changeset/base/250998 Log: MFC r249591: Document jail__parameters option. The description explains why we should not configure "path", "host.hostname", "command", "ip4.addr" and ip6.addr" parameters with this, but rather use the historical rc.conf(5) options. Modified: stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Sun May 26 14:14:42 2013 (r250997) +++ stable/9/share/man/man5/rc.conf.5 Sun May 26 14:35:35 2013 (r250998) @@ -3943,6 +3943,42 @@ Set to the root directory used by jail Unset by default. Set to the fully qualified domain name (FQDN) assigned to jail .Va jname . +.It Va jail_ Ns Ao Ar jname Ac Ns Va _parameters +.Pq Vt str +Unset by default. +Set extra parameters for jail +.Va jname , +such as +.Dq Li allow.chflags +or +.Dq Li children.max . +See +.Xr jail 8 +for a list of available parameters. +Note that the following parameters are already defined by +.Pa rc.d/jail +script out of their corresponding +.Nm +variables: +.Bl -tag -width "host.hostname" -offset indent +.It Li path +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir +.It Li host.hostname +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _hostname +.It Li command +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start +.It Li ip4.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip +contains IPv4 addresses +.It Li ip6.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip6 +contains IPv6 addresses +.El .It Va jail_ Ns Ao Ar jname Ac Ns Va _ip .Pq Vt str Unset by default. From owner-svn-src-all@FreeBSD.ORG Sun May 26 14:40:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 739496C8; Sun, 26 May 2013 14:40:24 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC3CD7F; Sun, 26 May 2013 14:40:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEeNik051108; Sun, 26 May 2013 14:40:23 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEeNK3051107; Sun, 26 May 2013 14:40:23 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305261440.r4QEeNK3051107@svn.freebsd.org> From: Jeremie Le Hen Date: Sun, 26 May 2013 14:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250999 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:40:24 -0000 Author: jlh Date: Sun May 26 14:40:23 2013 New Revision: 250999 URL: http://svnweb.freebsd.org/changeset/base/250999 Log: MFC r250992: Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced. The build system is really intricate and I had a hard time to remind the whole picture even when reading my own words. This one will hopefully be better. Modified: stable/9/share/mk/bsd.lib.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Sun May 26 14:35:35 2013 (r250998) +++ stable/9/share/mk/bsd.lib.mk Sun May 26 14:40:23 2013 (r250999) @@ -273,16 +273,21 @@ _libinstall: .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory -# prefix where shared objects will be installed. ${_LDSCRIPTROOT} is the -# directory prefix that will be used in generated ld(1) scripts. They cannot -# be coalesced because of the way ld(1) handles the sysroot prefix (used in the -# cross-toolchain): -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty. +# prefix where shared objects will be installed by the install target. +# +# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating +# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an +# alternative directory which is called "sysroot", so during buildworld binaries +# won't be linked against the running system libraries but against the ones of +# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of +# the location where we store them: +# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty +# because ld(1) will manage to find them from sysroot; # - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path. Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty. -# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it -# does not involve the logic of a tool we do not own. +# path, outside of sysroot. +# Note that ld(1) scripts are generated both during buildworld and +# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty +# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \ From owner-svn-src-all@FreeBSD.ORG Sun May 26 14:54:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2869BDE7; Sun, 26 May 2013 14:54:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19E5EECD; Sun, 26 May 2013 14:54:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEs6UQ055052; Sun, 26 May 2013 14:54:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEs6Oi055051; Sun, 26 May 2013 14:54:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305261454.r4QEs6Oi055051@svn.freebsd.org> From: Eitan Adler Date: Sun, 26 May 2013 14:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251000 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:54:07 -0000 Author: eadler Date: Sun May 26 14:54:06 2013 New Revision: 251000 URL: http://svnweb.freebsd.org/changeset/base/251000 Log: Remove backwards compat layer which was added in r71419 (in 2001). This change is not intended for MFC. Reviewed by: peter Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun May 26 14:40:23 2013 (r250999) +++ head/Makefile.inc1 Sun May 26 14:54:06 2013 (r251000) @@ -892,16 +892,11 @@ NO_KERNELOBJ= t KERNCONF=${KERNFAST} .endif .endif -.if !defined(KERNCONF) && defined(KERNEL) -KERNCONF= ${KERNEL} -KERNWARN= -.else .if ${TARGET_ARCH} == "powerpc64" KERNCONF?= GENERIC64 .else KERNCONF?= GENERIC .endif -.endif INSTKERNNAME?= kernel KERNSRCDIR?= ${.CURDIR}/sys @@ -930,12 +925,6 @@ buildkernel: @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ false .endif -.if defined(KERNWARN) - @echo "--------------------------------------------------------------" - @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" - @echo "--------------------------------------------------------------" - @sleep 3 -.endif @echo .for _kernel in ${BUILDKERNELS} @echo "--------------------------------------------------------------" From owner-svn-src-all@FreeBSD.ORG Sun May 26 16:48:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3D5759B; Sun, 26 May 2013 16:48:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BE9024D; Sun, 26 May 2013 16:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QGmpEP092140; Sun, 26 May 2013 16:48:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QGmpV6092138; Sun, 26 May 2013 16:48:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305261648.r4QGmpV6092138@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 26 May 2013 16:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251001 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 16:48:51 -0000 Author: des Date: Sun May 26 16:48:51 2013 New Revision: 251001 URL: http://svnweb.freebsd.org/changeset/base/251001 Log: MFH (r243149): fix indentation MFH (r249431): use CONNECT to proxy HTTPS over HTTP PR: bin/80176 Modified: stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Sun May 26 14:54:06 2013 (r251000) +++ stable/9/lib/libfetch/http.c Sun May 26 16:48:51 2013 (r251001) @@ -1373,6 +1373,7 @@ http_authorize(conn_t *conn, const char static conn_t * http_connect(struct url *URL, struct url *purl, const char *flags) { + struct url *curl; conn_t *conn; int verbose; int af, val; @@ -1391,17 +1392,21 @@ http_connect(struct url *URL, struct url af = AF_INET6; #endif - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { - URL = purl; - } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) { - /* can't talk http to an ftp server */ - /* XXX should set an error code */ - return (NULL); - } + curl = (purl != NULL) ? purl : URL; - if ((conn = fetch_connect(URL->host, URL->port, af, verbose)) == NULL) + if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", + URL->host, URL->port); + http_cmd(conn, ""); + if (http_get_reply(conn) != HTTP_OK) { + fetch_close(conn); + return (NULL); + } + http_get_reply(conn); + } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, verbose) == -1) { fetch_close(conn); @@ -1752,11 +1757,11 @@ http_request(struct url *URL, const char /* get headers. http_next_header expects one line readahead */ if (fetch_getln(conn) == -1) { - fetch_syserr(); - goto ouch; + fetch_syserr(); + goto ouch; } do { - switch ((h = http_next_header(conn, &headerbuf, &p))) { + switch ((h = http_next_header(conn, &headerbuf, &p))) { case hdr_syserror: fetch_syserr(); goto ouch; @@ -1785,7 +1790,7 @@ http_request(struct url *URL, const char conn->err != HTTP_USE_PROXY) { n = 1; break; - } + } if (new) free(new); if (verbose) From owner-svn-src-all@FreeBSD.ORG Sun May 26 17:00:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29AE58B7; Sun, 26 May 2013 17:00:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFA2294; Sun, 26 May 2013 17:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QH0Fmh097147; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QH0F99097145; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305261700.r4QH0F99097145@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 26 May 2013 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251002 - stable/8/lib/libfetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 17:00:16 -0000 Author: des Date: Sun May 26 17:00:15 2013 New Revision: 251002 URL: http://svnweb.freebsd.org/changeset/base/251002 Log: MFH (r230478): fix a couple of nits in r230307 (r231248) MFH (r243149): fix indentation MFH (r249431): use CONNECT to proxy HTTPS over HTTP PR: bin/80176 Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/common.c Sun May 26 17:00:15 2013 (r251002) @@ -418,7 +418,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/http.c Sun May 26 17:00:15 2013 (r251002) @@ -1373,6 +1373,7 @@ http_authorize(conn_t *conn, const char static conn_t * http_connect(struct url *URL, struct url *purl, const char *flags) { + struct url *curl; conn_t *conn; int verbose; int af, val; @@ -1391,17 +1392,21 @@ http_connect(struct url *URL, struct url af = AF_INET6; #endif - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { - URL = purl; - } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) { - /* can't talk http to an ftp server */ - /* XXX should set an error code */ - return (NULL); - } + curl = (purl != NULL) ? purl : URL; - if ((conn = fetch_connect(URL->host, URL->port, af, verbose)) == NULL) + if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", + URL->host, URL->port); + http_cmd(conn, ""); + if (http_get_reply(conn) != HTTP_OK) { + fetch_close(conn); + return (NULL); + } + http_get_reply(conn); + } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, verbose) == -1) { fetch_close(conn); @@ -1752,11 +1757,11 @@ http_request(struct url *URL, const char /* get headers. http_next_header expects one line readahead */ if (fetch_getln(conn) == -1) { - fetch_syserr(); - goto ouch; + fetch_syserr(); + goto ouch; } do { - switch ((h = http_next_header(conn, &headerbuf, &p))) { + switch ((h = http_next_header(conn, &headerbuf, &p))) { case hdr_syserror: fetch_syserr(); goto ouch; @@ -1785,7 +1790,7 @@ http_request(struct url *URL, const char conn->err != HTTP_USE_PROXY) { n = 1; break; - } + } if (new) free(new); if (verbose) From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:26:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25BE3B2E; Sun, 26 May 2013 18:26:30 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17F1C77A; Sun, 26 May 2013 18:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIQTM7024838; Sun, 26 May 2013 18:26:29 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIQTMg024837; Sun, 26 May 2013 18:26:29 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261826.r4QIQTMg024837@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251003 - stable/9/lib/libprocstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:26:30 -0000 Author: trociny Date: Sun May 26 18:26:29 2013 New Revision: 251003 URL: http://svnweb.freebsd.org/changeset/base/251003 Log: MFC r250147: procstat_getpathname: for kvm method, instead of returning the error that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Sun May 26 17:00:15 2013 (r251002) +++ stable/9/lib/libprocstat/libprocstat.c Sun May 26 18:26:29 2013 (r251003) @@ -2120,8 +2120,10 @@ procstat_getpathname(struct procstat *pr { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + /* XXX: Return empty string. */ + if (maxlen > 0) + pathname[0] = '\0'; + return (0); case PROCSTAT_SYSCTL: return (procstat_getpathname_sysctl(kp->ki_pid, pathname, maxlen)); From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:28:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03B8FCAB; Sun, 26 May 2013 18:28:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8911788; Sun, 26 May 2013 18:28:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QISa3k025218; Sun, 26 May 2013 18:28:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QISaAj025215; Sun, 26 May 2013 18:28:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261828.r4QISaAj025215@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251004 - in stable/9/sbin: hastctl hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:28:37 -0000 Author: trociny Date: Sun May 26 18:28:36 2013 New Revision: 251004 URL: http://svnweb.freebsd.org/changeset/base/251004 Log: r250503 Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: stable/9/sbin/hastctl/Makefile stable/9/sbin/hastd/Makefile stable/9/sbin/hastd/token.l Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/Makefile ============================================================================== --- stable/9/sbin/hastctl/Makefile Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastctl/Makefile Sun May 26 18:28:36 2013 (r251004) @@ -31,8 +31,8 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/9/sbin/hastd/Makefile ============================================================================== --- stable/9/sbin/hastd/Makefile Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastd/Makefile Sun May 26 18:28:36 2013 (r251004) @@ -30,7 +30,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/9/sbin/hastd/token.l ============================================================================== --- stable/9/sbin/hastd/token.l Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastd/token.l Sun May 26 18:28:36 2013 (r251004) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:30:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC17CE22; Sun, 26 May 2013 18:30:07 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE4C4791; Sun, 26 May 2013 18:30:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIU7LY025574; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIU7V5025567; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261830.r4QIU7V5025567@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251005 - in stable/8/sbin: hastctl hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:30:08 -0000 Author: trociny Date: Sun May 26 18:30:07 2013 New Revision: 251005 URL: http://svnweb.freebsd.org/changeset/base/251005 Log: MFC r250503: Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: stable/8/sbin/hastctl/Makefile stable/8/sbin/hastd/Makefile stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/Makefile ============================================================================== --- stable/8/sbin/hastctl/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastctl/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,8 +29,8 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,7 +29,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/token.l ============================================================================== --- stable/8/sbin/hastd/token.l Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/token.l Sun May 26 18:30:07 2013 (r251005) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:35:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71276125; Sun, 26 May 2013 18:35:53 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 631CA7D7; Sun, 26 May 2013 18:35:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIZrmC028150; Sun, 26 May 2013 18:35:53 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIZrN3028147; Sun, 26 May 2013 18:35:53 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261835.r4QIZrN3028147@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251006 - in stable/9/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:35:53 -0000 Author: trociny Date: Sun May 26 18:35:52 2013 New Revision: 251006 URL: http://svnweb.freebsd.org/changeset/base/251006 Log: MFC r250379, r250503: HAST module for bsnmpd(1). Reviewed by: harti, pjd Added: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/ - copied from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/ Modified: stable/9/usr.sbin/bsnmpd/modules/Makefile stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:30:07 2013 (r251005) +++ stable/9/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:35:52 2013 (r251006) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf \ Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:35:52 2013 (r251006) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:37:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1244E299; Sun, 26 May 2013 18:37:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 048787E0; Sun, 26 May 2013 18:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIbKr3028446; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIbKsQ028444; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261837.r4QIbKsQ028444@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251007 - in stable/8/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:37:21 -0000 Author: trociny Date: Sun May 26 18:37:20 2013 New Revision: 251007 URL: http://svnweb.freebsd.org/changeset/base/251007 Log: MFC r250379, r250503: HAST module for bsnmpd(1). Reviewed by: harti, pjd Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/ - copied from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/ Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:35:52 2013 (r251006) +++ stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:38:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5212428; Sun, 26 May 2013 18:38:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97C9A7EC; Sun, 26 May 2013 18:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIckfq028701; Sun, 26 May 2013 18:38:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIck4o028700; Sun, 26 May 2013 18:38:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261838.r4QIck4o028700@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251008 - stable/9/contrib/bsnmp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:38:46 -0000 Author: trociny Date: Sun May 26 18:38:46 2013 New Revision: 251008 URL: http://svnweb.freebsd.org/changeset/base/251008 Log: MFC r250380: Register OID for HAST module. Modified: stable/9/contrib/bsnmp/oid-list Directory Properties: stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/oid-list ============================================================================== --- stable/9/contrib/bsnmp/oid-list Sun May 26 18:37:20 2013 (r251007) +++ stable/9/contrib/bsnmp/oid-list Sun May 26 18:38:46 2013 (r251008) @@ -24,6 +24,7 @@ enterprises 204 pingData bsnmp-ping (Nate Nielsen ) 205 begemotBridge bridge module 210 begemotWlan WLAN module + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project 303 BEGEMOT-WLINK DLR WLINK simulator From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:39:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57FA6597; Sun, 26 May 2013 18:39:34 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3127F3; Sun, 26 May 2013 18:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIdYHn028877; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIdYX5028876; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261839.r4QIdYX5028876@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251009 - stable/8/contrib/bsnmp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:39:34 -0000 Author: trociny Date: Sun May 26 18:39:33 2013 New Revision: 251009 URL: http://svnweb.freebsd.org/changeset/base/251009 Log: MFC r250380: Register OID for HAST module. Modified: stable/8/contrib/bsnmp/oid-list Directory Properties: stable/8/contrib/bsnmp/ (props changed) Modified: stable/8/contrib/bsnmp/oid-list ============================================================================== --- stable/8/contrib/bsnmp/oid-list Sun May 26 18:38:46 2013 (r251008) +++ stable/8/contrib/bsnmp/oid-list Sun May 26 18:39:33 2013 (r251009) @@ -17,6 +17,7 @@ enterprises 200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org) 201 BEGEMOT-NTP snmpd NTP module 202 BEGEMOT-HOSTRES snmpd HOSTRES module private stuff + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project If you need an OID and don't know where to stuck it in, I can assign you one - From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:54:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4E79A18; Sun, 26 May 2013 18:54:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B64D4869; Sun, 26 May 2013 18:54:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIs520034400; Sun, 26 May 2013 18:54:05 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIs5Vs034398; Sun, 26 May 2013 18:54:05 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261854.r4QIs5Vs034398@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251010 - stable/9/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:54:05 -0000 Author: trociny Date: Sun May 26 18:54:05 2013 New Revision: 251010 URL: http://svnweb.freebsd.org/changeset/base/251010 Log: MFC r250405: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Added: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied unchanged from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Deleted: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:39:33 2013 (r251009) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:05 2013 (r251010) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sun May 26 18:54:05 2013 (r251010, copy of r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" 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 REGENTS 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 REGENTS 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 May 9, 2013 +.Dt SNMP_HAST 3 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default +.Xr hastd 8 +configuration file. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr hastctl 8 , +.Xr hastd 8 , +.Xr snmpmod 3 +.Sh AUTHORS +.An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:54:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F2E0C62; Sun, 26 May 2013 18:54:51 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC9D873; Sun, 26 May 2013 18:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIsoGx034610; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIso5o034608; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261854.r4QIso5o034608@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251011 - stable/8/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:54:51 -0000 Author: trociny Date: Sun May 26 18:54:50 2013 New Revision: 251011 URL: http://svnweb.freebsd.org/changeset/base/251011 Log: MFC r250405: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied unchanged from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Deleted: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:05 2013 (r251010) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:50 2013 (r251011) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sun May 26 18:54:50 2013 (r251011, copy of r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" 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 REGENTS 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 REGENTS 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 May 9, 2013 +.Dt SNMP_HAST 3 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default +.Xr hastd 8 +configuration file. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr hastctl 8 , +.Xr hastd 8 , +.Xr snmpmod 3 +.Sh AUTHORS +.An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sun May 26 18:58:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C747E8C; Sun, 26 May 2013 18:58:00 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1B9892; Sun, 26 May 2013 18:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIw0uT035179; Sun, 26 May 2013 18:58:00 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIw03A035178; Sun, 26 May 2013 18:58:00 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201305261858.r4QIw03A035178@svn.freebsd.org> From: Jens Schweikhardt Date: Sun, 26 May 2013 18:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251012 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:58:00 -0000 Author: schweikh Date: Sun May 26 18:57:59 2013 New Revision: 251012 URL: http://svnweb.freebsd.org/changeset/base/251012 Log: s/recieve/receive Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Sun May 26 18:54:50 2013 (r251011) +++ head/share/man/man4/bce.4 Sun May 26 18:57:59 2013 (r251012) @@ -212,7 +212,7 @@ Enable/Disable strict RX frame size chec .It Va hw.bce.hdr_split Enable/Disable frame header/payload splitting (default 1). .It Va hw.bce.rx_pages -Set the number of memory pages assigned to recieve packets by the driver. +Set the number of memory pages assigned to receive packets by the driver. Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). .It Va hw.bce.tx_pages From owner-svn-src-all@FreeBSD.ORG Sun May 26 20:26:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 890518F0 for ; Sun, 26 May 2013 20:26:51 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm18.bullet.mail.ird.yahoo.com (nm18.bullet.mail.ird.yahoo.com [77.238.189.71]) by mx1.freebsd.org (Postfix) with SMTP id 73B5FC23 for ; Sun, 26 May 2013 20:26:50 +0000 (UTC) Received: from [77.238.189.50] by nm18.bullet.mail.ird.yahoo.com with NNFMP; 26 May 2013 20:26:37 -0000 Received: from [46.228.39.106] by tm3.bullet.mail.ird.yahoo.com with NNFMP; 26 May 2013 20:26:36 -0000 Received: from [127.0.0.1] by smtp143.mail.ir2.yahoo.com with NNFMP; 26 May 2013 20:26:36 -0000 X-Yahoo-Newman-Id: 914099.58145.bm@smtp143.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MZirmvgVM1mIV1ZRtPxthvUb7r4Otv8YtmXwRhGdz2Fh70Y HgDQ1P_oJoMDexsXsfDZEG.6cG0xyrEjWAQF_UBTdHobwyCD.AFiLSlnepgZ SdY9pSunSn.KI_fA0qroHCz9lnfxiHT33G_3ovH5XOXd0cKec6MbdzmkFYn9 iGNb8sQxi6dzkYbAoYgTsA5D7.6hqxxfAdunznLg4BJnSPGOI97zHOBLMUUt URznp1zFmEiVwPIJoLQPgIUZKygBtjmyU93Sr5gcC_DaXzUvlAHK.UFCMe3i JL7yNquIBj79C3qmU8D34JEu38VnW44nw.alQmCHQ92snTnTfxDj7Z4koWSM U0ne.KX4ooOStr7SzYBToo2S85w3MdzlotiUPuvbowaZEE3Ll4RVyMm4RGCe KWrSmLTsh4sicPu_xhLHg.9yWIkUEiDiU_N9EhihExkRDa7KYUgJeU5QC4yD ZTw-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.26] (se@87.158.28.224 with ) by smtp143.mail.ir2.yahoo.com with SMTP; 26 May 2013 20:26:36 +0000 UTC Message-ID: <51A26FED.4020801@freebsd.org> Date: Sun, 26 May 2013 22:26:21 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r250972 - head/usr.bin/patch References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525122811.I837@besplex.bde.org> In-Reply-To: <20130525122811.I837@besplex.bde.org> X-Enigmail-Version: 1.5.1 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, Stefan Esser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 20:26:51 -0000 Am 25.05.2013 06:31, schrieb Bruce Evans: > On Fri, 24 May 2013, Stefan Esser wrote: > >> ... >> Log: >> The error handling for writes to the target file could lead to the final >> fclose() being skipped. Fix this by using boolean "&" and "|" instead of >> short-cut operators "&&" and "||". >> While here, increment the last part of the version string. The reason is >> the fixed output file selection logic in pch.c, which was committed as >> r250943, yesterday. >> >> Reviewed by: pfg >> ... >> Modified: head/usr.bin/patch/patch.c >> ============================================================================== >> >> --- head/usr.bin/patch/patch.c Fri May 24 18:28:27 2013 (r250971) >> +++ head/usr.bin/patch/patch.c Fri May 24 18:54:52 2013 (r250972) >> @@ -303,7 +303,7 @@ main(int argc, char *argv[]) >> ++fuzz <= mymaxfuzz); >> >> if (skip_rest_of_patch) { /* just got decided */ >> - if (ferror(ofp) || fclose(ofp)) { >> + if (ferror(ofp) | fclose(ofp)) { >> say("Error writing %s\n", >> TMPOUTNAME); >> error = 1; > > This is more broken than before. Now the order of operations is > indeterminate, so the behaviour is undefined if fclose(ofp) is evaluated > before ferror(ofp) (then ferror(ofp) is passed an invalid pointer). > Now even the usual case when there is no error initially is broken. Oh, I see ... Sorry, I should have noticed this myself. I had considered two more complex solutions, one with a temporary variable "result" which was set by the call to ferror and where the result of fclose was ORed in, the other with duplication of the error message and setting of error. I guess that using a temporary variable for the ferror result is better ... > Error handling is very rarely correct in utilities that use stdio. > patch at least checks for errors. The easiest way to improve it (not > just for patch) is to sprinkle fflush()es. Blindly doing voided > fflush()es before every ferror() check ensures that output gets done > and checked even if you neglect to do fclose() or check for errors in > it (provided you have enough ferror() checks). This is especially Yes, I had considered an fflush with error checking before the fclose, but thought this was unnecessary (one extra call), and that it were better to use a temporary result variable, instead. And then I erroneously removed that variable and used the boolean operators, instead ... (It's good to simplify an algorithm, but not further than required to keep it functional ;-) ). > important and especially mostly not done for stdout and stderr, since > it is best to never close these (it may be impossible to report errors > on stdout or stderr on themself, especially for stderr, but it doesn't > hurt to try, except this may inhibit more correct error handling like > logging the error to another file). > > patch/pch.c has another ferror() || fclose() that wasn't touched by this > commit. It is almost OK, since the file was just opened successfully > so ferror() on it "can't happen". But this means that the normal > broken idiom 'ferror() || fclose()' is not even wrong. I noticed that case, but did not bother to change it, since pfatal() is called immediately after a failed ferror(). This will terminate the program and thus there is no resource leak. > I think ferror() in 'ferror() || fclose()' should never be necessary > unless you actually want to keep the file open if ferror(), and then > you should normally use clearerr() in the error handling. C99 is > almost clear that fclose() must fail if ferror() was true when it was > called. It says that fclose() returns EOF iff any errors were detected, > and it would take a weaselish reading of this to not allow detection > of errors that are already present when it was called. patch might > be using 'ferror() || fclose() because it doesn't trust pre-C90 stdio. Our version of patch must only work on supported releases of FreeBSD. The ferror() before flcose() does not exist in the versions it is derived from. It was added after the code was imported from OpenBSD. > It is also a style bug to use the bitwise boolean operations for logical > boolean operations. When we need sequential evaluation, this becomes a > bug. We want sequential evaluation, and that should be written normally > using > sequence points (which are easiest to get using separate statements) if > the logical boolean operations aren't suitable. So to combine the errors > from ferror() and fclose() so as to support buggy fclose()'s, and to do > this without sprinkling ferror(), we must write something like: > > locerror = 0; > if (ferror(ofp) > locerror = 1; > if (fclose(ofp) > locerror = 1; > if (locerror) { > say("Error writing %s\n", > TMPOUTNAME); > error = 1; I had code like that, before I thought I could simplify it. It read int ret; ... ret = ferror(ofp); if (fclose(ofp) || ret) { say ... error = 1 } Another possibility (too obfuscated for my taste) is: if (ferror(ofp) { fclose(ofp); ofp = NULL; } if (ofp == NULL || fclose(ofp)) say ... error = 1 } This version does not need the temporary result variable, but uses two calls to fclose() and thus produces more code. > This is too ugly. I prefer to depend on fclose() being non-broken. > Unfortunately, fclose() seems to be broken in FreeBSD: Ughh. That might be the reason the ferror() tests were added in the FreeBSD version ... > @ #include > @ @ int > @ main(void) > @ { > @ FILE *fp; > @ @ remove("test.dat"); > @ fp = fopen("test.dat", "a"); > @ fclose(fp); > @ fp = fopen("test.dat", "r"); > @ (void)fwrite("", 1, 1, fp); > @ fprintf(stderr, "ferror %d\n", ferror(fp)); > @ fprintf(stderr, "fclose %d\n", fclose(fp)); > @ return (0); > @ } > > This finds ferror(), but then fclose() succeeds. Setting ferror() without > having any real i/o problems isn't easy, and this example is contrived > since the file is only open for input, so fclose() cannot have any buffered > output to flush. However, there points to a general problem with ferror() -- > the error flag is shared between input and output, so if fclose() always > checked the flag and failed if it is set, then its failure wouldn't be > useful for detecting output errors. Neither would ferror(). So if the > stream is open for both reading and writing, the application should do > something like clearerr() before all fflush() and fclose() operations so > as to detect only write errors. fclose() in FreeBSD doesn't seem to check > the flag at all. I can't see exactly what it does. The low level function > __sflush() mainly tries to write all buffered i/o. It sets ferror() and > returns an error if any of the writes fails, but it doesn't return an error > if ferror() is already true. Do we have compatibility and/or regression tests for stdio that cover ferror/fflush/fclose? I'm wondering, whether we could just implicitly call fflush before fclose and return an error condition, if the fflush failed. That way, fclose would report write errors only reported by fflush, now. The fclose(3) man-page states: ERRORS The fclose() function may also fail and set errno for any of the errors specified for the routines close(2) or fflush(3). So, returning fflush errors from fclose is documented behavior, but apparently not implemented behavior. One way to test write errors is via tmpfs: # mount -t tmpfs -o maxfilesize=1 tmp /mnt A few more tests with this special file system: ----------------------------------------------------------------- #include int main(void) { FILE *fp; remove("test.dat"); fprintf(stderr, "1) normal write - expect OK:\n"); fp = fopen("test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("a\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n2) write 1 byte - expect OK:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n3) write 1 byte - expect OK:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w+"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n4) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n5) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n6) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n7) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n8) write 1 bytes to R/O file - expect FAIL:\n"); //remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "r"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); return (0); } ----------------------------------------------------------------- 1) normal write - expect OK: fwrite 3 ferror 0 fflush 0 fclose 0 2) write 1 byte - expect OK: fwrite 1 ferror 0 fflush 0 ferror 0 fclose 0 3) write 1 byte - expect OK: fwrite 1 ferror 0 fflush 0 ferror 0 fclose 0 4) write 3 bytes - expect FAIL: fwrite 3 fclose -1 5) write 3 bytes - expect FAIL: fwrite 3 fflush -1 fclose 0 6) write 3 bytes - expect FAIL: fwrite 3 ferror 0 fclose -1 7) write 3 bytes - expect FAIL: fwrite 3 ferror 0 fflush -1 ferror 1 fclose 0 8) write 1 bytes to R/O file - expect FAIL: fwrite 0 ferror 1 fflush -1 ferror 1 fclose 0 ----------------------------------------------------------------- So it seems that fclose will return an error if data could not be written (see case 4), but not if an fflush already returned the error condition. It is not sticky. So I guess it is sufficient to check the result returned by fclose, without the prior check of ferror. I do not see what cases ferror can catch, that are no caught by fclose ... Regards, STefan From owner-svn-src-all@FreeBSD.ORG Sun May 26 21:48:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0B687E8; Sun, 26 May 2013 21:48:40 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BB20BEF7; Sun, 26 May 2013 21:48:40 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id B4746204; Sun, 26 May 2013 23:44:25 +0200 (CEST) Date: Sun, 26 May 2013 23:51:25 +0200 From: Pawel Jakub Dawidek To: Glen Barber Subject: Re: svn commit: r250972 - head/usr.bin/patch Message-ID: <20130526215125.GC1381@garage.freebsd.pl> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525051127.GP1756@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7gGkHNMELEOhSGF6" Content-Disposition: inline In-Reply-To: <20130525051127.GP1756@glenbarber.us> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Esser , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 21:48:41 -0000 --7gGkHNMELEOhSGF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 25, 2013 at 01:11:27AM -0400, Glen Barber wrote: > On Fri, May 24, 2013 at 06:54:52PM +0000, Stefan Esser wrote: > > Author: se > > Date: Fri May 24 18:54:52 2013 > > New Revision: 250972 > > URL: http://svnweb.freebsd.org/changeset/base/250972 > >=20 >=20 > > [...] >=20 > > @@ -977,7 +977,7 @@ spew_output(void) > > #endif > > if (input_lines) > > copy_till(input_lines, true); /* dump remainder of file */ > > - rv =3D ferror(ofp) =3D=3D 0 && fclose(ofp) =3D=3D 0; > > + rv =3D ferror(ofp) =3D=3D 0 & fclose(ofp) =3D=3D 0; > > ofp =3D NULL; > > return rv; > > } > >=20 >=20 > This breaks head/. Not to mention that it is really ugly and without any comment it looks like a typo. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --7gGkHNMELEOhSGF6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGig90ACgkQForvXbEpPzRpnQCfd2ouzLBvqchMOT3sZ5z4iGbq INsAn0KWj1LFfJkqLSW2bdrmAC1SeHdl =etOR -----END PGP SIGNATURE----- --7gGkHNMELEOhSGF6-- From owner-svn-src-all@FreeBSD.ORG Sun May 26 22:11:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 70F44B08; Sun, 26 May 2013 22:11:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47561F5A; Sun, 26 May 2013 22:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QMBERY099731; Sun, 26 May 2013 22:11:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QMBDkv099729; Sun, 26 May 2013 22:11:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305262211.r4QMBDkv099729@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 26 May 2013 22:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251013 - head/sys/dev/aacraid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 22:11:14 -0000 Author: marcel Date: Sun May 26 22:11:13 2013 New Revision: 251013 URL: http://svnweb.freebsd.org/changeset/base/251013 Log: Unbreak ia64 tinderbox: 64-bit support was made conditional upon __amd64__, and thus limited. Eliminate 2 trivial conditionals by casting the 64-bit integral, holding an address, via (uintptr_t) to (void *) and replace the last remaining check for __amd64__ with a check for __LP64__ instead. Modified: head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sun May 26 18:57:59 2013 (r251012) +++ head/sys/dev/aacraid/aacraid.c Sun May 26 22:11:13 2013 (r251013) @@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc srb_sg_address = (u_int64_t)sgp->SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { -#ifdef __amd64__ +#ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; srb_sg_bytecount = sgp->SgByteCount; @@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc cm->cm_flags |= AAC_CMD_DATAOUT; if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { - if ((error = copyin( -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyin((void *)(uintptr_t)srb_sg_address, cm->cm_data, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() alloc. mem.? */ @@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc /* copy data */ if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) { - if ((error = copyout(cm->cm_data, -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyout(cm->cm_data, + (void *)(uintptr_t)srb_sg_address, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() allocated mem.? */ From owner-svn-src-all@FreeBSD.ORG Sun May 26 22:23:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7A1FECC; Sun, 26 May 2013 22:23:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A99E2FA2; Sun, 26 May 2013 22:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QMNesW003588; Sun, 26 May 2013 22:23:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QMNefL003583; Sun, 26 May 2013 22:23:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305262223.r4QMNefL003583@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 May 2013 22:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251014 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 22:23:40 -0000 Author: adrian Date: Sun May 26 22:23:39 2013 New Revision: 251014 URL: http://svnweb.freebsd.org/changeset/base/251014 Log: Migrate ath(4) to now use if_transmit instead of the legacy if_start and if queue mechanism; also fix up (non-11n) TX fragment handling. This may result in a bit of a performance drop for now but I plan on debugging and resolving this at a later stage. Whilst here, fix the transmit path so fragment transmission works. The TX fragmentation handling is a bit more special. In order to correctly transmit TX fragments, there's a bunch of corner cases that need to be handled: * They must be transmitted back to back, in the same order.. * .. ie, you need to hold the TX lock whilst transmitting this set of fragments rather than interleaving it with other MSDUs destined to other nodes; * The length of the next fragment is required when transmitting, in order to correctly set the NAV field in the current frame to the length of the next frame; which requires .. * .. that we know the transmit duration of the next frame, which .. * .. requires us to set the rate of all fragments to the same length, or make the decision up-front, etc. To facilitate this, I've added a new ath_buf field to describe the length of the next fragment. This avoids having to keep the mbuf chain together. This used to work before my 11n TX path work because the ath_tx_start() routine would be handed a single mbuf with m_nextpkt pointing to the next frame, and that would be maintained all the way up to when the duration calculation was done. This doesn't hold true any longer - the actual queuing may occur at any point in the future (think ath_node TID software queuing) so this information needs to be maintained. Right now this does work for non-11n frames but it doesn't at all enforce the same rate control decision for all frames in the fragment. I plan on fixing this in a followup commit. RTS/CTS has the same issue, I'll look at fixing this in a subsequent commit. Finaly, 11n fragment support requires the driver to have fully decided what the rate scenario setup is - including 20/40MHz, short/long GI, STBC, LDPC, number of streams, etc. Right now that decision is (currently) made _after_ the NAV field value is updated. I'll fix all of this in subsequent commits. Tested: * AR5416, STA, transmitting 11abg fragments * AR5416, STA, 11n fragments work but the NAV field is incorrect for the reasons above. TODO: * It would be nice to be able to queue mbufs per-node and per-TID so we can only queue ath_buf entries when it's time to assemble frames to send to the hardware. But honestly, we should just do that level of software queue management in net80211 rather than ath(4), so I'm going to leave this alone for now. * More thorough AP, mesh and adhoc testing. * Ensure that net80211 doesn't hand us fragmented frames when A-MPDU has been negotiated, as we can't do software retransmission of fragments. * .. set CLRDMASK when transmitting fragments, just to ensure. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath.c Sun May 26 22:23:39 2013 (r251014) @@ -152,7 +152,8 @@ static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static void ath_start_queue(struct ifnet *ifp); +static int ath_transmit(struct ifnet *ifp, struct mbuf *m); +static void ath_qflush(struct ifnet *ifp); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); static int ath_ioctl(struct ifnet *, u_long, caddr_t); @@ -437,9 +438,6 @@ ath_attach(u_int16_t devid, struct ath_s TASK_INIT(&sc->sc_txqtask, 0, ath_txq_sched_tasklet, sc); TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc); - /* XXX make this a higher priority taskqueue? */ - TASK_INIT(&sc->sc_txpkttask, 0, ath_start_task, sc); - /* * Allocate hardware transmit queues: one queue for * beacon frames and one data queue for each QoS @@ -558,7 +556,8 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_start = ath_start_queue; + ifp->if_transmit = ath_transmit; + ifp->if_qflush = ath_qflush; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -2645,43 +2644,32 @@ ath_getbuf(struct ath_softc *sc, ath_buf } static void -ath_start_queue(struct ifnet *ifp) +ath_qflush(struct ifnet *ifp) { - struct ath_softc *sc = ifp->if_softc; - - ATH_PCU_LOCK(sc); - if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, - "%s: sc_inreset_cnt > 0; bailing\n", __func__); - ATH_PCU_UNLOCK(sc); - IF_LOCK(&ifp->if_snd); - sc->sc_stats.ast_tx_qstop++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); - return; - } - sc->sc_txstart_cnt++; - ATH_PCU_UNLOCK(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: start"); - ath_tx_kick(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: finished"); - - ATH_PCU_LOCK(sc); - sc->sc_txstart_cnt--; - ATH_PCU_UNLOCK(sc); + /* XXX TODO */ } -void -ath_start_task(void *arg, int npending) +/* + * Transmit a single frame. + * + * net80211 will free the node reference if the transmit + * fails, so don't free the node reference here. + */ +static int +ath_transmit(struct ifnet *ifp, struct mbuf *m) { - struct ath_softc *sc = (struct ath_softc *) arg; - struct ifnet *ifp = sc->sc_ifp; - - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: start"); + struct ieee80211com *ic = ifp->if_l2com; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211_node *ni; + struct mbuf *next; + struct ath_buf *bf; + ath_bufhead frags; + int retval = 0; - /* XXX is it ok to hold the ATH_LOCK here? */ + /* + * Tell the reset path that we're currently transmitting. + */ ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { device_printf(sc->sc_dev, @@ -2692,211 +2680,249 @@ ath_start_task(void *arg, int npending) ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); - return; + return (ENOBUFS); /* XXX should be EINVAL or? */ } sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: start"); + /* + * Grab the TX lock - it's ok to do this here; we haven't + * yet started transmitting. + */ ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); - - ATH_PCU_LOCK(sc); - sc->sc_txstart_cnt--; - ATH_PCU_UNLOCK(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: finished"); -} -void -ath_start(struct ifnet *ifp) -{ - struct ath_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; - struct ath_buf *bf; - struct mbuf *m, *next; - ath_bufhead frags; - int npkts = 0; + /* + * Node reference, if there's one. + */ + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) - return; + /* + * Enforce how deep a node queue can get. + * + * XXX it would be nicer if we kept an mbuf queue per + * node and only whacked them into ath_bufs when we + * are ready to schedule some traffic from them. + * .. that may come later. + * + * XXX we should also track the per-node hardware queue + * depth so it is easy to limit the _SUM_ of the swq and + * hwq frames. Since we only schedule two HWQ frames + * at a time, this should be OK for now. + */ + if ((!(m->m_flags & M_EAPOL)) && + (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { + sc->sc_stats.ast_tx_nodeq_overflow++; + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - ATH_TX_LOCK_ASSERT(sc); + /* + * Check how many TX buffers are available. + * + * If this is for non-EAPOL traffic, just leave some + * space free in order for buffer cloning and raw + * frame transmission to occur. + * + * If it's for EAPOL traffic, ignore this for now. + * Management traffic will be sent via the raw transmit + * method which bypasses this check. + * + * This is needed to ensure that EAPOL frames during + * (re) keying have a chance to go out. + * + * See kern/138379 for more information. + */ + if ((!(m->m_flags & M_EAPOL)) && + (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { + sc->sc_stats.ast_tx_nobuf++; + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start: called"); + /* + * Grab a TX buffer and associated resources. + * + * If it's an EAPOL frame, allocate a MGMT ath_buf. + * That way even with temporary buffer exhaustion due to + * the data path doesn't leave us without the ability + * to transmit management frames. + * + * Otherwise allocate a normal buffer. + */ + if (m->m_flags & M_EAPOL) + bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); + else + bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - for (;;) { + if (bf == NULL) { /* - * Grab the frame that we're going to try and transmit. + * If we failed to allocate a buffer, fail. + * + * We shouldn't fail normally, due to the check + * above. */ - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + sc->sc_stats.ast_tx_nobuf++; + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - /* - * Enforce how deep a node queue can get. - * - * XXX it would be nicer if we kept an mbuf queue per - * node and only whacked them into ath_bufs when we - * are ready to schedule some traffic from them. - * .. that may come later. - * - * XXX we should also track the per-node hardware queue - * depth so it is easy to limit the _SUM_ of the swq and - * hwq frames. Since we only schedule two HWQ frames - * at a time, this should be OK for now. - */ - if ((!(m->m_flags & M_EAPOL)) && - (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { - sc->sc_stats.ast_tx_nodeq_overflow++; - if (ni != NULL) - ieee80211_free_node(ni); - m_freem(m); - m = NULL; - continue; - } + /* + * At this point we have a buffer; so we need to free it + * if we hit any error conditions. + */ + + /* + * Check for fragmentation. If this frame + * has been broken up verify we have enough + * buffers to send all the fragments so all + * go out or none... + */ + TAILQ_INIT(&frags); + if ((m->m_flags & M_FRAG) && + !ath_txfrag_setup(sc, &frags, m, ni)) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: out of txfrag buffers\n", __func__); + sc->sc_stats.ast_tx_nofrag++; + ifp->if_oerrors++; + ath_freetx(m); + goto bad; + } + + /* + * At this point if we have any TX fragments, then we will + * have bumped the node reference once for each of those. + */ + + /* + * XXX Is there anything actually _enforcing_ that the + * fragments are being transmitted in one hit, rather than + * being interleaved with other transmissions on that + * hardware queue? + * + * The ATH TX output lock is the only thing serialising this + * right now. + */ + + /* + * Calculate the "next fragment" length field in ath_buf + * in order to let the transmit path know enough about + * what to next write to the hardware. + */ + if (m->m_flags & M_FRAG) { + struct ath_buf *fbf = bf; + struct ath_buf *n_fbf = NULL; + struct mbuf *fm = m->m_nextpkt; /* - * Check how many TX buffers are available. - * - * If this is for non-EAPOL traffic, just leave some - * space free in order for buffer cloning and raw - * frame transmission to occur. - * - * If it's for EAPOL traffic, ignore this for now. - * Management traffic will be sent via the raw transmit - * method which bypasses this check. - * - * This is needed to ensure that EAPOL frames during - * (re) keying have a chance to go out. - * - * See kern/138379 for more information. + * We need to walk the list of fragments and set + * the next size to the following buffer. + * However, the first buffer isn't in the frag + * list, so we have to do some gymnastics here. */ - if ((!(m->m_flags & M_EAPOL)) && - (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { - sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - _IF_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m = NULL; - break; + TAILQ_FOREACH(n_fbf, &frags, bf_list) { + fbf->bf_nextfraglen = fm->m_pkthdr.len; + fbf = n_fbf; + fm = fm->m_nextpkt; } + } + /* + * Bump the ifp output counter. + * + * XXX should use atomics? + */ + ifp->if_opackets++; +nextfrag: + /* + * Pass the frame to the h/w for transmission. + * Fragmented frames have each frag chained together + * with m_nextpkt. We know there are sufficient ath_buf's + * to send all the frags because of work done by + * ath_txfrag_setup. We leave m_nextpkt set while + * calling ath_tx_start so it can use it to extend the + * the tx duration to cover the subsequent frag and + * so it can reclaim all the mbufs in case of an error; + * ath_tx_start clears m_nextpkt once it commits to + * handing the frame to the hardware. + * + * Note: if this fails, then the mbufs are freed but + * not the node reference. + */ + next = m->m_nextpkt; + if (ath_tx_start(sc, ni, bf, m)) { +bad: + ifp->if_oerrors++; +reclaim: + bf->bf_m = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK(sc); + ath_returnbuf_head(sc, bf); /* - * Grab a TX buffer and associated resources. - * - * If it's an EAPOL frame, allocate a MGMT ath_buf. - * That way even with temporary buffer exhaustion due to - * the data path doesn't leave us without the ability - * to transmit management frames. - * - * Otherwise allocate a normal buffer. + * Free the rest of the node references and + * buffers for the fragment list. */ - if (m->m_flags & M_EAPOL) - bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); - else - bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - - if (bf == NULL) { - /* - * If we failed to allocate a buffer, prepend it - * and continue. - * - * We shouldn't fail normally, due to the check - * above. - */ - sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - _IF_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m = NULL; - break; - } + ath_txfrag_cleanup(sc, &frags, ni); + ATH_TXBUF_UNLOCK(sc); + retval = ENOBUFS; + goto finish; + } - npkts ++; + /* + * Check here if the node is in power save state. + */ + ath_tx_update_tim(sc, ni, 1); + if (next != NULL) { /* - * Check for fragmentation. If this frame - * has been broken up verify we have enough - * buffers to send all the fragments so all - * go out or none... + * Beware of state changing between frags. + * XXX check sta power-save state? */ - TAILQ_INIT(&frags); - if ((m->m_flags & M_FRAG) && - !ath_txfrag_setup(sc, &frags, m, ni)) { + if (ni->ni_vap->iv_state != IEEE80211_S_RUN) { DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: out of txfrag buffers\n", __func__); - sc->sc_stats.ast_tx_nofrag++; - ifp->if_oerrors++; - ath_freetx(m); - goto bad; - } - ifp->if_opackets++; - nextfrag: - /* - * Pass the frame to the h/w for transmission. - * Fragmented frames have each frag chained together - * with m_nextpkt. We know there are sufficient ath_buf's - * to send all the frags because of work done by - * ath_txfrag_setup. We leave m_nextpkt set while - * calling ath_tx_start so it can use it to extend the - * the tx duration to cover the subsequent frag and - * so it can reclaim all the mbufs in case of an error; - * ath_tx_start clears m_nextpkt once it commits to - * handing the frame to the hardware. - */ - next = m->m_nextpkt; - if (ath_tx_start(sc, ni, bf, m)) { - bad: - ifp->if_oerrors++; - reclaim: - bf->bf_m = NULL; - bf->bf_node = NULL; - ATH_TXBUF_LOCK(sc); - ath_returnbuf_head(sc, bf); - ath_txfrag_cleanup(sc, &frags, ni); - ATH_TXBUF_UNLOCK(sc); - /* - * XXX todo, free the node outside of - * the TX lock context! - */ - if (ni != NULL) - ieee80211_free_node(ni); - continue; + "%s: flush fragmented packet, state %s\n", + __func__, + ieee80211_state_name[ni->ni_vap->iv_state]); + /* XXX dmamap */ + ath_freetx(next); + goto reclaim; } + m = next; + bf = TAILQ_FIRST(&frags); + KASSERT(bf != NULL, ("no buf for txfrag")); + TAILQ_REMOVE(&frags, bf, bf_list); + goto nextfrag; + } - /* - * Check here if the node is in power save state. - */ - ath_tx_update_tim(sc, ni, 1); + /* + * Bump watchdog timer. + */ + sc->sc_wd_timer = 5; - if (next != NULL) { - /* - * Beware of state changing between frags. - * XXX check sta power-save state? - */ - if (ni->ni_vap->iv_state != IEEE80211_S_RUN) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: flush fragmented packet, state %s\n", - __func__, - ieee80211_state_name[ni->ni_vap->iv_state]); - /* XXX dmamap */ - ath_freetx(next); - goto reclaim; - } - m = next; - bf = TAILQ_FIRST(&frags); - KASSERT(bf != NULL, ("no buf for txfrag")); - TAILQ_REMOVE(&frags, bf, bf_list); - goto nextfrag; - } +finish: + ATH_TX_UNLOCK(sc); - sc->sc_wd_timer = 5; - } - ATH_KTR(sc, ATH_KTR_TX, 1, "ath_start: finished; npkts=%d", npkts); + /* + * Finished transmitting! + */ + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); + + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: finished"); + + return (retval); } + static int ath_media_change(struct ifnet *ifp) { Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath_misc.h Sun May 26 22:23:39 2013 (r251014) @@ -134,9 +134,7 @@ static inline void ath_tx_kick(struct ath_softc *sc) { - ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); + /* XXX NULL for now */ } /* Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath_tx.c Sun May 26 22:23:39 2013 (r251014) @@ -1154,7 +1154,6 @@ ath_tx_calc_duration(struct ath_softc *s dur = rt->info[rix].lpAckDuration; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { dur += dur; /* additional SIFS+ACK */ - KASSERT(bf->bf_m->m_nextpkt != NULL, ("no fragment")); /* * Include the size of next fragment so NAV is * updated properly. The last fragment uses only @@ -1164,9 +1163,10 @@ ath_tx_calc_duration(struct ath_softc *s * fragment is the same as the rate used by the * first fragment! */ - dur += ath_hal_computetxtime(ah, rt, - bf->bf_m->m_nextpkt->m_pkthdr.len, - rix, shortPreamble); + dur += ath_hal_computetxtime(ah, + rt, + bf->bf_nextfraglen, + rix, shortPreamble); } if (isfrag) { /* Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_athvar.h Sun May 26 22:23:39 2013 (r251014) @@ -225,6 +225,7 @@ struct ath_buf { bus_size_t bf_mapsize; #define ATH_MAX_SCATTER ATH_TXDESC /* max(tx,rx,beacon) desc's */ bus_dma_segment_t bf_segs[ATH_MAX_SCATTER]; + uint32_t bf_nextfraglen; /* length of next fragment */ /* Completion function to call on TX complete (fail or not) */ /* @@ -733,7 +734,6 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ - struct task sc_txpkttask; /* tx frame processing */ struct ath_descdma sc_txcompdma; /* TX EDMA completion */ struct mtx sc_txcomplock; /* TX EDMA completion lock */ From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:06:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC07D21D; Mon, 27 May 2013 00:06:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BCCFF35A; Mon, 27 May 2013 00:06:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R06OtS036837; Mon, 27 May 2013 00:06:24 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R06OjG036835; Mon, 27 May 2013 00:06:24 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270006.r4R06OjG036835@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251015 - in head/sys/arm/ti: . am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:06:24 -0000 Author: gonzo Date: Mon May 27 00:06:24 2013 New Revision: 251015 URL: http://svnweb.freebsd.org/changeset/base/251015 Log: Add clock definitions for LCD controller and PWM module Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/ti_prcm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Sun May 26 22:23:39 2013 (r251014) +++ head/sys/arm/ti/am335x/am335x_prcm.c Mon May 27 00:06:24 2013 (r251015) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) #define CM_PER_L3_CLKSTCTRL (CM_PER + 0x00C) #define CM_PER_CPGMAC0_CLKCTRL (CM_PER + 0x014) +#define CM_PER_LCDC_CLKCTRL (CM_PER + 0x018) #define CM_PER_USB0_CLKCTRL (CM_PER + 0x01C) #define CM_PER_TPTC0_CLKCTRL (CM_PER + 0x024) #define CM_PER_MMC0_CLKCTRL (CM_PER + 0x03C) @@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$"); #define CM_PER_GPIO2_CLKCTRL (CM_PER + 0x0B0) #define CM_PER_GPIO3_CLKCTRL (CM_PER + 0x0B4) #define CM_PER_TPCC_CLKCTRL (CM_PER + 0x0BC) +#define CM_PER_EPWMSS1_CLKCTRL (CM_PER + 0x0CC) +#define CM_PER_EPWMSS0_CLKCTRL (CM_PER + 0x0D4) +#define CM_PER_EPWMSS2_CLKCTRL (CM_PER + 0x0D8) #define CM_PER_L3_INSTR_CLKCTRL (CM_PER + 0x0DC) #define CM_PER_L3_CLKCTRL (CM_PER + 0x0E0) #define CM_PER_TIMER5_CLKCTRL (CM_PER + 0x0EC) @@ -90,7 +94,10 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_GPIO0_CLKCTRL (CM_WKUP + 0x008) #define CM_WKUP_CM_L3_AON_CLKSTCTRL (CM_WKUP + 0x01C) #define CM_WKUP_CM_CLKSEL_DPLL_MPU (CM_WKUP + 0x02C) +#define CM_WKUP_CM_IDLEST_DPLL_DISP (CM_WKUP + 0x048) +#define CM_WKUP_CM_CLKSEL_DPLL_DISP (CM_WKUP + 0x054) #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) +#define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) #define CM_DPLL 0x500 @@ -124,9 +131,11 @@ static int am335x_clk_generic_set_source static int am335x_clk_hsmmc_get_source_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_sysclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); +static int am335x_clk_get_arm_disp_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static void am335x_prcm_reset(void); static int am335x_clk_cpsw_activate(struct ti_clock_dev *clkdev); static int am335x_clk_musb0_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev); #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ @@ -190,6 +199,15 @@ struct ti_clock_dev ti_clk_devmap[] = { .clk_get_source_freq = NULL, }, + /* LCD controller clocks */ + { .id = LCDC_CLK, + .clk_activate = am335x_clk_lcdc_activate, + .clk_deactivate = NULL, + .clk_set_source = NULL, + .clk_accessible = NULL, + .clk_get_source_freq = am335x_clk_get_arm_disp_freq, + }, + /* DMTimer */ AM335X_GENERIC_CLOCK_DEV(DMTIMER2_CLK), AM335X_GENERIC_CLOCK_DEV(DMTIMER3_CLK), @@ -220,6 +238,11 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_MMCHS_CLOCK_DEV(MMC1_CLK), AM335X_MMCHS_CLOCK_DEV(MMC2_CLK), + /* PWMSS */ + AM335X_GENERIC_CLOCK_DEV(PWMSS0_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS1_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS2_CLK), + { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL } }; @@ -267,6 +290,11 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(MMC1_CLK, CM_PER_MMC1_CLKCTRL, 0), _CLK_DETAIL(MMC2_CLK, CM_PER_MMC1_CLKCTRL, 0), + /* PWMSS modules */ + _CLK_DETAIL(PWMSS0_CLK, CM_PER_EPWMSS0_CLKCTRL, 0), + _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0), + _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0), + { INVALID_CLK_IDENT, 0}, }; @@ -491,14 +519,15 @@ am335x_clk_get_sysclk_freq(struct ti_clo return (0); } +#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) +#define DPLL_DIV(reg) ((reg & 0x7f)+1) +#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) + static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq) { uint32_t reg; uint32_t sysclk; -#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) -#define DPLL_DIV(reg) ((reg & 0x7f)+1) -#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) reg = prcm_read_4(CM_WKUP_CM_CLKSEL_DPLL_MPU); @@ -511,6 +540,23 @@ am335x_clk_get_arm_fclk_freq(struct ti_c return(0); } +static int +am335x_clk_get_arm_disp_freq(struct ti_clock_dev *clkdev, unsigned int *freq) +{ + uint32_t reg; + uint32_t sysclk; + + reg = prcm_read_4(CM_WKUP_CM_CLKSEL_DPLL_DISP); + + /*Check if we are running in bypass */ + if (DPLL_BYP_CLKSEL(reg)) + return ENXIO; + + am335x_clk_get_sysclk_freq(NULL, &sysclk); + *freq = DPLL_MULT(reg) * (sysclk / DPLL_DIV(reg)); + return(0); +} + static void am335x_prcm_reset(void) { @@ -565,4 +611,46 @@ am335x_clk_musb0_activate(struct ti_cloc return(0); } +static int +am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev) +{ + struct am335x_prcm_softc *sc = am335x_prcm_sc; + + if (sc == NULL) + return (ENXIO); + + /* Bypass mode */ + prcm_write_4(CM_WKUP_CM_CLKMODE_DPLL_DISP, 0x4); + + /* Make sure it's in bypass mode */ + while (!(prcm_read_4(CM_WKUP_CM_IDLEST_DPLL_DISP) + & (1 << 8))) + DELAY(10); + /* + * For now set frequenct to 5xSYSFREQ + * More flexible control might be required + */ + prcm_write_4(CM_WKUP_CM_CLKSEL_DPLL_DISP, (5 << 8) | 0); + + /* Locked mode */ + prcm_write_4(CM_WKUP_CM_CLKMODE_DPLL_DISP, 0x7); + + int timeout = 10000; + while ((!(prcm_read_4(CM_WKUP_CM_IDLEST_DPLL_DISP) + & (1 << 0))) && timeout--) + DELAY(10); + + /*set MODULEMODE to ENABLE(2) */ + prcm_write_4(CM_PER_LCDC_CLKCTRL, 2); + + /* wait for MODULEMODE to become ENABLE(2) */ + while ((prcm_read_4(CM_PER_LCDC_CLKCTRL) & 0x3) != 2) + DELAY(10); + + /* wait for IDLEST to become Func(0) */ + while(prcm_read_4(CM_PER_LCDC_CLKCTRL) & (3<<16)) + DELAY(10); + + return (0); +} Modified: head/sys/arm/ti/ti_prcm.h ============================================================================== --- head/sys/arm/ti/ti_prcm.h Sun May 26 22:23:39 2013 (r251014) +++ head/sys/arm/ti/ti_prcm.h Mon May 27 00:06:24 2013 (r251015) @@ -141,6 +141,14 @@ typedef enum { EDMA_TPTC1_CLK, EDMA_TPTC2_CLK, + /* LCD controller module */ + LCDC_CLK = 1300, + + /* PWM modules */ + PWMSS0_CLK = 1400, + PWMSS1_CLK, + PWMSS2_CLK, + INVALID_CLK_IDENT } clk_ident_t; From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:09:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 335053A2; Mon, 27 May 2013 00:09:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0AEDF365; Mon, 27 May 2013 00:09:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0949D037334; Mon, 27 May 2013 00:09:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R094LB037333; Mon, 27 May 2013 00:09:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270009.r4R094LB037333@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251016 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:09:05 -0000 Author: gonzo Date: Mon May 27 00:09:04 2013 New Revision: 251016 URL: http://svnweb.freebsd.org/changeset/base/251016 Log: Add SCM registers definitions for AM335x platform Added: head/sys/arm/ti/am335x/am335x_scm.h (contents, props changed) Added: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_scm.h Mon May 27 00:09:04 2013 (r251016) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __AM335X_SCM_H__ +#define __AM335X_SCM_H__ + +/* AM335x-specific registers for control module (scm) */ +#define SCM_USB_CTRL0 0x620 +#define SCM_USB_STS0 0x624 +#define SCM_USB_CTRL1 0x628 +#define SCM_USB_STS1 0x62C +#define SCM_PWMSS_CTRL 0x664 + +#endif /* __AM335X_SCM_H__ */ From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:13:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A0676672; Mon, 27 May 2013 00:13:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80FA73E5; Mon, 27 May 2013 00:13:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0DSOR039744; Mon, 27 May 2013 00:13:28 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0DRWA039741; Mon, 27 May 2013 00:13:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270013.r4R0DRWA039741@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251017 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:13:28 -0000 Author: gonzo Date: Mon May 27 00:13:27 2013 New Revision: 251017 URL: http://svnweb.freebsd.org/changeset/base/251017 Log: Add PWM module driver for AM335x. Only eCAS subsystem is supported Export function to configure eCAS submodule from another drivers. It's used to control LCD panel backlight on AM335x EVM. Added: head/sys/arm/ti/am335x/am335x_pwm.c (contents, props changed) head/sys/arm/ti/am335x/am335x_pwm.h (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_pwm.c Mon May 27 00:13:27 2013 (r251017) @@ -0,0 +1,285 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include "am335x_pwm.h" +#include "am335x_scm.h" + +#define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "am335x_pwm softc", MTX_DEF) +#define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); + +static struct resource_spec am335x_pwm_mem_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* PWMSS */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* eCAP */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* eQEP */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /*ePWM */ + { -1, 0, 0 } +}; + +#define PWMSS_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res[0], reg); +#define PWMSS_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res[0], reg, value); + +#define ECAP_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res[1], reg); +#define ECAP_WRITE2(_sc, reg, value) \ + bus_write_2((_sc)->sc_mem_res[1], reg, value); +#define ECAP_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res[1], reg); +#define ECAP_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res[1], reg, value); + +#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res[3], reg); +#define EPWM_WRITE2(_sc, reg, value) \ + bus_write_2((_sc)->sc_mem_res[3], reg, value); + +#define PWMSS_IDVER 0x00 +#define PWMSS_SYSCONFIG 0x04 +#define PWMSS_CLKCONFIG 0x08 +#define CLKCONFIG_EPWMCLK_EN (1 << 8) +#define PWMSS_CLKSTATUS 0x0C + +#define ECAP_TSCTR 0x00 +#define ECAP_CAP1 0x08 +#define ECAP_CAP2 0x0C +#define ECAP_CAP3 0x10 +#define ECAP_CAP4 0x14 +#define ECAP_ECCTL2 0x2A +#define ECCTL2_MODE_APWM (1 << 9) +#define ECCTL2_SYNCO_SEL (3 << 6) +#define ECCTL2_TSCTRSTOP_FREERUN (1 << 4) + +#define EPWM_TBCTL 0x00 +#define TBCTL_PHDIR_UP (1 << 13) +#define TBCTL_PHDIR_DOWN (0 << 13) +#define TBCTL_CLKDIV(x) ((x) << 10) +#define TBCTL_HSPCLKDIV(x) ((x) << 7) +#define TBCTL_SYNCOSEL_DISABLED (3 << 4) +#define TBCTL_PRDLD_SHADOW (0 << 3) +#define TBCTL_PRDLD_IMMEDIATE (0 << 3) +#define TBCTL_PHSEN_ENABLED (1 << 2) +#define TBCTL_PHSEN_DISABLED (0 << 2) +#define EPWM_TBSTS 0x02 +#define EPWM_TBPHSHR 0x04 +#define EPWM_TBPHS 0x06 +#define EPWM_TBCNT 0x08 +#define EPWM_TBPRD 0x0a +/* Counter-compare */ +#define EPWM_CMPCTL 0x0e +#define CMPCTL_SHDWBMODE_SHADOW (1 << 6) +#define CMPCTL_SHDWBMODE_IMMEDIATE (0 << 6) +#define CMPCTL_SHDWAMODE_SHADOW (1 << 4) +#define CMPCTL_SHDWAMODE_IMMEDIATE (0 << 4) +#define CMPCTL_LOADBMODE_ZERO (0 << 2) +#define CMPCTL_LOADBMODE_PRD (1 << 2) +#define CMPCTL_LOADBMODE_EITHER (2 << 2) +#define CMPCTL_LOADBMODE_FREEZE (3 << 2) +#define CMPCTL_LOADAMODE_ZERO (0 << 0) +#define CMPCTL_LOADAMODE_PRD (1 << 0) +#define CMPCTL_LOADAMODE_EITHER (2 << 0) +#define CMPCTL_LOADAMODE_FREEZE (3 << 0) +#define EPWM_CMPAHR 0x10 +#define EPWM_CMPA 0x12 +#define EPWM_CMPB 0x14 +/* CMPCTL_LOADAMODE_ZERO */ +#define EPWM_AQCTLA 0x16 +#define EPWM_AQCTLB 0x18 +#define AQCTL_CAU_NONE (0 << 0) +#define AQCTL_CAU_CLEAR (1 << 0) +#define AQCTL_CAU_SET (2 << 0) +#define AQCTL_CAU_TOGGLE (3 << 0) +#define AQCTL_ZRO_NONE (0 << 0) +#define AQCTL_ZRO_CLEAR (1 << 0) +#define AQCTL_ZRO_SET (2 << 0) +#define AQCTL_ZRO_TOGGLE (3 << 0) +#define EPWM_AQSFRC 0x1a +#define EPWM_AQCSFRC 0x1c + +static device_probe_t am335x_pwm_probe; +static device_attach_t am335x_pwm_attach; +static device_detach_t am335x_pwm_detach; + +struct am335x_pwm_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource *sc_mem_res[4]; + int sc_id; +}; + +static device_method_t am335x_pwm_methods[] = { + DEVMETHOD(device_probe, am335x_pwm_probe), + DEVMETHOD(device_attach, am335x_pwm_attach), + DEVMETHOD(device_detach, am335x_pwm_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_pwm_driver = { + "am335x_pwm", + am335x_pwm_methods, + sizeof(struct am335x_pwm_softc), +}; + +static devclass_t am335x_pwm_devclass; + +/* + * API function to set period/duty cycles for ECASx + */ +int +am335x_pwm_config_ecas(int unit, int period, int duty) +{ + device_t dev; + struct am335x_pwm_softc *sc; + uint16_t reg; + + dev = devclass_get_device(am335x_pwm_devclass, unit); + if (dev == NULL) + return (ENXIO); + + if (duty > period) + return (EINVAL); + + if (period == 0) + return (EINVAL); + + sc = device_get_softc(dev); + PWM_LOCK(sc); + + reg = ECAP_READ2(sc, ECAP_ECCTL2); + reg |= ECCTL2_MODE_APWM | ECCTL2_TSCTRSTOP_FREERUN | ECCTL2_SYNCO_SEL; + ECAP_WRITE2(sc, ECAP_ECCTL2, reg); + + /* CAP3 in APWM mode is APRD shadow register */ + ECAP_WRITE4(sc, ECAP_CAP3, period - 1); + + /* CAP4 in APWM mode is ACMP shadow register */ + ECAP_WRITE4(sc, ECAP_CAP4, duty); + /* Restart counter */ + ECAP_WRITE4(sc, ECAP_TSCTR, 0); + + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_pwm_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ti,am335x-pwm")) + return (ENXIO); + + device_set_desc(dev, "AM335x PWM"); + + return (BUS_PROBE_DEFAULT); +} + +static int +am335x_pwm_attach(device_t dev) +{ + struct am335x_pwm_softc *sc; + int err; + uint32_t reg; + phandle_t node; + pcell_t did; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + /* Get the PWM module id */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "pwm-device-id", &did, sizeof(did))) <= 0) { + device_printf(dev, "missing pwm-device-id attribute in FDT\n"); + return (ENXIO); + } + sc->sc_id = fdt32_to_cpu(did); + + PWM_LOCK_INIT(sc); + + err = bus_alloc_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + if (err) { + device_printf(dev, "cannot allocate memory resources\n"); + goto fail; + } + + ti_prcm_clk_enable(PWMSS0_CLK + sc->sc_id); + ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); + reg |= (1 << sc->sc_id); + ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); + + return (0); +fail: + PWM_LOCK_DESTROY(sc); + if (sc->sc_mem_res[0]) + bus_release_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + + return(ENXIO); +} + +static int +am335x_pwm_detach(device_t dev) +{ + struct am335x_pwm_softc *sc; + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + if (sc->sc_mem_res[0]) + bus_release_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + PWM_UNLOCK(sc); + + PWM_LOCK_DESTROY(sc); + + return (0); +} + +DRIVER_MODULE(am335x_pwm, simplebus, am335x_pwm_driver, am335x_pwm_devclass, 0, 0); +MODULE_VERSION(am335x_pwm, 1); +MODULE_DEPEND(am335x_pwm, simplebus, 1, 1, 1); Added: head/sys/arm/ti/am335x/am335x_pwm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_pwm.h Mon May 27 00:13:27 2013 (r251017) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __AM335X_PWM_H__ +#define __AM335X_PWM_H__ + +int am335x_pwm_config_ecas(int unit, int period, int duty); + +#endif /* __AM335X_PWM_H__ */ Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Mon May 27 00:09:04 2013 (r251016) +++ head/sys/arm/ti/am335x/files.am335x Mon May 27 00:13:27 2013 (r251017) @@ -4,6 +4,7 @@ arm/ti/aintc.c standard arm/ti/am335x/am335x_prcm.c standard arm/ti/am335x/am335x_dmtimer.c standard arm/ti/am335x/am335x_scm_padconf.c standard +arm/ti/am335x/am335x_pwm.c standard arm/ti/ti_edma3.c standard arm/ti/ti_mmchs.c optional mmc arm/ti/cpsw/if_cpsw.c optional cpsw From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:23:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2899977; Mon, 27 May 2013 00:23:02 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1791650; Mon, 27 May 2013 00:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0N2mW042973; Mon, 27 May 2013 00:23:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0N2bC042969; Mon, 27 May 2013 00:23:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270023.r4R0N2bC042969@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251018 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:23:02 -0000 Author: gonzo Date: Mon May 27 00:23:01 2013 New Revision: 251018 URL: http://svnweb.freebsd.org/changeset/base/251018 Log: AM335x LCD controller driver with syscons support Limitations: - Raster mode only - 24 and 32 bpp only Added: head/sys/arm/ti/am335x/am335x_lcd.c (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd.h (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd_syscons.c (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd.c Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,667 @@ +/*- + * Copyright 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include "am335x_lcd.h" +#include "am335x_pwm.h" + +#define LCD_PID 0x00 +#define LCD_CTRL 0x04 +#define CTRL_DIV_MASK 0xff +#define CTRL_DIV_SHIFT 8 +#define CTRL_AUTO_UFLOW_RESTART (1 << 1) +#define CTRL_RASTER_MODE 1 +#define CTRL_LIDD_MODE 0 +#define LCD_LIDD_CTRL 0x0C +#define LCD_LIDD_CS0_CONF 0x10 +#define LCD_LIDD_CS0_ADDR 0x14 +#define LCD_LIDD_CS0_DATA 0x18 +#define LCD_LIDD_CS1_CONF 0x1C +#define LCD_LIDD_CS1_ADDR 0x20 +#define LCD_LIDD_CS1_DATA 0x24 +#define LCD_RASTER_CTRL 0x28 +#define RASTER_CTRL_TFT24_UNPACKED (1 << 26) +#define RASTER_CTRL_TFT24 (1 << 25) +#define RASTER_CTRL_STN565 (1 << 24) +#define RASTER_CTRL_TFTPMAP (1 << 23) +#define RASTER_CTRL_NIBMODE (1 << 22) +#define RASTER_CTRL_PALMODE_SHIFT 20 +#define PALETTE_PALETTE_AND_DATA 0x00 +#define PALETTE_PALETTE_ONLY 0x01 +#define PALETTE_DATA_ONLY 0x02 +#define RASTER_CTRL_REQDLY_SHIFT 12 +#define RASTER_CTRL_MONO8B (1 << 9) +#define RASTER_CTRL_RBORDER (1 << 8) +#define RASTER_CTRL_LCDTFT (1 << 7) +#define RASTER_CTRL_LCDBW (1 << 1) +#define RASTER_CTRL_LCDEN (1 << 0) +#define LCD_RASTER_TIMING_0 0x2C +#define RASTER_TIMING_0_HBP_SHIFT 24 +#define RASTER_TIMING_0_HFP_SHIFT 16 +#define RASTER_TIMING_0_HSW_SHIFT 10 +#define RASTER_TIMING_0_PPLLSB_SHIFT 4 +#define RASTER_TIMING_0_PPLMSB_SHIFT 3 +#define LCD_RASTER_TIMING_1 0x30 +#define RASTER_TIMING_1_VBP_SHIFT 24 +#define RASTER_TIMING_1_VFP_SHIFT 16 +#define RASTER_TIMING_1_VSW_SHIFT 10 +#define RASTER_TIMING_1_LPP_SHIFT 0 +#define LCD_RASTER_TIMING_2 0x34 +#define RASTER_TIMING_2_HSWHI_SHIFT 27 +#define RASTER_TIMING_2_LPP_B10_SHIFT 26 +#define RASTER_TIMING_2_PHSVS (1 << 25) +#define RASTER_TIMING_2_PHSVS_RISE (1 << 24) +#define RASTER_TIMING_2_PHSVS_FALL (0 << 24) +#define RASTER_TIMING_2_IOE (1 << 23) +#define RASTER_TIMING_2_IPC (1 << 22) +#define RASTER_TIMING_2_IHS (1 << 21) +#define RASTER_TIMING_2_IVS (1 << 20) +#define RASTER_TIMING_2_ACBI_SHIFT 16 +#define RASTER_TIMING_2_ACB_SHIFT 8 +#define RASTER_TIMING_2_HBPHI_SHIFT 4 +#define RASTER_TIMING_2_HFPHI_SHIFT 0 +#define LCD_RASTER_SUBPANEL 0x38 +#define LCD_RASTER_SUBPANEL2 0x3C +#define LCD_LCDDMA_CTRL 0x40 +#define LCDDMA_CTRL_DMA_MASTER_PRIO_SHIFT 16 +#define LCDDMA_CTRL_TH_FIFO_RDY_SHIFT 8 +#define LCDDMA_CTRL_BURST_SIZE_SHIFT 4 +#define LCDDMA_CTRL_BYTES_SWAP (1 << 3) +#define LCDDMA_CTRL_BE (1 << 1) +#define LCDDMA_CTRL_FB0_ONLY 0 +#define LCDDMA_CTRL_FB0_FB1 (1 << 0) +#define LCD_LCDDMA_FB0_BASE 0x44 +#define LCD_LCDDMA_FB0_CEILING 0x48 +#define LCD_LCDDMA_FB1_BASE 0x4C +#define LCD_LCDDMA_FB1_CEILING 0x50 +#define LCD_SYSCONFIG 0x54 +#define SYSCONFIG_STANDBY_FORCE (0 << 4) +#define SYSCONFIG_STANDBY_NONE (1 << 4) +#define SYSCONFIG_STANDBY_SMART (2 << 4) +#define SYSCONFIG_IDLE_FORCE (0 << 2) +#define SYSCONFIG_IDLE_NONE (1 << 2) +#define SYSCONFIG_IDLE_SMART (2 << 2) +#define LCD_IRQSTATUS_RAW 0x58 +#define LCD_IRQSTATUS 0x5C +#define LCD_IRQENABLE_SET 0x60 +#define LCD_IRQENABLE_CLEAR 0x64 +#define IRQ_EOF1 (1 << 9) +#define IRQ_EOF0 (1 << 8) +#define IRQ_PL (1 << 6) +#define IRQ_FUF (1 << 5) +#define IRQ_ACB (1 << 3) +#define IRQ_SYNC_LOST (1 << 2) +#define IRQ_RASTER_DONE (1 << 1) +#define IRQ_FRAME_DONE (1 << 0) +#define LCD_CLKC_ENABLE 0x6C +#define CLKC_ENABLE_DMA (1 << 2) +#define CLKC_ENABLE_LDID (1 << 1) +#define CLKC_ENABLE_CORE (1 << 0) +#define LCD_CLKC_RESET 0x70 +#define CLKC_RESET_MAIN (1 << 3) +#define CLKC_RESET_DMA (1 << 2) +#define CLKC_RESET_LDID (1 << 1) +#define CLKC_RESET_CORE (1 << 0) + +#define LCD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define LCD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define LCD_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "am335x_lcd", MTX_DEF) +#define LCD_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); + +#define LCD_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, reg); +#define LCD_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res, reg, value); + + +/* Backlight is controlled by eCAS interface on PWM unit 0 */ +#define PWM_UNIT 0 +#define PWM_PERIOD 100 + +struct am335x_lcd_softc { + device_t sc_dev; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + void *sc_intr_hl; + struct mtx sc_mtx; + int sc_backlight; + struct sysctl_oid *sc_oid; + + /* Framebuffer */ + bus_dma_tag_t sc_dma_tag; + bus_dmamap_t sc_dma_map; + size_t sc_fb_size; + bus_addr_t sc_fb_phys; + uint8_t *sc_fb_base; +}; + +static void +am335x_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = segs[0].ds_addr; +} + +static uint32_t +am335x_lcd_calc_divisor(uint32_t reference, uint32_t freq) +{ + uint32_t div; + /* Raster mode case: divisors are in range from 2 to 255 */ + for (div = 2; div < 255; div++) + if (reference/div <= freq) + return (div); + + return (255); +} + +static int +am335x_lcd_sysctl_backlight(SYSCTL_HANDLER_ARGS) +{ + struct am335x_lcd_softc *sc = (struct am335x_lcd_softc*)arg1; + int error; + int backlight; + + backlight = sc->sc_backlight;; + error = sysctl_handle_int(oidp, &backlight, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + if (backlight < 0) + backlight = 0; + if (backlight > 100) + backlight = 100; + + LCD_LOCK(sc); + error = am335x_pwm_config_ecas(PWM_UNIT, PWM_PERIOD, + backlight*PWM_PERIOD/100); + if (error == 0) + sc->sc_backlight = backlight; + LCD_UNLOCK(sc); + + return (error); +} + +static int +am335x_read_panel_property(device_t dev, const char *name, uint32_t *val) +{ + phandle_t node; + pcell_t cell; + + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, name, &cell, sizeof(cell))) <= 0) { + device_printf(dev, "missing '%s' attribute in LCD panel info\n", + name); + return (ENXIO); + } + + *val = fdt32_to_cpu(cell); + + return (0); +} + +static int +am335x_read_panel_info(device_t dev, struct panel_info *panel) +{ + int error; + + error = 0; + if ((error = am335x_read_panel_property(dev, + "panel_width", &panel->panel_width))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_height", &panel->panel_height))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hfp", &panel->panel_hfp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hbp", &panel->panel_hbp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hsw", &panel->panel_hsw))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vfp", &panel->panel_vfp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vbp", &panel->panel_vbp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vsw", &panel->panel_vsw))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_pxl_clk", &panel->panel_pxl_clk))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_invert_pxl_clk", &panel->panel_invert_pxl_clk))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "ac_bias", &panel->ac_bias))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "ac_bias_intrpt", &panel->ac_bias_intrpt))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "dma_burst_sz", &panel->dma_burst_sz))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "bpp", &panel->bpp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "fdd", &panel->fdd))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "invert_line_clock", &panel->invert_line_clock))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "invert_frm_clock", &panel->invert_frm_clock))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "sync_edge", &panel->sync_edge))) + goto out; + + error = am335x_read_panel_property(dev, + "sync_ctrl", &panel->sync_ctrl); + +out: + return (error); +} + +static void +am335x_lcd_intr(void *arg) +{ + struct am335x_lcd_softc *sc = arg; + uint32_t reg; + + reg = LCD_READ4(sc, LCD_IRQSTATUS); + LCD_WRITE4(sc, LCD_IRQSTATUS, reg); + + if (reg & IRQ_SYNC_LOST) { + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg &= ~RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + return; + } + + if (reg & IRQ_PL) { + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg &= ~RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + return; + } + + if (reg & IRQ_EOF0) { + LCD_WRITE4(sc, LCD_LCDDMA_FB0_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB0_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + reg &= ~IRQ_EOF0; + } + + if (reg & IRQ_EOF1) { + LCD_WRITE4(sc, LCD_LCDDMA_FB1_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + reg &= ~IRQ_EOF1; + } + + if (reg & IRQ_FUF) { + /* TODO: Handle FUF */ + } + + if (reg & IRQ_ACB) { + /* TODO: Handle ACB */ + } +} + +static int +am335x_lcd_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) + return (ENXIO); + + device_set_desc(dev, "AM335x LCD controller"); + + return (0); +} + +static int +am335x_lcd_attach(device_t dev) +{ + struct am335x_lcd_softc *sc; + int rid; + int div; + struct panel_info panel; + uint32_t reg, timing0, timing1, timing2; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + uint32_t burst_log; + int err; + size_t dma_size; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + if (am335x_read_panel_info(dev, &panel)) + return (ENXIO); + + int ref_freq = 0; + ti_prcm_clk_enable(LCDC_CLK); + if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { + device_printf(dev, "Can't get reference frequency\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, am335x_lcd_intr, sc, + &sc->sc_intr_hl) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->sc_mem_res); + device_printf(dev, "Unable to setup the irq handler.\n"); + return (ENXIO); + } + + LCD_LOCK_INIT(sc); + + /* Panle initialization */ + dma_size = round_page(panel.panel_width*panel.panel_height*panel.bpp/8); + + /* + * Now allocate framebuffer memory + */ + err = bus_dma_tag_create( + bus_get_dma_tag(dev), + 4, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + dma_size, 1, /* maxsize, nsegments */ + dma_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->sc_dma_tag); + if (err) + goto fail; + + err = bus_dmamem_alloc(sc->sc_dma_tag, (void **)&sc->sc_fb_base, + 0, &sc->sc_dma_map); + + if (err) { + device_printf(dev, "cannot allocate framebuffer\n"); + goto fail; + } + + err = bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, sc->sc_fb_base, + dma_size, am335x_fb_dmamap_cb, &sc->sc_fb_phys, BUS_DMA_NOWAIT); + + if (err) { + device_printf(dev, "cannot load DMA map\n"); + goto fail; + } + + /* Make sure it's blank */ + memset(sc->sc_fb_base, 0x00, dma_size); + + /* Calculate actual FB Size */ + sc->sc_fb_size = panel.panel_width*panel.panel_height*panel.bpp/8; + + /* Only raster mode is supported */ + reg = CTRL_RASTER_MODE; + div = am335x_lcd_calc_divisor(ref_freq, panel.panel_pxl_clk); + reg |= (div << CTRL_DIV_SHIFT); + LCD_WRITE4(sc, LCD_CTRL, reg); + + /* Set timing */ + timing0 = timing1 = timing2 = 0; + + /* Horizontal back porch */ + timing0 |= (panel.panel_hbp & 0xff) << RASTER_TIMING_0_HBP_SHIFT; + timing2 |= ((panel.panel_hbp >> 8) & 3) << RASTER_TIMING_2_HBPHI_SHIFT; + /* Horizontal front porch */ + timing0 |= (panel.panel_hfp & 0xff) << RASTER_TIMING_0_HFP_SHIFT; + timing2 |= ((panel.panel_hfp >> 8) & 3) << RASTER_TIMING_2_HFPHI_SHIFT; + /* Horizontal sync width */ + timing0 |= (panel.panel_hsw & 0x3f) << RASTER_TIMING_0_HSW_SHIFT; + timing2 |= ((panel.panel_hsw >> 6) & 0xf) << RASTER_TIMING_2_HSWHI_SHIFT; + + /* Vertical back porch, front porch, sync width */ + timing1 |= (panel.panel_vbp & 0xff) << RASTER_TIMING_1_VBP_SHIFT; + timing1 |= (panel.panel_vfp & 0xff) << RASTER_TIMING_1_VFP_SHIFT; + timing1 |= (panel.panel_vsw & 0x3f) << RASTER_TIMING_1_VSW_SHIFT; + + /* Pixels per line */ + timing0 |= (((panel.panel_width - 1) >> 10) & 1) + << RASTER_TIMING_0_PPLMSB_SHIFT; + timing0 |= (((panel.panel_width - 1) >> 4) & 0x3f) + << RASTER_TIMING_0_PPLLSB_SHIFT; + + /* Lines per panel */ + timing1 |= ((panel.panel_height - 1) & 0x3ff) + << RASTER_TIMING_1_LPP_SHIFT; + timing2 |= (((panel.panel_height - 1) >> 10 ) & 1) + << RASTER_TIMING_2_LPP_B10_SHIFT; + + /* clock signal settings */ + if (panel.sync_ctrl) + timing2 |= RASTER_TIMING_2_PHSVS; + if (panel.sync_edge) + timing2 |= RASTER_TIMING_2_PHSVS_RISE; + else + timing2 |= RASTER_TIMING_2_PHSVS_FALL; + if (panel.invert_line_clock) + timing2 |= RASTER_TIMING_2_IHS; + if (panel.invert_frm_clock) + timing2 |= RASTER_TIMING_2_IVS; + if (panel.panel_invert_pxl_clk) + timing2 |= RASTER_TIMING_2_IPC; + + /* AC bias */ + timing2 |= (panel.ac_bias << RASTER_TIMING_2_ACB_SHIFT); + timing2 |= (panel.ac_bias_intrpt << RASTER_TIMING_2_ACBI_SHIFT); + + LCD_WRITE4(sc, LCD_RASTER_TIMING_0, timing0); + LCD_WRITE4(sc, LCD_RASTER_TIMING_1, timing1); + LCD_WRITE4(sc, LCD_RASTER_TIMING_2, timing2); + + /* DMA settings */ + reg = LCDDMA_CTRL_FB0_FB1; + /* Find power of 2 for current burst size */ + switch (panel.dma_burst_sz) { + case 1: + burst_log = 0; + break; + case 2: + burst_log = 1; + break; + case 4: + burst_log = 2; + break; + case 8: + burst_log = 3; + break; + case 16: + default: + burst_log = 4; + break; + } + reg |= (burst_log << LCDDMA_CTRL_BURST_SIZE_SHIFT); + /* XXX: FIFO TH */ + reg |= (0 << LCDDMA_CTRL_TH_FIFO_RDY_SHIFT); + LCD_WRITE4(sc, LCD_LCDDMA_CTRL, reg); + + LCD_WRITE4(sc, LCD_LCDDMA_FB0_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB0_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + + /* Enable LCD */ + reg = RASTER_CTRL_LCDTFT; + reg |= (panel.fdd << RASTER_CTRL_REQDLY_SHIFT); + reg |= (PALETTE_DATA_ONLY << RASTER_CTRL_PALMODE_SHIFT); + if (panel.bpp >= 24) + reg |= RASTER_CTRL_TFT24; + if (panel.bpp == 32) + reg |= RASTER_CTRL_TFT24_UNPACKED; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + LCD_WRITE4(sc, LCD_CLKC_ENABLE, + CLKC_ENABLE_DMA | CLKC_ENABLE_LDID | CLKC_ENABLE_CORE); + + LCD_WRITE4(sc, LCD_CLKC_RESET, CLKC_RESET_MAIN); + DELAY(100); + LCD_WRITE4(sc, LCD_CLKC_RESET, 0); + + reg = IRQ_EOF1 | IRQ_EOF0 | IRQ_FUF | IRQ_PL | + IRQ_ACB | IRQ_SYNC_LOST | IRQ_RASTER_DONE | + IRQ_FRAME_DONE; + LCD_WRITE4(sc, LCD_IRQENABLE_SET, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + LCD_WRITE4(sc, LCD_SYSCONFIG, + SYSCONFIG_STANDBY_SMART | SYSCONFIG_IDLE_SMART); + + /* Init backlight interface */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree = device_get_sysctl_tree(sc->sc_dev); + sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "backlight", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_lcd_sysctl_backlight, "I", "LCD backlight"); + sc->sc_backlight = 0; + /* Check if eCAS interface is available at this point */ + if (am335x_pwm_config_ecas(PWM_UNIT, + PWM_PERIOD, PWM_PERIOD) == 0) + sc->sc_backlight = 100; + + am335x_lcd_syscons_setup((vm_offset_t)sc->sc_fb_base, sc->sc_fb_phys, &panel); + + return (0); + +fail: + return (err); +} + +static int +am335x_lcd_detach(device_t dev) +{ + /* Do not let unload driver */ + return (EBUSY); +} + +static device_method_t am335x_lcd_methods[] = { + DEVMETHOD(device_probe, am335x_lcd_probe), + DEVMETHOD(device_attach, am335x_lcd_attach), + DEVMETHOD(device_detach, am335x_lcd_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_lcd_driver = { + "am335x_lcd", + am335x_lcd_methods, + sizeof(struct am335x_lcd_softc), +}; + +static devclass_t am335x_lcd_devclass; + +DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, am335x_lcd_devclass, 0, 0); +MODULE_VERSION(am335x_lcd, 1); +MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); Added: head/sys/arm/ti/am335x/am335x_lcd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd.h Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __AM335X_LCD_H__ +#define __AM335X_LCD_H__ + +struct panel_info { + uint32_t panel_width; + uint32_t panel_height; + uint32_t panel_hfp; + uint32_t panel_hbp; + uint32_t panel_hsw; + uint32_t panel_vfp; + uint32_t panel_vbp; + uint32_t panel_vsw; + uint32_t ac_bias; + uint32_t ac_bias_intrpt; + uint32_t dma_burst_sz; + uint32_t bpp; + uint32_t fdd; + uint32_t invert_line_clock; + uint32_t invert_frm_clock; + uint32_t sync_edge; + uint32_t sync_ctrl; + uint32_t panel_pxl_clk; + uint32_t panel_invert_pxl_clk; +}; + +int am335x_lcd_syscons_setup(vm_offset_t vaddr, vm_paddr_t paddr, + struct panel_info *panel); + +#endif /* __AM335X_LCD_H__ */ Added: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,793 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "am335x_lcd.h" + +struct video_adapter_softc { + /* Videoadpater part */ + video_adapter_t va; + int console; + + intptr_t fb_addr; + intptr_t fb_paddr; + unsigned int fb_size; + + unsigned int height; + unsigned int width; + unsigned int depth; + unsigned int stride; + + unsigned int xmargin; + unsigned int ymargin; + + unsigned char *font; + int initialized; +}; + +struct argb { + uint8_t a; + uint8_t r; + uint8_t g; + uint8_t b; +}; + +static struct argb am335x_syscons_palette[16] = { + {0x00, 0x00, 0x00, 0x00}, + {0x00, 0x00, 0x00, 0xaa}, + {0x00, 0x00, 0xaa, 0x00}, + {0x00, 0x00, 0xaa, 0xaa}, + {0x00, 0xaa, 0x00, 0x00}, + {0x00, 0xaa, 0x00, 0xaa}, + {0x00, 0xaa, 0x55, 0x00}, + {0x00, 0xaa, 0xaa, 0xaa}, + {0x00, 0x55, 0x55, 0x55}, + {0x00, 0x55, 0x55, 0xff}, + {0x00, 0x55, 0xff, 0x55}, + {0x00, 0x55, 0xff, 0xff}, + {0x00, 0xff, 0x55, 0x55}, + {0x00, 0xff, 0x55, 0xff}, + {0x00, 0xff, 0xff, 0x55}, + {0x00, 0xff, 0xff, 0xff} +}; + +/* mouse pointer from dev/syscons/scgfbrndr.c */ +static u_char mouse_pointer[16] = { + 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, + 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 +}; + +#define AM335X_FONT_HEIGHT 16 + +#define FB_WIDTH 640 +#define FB_HEIGHT 480 +#define FB_DEPTH 24 + +static struct video_adapter_softc va_softc; + +static int am335x_syscons_configure(int flags); + +/* + * Video driver routines and glue. + */ +static vi_probe_t am335x_syscons_probe; +static vi_init_t am335x_syscons_init; +static vi_get_info_t am335x_syscons_get_info; +static vi_query_mode_t am335x_syscons_query_mode; +static vi_set_mode_t am335x_syscons_set_mode; +static vi_save_font_t am335x_syscons_save_font; +static vi_load_font_t am335x_syscons_load_font; +static vi_show_font_t am335x_syscons_show_font; +static vi_save_palette_t am335x_syscons_save_palette; +static vi_load_palette_t am335x_syscons_load_palette; +static vi_set_border_t am335x_syscons_set_border; +static vi_save_state_t am335x_syscons_save_state; +static vi_load_state_t am335x_syscons_load_state; +static vi_set_win_org_t am335x_syscons_set_win_org; +static vi_read_hw_cursor_t am335x_syscons_read_hw_cursor; +static vi_set_hw_cursor_t am335x_syscons_set_hw_cursor; +static vi_set_hw_cursor_shape_t am335x_syscons_set_hw_cursor_shape; +static vi_blank_display_t am335x_syscons_blank_display; +static vi_mmap_t am335x_syscons_mmap; +static vi_ioctl_t am335x_syscons_ioctl; +static vi_clear_t am335x_syscons_clear; +static vi_fill_rect_t am335x_syscons_fill_rect; +static vi_bitblt_t am335x_syscons_bitblt; +static vi_diag_t am335x_syscons_diag; +static vi_save_cursor_palette_t am335x_syscons_save_cursor_palette; +static vi_load_cursor_palette_t am335x_syscons_load_cursor_palette; +static vi_copy_t am335x_syscons_copy; +static vi_putp_t am335x_syscons_putp; +static vi_putc_t am335x_syscons_putc; +static vi_puts_t am335x_syscons_puts; +static vi_putm_t am335x_syscons_putm; + +static video_switch_t am335x_sysconsvidsw = { + .probe = am335x_syscons_probe, + .init = am335x_syscons_init, + .get_info = am335x_syscons_get_info, + .query_mode = am335x_syscons_query_mode, + .set_mode = am335x_syscons_set_mode, + .save_font = am335x_syscons_save_font, + .load_font = am335x_syscons_load_font, + .show_font = am335x_syscons_show_font, + .save_palette = am335x_syscons_save_palette, + .load_palette = am335x_syscons_load_palette, + .set_border = am335x_syscons_set_border, + .save_state = am335x_syscons_save_state, + .load_state = am335x_syscons_load_state, + .set_win_org = am335x_syscons_set_win_org, + .read_hw_cursor = am335x_syscons_read_hw_cursor, + .set_hw_cursor = am335x_syscons_set_hw_cursor, + .set_hw_cursor_shape = am335x_syscons_set_hw_cursor_shape, + .blank_display = am335x_syscons_blank_display, + .mmap = am335x_syscons_mmap, + .ioctl = am335x_syscons_ioctl, + .clear = am335x_syscons_clear, + .fill_rect = am335x_syscons_fill_rect, + .bitblt = am335x_syscons_bitblt, + .diag = am335x_syscons_diag, + .save_cursor_palette = am335x_syscons_save_cursor_palette, + .load_cursor_palette = am335x_syscons_load_cursor_palette, + .copy = am335x_syscons_copy, + .putp = am335x_syscons_putp, + .putc = am335x_syscons_putc, + .puts = am335x_syscons_puts, + .putm = am335x_syscons_putm, +}; + +VIDEO_DRIVER(am335x_syscons, am335x_sysconsvidsw, am335x_syscons_configure); + +static vr_init_t am335x_rend_init; +static vr_clear_t am335x_rend_clear; +static vr_draw_border_t am335x_rend_draw_border; +static vr_draw_t am335x_rend_draw; +static vr_set_cursor_t am335x_rend_set_cursor; +static vr_draw_cursor_t am335x_rend_draw_cursor; +static vr_blink_cursor_t am335x_rend_blink_cursor; +static vr_set_mouse_t am335x_rend_set_mouse; +static vr_draw_mouse_t am335x_rend_draw_mouse; + +/* + * We use our own renderer; this is because we must emulate a hardware + * cursor. + */ +static sc_rndr_sw_t am335x_rend = { + am335x_rend_init, + am335x_rend_clear, + am335x_rend_draw_border, + am335x_rend_draw, + am335x_rend_set_cursor, + am335x_rend_draw_cursor, + am335x_rend_blink_cursor, + am335x_rend_set_mouse, + am335x_rend_draw_mouse +}; + +RENDERER(am335x_syscons, 0, am335x_rend, gfb_set); +RENDERER_MODULE(am335x_syscons, gfb_set); + +static void +am335x_rend_init(scr_stat* scp) +{ +} + +static void +am335x_rend_clear(scr_stat* scp, int c, int attr) +{ +} + +static void +am335x_rend_draw_border(scr_stat* scp, int color) +{ +} + +static void +am335x_rend_draw(scr_stat* scp, int from, int count, int flip) +{ + video_adapter_t* adp = scp->sc->adp; + int i, c, a; + + if (!flip) { + /* Normal printing */ + vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count); + } else { + /* This is for selections and such: invert the color attribute */ + for (i = count; i-- > 0; ++from) { + c = sc_vtb_getc(&scp->vtb, from); + a = sc_vtb_geta(&scp->vtb, from) >> 8; + vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); + } + } +} + +static void +am335x_rend_set_cursor(scr_stat* scp, int base, int height, int blink) +{ +} + +static void +am335x_rend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip) +{ + video_adapter_t* adp = scp->sc->adp; + struct video_adapter_softc *sc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:23:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD42CAFB; Mon, 27 May 2013 00:23:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF9EA658; Mon, 27 May 2013 00:23:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0Nxav043152; Mon, 27 May 2013 00:23:59 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0NxLN043151; Mon, 27 May 2013 00:23:59 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270023.r4R0NxLN043151@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251019 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:23:59 -0000 Author: gonzo Date: Mon May 27 00:23:59 2013 New Revision: 251019 URL: http://svnweb.freebsd.org/changeset/base/251019 Log: Add PWM and LCDC nodes to base DTS for AM335x-based devices Modified: head/sys/boot/fdt/dts/am335x.dtsi Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:01 2013 (r251018) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:59 2013 (r251019) @@ -150,5 +150,28 @@ interrupt-parent = <&AINTC>; i2c-device-id = <0>; }; + + pwm@48300000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48300000 0x100 /* PWMSS */ + 0x48300100 0x80 /* eCAP0 */ + 0x48300180 0x80 /* eQEP0 */ + 0x48300200 0x60 /* ePWM0 */ + >; + interrupts = <86 58>; /* ePWM0INT, ePWM0_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <0>; + }; + + lcd: lcd@4830e000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,am335x-lcd"; + reg =< 0x4830e000 0x1000 >; + interrupts = <36>; + interrupt-parent = <&AINTC>; + }; }; }; From owner-svn-src-all@FreeBSD.ORG Mon May 27 00:26:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9248C8C; Mon, 27 May 2013 00:26:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAE0366A; Mon, 27 May 2013 00:26:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0QTS8043635; Mon, 27 May 2013 00:26:29 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0QTtu043634; Mon, 27 May 2013 00:26:29 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270026.r4R0QTtu043634@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251020 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 00:26:29 -0000 Author: gonzo Date: Mon May 27 00:26:29 2013 New Revision: 251020 URL: http://svnweb.freebsd.org/changeset/base/251020 Log: Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and LCD panel description Added: head/sys/boot/fdt/dts/am335x-evm.dts (contents, props changed) Added: head/sys/boot/fdt/dts/am335x-evm.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/am335x-evm.dts Mon May 27 00:26:29 2013 (r251020) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * 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$ + */ + +/dts-v1/; + +/include/ "am335x.dtsi" + +/ { + model = "TMDXEVM3358"; + compatible = "ti,am335x"; + + aliases { + soc = &SOC; + uart0 = &uart0; + }; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ + }; + + am335x { + scm@44e10000 { + /* Set of triplets < padname, muxname, padstate> */ + scm-pad-config = + /* I2C0 */ + "I2C0_SDA", "I2C0_SDA","i2c", + "I2C0_SCL", "I2C0_SCL","i2c", + /* Ethernet */ + "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", + "MII1_TX_EN", "gmii1_txen", "output", + "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", + "MII1_TXD3", "gmii1_txd3", "output", + "MII1_TXD2", "gmii1_txd2", "output", + "MII1_TXD1", "gmii1_txd1", "output", + "MII1_TXD0", "gmii1_txd0", "output", + "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", + "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", + "MII1_RXD3", "gmii1_rxd3", "input_pulldown", + "MII1_RXD2", "gmii1_rxd2", "input_pulldown", + "MII1_RXD1", "gmii1_rxd1", "input_pulldown", + "MII1_RXD0", "gmii1_rxd0", "input_pulldown", + "MDIO", "mdio_data", "input_pullup", + "MDC", "mdio_clk", "output_pullup", + /* MMCSD0 */ + "MMC0_CMD", "mmc0_cmd", "input_pullup", + "MMC0_CLK", "mmc0_clk", "input_pullup", + "MMC0_DAT0", "mmc0_dat0", "input_pullup", + "MMC0_DAT1", "mmc0_dat1", "input_pullup", + "MMC0_DAT2", "mmc0_dat2", "input_pullup", + "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* GPIO */ + "GPMC_AD10", "gpio0_26", "input_pulldown", + "GPMC_AD11", "gpio0_27", "input_pulldown", + "GPMC_AD0", "gpio1_0", "input_pulldown", + "GPMC_AD1", "gpio1_1", "input_pulldown", + "GPMC_AD2", "gpio1_2", "input_pulldown", + "GPMC_AD3", "gpio1_3", "input_pulldown", + "GPMC_AD4", "gpio1_4", "input_pulldown", + "GPMC_AD5", "gpio1_5", "input_pulldown", + "GPMC_AD6", "gpio1_6", "input_pulldown", + "GPMC_AD7", "gpio1_7", "input_pulldown", + "GPMC_AD12", "gpio1_12", "input_pulldown", + "GPMC_AD13", "gpio1_13", "input_pulldown", + "GPMC_AD14", "gpio1_14", "input_pulldown", + "GPMC_AD15", "gpio1_15", "input_pulldown", + "GPMC_A0", "gpio1_16", "input_pulldown", + "GPMC_A1", "gpio1_17", "input_pulldown", + "GPMC_A5", "gpio1_21", "output", /* User LED 1 */ + "GPMC_A6", "gpio1_22", "output", /* User LED 2 */ + "GPMC_A7", "gpio1_23", "output", /* User LED 3 */ + "GPMC_A8", "gpio1_24", "output", /* User LED 4 */ + "GPMC_BEn1", "gpio1_28", "input_pulldown", + "GPMC_CSn0", "gpio1_29", "input_pulldown", + "GPMC_CSn1", "gpio1_30", "input_pulldown", + "GPMC_CSn2", "gpio1_31", "input_pulldown", + "MCASP0_FSR", "gpio3_19", "input_pulldown", + "MCASP0_AHCLKX", "gpio3_21", "input_pulldown", + /* TIMERs */ + "GPMC_ADVn_ALE", "timer4", "output", + "GPMC_BEn0_CLE", "timer5", "output", + "GPMC_WEn", "timer6", "output", + "GPMC_OEn_REn", "timer7", "output", + /* LCD */ + "GPMC_AD8", "lcd_data23", "output", + "GPMC_AD9", "lcd_data22", "output", + "GPMC_AD10", "lcd_data21", "output", + "GPMC_AD11", "lcd_data20", "output", + "GPMC_AD12", "lcd_data19", "output", + "GPMC_AD13", "lcd_data18", "output", + "GPMC_AD14", "lcd_data17", "output", + "GPMC_AD15", "lcd_data16", "output", + "GPMC_CLK", "lcd_memory_clk", "output", + "LCD_DATA0", "lcd_data0", "output", + "LCD_DATA1", "lcd_data1", "output", + "LCD_DATA2", "lcd_data2", "output", + "LCD_DATA3", "lcd_data3", "output", + "LCD_DATA4", "lcd_data4", "output", + "LCD_DATA5", "lcd_data5", "output", + "LCD_DATA6", "lcd_data6", "output", + "LCD_DATA7", "lcd_data7", "output", + "LCD_DATA8", "lcd_data8", "output", + "LCD_DATA9", "lcd_data9", "output", + "LCD_DATA10", "lcd_data10", "output", + "LCD_DATA11", "lcd_data11", "output", + "LCD_DATA12", "lcd_data12", "output", + "LCD_DATA13", "lcd_data13", "output", + "LCD_DATA14", "lcd_data14", "output", + "LCD_DATA15", "lcd_data15", "output", + "LCD_VSYNC", "lcd_vsync", "output", + "LCD_HSYNC", "lcd_hsync", "output", + "LCD_PCLK", "lcd_pclk", "output", + "LCD_AC_BIAS_EN", "lcd_ac_bias_en", "output", + "ECAP0_IN_PWM0_OUT", "eCAP0_in_PWM0_out", "output"; + + }; + + lcd@4830e000 { + panel_name = "TFC_S9700RTWV35TR_01B"; + panel_width = <800>; + panel_height = <480>; + panel_hfp = <39>; + panel_hbp = <39>; + panel_hsw = <47>; + panel_vfp = <13>; + panel_vbp = <29>; + panel_vsw = <2>; + panel_pxl_clk = <30000000>; + panel_invert_pxl_clk = <0>; + panel_type = <1>; /* Active or passive, compatibility */ + panel_max_bpp = <32>; /* compatibility */ + panel_min_bpp = <32>; /* compatibility */ + panel_shade = <1>; /* compatibility */ + ac_bias = <255>; + ac_bias_intrpt = <0>; + dma_burst_sz = <16>; + bpp = <32>; + fdd = <128>; + tft_alt_mode = <0>; /* compatiblity */ + stn_565_mode = <0>; /* compatibility */ + mono_8bit_mode = <0>; /* compatibilty */ + invert_line_clock = <1>; + invert_frm_clock = <1>; + sync_edge = <0>; + sync_ctrl = <1>; + raster_order = <0>; /* compatibity */ + }; + + }; + + chosen { + stdin = "uart0"; + stdout = "uart0"; + }; +}; From owner-svn-src-all@FreeBSD.ORG Mon May 27 03:09:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95085D14; Mon, 27 May 2013 03:09:27 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87335D85; Mon, 27 May 2013 03:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R39R7i097802; Mon, 27 May 2013 03:09:27 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R39RsQ097801; Mon, 27 May 2013 03:09:27 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201305270309.r4R39RsQ097801@svn.freebsd.org> From: Jamie Gritton Date: Mon, 27 May 2013 03:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251021 - stable/9/share/man/man8 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 03:09:27 -0000 Author: jamie Date: Mon May 27 03:09:26 2013 New Revision: 251021 URL: http://svnweb.freebsd.org/changeset/base/251021 Log: MFC r250968: Mention the "nojailvnet" keyword. Modified: stable/9/share/man/man8/rc.8 Directory Properties: stable/9/share/man/man8/ (props changed) Modified: stable/9/share/man/man8/rc.8 ============================================================================== --- stable/9/share/man/man8/rc.8 Mon May 27 00:26:29 2013 (r251020) +++ stable/9/share/man/man8/rc.8 Mon May 27 03:09:26 2013 (r251021) @@ -124,7 +124,9 @@ Load the configuration files. Determine if booting in a jail, and add .Dq Li nojail -to the list of KEYWORDS to skip in +(no jails allowed) or +.Dq Li nojailvnet +(only allow vnet-enabled jails) to the list of KEYWORDS to skip in .Xr rcorder 8 . .It Invoke From owner-svn-src-all@FreeBSD.ORG Mon May 27 06:24:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A293752; Mon, 27 May 2013 06:24:32 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0335DF; Mon, 27 May 2013 06:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R6OWUt061035; Mon, 27 May 2013 06:24:32 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R6OVmS061031; Mon, 27 May 2013 06:24:31 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305270624.r4R6OVmS061031@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 27 May 2013 06:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251022 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 06:24:32 -0000 Author: gber Date: Mon May 27 06:24:31 2013 New Revision: 251022 URL: http://svnweb.freebsd.org/changeset/base/251022 Log: Fix ONFI chip detection. Submitted by: Alexander Fedorov Modified: head/sys/dev/nand/nand.h head/sys/dev/nand/nandbus.c Modified: head/sys/dev/nand/nand.h ============================================================================== --- head/sys/dev/nand/nand.h Mon May 27 03:09:26 2013 (r251021) +++ head/sys/dev/nand/nand.h Mon May 27 06:24:31 2013 (r251022) @@ -219,7 +219,7 @@ struct onfi_params { uint16_t vendor_rev; uint8_t vendor_spec[8]; uint16_t crc; -}; +}__attribute__((packed)); struct nand_ecc_data { int eccsize; /* Number of data bytes per ECC step */ Modified: head/sys/dev/nand/nandbus.c ============================================================================== --- head/sys/dev/nand/nandbus.c Mon May 27 03:09:26 2013 (r251021) +++ head/sys/dev/nand/nandbus.c Mon May 27 06:24:31 2013 (r251022) @@ -331,7 +331,7 @@ static int nand_probe_onfi(device_t bus, uint8_t *onfi_compliant) { device_t nfc; - char onfi_id[] = {'o', 'n', 'f', 'i', '\0'}; + char onfi_id[] = {'O', 'N', 'F', 'I', '\0'}; int i; nand_debug(NDBG_BUS,"probing ONFI"); From owner-svn-src-all@FreeBSD.ORG Mon May 27 06:32:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C59F1B4E; Mon, 27 May 2013 06:32:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B89E664A; Mon, 27 May 2013 06:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R6W77I064002; Mon, 27 May 2013 06:32:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R6W7EP063999; Mon, 27 May 2013 06:32:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305270632.r4R6W7EP063999@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 27 May 2013 06:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251023 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 06:32:07 -0000 Author: hselasky Date: Mon May 27 06:32:07 2013 New Revision: 251023 URL: http://svnweb.freebsd.org/changeset/base/251023 Log: Workaround for for a problem seen with ATI Technologies EHCI controller hardware most likely present on UHCI chipsets aswell. The bug manifests itself when issuing isochronous transfers and bulk transfers towards the same device simultaneously. From time to time it happens that either the completion IRQ was missing or that the completion IRQ was happening before the ITD/SITD was completely written back to memory. The workaround assumes that double buffered isochronous transfers are used, and that a second interrupt is generated at the beginning of the next isochronous transfer to complete the previous one. Possibly skipping the interrupt at the last isochronous frame is possible, but will then break single buffered isochronous transfers. For now we can live with some extra interrupts. MFC after: 1 week Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon May 27 06:24:31 2013 (r251022) +++ head/sys/dev/usb/controller/ehci.c Mon May 27 06:32:07 2013 (r251023) @@ -2454,6 +2454,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe uint16_t tlen; uint8_t sa; uint8_t sb; + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2618,6 +2619,16 @@ ehci_device_isoc_fs_enter(struct usb_xfe EHCI_SITD_IOC | EHCI_SITD_ACTIVE | EHCI_SITD_SET_LEN(*plen)); + } else if (first != 0) { + /* + * Workaround for lost or too early + * completion interrupt: + */ + first = 0; + td->sitd_status = htohc32(sc, + EHCI_SITD_IOC | + EHCI_SITD_ACTIVE | + EHCI_SITD_SET_LEN(*plen)); } else { td->sitd_status = htohc32(sc, EHCI_SITD_ACTIVE | @@ -2759,6 +2770,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe uint8_t td_no; uint8_t page_no; uint8_t shift = usbd_xfer_get_fps_shift(xfer); + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2920,6 +2932,13 @@ ehci_device_isoc_hs_enter(struct usb_xfe /* set IOC bit if we are complete */ if (nframes == 0) { td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); + } else if (first != 0) { + /* + * Workaround for lost or too early + * completion interrupt: + */ + first = 0; + td->itd_status[0] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #ifdef USB_DEBUG Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Mon May 27 06:24:31 2013 (r251022) +++ head/sys/dev/usb/controller/uhci.c Mon May 27 06:32:07 2013 (r251023) @@ -2138,6 +2138,7 @@ uhci_device_isoc_enter(struct usb_xfer * uint32_t nframes; uint32_t temp; uint32_t *plen; + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2253,6 +2254,18 @@ uhci_device_isoc_enter(struct usb_xfer * UHCI_TD_ACTIVE | UHCI_TD_IOS | UHCI_TD_IOC)); + } else if (first != 0) { + /* + * Workaround for lost or too early completion + * interrupt: + */ + first = 0; + td->td_status = htole32 + (UHCI_TD_ZERO_ACTLEN + (UHCI_TD_SET_ERRCNT(0) | + UHCI_TD_ACTIVE | + UHCI_TD_IOS | + UHCI_TD_IOC)); } else { td->td_status = htole32 (UHCI_TD_ZERO_ACTLEN From owner-svn-src-all@FreeBSD.ORG Mon May 27 08:33:38 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B73E4283; Mon, 27 May 2013 08:33:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id C1B9ED54; Mon, 27 May 2013 08:33:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4R8XILn001101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 May 2013 18:33:22 +1000 Date: Mon, 27 May 2013 18:33:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser Subject: Re: svn commit: r250972 - head/usr.bin/patch In-Reply-To: <51A26FED.4020801@freebsd.org> Message-ID: <20130527172803.P1491@besplex.bde.org> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525122811.I837@besplex.bde.org> <51A26FED.4020801@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=0a0yn1FGu_gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=LFobCLJwE3wA:10 a=x0QUDIz939gMxI9YZRcA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Stefan Esser , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 08:33:38 -0000 n Sun, 26 May 2013, Stefan Esser wrote: > Am 25.05.2013 06:31, schrieb Bruce Evans: >> On Fri, 24 May 2013, Stefan Esser wrote: > ... > Another possibility (too obfuscated for my taste) is: > > if (ferror(ofp) { > fclose(ofp); > ofp = NULL; > } > if (ofp == NULL || fclose(ofp)) > say ... > error = 1 > } > > This version does not need the temporary result variable, > but uses two calls to fclose() and thus produces more code. > >> This is too ugly. I prefer to depend on fclose() being non-broken. >> Unfortunately, fclose() seems to be broken in FreeBSD: > > Ughh. That might be the reason the ferror() tests were added > in the FreeBSD version ... The addition is fairly recent. I don't see any reason for it. > ... > Do we have compatibility and/or regression tests for stdio that > cover ferror/fflush/fclose? Not that I know of. > I'm wondering, whether we could just implicitly call fflush before > fclose and return an error condition, if the fflush failed. That > way, fclose would report write errors only reported by fflush, now. fflush() seems to be the most broken (see below), so using it increases problems. > The fclose(3) man-page states: > > ERRORS > The fclose() function may also fail and set errno for any of the > errors specified for the routines close(2) or fflush(3). > > So, returning fflush errors from fclose is documented behavior, but > apparently not implemented behavior. This is fuzzy wording. C99 says even less (nothing explicit about errno), but POSIX is much more specific and says "shall fail" for most of the errors specified for close() and fflush(). But at least in the 2001 draft 7, it also has bugs like specifying that st_ntime and st_ctime "[shall be marked for update], if the stream was writable, and if buffered data remains". This not only has bad grammar; it also specifies the update if the write fails. This is inconsistent with the specification of write(), that it only updates the times if it succeeds. fclose() has this bug in a worse form. Similarly for fflush(), except the wording is better and more clearly mis-specifies that the update always occurs iff any buffered data remains. So the above should say that fclose() does fail and set ferror() if any of underlying functions (which are not necessarily write() and close() fails. fflush() is only directly underlying, and of course it must fail and set error if its underying functions fail. I don't know of any implementations that get this wrong. > One way to test write errors is via tmpfs: > > # mount -t tmpfs -o maxfilesize=1 tmp /mnt A bit hard for me, since I don't believe in tmpfs and don't have it on any of my systems. > > A few more tests with this special file system: > > ----------------------------------------------------------------- > #include > > int > main(void) > { > FILE *fp; > > remove("test.dat"); > fprintf(stderr, "1) normal write - expect OK:\n"); > fp = fopen("test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("a\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n2) write 1 byte - expect OK:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n3) write 1 byte - expect OK:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w+"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n4) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n5) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n6) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n7) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n8) write 1 bytes to R/O file - expect FAIL:\n"); > //remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "r"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > > return (0); > } > ----------------------------------------------------------------- > 5) write 3 bytes - expect FAIL: > fwrite 3 > fflush -1 > fclose 0 fflush() seems to be very broken. It really does flush (discard) all buffered data if there is a write error during the write(s) (and of course it won't tell where the error occurred. Just another reason why stdio should never be used. This misbehaviour seems to be intentional: from libc/stdio/fflush.c: % int % __sflush(FILE *fp) % { % unsigned char *p; % int n, t; % % t = fp->_flags; % if ((t & __SWR) == 0) % return (0); % % if ((p = fp->_bf._base) == NULL) % return (0); % % n = fp->_p - p; /* write this much */ % % /* % * Set these immediately to avoid problems with longjmp and to allow % * exchange buffering (via setvbuf) in user write function. % */ % fp->_p = p; It remembers how much to write, then advances the pointer and forgets where it was. longjump will cause much larger problems now than when the above was written, and a don't understand the point about exchange buffering. This is normally (always from at least fflush()) called with FLOCKFILE(), so if the lock is not null then longjmp would be especially fatal, but maybe locking prevents problems with exchange buffering. % fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size; % % for (; n > 0; n -= t, p += t) { % t = _swrite(fp, (char *)p, n); % if (t <= 0) { n gives the amount not written, so we could easily reset the pointer, but we don't. Locking should prevent any external use of the FILE object while it is in an intermediate state. % fp->_flags |= __SERR; % return (EOF); % } % } % return (0); % } Standards don't say anything to explicitly allow fflush() to flush (discard) unwritable data. C99 says very little about anything in fflush(). POSIX adds mainly - a description of errors that shall be detected - an example of fflush()ing stdout before using stdin (but nothing about automatic fflush()ing of stdout that most unix stdios actually do) - a rationale about the file position. The file position causes further complications for failing fflush()es. Currently I think neither the stdio position nor the kernel position is advanced for the failed part of the write. This is as consistent as possible, but means that you can't track the position by counting the bytes claimed to have been written by fwrite() and putc(), etc. > 6) write 3 bytes - expect FAIL: > fwrite 3 > ferror 0 > fclose -1 Now when we don't try fflush() first, fclose() can actually see the buffered data and fail trying to write it. > So it seems that fclose will return an error if data could not be > written (see case 4), but not if an fflush already returned the > error condition. It is not sticky. > > So I guess it is sufficient to check the result returned by fclose, > without the prior check of ferror. I do not see what cases ferror > can catch, that are no caught by fclose ... Now I see a problem that is large enough to require the the ferror()s: __sflush() is called not only from fflush(), but for general operation. Even putc() calls if fairly directly (via __swbuf() and __fflush()). So when __sflush() fails in certain contexts, the only evidence of it trashing the buffer is the sticky ferror() flag and the not-sticky error return to functions like putc() and printf(). Most callers don't check the results of their putc()'s and printf()'s. Hopefully printf() itself checks, but patch(1) seems to use only fputs() and putc() to write to ofp, and it _never_ checks their results. So in most cases there is something in the buffer at fclose() time and fclose() detects most errors in these cases (there might be previous undetected errors but most error conditions are sticky at the fs level). But sometimes the auto-flush might occur on the last byte of a file. Then trashing the buffer would leave no problem for fclose() to detect. Bruce From owner-svn-src-all@FreeBSD.ORG Mon May 27 08:34:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45C0E409; Mon, 27 May 2013 08:34:45 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 2C573D5F; Mon, 27 May 2013 08:34:44 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4R8YfVG001493; Mon, 27 May 2013 01:34:41 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4R8YfT8001492; Mon, 27 May 2013 01:34:41 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 27 May 2013 01:34:41 -0700 From: David Schultz To: Ed Schouten Subject: Re: svn commit: r250990 - head/include Message-ID: <20130527083441.GA1309@zim.MIT.EDU> References: <201305251855.r4PIttB7052695@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305251855.r4PIttB7052695@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 08:34:45 -0000 On Sat, May 25, 2013, Ed Schouten wrote: > Author: ed > Date: Sat May 25 18:55:55 2013 > New Revision: 250990 > URL: http://svnweb.freebsd.org/changeset/base/250990 > > Log: > Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). > > Clang allows us to initialize complex numbers using an array > initializer, casted to a complex type. GCC has a builtin called > __builtin_complex(). Awesome, thanks! I recall that we talked about this last year, and the blocking issue was that gcc didn't support it. It appears that the one in the base system still doesn't, but now that clang is the default compiler, maybe that doesn't matter. There are some regression tests in tools/regression/lib/msun that could be converted to exercise these macros if you wish: grep for "cpack". From owner-svn-src-all@FreeBSD.ORG Mon May 27 08:50:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A9ACC64; Mon, 27 May 2013 08:50:15 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0A3E10; Mon, 27 May 2013 08:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R8oFHt008979; Mon, 27 May 2013 08:50:15 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R8oA6g008947; Mon, 27 May 2013 08:50:10 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305270850.r4R8oA6g008947@svn.freebsd.org> From: David Schultz Date: Mon, 27 May 2013 08:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 08:50:15 -0000 Author: das Date: Mon May 27 08:50:10 2013 New Revision: 251024 URL: http://svnweb.freebsd.org/changeset/base/251024 Log: Fix some regressions caused by the switch from gcc to clang. The fixes are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet. Modified: head/lib/msun/Makefile head/lib/msun/ld128/s_exp2l.c head/lib/msun/ld80/s_exp2l.c head/lib/msun/src/e_exp.c head/lib/msun/src/e_expf.c head/lib/msun/src/e_log.c head/lib/msun/src/e_log10.c head/lib/msun/src/e_log10f.c head/lib/msun/src/e_log2.c head/lib/msun/src/e_log2f.c head/lib/msun/src/e_logf.c head/lib/msun/src/s_exp2.c head/lib/msun/src/s_exp2f.c head/lib/msun/src/s_expm1.c head/lib/msun/src/s_expm1f.c head/lib/msun/src/s_fma.c head/lib/msun/src/s_fmal.c head/lib/msun/src/s_log1p.c head/lib/msun/src/s_log1pf.c head/lib/msun/src/s_nearbyint.c head/tools/regression/lib/msun/test-fma.c Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/Makefile Mon May 27 08:50:10 2013 (r251024) @@ -121,12 +121,6 @@ COMMON_SRCS:= ${COMMON_SRCS:N${i:R}.c} .endfor .endif -# Some files need certain gcc built-in functions to be disabled, since gcc's -# model of the functions bogusly assumes -fno-trapping-math. -XRINT_CFLAGS= -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl -CFLAGS+= ${XRINT_CFLAGS} -XRINT_CFLAGS:= ${.IMPSRC:M*/s_nearbyint.c:C/^.+$/${XRINT_CFLAGS}/:C/^$//} - SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS+= fenv.h math.h Modified: head/lib/msun/ld128/s_exp2l.c ============================================================================== --- head/lib/msun/ld128/s_exp2l.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/ld128/s_exp2l.c Mon May 27 08:50:10 2013 (r251024) @@ -39,14 +39,11 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) #define EXPMASK (BIAS + LDBL_MAX_EXP) -#if 0 /* XXX Prevent gcc from erroneously constant folding this. */ -static const long double twom10000 = 0x1p-10000L; -#else -static volatile long double twom10000 = 0x1p-10000L; -#endif +static volatile long double + huge = 0x1p10000L, + twom10000 = 0x1p-10000L; static const long double - huge = 0x1p10000L, P1 = 0x1.62e42fefa39ef35793c7673007e6p-1L, P2 = 0x1.ebfbdff82c58ea86f16b06ec9736p-3L, P3 = 0x1.c6b08d704a0bf8b33a762bad3459p-5L, Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 08:50:10 2013 (r251024) @@ -43,12 +43,9 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) #define EXPMASK (BIAS + LDBL_MAX_EXP) -static const long double huge = 0x1p10000L; -#if 0 /* XXX Prevent gcc from erroneously constant folding this. */ -static const long double twom10000 = 0x1p-10000L; -#else -static volatile long double twom10000 = 0x1p-10000L; -#endif +static volatile long double + huge = 0x1p10000L, + twom10000 = 0x1p-10000L; static const double redux = 0x1.8p63 / TBLSIZE, Modified: head/lib/msun/src/e_exp.c ============================================================================== --- head/lib/msun/src/e_exp.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_exp.c Mon May 27 08:50:10 2013 (r251024) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, halF[2] = {0.5,-0.5,}, -huge = 1.0e+300, o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */ ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */ @@ -99,6 +98,7 @@ P4 = -1.65339022054652515390e-06, /* 0 P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ static volatile double +huge = 1.0e+300, twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ double Modified: head/lib/msun/src/e_expf.c ============================================================================== --- head/lib/msun/src/e_expf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_expf.c Mon May 27 08:50:10 2013 (r251024) @@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, halF[2] = {0.5,-0.5,}, -huge = 1.0e+30, o_threshold= 8.8721679688e+01, /* 0x42b17180 */ u_threshold= -1.0397208405e+02, /* 0xc2cff1b5 */ ln2HI[2] ={ 6.9314575195e-01, /* 0x3f317200 */ @@ -39,7 +38,9 @@ invln2 = 1.4426950216e+00, /* 0x3fb8a P1 = 1.6666625440e-1, /* 0xaaaa8f.0p-26 */ P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */ -static volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ +static volatile float +huge = 1.0e+30, +twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ float __ieee754_expf(float x) Modified: head/lib/msun/src/e_log.c ============================================================================== --- head/lib/msun/src/e_log.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log.c Mon May 27 08:50:10 2013 (r251024) @@ -81,6 +81,7 @@ Lg6 = 1.531383769920937332e-01, /* 3FC3 Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log(double x) @@ -94,7 +95,7 @@ __ieee754_log(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log10.c ============================================================================== --- head/lib/msun/src/e_log10.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log10.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ log10_2hi = 3.01029995663611771306e-01 log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log10(double x) @@ -47,7 +48,7 @@ __ieee754_log10(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log10f.c ============================================================================== --- head/lib/msun/src/e_log10f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log10f.c Mon May 27 08:50:10 2013 (r251024) @@ -28,6 +28,7 @@ log10_2hi = 3.0102920532e-01, /* 0x3e9 log10_2lo = 7.9034151668e-07; /* 0x355427db */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_log10f(float x) @@ -40,7 +41,7 @@ __ieee754_log10f(float x) k=0; if (hx < 0x00800000) { /* x < 2**-126 */ if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); Modified: head/lib/msun/src/e_log2.c ============================================================================== --- head/lib/msun/src/e_log2.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log2.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ ivln2hi = 1.44269504072144627571e+00 ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log2(double x) @@ -47,7 +48,7 @@ __ieee754_log2(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log2f.c ============================================================================== --- head/lib/msun/src/e_log2f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log2f.c Mon May 27 08:50:10 2013 (r251024) @@ -26,6 +26,7 @@ ivln2hi = 1.4428710938e+00, /* 0x3fb ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_log2f(float x) @@ -38,7 +39,7 @@ __ieee754_log2f(float x) k=0; if (hx < 0x00800000) { /* x < 2**-126 */ if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); Modified: head/lib/msun/src/e_logf.c ============================================================================== --- head/lib/msun/src/e_logf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_logf.c Mon May 27 08:50:10 2013 (r251024) @@ -30,6 +30,7 @@ Lg3 = 0x91e9ee.0p-25, /* 0.28498786 Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_logf(float x) @@ -42,7 +43,7 @@ __ieee754_logf(float x) k=0; if (ix < 0x00800000) { /* x < 2**-126 */ if ((ix&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (ix<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(ix,x); Modified: head/lib/msun/src/s_exp2.c ============================================================================== --- head/lib/msun/src/s_exp2.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_exp2.c Mon May 27 08:50:10 2013 (r251024) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #define TBLSIZE (1 << TBLBITS) static const double - huge = 0x1p1000, redux = 0x1.8p52 / TBLSIZE, P1 = 0x1.62e42fefa39efp-1, P2 = 0x1.ebfbdff82c575p-3, @@ -44,7 +43,9 @@ static const double P4 = 0x1.3b2ab88f70400p-7, P5 = 0x1.5d88003875c74p-10; -static volatile double twom1000 = 0x1p-1000; +static volatile double + huge = 0x1p1000, + twom1000 = 0x1p-1000; static const double tbl[TBLSIZE * 2] = { /* exp2(z + eps) eps */ Modified: head/lib/msun/src/s_exp2f.c ============================================================================== --- head/lib/msun/src/s_exp2f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_exp2f.c Mon May 27 08:50:10 2013 (r251024) @@ -36,14 +36,15 @@ __FBSDID("$FreeBSD$"); #define TBLSIZE (1 << TBLBITS) static const float - huge = 0x1p100f, redux = 0x1.8p23f / TBLSIZE, P1 = 0x1.62e430p-1f, P2 = 0x1.ebfbe0p-3f, P3 = 0x1.c6b348p-5f, P4 = 0x1.3b2c9cp-7f; -static volatile float twom100 = 0x1p-100f; +static volatile float + huge = 0x1p100f, + twom100 = 0x1p-100f; static const double exp2ft[TBLSIZE] = { 0x1.6a09e667f3bcdp-1, Modified: head/lib/msun/src/s_expm1.c ============================================================================== --- head/lib/msun/src/s_expm1.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_expm1.c Mon May 27 08:50:10 2013 (r251024) @@ -115,7 +115,6 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, -huge = 1.0e+300, tiny = 1.0e-300, o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */ ln2_hi = 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */ @@ -128,6 +127,8 @@ Q3 = -7.93650757867487942473e-05, /* B Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ +static volatile double huge = 1.0e+300; + double expm1(double x) { Modified: head/lib/msun/src/s_expm1f.c ============================================================================== --- head/lib/msun/src/s_expm1f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_expm1f.c Mon May 27 08:50:10 2013 (r251024) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, -huge = 1.0e+30, tiny = 1.0e-30, o_threshold = 8.8721679688e+01,/* 0x42b17180 */ ln2_hi = 6.9313812256e-01,/* 0x3f317180 */ @@ -37,6 +36,8 @@ invln2 = 1.4426950216e+00,/* 0x3fb8aa3b Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */ Q2 = 1.5807170421e-3; /* 0xcf3010.0p-33 */ +static volatile float huge = 1.0e+30; + float expm1f(float x) { Modified: head/lib/msun/src/s_fma.c ============================================================================== --- head/lib/msun/src/s_fma.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_fma.c Mon May 27 08:50:10 2013 (r251024) @@ -238,6 +238,8 @@ fma(double x, double y, double z) zs = copysign(DBL_MIN, zs); fesetround(FE_TONEAREST); + /* work around clang bug 8100 */ + volatile double vxs = xs; /* * Basic approach for round-to-nearest: @@ -247,7 +249,7 @@ fma(double x, double y, double z) * adj = xy.lo + r.lo (inexact; low bit is sticky) * result = r.hi + adj (correctly rounded) */ - xy = dd_mul(xs, ys); + xy = dd_mul(vxs, ys); r = dd_add(xy.hi, zs); spread = ex + ey; @@ -268,7 +270,9 @@ fma(double x, double y, double z) * rounding modes. */ fesetround(oround); - adj = r.lo + xy.lo; + /* work around clang bug 8100 */ + volatile double vrlo = r.lo; + adj = vrlo + xy.lo; return (ldexp(r.hi + adj, spread)); } Modified: head/lib/msun/src/s_fmal.c ============================================================================== --- head/lib/msun/src/s_fmal.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_fmal.c Mon May 27 08:50:10 2013 (r251024) @@ -226,6 +226,8 @@ fmal(long double x, long double y, long zs = copysignl(LDBL_MIN, zs); fesetround(FE_TONEAREST); + /* work around clang bug 8100 */ + volatile long double vxs = xs; /* * Basic approach for round-to-nearest: @@ -235,7 +237,7 @@ fmal(long double x, long double y, long * adj = xy.lo + r.lo (inexact; low bit is sticky) * result = r.hi + adj (correctly rounded) */ - xy = dd_mul(xs, ys); + xy = dd_mul(vxs, ys); r = dd_add(xy.hi, zs); spread = ex + ey; @@ -256,7 +258,9 @@ fmal(long double x, long double y, long * rounding modes. */ fesetround(oround); - adj = r.lo + xy.lo; + /* work around clang bug 8100 */ + volatile long double vrlo = r.lo; + adj = vrlo + xy.lo; return (ldexpl(r.hi + adj, spread)); } Modified: head/lib/msun/src/s_log1p.c ============================================================================== --- head/lib/msun/src/s_log1p.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_log1p.c Mon May 27 08:50:10 2013 (r251024) @@ -96,6 +96,7 @@ Lp6 = 1.531383769920937332e-01, /* 3FC3 Lp7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double log1p(double x) @@ -109,7 +110,7 @@ log1p(double x) k = 1; if (hx < 0x3FDA827A) { /* 1+x < sqrt(2)+ */ if(ax>=0x3ff00000) { /* x <= -1.0 */ - if(x==-1.0) return -two54/zero; /* log1p(-1)=+inf */ + if(x==-1.0) return -two54/vzero; /* log1p(-1)=+inf */ else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ } if(ax<0x3e200000) { /* |x| < 2**-29 */ Modified: head/lib/msun/src/s_log1pf.c ============================================================================== --- head/lib/msun/src/s_log1pf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_log1pf.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ Lp6 = 1.5313838422e-01, /* 3E1CD04F */ Lp7 = 1.4798198640e-01; /* 3E178897 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float log1pf(float x) @@ -47,7 +48,7 @@ log1pf(float x) k = 1; if (hx < 0x3ed413d0) { /* 1+x < sqrt(2)+ */ if(ax>=0x3f800000) { /* x <= -1.0 */ - if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=+inf */ + if(x==(float)-1.0) return -two25/vzero; /* log1p(-1)=+inf */ else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ } if(ax<0x38000000) { /* |x| < 2**-15 */ Modified: head/lib/msun/src/s_nearbyint.c ============================================================================== --- head/lib/msun/src/s_nearbyint.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_nearbyint.c Mon May 27 08:50:10 2013 (r251024) @@ -36,12 +36,16 @@ __FBSDID("$FreeBSD$"); * instead of feclearexcept()/feupdateenv() to restore the environment * because the only exception defined for rint() is overflow, and * rounding can't overflow as long as emax >= p. + * + * The volatile keyword is needed below because clang incorrectly assumes + * that rint won't raise any floating-point exceptions. Declaring ret volatile + * is sufficient to trick the compiler into doing the right thing. */ #define DECL(type, fn, rint) \ type \ fn(type x) \ { \ - type ret; \ + volatile type ret; \ fenv_t env; \ \ fegetenv(&env); \ Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Mon May 27 06:32:07 2013 (r251023) +++ head/tools/regression/lib/msun/test-fma.c Mon May 27 08:50:10 2013 (r251024) @@ -77,6 +77,12 @@ __FBSDID("$FreeBSD$"); } while (0) /* + * This is needed because clang constant-folds fma in ways that are incorrect + * in rounding modes other than FE_TONEAREST. + */ +volatile double one = 1.0; + +/* * Determine whether x and y are equal, with two special rules: * +0.0 != -0.0 * NaN == NaN @@ -108,9 +114,9 @@ test_zeroes(void) testall(-0.0, 0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); testall(0.0, -0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); - testall(-1.0, 1.0, 1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); - testall(1.0, -1.0, 1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); - testall(-1.0, -1.0, -1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(one, -one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, -one, -one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); switch (fegetround()) { case FE_TONEAREST: @@ -190,53 +196,53 @@ test_small_z(void) /* x*y positive, z positive */ if (fegetround() == FE_UPWARD) { - test(fmaf, 1.0, 1.0, 0x1.0p-100, 1.0 + FLT_EPSILON, + test(fmaf, one, one, 0x1.0p-100, 1.0 + FLT_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, 1.0, 1.0, 0x1.0p-200, 1.0 + DBL_EPSILON, + test(fma, one, one, 0x1.0p-200, 1.0 + DBL_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, 1.0, 1.0, 0x1.0p-200, 1.0 + LDBL_EPSILON, + test(fmal, one, one, 0x1.0p-200, 1.0 + LDBL_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, 1.0, 0x1.0p-100, 0x1.0p100, + testall(0x1.0p100, one, 0x1.0p-100, 0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y negative, z negative */ if (fegetround() == FE_DOWNWARD) { - test(fmaf, -1.0, 1.0, -0x1.0p-100, -(1.0 + FLT_EPSILON), + test(fmaf, -one, one, -0x1.0p-100, -(1.0 + FLT_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); - test(fma, -1.0, 1.0, -0x1.0p-200, -(1.0 + DBL_EPSILON), + test(fma, -one, one, -0x1.0p-200, -(1.0 + DBL_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, -1.0, 1.0, -0x1.0p-200, -(1.0 + LDBL_EPSILON), + test(fmal, -one, one, -0x1.0p-200, -(1.0 + LDBL_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, -1.0, -0x1.0p-100, -0x1.0p100, + testall(0x1.0p100, -one, -0x1.0p-100, -0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y positive, z negative */ if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { - test(fmaf, 1.0, 1.0, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, + test(fmaf, one, one, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, 1.0, 1.0, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, + test(fma, one, one, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, 1.0, 1.0, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, + test(fmal, one, one, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, 1.0, -0x1.0p-100, 0x1.0p100, + testall(0x1.0p100, one, -0x1.0p-100, 0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y negative, z positive */ if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { - test(fmaf, -1.0, 1.0, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, + test(fmaf, -one, one, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, -1.0, 1.0, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, + test(fma, -one, one, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, -1.0, 1.0, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, + test(fmal, -one, one, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(-0x1.0p100, 1.0, 0x1.0p-100, -0x1.0p100, + testall(-0x1.0p100, one, 0x1.0p-100, -0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } } From owner-svn-src-all@FreeBSD.ORG Mon May 27 13:49:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4FBD5B0; Mon, 27 May 2013 13:49:56 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C650D38F; Mon, 27 May 2013 13:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RDnuGu011349; Mon, 27 May 2013 13:49:56 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RDnuJD011346; Mon, 27 May 2013 13:49:56 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201305271349.r4RDnuJD011346@svn.freebsd.org> From: Dmitry Morozovsky Date: Mon, 27 May 2013 13:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251025 - in stable/9: . sbin/hastctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 13:49:56 -0000 Author: marck (doc committer) Date: Mon May 27 13:49:55 2013 New Revision: 251025 URL: http://svnweb.freebsd.org/changeset/base/251025 Log: Preparation for MFC revs r248291 and r249741: Add 'list' command, for now the exact equivalent of 'status', so users of the latter could change their scripts. This is direct commit to stable, and is temporary. Requested by: Pete French Approved by: trociny 2B cleaned after: 6 weeks Modified: stable/9/UPDATING stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon May 27 08:50:10 2013 (r251024) +++ stable/9/UPDATING Mon May 27 13:49:55 2013 (r251025) @@ -11,6 +11,13 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130524: + `list' command has been added to hastctl(8). For now, it is full + equivalent of `status' command. + WARNING: in the near future the output of hastctl's status command + will change to more terse format. If you use `hastctl status' + for parsing in your scripts, switch to `hastctl list'. + 20130430: The mergemaster command now uses the default MAKEOBJDIRPREFIX rather than creating it's own in the temporary directory in Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Mon May 27 08:50:10 2013 (r251024) +++ stable/9/sbin/hastctl/hastctl.8 Mon May 27 13:49:55 2013 (r251025) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 24, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,19 @@ GEOM provider .Pa /dev/hast/ will not be created on secondary node. .El +.It Cm list .It Cm status -Present status of the configured resources. +Present verbose status of the configured resources. +For now, list and status commands are equivalent. +In the near future the output of +.Nm +status command will change to more terse format. +If you use ` +.Nm +status' for parsing in your scripts, switch to ` +.Nm +list'. + .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Mon May 27 08:50:10 2013 (r251024) +++ stable/9/sbin/hastctl/hastctl.c Mon May 27 13:49:55 2013 (r251025) @@ -70,7 +70,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -85,6 +86,9 @@ usage(void) " %s role [-d] [-c config] all | name ...\n", getprogname()); fprintf(stderr, + " %s list [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, " %s status [-d] [-c config] [all | name ...]\n", getprogname()); fprintf(stderr, @@ -381,6 +385,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "role") == 0) { cmd = CMD_ROLE; optstr = "c:dh"; + } else if (strcmp(argv[1], "list") == 0) { + cmd = CMD_LIST; + optstr = "c:dh"; } else if (strcmp(argv[1], "status") == 0) { cmd = CMD_STATUS; optstr = "c:dh"; @@ -469,6 +476,7 @@ main(int argc, char *argv[]) for (ii = 0; ii < argc - 1; ii++) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; + case CMD_LIST: case CMD_STATUS: /* Obtain status of the given resources. */ nv = nv_alloc(); @@ -524,6 +532,7 @@ main(int argc, char *argv[]) case CMD_ROLE: error = control_set_role(nv, argv[0]); break; + case CMD_LIST: case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-all@FreeBSD.ORG Mon May 27 13:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EED2378D; Mon, 27 May 2013 13:51:57 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0D3E3DC; Mon, 27 May 2013 13:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RDpvSg013329; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RDpvar013326; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201305271351.r4RDpvar013326@svn.freebsd.org> From: Dmitry Morozovsky Date: Mon, 27 May 2013 13:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251026 - in stable/8: . sbin/hastctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 13:51:58 -0000 Author: marck (doc committer) Date: Mon May 27 13:51:57 2013 New Revision: 251026 URL: http://svnweb.freebsd.org/changeset/base/251026 Log: Preparation for MFC revs r248291 and r249741: Add 'list' command, for now the exact equivalent of 'status', so users of the latter could change their scripts. This is direct commit to stable, and is temporary. Requested by: Pete French Approved by: trociny 2B cleaned after: 6 weeks Modified: stable/8/UPDATING stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon May 27 13:49:55 2013 (r251025) +++ stable/8/UPDATING Mon May 27 13:51:57 2013 (r251026) @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130524: + `list' command has been added to hastctl(8). For now, it is full + equivalent of `status' command. + WARNING: in the near future the output of hastctl's status command + will change to more terse format. If you use `hastctl status' + for parsing in your scripts, switch to `hastctl list'. + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:51:57 2013 (r251026) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 24, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,19 @@ GEOM provider .Pa /dev/hast/ will not be created on secondary node. .El +.It Cm list .It Cm status -Present status of the configured resources. +Present verbose status of the configured resources. +For now, list and status commands are equivalent. +In the near future the output of +.Nm +status command will change to more terse format. +If you use ` +.Nm +status' for parsing in your scripts, switch to ` +.Nm +list'. + .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.c Mon May 27 13:51:57 2013 (r251026) @@ -70,7 +70,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -85,6 +86,9 @@ usage(void) " %s role [-d] [-c config] all | name ...\n", getprogname()); fprintf(stderr, + " %s list [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, " %s status [-d] [-c config] [all | name ...]\n", getprogname()); fprintf(stderr, @@ -381,6 +385,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "role") == 0) { cmd = CMD_ROLE; optstr = "c:dh"; + } else if (strcmp(argv[1], "list") == 0) { + cmd = CMD_LIST; + optstr = "c:dh"; } else if (strcmp(argv[1], "status") == 0) { cmd = CMD_STATUS; optstr = "c:dh"; @@ -469,6 +476,7 @@ main(int argc, char *argv[]) for (ii = 0; ii < argc - 1; ii++) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; + case CMD_LIST: case CMD_STATUS: /* Obtain status of the given resources. */ nv = nv_alloc(); @@ -524,6 +532,7 @@ main(int argc, char *argv[]) case CMD_ROLE: error = control_set_role(nv, argv[0]); break; + case CMD_LIST: case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-all@FreeBSD.ORG Mon May 27 14:07:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84868C96; Mon, 27 May 2013 14:07:31 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC39677; Mon, 27 May 2013 14:07:31 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r4RE7M6k043624; Mon, 27 May 2013 07:07:22 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r4RE7MVk043623; Mon, 27 May 2013 07:07:22 -0700 (PDT) (envelope-from sgk) Date: Mon, 27 May 2013 07:07:22 -0700 From: Steve Kargl To: David Schultz Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Message-ID: <20130527140722.GA43583@troutmask.apl.washington.edu> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305270850.r4R8oA6g008947@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 14:07:31 -0000 On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: > Author: das > Date: Mon May 27 08:50:10 2013 > New Revision: 251024 > URL: http://svnweb.freebsd.org/changeset/base/251024 > > Log: > Fix some regressions caused by the switch from gcc to clang. The fixes > are workarounds for various symptoms of the problem described in clang > bugs 3929, 8100, 8241, 10409, and 12958. > > The regression tests did their job: they failed, someone brought it > up on the mailing lists, and then the issue got ignored for 6 months. > Oops. There may still be some regressions for functions we don't have > test coverage for yet. > The combination of clang+regression tests is almost unusable. % cd src/tools/regressions/lib/msun % make |& tee sgk.log % grep generated sgk.log 41 warnings generated. 1 warning generated. 1 warning generated. 593 warnings generated. 51 warnings generated. 1 warning generated. 221 warnings generated. 1 warning generated. 265 warnings generated. 84 warnings generated. 1 warning generated. 1 warning generated. 2 warnings generated. 74 warnings generated. I also find the following patch helpful in cleaning up the corefiles. Index: Makefile =================================================================== --- Makefile (revision 251026) +++ Makefile (working copy) @@ -12,4 +12,4 @@ .PHONY: clean clean: - -rm -f ${TESTS} + -rm -f ${TESTS} *.core -- Steve From owner-svn-src-all@FreeBSD.ORG Mon May 27 15:26:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AFE802C9; Mon, 27 May 2013 15:26:25 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id A3CDA9E1; Mon, 27 May 2013 15:26:24 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuwGAFt6o1FbsKBk/2dsb2JhbABagwgwwgWBBRd0giMBAQVWIgEQCw4GBAkWDwkDAgECASceBg0BBwEBiA0IvU+PDBEHg1QDj36BK4c7kBeDETo Received: from 100.160-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.160.100]) by relay.skynet.be with ESMTP; 27 May 2013 17:26:13 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r4RFQC5U003203; Mon, 27 May 2013 17:26:12 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51A37B0E.1010807@coosemans.org> Date: Mon, 27 May 2013 17:26:06 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: David Schultz Subject: Re: svn commit: r250990 - head/include References: <201305251855.r4PIttB7052695@svn.freebsd.org> <20130527083441.GA1309@zim.MIT.EDU> In-Reply-To: <20130527083441.GA1309@zim.MIT.EDU> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2REMGGGQRAXOEWXDKWVFM" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 15:26:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2REMGGGQRAXOEWXDKWVFM Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-05-27 10:34, David Schultz wrote: > On Sat, May 25, 2013, Ed Schouten wrote: >> Author: ed >> Date: Sat May 25 18:55:55 2013 >> New Revision: 250990 >> URL: http://svnweb.freebsd.org/changeset/base/250990 >> >> Log: >> Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). >> =20 >> Clang allows us to initialize complex numbers using an array >> initializer, casted to a complex type. GCC has a builtin called >> __builtin_complex(). >=20 > Awesome, thanks! I recall that we talked about this last year, and > the blocking issue was that gcc didn't support it. It appears > that the one in the base system still doesn't, but now that clang > is the default compiler, maybe that doesn't matter. >=20 > There are some regression tests in tools/regression/lib/msun that > could be converted to exercise these macros if you wish: grep for > "cpack". You could add a cpack-like fall-back for old gcc. It's not usable for static initialisation, but maybe it's better than nothing. #define CMPLX(x, y) __extension__({ double complex __z; \ __real__ __z =3D (x); __imag__ __z =3D (y); __z; }) ------enig2REMGGGQRAXOEWXDKWVFM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlGjexMACgkQfoCS2CCgtiuFwgD/bV7CvQcPpjpbgBmxw6MD9FWX D9O/H4h+xXxctU/nZgsA/jIeUD+RK+IR5UrEURH0BP02wFrMacxKGFuDvYdtv0m3 =K80O -----END PGP SIGNATURE----- ------enig2REMGGGQRAXOEWXDKWVFM-- From owner-svn-src-all@FreeBSD.ORG Mon May 27 17:23:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC0E4AAC; Mon, 27 May 2013 17:23:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 93BD1FC9; Mon, 27 May 2013 17:23:30 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4RHNQHJ006600; Mon, 27 May 2013 10:23:26 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4RHNQpB006599; Mon, 27 May 2013 10:23:26 -0700 (PDT) (envelope-from das@FreeBSD.org) Date: Mon, 27 May 2013 10:23:26 -0700 From: David Schultz To: Steve Kargl Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Message-ID: <20130527172326.GA6461@zim.MIT.EDU> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130527140722.GA43583@troutmask.apl.washington.edu> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 17:23:30 -0000 On Mon, May 27, 2013, Steve Kargl wrote: > On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: > > Author: das > > Date: Mon May 27 08:50:10 2013 > > New Revision: 251024 > > URL: http://svnweb.freebsd.org/changeset/base/251024 > > > > Log: > > Fix some regressions caused by the switch from gcc to clang. The fixes > > are workarounds for various symptoms of the problem described in clang > > bugs 3929, 8100, 8241, 10409, and 12958. > > > > The regression tests did their job: they failed, someone brought it > > up on the mailing lists, and then the issue got ignored for 6 months. > > Oops. There may still be some regressions for functions we don't have > > test coverage for yet. > > > > The combination of clang+regression tests is almost unusable. > > % cd src/tools/regressions/lib/msun > % make |& tee sgk.log > % grep generated sgk.log > 41 warnings generated. > 1 warning generated. > 1 warning generated. > 593 warnings generated. > 51 warnings generated. > 1 warning generated. > 221 warnings generated. > 1 warning generated. > 265 warnings generated. > 84 warnings generated. > 1 warning generated. > 1 warning generated. > 2 warnings generated. > 74 warnings generated. It seems that it's mostly complaining about the macros I use to test many variants of a function in a single call. The macros often say things like: assert(f(x) == y); \ assert(f, fetestexcept(...) == K); \ The goal of the "f, " is to make the failure message include the function that was invoked on the preceding line. The tests really shouldn't be using assert() at all. Starting circa 2002, I wrote them that way in the interests of expedience, since an official unit-testing framework was supposed to replace it anyway. Ten years later, it looks like everyone is still rolling their own! If someone were to write or import a good test framework, get all the tests to use it, and put together a test tinderbox, that would have a lot of impact. > I also find the following patch helpful in cleaning up the corefiles. > > > Index: Makefile > =================================================================== > --- Makefile (revision 251026) > +++ Makefile (working copy) > @@ -12,4 +12,4 @@ > > .PHONY: clean > clean: > - -rm -f ${TESTS} > + -rm -f ${TESTS} *.core Sounds reasonable. Feel free to commit this. From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:26:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34EA3344; Mon, 27 May 2013 18:26:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27F5E348; Mon, 27 May 2013 18:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIQ9vX004925; Mon, 27 May 2013 18:26:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIQ8IT004923; Mon, 27 May 2013 18:26:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271826.r4RIQ8IT004923@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251033 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:26:09 -0000 Author: kib Date: Mon May 27 18:26:08 2013 New Revision: 251033 URL: http://svnweb.freebsd.org/changeset/base/251033 Log: When handling an exception from the attempt from loading the faulting context on return from the trap handler, re-enable the interrupts on i386 and amd64. The trap return path have to disable interrupts since the sequence of loading the machine state is not atomic. The trap() function which transfers the control to the special handler would enable the interrupt, but an iret loads the previous eflags with PSL_I clear. Then, the special handler calls trap() on its own, which now sees the original eflags with PSL_I set and does not enable interrupts. The end result is that signal delivery and process exiting code could be executed with interrupts disabled, which is generally wrong and triggers several assertions. For amd64, the interrupts are enabled conditionally based on PSL_I in the eflags of the outer frame, as it is already done for doreti_iret_fault. For i386, the interrupts are enabled unconditionally, the ast loop could have opened a window with interrupts enabled just before the iret anyway. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/i386/i386/exception.s Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Mon May 27 16:29:53 2013 (r251032) +++ head/sys/amd64/amd64/exception.S Mon May 27 18:26:08 2013 (r251033) @@ -818,6 +818,10 @@ doreti_iret_fault: .globl ds_load_fault ds_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_DS(%rsp) @@ -827,6 +831,10 @@ ds_load_fault: .globl es_load_fault es_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_ES(%rsp) @@ -835,6 +843,10 @@ es_load_fault: ALIGN_TEXT .globl fs_load_fault fs_load_fault: + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movl $T_PROTFLT,TF_TRAPNO(%rsp) movq %rsp,%rdi call trap @@ -846,6 +858,10 @@ fs_load_fault: gs_load_fault: popfq movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUG32SEL,TF_GS(%rsp) @@ -855,6 +871,10 @@ gs_load_fault: .globl fsbase_load_fault fsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 @@ -866,6 +886,10 @@ fsbase_load_fault: .globl gsbase_load_fault gsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Mon May 27 16:29:53 2013 (r251032) +++ head/sys/i386/i386/exception.s Mon May 27 18:26:08 2013 (r251033) @@ -422,6 +422,7 @@ doreti_popl_es_fault: pushl %fs .globl doreti_popl_fs_fault doreti_popl_fs_fault: + sti movl $0,TF_ERR(%esp) /* XXX should be the error code */ movl $T_PROTFLT,TF_TRAPNO(%esp) jmp alltraps_with_regs_pushed From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:27:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8E54959E; Mon, 27 May 2013 18:27:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5DC358; Mon, 27 May 2013 18:27:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIRGMT005173; Mon, 27 May 2013 18:27:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIRCJp005145; Mon, 27 May 2013 18:27:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305271827.r4RIRCJp005145@svn.freebsd.org> From: Ed Schouten Date: Mon, 27 May 2013 18:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251034 - in vendor/compiler-rt/dist: . SDKs/darwin/usr/include SDKs/darwin/usr/include/sys SDKs/linux/usr/include SDKs/linux/usr/include/sys cmake/Modules include include/sanitizer lib... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:27:16 -0000 Author: ed Date: Mon May 27 18:27:12 2013 New Revision: 251034 URL: http://svnweb.freebsd.org/changeset/base/251034 Log: Import compiler-rt r182741. Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h vendor/compiler-rt/dist/include/CMakeLists.txt vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h vendor/compiler-rt/dist/lib/arm/aeabi_dcmp.S vendor/compiler-rt/dist/lib/arm/aeabi_fcmp.S vendor/compiler-rt/dist/lib/asan/asan.syms vendor/compiler-rt/dist/lib/asan/asan_blacklist.txt vendor/compiler-rt/dist/lib/asan/asan_fake_stack.h vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h vendor/compiler-rt/dist/lib/asan/asan_poisoning.h vendor/compiler-rt/dist/lib/asan/asan_preinit.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/ vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/interface_symbols_darwin.c vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/reexec-insert-libraries-env.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/unset-insert-libraries-on-exec.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/init-order-atexit-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-constexpr-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/asan_prelink_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/ vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/aa vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/ab vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/ba vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/heavy_uar_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/interface_symbols_linux.c vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/malloc_delete_mismatch.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/preinit_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/syscalls.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/time_null_regtest.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/zero-base-shadow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/darwin-dummy-shared-lib-so.cc vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/init-order-dlopen-so.cc vendor/compiler-rt/dist/lib/asan/lit_tests/allow_user_segv.cc vendor/compiler-rt/dist/lib/asan/lit_tests/default_blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/double-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/global-demangle.cc vendor/compiler-rt/dist/lib/asan/lit_tests/huge_negative_hea_oob.cc vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-atexit.cc vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-dlopen.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-constexpr.cc vendor/compiler-rt/dist/lib/asan/lit_tests/interface_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/invalid-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/log_path_fork_test.cc.disabled vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_fill.cc vendor/compiler-rt/dist/lib/asan/lit_tests/memcmp_strict_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/partial_right.cc vendor/compiler-rt/dist/lib/asan/lit_tests/stack-oob-frames.cc vendor/compiler-rt/dist/lib/asan/lit_tests/throw_call_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/throw_invoke_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/time_interceptor.cc vendor/compiler-rt/dist/lib/asan/lit_tests/unaligned_loads_and_stores.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free-right.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-poison.cc vendor/compiler-rt/dist/lib/asan/lit_tests/wait.cc vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test_helpers.mm vendor/compiler-rt/dist/lib/asan/tests/asan_mem_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_oob_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc vendor/compiler-rt/dist/lib/interception/interception_type_test.cc vendor/compiler-rt/dist/lib/lsan/ vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/Makefile.mk vendor/compiler-rt/dist/lib/lsan/lit_tests/ vendor/compiler-rt/dist/lib/lsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/lit_tests/SharedLibs/ vendor/compiler-rt/dist/lib/lsan/lit_tests/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/ vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/lsan/lit_tests/use_globals_initialized.cc vendor/compiler-rt/dist/lib/lsan/lsan.cc vendor/compiler-rt/dist/lib/lsan/lsan.h vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc vendor/compiler-rt/dist/lib/lsan/lsan_allocator.h vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.h vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc vendor/compiler-rt/dist/lib/lsan/lsan_thread.cc vendor/compiler-rt/dist/lib/lsan/lsan_thread.h vendor/compiler-rt/dist/lib/lsan/tests/ vendor/compiler-rt/dist/lib/lsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/tests/lsan_dummy_unittest.cc vendor/compiler-rt/dist/lib/lsan/tests/lsan_testlib.cc vendor/compiler-rt/dist/lib/msan/Makefile.mk vendor/compiler-rt/dist/lib/msan/lit_tests/ vendor/compiler-rt/dist/lib/msan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/ vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob.cc vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/ vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/aa vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/ab vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/ba vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/lit.local.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/syscalls.cc vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/ vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/msan/lit_tests/c-strdup.c vendor/compiler-rt/dist/lib/msan/lit_tests/default_blacklist.cc vendor/compiler-rt/dist/lib/msan/lit_tests/getaddrinfo-positive.cc vendor/compiler-rt/dist/lib/msan/lit_tests/getaddrinfo.cc vendor/compiler-rt/dist/lib/msan/lit_tests/heap-origin.cc vendor/compiler-rt/dist/lib/msan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/msan/lit_tests/no_sanitize_memory.cc vendor/compiler-rt/dist/lib/msan/lit_tests/no_sanitize_memory_prop.cc vendor/compiler-rt/dist/lib/msan/lit_tests/readdir64.cc vendor/compiler-rt/dist/lib/msan/lit_tests/stack-origin.cc vendor/compiler-rt/dist/lib/msan/msan.syms vendor/compiler-rt/dist/lib/msan/msan_blacklist.txt vendor/compiler-rt/dist/lib/msan/msan_interface_internal.h vendor/compiler-rt/dist/lib/msan/tests/msan_loadable.cc vendor/compiler-rt/dist/lib/msan/tests/msan_test_config.h vendor/compiler-rt/dist/lib/msan/tests/msan_test_main.cc vendor/compiler-rt/dist/lib/msandr/ vendor/compiler-rt/dist/lib/msandr/CMakeLists.txt vendor/compiler-rt/dist/lib/msandr/README.txt vendor/compiler-rt/dist/lib/msandr/msandr.cc vendor/compiler-rt/dist/lib/profile/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_syscalls.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_generic.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.h vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_atomic_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_linux_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stoptheworld_testlib.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/ vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/aligned_vs_unaligned_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_stack.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/benign_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/inlined_memcpy_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_rec.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_rec_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/load_shared_lib.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp4.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_overflow.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_stack.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset8.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/oob_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex2.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_write.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_end_with_ignore.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_end_with_ignore2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak4.c vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak5.c vendor/compiler-rt/dist/lib/tsan/lit_tests/tsan-vs-gvn.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/unaligned_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/unaligned_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race2.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/bounds.cpp vendor/compiler-rt/dist/lib/ubsan/ubsan.syms vendor/compiler-rt/dist/test/timing/modsi3.c Deleted: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_thread_registry.cc vendor/compiler-rt/dist/lib/asan/asan_thread_registry.h vendor/compiler-rt/dist/lib/asan/dynamic/ vendor/compiler-rt/dist/lib/asan/lit_tests/interface_symbols.c vendor/compiler-rt/dist/lib/asan/lit_tests/log_path_fork_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_delete_mismatch.cc vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.mm vendor/compiler-rt/dist/lib/interception/mach_override/ vendor/compiler-rt/dist/lib/msan/msan_platform_limits_posix.cc vendor/compiler-rt/dist/lib/msan/msan_platform_limits_posix.h vendor/compiler-rt/dist/lib/msan/tests/lit.cfg vendor/compiler-rt/dist/lib/msan/tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_platform_test.cc Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/Makefile vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake vendor/compiler-rt/dist/include/sanitizer/asan_interface.h vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h vendor/compiler-rt/dist/include/sanitizer/msan_interface.h vendor/compiler-rt/dist/lib/CMakeLists.txt vendor/compiler-rt/dist/lib/Makefile.mk vendor/compiler-rt/dist/lib/apple_versioning.c vendor/compiler-rt/dist/lib/arm/divmodsi4.S vendor/compiler-rt/dist/lib/arm/modsi3.S vendor/compiler-rt/dist/lib/arm/udivmodsi4.S vendor/compiler-rt/dist/lib/arm/umodsi3.S vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/Makefile.mk vendor/compiler-rt/dist/lib/asan/asan_allocator.h vendor/compiler-rt/dist/lib/asan/asan_allocator2.cc vendor/compiler-rt/dist/lib/asan/asan_fake_stack.cc vendor/compiler-rt/dist/lib/asan/asan_flags.h vendor/compiler-rt/dist/lib/asan/asan_globals.cc vendor/compiler-rt/dist/lib/asan/asan_intercepted_functions.h vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.h vendor/compiler-rt/dist/lib/asan/asan_internal.h vendor/compiler-rt/dist/lib/asan/asan_linux.cc vendor/compiler-rt/dist/lib/asan/asan_mac.cc vendor/compiler-rt/dist/lib/asan/asan_mac.h vendor/compiler-rt/dist/lib/asan/asan_malloc_linux.cc vendor/compiler-rt/dist/lib/asan/asan_malloc_mac.cc vendor/compiler-rt/dist/lib/asan/asan_malloc_win.cc vendor/compiler-rt/dist/lib/asan/asan_mapping.h vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc vendor/compiler-rt/dist/lib/asan/asan_poisoning.cc vendor/compiler-rt/dist/lib/asan/asan_posix.cc vendor/compiler-rt/dist/lib/asan/asan_report.cc vendor/compiler-rt/dist/lib/asan/asan_report.h vendor/compiler-rt/dist/lib/asan/asan_rtl.cc vendor/compiler-rt/dist/lib/asan/asan_stack.cc vendor/compiler-rt/dist/lib/asan/asan_stack.h vendor/compiler-rt/dist/lib/asan/asan_stats.cc vendor/compiler-rt/dist/lib/asan/asan_stats.h vendor/compiler-rt/dist/lib/asan/asan_thread.cc vendor/compiler-rt/dist/lib/asan/asan_thread.h vendor/compiler-rt/dist/lib/asan/asan_win.cc vendor/compiler-rt/dist/lib/asan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist.txt vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-nobug-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/malloc-in-qsort.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/overflow-in-qsort.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/rlimit_mmap_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/swapcontext_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/asan/lit_tests/default_options.cc vendor/compiler-rt/dist/lib/asan/lit_tests/dlclose-test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/heap-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-bug.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-nobug.cc vendor/compiler-rt/dist/lib/asan/lit_tests/large_func_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/asan/lit_tests/stack-frame-demangle.cc vendor/compiler-rt/dist/lib/asan/lit_tests/stack-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/strncpy-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-scope-inlined.cc vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/tests/asan_globals_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test_config.h vendor/compiler-rt/dist/lib/asan/tests/asan_test_utils.h vendor/compiler-rt/dist/lib/atomic.c vendor/compiler-rt/dist/lib/comparedf2.c vendor/compiler-rt/dist/lib/comparesf2.c vendor/compiler-rt/dist/lib/interception/CMakeLists.txt vendor/compiler-rt/dist/lib/interception/Makefile.mk vendor/compiler-rt/dist/lib/interception/interception.h vendor/compiler-rt/dist/lib/interception/interception_mac.cc vendor/compiler-rt/dist/lib/interception/interception_mac.h vendor/compiler-rt/dist/lib/lit.common.cfg vendor/compiler-rt/dist/lib/lit.common.unit.cfg vendor/compiler-rt/dist/lib/msan/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/msan.cc vendor/compiler-rt/dist/lib/msan/msan.h vendor/compiler-rt/dist/lib/msan/msan_flags.h vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan_linux.cc vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc vendor/compiler-rt/dist/lib/msan/msan_report.cc vendor/compiler-rt/dist/lib/msan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc vendor/compiler-rt/dist/lib/msan/tests/msandr_test_so.cc vendor/compiler-rt/dist/lib/msan/tests/msandr_test_so.h vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_msvc.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_lfstack.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mutex.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_placement_new.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_quarantine.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_report_decorator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stackdepot.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.cfg vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_allocator_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_common_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_libc_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_mutex_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/Makefile.old vendor/compiler-rt/dist/lib/tsan/analyze_libtsan.sh vendor/compiler-rt/dist/lib/tsan/check_cmake.sh vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh vendor/compiler-rt/dist/lib/tsan/go/test.c vendor/compiler-rt/dist/lib/tsan/go/tsan_go.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race.c vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race2.c vendor/compiler-rt/dist/lib/tsan/lit_tests/java.h vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_rwlock.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/tsan/lit_tests/memcpy_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_destroy_locked.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset7.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_heap.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex.c vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_errno.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_malloc.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/test_output.sh vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak3.c vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_name.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race.cc vendor/compiler-rt/dist/lib/tsan/rtl/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/Makefile.mk vendor/compiler-rt/dist/lib/tsan/rtl/Makefile.old vendor/compiler-rt/dist/lib/tsan/rtl/tsan_defs.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_fd.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_atomic.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_inl.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_java.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_java.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_md5.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mutex.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mutexset.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_windows.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_amd64.S vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_mutex.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_update_shadow_word_inl.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_vector.h vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_test_util_linux.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mman_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mutexset_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_shadow_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_suppressions_test.cc vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/Makefile.mk vendor/compiler-rt/dist/lib/ubsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/lit_tests/Float/cast-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/vptr.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers_cxx.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_value.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_value.h vendor/compiler-rt/dist/make/AppleBI.mk vendor/compiler-rt/dist/make/platform/clang_darwin.mk vendor/compiler-rt/dist/make/platform/clang_linux.mk vendor/compiler-rt/dist/make/platform/darwin_bni.mk Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/CMakeLists.txt Mon May 27 18:27:12 2013 (r251034) @@ -15,6 +15,19 @@ include(LLVMParseArguments) # runtime libraries. cmake_minimum_required(VERSION 2.8.8) +# Compute the Clang version from the LLVM version. +# FIXME: We should be able to reuse CLANG_VERSION variable calculated +# in Clang cmake files, instead of copying the rules here. +string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + ${PACKAGE_VERSION}) +# Setup the paths where compiler-rt runtimes and headers should be stored. +set(LIBCLANG_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) +string(TOLOWER ${CMAKE_SYSTEM_NAME} LIBCLANG_OS_DIR) +set(CLANG_RESOURCE_DIR ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}) +set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${CLANG_RESOURCE_DIR}/lib/${LIBCLANG_OS_DIR}) +set(COMPILER_RT_LIBRARY_INSTALL_DIR + ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR}) + # Add path for custom modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} @@ -23,6 +36,9 @@ set(CMAKE_MODULE_PATH include(AddCompilerRT) set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +# Setup custom SDK sysroots. +set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin) +set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux) # Detect whether the current target platform is 32-bit or 64-bit, and setup # the correct commandline flags needed to attempt to target 32-bit and 64-bit. @@ -37,15 +53,8 @@ else() set(TARGET_32_BIT_CFLAGS "-m32") endif() -# FIXME: Below we assume that the target build of LLVM/Clang is x86, which is -# not at all valid. Much of this can be fixed just by switching to use -# a just-built-clang binary for the compiles. - -set(TARGET_x86_64_CFLAGS ${TARGET_64_BIT_CFLAGS}) -set(TARGET_i386_CFLAGS ${TARGET_32_BIT_CFLAGS}) - -set(COMPILER_RT_SUPPORTED_ARCH - x86_64 i386) +# List of architectures we can target. +set(COMPILER_RT_SUPPORTED_ARCH) function(get_target_flags_for_arch arch out_var) list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) @@ -60,27 +69,45 @@ endfunction() # platform. We use the results of these tests to build only the various target # runtime libraries supported by our current compilers cross-compiling # abilities. -set(SIMPLE_SOURCE64 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple64.c) -file(WRITE ${SIMPLE_SOURCE64} "#include \nint main() {}") -try_compile(CAN_TARGET_x86_64 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE64} - COMPILE_DEFINITIONS "${TARGET_x86_64_CFLAGS}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_x86_64_CFLAGS}") - -set(SIMPLE_SOURCE32 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple32.c) -file(WRITE ${SIMPLE_SOURCE32} "#include \nint main() {}") -try_compile(CAN_TARGET_i386 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE32} - COMPILE_DEFINITIONS "${TARGET_i386_CFLAGS}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_i386_CFLAGS}") +set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.c) +file(WRITE ${SIMPLE_SOURCE} "#include \nint main() {}") + +# test_target_arch( ) +# Sets the target flags for a given architecture and determines if this +# architecture is supported by trying to build a simple file. +macro(test_target_arch arch) + set(TARGET_${arch}_CFLAGS ${ARGN}) + try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" + CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}") + if(${CAN_TARGET_${arch}}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + endif() +endmacro() + +if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") + test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) + test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) +elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") + # Explicitly set -m flag on powerpc, because on ppc64 defaults for gcc and + # clang are different. + test_target_arch(powerpc64 "-m64") + test_target_arch(powerpc "-m32") +endif() # We only support running instrumented tests when we're not cross compiling # and target a unix-like system. On Android we define the rules for building # unit tests, but don't execute them. if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX AND NOT ANDROID) - set(COMPILER_RT_CAN_EXECUTE_TESTS TRUE) + option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON) else() - set(COMPILER_RT_CAN_EXECUTE_TESTS FALSE) + option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF) endif() - + +# Check if compiler-rt is built with libc++. +find_flag_in_string("${CMAKE_CXX_FLAGS}" "-stdlib=libc++" + COMPILER_RT_USES_LIBCXX) + function(filter_available_targets out_var) set(archs) foreach(arch ${ARGN}) @@ -99,6 +126,8 @@ set(SANITIZER_COMMON_CFLAGS -fno-exceptions -fomit-frame-pointer -funwind-tables + -fno-stack-protector + -Wno-gnu # Variadic macros with 0 arguments for ... -O3 ) if(NOT WIN32) @@ -120,51 +149,36 @@ check_cxx_compiler_flag(-Wno-c99-extensi if(SUPPORTS_NO_C99_EXTENSIONS_FLAG) list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions) endif() +# Sanitizer may not have libstdc++, so we can have problems with virtual +# destructors. +check_cxx_compiler_flag(-Wno-non-virtual-dtor SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) +if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor) +endif() + +# Setup min Mac OS X version. if(APPLE) - list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5) + if(COMPILER_RT_USES_LIBCXX) + set(SANITIZER_MIN_OSX_VERSION 10.7) + else() + set(SANITIZER_MIN_OSX_VERSION 10.5) + endif() + list(APPEND SANITIZER_COMMON_CFLAGS + -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) endif() # Architectures supported by Sanitizer runtimes. Specific sanitizers may # support only subset of these (e.g. TSan works on x86_64 only). filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH - x86_64 i386) - -# Compute the Clang version from the LLVM version. -# FIXME: We should be able to reuse CLANG_VERSION variable calculated -# in Clang cmake files, instead of copying the rules here. -string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION - ${PACKAGE_VERSION}) -# Setup the paths where compiler-rt runtimes and headers should be stored. -set(LIBCLANG_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) -string(TOLOWER ${CMAKE_SYSTEM_NAME} LIBCLANG_OS_DIR) - -# Install compiler-rt headers. -install(DIRECTORY include/ - DESTINATION ${LIBCLANG_INSTALL_PATH}/include - FILES_MATCHING - PATTERN "*.h" - PATTERN ".svn" EXCLUDE - ) - -# Call add_clang_compiler_rt_libraries to make sure that targets are built -# and installed in the directories where Clang driver expects to find them. -macro(add_clang_compiler_rt_libraries) - # Setup output directories so that clang in build tree works. - set_target_properties(${ARGN} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY - ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/${LIBCLANG_OS_DIR} - LIBRARY_OUTPUT_DIRECTORY - ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/${LIBCLANG_OS_DIR} - ) - # Add installation command. - install(TARGETS ${ARGN} - ARCHIVE DESTINATION ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR} - LIBRARY DESTINATION ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR} - ) -endmacro(add_clang_compiler_rt_libraries) + x86_64 i386 powerpc64 powerpc) # Add the public header's directory to the includes for all of compiler-rt. include_directories(include) +add_subdirectory(include) + +set(SANITIZER_COMMON_LIT_TEST_DEPS + clang clang-headers FileCheck count not llvm-nm llvm-symbolizer + compiler-rt-headers) add_subdirectory(lib) Modified: vendor/compiler-rt/dist/Makefile ============================================================================== --- vendor/compiler-rt/dist/Makefile Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/Makefile Mon May 27 18:27:12 2013 (r251034) @@ -255,10 +255,10 @@ $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $ $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CFLAGS) -o $$@ $$< + $(Verb) $(Tmp.CC) $(COMMON_CFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.cc $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CXXFLAGS) -o $$@ $$< + $(Verb) $(Tmp.CC) $(COMMON_CXXFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< .PRECIOUS: $(Tmp.ObjPath)/.dir endef Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,17 @@ +/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#include Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h Mon May 27 18:27:12 2013 (r251034) @@ -24,15 +24,18 @@ extern "C" { typedef struct __sFILE FILE; typedef __SIZE_TYPE__ size_t; -/* Determine the appropriate fopen() and fwrite() functions. */ +/* Determine the appropriate fdopen, fopen(), and fwrite() functions. */ #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) # if defined(__i386) +# define __FDOPEN_NAME "_fdopen$UNIX2003" # define __FOPEN_NAME "_fopen$UNIX2003" # define __FWRITE_NAME "_fwrite$UNIX2003" # elif defined(__x86_64__) +# define __FDOPEN_NAME "_fdopen" # define __FOPEN_NAME "_fopen" # define __FWRITE_NAME "_fwrite" # elif defined(__arm) +# define __FDOPEN_NAME "_fdopen" # define __FOPEN_NAME "_fopen" # define __FWRITE_NAME "_fwrite" # else @@ -40,9 +43,11 @@ typedef __SIZE_TYPE__ size_t; # endif #elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) # if defined(__i386) || defined (__x86_64) +# define __FDOPEN_NAME "_fdopen" # define __FOPEN_NAME "_fopen" # define __FWRITE_NAME "_fwrite" # elif defined(__arm) +# define __FDOPEN_NAME "_fdopen" # define __FOPEN_NAME "_fopen" # define __FWRITE_NAME "_fwrite" # else @@ -68,13 +73,13 @@ extern FILE *__stderrp; int fclose(FILE *); int fflush(FILE *); FILE *fopen(const char * __restrict, const char * __restrict) __asm(__FOPEN_NAME); +FILE *fdopen(int, const char *) __asm(__FDOPEN_NAME); int fprintf(FILE * __restrict, const char * __restrict, ...); size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) __asm(__FWRITE_NAME); size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); long ftell(FILE *); int fseek(FILE *, long, int); - int snprintf(char * __restrict, size_t, const char * __restrict, ...); #if defined(__cplusplus) Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h Mon May 27 18:27:12 2013 (r251034) @@ -22,9 +22,11 @@ typedef __SIZE_TYPE__ size_t; void abort(void) __attribute__((__noreturn__)); +int atexit(void (*)(void)); int atoi(const char *); void free(void *); char *getenv(const char *); void *malloc(size_t); +void *realloc(void *, size_t); #endif /* __STDLIB_H__ */ Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h Mon May 27 18:27:12 2013 (r251034) @@ -21,6 +21,7 @@ typedef __SIZE_TYPE__ size_t; int memcmp(const void *, const void *, size_t); void *memcpy(void *, const void *, size_t); +void *memset(void *, int, size_t); char *strcat(char *, const char *); char *strcpy(char *, const char *); char *strdup(const char *); Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,52 @@ +/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef _SYS_FCNTL_H_ +#define _SYS_FCNTL_H_ + +/* Determine the appropriate open function. */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +# if defined(__i386) +# define __OPEN_NAME "_open$UNIX2003" +# elif defined(__x86_64__) +# define __OPEN_NAME "_open" +# elif defined(__arm) +# define __OPEN_NAME "_open" +# else +# error "unrecognized architecture for targetting OS X" +# endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +# if defined(__i386) || defined (__x86_64) +# define __OPEN_NAME "_open" +# elif defined(__arm) +# define __OPEN_NAME "_open" +# else +# error "unrecognized architecture for targetting iOS" +# endif +#else +# error "unrecognized architecture for targetting Darwin" +#endif + +#define O_RDONLY 0x0000 /* open for reading only */ +#define O_WRONLY 0x0001 /* open for writing only */ +#define O_RDWR 0x0002 /* open for reading and writing */ +#define O_ACCMODE 0x0003 /* mask for above modes */ + +#define O_CREAT 0x0200 /* create if nonexistant */ + +int open(const char *, int, ...) __asm(__OPEN_NAME); + +#endif /* !_SYS_FCNTL_H_ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,42 @@ +/* ===-- mman.h - stub SDK header for compiler-rt ---------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_MMAN_H__ +#define __SYS_MMAN_H__ + +typedef __SIZE_TYPE__ size_t; + +#define PROT_NONE 0x00 +#define PROT_READ 0x01 +#define PROT_WRITE 0x02 +#define PROT_EXEC 0x04 + +#define MAP_SHARED 0x0001 +#define MAP_PRIVATE 0x0002 + +#define MAP_FILE 0x0000 +#define MAP_ANON 0x1000 + +#define MS_ASYNC 0x0001 +#define MS_INVALIDATE 0x0002 +#define MS_SYNC 0x0010 + +void *mmap(void *addr, size_t len, int prot, int flags, int fd, + long long offset); +int munmap(void *addr, size_t len); +int msync(void *addr, size_t len, int flags); + +#endif /* __SYS_MMAN_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,17 @@ +/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#include Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h Mon May 27 18:27:12 2013 (r251034) @@ -33,6 +33,7 @@ extern struct _IO_FILE *stderr; extern int fclose(FILE *); extern int fflush(FILE *); extern FILE *fopen(const char * restrict, const char * restrict); +extern FILE *fdopen(int, const char * restrict); extern int fprintf(FILE * restrict, const char * restrict, ...); extern size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict); extern size_t fread(void * restrict, size_t, size_t, FILE * restrict); Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h Mon May 27 18:27:12 2013 (r251034) @@ -22,6 +22,7 @@ typedef __SIZE_TYPE__ size_t; void abort(void) __attribute__((__nothrow__)) __attribute__((__noreturn__)); +int atexit(void (*)(void)) __attribute__((__nothrow__)); int atoi(const char *) __attribute__((__nothrow__)); void free(void *) __attribute__((__nothrow__)); char *getenv(const char *) __attribute__((__nothrow__)) @@ -29,5 +30,7 @@ char *getenv(const char *) __attribute__ __attribute__((__warn_unused_result__)); void *malloc(size_t) __attribute__((__nothrow__)) __attribute((__malloc__)) __attribute__((__warn_unused_result__)); +void *realloc(void *, size_t) __attribute__((__nothrow__)) __attribute((__malloc__)) + __attribute__((__warn_unused_result__)); #endif /* __STDLIB_H__ */ Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h Mon May 27 18:27:12 2013 (r251034) @@ -21,6 +21,7 @@ typedef __SIZE_TYPE__ size_t; int memcmp(const void *, const void *, size_t); void *memcpy(void *, const void *, size_t); +void *memset(void *, int, size_t); char *strcat(char *, const char *); char *strcpy(char *, const char *); char *strdup(const char *); Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,29 @@ +/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef _SYS_FCNTL_H_ +#define _SYS_FCNTL_H_ + +#define O_RDONLY 0x0000 +#define O_WRONLY 0x0001 +#define O_RDWR 0x0002 +#define O_ACCMODE 0x0003 + +#define O_CREAT 0x0200 + +int open(const char *, int, ...); + +#endif /* _SYS_FCNTL_H_ */ Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h Mon May 27 18:27:12 2013 (r251034) @@ -19,10 +19,28 @@ typedef __SIZE_TYPE__ size_t; -#define PROT_READ 0x1 -#define PROT_WRITE 0x2 -#define PROT_EXEC 0x4 +#define PROT_NONE 0x00 +#define PROT_READ 0x01 +#define PROT_WRITE 0x02 +#define PROT_EXEC 0x04 +#define MAP_SHARED 0x0001 +#define MAP_PRIVATE 0x0002 + +#define MAP_FILE 0x0000 +#define MAP_ANON 0x1000 + +#define MS_ASYNC 0x0001 +#define MS_INVALIDATE 0x0002 +#define MS_SYNC 0x0010 + +extern void *mmap(void *addr, size_t len, int prot, int flags, int fd, + long long offset) + __attribute__((__nothrow__)); +extern int munmap(void *addr, size_t len) + __attribute__((__nothrow__)); +extern int msync(void *addr, size_t len, int flags) + __attribute__((__nothrow__)); extern int mprotect (void *__addr, size_t __len, int __prot) __attribute__((__nothrow__)); Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Mon May 27 18:27:12 2013 (r251034) @@ -18,6 +18,92 @@ macro(add_compiler_rt_object_library nam endif() endmacro() +# Same as above, but adds universal osx library with name ".osx" +# targeting multiple architectures. +# add_compiler_rt_osx_object_library( ARCH +# SOURCES +# CFLAGS ) +macro(add_compiler_rt_osx_object_library name) + parse_arguments(LIB "ARCH;SOURCES;CFLAGS" "" ${ARGN}) + set(libname "${name}.osx") + add_library(${libname} OBJECT ${LIB_SOURCES}) + set_target_compile_flags(${libname} ${LIB_CFLAGS}) + set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}") +endmacro() + +# Adds static runtime for a given architecture and puts it in the proper +# directory in the build and install trees. +# add_compiler_rt_static_runtime( +# SOURCES +# CFLAGS +# DEFS +# SYMS ) +macro(add_compiler_rt_static_runtime name arch) + if(CAN_TARGET_${arch}) + parse_arguments(LIB "SOURCES;CFLAGS;DEFS;SYMS" "" ${ARGN}) + add_library(${name} STATIC ${LIB_SOURCES}) + # Setup compile flags and definitions. + set_target_compile_flags(${name} + ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set_property(TARGET ${name} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + # Setup correct output directory in the build tree. + set_target_properties(${name} PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + # Add installation command. + install(TARGETS ${name} + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + # Generate the .syms file if possible. + if(LIB_SYMS) + get_target_property(libfile ${name} LOCATION) + configure_file(${LIB_SYMS} ${libfile}.syms) + install(FILES ${libfile}.syms + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif(LIB_SYMS) + else() + message(FATAL_ERROR "Archtecture ${arch} can't be targeted") + endif() +endmacro() + +# Same as add_compiler_rt_static_runtime, but creates a universal library +# for several architectures. +# add_compiler_rt_osx_static_runtime( ARCH +# SOURCES +# CFLAGS +# DEFS ) +macro(add_compiler_rt_osx_static_runtime name) + parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN}) + add_library(${name} STATIC ${LIB_SOURCES}) + set_target_compile_flags(${name} ${LIB_CFLAGS}) + set_property(TARGET ${name} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${name} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCH}" + ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + install(TARGETS ${name} + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) +endmacro() + +# Adds dynamic runtime library on osx, which supports multiple architectures. +# add_compiler_rt_osx_dynamic_runtime( ARCH +# SOURCES +# CFLAGS +# DEFS +# LINKFLAGS ) +macro(add_compiler_rt_osx_dynamic_runtime name) + parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN}) + add_library(${name} SHARED ${LIB_SOURCES}) + set_target_compile_flags(${name} ${LIB_CFLAGS}) + set_target_link_flags(${name} ${LIB_LINKFLAGS}) + set_property(TARGET ${name} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${name} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCH}" + LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + install(TARGETS ${name} + LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) +endmacro() + # Unittests support. set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/gtest-all.cc) @@ -35,15 +121,21 @@ set(COMPILER_RT_GTEST_INCLUDE_CFLAGS # LINK_FLAGS ) macro(add_compiler_rt_test test_suite test_name) parse_arguments(TEST "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) - get_unittest_directory(OUTPUT_DIR) - file(MAKE_DIRECTORY ${OUTPUT_DIR}) - set(output_bin "${OUTPUT_DIR}/${test_name}") - add_custom_command( - OUTPUT ${output_bin} + set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${test_name}") + add_custom_target(${test_name} COMMAND clang ${TEST_OBJECTS} -o "${output_bin}" ${TEST_LINK_FLAGS} DEPENDS clang ${TEST_DEPS}) - add_custom_target(${test_name} DEPENDS ${output_bin}) # Make the test suite depend on the binary. add_dependencies(${test_suite} ${test_name}) endmacro() + +macro(add_compiler_rt_resource_file target_name file_name) + set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}") + set(dst_file "${CLANG_RESOURCE_DIR}/${file_name}") + add_custom_target(${target_name} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file} + DEPENDS ${file_name}) + # Install in Clang resource directory. + install(FILES ${file_name} DESTINATION ${LIBCLANG_INSTALL_PATH}) +endmacro() Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Mon May 27 18:27:12 2013 (r251034) @@ -15,3 +15,14 @@ function(set_target_link_flags target) set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}") endfunction() +# Check if a given flag is present in a space-separated flag_string. +# Store the result in out_var. +function(find_flag_in_string flag_string flag out_var) + string(REPLACE " " ";" flag_list ${flag_string}) + list(FIND flag_list ${flag} flag_pos) + if(NOT flag_pos EQUAL -1) + set(${out_var} TRUE PARENT_SCOPE) + else() + set(${out_var} FALSE PARENT_SCOPE) + endif() +endfunction() Added: vendor/compiler-rt/dist/include/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/include/CMakeLists.txt Mon May 27 18:27:12 2013 (r251034) @@ -0,0 +1,39 @@ +set(SANITIZER_HEADERS + sanitizer/asan_interface.h + sanitizer/common_interface_defs.h + sanitizer/linux_syscall_hooks.h + sanitizer/msan_interface.h) + +set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) + +if(MSVC_IDE OR XCODE) + set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) +endif() + +# Copy compiler-rt headers to the build tree. +set(out_files) +foreach( f ${SANITIZER_HEADERS} ) + set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) + set( dst ${output_dir}/${f} ) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying compiler-rt's ${f}...") + list(APPEND out_files ${dst}) + + if(other_output_dir) + set(other_dst ${other_output_dir}/${f}) + add_custom_command(OUTPUT ${other_dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} + COMMENT "Copying compiler-rt's ${f}...") + list(APPEND out_files ${other_dst}) + endif() +endforeach( f ) + +add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) + +# Install sanitizer headers. +install(FILES ${SANITIZER_HEADERS} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DESTINATION ${LIBCLANG_INSTALL_PATH}/include/sanitizer) Modified: vendor/compiler-rt/dist/include/sanitizer/asan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/asan_interface.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/include/sanitizer/asan_interface.h Mon May 27 18:27:12 2013 (r251034) @@ -7,69 +7,18 @@ // //===----------------------------------------------------------------------===// // -// This file is a part of AddressSanitizer, an address sanity checker. +// This file is a part of AddressSanitizer. // -// This header can be included by the instrumented program to fetch -// data (mostly allocator statistics) from ASan runtime library. +// Public interface header. //===----------------------------------------------------------------------===// #ifndef SANITIZER_ASAN_INTERFACE_H #define SANITIZER_ASAN_INTERFACE_H #include -// ----------- ATTENTION ------------- -// This header should NOT include any other headers from ASan runtime. -// All functions in this header are extern "C" and start with __asan_. - -using __sanitizer::uptr; - +#ifdef __cplusplus extern "C" { - // This function should be called at the very beginning of the process, - // before any instrumented code is executed and before any call to malloc. - void __asan_init() SANITIZER_INTERFACE_ATTRIBUTE; - - // This structure describes an instrumented global variable. - struct __asan_global { - uptr beg; // The address of the global. - uptr size; // The original size of the global. - uptr size_with_redzone; // The size with the redzone. - const char *name; // Name as a C string. - uptr has_dynamic_init; // Non-zero if the global has dynamic initializer. - }; - - // These two functions should be called by the instrumented code. - // 'globals' is an array of structures describing 'n' globals. - void __asan_register_globals(__asan_global *globals, uptr n) - SANITIZER_INTERFACE_ATTRIBUTE; - void __asan_unregister_globals(__asan_global *globals, uptr n) - SANITIZER_INTERFACE_ATTRIBUTE; - - // These two functions should be called before and after dynamic initializers - // run, respectively. They should be called with parameters describing all - // dynamically initialized globals defined in the calling TU. - void __asan_before_dynamic_init(uptr first_addr, uptr last_addr) - SANITIZER_INTERFACE_ATTRIBUTE; - void __asan_after_dynamic_init() - SANITIZER_INTERFACE_ATTRIBUTE; - - // These two functions are used by the instrumented code in the - // use-after-return mode. __asan_stack_malloc allocates size bytes of - // fake stack and __asan_stack_free poisons it. real_stack is a pointer to - // the real stack region. - uptr __asan_stack_malloc(uptr size, uptr real_stack) - SANITIZER_INTERFACE_ATTRIBUTE; - void __asan_stack_free(uptr ptr, uptr size, uptr real_stack) - SANITIZER_INTERFACE_ATTRIBUTE; - - // These two functions are used by instrumented code in the - // use-after-scope mode. They mark memory for local variables as - // unaddressable when they leave scope and addressable before the - // function exits. - void __asan_poison_stack_memory(uptr addr, uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; - void __asan_unpoison_stack_memory(uptr addr, uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; - +#endif // Marks memory region [addr, addr+size) as unaddressable. // This memory must be previously allocated by the user program. Accessing // addresses in this region from instrumented code is forbidden until @@ -78,8 +27,7 @@ extern "C" { // to ASan alignment restrictions. // Method is NOT thread-safe in the sense that no two threads can // (un)poison memory in the same memory region simultaneously. - void __asan_poison_memory_region(void const volatile *addr, uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_poison_memory_region(void const volatile *addr, size_t size); // Marks memory region [addr, addr+size) as addressable. // This memory must be previously allocated by the user program. Accessing // addresses in this region is allowed until this region is poisoned again. @@ -87,15 +35,10 @@ extern "C" { // ASan alignment restrictions. // Method is NOT thread-safe in the sense that no two threads can // (un)poison memory in the same memory region simultaneously. - void __asan_unpoison_memory_region(void const volatile *addr, uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; - - // Performs cleanup before a NoReturn function. Must be called before things - // like _exit and execl to avoid false positives on stack. - void __asan_handle_no_return() SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_unpoison_memory_region(void const volatile *addr, size_t size); -// User code should use macro instead of functions. -#if __has_feature(address_sanitizer) +// User code should use macros instead of functions. +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) #define ASAN_POISON_MEMORY_REGION(addr, size) \ __asan_poison_memory_region((addr), (size)) #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \ @@ -109,104 +52,86 @@ extern "C" { // Returns true iff addr is poisoned (i.e. 1-byte read/write access to this // address will result in error report from AddressSanitizer). - bool __asan_address_is_poisoned(void const volatile *addr) - SANITIZER_INTERFACE_ATTRIBUTE; + bool __asan_address_is_poisoned(void const volatile *addr); // If at least on byte in [beg, beg+size) is poisoned, return the address // of the first such byte. Otherwise return 0. - uptr __asan_region_is_poisoned(uptr beg, uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; + void *__asan_region_is_poisoned(void *beg, size_t size); // Print the description of addr (useful when debugging in gdb). - void __asan_describe_address(uptr addr) - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_describe_address(void *addr); // This is an internal function that is called to report an error. // However it is still a part of the interface because users may want to // set a breakpoint on this function in a debugger. - void __asan_report_error(uptr pc, uptr bp, uptr sp, - uptr addr, bool is_write, uptr access_size) - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_report_error(void *pc, void *bp, void *sp, + void *addr, bool is_write, size_t access_size); // Sets the exit code to use when reporting an error. // Returns the old value. - int __asan_set_error_exit_code(int exit_code) - SANITIZER_INTERFACE_ATTRIBUTE; + int __asan_set_error_exit_code(int exit_code); // Sets the callback to be called right before death on error. // Passing 0 will unset the callback. - void __asan_set_death_callback(void (*callback)(void)) - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_set_death_callback(void (*callback)(void)); - void __asan_set_error_report_callback(void (*callback)(const char*)) - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_set_error_report_callback(void (*callback)(const char*)); // User may provide function that would be called right when ASan detects // an error. This can be used to notice cases when ASan detects an error, but // the program crashes before ASan report is printed. - /* OPTIONAL */ void __asan_on_error() - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_on_error(); // User may provide its own implementation for symbolization function. // It should print the description of instruction at address "pc" to // "out_buffer". Description should be at most "out_size" bytes long. // User-specified function should return true if symbolization was // successful. - /* OPTIONAL */ bool __asan_symbolize(const void *pc, char *out_buffer, - int out_size) - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; + bool __asan_symbolize(const void *pc, char *out_buffer, + int out_size); // Returns the estimated number of bytes that will be reserved by allocator // for request of "size" bytes. If ASan allocator can't allocate that much // memory, returns the maximal possible allocation size, otherwise returns // "size". - uptr __asan_get_estimated_allocated_size(uptr size) - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_estimated_allocated_size(size_t size); // Returns true if p was returned by the ASan allocator and // is not yet freed. - bool __asan_get_ownership(const void *p) - SANITIZER_INTERFACE_ATTRIBUTE; + bool __asan_get_ownership(const void *p); // Returns the number of bytes reserved for the pointer p. // Requires (get_ownership(p) == true) or (p == 0). - uptr __asan_get_allocated_size(const void *p) - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_allocated_size(const void *p); // Number of bytes, allocated and not yet freed by the application. - uptr __asan_get_current_allocated_bytes() - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_current_allocated_bytes(); // Number of bytes, mmaped by asan allocator to fulfill allocation requests. // Generally, for request of X bytes, allocator can reserve and add to free // lists a large number of chunks of size X to use them for future requests. // All these chunks count toward the heap size. Currently, allocator never // releases memory to OS (instead, it just puts freed chunks to free lists). - uptr __asan_get_heap_size() - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_heap_size(); // Number of bytes, mmaped by asan allocator, which can be used to fulfill // allocation requests. When a user program frees memory chunk, it can first // fall into quarantine and will count toward __asan_get_free_bytes() later. - uptr __asan_get_free_bytes() - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_free_bytes(); // Number of bytes in unmapped pages, that are released to OS. Currently, // always returns 0. - uptr __asan_get_unmapped_bytes() - SANITIZER_INTERFACE_ATTRIBUTE; + size_t __asan_get_unmapped_bytes(); // Prints accumulated stats to stderr. Used for debugging. - void __asan_print_accumulated_stats() - SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_print_accumulated_stats(); // This function may be optionally provided by user and should return // a string containing ASan runtime options. See asan_flags.h for details. - /* OPTIONAL */ const char* __asan_default_options() - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; + const char* __asan_default_options(); // Malloc hooks that may be optionally provided by user. // __asan_malloc_hook(ptr, size) is called immediately after // allocation of "size" bytes, which returned "ptr". // __asan_free_hook(ptr) is called immediately before // deallocation of "ptr". - /* OPTIONAL */ void __asan_malloc_hook(void *ptr, uptr size) - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; - /* OPTIONAL */ void __asan_free_hook(void *ptr) - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; + void __asan_malloc_hook(void *ptr, size_t size); + void __asan_free_hook(void *ptr); +#ifdef __cplusplus } // extern "C" +#endif #endif // SANITIZER_ASAN_INTERFACE_H Modified: vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Mon May 27 18:26:08 2013 (r251033) +++ vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Mon May 27 18:27:12 2013 (r251034) @@ -7,86 +7,52 @@ // //===----------------------------------------------------------------------===// // -// This file is shared between AddressSanitizer and ThreadSanitizer. -// It contains basic macro and types. -// NOTE: This file may be included into user code. +// Common part of the public sanitizer interface. //===----------------------------------------------------------------------===// #ifndef SANITIZER_COMMON_INTERFACE_DEFS_H #define SANITIZER_COMMON_INTERFACE_DEFS_H -// ----------- ATTENTION ------------- -// This header should NOT include any other headers to avoid portability issues. +#include +#include -#if defined(_WIN32) -// FIXME find out what we need on Windows. __declspec(dllexport) ? -# define SANITIZER_INTERFACE_ATTRIBUTE -# define SANITIZER_WEAK_ATTRIBUTE -#elif defined(SANITIZER_GO) -# define SANITIZER_INTERFACE_ATTRIBUTE -# define SANITIZER_WEAK_ATTRIBUTE -#else -# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default"))) -# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak)) -#endif - -#ifdef __linux__ -# define SANITIZER_SUPPORTS_WEAK_HOOKS 1 -#else -# define SANITIZER_SUPPORTS_WEAK_HOOKS 0 -#endif - -// __has_feature +// GCC does not understand __has_feature. #if !defined(__has_feature) # define __has_feature(x) 0 #endif -// For portability reasons we do not include stddef.h, stdint.h or any other -// system header, but we do need some basic types that are not defined -// in a portable way by the language itself. -namespace __sanitizer { - -#if defined(_WIN64) -// 64-bit Windows uses LLP64 data model. -typedef unsigned long long uptr; // NOLINT -typedef signed long long sptr; // NOLINT -#else -typedef unsigned long uptr; // NOLINT -typedef signed long sptr; // NOLINT -#endif // defined(_WIN64) -#if defined(__x86_64__) -// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use -// 64-bit pointer to unwind stack frame. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:29:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E76D2705; Mon, 27 May 2013 18:29:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA46D363; Mon, 27 May 2013 18:29:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RITKUf005548; Mon, 27 May 2013 18:29:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RITK5q005547; Mon, 27 May 2013 18:29:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271829.r4RITK5q005547@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251035 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:29:21 -0000 Author: kib Date: Mon May 27 18:29:20 2013 New Revision: 251035 URL: http://svnweb.freebsd.org/changeset/base/251035 Log: When reporting the fault details, also print %rsp. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon May 27 18:27:12 2013 (r251034) +++ head/sys/amd64/amd64/trap.c Mon May 27 18:29:20 2013 (r251035) @@ -617,10 +617,10 @@ trap(struct trapframe *frame) ksi.ksi_addr = (void *)addr; if (uprintf_signal) { uprintf("pid %d comm %s: signal %d err %lx code %d type %d " - "addr 0x%lx rip 0x%lx " + "addr 0x%lx rsp 0x%lx rip 0x%lx " "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, - frame->tf_rip, + frame->tf_rsp, frame->tf_rip, fubyte((void *)(frame->tf_rip + 0)), fubyte((void *)(frame->tf_rip + 1)), fubyte((void *)(frame->tf_rip + 2)), From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:29:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8703828; Mon, 27 May 2013 18:29:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B21DF366; Mon, 27 May 2013 18:29:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RITVGg005611; Mon, 27 May 2013 18:29:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RITVN3005610; Mon, 27 May 2013 18:29:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305271829.r4RITVN3005610@svn.freebsd.org> From: Ed Schouten Date: Mon, 27 May 2013 18:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251036 - vendor/compiler-rt/compiler-rt-r182741 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:29:31 -0000 Author: ed Date: Mon May 27 18:29:31 2013 New Revision: 251036 URL: http://svnweb.freebsd.org/changeset/base/251036 Log: Tag compiler-rt r182741. Added: vendor/compiler-rt/compiler-rt-r182741/ - copied from r251035, vendor/compiler-rt/dist/ From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:31:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 16563A44; Mon, 27 May 2013 18:31:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A019386; Mon, 27 May 2013 18:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIVFZ7007600; Mon, 27 May 2013 18:31:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIVFb9007599; Mon, 27 May 2013 18:31:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271831.r4RIVFb9007599@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251037 - head/sys/amd64/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:31:16 -0000 Author: kib Date: Mon May 27 18:31:15 2013 New Revision: 251037 URL: http://svnweb.freebsd.org/changeset/base/251037 Log: The ia32_get_mcontext() does not need to set PCB_FULL_IRET. The usermode context state is not changed by the get operation, and get_mcontext() does not require full iret as well. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:29:31 2013 (r251036) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:31:15 2013 (r251037) @@ -187,7 +187,6 @@ ia32_get_mcontext(struct thread *td, str mcp->mc_xfpustate = 0; mcp->mc_xfpustate_len = 0; bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:36:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DBA9FD16; Mon, 27 May 2013 18:36:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF3BB3E4; Mon, 27 May 2013 18:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIakir008584; Mon, 27 May 2013 18:36:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIakt4008582; Mon, 27 May 2013 18:36:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271836.r4RIakt4008582@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251038 - head/sys/amd64/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:36:46 -0000 Author: kib Date: Mon May 27 18:36:46 2013 New Revision: 251038 URL: http://svnweb.freebsd.org/changeset/base/251038 Log: The _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit value on purpose, but the ia32 context handling code is logically more correct to use the _MC_IA32_HASFPXSTATE name for the flag. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:31:15 2013 (r251037) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:36:46 2013 (r251038) @@ -112,7 +112,7 @@ ia32_get_fpcontext(struct thread *td, st len = max_len; bzero(xfpusave + max_len, len - max_len); } - mcp->mc_flags |= _MC_HASFPXSTATE; + mcp->mc_flags |= _MC_IA32_HASFPXSTATE; mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); } From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:39:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 367D7F4C; Mon, 27 May 2013 18:39:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 109215E6; Mon, 27 May 2013 18:39:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIddB6009093; Mon, 27 May 2013 18:39:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIddXQ009090; Mon, 27 May 2013 18:39:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271839.r4RIddXQ009090@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251039 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:39:40 -0000 Author: kib Date: Mon May 27 18:39:39 2013 New Revision: 251039 URL: http://svnweb.freebsd.org/changeset/base/251039 Log: Use slightly more idiomatic expression to get the address of array. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/amd64/amd64/machdep.c Mon May 27 18:39:39 2013 (r251039) @@ -2278,7 +2278,7 @@ get_fpcontext(struct thread *td, mcontex size_t max_len, len; mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:39:39 2013 (r251039) @@ -101,7 +101,7 @@ ia32_get_fpcontext(struct thread *td, st * for now, it should be irrelevant for most applications. */ mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/i386/i386/machdep.c Mon May 27 18:39:39 2013 (r251039) @@ -3488,7 +3488,7 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif From owner-svn-src-all@FreeBSD.ORG Mon May 27 18:45:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEEDB335; Mon, 27 May 2013 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1CD662D; Mon, 27 May 2013 18:45:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIjjxJ011728; Mon, 27 May 2013 18:45:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIjjde011727; Mon, 27 May 2013 18:45:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271845.r4RIjjde011727@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251040 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 18:45:45 -0000 Author: kib Date: Mon May 27 18:45:45 2013 New Revision: 251040 URL: http://svnweb.freebsd.org/changeset/base/251040 Log: Partially apply the capitalization of the heading word of the sequence and fix typo. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon May 27 18:39:39 2013 (r251039) +++ head/lib/libthr/thread/thr_sig.c Mon May 27 18:45:45 2013 (r251040) @@ -205,9 +205,9 @@ handle_signal(struct sigaction *actp, in curthread->in_sigsuspend = 0; /* - * if thread is in deferred cancellation mode, disable cancellation + * If thread is in deferred cancellation mode, disable cancellation * in signal handler. - * if user signal handler calls a cancellation point function, e.g, + * If user signal handler calls a cancellation point function, e.g, * it calls write() to write data to file, because write() is a * cancellation point, the thread is immediately cancelled if * cancellation is pending, to avoid this problem while thread is in @@ -229,7 +229,7 @@ handle_signal(struct sigaction *actp, in * We have already reset cancellation point flags, so if user's code * longjmp()s out of its signal handler, wish its jmpbuf was set * outside of a cancellation point, in most cases, this would be - * true. however, ther is no way to save cancel_enable in jmpbuf, + * true. However, there is no way to save cancel_enable in jmpbuf, * so after setjmps() returns once more, the user code may need to * re-set cancel_enable flag by calling pthread_setcancelstate(). */ From owner-svn-src-all@FreeBSD.ORG Mon May 27 19:59:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FF88A4F; Mon, 27 May 2013 19:59:03 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) by mx1.freebsd.org (Postfix) with ESMTP id B9A6993F; Mon, 27 May 2013 19:59:02 +0000 (UTC) Received: by mail-oa0-f49.google.com with SMTP id k14so9241516oag.36 for ; Mon, 27 May 2013 12:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UbrEA/WpWXpaRKtMAt63r3kmQHeKdaLuAL5yf8BMCHI=; b=oTMMsSeNTHqHzb89opBns5uKpG79FqkcNibTk1S2F1CoHos/NbV+BxKrR6Yf0vClY8 yptaQ24sPEcNC+cBY2Gha/owEBI5auKF1r7x6npvDtZUEvSq3y7Y/ccCSZAvG9ZzUunj x2mLUmMFDtG5cOHZY4ky//ilCXzIPoo+FFNYrLJ2EuQ3GZmLttQmsBIhcBIM07o3rgpC CAQtDb5sd3VvD4G87blv0bLhz5Kmwm5G7mNPLbrb7J7mKnXZiwksU09ZmAVTvxBIyVvL XecG6LECWeMKNKjX8JKMn856Pg0nWNpnE89Dcj/1IFwqjifARVV/zkiYb5mv7vltEBts y8Ew== MIME-Version: 1.0 X-Received: by 10.60.155.209 with SMTP id vy17mr19593850oeb.83.1369684735089; Mon, 27 May 2013 12:58:55 -0700 (PDT) Received: by 10.76.90.10 with HTTP; Mon, 27 May 2013 12:58:55 -0700 (PDT) In-Reply-To: <20130527172326.GA6461@zim.MIT.EDU> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> <20130527172326.GA6461@zim.MIT.EDU> Date: Mon, 27 May 2013 15:58:55 -0400 Message-ID: Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun From: Ryan Stone To: David Schultz Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 19:59:03 -0000 On Mon, May 27, 2013 at 1:23 PM, David Schultz wrote: > If someone were to write or import a good test framework, > get all the tests to use it, and put together a test tinderbox, that > would have a lot of impact. > > People are working on bringing ATF into FreeBSD: https://wiki.freebsd.org/TestingFreeBSD From owner-svn-src-all@FreeBSD.ORG Mon May 27 20:01:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D0C7C4D; Mon, 27 May 2013 20:01:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9F795F; Mon, 27 May 2013 20:01:32 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B9F0F5C44; Mon, 27 May 2013 22:01:20 +0200 (CEST) Message-ID: <51A3BB8B.8020405@FreeBSD.org> Date: Mon, 27 May 2013 22:01:15 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Thunderbird/21.0 MIME-Version: 1.0 To: Steve Kargl , David Schultz Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> In-Reply-To: <20130527140722.GA43583@troutmask.apl.washington.edu> 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 20:01:32 -0000 On 2013-05-27 16:07, Steve Kargl wrote: > On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: >> Author: das >> Date: Mon May 27 08:50:10 2013 >> New Revision: 251024 >> URL: http://svnweb.freebsd.org/changeset/base/251024 >> >> Log: >> Fix some regressions caused by the switch from gcc to clang. The fixes >> are workarounds for various symptoms of the problem described in clang >> bugs 3929, 8100, 8241, 10409, and 12958. >> >> The regression tests did their job: they failed, someone brought it >> up on the mailing lists, and then the issue got ignored for 6 months. >> Oops. There may still be some regressions for functions we don't have >> test coverage for yet. >> > > The combination of clang+regression tests is almost unusable. > > % cd src/tools/regressions/lib/msun > % make |& tee sgk.log > % grep generated sgk.log > 41 warnings generated. > 1 warning generated. > 1 warning generated. > 593 warnings generated. > 51 warnings generated. > 1 warning generated. > 221 warnings generated. > 1 warning generated. > 265 warnings generated. > 84 warnings generated. > 1 warning generated. > 1 warning generated. > 2 warnings generated. > 74 warnings generated. The following should help. Results in just a few warnings now, which may or may not be real bugs: 1 warning generated. 1 warning generated. 2 warnings generated. 1 warning generated. Index: tools/regression/lib/msun/Makefile =================================================================== --- tools/regression/lib/msun/Makefile (revision 250997) +++ tools/regression/lib/msun/Makefile (working copy) @@ -5,6 +5,7 @@ test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm +CFLAGS+= -Wno-unused-value -Wno-unknown-pragmas .PHONY: tests tests: ${TESTS} From owner-svn-src-all@FreeBSD.ORG Mon May 27 20:43:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CF28C6E; Mon, 27 May 2013 20:43:16 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C21ECB29; Mon, 27 May 2013 20:43:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RKhG63051038; Mon, 27 May 2013 20:43:16 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RKhGV4051036; Mon, 27 May 2013 20:43:16 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201305272043.r4RKhGV4051036@svn.freebsd.org> From: Steve Kargl Date: Mon, 27 May 2013 20:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251041 - head/lib/msun/ld80 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 20:43:16 -0000 Author: kargl Date: Mon May 27 20:43:16 2013 New Revision: 251041 URL: http://svnweb.freebsd.org/changeset/base/251041 Log: * Update polynomial coefficients. * Use ENTERI/RETURNI to allow the use of FP_PE on i386 target. Reviewed by: das (and bde a long time ago) Approved by: das (mentor) Obtained from: bde (polynomial coefficients) Modified: head/lib/msun/ld80/s_exp2l.c Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 18:45:45 2013 (r251040) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 20:43:16 2013 (r251041) @@ -36,25 +36,31 @@ __FBSDID("$FreeBSD$"); #include "fpmath.h" #include "math.h" +#include "math_private.h" #define TBLBITS 7 #define TBLSIZE (1 << TBLBITS) #define BIAS (LDBL_MAX_EXP - 1) -#define EXPMASK (BIAS + LDBL_MAX_EXP) static volatile long double huge = 0x1p10000L, twom10000 = 0x1p-10000L; +static const union IEEEl2bits +P1 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309429e-1L); + static const double - redux = 0x1.8p63 / TBLSIZE, - P1 = 0x1.62e42fefa39efp-1, - P2 = 0x1.ebfbdff82c58fp-3, - P3 = 0x1.c6b08d7049fap-5, - P4 = 0x1.3b2ab6fba4da5p-7, - P5 = 0x1.5d8804780a736p-10, - P6 = 0x1.430918835e33dp-13; +redux = 0x1.8p63 / TBLSIZE, +/* + * Domain [-0.00390625, 0.00390625], range ~[-1.7079e-23, 1.7079e-23] + * |exp(x) - p(x)| < 2**-75.6 + */ +P2 = 2.4022650695910072e-1, /* 0x1ebfbdff82c58f.0p-55 */ +P3 = 5.5504108664816879e-2, /* 0x1c6b08d7049e1a.0p-57 */ +P4 = 9.6181291055695180e-3, /* 0x13b2ab6fa8321a.0p-59 */ +P5 = 1.3333563089183052e-3, /* 0x15d8806f67f251.0p-62 */ +P6 = 1.5413361552277414e-4; /* 0x1433ddacff3441.0p-65 */ static const double tbl[TBLSIZE * 2] = { 0x1.6a09e667f3bcdp-1, -0x1.bdd3413b2648p-55, @@ -187,8 +193,8 @@ static const double tbl[TBLSIZE * 2] = { 0x1.68155d44ca973p+0, 0x1.038ae44f74p-57, }; -/* - * exp2l(x): compute the base 2 exponential of x +/*- + * Compute the base 2 exponential of x for Intel 80-bit format. * * Accuracy: Peak error < 0.511 ulp. * @@ -204,7 +210,7 @@ static const double tbl[TBLSIZE * 2] = { * with |z| <= 2**-(TBLBITS+1). * * We compute exp2(i/TBLSIZE) via table lookup and exp2(z) via a - * degree-6 minimax polynomial with maximum error under 2**-69. + * degree-6 minimax polynomial with maximum error under 2**-75.6. * The table entries each have 104 bits of accuracy, encoded as * a pair of double precision values. */ @@ -219,30 +225,22 @@ exp2l(long double x) /* Filter out exceptional cases. */ u.e = x; hx = u.xbits.expsign; - ix = hx & EXPMASK; + ix = hx & 0x7fff; if (ix >= BIAS + 14) { /* |x| >= 16384 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { - if (u.xbits.man != 1ULL << 63 || (hx & 0x8000) == 0) - return (x + x); /* x is +Inf or NaN */ - else - return (0.0); /* x is -Inf */ + if (hx & 0x8000 && u.xbits.man == 1ULL << 63) + return (0.0L); /* x is -Inf */ + return (x + x); /* x is +Inf, NaN or unsupported */ } if (x >= 16384) return (huge * huge); /* overflow */ if (x <= -16446) return (twom10000 * twom10000); /* underflow */ - } else if (ix <= BIAS - 66) { /* |x| < 0x1p-66 */ - return (1.0 + x); + } else if (ix <= BIAS - 66) { /* |x| < 0x1p-65 (includes pseudos) */ + return (1.0L + x); /* 1 with inexact */ } -#ifdef __i386__ - /* - * The default precision on i386 is 53 bits, so long doubles are - * broken. Call exp2() to get an accurate (double precision) result. - */ - if (fpgetprec() != FP_PE) - return (exp2(x)); -#endif + ENTERI(); /* * Reduce x, computing z, i0, and k. The low bits of x + redux @@ -266,26 +264,25 @@ exp2l(long double x) z = x - u.e; v.xbits.man = 1ULL << 63; if (k >= LDBL_MIN_EXP) { - v.xbits.expsign = LDBL_MAX_EXP - 1 + k; + v.xbits.expsign = BIAS + k; twopk = v.e; } else { - v.xbits.expsign = LDBL_MAX_EXP - 1 + k + 10000; + v.xbits.expsign = BIAS + k + 10000; twopkp10000 = v.e; } /* Compute r = exp2l(y) = exp2lt[i0] * p(z). */ long double t_hi = tbl[i0]; long double t_lo = tbl[i0 + 1]; - /* XXX This gives > 1 ulp errors outside of FE_TONEAREST mode */ - r = t_lo + (t_hi + t_lo) * z * (P1 + z * (P2 + z * (P3 + z * (P4 + r = t_lo + (t_hi + t_lo) * z * (P1.e + z * (P2 + z * (P3 + z * (P4 + z * (P5 + z * P6))))) + t_hi; /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - return (r * 2.0 * 0x1p16383L); - return (r * twopk); + RETURNI(r * 2.0 * 0x1p16383L); + RETURNI(r * twopk); } else { - return (r * twopkp10000 * twom10000); + RETURNI(r * twopkp10000 * twom10000); } } From owner-svn-src-all@FreeBSD.ORG Mon May 27 21:37:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB53116A; Mon, 27 May 2013 21:37:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDCDBE85; Mon, 27 May 2013 21:37:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RLbJ7f068129; Mon, 27 May 2013 21:37:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RLbJK0068128; Mon, 27 May 2013 21:37:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305272137.r4RLbJK0068128@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 27 May 2013 21:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251042 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 21:37:20 -0000 Author: jilles Date: Mon May 27 21:37:19 2013 New Revision: 251042 URL: http://svnweb.freebsd.org/changeset/base/251042 Log: cap_rights_limit(2): CAP_ACCEPT also permits accept4(2). Modified: head/lib/libc/sys/cap_rights_limit.2 Modified: head/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- head/lib/libc/sys/cap_rights_limit.2 Mon May 27 20:43:16 2013 (r251041) +++ head/lib/libc/sys/cap_rights_limit.2 Mon May 27 21:37:19 2013 (r251042) @@ -77,7 +77,9 @@ The following rights may be specified in .Bl -tag -width CAP_EXTATTR_DELETE .It Dv CAP_ACCEPT Permit -.Xr accept 2 . +.Xr accept 2 +and +.Xr accept4 2 . .It Dv CAP_ACL_CHECK Permit checking of an ACL on a file descriptor; there is no cross-reference for this system call. From owner-svn-src-all@FreeBSD.ORG Mon May 27 22:18:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 782F8E85; Mon, 27 May 2013 22:18:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68405C9; Mon, 27 May 2013 22:18:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMI5pA081402; Mon, 27 May 2013 22:18:05 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMI47A081398; Mon, 27 May 2013 22:18:04 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305272218.r4RMI47A081398@svn.freebsd.org> From: Kirk McKusick Date: Mon, 27 May 2013 22:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251043 - stable/9/sbin/dumpfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:18:05 -0000 Author: mckusick Date: Mon May 27 22:18:04 2013 New Revision: 251043 URL: http://svnweb.freebsd.org/changeset/base/251043 Log: MFC of 250708: Clean up trailing whitespace. Submitted by: Andy Kosela MFC of 250710: When running the -m option to generate a newfs(8) command suitable for recreating the filesystem, check for and output the -i, -k, and -l options if appropriate. Note the remaining deficiencies of the -m option in the dumpfs(8) manual page. Specifically that newfs(8) options -E, -R, -S, and -T options are not handled and that -p is not useful so is omitted. Also document that newfs(8) options -n and -r are neither checked for nor output but should be. The -r flag is needed if the filesystem uses gjournal(8). PR: bin/163992 Reported by: Dieter Submitted by: Andy Kosela Modified: stable/9/sbin/dumpfs/dumpfs.8 stable/9/sbin/dumpfs/dumpfs.c Directory Properties: stable/9/sbin/dumpfs/ (props changed) Modified: stable/9/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.8 Mon May 27 21:37:19 2013 (r251042) +++ stable/9/sbin/dumpfs/dumpfs.8 Mon May 27 22:18:04 2013 (r251043) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Jul 14, 2011 +.Dd May 16, 2013 .Dt DUMPFS 8 .Os .Sh NAME @@ -76,6 +76,27 @@ is specified, a .Xr newfs 8 command is printed that can be used to generate a new file system with equivalent settings. +Please note that +.Xr newfs 8 +options +.Fl E , +.Fl R , +.Fl S , +and +.Fl T +are not handled and +.Fl p +is not useful in this case so is omitted. +.Xr Newfs 8 +options +.Fl n +and +.Fl r +are neither checked for nor output but should be. +The +.Fl r +flag is needed if the filesystem uses +.Xr gjournal 8 . .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , Modified: stable/9/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.c Mon May 27 21:37:19 2013 (r251042) +++ stable/9/sbin/dumpfs/dumpfs.c Mon May 27 22:18:04 2013 (r251043) @@ -197,15 +197,15 @@ dumpfs(const char *name) "maxbsize", afs.fs_maxbsize, afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize); printf("nbfree\t%jd\tndir\t%jd\tnifree\t%jd\tnffree\t%jd\n", - (intmax_t)afs.fs_cstotal.cs_nbfree, + (intmax_t)afs.fs_cstotal.cs_nbfree, (intmax_t)afs.fs_cstotal.cs_ndir, - (intmax_t)afs.fs_cstotal.cs_nifree, + (intmax_t)afs.fs_cstotal.cs_nifree, (intmax_t)afs.fs_cstotal.cs_nffree); printf("bpg\t%d\tfpg\t%d\tipg\t%d\tunrefs\t%jd\n", afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg, (intmax_t)afs.fs_unrefs); printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%ju\n", - afs.fs_nindir, afs.fs_inopb, + afs.fs_nindir, afs.fs_inopb, (uintmax_t)afs.fs_maxfilesize); printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%jd\tcssize\t%d\n", afs.fs_sbsize, afs.fs_cgsize, (intmax_t)afs.fs_csaddr, @@ -417,12 +417,15 @@ marshal(const char *name) printf("-f %d ", fs->fs_fsize); printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); - /* -i is dumb */ + printf("-i %jd ", fragroundup(fs, lblktosize(fs, fragstoblks(fs, + fs->fs_fpg)) / fs->fs_ipg)); if (fs->fs_flags & FS_SUJ) printf("-j "); if (fs->fs_flags & FS_GJOURNAL) printf("-J "); - /* -k..l unimplemented */ + printf("-k %jd ", fs->fs_metaspace); + if (fs->fs_flags & FS_MULTILABEL) + printf("-l "); printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); From owner-svn-src-all@FreeBSD.ORG Mon May 27 22:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7EE5FF9; Mon, 27 May 2013 22:19:02 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 88696D2; Mon, 27 May 2013 22:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMJ265081631; Mon, 27 May 2013 22:19:02 GMT (envelope-from gad@svn.freebsd.org) Received: (from gad@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMJ2lL081629; Mon, 27 May 2013 22:19:02 GMT (envelope-from gad@svn.freebsd.org) Message-Id: <201305272219.r4RMJ2lL081629@svn.freebsd.org> From: Garance A Drosehn Date: Mon, 27 May 2013 22:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251044 - head/usr.sbin/lpr/common_source X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:19:02 -0000 Author: gad Date: Mon May 27 22:19:01 2013 New Revision: 251044 URL: http://svnweb.freebsd.org/changeset/base/251044 Log: Change the closeallfds() routine to use closefrom() when it is available (closefrom() was added to FreeBSD in 8.0-release). The selection is made at compile-time, as I still compile a FreeBSD-based version of lpr&friends on other platforms. While testing I out that (at least on my system) lpd has been closing 11095 fd's, when there are only 6 fd's open. The old code took 120 times more clocktime than calling closefrom(). (although that was still less than 2/1000-ths of a second!) Reviewed by: jilles MFC after: 2 weeks Modified: head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/common_source/lp.cdefs.h Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Mon May 27 22:18:04 2013 (r251043) +++ head/usr.sbin/lpr/common_source/common.c Mon May 27 22:19:01 2013 (r251044) @@ -757,16 +757,22 @@ fatal(const struct printer *pp, const ch /* * Close all file descriptors from START on up. - * This is a horrific kluge, since getdtablesize() might return - * ``infinity'', in which case we will be spending a long time - * closing ``files'' which were never open. Perhaps it would - * be better to close the first N fds, for some small value of N. */ void closeallfds(int start) { - int stop = getdtablesize(); - for (; start < stop; start++) - close(start); + int stop; + + if (USE_CLOSEFROM) /* The faster, modern solution */ + closefrom(start); + else { + /* This older logic can be pretty awful on some OS's. The + * getdtablesize() might return ``infinity'', and then this + * will waste a lot of time closing file descriptors which + * had never been open()-ed. */ + stop = getdtablesize(); + for (; start < stop; start++) + close(start); + } } Modified: head/usr.sbin/lpr/common_source/lp.cdefs.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.cdefs.h Mon May 27 22:18:04 2013 (r251043) +++ head/usr.sbin/lpr/common_source/lp.cdefs.h Mon May 27 22:19:01 2013 (r251044) @@ -1,6 +1,6 @@ /*- * ------+---------+---------+---------+---------+---------+---------+---------* - * Copyright (c) 2003 - Garance Alistair Drosehn . + * Copyright (c) 2003,2013 - Garance Alistair Drosehn . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,21 @@ #endif /* + * FreeBSD added a closefrom() routine in release 8.0. When compiling + * `lpr' on other platforms you might want to include bsd-closefrom.c + * from the portable-openssh project. + */ +#ifndef USE_CLOSEFROM +# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# define USE_CLOSEFROM 1 +# endif +#endif +/* The macro USE_CLOSEFROM must be defined with a value of 0 or 1. */ +#ifndef USE_CLOSEFROM +# define USE_CLOSEFROM 0 +#endif + +/* * __unused is a compiler-specific trick which can be used to avoid * warnings about a variable which is defined but never referenced. * Some lpr files use this, so define a null version if it was not From owner-svn-src-all@FreeBSD.ORG Mon May 27 22:41:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB90A5EC; Mon, 27 May 2013 22:41:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE39183; Mon, 27 May 2013 22:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMfiER090356; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMfiwV090353; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305272241.r4RMfiwV090353@svn.freebsd.org> From: Kirk McKusick Date: Mon, 27 May 2013 22:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251045 - stable/8/sbin/dumpfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:41:44 -0000 Author: mckusick Date: Mon May 27 22:41:43 2013 New Revision: 251045 URL: http://svnweb.freebsd.org/changeset/base/251045 Log: MFC of 250708: Clean up trailing whitespace. Submitted by: Andy Kosela MFC of 250710: (delete addition of -k which does not exist in 8-stable) When running the -m option to generate a newfs(8) command suitable for recreating the filesystem, check for and output the -i, -k, and -l options if appropriate. Note the remaining deficiencies of the -m option in the dumpfs(8) manual page. Specifically that newfs(8) options -E, -R, -S, and -T options are not handled and that -p is not useful so is omitted. Also document that newfs(8) options -n and -r are neither checked for nor output but should be. The -r flag is needed if the filesystem uses gjournal(8). PR: bin/163992 Reported by: Dieter Submitted by: Andy Kosela Modified: stable/8/sbin/dumpfs/dumpfs.8 stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:41:43 2013 (r251045) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Jul 14, 2011 +.Dd May 16, 2013 .Dt DUMPFS 8 .Os .Sh NAME @@ -76,6 +76,27 @@ is specified, a .Xr newfs 8 command is printed that can be used to generate a new file system with equivalent settings. +Please note that +.Xr newfs 8 +options +.Fl E , +.Fl R , +.Fl S , +and +.Fl T +are not handled and +.Fl p +is not useful in this case so is omitted. +.Xr Newfs 8 +options +.Fl n +and +.Fl r +are neither checked for nor output but should be. +The +.Fl r +flag is needed if the filesystem uses +.Xr gjournal 8 . .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:41:43 2013 (r251045) @@ -197,15 +197,15 @@ dumpfs(const char *name) "maxbsize", afs.fs_maxbsize, afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize); printf("nbfree\t%jd\tndir\t%jd\tnifree\t%jd\tnffree\t%jd\n", - (intmax_t)afs.fs_cstotal.cs_nbfree, + (intmax_t)afs.fs_cstotal.cs_nbfree, (intmax_t)afs.fs_cstotal.cs_ndir, - (intmax_t)afs.fs_cstotal.cs_nifree, + (intmax_t)afs.fs_cstotal.cs_nifree, (intmax_t)afs.fs_cstotal.cs_nffree); printf("bpg\t%d\tfpg\t%d\tipg\t%d\tunrefs\t%jd\n", afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg, (intmax_t)afs.fs_unrefs); printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%ju\n", - afs.fs_nindir, afs.fs_inopb, + afs.fs_nindir, afs.fs_inopb, (uintmax_t)afs.fs_maxfilesize); printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%jd\tcssize\t%d\n", afs.fs_sbsize, afs.fs_cgsize, (intmax_t)afs.fs_csaddr, @@ -416,8 +416,13 @@ marshal(const char *name) printf("-f %d ", fs->fs_fsize); printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); - /* -i is dumb */ - /* -j..l unimplemented */ + printf("-i %jd ", fragroundup(fs, lblktosize(fs, fragstoblks(fs, + fs->fs_fpg)) / fs->fs_ipg)); + /* -j..k unimplemented */ + if (fs->fs_flags & FS_GJOURNAL) + printf("-J "); + if (fs->fs_flags & FS_MULTILABEL) + printf("-l "); printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); From owner-svn-src-all@FreeBSD.ORG Mon May 27 22:45:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 932B0771; Mon, 27 May 2013 22:45:05 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85936198; Mon, 27 May 2013 22:45:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMj5QL090957; Mon, 27 May 2013 22:45:05 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMj5Q7090956; Mon, 27 May 2013 22:45:05 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201305272245.r4RMj5Q7090956@svn.freebsd.org> From: Steve Kargl Date: Mon, 27 May 2013 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251046 - head/lib/msun/ld80 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:45:05 -0000 Author: kargl Date: Mon May 27 22:45:05 2013 New Revision: 251046 URL: http://svnweb.freebsd.org/changeset/base/251046 Log: Style(9) Approved by: das (implicit) Reported by: jh Modified: head/lib/msun/ld80/s_exp2l.c Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 22:41:43 2013 (r251045) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 22:45:05 2013 (r251046) @@ -193,7 +193,7 @@ static const double tbl[TBLSIZE * 2] = { 0x1.68155d44ca973p+0, 0x1.038ae44f74p-57, }; -/*- +/** * Compute the base 2 exponential of x for Intel 80-bit format. * * Accuracy: Peak error < 0.511 ulp. From owner-svn-src-all@FreeBSD.ORG Tue May 28 02:01:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B6454CB; Tue, 28 May 2013 02:01:24 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1.freebsd.org (Postfix) with ESMTP id 152F7E24; Tue, 28 May 2013 02:01:23 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id tj12so2396630pac.18 for ; Mon, 27 May 2013 19:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=rtu7KhvG2zqRnUaiWcsfV9RfRdGY3Kfab7DcJhMouZQ=; b=ob193KOiOde8iobEAkFyFHTCX2SpRFedp14l2jZAcG43Ut4dsJKdsIRk71NGp/fsbE GgHAXHHM3DTRkUxDlBfViW1ciSV741tJ19aSFMyHDLGUT+vPBQm6EzFfaNfceUoJQMF8 k2PW+Sfi1wJJTddnqzyy/GIVWC94tGhioit5gh/8f0ClCyg49gMhnqcId42b4Due4ov/ ZuFfHto9WoYo4meV6SVgpv4+mqgq6G7KtO2wsIuM9g6JNagF6Apce9Tnrkn/4y8cgU3F VqrdMP12YsEZjU+tyIVFiu7A4Bf0BXA5YWIGZVoF6TCyPA/ZL5h/FADwGhW4RDGhESLL 1OZQ== X-Received: by 10.68.180.4 with SMTP id dk4mr31569006pbc.104.1369706476396; Mon, 27 May 2013 19:01:16 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id lq4sm32825690pab.19.2013.05.27.19.01.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 19:01:14 -0700 (PDT) Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: Date: Mon, 27 May 2013 19:01:12 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <13D68565-6ED3-44F2-82A9-E94F53C6C95A@gmail.com> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> <20130527172326.GA6461@zim.MIT.EDU> To: Ryan Stone X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, svn-src-all@freebsd.org, Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 02:01:24 -0000 On May 27, 2013, at 12:58 PM, Ryan Stone wrote: > On Mon, May 27, 2013 at 1:23 PM, David Schultz = wrote: >=20 >> If someone were to write or import a good test framework, >> get all the tests to use it, and put together a test tinderbox, that >> would have a lot of impact. >>=20 >>=20 > People are working on bringing ATF into FreeBSD: >=20 > https://wiki.freebsd.org/TestingFreeBSD Thanks for the plug! Yes, ATF is in (it's a bit outdated so I'll have to submit a patch for = ATF 0.17), build infrastructure's on its way, and the best news of all = is that I've already ported a large chunk of the msun testcases from = NetBSD to FreeBSD. They work with little hacking for the most part. = Example: # cd /usr/src/lib/msun/tests/ # make obj depend all check Summary for 19 test programs: 295 passed test cases. 0 failed test cases. 0 expected failed test cases. 5 skipped test cases. *** The verbatim output of atf-run has been saved to = /usr/obj/usr/src/lib/msun/tests/atf-run.log # Why isn't this in FreeBSD yet (along with some of the other testsuites = from NetBSD)? Well, a couple of reasons: 1. The test build infrastructure changes haven't been fully pushed in = (Marcel's helping me out with the latest set of patches). 2. There are issues with porting stuff over from NetBSD because some of = the macros needed to minimize porting divergence don't have a happy home = yet. I gently poked several people from FreeBSD, NetBSD, and OpenBSD = about getting some degree of solidarity and agreement on macros, but I = haven't heard back from anyone I emailed for several weeks. So I figure = that FreeBSD needs to bend by adding some [compat] macros to strategic = locations in sys/sys, and then we can work on standardizing things = later. I really don't want to hack all of the tests to use libnetbsd = because while it works for nmtree and nmakefs, it doesn't make sense for = testcases as the volume of required changes wouldn't make sense from a = porting perspective. 3. I really REALLY need help porting over changes we've added that can = be contributed back to NetBSD, and FreeBSD specific tests need to be = cordoned off properly. As far as the test image stuff is concerned and test tinderbox stuff is = concerned, yes, it's on my radar.. I'm working on installing tests via = .iso images and USB images; once that's done we can work on making the = other testing stuff work on a cron basis via tinderbox or another = similar mechanism. So, what say ye to making things work better and helping me in this = process :)? Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Tue May 28 04:54:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67F4E3CF; Tue, 28 May 2013 04:54:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49B627FB; Tue, 28 May 2013 04:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S4sJkA014292; Tue, 28 May 2013 04:54:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S4sHHn014272; Tue, 28 May 2013 04:54:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280454.r4S4sHHn014272@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 04:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251047 - in head: lib/libc/amd64/gen lib/libc/arm/gen lib/libc/gen lib/libc/i386/gen lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sparc64/ge... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 04:54:19 -0000 Author: kib Date: Tue May 28 04:54:16 2013 New Revision: 251047 URL: http://svnweb.freebsd.org/changeset/base/251047 Log: The getcontext() from the __fillcontextx() call in the check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Modified: head/lib/libc/amd64/gen/getcontextx.c head/lib/libc/arm/gen/getcontextx.c head/lib/libc/gen/Symbol.map head/lib/libc/i386/gen/getcontextx.c head/lib/libc/ia64/gen/getcontextx.c head/lib/libc/mips/gen/getcontextx.c head/lib/libc/powerpc/gen/getcontextx.c head/lib/libc/powerpc64/gen/getcontextx.c head/lib/libc/sparc64/gen/getcontextx.c head/lib/libthr/thread/thr_sig.c head/sys/sys/ucontext.h Modified: head/lib/libc/amd64/gen/getcontextx.c ============================================================================== --- head/lib/libc/amd64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/amd64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -57,14 +57,12 @@ __getcontextx_size(void) } int -__fillcontextx(char *ctx) +__fillcontextx2(char *ctx) { struct amd64_get_xfpustate xfpu; ucontext_t *ucp; ucp = (ucontext_t *)ctx; - if (getcontext(ucp) == -1) - return (-1); if (xstate_sz != 0) { xfpu.addr = (char *)(ucp + 1); xfpu.len = xstate_sz; @@ -80,6 +78,18 @@ __fillcontextx(char *ctx) return (0); } +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + __weak_reference(__getcontextx, getcontextx); ucontext_t * Modified: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- head/lib/libc/arm/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/arm/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/gen/Symbol.map Tue May 28 04:54:16 2013 (r251047) @@ -529,5 +529,6 @@ FBSDprivate_1.0 { __elf_aux_vector; __pthread_map_stacks_exec; __fillcontextx; + __fillcontextx2; __getcontextx_size; }; Modified: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- head/lib/libc/i386/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/i386/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -89,14 +89,12 @@ __getcontextx_size(void) } int -__fillcontextx(char *ctx) +__fillcontextx2(char *ctx) { struct i386_get_xfpustate xfpu; ucontext_t *ucp; ucp = (ucontext_t *)ctx; - if (getcontext(ucp) == -1) - return (-1); if (xstate_sz != 0) { xfpu.addr = (char *)(ucp + 1); xfpu.len = xstate_sz; @@ -112,6 +110,18 @@ __fillcontextx(char *ctx) return (0); } +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + __weak_reference(__getcontextx, getcontextx); ucontext_t * Modified: head/lib/libc/ia64/gen/getcontextx.c ============================================================================== --- head/lib/libc/ia64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/ia64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/mips/gen/getcontextx.c ============================================================================== --- head/lib/libc/mips/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/mips/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/powerpc/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/powerpc/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/powerpc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/powerpc64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/sparc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/sparc64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/sparc64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libthr/thread/thr_sig.c Tue May 28 04:54:16 2013 (r251047) @@ -323,8 +323,13 @@ check_deferred_signal(struct pthread *cu return; #if defined(__amd64__) || defined(__i386__) - uc = alloca(__getcontextx_size()); - __fillcontextx((char *)uc); + int uc_len; + uc_len = __getcontextx_size(); + uc = alloca(uc_len); + getcontext(uc); + if (curthread->deferred_siginfo.si_signo == 0) + return; + __fillcontextx2((char *)uc); #else ucontext_t ucv; uc = &ucv; Modified: head/sys/sys/ucontext.h ============================================================================== --- head/sys/sys/ucontext.h Mon May 27 22:45:05 2013 (r251046) +++ head/sys/sys/ucontext.h Tue May 28 04:54:16 2013 (r251047) @@ -80,7 +80,8 @@ int swapcontext(ucontext_t *, const ucon #if __BSD_VISIBLE int __getcontextx_size(void); -int __fillcontextx(char *ctx); +int __fillcontextx(char *ctx) __returns_twice; +int __fillcontextx2(char *ctx); #endif __END_DECLS From owner-svn-src-all@FreeBSD.ORG Tue May 28 05:22:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ACD11BA5; Tue, 28 May 2013 05:22:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F76E8E0; Tue, 28 May 2013 05:22:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5MjYG023968; Tue, 28 May 2013 05:22:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5Mj09023967; Tue, 28 May 2013 05:22:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280522.r4S5Mj09023967@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251048 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:22:45 -0000 Author: kib Date: Tue May 28 05:22:45 2013 New Revision: 251048 URL: http://svnweb.freebsd.org/changeset/base/251048 Log: MFC r250849: Add ddb command 'show pginfo'. Modified: stable/9/sys/vm/vm_page.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Tue May 28 04:54:16 2013 (r251047) +++ stable/9/sys/vm/vm_page.c Tue May 28 05:22:45 2013 (r251048) @@ -2915,4 +2915,27 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag *vm_page_queues[PQ_ACTIVE].cnt, *vm_page_queues[PQ_INACTIVE].cnt); } + +DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) +{ + vm_page_t m; + boolean_t phys; + + if (!have_addr) { + db_printf("show pginfo addr\n"); + return; + } + + phys = strchr(modif, 'p') != NULL; + if (phys) + m = PHYS_TO_VM_PAGE(addr); + else + m = (vm_page_t)addr; + db_printf( + "page %p obj %p pidx 0x%jx phys 0x%jx q %d hold %d wire %d\n" + " af 0x%x of 0x%x f 0x%x act %d busy %d valid 0x%x dirty 0x%x\n", + m, m->object, (uintmax_t)m->pindex, (uintmax_t)m->phys_addr, + m->queue, m->hold_count, m->wire_count, m->aflags, m->oflags, + m->flags, m->act_count, m->busy, m->valid, m->dirty); +} #endif /* DDB */ From owner-svn-src-all@FreeBSD.ORG Tue May 28 05:25:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 40EE8D28; Tue, 28 May 2013 05:25:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 338FE8F2; Tue, 28 May 2013 05:25:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5PB8t024448; Tue, 28 May 2013 05:25:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5PBl8024447; Tue, 28 May 2013 05:25:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280525.r4S5PBl8024447@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251049 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:25:11 -0000 Author: kib Date: Tue May 28 05:25:10 2013 New Revision: 251049 URL: http://svnweb.freebsd.org/changeset/base/251049 Log: MFC r250850: Add amd64-specific ddb command 'show phys2dmap'. Modified: stable/9/sys/amd64/amd64/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Tue May 28 05:22:45 2013 (r251048) +++ stable/9/sys/amd64/amd64/pmap.c Tue May 28 05:25:10 2013 (r251049) @@ -5543,4 +5543,16 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) pte = pmap_pde_to_pte(pde, va); db_printf(" pte %#016lx\n", *pte); } + +DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) +{ + vm_paddr_t a; + + if (have_addr) { + a = (vm_paddr_t)addr; + db_printf("0x%jx\n", (uintmax_t)PHYS_TO_DMAP(a)); + } else { + db_printf("show phys2dmap addr\n"); + } +} #endif From owner-svn-src-all@FreeBSD.ORG Tue May 28 05:36:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CCB8B256; Tue, 28 May 2013 05:36:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF3C894E; Tue, 28 May 2013 05:36:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5aJv0027996; Tue, 28 May 2013 05:36:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5aIbR027992; Tue, 28 May 2013 05:36:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280536.r4S5aIbR027992@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251050 - in stable/9/sys/amd64: amd64 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:36:19 -0000 Author: kib Date: Tue May 28 05:36:18 2013 New Revision: 251050 URL: http://svnweb.freebsd.org/changeset/base/251050 Log: MFC r250851: Fix the hardware watchpoints on SMP amd64. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/amd64/include/md_var.h stable/9/sys/amd64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/amd64/db_trace.c Tue May 28 05:36:18 2013 (r251050) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,6 +64,8 @@ static db_varfcn_t db_frame; static db_varfcn_t db_rsp; static db_varfcn_t db_ss; +CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); + /* * Machine register set. */ @@ -591,64 +594,82 @@ db_md_set_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int avail, i, wsize; + struct dbreg *d; + struct pcpu *pc; + int avail, c, cpu, i, wsize; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); avail = 0; - for(i = 0; i < 4; i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) + for (i = 0; i < 4; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) avail++; } if (avail * 8 < size) return (-1); - for (i = 0; i < 4 && (size > 0); i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) { + for (i = 0; i < 4 && size > 0; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) { if (size >= 8 || (avail == 1 && size > 4)) wsize = 8; else if (size > 2) wsize = 4; else wsize = size; - amd64_set_watch(i, addr, wsize, - DBREG_DR7_WRONLY, &d); + amd64_set_watch(i, addr, wsize, DBREG_DR7_WRONLY, d); addr += wsize; size -= wsize; avail--; } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } - int db_md_clr_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int i; + struct dbreg *d; + struct pcpu *pc; + int i, c, cpu; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); - for(i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - if ((DBREG_DRX((&d), i) >= addr) && - (DBREG_DRX((&d), i) < addr+size)) - amd64_clr_watch(i, &d); + for (i = 0; i < 4; i++) { + if (DBREG_DR7_ENABLED(d->dr[7], i)) { + if (DBREG_DRX((d), i) >= addr && + DBREG_DRX((d), i) < addr + size) + amd64_clr_watch(i, d); } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } @@ -699,3 +720,17 @@ db_md_list_watchpoints() } db_printf("\n"); } + +void +amd64_db_resume_dbreg(void) +{ + struct dbreg *d; + + switch (PCPU_GET(dbreg_cmd)) { + case PC_DBREG_CMD_LOAD: + d = (struct dbreg *)PCPU_PTR(dbreg); + set_dbregs(NULL, d); + PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); + break; + } +} Modified: stable/9/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/mp_machdep.c Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/amd64/mp_machdep.c Tue May 28 05:36:18 2013 (r251050) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_sched.h" #include "opt_smp.h" @@ -1397,6 +1398,10 @@ cpustop_handler(void) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); +#ifdef DDB + amd64_db_resume_dbreg(); +#endif + if (cpu == 0 && cpustop_restartfunc != NULL) { cpustop_restartfunc(); cpustop_restartfunc = NULL; Modified: stable/9/sys/amd64/include/md_var.h ============================================================================== --- stable/9/sys/amd64/include/md_var.h Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/include/md_var.h Tue May 28 05:36:18 2013 (r251050) @@ -117,5 +117,6 @@ void minidumpsys(struct dumperinfo *); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); struct pcb *get_pcb_td(struct thread *td); +void amd64_db_resume_dbreg(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: stable/9/sys/amd64/include/pcpu.h ============================================================================== --- stable/9/sys/amd64/include/pcpu.h Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/include/pcpu.h Tue May 28 05:36:18 2013 (r251050) @@ -77,7 +77,12 @@ /* Pointer to the CPU TSS descriptor */ \ struct system_segment_descriptor *pc_tss; \ u_int pc_cmci_mask /* MCx banks for CMCI */ \ - PCPU_XEN_FIELDS + PCPU_XEN_FIELDS; \ + uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ + int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ + +#define PC_DBREG_CMD_NONE 0 +#define PC_DBREG_CMD_LOAD 1 #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue May 28 05:51:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 293B3625; Tue, 28 May 2013 05:51:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD33FA19; Tue, 28 May 2013 05:51:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5p16X033561; Tue, 28 May 2013 05:51:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5p1Uh033547; Tue, 28 May 2013 05:51:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280551.r4S5p1Uh033547@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251051 - in stable/9/sys: compat/freebsd32 kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:51:02 -0000 Author: kib Date: Tue May 28 05:51:00 2013 New Revision: 251051 URL: http://svnweb.freebsd.org/changeset/base/251051 Log: MFC r250853: Fix the wait6(2) on 32bit architectures and for the compat32, by using the right type for the argument in syscalls.master. Also fix the posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the architectures which require padding of the 64bit argument. Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/syscalls.master Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Tue May 28 05:51:00 2013 (r251051) @@ -192,8 +192,8 @@ freebsd32_wait6(struct thread *td, struc bzero(sip, sizeof(*sip)); } else sip = NULL; - error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options, - wrup, sip); + error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id), + &status, uap->options, wrup, sip); if (error != 0) return (error); if (uap->status != NULL) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/compat/freebsd32/syscalls.master Tue May 28 05:51:00 2013 (r251051) @@ -990,6 +990,22 @@ 529 AUE_NULL NOPROTO { int rctl_remove_rule(const void *inbufp, \ size_t inbuflen, void *outbufp, \ size_t outbuflen); } +#ifdef PAD64_REQUIRED +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2); } +531 AUE_NULL STD { int freebsd32_posix_fadvise(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2, \ + int advice); } +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int pad, \ + uint32_t id1, uint32_t id2, \ + int *status, int options, \ + struct wrusage32 *wrusage, \ + siginfo_t *info); } +#else 530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2); } @@ -997,8 +1013,9 @@ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } -532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, \ + uint32_t id1, uint32_t id2, \ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } - +#endif Modified: stable/9/sys/kern/syscalls.master ============================================================================== --- stable/9/sys/kern/syscalls.master Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/kern/syscalls.master Tue May 28 05:51:00 2013 (r251051) @@ -948,7 +948,7 @@ off_t offset, off_t len); } 531 AUE_NULL STD { int posix_fadvise(int fd, off_t offset, \ off_t len, int advice); } -532 AUE_WAIT6 STD { int wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int wait6(int idtype, id_t id, \ int *status, int options, \ struct __wrusage *wrusage, \ siginfo_t *info); } From owner-svn-src-all@FreeBSD.ORG Tue May 28 05:52:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF62A8BF; Tue, 28 May 2013 05:52:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C03D8A28; Tue, 28 May 2013 05:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5q5dG033855; Tue, 28 May 2013 05:52:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5q3pS033834; Tue, 28 May 2013 05:52:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280552.r4S5q3pS033834@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251052 - in stable/9/sys: compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:52:06 -0000 Author: kib Date: Tue May 28 05:52:03 2013 New Revision: 251052 URL: http://svnweb.freebsd.org/changeset/base/251052 Log: Regenerate. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c stable/9/sys/kern/init_sysent.c stable/9/sys/kern/syscalls.c stable/9/sys/kern/systrace_args.c stable/9/sys/sys/syscall.h stable/9/sys/sys/syscall.mk stable/9/sys/sys/sysproto.h Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -573,8 +573,10 @@ struct freebsd32_pselect_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +#ifdef PAD64_REQUIRED struct freebsd32_posix_fallocate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -582,6 +584,7 @@ struct freebsd32_posix_fallocate_args { }; struct freebsd32_posix_fadvise_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -590,12 +593,40 @@ struct freebsd32_posix_fadvise_args { }; struct freebsd32_wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +#else +struct freebsd32_posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; +}; +struct freebsd32_posix_fadvise_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; +struct freebsd32_wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; +#endif #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -705,9 +736,15 @@ int freebsd32_semctl(struct thread *, st int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); +#ifdef PAD64_REQUIRED +int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); +int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); +int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#else int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#endif #ifdef COMPAT_43 @@ -776,6 +813,9 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); @@ -841,6 +881,9 @@ struct freebsd4_freebsd32_sigreturn_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd4_freebsd32_getfsstat(struct thread *, struct freebsd4_freebsd32_getfsstat_args *); int freebsd4_freebsd32_statfs(struct thread *, struct freebsd4_freebsd32_statfs_args *); int freebsd4_freebsd32_fstatfs(struct thread *, struct freebsd4_freebsd32_fstatfs_args *); @@ -908,6 +951,9 @@ struct freebsd6_freebsd32_ftruncate_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd6_freebsd32_pread(struct thread *, struct freebsd6_freebsd32_pread_args *); int freebsd6_freebsd32_pwrite(struct thread *, struct freebsd6_freebsd32_pwrite_args *); int freebsd6_freebsd32_mmap(struct thread *, struct freebsd6_freebsd32_mmap_args *); @@ -945,6 +991,9 @@ struct freebsd7_freebsd32_shmctl_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *); int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); @@ -1085,6 +1134,9 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -426,4 +426,7 @@ #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_freebsd32_posix_fallocate 530 +#define FREEBSD32_SYS_freebsd32_posix_fadvise 531 +#define FREEBSD32_SYS_freebsd32_wait6 532 #define FREEBSD32_SYS_MAXSYSCALL 533 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ const char *freebsd32_syscallnames[] = { @@ -553,7 +553,13 @@ const char *freebsd32_syscallnames[] = { "rctl_get_limits", /* 527 = rctl_get_limits */ "rctl_add_rule", /* 528 = rctl_add_rule */ "rctl_remove_rule", /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ + "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ + "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#else "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#endif }; Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #include "opt_compat.h" @@ -590,7 +590,13 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#else { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#endif }; Modified: stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 28 05:52:03 2013 (r251052) @@ -3023,6 +3023,47 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } +#ifdef PAD64_REQUIRED + /* freebsd32_posix_fallocate */ + case 530: { + struct freebsd32_posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + *n_args = 6; + break; + } + /* freebsd32_posix_fadvise */ + case 531: { + struct freebsd32_posix_fadvise_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + iarg[6] = p->advice; /* int */ + *n_args = 7; + break; + } + /* freebsd32_wait6 */ + case 532: { + struct freebsd32_wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ + uarg[4] = (intptr_t) p->status; /* int * */ + iarg[5] = p->options; /* int */ + uarg[6] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[7] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 8; + break; + } +#else /* freebsd32_posix_fallocate */ case 530: { struct freebsd32_posix_fallocate_args *p = params; @@ -3050,14 +3091,16 @@ systrace_args(int sysnum, void *params, case 532: { struct freebsd32_wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ - uarg[2] = (intptr_t) p->status; /* int * */ - iarg[3] = p->options; /* int */ - uarg[4] = (intptr_t) p->wrusage; /* struct wrusage32 * */ - uarg[5] = (intptr_t) p->info; /* siginfo_t * */ - *n_args = 6; + uarg[1] = p->id1; /* uint32_t */ + uarg[2] = p->id2; /* uint32_t */ + uarg[3] = (intptr_t) p->status; /* int * */ + iarg[4] = p->options; /* int */ + uarg[5] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[6] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 7; break; } +#endif default: *n_args = 0; break; @@ -8095,6 +8138,7 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; +#ifdef PAD64_REQUIRED /* freebsd32_posix_fallocate */ case 530: switch(ndx) { @@ -8102,7 +8146,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8113,6 +8157,9 @@ systrace_setargdesc(int sysnum, int ndx, case 4: p = "uint32_t"; break; + case 5: + p = "uint32_t"; + break; default: break; }; @@ -8124,7 +8171,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8136,6 +8183,9 @@ systrace_setargdesc(int sysnum, int ndx, p = "uint32_t"; break; case 5: + p = "uint32_t"; + break; + case 6: p = "int"; break; default: @@ -8152,21 +8202,104 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: p = "int *"; break; + case 5: + p = "int"; + break; + case 6: + p = "struct wrusage32 *"; + break; + case 7: + p = "siginfo_t *"; + break; + default: + break; + }; + break; +#else + /* freebsd32_posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; + /* freebsd32_posix_fadvise */ + case 531: + switch(ndx) { + case 0: p = "int"; break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; case 4: - p = "struct wrusage32 *"; + p = "uint32_t"; break; case 5: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "int *"; + break; + case 4: + p = "int"; + break; + case 5: + p = "struct wrusage32 *"; + break; + case 6: p = "siginfo_t *"; break; default: break; }; break; +#endif default: break; }; Modified: stable/9/sys/kern/init_sysent.c ============================================================================== --- stable/9/sys/kern/init_sysent.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/init_sysent.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #include "opt_compat.h" Modified: stable/9/sys/kern/syscalls.c ============================================================================== --- stable/9/sys/kern/syscalls.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/syscalls.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ const char *syscallnames[] = { Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/systrace_args.c Tue May 28 05:52:03 2013 (r251052) @@ -3248,7 +3248,7 @@ systrace_args(int sysnum, void *params, case 532: { struct wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ + iarg[1] = p->id; /* id_t */ uarg[2] = (intptr_t) p->status; /* int * */ iarg[3] = p->options; /* int */ uarg[4] = (intptr_t) p->wrusage; /* struct __wrusage * */ @@ -8651,7 +8651,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "int"; + p = "id_t"; break; case 2: p = "int *"; Modified: stable/9/sys/sys/syscall.h ============================================================================== --- stable/9/sys/sys/syscall.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/syscall.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #define SYS_syscall 0 Modified: stable/9/sys/sys/syscall.mk ============================================================================== --- stable/9/sys/sys/syscall.mk Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/syscall.mk Tue May 28 05:52:03 2013 (r251052) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib +# created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib MIASM = \ syscall.o \ exit.o \ Modified: stable/9/sys/sys/sysproto.h ============================================================================== --- stable/9/sys/sys/sysproto.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/sysproto.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1741,7 +1741,7 @@ struct posix_fadvise_args { }; struct wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)]; From owner-svn-src-all@FreeBSD.ORG Tue May 28 08:50:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EF0080E; Tue, 28 May 2013 08:50:51 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF523F7; Tue, 28 May 2013 08:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S8opMe092586; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S8opvu092585; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201305280850.r4S8opvu092585@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 May 2013 08:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251053 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 08:50:51 -0000 Author: tijl Date: Tue May 28 08:50:50 2013 New Revision: 251053 URL: http://svnweb.freebsd.org/changeset/base/251053 Log: Fix cexp regression tests that have an infinite real part. The signs of the result depend on the cosine and sine of the imaginary part. Small values are used in the new tests such that cosine and sine are well defined. Reviewed by: das Modified: head/tools/regression/lib/msun/test-cexp.c Modified: head/tools/regression/lib/msun/test-cexp.c ============================================================================== --- head/tools/regression/lib/msun/test-cexp.c Tue May 28 05:52:03 2013 (r251052) +++ head/tools/regression/lib/msun/test-cexp.c Tue May 28 08:50:50 2013 (r251053) @@ -110,7 +110,7 @@ cpackl(long double x, long double y) /* Various finite non-zero numbers to test. */ static const float finites[] = -{ -42.0e20, -1.0 -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; +{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; /* * Determine whether x and y are equal, with two special rules: @@ -228,21 +228,35 @@ test_inf(void) int i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ - /* cexp(inf + yi) = 0 + 0yi */ - /* cexp(-inf + yi) = inf + inf yi (except y=0) */ for (i = 0; i < N(finites); i++) { testall(cpackl(finites[i], INFINITY), cpackl(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); - /* XXX shouldn't raise an inexact exception */ - testall(cpackl(-INFINITY, finites[i]), - cpackl(0.0, 0.0 * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - if (finites[i] == 0) - continue; - testall(cpackl(INFINITY, finites[i]), - cpackl(INFINITY, INFINITY * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } + /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(-INFINITY, M_PI_4), cpackl(0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 3 * M_PI_4), cpackl(-0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 5 * M_PI_4), cpackl(-0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 7 * M_PI_4), cpackl(0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 0.0), cpackl(0.0, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(cpackl(-INFINITY, -0.0), cpackl(0.0, -0.0), + ALL_STD_EXCEPT, 0, 1); + /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(INFINITY, M_PI_4), cpackl(INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 3 * M_PI_4), cpackl(-INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 5 * M_PI_4), cpackl(-INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 7 * M_PI_4), cpackl(INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + /* cexp(inf + 0i) = inf + 0i */ testall(cpackl(INFINITY, 0.0), cpackl(INFINITY, 0.0), ALL_STD_EXCEPT, 0, 1); testall(cpackl(INFINITY, -0.0), cpackl(INFINITY, -0.0), From owner-svn-src-all@FreeBSD.ORG Tue May 28 09:25:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4697DE18; Tue, 28 May 2013 09:25:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DDAD775; Tue, 28 May 2013 09:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9PwhR003513; Tue, 28 May 2013 09:25:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9PwGM003512; Tue, 28 May 2013 09:25:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201305280925.r4S9PwGM003512@svn.freebsd.org> From: Michael Tuexen Date: Tue, 28 May 2013 09:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251054 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 09:25:59 -0000 Author: tuexen Date: Tue May 28 09:25:58 2013 New Revision: 251054 URL: http://svnweb.freebsd.org/changeset/base/251054 Log: Remove redundant checks. MFC after: 2 weeks Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue May 28 08:50:50 2013 (r251053) +++ head/sys/netinet/sctputil.c Tue May 28 09:25:58 2013 (r251054) @@ -3536,8 +3536,8 @@ sctp_ulp_notify(uint32_t notification, s if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if (stcb && ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED))) { + if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || + (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3611,16 +3611,16 @@ sctp_ulp_notify(uint32_t notification, s break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); From owner-svn-src-all@FreeBSD.ORG Tue May 28 09:33:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3BCA385; Tue, 28 May 2013 09:33:46 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC63D7CE; Tue, 28 May 2013 09:33:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9XkaQ006675; Tue, 28 May 2013 09:33:46 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9XktD006673; Tue, 28 May 2013 09:33:46 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201305280933.r4S9XktD006673@svn.freebsd.org> From: Joel Dahl Date: Tue, 28 May 2013 09:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251056 - in head: share/man/man4 tools/tools/makeroot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 09:33:47 -0000 Author: joel (doc committer) Date: Tue May 28 09:33:46 2013 New Revision: 251056 URL: http://svnweb.freebsd.org/changeset/base/251056 Log: mdoc: silence a few mandoc lint warnings. Modified: head/share/man/man4/aacraid.4 head/tools/tools/makeroot/makeroot.8 Modified: head/share/man/man4/aacraid.4 ============================================================================== --- head/share/man/man4/aacraid.4 Tue May 28 09:26:48 2013 (r251055) +++ head/share/man/man4/aacraid.4 Tue May 28 09:33:46 2013 (r251056) @@ -53,10 +53,10 @@ The driver provides support for the Adaptec by PMC RAID controllers, including Series 6/7/8 and upcoming families. .Pp -The RAID containers are handled via the +The RAID containers are handled via the .Nm aacraidp0 bus. -The physical buses are represented by the +The physical buses are represented by the .Nm aacraidp? devices (beginning with aacraidp1). These devices enable the SCSI pass-thru interface and allows devices connected @@ -135,5 +135,4 @@ and are also queued for retrieval by a m .An Scott Long .Aq scottl@FreeBSD.org .Sh BUGS -.Pp The controller is not actually paused on suspend/resume. Modified: head/tools/tools/makeroot/makeroot.8 ============================================================================== --- head/tools/tools/makeroot/makeroot.8 Tue May 28 09:26:48 2013 (r251055) +++ head/tools/tools/makeroot/makeroot.8 Tue May 28 09:33:46 2013 (r251056) @@ -108,8 +108,6 @@ The argument is passed directly to .Xr makefs 8 . .El -.Sh EXAMPLES -.Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist .Sh FILES .Bl -tag -width METALOG -compact .It Pa METALOG @@ -118,6 +116,8 @@ argument is passed directly to directory. This file is generated by installworld, distribution, and installkernel. .El +.Sh EXAMPLES +.Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist .Sh SEE ALSO .Xr mtree 5 , .Xr makefs 8 , From owner-svn-src-all@FreeBSD.ORG Tue May 28 09:52:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA5D9C26; Tue, 28 May 2013 09:52:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2468D5; Tue, 28 May 2013 09:52:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9qSor012992; Tue, 28 May 2013 09:52:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9qShX012991; Tue, 28 May 2013 09:52:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305280952.r4S9qShX012991@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 28 May 2013 09:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251058 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 09:52:28 -0000 Author: des Date: Tue May 28 09:52:28 2013 New Revision: 251058 URL: http://svnweb.freebsd.org/changeset/base/251058 Log: During buildkernel, print a banner before building modules. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) @@ -983,9 +983,16 @@ buildkernel: .endif @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 3.2: building everything" + @echo ">>> stage 3.2: building the kernel" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ + @echo +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) + @echo "--------------------------------------------------------------" + @echo ">>> stage 3.3: building the modules" + @echo "--------------------------------------------------------------" + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ +.endif @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" From owner-svn-src-all@FreeBSD.ORG Tue May 28 13:54:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71459D38; Tue, 28 May 2013 13:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63F61D2E; Tue, 28 May 2013 13:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SDsRFD091294; Tue, 28 May 2013 13:54:27 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SDsRkx091293; Tue, 28 May 2013 13:54:27 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305281354.r4SDsRkx091293@svn.freebsd.org> From: Mark Johnston Date: Tue, 28 May 2013 13:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251059 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 13:54:27 -0000 Author: markj Date: Tue May 28 13:54:26 2013 New Revision: 251059 URL: http://svnweb.freebsd.org/changeset/base/251059 Log: - Fix wording. [1] - Improve the descriptions in the FILES section. [2] Reported by: Jason McIntyre [1] Obtained from: NetBSD [2] MFC after: 3 days Modified: head/usr.sbin/rtsold/rtsold.8 Modified: head/usr.sbin/rtsold/rtsold.8 ============================================================================== --- head/usr.sbin/rtsold/rtsold.8 Tue May 28 09:52:28 2013 (r251058) +++ head/usr.sbin/rtsold/rtsold.8 Tue May 28 13:54:26 2013 (r251059) @@ -161,9 +161,9 @@ will dump the current internal state int The options are as follows: .Bl -tag -width indent .It Fl a -Autoprobe outgoing interface. +Autoprobe outgoing interfaces. .Nm -will try to find non-loopback, non-point-to-point, IPv6-capable interfaces +will try to find any non-loopback, non-point-to-point, IPv6-capable interfaces and send router solicitation messages on all of them. .It Fl d Enable debugging. @@ -256,10 +256,10 @@ If not, it will be .Sh FILES .Bl -tag -width /var/run/rtsold.dump -compact .It Pa /var/run/rtsold.pid -the pid of the currently running +The PID of the currently running .Nm . .It Pa /var/run/rtsold.dump -dumps internal state on. +Internal state dump file. .El .\" .Sh EXIT STATUS From owner-svn-src-all@FreeBSD.ORG Tue May 28 14:44:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4FCA2A4; Tue, 28 May 2013 14:44:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B73EFF90; Tue, 28 May 2013 14:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SEibx5009524; Tue, 28 May 2013 14:44:37 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SEibkS009522; Tue, 28 May 2013 14:44:37 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305281444.r4SEibkS009522@svn.freebsd.org> From: Steven Hartland Date: Tue, 28 May 2013 14:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251061 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 14:44:37 -0000 Author: smh Date: Tue May 28 14:44:37 2013 New Revision: 251061 URL: http://svnweb.freebsd.org/changeset/base/251061 Log: Added missing SCSI quirks from r241784 Re-ordered SSD quirks alphabetically so they are easier to maintain. Removed my email and PR reference from comments on each quirk. Added quirks for more SSDs: * Crucial M4 * Corsair Force GT * Intel 520 Series * Kingston E100 Series * Samsung 830 Series Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue May 28 14:32:02 2013 (r251060) +++ head/sys/cam/ata/ata_da.c Tue May 28 14:44:37 2013 (r251061) @@ -272,12 +272,11 @@ static struct ada_quirk_entry ada_quirk_ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD?????PVT*", "*" }, /*quirks*/ADA_Q_4K }, + /* SSDs */ { /* * Corsair Force 2 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair CSSD-F*", "*" }, /*quirks*/ADA_Q_4K @@ -286,116 +285,136 @@ static struct ada_quirk_entry ada_quirk_ /* * Corsair Force 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force 3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Agility 3 SSDs + * Corsair Force GT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force GT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 2 SSDs (inc pro series) + * Crucial M4 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "M4-CT???M4SSD2*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 3 SSDs + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/ADA_Q_4K + }, + { + /* + * Intel 320 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * SuperTalent TeraDrive CT SSDs + * Intel 330 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2CT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Crucial RealSSD C300 SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", - "*" }, /*quirks*/ADA_Q_4K + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + /*quirks*/ADA_Q_4K }, { /* - * XceedIOPS SATA SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 320 Series SSDs + * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SE100S3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 330 Series SSDs + * Kingston HyperX 3k SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2ct*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 510 Series SSDs + * OCZ Agility 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, /*quirks*/ADA_Q_4K }, { /* * OCZ Deneva R Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "DENRSTE251M45*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Kingston HyperX 3k SSDs + * OCZ Vertex 2 SSDs (inc pro series) * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, /*quirks*/ADA_Q_4K }, { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue May 28 14:32:02 2013 (r251060) +++ head/sys/cam/scsi/scsi_da.c Tue May 28 14:44:37 2013 (r251061) @@ -907,6 +907,151 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HM250JI", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + /* SATA SSDs */ + { + /* + * Corsair Force 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair CSSD-F*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force 3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force GT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force GT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial M4 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "M4-CT???M4SSD2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/DA_Q_4K + }, + { + /* + * Intel 320 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSA2CW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 330 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2CT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2MH*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston E100 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SE100S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SH103S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-AGILITY3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Deneva R Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "DENRSTE251M45*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 2 SSDs (inc pro series) + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ?VERTEX2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "FTM??CT25H*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, + /*quirks*/DA_Q_4K + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Tue May 28 17:58:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5545133E; Tue, 28 May 2013 17:58:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 32050B5A; Tue, 28 May 2013 17:58:31 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3B602B99F; Tue, 28 May 2013 13:58:28 -0400 (EDT) From: John Baldwin To: "Dag-Erling SmXXrgrav" Subject: Re: svn commit: r251058 - head Date: Tue, 28 May 2013 11:00:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305280952.r4S9qShX012991@svn.freebsd.org> In-Reply-To: <201305280952.r4S9qShX012991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305281100.35435.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 28 May 2013 13:58:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 17:58:31 -0000 On Tuesday, May 28, 2013 5:52:28 am Dag-Erling SmXXrgrav wrote: > Author: des > Date: Tue May 28 09:52:28 2013 > New Revision: 251058 > URL: http://svnweb.freebsd.org/changeset/base/251058 > > Log: > During buildkernel, print a banner before building modules. > > Modified: > head/Makefile.inc1 Does this honor 'makeoptions NO_MODULES=yes' in the kernel config? That sets NO_MODULES=yes in the generated Makefile, not in the environment seen by the make instance running this makefile. My guess is that this would result in 'make buildkernel' calling 'make modules-all' but 'modules-all' wouldn't be defined as a valid target? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 28 18:13:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 52B06B5C; Tue, 28 May 2013 18:13:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABB7CD5; Tue, 28 May 2013 18:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SID9LE084216; Tue, 28 May 2013 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SID9eR084215; Tue, 28 May 2013 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305281813.r4SID9eR084215@svn.freebsd.org> From: John Baldwin Date: Tue, 28 May 2013 18:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251063 - stable/9/sys/dev/cpufreq X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:13:09 -0000 Author: jhb Date: Tue May 28 18:13:08 2013 New Revision: 251063 URL: http://svnweb.freebsd.org/changeset/base/251063 Log: MFC 247332: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5 Modified: stable/9/sys/dev/cpufreq/ichss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cpufreq/ichss.c ============================================================================== --- stable/9/sys/dev/cpufreq/ichss.c Tue May 28 15:04:58 2013 (r251062) +++ stable/9/sys/dev/cpufreq/ichss.c Tue May 28 18:13:08 2013 (r251063) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA 0x244c /* ICH2M */ #define PCI_DEV_82801CA 0x248c /* ICH3M */ #define PCI_DEV_82801DB 0x24cc /* ICH4M */ -#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET 0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). - * - * TODO: add a quirk to disable if we see the 82815_MC along - * with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* + * Certain systems with ICH2 and an Intel 82815_MC host bridge + * where the host bridge's revision is < 5 lockup if SpeedStep + * is used. + */ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); From owner-svn-src-all@FreeBSD.ORG Tue May 28 18:43:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2FE2736; Tue, 28 May 2013 18:43:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5A8E68; Tue, 28 May 2013 18:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SIhwa0094514; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SIhwr8094512; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305281843.r4SIhwr8094512@svn.freebsd.org> From: John Baldwin Date: Tue, 28 May 2013 18:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251064 - stable/8/sys/dev/cpufreq X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:43:58 -0000 Author: jhb Date: Tue May 28 18:43:58 2013 New Revision: 251064 URL: http://svnweb.freebsd.org/changeset/base/251064 Log: MFC 247332: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5 Modified: stable/8/sys/dev/cpufreq/ichss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) Modified: stable/8/sys/dev/cpufreq/ichss.c ============================================================================== --- stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:13:08 2013 (r251063) +++ stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:43:58 2013 (r251064) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA 0x244c /* ICH2M */ #define PCI_DEV_82801CA 0x248c /* ICH3M */ #define PCI_DEV_82801DB 0x24cc /* ICH4M */ -#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET 0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). - * - * TODO: add a quirk to disable if we see the 82815_MC along - * with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* + * Certain systems with ICH2 and an Intel 82815_MC host bridge + * where the host bridge's revision is < 5 lockup if SpeedStep + * is used. + */ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); From owner-svn-src-all@FreeBSD.ORG Tue May 28 18:51:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12EF99C0; Tue, 28 May 2013 18:51:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE6A7ECE; Tue, 28 May 2013 18:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SIpUhW097487; Tue, 28 May 2013 18:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SIpUGv097485; Tue, 28 May 2013 18:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305281851.r4SIpUGv097485@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 28 May 2013 18:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251065 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:51:31 -0000 Author: hselasky Date: Tue May 28 18:51:30 2013 New Revision: 251065 URL: http://svnweb.freebsd.org/changeset/base/251065 Log: Revert r251023 until a more proper solution is found for ATI based USB controllers. MFC after: 1 week Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue May 28 18:43:58 2013 (r251064) +++ head/sys/dev/usb/controller/ehci.c Tue May 28 18:51:30 2013 (r251065) @@ -2454,7 +2454,6 @@ ehci_device_isoc_fs_enter(struct usb_xfe uint16_t tlen; uint8_t sa; uint8_t sb; - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2619,16 +2618,6 @@ ehci_device_isoc_fs_enter(struct usb_xfe EHCI_SITD_IOC | EHCI_SITD_ACTIVE | EHCI_SITD_SET_LEN(*plen)); - } else if (first != 0) { - /* - * Workaround for lost or too early - * completion interrupt: - */ - first = 0; - td->sitd_status = htohc32(sc, - EHCI_SITD_IOC | - EHCI_SITD_ACTIVE | - EHCI_SITD_SET_LEN(*plen)); } else { td->sitd_status = htohc32(sc, EHCI_SITD_ACTIVE | @@ -2770,7 +2759,6 @@ ehci_device_isoc_hs_enter(struct usb_xfe uint8_t td_no; uint8_t page_no; uint8_t shift = usbd_xfer_get_fps_shift(xfer); - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2932,13 +2920,6 @@ ehci_device_isoc_hs_enter(struct usb_xfe /* set IOC bit if we are complete */ if (nframes == 0) { td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); - } else if (first != 0) { - /* - * Workaround for lost or too early - * completion interrupt: - */ - first = 0; - td->itd_status[0] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #ifdef USB_DEBUG Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Tue May 28 18:43:58 2013 (r251064) +++ head/sys/dev/usb/controller/uhci.c Tue May 28 18:51:30 2013 (r251065) @@ -2138,7 +2138,6 @@ uhci_device_isoc_enter(struct usb_xfer * uint32_t nframes; uint32_t temp; uint32_t *plen; - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2254,18 +2253,6 @@ uhci_device_isoc_enter(struct usb_xfer * UHCI_TD_ACTIVE | UHCI_TD_IOS | UHCI_TD_IOC)); - } else if (first != 0) { - /* - * Workaround for lost or too early completion - * interrupt: - */ - first = 0; - td->td_status = htole32 - (UHCI_TD_ZERO_ACTLEN - (UHCI_TD_SET_ERRCNT(0) | - UHCI_TD_ACTIVE | - UHCI_TD_IOS | - UHCI_TD_IOC)); } else { td->td_status = htole32 (UHCI_TD_ZERO_ACTLEN From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:04:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DE7DEC26 for ; Tue, 28 May 2013 20:04:57 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [IPv6:2607:f8b0:400c:c02::233]) by mx1.freebsd.org (Postfix) with ESMTP id 9E449299 for ; Tue, 28 May 2013 20:04:57 +0000 (UTC) Received: by mail-vb0-f51.google.com with SMTP id x16so5612999vbf.38 for ; Tue, 28 May 2013 13:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=gQtM8Dmeht3Bx6dij3qwGBX605ZeJ6vSbxHVAiRWjZw=; b=OPYM8kRPmaMLjJyL731OnWAVbH9q+jBmTAGaFM5W5GwiAjFNl9aPk1Um5tYOnN4v4h naibxAx8JlmfPqF1EkLqFs7Bgo7Yqlk4xI0un9iJc7lgS6MsvleQVmat1vI9SYJgDmNB qxttcLXUL2C4AzcMNdwfVu1KpH/j09BoS9cVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=gQtM8Dmeht3Bx6dij3qwGBX605ZeJ6vSbxHVAiRWjZw=; b=ejdiiygdHKala1Qzoh01GGyUbPTPqfns8ERjdylninr0ObV2id26sKxbO7mLeQZPVh 7lypf6aYVnEbqEZIuloJS04Pbk4/qFTX8f5hHPNpN02nPsUTENqgTmGSCBeJ3Se+NXR8 EBuJr1yJC+3Kmi0HZFWDigxuzmVeN7n6yBEhRrDpQMTE3IWZqBlk3cnkTfaJ/F3kmxpg agxpG0/WADoj/YLaCsm52ahWTWROJ6ljcMWG2MVGDGc5PTZVKG5LNUdhSv9mcPueRO1E 2eIqi5G7w5wVCRlPMbU8sdr8jdiXs37UA9ZeWw3ly1Ton82yabc4R0wmP/KqkLe5Y2PI wfag== MIME-Version: 1.0 X-Received: by 10.220.76.137 with SMTP id c9mr3069827vck.48.1369771497172; Tue, 28 May 2013 13:04:57 -0700 (PDT) Received: by 10.220.119.2 with HTTP; Tue, 28 May 2013 13:04:56 -0700 (PDT) In-Reply-To: <201305280952.r4S9qShX012991@svn.freebsd.org> References: <201305280952.r4S9qShX012991@svn.freebsd.org> Date: Tue, 28 May 2013 13:04:56 -0700 Message-ID: Subject: Re: svn commit: r251058 - head From: Peter Wemm To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQllobYsVh3mE84/KqpKJpBydo7acQ+UQgrLCW57+oBHwIlCcAXYKjbtmCj3AUxJhnL8sbtL Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:04:58 -0000 On Tue, May 28, 2013 at 2:52 AM, Dag-Erling Sm=F8rgrav wr= ote: > Author: des > Date: Tue May 28 09:52:28 2013 > New Revision: 251058 > URL: http://svnweb.freebsd.org/changeset/base/251058 > > Log: > During buildkernel, print a banner before building modules. > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) > +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) > @@ -983,9 +983,16 @@ buildkernel: > .endif > @echo > @echo "----------------------------------------------------------= ----" > - @echo ">>> stage 3.2: building everything" > + @echo ">>> stage 3.2: building the kernel" > @echo "----------------------------------------------------------= ----" > - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ > + @echo > +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KER= NSRCDIR}/modules) > + @echo "----------------------------------------------------------= ----" > + @echo ">>> stage 3.3: building the modules" > + @echo "----------------------------------------------------------= ----" > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OB= J > +.endif > @echo "----------------------------------------------------------= ----" > @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=3DC d= ate`" > @echo "----------------------------------------------------------= ----" Please back this out or fix it ASAP. You broke every single machine in the freebsd.org cluster. make: don't know how to make modules-all. Stop *** [buildkernel] Error code 2 You are causing it to stop respecting makeoptions in the kernel config files. eg: eg: makeoptions NO_MODULES=3Dno or makeoptions MODULES_OVERRIDE=3D"zfs opensolaris" If you really want this echo here then you're going to need to reach down into the internals and make 'modules-all' work even when NO_MODULES is set. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:11:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18E7BE02; Tue, 28 May 2013 20:11:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4F1D2CE; Tue, 28 May 2013 20:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKBS0i026144; Tue, 28 May 2013 20:11:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKBSia026143; Tue, 28 May 2013 20:11:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305282011.r4SKBSia026143@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 May 2013 20:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251066 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:11:29 -0000 Author: dim Date: Tue May 28 20:11:28 2013 New Revision: 251066 URL: http://svnweb.freebsd.org/changeset/base/251066 Log: Fix warnings from newer clang versions about constexpr member functions not being implicitly const in libc++'s header. The warnings have been introduced because of new language rules recently adopted by the C++ WG. More info: MFC after: 3 days Modified: head/contrib/libc++/include/chrono Modified: head/contrib/libc++/include/chrono ============================================================================== --- head/contrib/libc++/include/chrono Tue May 28 18:51:30 2013 (r251065) +++ head/contrib/libc++/include/chrono Tue May 28 20:11:28 2013 (r251066) @@ -468,7 +468,7 @@ template ::type _Ct; return _Ct(__lhs).count() == _Ct(__rhs).count(); @@ -479,7 +479,7 @@ template struct __duration_eq<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() == __rhs.count();} }; @@ -509,7 +509,7 @@ template ::type _Ct; return _Ct(__lhs).count() < _Ct(__rhs).count(); @@ -520,7 +520,7 @@ template struct __duration_lt<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() < __rhs.count();} }; From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:37:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8F6E3821; Tue, 28 May 2013 20:37:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70BF062D; Tue, 28 May 2013 20:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKbotY034153; Tue, 28 May 2013 20:37:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKbmHB034143; Tue, 28 May 2013 20:37:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282037.r4SKbmHB034143@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 20:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251067 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:37:50 -0000 Author: emaste Date: Tue May 28 20:37:48 2013 New Revision: 251067 URL: http://svnweb.freebsd.org/changeset/base/251067 Log: Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Modified: head/lib/libc/net/sctp_bindx.3 head/lib/libc/net/sctp_connectx.3 head/lib/libc/net/sctp_freepaddrs.3 head/lib/libc/net/sctp_getaddrlen.3 head/lib/libc/net/sctp_getassocid.3 head/lib/libc/net/sctp_getpaddrs.3 head/lib/libc/net/sctp_opt_info.3 head/lib/libc/net/sctp_recvmsg.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 Modified: head/lib/libc/net/sctp_bindx.3 ============================================================================== --- head/lib/libc/net/sctp_bindx.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_bindx.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_connectx.3 ============================================================================== --- head/lib/libc/net/sctp_connectx.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_connectx.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_freepaddrs.3 ============================================================================== --- head/lib/libc/net/sctp_freepaddrs.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_freepaddrs.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_getaddrlen.3 ============================================================================== --- head/lib/libc/net/sctp_getaddrlen.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getaddrlen.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_getassocid.3 ============================================================================== --- head/lib/libc/net/sctp_getassocid.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getassocid.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_getpaddrs.3 ============================================================================== --- head/lib/libc/net/sctp_getpaddrs.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getpaddrs.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_opt_info.3 ============================================================================== --- head/lib/libc/net/sctp_opt_info.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_opt_info.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- head/lib/libc/net/sctp_recvmsg.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_recvmsg.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_send.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_sendmsg.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:53:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8AE2CB9; Tue, 28 May 2013 20:53:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA42F6E0; Tue, 28 May 2013 20:53:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKrQ1o040094; Tue, 28 May 2013 20:53:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKrQCx040093; Tue, 28 May 2013 20:53:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282053.r4SKrQCx040093@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 20:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251068 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:53:26 -0000 Author: marius Date: Tue May 28 20:53:26 2013 New Revision: 251068 URL: http://svnweb.freebsd.org/changeset/base/251068 Log: MFC: r245926, r245931 - Improve some comments. - Make bge_lookup_{rev,vendor}() static. - Factor out chip identification rather than duplicating the code. - Sanitize bge_probe() a bit (don't hardcode buffer sizes, allow bge_lookup_vendor() to return NULL so the excessive panic() can be removed there, etc.) and return BUS_PROBE_DEFAULT rather than hardcoding 0. - According to the Linux tg3 driver, BCM57791 and BCM57795 aren't capable of Gigabit Ethernet. - Check the return value of taskqueue_start_threads(). - Mention NetLink controllers in the fallback description, too. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Tue May 28 20:37:48 2013 (r251067) +++ stable/9/sys/dev/bge/if_bge.c Tue May 28 20:53:26 2013 (r251068) @@ -35,10 +35,10 @@ __FBSDID("$FreeBSD$"); /* - * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. + * Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver * * The Broadcom BCM5700 is based on technology originally developed by - * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet + * Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo @@ -367,8 +367,9 @@ static const struct bge_revision bge_maj #define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) #define BGE_IS_57765_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_57765_PLUS) -const struct bge_revision * bge_lookup_rev(uint32_t); -const struct bge_vendor * bge_lookup_vendor(uint16_t); +static uint32_t bge_chipid(device_t); +static const struct bge_vendor * bge_lookup_vendor(uint16_t); +static const struct bge_revision * bge_lookup_rev(uint32_t); typedef int (*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]); @@ -1916,7 +1917,7 @@ bge_chipinit(struct bge_softc *sc) PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4); - /* Set the timer prescaler (always 66Mhz) */ + /* Set the timer prescaler (always 66 MHz). */ CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); /* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */ @@ -2586,7 +2587,7 @@ bge_blockinit(struct bge_softc *sc) return (0); } -const struct bge_revision * +static const struct bge_revision * bge_lookup_rev(uint32_t chipid) { const struct bge_revision *br; @@ -2604,7 +2605,7 @@ bge_lookup_rev(uint32_t chipid) return (NULL); } -const struct bge_vendor * +static const struct bge_vendor * bge_lookup_vendor(uint16_t vid) { const struct bge_vendor *v; @@ -2613,10 +2614,47 @@ bge_lookup_vendor(uint16_t vid) if (v->v_id == vid) return (v); - panic("%s: unknown vendor %d", __func__, vid); return (NULL); } +static uint32_t +bge_chipid(device_t dev) +{ + uint32_t id; + + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips use different + * registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: + case BCOM_DEVICEID_BCM5720: + id = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57762: + case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57766: + case BCOM_DEVICEID_BCM57781: + case BCOM_DEVICEID_BCM57785: + case BCOM_DEVICEID_BCM57791: + case BCOM_DEVICEID_BCM57795: + id = pci_read_config(dev, + BGE_PCI_GEN15_PRODID_ASICREV, 4); + break; + default: + id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); + } + } + return (id); +} + /* * Probe for a Broadcom chip. Check the PCI vendor and device IDs * against our list and return its name if we find a match. @@ -2634,61 +2672,34 @@ bge_probe(device_t dev) char model[64]; const struct bge_revision *br; const char *pname; - struct bge_softc *sc = device_get_softc(dev); + struct bge_softc *sc; const struct bge_type *t = bge_devs; const struct bge_vendor *v; uint32_t id; uint16_t did, vid; + sc = device_get_softc(dev); sc->bge_dev = dev; vid = pci_get_vendor(dev); did = pci_get_device(dev); while(t->bge_vid != 0) { if ((vid == t->bge_vid) && (did == t->bge_did)) { - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> - BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { - /* - * Find the ASCI revision. Different chips - * use different registers. - */ - switch (pci_get_device(dev)) { - case BCOM_DEVICEID_BCM5717: - case BCOM_DEVICEID_BCM5718: - case BCOM_DEVICEID_BCM5719: - case BCOM_DEVICEID_BCM5720: - id = pci_read_config(dev, - BGE_PCI_GEN2_PRODID_ASICREV, 4); - break; - case BCOM_DEVICEID_BCM57761: - case BCOM_DEVICEID_BCM57762: - case BCOM_DEVICEID_BCM57765: - case BCOM_DEVICEID_BCM57766: - case BCOM_DEVICEID_BCM57781: - case BCOM_DEVICEID_BCM57785: - case BCOM_DEVICEID_BCM57791: - case BCOM_DEVICEID_BCM57795: - id = pci_read_config(dev, - BGE_PCI_GEN15_PRODID_ASICREV, 4); - break; - default: - id = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); - } - } + id = bge_chipid(dev); br = bge_lookup_rev(id); - v = bge_lookup_vendor(vid); if (bge_has_eaddr(sc) && pci_get_vpd_ident(dev, &pname) == 0) - snprintf(model, 64, "%s", pname); - else - snprintf(model, 64, "%s %s", v->v_name, + snprintf(model, sizeof(model), "%s", pname); + else { + v = bge_lookup_vendor(vid); + snprintf(model, sizeof(model), "%s %s", + v != NULL ? v->v_name : "Unknown", br != NULL ? br->br_name : - "NetXtreme Ethernet Controller"); - snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, - br != NULL ? "" : "unknown ", id); + "NetXtreme/NetLink Ethernet Controller"); + } + snprintf(buf, sizeof(buf), "%s, %sASIC rev. %#08x", + model, br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); - return (0); + return (BUS_PROBE_DEFAULT); } t++; } @@ -3272,38 +3283,7 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_func_addr = pci_get_function(dev); - sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> - BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) { - /* - * Find the ASCI revision. Different chips use different - * registers. - */ - switch (pci_get_device(dev)) { - case BCOM_DEVICEID_BCM5717: - case BCOM_DEVICEID_BCM5718: - case BCOM_DEVICEID_BCM5719: - case BCOM_DEVICEID_BCM5720: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_GEN2_PRODID_ASICREV, 4); - break; - case BCOM_DEVICEID_BCM57761: - case BCOM_DEVICEID_BCM57762: - case BCOM_DEVICEID_BCM57765: - case BCOM_DEVICEID_BCM57766: - case BCOM_DEVICEID_BCM57781: - case BCOM_DEVICEID_BCM57785: - case BCOM_DEVICEID_BCM57791: - case BCOM_DEVICEID_BCM57795: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_GEN15_PRODID_ASICREV, 4); - break; - default: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); - } - } + sc->bge_chipid = bge_chipid(dev); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -3493,6 +3473,8 @@ bge_attach(device_t dev) pci_get_device(dev) == BCOM_DEVICEID_BCM5753F || pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) || pci_get_device(dev) == BCOM_DEVICEID_BCM57790 || + pci_get_device(dev) == BCOM_DEVICEID_BCM57791 || + pci_get_device(dev) == BCOM_DEVICEID_BCM57795 || sc->bge_asicrev == BGE_ASICREV_BCM5906) { /* These chips are 10/100 only. */ capmask &= ~BMSR_EXTSTAT; @@ -3504,8 +3486,8 @@ bge_attach(device_t dev) * TSO. But the firmware is not available to FreeBSD and Linux * claims that the TSO performed by the firmware is slower than * hardware based TSO. Moreover the firmware based TSO has one - * known bug which can't handle TSO if ethernet header + IP/TCP - * header is greater than 80 bytes. The workaround for the TSO + * known bug which can't handle TSO if Ethernet header + IP/TCP + * header is greater than 80 bytes. A workaround for the TSO * bug exist but it seems it's too expensive than not using * TSO at all. Some hardwares also have the TSO bug so limit * the TSO to the controllers that are not affected TSO issues @@ -3878,8 +3860,13 @@ again: error = ENOMEM; goto fail; } - taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(sc->bge_dev)); + error = taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, + "%s taskq", device_get_nameunit(sc->bge_dev)); + if (error != 0) { + device_printf(dev, "could not start threads.\n"); + ether_ifdetach(ifp); + goto fail; + } error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, &sc->bge_intrhand); From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:58:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A755222; Tue, 28 May 2013 20:58:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B056902; Tue, 28 May 2013 20:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKw0IL041053; Tue, 28 May 2013 20:58:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKvfcW040915; Tue, 28 May 2013 20:57:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282057.r4SKvfcW040915@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251069 - in head/lib/libc: stdlib string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:58:00 -0000 Author: emaste Date: Tue May 28 20:57:40 2013 New Revision: 251069 URL: http://svnweb.freebsd.org/changeset/base/251069 Log: Renumber clauses to reduce diffs to other versions NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier. Modified: head/lib/libc/stdlib/abort.3 head/lib/libc/stdlib/abort.c head/lib/libc/stdlib/abs.3 head/lib/libc/stdlib/abs.c head/lib/libc/stdlib/alloca.3 head/lib/libc/stdlib/atexit.3 head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/atexit.h head/lib/libc/stdlib/atof.3 head/lib/libc/stdlib/atof.c head/lib/libc/stdlib/atoi.3 head/lib/libc/stdlib/atoi.c head/lib/libc/stdlib/atol.3 head/lib/libc/stdlib/atol.c head/lib/libc/stdlib/atoll.c head/lib/libc/stdlib/bsearch.3 head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/div.3 head/lib/libc/stdlib/div.c head/lib/libc/stdlib/exit.3 head/lib/libc/stdlib/exit.c head/lib/libc/stdlib/getenv.3 head/lib/libc/stdlib/getopt.3 head/lib/libc/stdlib/getopt.c head/lib/libc/stdlib/getsubopt.3 head/lib/libc/stdlib/getsubopt.c head/lib/libc/stdlib/heapsort.c head/lib/libc/string/bcmp.3 head/lib/libc/string/bcmp.c head/lib/libc/string/bcopy.3 head/lib/libc/string/bcopy.c head/lib/libc/string/bstring.3 head/lib/libc/string/bzero.3 head/lib/libc/string/ffs.3 head/lib/libc/string/ffs.c head/lib/libc/string/ffsl.c head/lib/libc/string/ffsll.c head/lib/libc/string/fls.c head/lib/libc/string/flsl.c head/lib/libc/string/flsll.c head/lib/libc/string/index.3 head/lib/libc/string/memccpy.3 head/lib/libc/string/memccpy.c head/lib/libc/string/memchr.3 head/lib/libc/string/memchr.c head/lib/libc/string/memcmp.3 head/lib/libc/string/memcmp.c head/lib/libc/string/memcpy.3 head/lib/libc/string/memmove.3 head/lib/libc/string/memset.3 head/lib/libc/string/memset.c head/lib/libc/string/strcasecmp.3 head/lib/libc/string/strcasecmp.c head/lib/libc/string/strcasestr.c head/lib/libc/string/strcat.3 head/lib/libc/string/strcat.c head/lib/libc/string/strchr.3 head/lib/libc/string/strchr.c head/lib/libc/string/strcmp.3 head/lib/libc/string/strcmp.c head/lib/libc/string/strcoll.3 head/lib/libc/string/strcpy.3 head/lib/libc/string/strcpy.c head/lib/libc/string/strcspn.3 head/lib/libc/string/strdup.3 head/lib/libc/string/strdup.c head/lib/libc/string/strerror.3 head/lib/libc/string/strerror.c head/lib/libc/string/string.3 head/lib/libc/string/strlen.3 head/lib/libc/string/strmode.3 head/lib/libc/string/strmode.c head/lib/libc/string/strncat.c head/lib/libc/string/strncmp.c head/lib/libc/string/strncpy.c head/lib/libc/string/strndup.c head/lib/libc/string/strnstr.c head/lib/libc/string/strpbrk.3 head/lib/libc/string/strpbrk.c head/lib/libc/string/strrchr.c head/lib/libc/string/strsep.3 head/lib/libc/string/strsep.c head/lib/libc/string/strsignal.c head/lib/libc/string/strspn.3 head/lib/libc/string/strstr.3 head/lib/libc/string/strstr.c head/lib/libc/string/strtok.3 head/lib/libc/string/strtok.c head/lib/libc/string/strxfrm.3 head/lib/libc/string/swab.3 head/lib/libc/string/swab.c head/lib/libc/string/wcscmp.c head/lib/libc/string/wcscoll.3 head/lib/libc/string/wcsncmp.c head/lib/libc/string/wcsncpy.c head/lib/libc/string/wcsstr.c head/lib/libc/string/wcstok.c head/lib/libc/string/wcswidth.c head/lib/libc/string/wcsxfrm.3 head/lib/libc/string/wmemchr.3 Modified: head/lib/libc/stdlib/abort.3 ============================================================================== --- head/lib/libc/stdlib/abort.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abort.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/abort.c ============================================================================== --- head/lib/libc/stdlib/abort.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abort.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/abs.3 ============================================================================== --- head/lib/libc/stdlib/abs.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abs.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/abs.c ============================================================================== --- head/lib/libc/stdlib/abs.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abs.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/alloca.3 ============================================================================== --- head/lib/libc/stdlib/alloca.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/alloca.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/atexit.3 ============================================================================== --- head/lib/libc/stdlib/atexit.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/atexit.h ============================================================================== --- head/lib/libc/stdlib/atexit.h Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.h Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/atof.3 ============================================================================== --- head/lib/libc/stdlib/atof.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atof.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/atof.c ============================================================================== --- head/lib/libc/stdlib/atof.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atof.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/atoi.3 ============================================================================== --- head/lib/libc/stdlib/atoi.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoi.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/atoi.c ============================================================================== --- head/lib/libc/stdlib/atoi.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoi.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/atol.3 ============================================================================== --- head/lib/libc/stdlib/atol.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atol.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/atol.c ============================================================================== --- head/lib/libc/stdlib/atol.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atol.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/atoll.c ============================================================================== --- head/lib/libc/stdlib/atoll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoll.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/bsearch.3 ============================================================================== --- head/lib/libc/stdlib/bsearch.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/bsearch.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/bsearch.c ============================================================================== --- head/lib/libc/stdlib/bsearch.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/bsearch.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/div.3 ============================================================================== --- head/lib/libc/stdlib/div.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/div.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/div.c ============================================================================== --- head/lib/libc/stdlib/div.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/div.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/exit.3 ============================================================================== --- head/lib/libc/stdlib/exit.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/exit.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/exit.c ============================================================================== --- head/lib/libc/stdlib/exit.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/exit.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/getenv.3 ============================================================================== --- head/lib/libc/stdlib/getenv.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getenv.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/getopt.3 ============================================================================== --- head/lib/libc/stdlib/getopt.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getopt.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/getopt.c ============================================================================== --- head/lib/libc/stdlib/getopt.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getopt.c Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/getsubopt.3 ============================================================================== --- head/lib/libc/stdlib/getsubopt.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getsubopt.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/stdlib/getsubopt.c ============================================================================== --- head/lib/libc/stdlib/getsubopt.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getsubopt.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/stdlib/heapsort.c ============================================================================== --- head/lib/libc/stdlib/heapsort.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/heapsort.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/bcmp.3 ============================================================================== --- head/lib/libc/string/bcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/bcmp.c ============================================================================== --- head/lib/libc/string/bcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/bcopy.3 ============================================================================== --- head/lib/libc/string/bcopy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcopy.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/bcopy.c ============================================================================== --- head/lib/libc/string/bcopy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcopy.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/bstring.3 ============================================================================== --- head/lib/libc/string/bstring.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bstring.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/bzero.3 ============================================================================== --- head/lib/libc/string/bzero.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bzero.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/ffs.3 ============================================================================== --- head/lib/libc/string/ffs.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffs.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/ffs.c ============================================================================== --- head/lib/libc/string/ffs.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffs.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/ffsl.c ============================================================================== --- head/lib/libc/string/ffsl.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffsl.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/ffsll.c ============================================================================== --- head/lib/libc/string/ffsll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffsll.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/fls.c ============================================================================== --- head/lib/libc/string/fls.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/fls.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/flsl.c ============================================================================== --- head/lib/libc/string/flsl.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/flsl.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/flsll.c ============================================================================== --- head/lib/libc/string/flsll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/flsll.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/index.3 ============================================================================== --- head/lib/libc/string/index.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/index.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memccpy.3 ============================================================================== --- head/lib/libc/string/memccpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memccpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memccpy.c ============================================================================== --- head/lib/libc/string/memccpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memccpy.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/memchr.3 ============================================================================== --- head/lib/libc/string/memchr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memchr.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memchr.c ============================================================================== --- head/lib/libc/string/memchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memchr.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/memcmp.3 ============================================================================== --- head/lib/libc/string/memcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memcmp.c ============================================================================== --- head/lib/libc/string/memcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/memcpy.3 ============================================================================== --- head/lib/libc/string/memcpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memmove.3 ============================================================================== --- head/lib/libc/string/memmove.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memmove.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memset.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/memset.c ============================================================================== --- head/lib/libc/string/memset.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memset.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcasecmp.3 ============================================================================== --- head/lib/libc/string/strcasecmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasecmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strcasecmp.c ============================================================================== --- head/lib/libc/string/strcasecmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasecmp.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcasestr.c ============================================================================== --- head/lib/libc/string/strcasestr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasestr.c Tue May 28 20:57:40 2013 (r251069) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcat.3 ============================================================================== --- head/lib/libc/string/strcat.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcat.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strcat.c ============================================================================== --- head/lib/libc/string/strcat.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcat.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strchr.3 ============================================================================== --- head/lib/libc/string/strchr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strchr.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strchr.c ============================================================================== --- head/lib/libc/string/strchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strchr.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcmp.3 ============================================================================== --- head/lib/libc/string/strcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strcmp.c ============================================================================== --- head/lib/libc/string/strcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcoll.3 ============================================================================== --- head/lib/libc/string/strcoll.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcoll.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strcpy.c ============================================================================== --- head/lib/libc/string/strcpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcpy.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strcspn.3 ============================================================================== --- head/lib/libc/string/strcspn.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcspn.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strdup.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strdup.c ============================================================================== --- head/lib/libc/string/strdup.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strdup.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strerror.3 ============================================================================== --- head/lib/libc/string/strerror.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strerror.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strerror.c ============================================================================== --- head/lib/libc/string/strerror.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strerror.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/string.3 ============================================================================== --- head/lib/libc/string/string.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/string.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strlen.3 ============================================================================== --- head/lib/libc/string/strlen.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strlen.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strmode.3 ============================================================================== --- head/lib/libc/string/strmode.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strmode.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strmode.c ============================================================================== --- head/lib/libc/string/strmode.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strmode.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strncat.c ============================================================================== --- head/lib/libc/string/strncat.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncat.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strncmp.c ============================================================================== --- head/lib/libc/string/strncmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncmp.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strncpy.c ============================================================================== --- head/lib/libc/string/strncpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncpy.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strndup.c ============================================================================== --- head/lib/libc/string/strndup.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strndup.c Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strnstr.c ============================================================================== --- head/lib/libc/string/strnstr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strnstr.c Tue May 28 20:57:40 2013 (r251069) @@ -14,7 +14,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strpbrk.3 ============================================================================== --- head/lib/libc/string/strpbrk.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strpbrk.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strpbrk.c ============================================================================== --- head/lib/libc/string/strpbrk.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strpbrk.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strrchr.c ============================================================================== --- head/lib/libc/string/strrchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strrchr.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strsep.3 ============================================================================== --- head/lib/libc/string/strsep.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsep.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strsep.c ============================================================================== --- head/lib/libc/string/strsep.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsep.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsignal.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strspn.3 ============================================================================== --- head/lib/libc/string/strspn.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strspn.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strstr.3 ============================================================================== --- head/lib/libc/string/strstr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strstr.3 Tue May 28 20:57:40 2013 (r251069) @@ -14,7 +14,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/strstr.c ============================================================================== --- head/lib/libc/string/strstr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strstr.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strtok.3 ============================================================================== --- head/lib/libc/string/strtok.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strtok.3 Tue May 28 20:57:40 2013 (r251069) @@ -22,7 +22,7 @@ .\" disclaimer in the documentation and/or other materials provided .\" with the distribution. .\" -.\" 4. Neither the name of Softweyr LLC, the University nor the names +.\" 3. Neither the name of Softweyr LLC, the University nor the names .\" of its contributors may be used to endorse or promote products .\" derived from this software without specific prior written .\" permission. Modified: head/lib/libc/string/strtok.c ============================================================================== --- head/lib/libc/string/strtok.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strtok.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notices, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/string/strxfrm.3 ============================================================================== --- head/lib/libc/string/strxfrm.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strxfrm.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/swab.3 ============================================================================== --- head/lib/libc/string/swab.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/swab.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/string/swab.c ============================================================================== --- head/lib/libc/string/swab.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/swab.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 28 20:58:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B10313C3; Tue, 28 May 2013 20:58:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84A8A912; Tue, 28 May 2013 20:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKwwM5041255; Tue, 28 May 2013 20:58:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKwvn0041245; Tue, 28 May 2013 20:58:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282058.r4SKwvn0041245@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 20:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251070 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:58:58 -0000 Author: marius Date: Tue May 28 20:58:57 2013 New Revision: 251070 URL: http://svnweb.freebsd.org/changeset/base/251070 Log: MFC: r247570, r247591 - Make tables, device ID strings etc const. This includes #ifdef'ing 0 aac_command_status_table, which is actually unused since r111532. While at it, make aac_if a pointer to the now const interface tables instead of copying them over to the softc (this alone already reduces the size of aac.ko on amd64 by ~1 KiB). - Remove redundant softc members. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Use pci_enable_busmaster(9) instead of duplicating it. - Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will just fail). - Canonicalize the error messages in case of resource allocation failures. - Add support for using MSI instead of INTx, controllable via the tunable hw.aac.enable_msi (defaulting to on). Modified: stable/9/sys/dev/aac/aac.c stable/9/sys/dev/aac/aac_cam.c stable/9/sys/dev/aac/aac_disk.c stable/9/sys/dev/aac/aac_pci.c stable/9/sys/dev/aac/aac_tables.h stable/9/sys/dev/aac/aacvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac.c Tue May 28 20:58:57 2013 (r251070) @@ -117,7 +117,7 @@ static void aac_sa_set_mailbox(struct aa static int aac_sa_get_mailbox(struct aac_softc *sc, int mb); static void aac_sa_set_interrupts(struct aac_softc *sc, int enable); -struct aac_interface aac_sa_interface = { +const struct aac_interface aac_sa_interface = { aac_sa_get_fwstatus, aac_sa_qnotify, aac_sa_get_istatus, @@ -142,7 +142,7 @@ static int aac_rx_send_command(struct aa static int aac_rx_get_outb_queue(struct aac_softc *sc); static void aac_rx_set_outb_queue(struct aac_softc *sc, int index); -struct aac_interface aac_rx_interface = { +const struct aac_interface aac_rx_interface = { aac_rx_get_fwstatus, aac_rx_qnotify, aac_rx_get_istatus, @@ -169,7 +169,7 @@ static int aac_rkt_send_command(struct a static int aac_rkt_get_outb_queue(struct aac_softc *sc); static void aac_rkt_set_outb_queue(struct aac_softc *sc, int index); -struct aac_interface aac_rkt_interface = { +const struct aac_interface aac_rkt_interface = { aac_rkt_get_fwstatus, aac_rkt_qnotify, aac_rkt_get_istatus, @@ -183,8 +183,8 @@ struct aac_interface aac_rkt_interface = }; /* Debugging and Diagnostics */ -static void aac_describe_controller(struct aac_softc *sc); -static char *aac_describe_code(struct aac_code_lookup *table, +static void aac_describe_controller(struct aac_softc *sc); +static const char *aac_describe_code(const struct aac_code_lookup *table, u_int32_t code); /* Management Interface */ @@ -222,7 +222,7 @@ static struct cdevsw aac_cdevsw = { static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ -static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); /* * Device Interface @@ -634,8 +634,8 @@ aac_free(struct aac_softc *sc) if (sc->aac_intr) bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr); if (sc->aac_irq != NULL) - bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid, - sc->aac_irq); + bus_release_resource(sc->aac_dev, SYS_RES_IRQ, + rman_get_rid(sc->aac_irq), sc->aac_irq); /* destroy data-transfer DMA tag */ if (sc->aac_buffer_dmat) @@ -648,10 +648,10 @@ aac_free(struct aac_softc *sc) /* release the register window mapping */ if (sc->aac_regs_res0 != NULL) bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid0, sc->aac_regs_res0); + rman_get_rid(sc->aac_regs_res0), sc->aac_regs_res0); if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL) bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid1, sc->aac_regs_res1); + rman_get_rid(sc->aac_regs_res1), sc->aac_regs_res1); } /* @@ -1333,9 +1333,6 @@ aac_bio_complete(struct aac_command *cm) } else { bp->bio_error = EIO; bp->bio_flags |= BIO_ERROR; - /* pass an error string out to the disk layer */ - bp->bio_driver1 = aac_describe_code(aac_command_status_table, - status); } aac_biodone(bp); } @@ -1687,7 +1684,7 @@ static int aac_check_firmware(struct aac_softc *sc) { u_int32_t code, major, minor, options = 0, atu_size = 0; - int status; + int rid, status; time_t then; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -1765,7 +1762,7 @@ aac_check_firmware(struct aac_softc *sc) sc->flags |= AAC_FLAGS_SG_64BIT; } if ((options & AAC_SUPPORTED_NEW_COMM) - && sc->aac_if.aif_send_command) + && sc->aac_if->aif_send_command) sc->flags |= AAC_FLAGS_NEW_COMM; if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE) sc->flags |= AAC_FLAGS_ARRAY_64BIT; @@ -1776,17 +1773,15 @@ aac_check_firmware(struct aac_softc *sc) /* Remap mem. resource, if required */ if ((sc->flags & AAC_FLAGS_NEW_COMM) && - atu_size > rman_get_size(sc->aac_regs_res1)) { - bus_release_resource( - sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid1, sc->aac_regs_res1); - sc->aac_regs_res1 = bus_alloc_resource( - sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid1, - 0ul, ~0ul, atu_size, RF_ACTIVE); + atu_size > rman_get_size(sc->aac_regs_res1)) { + rid = rman_get_rid(sc->aac_regs_res1); + bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, rid, + sc->aac_regs_res1); + sc->aac_regs_res1 = bus_alloc_resource(sc->aac_dev, + SYS_RES_MEMORY, &rid, 0ul, ~0ul, atu_size, RF_ACTIVE); if (sc->aac_regs_res1 == NULL) { sc->aac_regs_res1 = bus_alloc_resource_any( - sc->aac_dev, SYS_RES_MEMORY, - &sc->aac_regs_rid1, RF_ACTIVE); + sc->aac_dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->aac_regs_res1 == NULL) { device_printf(sc->aac_dev, "couldn't allocate register window\n"); @@ -1799,7 +1794,6 @@ aac_check_firmware(struct aac_softc *sc) if (sc->aac_hwif == AAC_HWIF_NARK) { sc->aac_regs_res0 = sc->aac_regs_res1; - sc->aac_regs_rid0 = sc->aac_regs_rid1; sc->aac_btag0 = sc->aac_btag1; sc->aac_bhandle0 = sc->aac_bhandle1; } @@ -2003,14 +1997,7 @@ out: static int aac_setup_intr(struct aac_softc *sc) { - sc->aac_irq_rid = 0; - if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, - &sc->aac_irq_rid, - RF_SHAREABLE | - RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, "can't allocate interrupt\n"); - return (EINVAL); - } + if (sc->flags & AAC_FLAGS_NEW_COMM) { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_MPSAFE|INTR_TYPE_BIO, NULL, @@ -2119,7 +2106,7 @@ aac_sync_fib(struct aac_softc *sc, u_int * Note that the queue implementation here is a little funky; neither the PI or * CI will ever be zero. This behaviour is a controller feature. */ -static struct { +static const struct { int size; int notify; } aac_qinfo[] = { @@ -2786,8 +2773,8 @@ aac_describe_controller(struct aac_softc * Look up a text description of a numeric error code and return a pointer to * same. */ -static char * -aac_describe_code(struct aac_code_lookup *table, u_int32_t code) +static const char * +aac_describe_code(const struct aac_code_lookup *table, u_int32_t code) { int i; Modified: stable/9/sys/dev/aac/aac_cam.c ============================================================================== --- stable/9/sys/dev/aac/aac_cam.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_cam.c Tue May 28 20:58:57 2013 (r251070) @@ -92,7 +92,7 @@ static device_method_t aac_pass_methods[ DEVMETHOD(device_probe, aac_cam_probe), DEVMETHOD(device_attach, aac_cam_attach), DEVMETHOD(device_detach, aac_cam_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_pass_driver = { @@ -101,7 +101,7 @@ static driver_t aac_pass_driver = { sizeof(struct aac_cam) }; -DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, 0, 0); +DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, NULL, NULL); MODULE_DEPEND(aacp, cam, 1, 1, 1); static MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); @@ -683,4 +683,3 @@ aac_cam_term_io(struct cam_sim *sim, uni { return (CAM_UA_TERMIO); } - Modified: stable/9/sys/dev/aac/aac_disk.c ============================================================================== --- stable/9/sys/dev/aac/aac_disk.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_disk.c Tue May 28 20:58:57 2013 (r251070) @@ -73,7 +73,7 @@ static device_method_t aac_disk_methods[ DEVMETHOD(device_probe, aac_disk_probe), DEVMETHOD(device_attach, aac_disk_attach), DEVMETHOD(device_detach, aac_disk_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_disk_driver = { @@ -82,7 +82,7 @@ static driver_t aac_disk_driver = { sizeof(struct aac_disk) }; -DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0); +DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, NULL, NULL); /* * Handle open from generic layer. Modified: stable/9/sys/dev/aac/aac_pci.c ============================================================================== --- stable/9/sys/dev/aac/aac_pci.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_pci.c Tue May 28 20:58:57 2013 (r251070) @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$"); static int aac_pci_probe(device_t dev); static int aac_pci_attach(device_t dev); +static int aac_enable_msi = 1; +TUNABLE_INT("hw.aac.enable_msi", &aac_enable_msi); +SYSCTL_INT(_hw_aac, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &aac_enable_msi, 0, + "Enable MSI interrupts"); + static device_method_t aac_methods[] = { /* Device interface */ DEVMETHOD(device_probe, aac_pci_probe), @@ -79,11 +84,10 @@ static driver_t aac_pci_driver = { static devclass_t aac_devclass; -DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, 0, 0); +DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, NULL, NULL); MODULE_DEPEND(aac, pci, 1, 1, 1); - -struct aac_ident +static const struct aac_ident { u_int16_t vendor; u_int16_t device; @@ -91,7 +95,7 @@ struct aac_ident u_int16_t subdevice; int hwif; int quirks; - char *desc; + const char *desc; } aac_identifiers[] = { {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0, "Dell PERC 2/Si"}, @@ -139,7 +143,6 @@ struct aac_ident "Adaptec SCSI RAID 2230S"}, {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, "Adaptec SCSI RAID 2130S"}, - {0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"}, {0x9005, 0x0285, 0x17aa, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | @@ -276,7 +279,8 @@ struct aac_ident "AOC-USAS-S8iR-LP"}, {0, 0, 0, 0, 0, 0, 0} }; -struct aac_ident + +static const struct aac_ident aac_family_identifiers[] = { {0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0, "Adaptec RAID Controller"}, @@ -285,10 +289,10 @@ aac_family_identifiers[] = { {0, 0, 0, 0, 0, 0, 0} }; -static struct aac_ident * +static const struct aac_ident * aac_find_ident(device_t dev) { - struct aac_ident *m; + const struct aac_ident *m; u_int16_t vendid, devid, sub_vendid, sub_devid; vendid = pci_get_vendor(dev); @@ -317,7 +321,7 @@ aac_find_ident(device_t dev) static int aac_pci_probe(device_t dev) { - struct aac_ident *id; + const struct aac_ident *id; fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -335,9 +339,8 @@ static int aac_pci_attach(device_t dev) { struct aac_softc *sc; - struct aac_ident *id; - int error; - u_int32_t command; + const struct aac_ident *id; + int count, error, reg, rid; fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -345,7 +348,6 @@ aac_pci_attach(device_t dev) * Initialise softc. */ sc = device_get_softc(dev); - bzero(sc, sizeof(*sc)); sc->aac_dev = dev; /* assume failure is 'not configured' */ @@ -354,55 +356,66 @@ aac_pci_attach(device_t dev) /* * Verify that the adapter is correctly set up in PCI space. */ - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - if (!(command & PCIM_CMD_BUSMASTEREN)) { - device_printf(sc->aac_dev, "can't enable bus-master feature\n"); - goto out; - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(sc->aac_dev, "memory window not available\n"); + pci_enable_busmaster(dev); + if (!(pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_BUSMASTEREN)) { + device_printf(dev, "can't enable bus-master feature\n"); goto out; } /* - * Allocate the PCI register window. + * Allocate the PCI register window(s). */ - sc->aac_regs_rid0 = PCIR_BAR(0); - if ((sc->aac_regs_res0 = bus_alloc_resource_any(sc->aac_dev, - SYS_RES_MEMORY, &sc->aac_regs_rid0, RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, - "couldn't allocate register window 0\n"); + rid = PCIR_BAR(0); + if ((sc->aac_regs_res0 = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { + device_printf(dev, "can't allocate register window 0\n"); goto out; } sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0); sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0); if (sc->aac_hwif == AAC_HWIF_NARK) { - sc->aac_regs_rid1 = PCIR_BAR(1); - if ((sc->aac_regs_res1 = bus_alloc_resource_any(sc->aac_dev, - SYS_RES_MEMORY, &sc->aac_regs_rid1, RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, - "couldn't allocate register window 1\n"); + rid = PCIR_BAR(1); + if ((sc->aac_regs_res1 = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { + device_printf(dev, + "can't allocate register window 1\n"); goto out; } sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); } else { sc->aac_regs_res1 = sc->aac_regs_res0; - sc->aac_regs_rid1 = sc->aac_regs_rid0; sc->aac_btag1 = sc->aac_btag0; sc->aac_bhandle1 = sc->aac_bhandle0; } /* + * Allocate the interrupt. + */ + rid = 0; + count = 0; + if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) { + count = pci_msi_count(dev); + if (count > 1) + count = 1; + else + count = 0; + if (count == 1 && pci_alloc_msi(dev, &count) == 0) + rid = 1; + } + if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, + &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE))) == NULL) { + device_printf(dev, "can't allocate interrupt\n"); + goto out; + } + + /* * 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(bus_get_dma_tag(sc->aac_dev), /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -413,7 +426,7 @@ aac_pci_attach(device_t dev) 0, /* flags */ NULL, NULL, /* No locking needed */ &sc->aac_parent_dmat)) { - device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); + device_printf(dev, "can't allocate parent DMA tag\n"); goto out; } @@ -427,19 +440,19 @@ aac_pci_attach(device_t dev) case AAC_HWIF_I960RX: case AAC_HWIF_NARK: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK"); - sc->aac_if = aac_rx_interface; + sc->aac_if = &aac_rx_interface; break; case AAC_HWIF_STRONGARM: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); - sc->aac_if = aac_sa_interface; + sc->aac_if = &aac_sa_interface; break; case AAC_HWIF_RKT: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); - sc->aac_if = aac_rkt_interface; + sc->aac_if = &aac_rkt_interface; break; default: sc->aac_hwif = AAC_HWIF_UNKNOWN; - device_printf(sc->aac_dev, "unknown hardware type\n"); + device_printf(dev, "unknown hardware type\n"); error = ENXIO; goto out; } @@ -472,7 +485,7 @@ static device_method_t aacch_methods[] = DEVMETHOD(device_probe, aacch_probe), DEVMETHOD(device_attach, aacch_attach), DEVMETHOD(device_detach, aacch_detach), - { 0, 0 } + DEVMETHOD_END }; struct aacch_softc { @@ -486,7 +499,7 @@ static driver_t aacch_driver = { }; static devclass_t aacch_devclass; -DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, 0, 0); +DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); static int aacch_probe(device_t dev) Modified: stable/9/sys/dev/aac/aac_tables.h ============================================================================== --- stable/9/sys/dev/aac/aac_tables.h Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_tables.h Tue May 28 20:58:57 2013 (r251070) @@ -27,13 +27,14 @@ * $FreeBSD$ */ +#if 0 /* * Status codes for block read/write commands, etc. * * XXX many of these would not normally be returned, as they are * relevant only to FSA operations. */ -static struct aac_code_lookup aac_command_status_table[] = { +static const struct aac_code_lookup aac_command_status_table[] = { {"OK", ST_OK}, {"operation not permitted", ST_PERM}, {"not found", ST_NOENT}, @@ -75,8 +76,9 @@ static struct aac_code_lookup aac_comman }; #define AAC_COMMAND_STATUS(x) aac_describe_code(aac_command_status_table, x) +#endif -static struct aac_code_lookup aac_cpu_variant[] = { +static const struct aac_code_lookup aac_cpu_variant[] = { {"i960JX", CPUI960_JX}, {"i960CX", CPUI960_CX}, {"i960HX", CPUI960_HX}, @@ -93,7 +95,7 @@ static struct aac_code_lookup aac_cpu_va {"Unknown processor", 0} }; -static struct aac_code_lookup aac_battery_platform[] = { +static const struct aac_code_lookup aac_battery_platform[] = { {"required battery present", PLATFORM_BAT_REQ_PRESENT}, {"REQUIRED BATTERY NOT PRESENT", PLATFORM_BAT_REQ_NOTPRESENT}, {"optional battery present", PLATFORM_BAT_OPT_PRESENT}, @@ -103,7 +105,7 @@ static struct aac_code_lookup aac_batter {"unknown battery platform", 0} }; -static struct aac_code_lookup aac_container_types[] = { +static const struct aac_code_lookup aac_container_types[] = { {"Volume", CT_VOLUME}, {"RAID 1 (Mirror)", CT_MIRROR}, {"RAID 0 (Stripe)", CT_STRIPE}, @@ -126,4 +128,3 @@ static struct aac_code_lookup aac_contai {NULL, 0}, {"unknown", 0} }; - Modified: stable/9/sys/dev/aac/aacvar.h ============================================================================== --- stable/9/sys/dev/aac/aacvar.h Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aacvar.h Tue May 28 20:58:57 2013 (r251070) @@ -33,10 +33,13 @@ #include #include #include -#include #include +#include +#include #include +SYSCTL_DECL(_hw_aac); + #define AAC_TYPE_DEVO 1 #define AAC_TYPE_ALPHA 2 #define AAC_TYPE_BETA 3 @@ -242,28 +245,28 @@ struct aac_interface int (*aif_get_outb_queue)(struct aac_softc *sc); void (*aif_set_outb_queue)(struct aac_softc *sc, int index); }; -extern struct aac_interface aac_rx_interface; -extern struct aac_interface aac_sa_interface; -extern struct aac_interface aac_fa_interface; -extern struct aac_interface aac_rkt_interface; - -#define AAC_GET_FWSTATUS(sc) ((sc)->aac_if.aif_get_fwstatus((sc))) -#define AAC_QNOTIFY(sc, qbit) ((sc)->aac_if.aif_qnotify((sc), (qbit))) -#define AAC_GET_ISTATUS(sc) ((sc)->aac_if.aif_get_istatus((sc))) -#define AAC_CLEAR_ISTATUS(sc, mask) ((sc)->aac_if.aif_clr_istatus((sc), \ +extern const struct aac_interface aac_rx_interface; +extern const struct aac_interface aac_sa_interface; +extern const struct aac_interface aac_fa_interface; +extern const struct aac_interface aac_rkt_interface; + +#define AAC_GET_FWSTATUS(sc) ((sc)->aac_if->aif_get_fwstatus((sc))) +#define AAC_QNOTIFY(sc, qbit) ((sc)->aac_if->aif_qnotify((sc), (qbit))) +#define AAC_GET_ISTATUS(sc) ((sc)->aac_if->aif_get_istatus((sc))) +#define AAC_CLEAR_ISTATUS(sc, mask) ((sc)->aac_if->aif_clr_istatus((sc), \ (mask))) #define AAC_SET_MAILBOX(sc, command, arg0, arg1, arg2, arg3) \ - ((sc)->aac_if.aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \ + ((sc)->aac_if->aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \ (arg3))) -#define AAC_GET_MAILBOX(sc, mb) ((sc)->aac_if.aif_get_mailbox((sc), \ +#define AAC_GET_MAILBOX(sc, mb) ((sc)->aac_if->aif_get_mailbox((sc), \ (mb))) -#define AAC_MASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \ +#define AAC_MASK_INTERRUPTS(sc) ((sc)->aac_if->aif_set_interrupts((sc), \ 0)) -#define AAC_UNMASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \ +#define AAC_UNMASK_INTERRUPTS(sc) ((sc)->aac_if->aif_set_interrupts((sc), \ 1)) -#define AAC_SEND_COMMAND(sc, cm) ((sc)->aac_if.aif_send_command((sc), (cm))) -#define AAC_GET_OUTB_QUEUE(sc) ((sc)->aac_if.aif_get_outb_queue((sc))) -#define AAC_SET_OUTB_QUEUE(sc, idx) ((sc)->aac_if.aif_set_outb_queue((sc), (idx))) +#define AAC_SEND_COMMAND(sc, cm) ((sc)->aac_if->aif_send_command((sc), (cm))) +#define AAC_GET_OUTB_QUEUE(sc) ((sc)->aac_if->aif_get_outb_queue((sc))) +#define AAC_SET_OUTB_QUEUE(sc, idx) ((sc)->aac_if->aif_set_outb_queue((sc), (idx))) #define AAC_MEM0_SETREG4(sc, reg, val) bus_space_write_4(sc->aac_btag0, \ sc->aac_bhandle0, reg, val) @@ -307,14 +310,12 @@ struct aac_softc /* bus connections */ device_t aac_dev; struct resource *aac_regs_res0, *aac_regs_res1; /* reg. if. window */ - int aac_regs_rid0, aac_regs_rid1; /* resource ID */ bus_space_handle_t aac_bhandle0, aac_bhandle1; /* bus space handle */ bus_space_tag_t aac_btag0, aac_btag1; /* bus space tag */ bus_dma_tag_t aac_parent_dmat; /* parent DMA tag */ bus_dma_tag_t aac_buffer_dmat; /* data buffer/command * DMA tag */ struct resource *aac_irq; /* interrupt */ - int aac_irq_rid; void *aac_intr; /* interrupt handle */ eventhandler_tag eh; @@ -339,7 +340,7 @@ struct aac_softc * DMA map */ struct aac_common *aac_common; u_int32_t aac_common_busaddr; - struct aac_interface aac_if; + const struct aac_interface *aac_if; /* command/fib resources */ bus_dma_tag_t aac_fib_dmat; /* DMA tag for allocing FIBs */ @@ -499,7 +500,7 @@ extern void aac_print_aif(struct aac_sof #endif struct aac_code_lookup { - char *string; + const char *string; u_int32_t code; }; @@ -581,7 +582,6 @@ aac_remove_ ## name (struct aac_command cm->cm_flags &= ~AAC_ON_ ## index; \ AACQ_REMOVE(cm->cm_sc, index); \ } \ -struct hack AACQ_COMMAND_QUEUE(free, AACQ_FREE); AACQ_COMMAND_QUEUE(ready, AACQ_READY); @@ -644,4 +644,3 @@ aac_release_sync_fib(struct aac_softc *s mtx_assert(&sc->aac_io_lock, MA_OWNED); } - From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:05:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEA1E583; Tue, 28 May 2013 21:05:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF21F93E; Tue, 28 May 2013 21:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SL57Bo044344; Tue, 28 May 2013 21:05:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SL56I0044336; Tue, 28 May 2013 21:05:06 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282105.r4SL56I0044336@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 21:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251071 - in head/lib/libc: gen net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:05:08 -0000 Author: emaste Date: Tue May 28 21:05:06 2013 New Revision: 251071 URL: http://svnweb.freebsd.org/changeset/base/251071 Log: Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Modified: head/lib/libc/gen/fts-compat.h head/lib/libc/net/name6.c head/lib/libc/sys/sctp_generic_recvmsg.2 head/lib/libc/sys/sctp_generic_sendmsg.2 head/lib/libc/sys/sctp_peeloff.2 Modified: head/lib/libc/gen/fts-compat.h ============================================================================== --- head/lib/libc/gen/fts-compat.h Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/gen/fts-compat.h Tue May 28 21:05:06 2013 (r251071) @@ -10,11 +10,7 @@ * 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 the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/net/name6.c Tue May 28 21:05:06 2013 (r251071) @@ -42,11 +42,7 @@ * 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 the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/lib/libc/sys/sctp_generic_recvmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_recvmsg.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_generic_recvmsg.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/sys/sctp_generic_sendmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_sendmsg.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_generic_sendmsg.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libc/sys/sctp_peeloff.2 ============================================================================== --- head/lib/libc/sys/sctp_peeloff.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_peeloff.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:21:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 227FDD48; Tue, 28 May 2013 21:21:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15326A5B; Tue, 28 May 2013 21:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLLkib050771; Tue, 28 May 2013 21:21:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLLkT4050770; Tue, 28 May 2013 21:21:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305282121.r4SLLkT4050770@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 28 May 2013 21:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251072 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:21:47 -0000 Author: pjd Date: Tue May 28 21:21:46 2013 New Revision: 251072 URL: http://svnweb.freebsd.org/changeset/base/251072 Log: MFp4 @229085: Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given, as the result won't be used then. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 28 21:05:06 2013 (r251071) +++ head/usr.bin/kdump/kdump.c Tue May 28 21:21:46 2013 (r251072) @@ -1205,6 +1205,11 @@ ktrgenio(struct ktr_genio *ktr, int len) static int screenwidth = 0; int i, binary; + printf("fd %d %s %d byte%s\n", ktr->ktr_fd, + ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen, + datalen == 1 ? "" : "s"); + if (suppressdata) + return; if (screenwidth == 0) { struct winsize ws; @@ -1214,11 +1219,6 @@ ktrgenio(struct ktr_genio *ktr, int len) else screenwidth = 80; } - printf("fd %d %s %d byte%s\n", ktr->ktr_fd, - ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen, - datalen == 1 ? "" : "s"); - if (suppressdata) - return; if (maxdata && datalen > maxdata) datalen = maxdata; From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:22:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C2C4EC7; Tue, 28 May 2013 21:22:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id C8491A68; Tue, 28 May 2013 21:22:14 +0000 (UTC) Received: from glenbarber.us (static-108-16-252-210.phlapa.fios.verizon.net [108.16.252.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4B90723F804; Tue, 28 May 2013 17:22:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 4B90723F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 28 May 2013 17:22:11 -0400 From: Glen Barber To: Peter Wemm Subject: Re: svn commit: r251058 - head Message-ID: <20130528212211.GA1652@glenbarber.us> References: <201305280952.r4S9qShX012991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:22:15 -0000 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2013 at 01:04:56PM -0700, Peter Wemm wrote: > On Tue, May 28, 2013 at 2:52 AM, Dag-Erling Sm=F8rgrav = wrote: > > Author: des > > Date: Tue May 28 09:52:28 2013 > > New Revision: 251058 > > URL: http://svnweb.freebsd.org/changeset/base/251058 > > > > Log: > > During buildkernel, print a banner before building modules. > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) > > +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) > > @@ -983,9 +983,16 @@ buildkernel: > > .endif > > @echo > > @echo "--------------------------------------------------------= ------" > > - @echo ">>> stage 3.2: building everything" > > + @echo ">>> stage 3.2: building the kernel" > > @echo "--------------------------------------------------------= ------" > > - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ > > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_O= BJ > > + @echo > > +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${K= ERNSRCDIR}/modules) > > + @echo "--------------------------------------------------------= ------" > > + @echo ">>> stage 3.3: building the modules" > > + @echo "--------------------------------------------------------= ------" > > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_= OBJ > > +.endif > > @echo "--------------------------------------------------------= ------" > > @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=3DC= date`" > > @echo "--------------------------------------------------------= ------" >=20 > Please back this out or fix it ASAP. You broke every single machine in > the freebsd.org cluster. >=20 > make: don't know how to make modules-all. Stop > *** [buildkernel] Error code 2 >=20 > You are causing it to stop respecting makeoptions in the kernel config > files. eg: >=20 > eg: >=20 > makeoptions NO_MODULES=3Dno > or > makeoptions MODULES_OVERRIDE=3D"zfs opensolaris" >=20 > If you really want this echo here then you're going to need to reach > down into the internals and make 'modules-all' work even when > NO_MODULES is set. This also breaks i386 PAE build in tinderbox... make: don't know how to make modules-all. Stop make: stopped in /obj/i386.i386/src/sys/PAE *** Error code 2 Stop. make: stopped in /src *** Error code 1 Stop in /src. TB --- 2013-05-28 21:10:00 - WARNING: /usr/bin/make returned exit code 1 TB --- 2013-05-28 21:10:00 - ERROR: failed to build PAE kernel TB --- 2013-05-28 21:10:00 - 18049.16 user 3184.18 system 22779.88 real http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full Glen --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRpSADAAoJEFJPDDeguUajSToH/ArJ9GNXt0uPZ/GaNb3yUejf uJtCevrtHnBhDudrSuhKlTCXzH4fs5Nveg6/TsAym9au5VIaE0CUtXs/uxSw6FN0 aH5KYcK5uJ/x2cD8nvJfrQOdXuocu1VA6J96zoPgnqmYDbqQVs+ykYHb8NTNzeh6 bYRUA6oOsJYg2KI90XJ7j2z1vLXaa7GbdATmFBsMP7NmosW69EtMfJqpT4QH6DJm zlQnw11Fp5+8PbYLg4bpYt2t6G2kYvoV024ZLjNAPokgfItmln8GxRTPwuCQ7QLc 1htKPSX9KqRKmqkUZWCFB1CUI70BQdUZGrfViGoVOCYuXzdA79kEd/H7O04N6BY= =hHgM -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe-- From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:25:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 83CC7147; Tue, 28 May 2013 21:25:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76621AA2; Tue, 28 May 2013 21:25:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLPTn2051503; Tue, 28 May 2013 21:25:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLPTSw051502; Tue, 28 May 2013 21:25:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305282125.r4SLPTSw051502@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 28 May 2013 21:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251073 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:25:29 -0000 Author: pjd Date: Tue May 28 21:25:28 2013 New Revision: 251073 URL: http://svnweb.freebsd.org/changeset/base/251073 Log: MFp4 @229086: Make use of Capsicum to protect kdump(1), as it might be used to parse data from untrusted sources: - Sandbox kdump(1) using capability mode. - Limit stdin descriptor (where opened file is moved to) to only CAP_READ and CAP_FSTAT rights. - Limit stdout descriptor to only CAP_WRITE, CAP_FSTAT and CAP_IOCTL. Plus limit allowed ioctls to TIOCGETA only, which is needed for isatty() to work. - Limit stderr descriptor to only CAP_WRITE and CAP_FSTAT. In addition if the -s option is not given, grant CAP_IOCTL right, but allow for TIOCGWINSZ ioctl only, as we need screen width to dump the data. - Before entering capability mode call catopen("libc", NL_CAT_LOCALE), which opens message catalogs and caches data, so that strerror(3) and strsignal(3) can work in a sandbox. Sponsored by: The FreeBSD Foundation Discussed with: rwatson Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 28 21:21:46 2013 (r251072) +++ head/usr.bin/kdump/kdump.c Tue May 28 21:25:28 2013 (r251073) @@ -46,6 +46,7 @@ extern int errno; #include #undef _KERNEL #include +#include #include #define _KERNEL #include @@ -73,10 +74,12 @@ extern int errno; #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -105,6 +108,7 @@ void ktrstruct(char *, size_t); void ktrcapfail(struct ktr_cap_fail *); void ktrfault(struct ktr_fault *); void ktrfaultend(struct ktr_faultend *); +void limitfd(int fd); void usage(void); void ioctlname(unsigned long, int); @@ -230,6 +234,18 @@ main(int argc, char *argv[]) errx(1, "%s", strerror(ENOMEM)); if (!freopen(tracefile, "r", stdin)) err(1, "%s", tracefile); + + /* + * Cache NLS data before entering capability mode. + * XXXPJD: There should be strerror_init() and strsignal_init() in libc. + */ + (void)catopen("libc", NL_CAT_LOCALE); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + limitfd(STDIN_FILENO); + limitfd(STDOUT_FILENO); + limitfd(STDERR_FILENO); + TAILQ_INIT(&trace_procs); drop_logged = 0; while (fread_tail(&ktr_header, sizeof(struct ktr_header), 1)) { @@ -331,6 +347,40 @@ main(int argc, char *argv[]) return 0; } +void +limitfd(int fd) +{ + cap_rights_t rights; + unsigned long cmd; + + rights = CAP_FSTAT; + cmd = -1; + + switch (fd) { + case STDIN_FILENO: + rights |= CAP_READ; + break; + case STDOUT_FILENO: + rights |= CAP_IOCTL | CAP_WRITE; + cmd = TIOCGETA; /* required by isatty(3) in printf(3) */ + break; + case STDERR_FILENO: + rights |= CAP_WRITE; + if (!suppressdata) { + rights |= CAP_IOCTL; + cmd = TIOCGWINSZ; + } + break; + default: + abort(); + } + + if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for descriptor %d", fd); + if (cmd != -1 && cap_ioctls_limit(fd, &cmd, 1) < 0 && errno != ENOSYS) + err(1, "unable to limit ioctls for descriptor %d", fd); +} + int fread_tail(void *buf, int size, int num) { From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:29:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73B6832E; Tue, 28 May 2013 21:29:06 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65852AD0; Tue, 28 May 2013 21:29:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLT6EG052166; Tue, 28 May 2013 21:29:06 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLT67h052165; Tue, 28 May 2013 21:29:06 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201305282129.r4SLT67h052165@svn.freebsd.org> From: Peter Wemm Date: Tue, 28 May 2013 21:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251074 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:29:06 -0000 Author: peter Date: Tue May 28 21:29:05 2013 New Revision: 251074 URL: http://svnweb.freebsd.org/changeset/base/251074 Log: Temporarily revert r251058 - it breaks documented use of makeoptions including the tinderbox. http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full make: don't know how to make modules-all. Stop make: stopped in /obj/i386.i386/src/sys/PAE *** Error code 2 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 21:25:28 2013 (r251073) +++ head/Makefile.inc1 Tue May 28 21:29:05 2013 (r251074) @@ -983,16 +983,9 @@ buildkernel: .endif @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 3.2: building the kernel" + @echo ">>> stage 3.2: building everything" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ - @echo -.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) - @echo "--------------------------------------------------------------" - @echo ">>> stage 3.3: building the modules" - @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ -.endif + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" From owner-svn-src-all@FreeBSD.ORG Tue May 28 21:57:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 59EB2B9F; Tue, 28 May 2013 21:57:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB43D26; Tue, 28 May 2013 21:57:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLvtx0061984; Tue, 28 May 2013 21:57:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLvtct061983; Tue, 28 May 2013 21:57:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282157.r4SLvtct061983@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 21:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251075 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 21:57:56 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 21:57:55 2013 New Revision: 251075 URL: http://svnweb.freebsd.org/changeset/base/251075 Log: Update comments to reflect use of svn/svnup to keep the src/ tree up to date. MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 21:29:05 2013 (r251074) +++ head/Makefile.inc1 Tue May 28 21:57:55 2013 (r251075) @@ -35,7 +35,7 @@ # buildworld - rebuild *everything*, including glue to help do upgrades # installworld- install everything built by "buildworld" # doxygen - build API documentation of the kernel -# update - convenient way to update your source tree (eg: cvsup/cvs) +# update - convenient way to update your source tree (eg: svn/svnup) # # Standard targets (not defined here) are documented in the makefiles in # /usr/share/mk. These include: @@ -1076,7 +1076,7 @@ doxygen: # # update # -# Update the source tree(s), by running cvsup/cvs/svn to update to the +# Update the source tree(s), by running svn/svnup to update to the # latest copy. # update: From owner-svn-src-all@FreeBSD.ORG Tue May 28 22:00:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FC59D50; Tue, 28 May 2013 22:00:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3250AD50; Tue, 28 May 2013 22:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM0cf8062835; Tue, 28 May 2013 22:00:38 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM0cZX062834; Tue, 28 May 2013 22:00:38 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201305282200.r4SM0cZX062834@svn.freebsd.org> From: David C Somayajulu Date: Tue, 28 May 2013 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251076 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 22:00:38 -0000 Author: davidcs Date: Tue May 28 22:00:37 2013 New Revision: 251076 URL: http://svnweb.freebsd.org/changeset/base/251076 Log: Avoid reading back certain registers following a write. This is an optimization. Submitted by: David C Somayajulu Approved by: George Neville Neil Modified: head/sys/dev/qlxgbe/ql_hw.h Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Tue May 28 21:57:55 2013 (r251075) +++ head/sys/dev/qlxgbe/ql_hw.h Tue May 28 22:00:37 2013 (r251076) @@ -1533,16 +1533,16 @@ typedef struct _qla_hw { } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ - WRITE_REG32(ha, prod_reg, val); + bus_write_4((ha->pci_reg), prod_reg, val); #define QL_UPDATE_TX_PRODUCER_INDEX(ha, val, i) \ - WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) + WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) #define QL_UPDATE_SDS_CONSUMER_INDEX(ha, i, val) \ - WRITE_REG32(ha, ha->hw.sds[i].sds_consumer, val) - -#define QL_ENABLE_INTERRUPTS(ha, i) WRITE_REG32(ha, ha->hw.intr_src[i], 0); + bus_write_4((ha->pci_reg), (ha->hw.sds[i].sds_consumer), val); +#define QL_ENABLE_INTERRUPTS(ha, i) \ + bus_write_4((ha->pci_reg), (ha->hw.intr_src[i]), 0); #define QL_BUFFER_ALIGN 16 From owner-svn-src-all@FreeBSD.ORG Tue May 28 22:07:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CACC4F40; Tue, 28 May 2013 22:07:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3AB4D88; Tue, 28 May 2013 22:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM7Nek065772; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM7Nh2065771; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305282207.r4SM7Nh2065771@svn.freebsd.org> From: Attilio Rao Date: Tue, 28 May 2013 22:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251077 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 22:07:23 -0000 Author: attilio Date: Tue May 28 22:07:23 2013 New Revision: 251077 URL: http://svnweb.freebsd.org/changeset/base/251077 Log: o Change the locking scheme for swp_bcount. It can now be accessed with a write lock on the object containing it OR with a read lock on the object containing it along with the swhash_mtx. o Remove some duplicate assertions for swap_pager_freespace() and swap_pager_unswapped() but keep the object locking references for documentation. Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue May 28 22:00:37 2013 (r251076) +++ head/sys/vm/swap_pager.c Tue May 28 22:07:23 2013 (r251077) @@ -822,12 +822,13 @@ swp_pager_freeswapspace(daddr_t blk, int * The external callers of this routine typically have already destroyed * or renamed vm_page_t's associated with this range in the object so * we should be ok. + * + * The object must be locked. */ void swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) { - VM_OBJECT_ASSERT_WLOCKED(object); swp_pager_meta_free(object, start, size); } @@ -999,7 +1000,7 @@ swap_pager_haspage(vm_object_t object, v { daddr_t blk0; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * do we have good backing store at the requested index ? */ @@ -1065,12 +1066,13 @@ swap_pager_haspage(vm_object_t object, v * depends on it. * * This routine may not sleep. + * + * The object containing the page must be locked. */ static void swap_pager_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(m->object); swp_pager_meta_ctl(m->object, m->pindex, SWM_FREE); } @@ -1916,7 +1918,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count) { - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); if (object->type != OBJT_SWAP) return; @@ -2021,7 +2023,7 @@ swp_pager_meta_ctl(vm_object_t object, v daddr_t r1; int idx; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet. From owner-svn-src-all@FreeBSD.ORG Tue May 28 22:07:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 444E6ED; Tue, 28 May 2013 22:07:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 373ECD8A; Tue, 28 May 2013 22:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM7Ww6065841; Tue, 28 May 2013 22:07:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM7We8065840; Tue, 28 May 2013 22:07:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305282207.r4SM7We8065840@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 28 May 2013 22:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251078 - head/bin/sleep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 22:07:32 -0000 Author: jilles Date: Tue May 28 22:07:31 2013 New Revision: 251078 URL: http://svnweb.freebsd.org/changeset/base/251078 Log: sleep: Improve nanosleep() error handling: * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Modified: head/bin/sleep/sleep.c Modified: head/bin/sleep/sleep.c ============================================================================== --- head/bin/sleep/sleep.c Tue May 28 22:07:23 2013 (r251077) +++ head/bin/sleep/sleep.c Tue May 28 22:07:31 2013 (r251078) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -87,8 +88,8 @@ main(int argc, char *argv[]) warnx("about %d second(s) left out of the original %d", (int)time_to_sleep.tv_sec, (int)original); report_requested = 0; - } else - break; + } else if (errno != EINTR) + err(1, "nanosleep"); } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue May 28 22:36:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6733A713; Tue, 28 May 2013 22:36:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58E0FEDB; Tue, 28 May 2013 22:36:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SMa2qh075795; Tue, 28 May 2013 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SMa2Cp075794; Tue, 28 May 2013 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305282236.r4SMa2Cp075794@svn.freebsd.org> From: Rick Macklem Date: Tue, 28 May 2013 22:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251079 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 22:36:02 -0000 Author: rmacklem Date: Tue May 28 22:36:01 2013 New Revision: 251079 URL: http://svnweb.freebsd.org/changeset/base/251079 Log: Post-r248567, there were times when the client would return a truncated directory for some NFS servers. This turned out to be because the size of a directory reported by an NFS server can be smaller that the ufs-like directory created from the RPC XDR in the client. This patch fixes the problem by changing r248567 so that vnode_pager_setsize() is only done for regular files. Reported and tested by: hartmut.brandt@dlr.de Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue May 28 22:07:31 2013 (r251078) +++ head/sys/fs/nfsclient/nfs_clport.c Tue May 28 22:36:01 2013 (r251079) @@ -448,12 +448,10 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - } else { - np->n_size = vap->va_size; - } - if (vap->va_type == VREG || vap->va_type == VDIR) { setnsize = 1; nsize = vap->va_size; + } else { + np->n_size = vap->va_size; } } /* From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:32:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0CDE7D4 for ; Tue, 28 May 2013 23:32:42 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx1.freebsd.org (Postfix) with ESMTP id 8D27B2A0 for ; Tue, 28 May 2013 23:32:41 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id 10so8225240pdi.3 for ; Tue, 28 May 2013 16:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=k6GW0Hux/flVnW31a+L1QQyZ/T8kZB+uuzcvm7CWofk=; b=kMFCghv+K9n2BAizJdRZ85tN6gB84DCnyBD3SIZ5NxhXA6MlDB+TPaV0Tw5GNkLtOG KYhfSEO1icJbknd6aZLTWmJrcJkyZ7llywHJGVSBQBD2M+PjwRd4RgCJ2yYeYF6vPeRN p3xCK+K+OaU47YS8cqC+xpOht52t1YhxFm5m8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=k6GW0Hux/flVnW31a+L1QQyZ/T8kZB+uuzcvm7CWofk=; b=XbZCSRS/07s2l5PcWgvNcIkw9GHwSqRUAgwHSO6+PDxM9r4TuaGReIBiGsotUdx1r3 zXhHERJQ8Eb5mw035D1vbZA8X+D21kZOGOP3OmOwNqwwda+SxUF3QQEXm1lqhUJZMRs8 5r2L8YIgn59jjVnAqdNGufvyq09fMoG8yIKrfqN3q1jg8CBfeMvSA3LEAf99hy3WAFaH b+/7F3+bnwAp3aVxrtm1z6oJgQ/Bm8rgJyiO6q6gnfqm1zmvtL5RvirHG4slXb0v9qBg KTmj9gDG0rHpxnbkEl3k+Tz7vM2tsE1sDo2oRzjF9wOSaBf3b/EhUyWS0cMOx4keH8Lr fiZA== X-Received: by 10.66.27.243 with SMTP id w19mr568266pag.180.1369783955776; Tue, 28 May 2013 16:32:35 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.84.100 with HTTP; Tue, 28 May 2013 16:32:05 -0700 (PDT) In-Reply-To: <201305282207.r4SM7We8065840@svn.freebsd.org> References: <201305282207.r4SM7We8065840@svn.freebsd.org> From: Eitan Adler Date: Wed, 29 May 2013 01:32:05 +0200 X-Google-Sender-Auth: OLR93XMwrA1_VpyS8IOX9mukG4g Message-ID: Subject: Re: svn commit: r251078 - head/bin/sleep To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmxDHwrD7/fHe0CC0XoYY657gdMwmFEk2RmeciDJJfMouurwpQNW9ALpUVYy8jb3Y5yr9gX Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:32:42 -0000 On 29 May 2013 00:07, Jilles Tjoelker wrote: > Author: jilles > Date: Tue May 28 22:07:31 2013 > New Revision: 251078 > URL: http://svnweb.freebsd.org/changeset/base/251078 > > Log: > sleep: Improve nanosleep() error handling: > > * Work around kernel bugs that cause a spurious [EINTR] return if a > debugger (such as truss(1)) is attached. The the fact that this is a workaround be noted in a comment so the code may be removed when the bug is fixed? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:33:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A7F4846; Tue, 28 May 2013 23:33:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEA32A8; Tue, 28 May 2013 23:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNX5CB096037; Tue, 28 May 2013 23:33:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNX4aT096026; Tue, 28 May 2013 23:33:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282333.r4SNX4aT096026@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 23:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251081 - in stable/9/sys: cam cam/ata dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:33:05 -0000 Author: marius Date: Tue May 28 23:33:03 2013 New Revision: 251081 URL: http://svnweb.freebsd.org/changeset/base/251081 Log: MFC: r249199 Unbreak ATA_NO_48BIT_DMA with ATA_CAM by treating 48-bit DMA as an optional property with PATA transport. Reviewed by: mav Modified: stable/9/sys/cam/ata/ata_all.h stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_ccb.h stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.h ============================================================================== --- stable/9/sys/cam/ata/ata_all.h Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_all.h Tue May 28 23:33:03 2013 (r251081) @@ -35,8 +35,9 @@ struct ccb_ataio; struct cam_periph; union ccb; -#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ -#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ +#define SID_DMA48 0x01 /* Abuse inq_flags bit to track enabled DMA48. */ +#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ +#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ struct ata_cmd { u_int8_t flags; /* ATA command flags */ Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_da.c Tue May 28 23:33:03 2013 (r251081) @@ -75,18 +75,19 @@ typedef enum { } ada_state; typedef enum { - ADA_FLAG_PACK_INVALID = 0x001, - ADA_FLAG_CAN_48BIT = 0x002, - ADA_FLAG_CAN_FLUSHCACHE = 0x004, - ADA_FLAG_CAN_NCQ = 0x008, - ADA_FLAG_CAN_DMA = 0x010, - ADA_FLAG_NEED_OTAG = 0x020, - ADA_FLAG_WENT_IDLE = 0x040, - ADA_FLAG_CAN_TRIM = 0x080, - ADA_FLAG_OPEN = 0x100, - ADA_FLAG_SCTX_INIT = 0x200, - ADA_FLAG_CAN_CFA = 0x400, - ADA_FLAG_CAN_POWERMGT = 0x800 + ADA_FLAG_PACK_INVALID = 0x0001, + ADA_FLAG_CAN_48BIT = 0x0002, + ADA_FLAG_CAN_FLUSHCACHE = 0x0004, + ADA_FLAG_CAN_NCQ = 0x0008, + ADA_FLAG_CAN_DMA = 0x0010, + ADA_FLAG_NEED_OTAG = 0x0020, + ADA_FLAG_WENT_IDLE = 0x0040, + ADA_FLAG_CAN_TRIM = 0x0080, + ADA_FLAG_OPEN = 0x0100, + ADA_FLAG_SCTX_INIT = 0x0200, + ADA_FLAG_CAN_CFA = 0x0400, + ADA_FLAG_CAN_POWERMGT = 0x0800, + ADA_FLAG_CAN_DMA48 = 0x1000 } ada_flags; typedef enum { @@ -907,6 +908,15 @@ adaasync(void *callback_arg, u_int32_t c softc->flags |= ADA_FLAG_CAN_DMA; else softc->flags &= ~ADA_FLAG_CAN_DMA; + if (cgd.ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) { + softc->flags |= ADA_FLAG_CAN_48BIT; + if (cgd.inq_flags & SID_DMA48) + softc->flags |= ADA_FLAG_CAN_DMA48; + else + softc->flags &= ~ADA_FLAG_CAN_DMA48; + } else + softc->flags &= ~(ADA_FLAG_CAN_48BIT | + ADA_FLAG_CAN_DMA48); if ((cgd.ident_data.satacapabilities & ATA_SUPPORT_NCQ) && (cgd.inq_flags & SID_DMA) && (cgd.inq_flags & SID_CmdQue)) softc->flags |= ADA_FLAG_CAN_NCQ; @@ -1071,8 +1081,11 @@ adaregister(struct cam_periph *periph, v if ((cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) && (cgd->inq_flags & SID_DMA)) softc->flags |= ADA_FLAG_CAN_DMA; - if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) + if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) { softc->flags |= ADA_FLAG_CAN_48BIT; + if (cgd->inq_flags & SID_DMA48) + softc->flags |= ADA_FLAG_CAN_DMA48; + } if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE) softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) @@ -1462,7 +1475,7 @@ adastart(struct cam_periph *periph, unio } else if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count > 256)) { - if (softc->flags & ADA_FLAG_CAN_DMA) { + if (softc->flags & ADA_FLAG_CAN_DMA48) { if (bp->bio_cmd == BIO_READ) { ata_48bit_cmd(ataio, ATA_READ_DMA48, 0, lba, count); Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_xpt.c Tue May 28 23:33:03 2013 (r251081) @@ -965,19 +965,22 @@ noerror: xpt_schedule(periph, priority); return; case PROBE_SETMODE: - if (path->device->transport != XPORT_SATA) - goto notsata; /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); - if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) + if (path->device->transport == XPORT_SATA && + cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps = cts.xport_specific.sata.caps & CTS_SATA_CAPS_H; + else if (path->device->transport == XPORT_ATA && + cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + caps = cts.xport_specific.ata.caps & CTS_ATA_CAPS_H; else caps = 0; - if (ident_buf->satacapabilities != 0xffff) { + if (path->device->transport == XPORT_SATA && + ident_buf->satacapabilities != 0xffff) { if (ident_buf->satacapabilities & ATA_SUPPORT_IFPWRMNGTRCV) caps |= CTS_SATA_CAPS_D_PMREQ; if (ident_buf->satacapabilities & ATA_SUPPORT_HAPST) @@ -989,19 +992,42 @@ noerror: cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); - if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) + if (path->device->transport == XPORT_SATA && + cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else if (path->device->transport == XPORT_ATA && + cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + caps &= cts.xport_specific.ata.caps; else caps = 0; + /* + * Remember what transport thinks about 48-bit DMA. If + * capability information is not provided or transport is + * SATA, we take support for granted. + */ + if (!(path->device->inq_flags & SID_DMA) || + (path->device->transport == XPORT_ATA && + (cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) && + !(caps & CTS_ATA_CAPS_H_DMA48))) + path->device->inq_flags &= ~SID_DMA48; + else + path->device->inq_flags |= SID_DMA48; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; - cts.xport_specific.sata.caps = caps; - cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; + if (path->device->transport == XPORT_SATA) { + cts.xport_specific.sata.caps = caps; + cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; + } else { + cts.xport_specific.ata.caps = caps; + cts.xport_specific.ata.valid = CTS_ATA_VALID_CAPS; + } xpt_action((union ccb *)&cts); softc->caps = caps; + if (path->device->transport != XPORT_SATA) + goto notsata; if ((ident_buf->satasupport & ATA_SUPPORT_IFPWRMNGT) && (!(softc->caps & CTS_SATA_CAPS_H_PMREQ)) != (!(ident_buf->sataenabled & ATA_SUPPORT_IFPWRMNGT))) { @@ -1154,6 +1180,11 @@ notsata: caps &= cts.xport_specific.sata.caps; else caps = 0; + /* Remember what transport thinks about AEN. */ + if (caps & CTS_SATA_CAPS_H_AN) + path->device->inq_flags |= SID_AEN; + else + path->device->inq_flags &= ~SID_AEN; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1163,11 +1194,6 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - /* Remember what transport thinks about AEN. */ - if (softc->caps & CTS_SATA_CAPS_H_AN) - path->device->inq_flags |= SID_AEN; - else - path->device->inq_flags &= ~SID_AEN; xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -2077,4 +2103,3 @@ ata_announce_periph(struct cam_periph *p } printf("\n"); } - Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/cam_ccb.h Tue May 28 23:33:03 2013 (r251081) @@ -892,9 +892,14 @@ struct ccb_trans_settings_pata { #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 #define CTS_ATA_VALID_ATAPI 0x20 +#define CTS_ATA_VALID_CAPS 0x40 int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ u_int atapi; /* Length of ATAPI CDB */ + u_int caps; /* Device and host SATA caps. */ +#define CTS_ATA_CAPS_H 0x0000ffff +#define CTS_ATA_CAPS_H_DMA48 0x00000001 /* 48-bit DMA */ +#define CTS_ATA_CAPS_D 0xffff0000 }; struct ccb_trans_settings_sata { Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/dev/ata/ata-all.c Tue May 28 23:33:03 2013 (r251081) @@ -201,10 +201,15 @@ ata_attach(device_t dev) ch->user[i].bytecount = MAXPHYS; ch->user[i].caps = 0; ch->curr[i] = ch->user[i]; - if (ch->pm_level > 0) - ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ; - if (ch->pm_level > 1) - ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ; + if (ch->flags & ATA_SATA) { + if (ch->pm_level > 0) + ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ; + if (ch->pm_level > 1) + ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ; + } else { + if (!(ch->flags & ATA_NO_48BIT_DMA)) + ch->user[i].caps |= CTS_ATA_CAPS_H_DMA48; + } } callout_init(&ch->poll_callout, 1); #endif @@ -1797,6 +1802,8 @@ ataaction(struct cam_sim *sim, union ccb d->bytecount = cts->xport_specific.ata.bytecount; if (cts->xport_specific.ata.valid & CTS_ATA_VALID_ATAPI) d->atapi = cts->xport_specific.ata.atapi; + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + d->caps = cts->xport_specific.ata.caps; } ccb->ccb_h.status = CAM_REQ_CMP; break; @@ -1837,14 +1844,12 @@ ataaction(struct cam_sim *sim, union ccb } cts->xport_specific.sata.caps &= ch->user[ccb->ccb_h.target_id].caps; - cts->xport_specific.sata.valid |= - CTS_SATA_VALID_CAPS; } else { cts->xport_specific.sata.revision = d->revision; cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; cts->xport_specific.sata.caps = d->caps; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS; } + cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS; cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { @@ -1855,6 +1860,17 @@ ataaction(struct cam_sim *sim, union ccb cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + cts->xport_specific.ata.caps = + d->caps & CTS_ATA_CAPS_D; + if (!(ch->flags & ATA_NO_48BIT_DMA)) + cts->xport_specific.ata.caps |= + CTS_ATA_CAPS_H_DMA48; + cts->xport_specific.ata.caps &= + ch->user[ccb->ccb_h.target_id].caps; + } else + cts->xport_specific.ata.caps = d->caps; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_CAPS; cts->xport_specific.ata.atapi = d->atapi; cts->xport_specific.ata.valid |= CTS_ATA_VALID_ATAPI; } From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:43:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4859ED85; Tue, 28 May 2013 23:43:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2095934E; Tue, 28 May 2013 23:43:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNhC9Q099541; Tue, 28 May 2013 23:43:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNhCXp099540; Tue, 28 May 2013 23:43:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282343.r4SNhCXp099540@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 23:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251083 - stable/9/usr.sbin/rarpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:43:12 -0000 Author: marius Date: Tue May 28 23:43:11 2013 New Revision: 251083 URL: http://svnweb.freebsd.org/changeset/base/251083 Log: MFC: r249234 Add some missing newlines and static declarations. Modified: stable/9/usr.sbin/rarpd/rarpd.c Directory Properties: stable/9/usr.sbin/rarpd/ (props changed) Modified: stable/9/usr.sbin/rarpd/rarpd.c ============================================================================== --- stable/9/usr.sbin/rarpd/rarpd.c Tue May 28 23:38:06 2013 (r251082) +++ stable/9/usr.sbin/rarpd/rarpd.c Tue May 28 23:43:11 2013 (r251083) @@ -90,13 +90,13 @@ struct if_info { * The list of all interfaces that are being listened to. rarp_loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +static struct if_info *iflist; -int verbose; /* verbose messages */ -const char *tftp_dir = TFTP_DIR; /* tftp directory */ +static int verbose; /* verbose messages */ +static const char *tftp_dir = TFTP_DIR; /* tftp directory */ -int dflag; /* messages to stdout/stderr, not syslog(3) */ -int sflag; /* ignore /tftpboot */ +static int dflag; /* messages to stdout/stderr, not syslog(3) */ +static int sflag; /* ignore /tftpboot */ static u_char zero[6]; @@ -309,6 +309,7 @@ init_one(struct ifaddrs *ifa, char *targ break; } } + /* * Initialize all "candidate" interfaces that are in the system * configuration list. A "candidate" is up, not loopback and not @@ -370,6 +371,7 @@ init(char *target) static void usage(void) { + (void)fprintf(stderr, "%s\n%s\n", "usage: rarpd -a [-dfsv] [-t directory] [-P pidfile]", " rarpd [-dfsv] [-t directory] [-P pidfile] interface"); @@ -631,6 +633,7 @@ rarp_bootable_err: static in_addr_t choose_ipaddr(in_addr_t **alist, in_addr_t net, in_addr_t netmask) { + for (; *alist; ++alist) if ((**alist & netmask) == net) return **alist; @@ -693,17 +696,19 @@ rarp_process(struct if_info *ii, u_char * host (i.e. the guy running rarpd), won't try to ARP for the hardware * address of the guy being booted (he cannot answer the ARP). */ -struct sockaddr_inarp sin_inarp = { +static struct sockaddr_inarp sin_inarp = { sizeof(struct sockaddr_inarp), AF_INET, 0, {0}, {0}, 0, 0 }; -struct sockaddr_dl sin_dl = { + +static struct sockaddr_dl sin_dl = { sizeof(struct sockaddr_dl), AF_LINK, 0, IFT_ETHER, 0, 6, 0, "" }; -struct { + +static struct { struct rt_msghdr rthdr; char rtspace[512]; } rtmsg; @@ -885,6 +890,7 @@ rarp_reply(struct if_info *ii, struct et static in_addr_t ipaddrtonetmask(in_addr_t addr) { + addr = ntohl(addr); if (IN_CLASSA(addr)) return htonl(IN_CLASSA_NET); From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:43:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02D16EF7; Tue, 28 May 2013 23:43:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA750354; Tue, 28 May 2013 23:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNhlmu099670; Tue, 28 May 2013 23:43:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNhlm7099668; Tue, 28 May 2013 23:43:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282343.r4SNhlm7099668@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251084 - in head: . release/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:43:48 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:43:47 2013 New Revision: 251084 URL: http://svnweb.freebsd.org/changeset/base/251084 Log: r245757 introduced warning output if update method is set to CVS_UPDATE or SUP_UPDATE. CVS exporter for head/ is turned off for nearly one month now. It is finally time to swing the ax at these update methods. Reviewed by: eadler MFC after: 1 month Modified: head/Makefile.inc1 head/release/doc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 23:43:11 2013 (r251083) +++ head/Makefile.inc1 Tue May 28 23:43:47 2013 (r251084) @@ -114,15 +114,8 @@ LOCAL_TOOL_DIRS?= BUILDENV_SHELL?=/bin/sh -CVS?= cvs -CVSFLAGS?= -A -P -d -I! -SVN?= svn +SVN?= /usr/local/bin/svn SVNFLAGS?= -r HEAD -SUP?= /usr/bin/csup -SUPFLAGS?= -g -L 2 -.if defined(SUPHOST) -SUPFLAGS+= -h ${SUPHOST} -.endif MAKEOBJDIRPREFIX?= /usr/obj .if !defined(OSRELDATE) @@ -1080,59 +1073,18 @@ doxygen: # latest copy. # update: -.if defined(SUP_UPDATE) +.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) @echo "--------------------------------------------------------------" - @echo ">>> Running ${SUP}" + @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." + @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" @echo "--------------------------------------------------------------" - @echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" - @echo "!! Update methods with ${SUP} are deprecated." - @echo "!! Please see http://www.freebsd.org/handbook/svn.html" - @echo "!! and convert your update method to SVN_UPDATE or" - @echo "!! freebsd-update(8)." - @echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" - @sleep 5 -.if defined(SUPFILE) - @${SUP} ${SUPFLAGS} ${SUPFILE} -.endif -.if defined(SUPFILE1) - @${SUP} ${SUPFLAGS} ${SUPFILE1} -.endif -.if defined(SUPFILE2) - @${SUP} ${SUPFLAGS} ${SUPFILE2} -.endif -.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) - @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} -.endif -.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) - @${SUP} ${SUPFLAGS} ${DOCSUPFILE} -.endif -.endif -.if defined(CVS_UPDATE) - @cd ${.CURDIR} ; \ - if [ -d CVS ] ; then \ - echo "--------------------------------------------------------------" ; \ - echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ - echo "--------------------------------------------------------------" ; \ - echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" ; \ - echo "!! Update methods with CVS are deprecated." ; \ - echo "!! Please see http://www.freebsd.org/handbook/svn.html" ; \ - echo "!! and convert your update method to SVN_UPDATE or" ; \ - echo "!! freebsd-update(8)." ; \ - echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" ; \ - sleep 5 ; \ - echo ${CVS} -R -q update ${CVSFLAGS} ; \ - ${CVS} -R -q update ${CVSFLAGS} ; \ - fi + @exit 1 .endif .if defined(SVN_UPDATE) - @cd ${.CURDIR} ; \ - if [ -d .svn ] ; then \ - echo "--------------------------------------------------------------" ; \ - echo ">>> Updating ${.CURDIR} using Subversion" ; \ - echo "--------------------------------------------------------------" ; \ - echo ${SVN} update ${SVNFLAGS} ; \ - ${SVN} update ${SVNFLAGS} ; \ - fi + @echo "--------------------------------------------------------------" + @echo ">>> Updating ${.CURDIR} using Subversion" + @echo "--------------------------------------------------------------" + @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .endif # Modified: head/release/doc/Makefile ============================================================================== --- head/release/doc/Makefile Tue May 28 23:43:11 2013 (r251083) +++ head/release/doc/Makefile Tue May 28 23:43:47 2013 (r251084) @@ -12,26 +12,30 @@ SUBDIR+= share/xml RELN_ROOT?= ${.CURDIR} -.if defined(SUPHOST) -SUPFLAGS+= -h ${SUPHOST} -.endif +SVN?= /usr/local/bin/svn +SVNFLAGS?= -r HEAD + update: -.if defined(SUP_UPDATE) -.if !defined(DOCSUPFILE) - @echo "Error: Please define DOCSUPFILE before doing make update." +.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) + @echo "--------------------------------------------------------------" + @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." + @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" + @echo "--------------------------------------------------------------" @exit 1 .endif +.if defined(SVN_UPDATE) +. if !exists(${SVN}) @echo "--------------------------------------------------------------" - @echo ">>> Running ${SUP}" + @echo ">>> Updating ${RELN_ROOT} requires ${SVN}." @echo "--------------------------------------------------------------" - @${SUP} ${SUPFLAGS} ${DOCSUPFILE} -.elif defined(CVS_UPDATE) + @exit 1 +. endif @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} + @echo ">>> Updating ${.CURDIR} using Subversion" @echo "--------------------------------------------------------------" - cd ${.CURDIR}; cvs -q update -P -d + @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .else - @echo "Error: Please define either SUP_UPDATE or CVS_UPDATE first." + @echo "Error: Please define SUP_UPDATE first." .endif .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:46:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D954A153; Tue, 28 May 2013 23:46:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB2B237A; Tue, 28 May 2013 23:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNkDkv000332; Tue, 28 May 2013 23:46:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNkDqN000331; Tue, 28 May 2013 23:46:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282346.r4SNkDqN000331@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251085 - head/release/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:46:13 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:46:13 2013 New Revision: 251085 URL: http://svnweb.freebsd.org/changeset/base/251085 Log: Fix typo introduced in r251084. MFC after: 1 month X-MFC-With: r251084 Modified: head/release/doc/Makefile Modified: head/release/doc/Makefile ============================================================================== --- head/release/doc/Makefile Tue May 28 23:43:47 2013 (r251084) +++ head/release/doc/Makefile Tue May 28 23:46:13 2013 (r251085) @@ -35,7 +35,7 @@ update: @echo "--------------------------------------------------------------" @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .else - @echo "Error: Please define SUP_UPDATE first." + @echo "Error: Please define SVN_UPDATE first." .endif .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" From owner-svn-src-all@FreeBSD.ORG Tue May 28 23:52:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C1925F4; Tue, 28 May 2013 23:52:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5605D5E6; Tue, 28 May 2013 23:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNq2Ov002934; Tue, 28 May 2013 23:52:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNq2jK002933; Tue, 28 May 2013 23:52:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282352.r4SNq2jK002933@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251086 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:52:02 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:52:01 2013 New Revision: 251086 URL: http://svnweb.freebsd.org/changeset/base/251086 Log: Remove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084. MFC after: 1 month X-MFC-With: r251084, r251085 Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Tue May 28 23:46:13 2013 (r251085) +++ head/share/man/man5/make.conf.5 Tue May 28 23:52:01 2013 (r251086) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2013 +.Dd May 28, 2013 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -177,16 +177,6 @@ Refer to for a list of recognized .Va CPUTYPE options. -.It Va CVS_UPDATE -.Pq Vt bool -Set this to use -.Xr cvs 1 -to update your -.Pa src , ports -and -.Pa doc -trees with -.Dq Li "make update" . .It Va CXXFLAGS .Pq Vt str Controls the compiler settings when compiling C++ code. @@ -255,61 +245,6 @@ Set this to not update the doc tree duri .Pq Vt bool Set this to not update the ports tree during .Dq Li "make update" . -.It Va SUP -.Pq Vt str -The location of the -.Xr csup 1 -or -.Xr cvsup 1 -command for -.Dq Li "make update" . -.It Va SUPFILE -.Pq Vt str -The first -.Ar supfile -to use when doing a -.Dq Li "make update" . -For example, -.Pa /usr/share/examples/cvsup/standard-supfile . -.It Va SUPFILE1 -.Pq Vt str -The second -.Ar supfile -to use when doing a -.Dq Li "make update" . -.It Va SUPFILE2 -.Pq Vt str -The third -.Ar supfile -to use when doing a -.Dq Li "make update" . -.It Va SUPFLAGS -.Pq Vt str -The flag for the -.Xr sup 1 -command when doing -.Dq Li "make update" . -This defaults to -.Op Fl g L Ar 2 . -.It Va SUPHOST -.Pq Vt str -The hostname of the sup server to use when doing -.Dq Li "make update" . -.It Va SUP_UPDATE -.Pq Vt bool -Set this to use -.Xr csup 1 -to update your -.Pa src , -and -.Pa ports -trees with -.Dq Li "make update" . -This option is deprecated. -Please use -.Va SVN_UPDATE -or -.Xr freebsd-update 8 . .It Va SVN_UPDATE .Pq Vt bool Set this to use From owner-svn-src-all@FreeBSD.ORG Wed May 29 00:18:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D43AABDA; Wed, 29 May 2013 00:18:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6190785; Wed, 29 May 2013 00:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0ICu2011426; Wed, 29 May 2013 00:18:12 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0ICAu011425; Wed, 29 May 2013 00:18:12 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305290018.r4T0ICAu011425@svn.freebsd.org> From: Bryan Drewery Date: Wed, 29 May 2013 00:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251087 - stable/9/crypto/openssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 00:18:12 -0000 Author: bdrewery (ports committer) Date: Wed May 29 00:18:12 2013 New Revision: 251087 URL: http://svnweb.freebsd.org/changeset/base/251087 Log: MFH r250595: The HPN patch added a new BUG bit for SSH_BUG_LARGEWINDOW and the update to 6.1 added SSH_BUG_DYNAMIC_RPORT with the same value. Fix the HPN SSH_BUG_LARGEWINDOW bit so it is unique. Modified: stable/9/crypto/openssh/compat.h Directory Properties: stable/9/crypto/openssh/ (props changed) Modified: stable/9/crypto/openssh/compat.h ============================================================================== --- stable/9/crypto/openssh/compat.h Tue May 28 23:52:01 2013 (r251086) +++ stable/9/crypto/openssh/compat.h Wed May 29 00:18:12 2013 (r251087) @@ -60,7 +60,7 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x08000000 +#define SSH_BUG_LARGEWINDOW 0x10000000 void enable_compat13(void); void enable_compat20(void); From owner-svn-src-all@FreeBSD.ORG Wed May 29 00:19:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C18AD63; Wed, 29 May 2013 00:19:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF9B797; Wed, 29 May 2013 00:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0Jxad011757; Wed, 29 May 2013 00:19:59 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0JxLE011755; Wed, 29 May 2013 00:19:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305290019.r4T0JxLE011755@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 00:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251088 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 00:19:59 -0000 Author: des Date: Wed May 29 00:19:58 2013 New Revision: 251088 URL: http://svnweb.freebsd.org/changeset/base/251088 Log: Revert a local change that sets the default for UsePrivilegeSeparation to "sandbox" instead of "yes". In sandbox mode, the privsep child is unable to load additional libraries and will therefore crash when trying to take advantage of crypto offloading on CPUs that support it. Modified: head/crypto/openssh/servconf.c Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed May 29 00:18:12 2013 (r251087) +++ head/crypto/openssh/servconf.c Wed May 29 00:19:58 2013 (r251088) @@ -298,7 +298,7 @@ fill_default_server_options(ServerOption options->version_addendum = xstrdup(SSH_VERSION_FREEBSD); /* Turn privilege separation on by default */ if (use_privsep == -1) - use_privsep = PRIVSEP_ON; + use_privsep = PRIVSEP_NOSANDBOX; #ifndef HAVE_MMAP if (use_privsep && options->compression == 1) { From owner-svn-src-all@FreeBSD.ORG Wed May 29 00:32:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEEDD1E1; Wed, 29 May 2013 00:32:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFF8082B; Wed, 29 May 2013 00:32:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0WnPQ017335; Wed, 29 May 2013 00:32:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0Wntt017334; Wed, 29 May 2013 00:32:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305290032.r4T0Wntt017334@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 May 2013 00:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251089 - head/sys/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 00:32:49 -0000 Author: rmacklem Date: Wed May 29 00:32:49 2013 New Revision: 251089 URL: http://svnweb.freebsd.org/changeset/base/251089 Log: Add a patch analygous to r248567, r248581, r251079 to the old NFS client to avoid the panic reported in the PR by doing the vnode_pager_setsize() call after unlocking the mutex. PR: 177335 MFC after: 2 weeks Modified: head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Wed May 29 00:19:58 2013 (r251088) +++ head/sys/nfsclient/nfs_subs.c Wed May 29 00:32:49 2013 (r251089) @@ -463,6 +463,8 @@ nfs_loadattrcache(struct vnode **vpp, st struct timespec mtime, mtime_save; int v3 = NFS_ISV3(vp); int error = 0; + u_quad_t nsize; + int setnsize; md = *mdp; t1 = (mtod(md, caddr_t) + md->m_len) - *dposp; @@ -565,6 +567,8 @@ nfs_loadattrcache(struct vnode **vpp, st vap->va_filerev = 0; } np->n_attrstamp = time_second; + setnsize = 0; + nsize = 0; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -591,7 +595,8 @@ nfs_loadattrcache(struct vnode **vpp, st np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); + setnsize = 1; + nsize = vap->va_size; } else { np->n_size = vap->va_size; } @@ -628,6 +633,8 @@ nfs_loadattrcache(struct vnode **vpp, st KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, &np->n_vattr, 0); #endif mtx_unlock(&np->n_mtx); + if (setnsize) + vnode_pager_setsize(vp, nsize); out: #ifdef KDTRACE_HOOKS if (error) From owner-svn-src-all@FreeBSD.ORG Wed May 29 01:40:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF05A82E; Wed, 29 May 2013 01:40:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8815FB35; Wed, 29 May 2013 01:40:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T1eEuS040929; Wed, 29 May 2013 01:40:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T1eErx040928; Wed, 29 May 2013 01:40:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290140.r4T1eErx040928@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 01:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251090 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 01:40:14 -0000 Author: adrian Date: Wed May 29 01:40:13 2013 New Revision: 251090 URL: http://svnweb.freebsd.org/changeset/base/251090 Log: Shuffle around the cleanup unpause calls a bit. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed May 29 00:32:49 2013 (r251089) +++ head/sys/dev/ath/if_ath_tx.c Wed May 29 01:40:13 2013 (r251090) @@ -4156,7 +4156,9 @@ ath_tx_comp_cleanup_unaggr(struct ath_so * - Count the number of unacked frames, and let transmit completion * handle it later. * - * The caller is responsible for pausing the TID. + * The caller is responsible for pausing the TID and unpausing the + * TID if no cleanup was required. Otherwise the cleanup path will + * unpause the TID once the last hardware queued frame is completed. */ static void ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid, @@ -4214,12 +4216,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, bf = TAILQ_NEXT(bf, bf_list); } - /* The caller is required to pause the TID */ -#if 0 - /* Pause the TID */ - ath_tx_tid_pause(sc, atid); -#endif - /* * Calculate what hardware-queued frames exist based * on the current BAW size. Ie, what frames have been @@ -4238,14 +4234,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, INCR(tap->txa_start, IEEE80211_SEQ_RANGE); } - /* - * If cleanup is required, defer TID scheduling - * until all the HW queued packets have been - * sent. - */ - if (! atid->cleanup_inprogress) - ath_tx_tid_resume(sc, atid); - if (atid->cleanup_inprogress) DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: TID %d: cleanup needed: %d packets\n", @@ -5789,6 +5777,11 @@ ath_addba_stop(struct ieee80211_node *ni TAILQ_INIT(&bf_cq); ATH_TX_LOCK(sc); ath_tx_tid_cleanup(sc, an, tid, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! atid->cleanup_inprogress) + ath_tx_tid_resume(sc, atid); ATH_TX_UNLOCK(sc); /* Handle completing frames and fail them */ @@ -5830,6 +5823,11 @@ ath_tx_node_reassoc(struct ath_softc *sc ":", i); ath_tx_tid_cleanup(sc, an, i, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! tid->cleanup_inprogress) + ath_tx_tid_resume(sc, tid); } ATH_TX_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Wed May 29 01:54:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29C02A6F; Wed, 29 May 2013 01:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDD8C02; Wed, 29 May 2013 01:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T1sCk0046637; Wed, 29 May 2013 01:54:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T1sA0C046618; Wed, 29 May 2013 01:54:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305290154.r4T1sA0C046618@svn.freebsd.org> From: Ed Maste Date: Wed, 29 May 2013 01:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251091 - in head/lib/libc: mips/gen mips/net net powerpc64/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 01:54:13 -0000 Author: emaste Date: Wed May 29 01:54:10 2013 New Revision: 251091 URL: http://svnweb.freebsd.org/changeset/base/251091 Log: Remove clause 3 and 4 from TNF licenses Per the NetBSD Foundation statement Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license. Modified: head/lib/libc/mips/gen/longjmp.c head/lib/libc/mips/net/htonl.S head/lib/libc/mips/net/htons.S head/lib/libc/mips/net/ntohl.S head/lib/libc/mips/net/ntohs.S head/lib/libc/net/nsdispatch.c head/lib/libc/net/nslexer.l head/lib/libc/net/nsparser.y head/lib/libc/powerpc64/gen/fpgetmask.c head/lib/libc/powerpc64/gen/fpgetround.c head/lib/libc/powerpc64/gen/fpgetsticky.c head/lib/libc/powerpc64/gen/fpsetmask.c head/lib/libc/powerpc64/gen/fpsetround.c Modified: head/lib/libc/mips/gen/longjmp.c ============================================================================== --- head/lib/libc/mips/gen/longjmp.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/gen/longjmp.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/htonl.S ============================================================================== --- head/lib/libc/mips/net/htonl.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/htonl.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/htons.S ============================================================================== --- head/lib/libc/mips/net/htons.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/htons.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/ntohl.S ============================================================================== --- head/lib/libc/mips/net/ntohl.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/ntohl.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/ntohs.S ============================================================================== --- head/lib/libc/mips/net/ntohs.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/ntohs.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nsdispatch.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nslexer.l Wed May 29 01:54:10 2013 (r251091) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nsparser.y ============================================================================== --- head/lib/libc/net/nsparser.y Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nsparser.y Wed May 29 01:54:10 2013 (r251091) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetmask.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetmask.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetmask.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetround.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetround.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetround.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetsticky.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetsticky.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetsticky.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpsetmask.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpsetmask.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpsetmask.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpsetround.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpsetround.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpsetround.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:09:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11D12927; Wed, 29 May 2013 04:09:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03C00220; Wed, 29 May 2013 04:09:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T49Wk9093759; Wed, 29 May 2013 04:09:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T49Wpa093758; Wed, 29 May 2013 04:09:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290409.r4T49Wpa093758@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251092 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:09:33 -0000 Author: mav Date: Wed May 29 04:09:32 2013 New Revision: 251092 URL: http://svnweb.freebsd.org/changeset/base/251092 Log: MFC r250900: Fix NULL-dereference kernel panic in case of mps_attach() failure. Modified: stable/9/sys/dev/mps/mps_user.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_user.c ============================================================================== --- stable/9/sys/dev/mps/mps_user.c Wed May 29 01:54:10 2013 (r251091) +++ stable/9/sys/dev/mps/mps_user.c Wed May 29 04:09:32 2013 (r251092) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:10:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C99AAAE; Wed, 29 May 2013 04:10:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9BA232; Wed, 29 May 2013 04:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4Avh3095749; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Avqs095748; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290410.r4T4Avqs095748@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251093 - stable/8/sys/dev/mps X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:10:57 -0000 Author: mav Date: Wed May 29 04:10:57 2013 New Revision: 251093 URL: http://svnweb.freebsd.org/changeset/base/251093 Log: MFC r250900: Fix NULL-dereference kernel panic in case of mps_attach() failure. Modified: stable/8/sys/dev/mps/mps_user.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mps/ (props changed) Modified: stable/8/sys/dev/mps/mps_user.c ============================================================================== --- stable/8/sys/dev/mps/mps_user.c Wed May 29 04:09:32 2013 (r251092) +++ stable/8/sys/dev/mps/mps_user.c Wed May 29 04:10:57 2013 (r251093) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:12:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4C77C51; Wed, 29 May 2013 04:12:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D700C248; Wed, 29 May 2013 04:12:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4CrwN096187; Wed, 29 May 2013 04:12:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4CrUS096186; Wed, 29 May 2013 04:12:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290412.r4T4CrUS096186@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251094 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:12:54 -0000 Author: mav Date: Wed May 29 04:12:53 2013 New Revision: 251094 URL: http://svnweb.freebsd.org/changeset/base/251094 Log: MFC r250819: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Modified: stable/9/sys/geom/raid/md_ddf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Wed May 29 04:10:57 2013 (r251093) +++ stable/9/sys/geom/raid/md_ddf.c Wed May 29 04:12:53 2013 (r251094) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:14:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDC47DFF; Wed, 29 May 2013 04:14:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D069925D; Wed, 29 May 2013 04:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4EfQt096554; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Efh4096553; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290414.r4T4Efh4096553@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251095 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:14:41 -0000 Author: mav Date: Wed May 29 04:14:41 2013 New Revision: 251095 URL: http://svnweb.freebsd.org/changeset/base/251095 Log: MFC r250819: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Modified: stable/8/sys/geom/raid/md_ddf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:12:53 2013 (r251094) +++ stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:14:41 2013 (r251095) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:17:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62D4869; Wed, 29 May 2013 04:17:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43994288; Wed, 29 May 2013 04:17:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4H6f9097073; Wed, 29 May 2013 04:17:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4H6Lw097072; Wed, 29 May 2013 04:17:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290417.r4T4H6Lw097072@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251096 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:17:06 -0000 Author: mav Date: Wed May 29 04:17:05 2013 New Revision: 251096 URL: http://svnweb.freebsd.org/changeset/base/251096 Log: MFC r250508: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Wed May 29 04:14:41 2013 (r251095) +++ stable/9/sys/cam/ata/ata_pmp.c Wed May 29 04:17:05 2013 (r251096) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -319,7 +322,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -429,7 +436,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -459,6 +469,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -468,6 +504,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -577,7 +615,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -620,10 +661,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:18:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1632120D; Wed, 29 May 2013 04:18:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED647292; Wed, 29 May 2013 04:18:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4I2p6097293; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4I28Y097292; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290418.r4T4I28Y097292@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251097 - stable/8/sys/cam/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:18:03 -0000 Author: mav Date: Wed May 29 04:18:02 2013 New Revision: 251097 URL: http://svnweb.freebsd.org/changeset/base/251097 Log: MFC r250508: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Modified: stable/8/sys/cam/ata/ata_pmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:17:05 2013 (r251096) +++ stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:18:02 2013 (r251097) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -319,7 +322,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -434,7 +441,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -464,6 +474,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -473,6 +509,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -582,7 +620,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -623,10 +664,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-all@FreeBSD.ORG Wed May 29 04:21:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A061B409; Wed, 29 May 2013 04:21:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91F1E2D7; Wed, 29 May 2013 04:21:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4Lgo9099596; Wed, 29 May 2013 04:21:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4LgRc099595; Wed, 29 May 2013 04:21:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290421.r4T4LgRc099595@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 04:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:21:42 -0000 Author: adrian Date: Wed May 29 04:21:42 2013 New Revision: 251098 URL: http://svnweb.freebsd.org/changeset/base/251098 Log: Fix a false -> AH_FALSE. Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. It's been like this for a while. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed May 29 04:18:02 2013 (r251097) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed May 29 04:21:42 2013 (r251098) @@ -3554,7 +3554,7 @@ ar9300_init_cal_internal(struct ath_hal * no chip specific code for Jupiter/Posdeion except for register names. */ if (txiqcal_success_flag) { - ar9300_tx_iq_cal_post_proc(ah,ichan, 1, 1,is_cal_reusable,false); + ar9300_tx_iq_cal_post_proc(ah,ichan, 1, 1,is_cal_reusable, AH_FALSE); } } else { if (!txiqcal_success_flag) { From owner-svn-src-all@FreeBSD.ORG Wed May 29 05:10:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB4E2687; Wed, 29 May 2013 05:10:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE2AC9B4; Wed, 29 May 2013 05:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T5ABCJ015393; Wed, 29 May 2013 05:10:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T5ABTs015392; Wed, 29 May 2013 05:10:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290510.r4T5ABTs015392@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 05:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251099 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 05:10:11 -0000 Author: adrian Date: Wed May 29 05:10:11 2013 New Revision: 251099 URL: http://svnweb.freebsd.org/changeset/base/251099 Log: Turn the reassociate debug print into a DPRINTF. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 29 04:21:42 2013 (r251098) +++ head/sys/dev/ath/if_ath.c Wed May 29 05:10:11 2013 (r251099) @@ -5511,6 +5511,7 @@ ath_newassoc(struct ieee80211_node *ni, an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); ath_rate_newassoc(sc, an, isnew); + if (isnew && (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey && ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) @@ -5526,7 +5527,7 @@ ath_newassoc(struct ieee80211_node *ni, * marked as non-aggregate. */ if (! isnew) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; is_powersave=%d\n", __func__, ni->ni_macaddr, From owner-svn-src-all@FreeBSD.ORG Wed May 29 07:07:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B356D870; Wed, 29 May 2013 07:07:08 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 7D87FF88; Wed, 29 May 2013 07:07:07 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E316E917; Wed, 29 May 2013 09:02:48 +0200 (CEST) Date: Wed, 29 May 2013 09:09:53 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130529070952.GA1400@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <201305290019.r4T0JxLE011755@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 07:07:08 -0000 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 12:19:59AM +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Wed May 29 00:19:58 2013 > New Revision: 251088 > URL: http://svnweb.freebsd.org/changeset/base/251088 >=20 > Log: > Revert a local change that sets the default for UsePrivilegeSeparation = to > "sandbox" instead of "yes". In sandbox mode, the privsep child is unab= le > to load additional libraries and will therefore crash when trying to ta= ke > advantage of crypto offloading on CPUs that support it. Which library is needed for AES-NI? I don't see any engine in /usr/lib/ that implements AES-NI support. Could you be more specific? Also what is the exact difference between "sandbox" and "yes" settings? The reason I ask is because I plan to experiment with OpenSSH sandboxing to use Capsicum and Casper. > Modified: > head/crypto/openssh/servconf.c >=20 > Modified: head/crypto/openssh/servconf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/crypto/openssh/servconf.c Wed May 29 00:18:12 2013 (r251087) > +++ head/crypto/openssh/servconf.c Wed May 29 00:19:58 2013 (r251088) > @@ -298,7 +298,7 @@ fill_default_server_options(ServerOption > options->version_addendum =3D xstrdup(SSH_VERSION_FREEBSD); > /* Turn privilege separation on by default */ > if (use_privsep =3D=3D -1) > - use_privsep =3D PRIVSEP_ON; > + use_privsep =3D PRIVSEP_NOSANDBOX; > =20 > #ifndef HAVE_MMAP > if (use_privsep && options->compression =3D=3D 1) { --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGlqcAACgkQForvXbEpPzQGOgCgtMJXt0yVntEo0ej5EZZVEzZq e8AAnRFOUbrteHLIVdBEEgFuT8ESmKq9 =HLoi -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE-- From owner-svn-src-all@FreeBSD.ORG Wed May 29 07:17:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D618DF5; Wed, 29 May 2013 07:17:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F73AA6; Wed, 29 May 2013 07:17:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T7HqrX060558; Wed, 29 May 2013 07:17:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T7HqQP060557; Wed, 29 May 2013 07:17:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305290717.r4T7HqQP060557@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 29 May 2013 07:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r251100 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 07:17:52 -0000 Author: pjd Date: Wed May 29 07:17:51 2013 New Revision: 251100 URL: http://svnweb.freebsd.org/changeset/base/251100 Log: Release Steven Hartland (smh) from mentorship. He is ready to face the world on his own. Kids, they grow up so fast... :) Discussed with: avg (co-mentor) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed May 29 05:10:11 2013 (r251099) +++ svnadmin/conf/mentors Wed May 29 07:17:51 2013 (r251100) @@ -31,6 +31,5 @@ miwi rwatson monthadar adrian nork imp peterj jhb Co-mentor: grog -smh pjd Co-mentor: avg snb dwmalone versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Wed May 29 11:22:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E7CFD08; Wed, 29 May 2013 11:22:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 03D0CBD; Wed, 29 May 2013 11:22:12 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9FEE65C44; Wed, 29 May 2013 13:22:05 +0200 (CEST) Message-ID: <51A5E4DE.5060007@FreeBSD.org> Date: Wed, 29 May 2013 13:22:06 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Thunderbird/22.0 MIME-Version: 1.0 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 References: <201305290421.r4T4LgRc099595@svn.freebsd.org> In-Reply-To: <201305290421.r4T4LgRc099595@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 11:22:13 -0000 On 2013-05-29 06:21, Adrian Chadd wrote: > Author: adrian > Date: Wed May 29 04:21:42 2013 > New Revision: 251098 > URL: http://svnweb.freebsd.org/changeset/base/251098 > > Log: > Fix a false -> AH_FALSE. > > Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. > It's been like this for a while. Because 'false' will be implicitly converted to an enum HAL_BOOL value. Adding a warning for such cases would result in a *lot* of noise, and probably many angry developers. ;-) Note that in C++, such a call would result in an error: "no known conversion from 'bool' to 'HAL_BOOL'". From owner-svn-src-all@FreeBSD.ORG Wed May 29 12:36:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF26E915; Wed, 29 May 2013 12:36:17 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 832D7899; Wed, 29 May 2013 12:36:17 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 7D6007058; Wed, 29 May 2013 12:36:16 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id BDE7F4A7C8; Wed, 29 May 2013 14:36:17 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> Date: Wed, 29 May 2013 14:36:17 +0200 In-Reply-To: <20130529070952.GA1400@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 29 May 2013 09:09:53 +0200") Message-ID: <86zjve3qv2.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 12:36:17 -0000 Pawel Jakub Dawidek writes: > Which library is needed for AES-NI? I don't see any engine in /usr/lib/ > that implements AES-NI support. Could you be more specific? Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood his report. I just ran through the steps to reproduce the issue, and what happens is that a CRIOGET ioctl cal (which is supposed to allocate and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) 90344 sshd RET setrlimit 0 [...] 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) 90344 sshd RET ioctl -1 errno 24 Too many open files Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: May 29 12:10:37 zoo2 kernel: ktrace write failed, errno 27, tracing stopped= =20 To reproduce: # ktrace -tcnstuy -di env LD_UTRACE=3Dyes /usr/sbin/sshd -oUsePrivilegeSepa= ration=3Dsandbox -Dddd -oPort=3D2222 -oListenAddress=3Dlocalhost followed by % ssh -c aes128-cbc -p 2222 localhost on a machine with an AESNI-capable CPU and aesni.ko loaded. > Also what is the exact difference between "sandbox" and "yes" settings? "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means a bunch of rlimit settings. > The reason I ask is because I plan to experiment with OpenSSH sandboxing > to use Capsicum and Casper. You still have the patches I sent you? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed May 29 12:40:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A1F8B8A; Wed, 29 May 2013 12:40:29 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5490B8ED; Wed, 29 May 2013 12:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TCeT1T071941; Wed, 29 May 2013 12:40:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TCeTxN071940; Wed, 29 May 2013 12:40:29 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305291240.r4TCeTxN071940@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 12:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251101 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 12:40:29 -0000 Author: des Date: Wed May 29 12:40:28 2013 New Revision: 251101 URL: http://svnweb.freebsd.org/changeset/base/251101 Log: Forced commit to note that the sandbox issue was not about libraries, as I erroneously stated in the commit log, but about a CRIOGET ioctl failing due to a preceding setrlimit(RLIMIT_NOFILES, 0) call. Modified: head/crypto/openssh/servconf.c Modified: head/crypto/openssh/servconf.c ============================================================================== From owner-svn-src-all@FreeBSD.ORG Wed May 29 12:44:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A0E66EAC for ; Wed, 29 May 2013 12:44:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF9F96B for ; Wed, 29 May 2013 12:44:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4TCiMM1025274 for ; Wed, 29 May 2013 12:44:22 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4TCiM4u025267 for svn-src-all@freebsd.org; Wed, 29 May 2013 12:44:22 GMT (envelope-from bdrewery) Received: (qmail 94931 invoked from network); 29 May 2013 07:44:20 -0500 Received: from unknown (HELO ?10.10.1.133?) (freebsd@shatow.net@10.10.1.133) by sweb.xzibition.com with ESMTPA; 29 May 2013 07:44:20 -0500 Message-ID: <51A5F819.4070507@FreeBSD.org> Date: Wed, 29 May 2013 07:44:09 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> In-Reply-To: <86zjve3qv2.fsf@nine.des.no> X-Enigmail-Version: 1.5.1 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2TMUJULUDELVGEMIEOMUI" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 12:44:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TMUJULUDELVGEMIEOMUI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 5/29/2013 7:36 AM, Dag-Erling Sm=C3=B8rgrav wrote: > Pawel Jakub Dawidek writes: >> Which library is needed for AES-NI? I don't see any engine in /usr/lib= / >> that implements AES-NI support. Could you be more specific? >=20 > Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood > his report. I just ran through the steps to reproduce the issue, and > what happens is that a CRIOGET ioctl cal (which is supposed to allocate= > and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): >=20 > 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) > 90344 sshd RET setrlimit 0 This is as far as I went. I wasn't able to debug it further with the RLIMIT_FSIZE set, as removing it allowed the functionality to work. I incorrectly assumed it was due to dynamic library loading later. Sorry for the miscommunication. > [...] > 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) > 90344 sshd RET ioctl -1 errno 24 Too many open files >=20 > Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in > sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: --=20 Regards, Bryan Drewery ------enig2TMUJULUDELVGEMIEOMUI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRpfgaAAoJEG54KsA8mwz5Kw0P/21pL5DbSsQpf60NkqJ//upY EgZ9VBkHl7TCtzd/b16OHSw618zgVYDuSCRGmalsZbHxn4v4Q98CYtzo3/O5OxKK 7g22bf1pyBE9XNHcVPFbcNGqKbRSz3ZHEgMb7n1oLgFeWwvtB/mYAqlCT77sSDje haUEkEzClRS4KZklxN0v7CEteCgHz4hfPXbBJNplxcOUqZxbwkRL2l/Mb+7hf0bU 2j0xtkxRhMI5SUUMw7zuRPkNwS+ogkQetRGrUp4qakzGpcnI8xMEYHOvonQc0XP9 +SEMt6bkacQb0pHpfTB5j/BAhXSQUr/4OjI6EIu2CJbbodRY4EKjMyqIGvRVFZQR IvExf9GNS5o3M7W7uI4KGNzr38XnXepBbDmVrpPRgm30ffa0le+7i7G+E/WnTCNp TNtg68ZD5SZVfJGB7NWu68n0n6nJt2PFC1gyFTWE23aKenlubxsigf7U/EPXnmVg iNzXqVsuzrib4wrbK5ZvZanNoXPsrTdaoCadGl/z2FflBEPqAcDWQyxFI6SaVe+b gvK/qilUO0jQn7hTHz97iGnlXjJFaiVpZQ485ZB9QsICYfJVW3nr08WRIGHpi3yP PRKaaiFA/GrXVn1P/4g+jhLIOIB1ccZkuy+a7jKysh4lX90A4l/lXuous3njkQdE VjbL4ufuBkaUqZVvog8B =Bg5Q -----END PGP SIGNATURE----- ------enig2TMUJULUDELVGEMIEOMUI-- From owner-svn-src-all@FreeBSD.ORG Wed May 29 12:48:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D97827B; Wed, 29 May 2013 12:48:01 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 5751B9C2; Wed, 29 May 2013 12:48:01 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 763A6A69; Wed, 29 May 2013 14:43:47 +0200 (CEST) Date: Wed, 29 May 2013 14:50:52 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130529125052.GA1383@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <86zjve3qv2.fsf@nine.des.no> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 12:48:01 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 02:36:17PM +0200, Dag-Erling Sm=F8rgrav wrote: > Pawel Jakub Dawidek writes: > > Which library is needed for AES-NI? I don't see any engine in /usr/lib/ > > that implements AES-NI support. Could you be more specific? >=20 > Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood > his report. I just ran through the steps to reproduce the issue, and > what happens is that a CRIOGET ioctl cal (which is supposed to allocate > and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): >=20 > 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) > 90344 sshd RET setrlimit 0 > [...] > 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) > 90344 sshd RET ioctl -1 errno 24 Too many open files >=20 > Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in > sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: >=20 > May 29 12:10:37 zoo2 kernel: ktrace write failed, errno 27, tracing stopp= ed=20 >=20 > To reproduce: >=20 > # ktrace -tcnstuy -di env LD_UTRACE=3Dyes /usr/sbin/sshd -oUsePrivilegeSe= paration=3Dsandbox -Dddd -oPort=3D2222 -oListenAddress=3Dlocalhost >=20 > followed by >=20 > % ssh -c aes128-cbc -p 2222 localhost >=20 > on a machine with an AESNI-capable CPU and aesni.ko loaded. AES-NI doesn't have to go through kernel at all and doing so is much slower. Not sure if our OpenSSL version already has native AES-NI support. If not it would be best to upgrade it. This would fix AES-NI at least. Other crypto HW that do need kernel driver would still need something here. I wonder if CRIOGET can't be done before setting rlimit. How does it work on OpenBSD then? > > Also what is the exact difference between "sandbox" and "yes" settings? >=20 > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means > a bunch of rlimit settings. I thought that simple "yes" setting does chroot to /var/empty, drops privileges to sshd user/group and sets rlimit? I'm trying to figure out the difference between those two settings. > > The reason I ask is because I plan to experiment with OpenSSH sandboxing > > to use Capsicum and Casper. >=20 > You still have the patches I sent you? Probably somewhere in my INBOX. If you have them handy can you please resend them? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGl+awACgkQForvXbEpPzSQ2QCg4Rd8ricVkUU7xRd+8/sEWdv3 TAwAoIJZDDC2W3fUllt4f62suXTzxWuu =a7Dr -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-svn-src-all@FreeBSD.ORG Wed May 29 13:36:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A767DA9B; Wed, 29 May 2013 13:36:33 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 999DFED1; Wed, 29 May 2013 13:36:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TDaX2B092028; Wed, 29 May 2013 13:36:33 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TDaXwj092027; Wed, 29 May 2013 13:36:33 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305291336.r4TDaXwj092027@svn.freebsd.org> From: Chris Rees Date: Wed, 29 May 2013 13:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251102 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 13:36:33 -0000 Author: crees (doc,ports committer) Date: Wed May 29 13:36:33 2013 New Revision: 251102 URL: http://svnweb.freebsd.org/changeset/base/251102 Log: Add my entry. Approved by: bcr, gjb (mentors) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Wed May 29 12:40:28 2013 (r251101) +++ head/share/misc/committers-doc.dot Wed May 29 13:36:33 2013 (r251102) @@ -56,6 +56,7 @@ blackend [label="Marc Fonvieille\nblacke brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] +crees [label="Chris Rees\ncrees@FreeBSD.org\n2013/05/27"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] dru [label="Dru Lavigne\ndru@FreeBSD.org\n2013/01/22"] @@ -95,6 +96,7 @@ bcr -> gavin bcr -> wblock bcr -> eadler bcr -> dru +bcr -> crees blackend -> ale @@ -120,6 +122,7 @@ gabor -> ebrandi gjb -> wblock gjb -> rene gjb -> dru +gjb -> crees hrs -> ryusuke hrs -> dru From owner-svn-src-all@FreeBSD.ORG Wed May 29 15:03:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C3D21C2; Wed, 29 May 2013 15:03:11 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 139D0ADA; Wed, 29 May 2013 15:03:10 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 64B46730E; Wed, 29 May 2013 15:03:04 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id F0ADE4AA3D; Wed, 29 May 2013 17:03:05 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> <20130529125052.GA1383@garage.freebsd.pl> Date: Wed, 29 May 2013 17:03:05 +0200 In-Reply-To: <20130529125052.GA1383@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 29 May 2013 14:50:52 +0200") Message-ID: <867gih4ymu.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 15:03:11 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Pawel Jakub Dawidek writes: > AES-NI doesn't have to go through kernel at all and doing so is much > slower. Not sure if our OpenSSL version already has native AES-NI > support. If not it would be best to upgrade it. This would fix AES-NI > at least. Other crypto HW that do need kernel driver would still need > something here. I wonder if CRIOGET can't be done before setting rlimit. The CRIOGET ioctl call happens deep inside OpenSSL. There may be a way to pre-initialize the AES engine, but the unprivileged child doesn't know which engine to use until after it's sandboxed. > How does it work on OpenBSD then? IIUC, they have sandboxing facilities in the base system and use those instead of the extremely rudimentary rlimit-based implementation that we use. > > > Also what is the exact difference between "sandbox" and "yes" setting= s? > > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means > > a bunch of rlimit settings. > I thought that simple "yes" setting does chroot to /var/empty, drops > privileges to sshd user/group and sets rlimit? I'm trying to figure out > the difference between those two settings. In our case, the only difference is that "sandbox" uses setrlimit() to prevent the unprivileged child from forking, opening files or appending to open files. > > > The reason I ask is because I plan to experiment with OpenSSH > > > sandboxing to use Capsicum and Casper. > > You still have the patches I sent you? > Probably somewhere in my INBOX. If you have them handy can you please > resend them? Attached. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=openssh-capsicum.diff Content-Transfer-Encoding: quoted-printable Index: crypto/openssh/servconf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/servconf.c (revision 237273) +++ crypto/openssh/servconf.c (working copy) @@ -320,7 +320,7 @@ =20 /* Turn privilege separation on by default */ if (use_privsep =3D=3D -1) - use_privsep =3D PRIVSEP_ON; + use_privsep =3D PRIVSEP_SANDBOX; =20 #ifndef HAVE_MMAP if (use_privsep && options->compression =3D=3D 1) { Index: crypto/openssh/sandbox-rlimit.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sandbox-rlimit.c (revision 237273) +++ crypto/openssh/sandbox-rlimit.c (working copy) @@ -32,17 +32,19 @@ #include =20 #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 /* Minimal sandbox that sets zero nfiles, nprocs and filesize rlimits */ =20 struct ssh_sandbox { + struct monitor *monitor; pid_t child_pid; }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -52,6 +54,7 @@ */ debug3("%s: preparing rlimit sandbox", __func__); box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; box->child_pid =3D 0; =20 return box; Index: crypto/openssh/sshd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sshd.c (revision 237273) +++ crypto/openssh/sshd.c (working copy) @@ -632,6 +632,14 @@ #endif } =20 +#if 1 +#include +#include +#include +#include +#include +#endif + static int privsep_preauth(Authctxt *authctxt) { @@ -645,7 +653,7 @@ pmonitor->m_pkex =3D &xxx_kex; =20 if (use_privsep =3D=3D PRIVSEP_SANDBOX) - box =3D ssh_sandbox_init(); + box =3D ssh_sandbox_init(pmonitor); pid =3D fork(); if (pid =3D=3D -1) { fatal("fork of unprivileged child failed"); @@ -677,6 +685,27 @@ ssh_sandbox_parent_finish(box); return 1; } else { +#if 1 + do { + struct rlimit rlim_infinity =3D { RLIM_INFINITY, RLIM_INFINITY }; + char ktfn[1024]; + int ktfd, ret; + snprintf(ktfn, sizeof ktfn, "/tmp/sshd.ktrace", (unsigned long)getpid()= ); + ktfd =3D open(ktfn, O_RDWR|O_CREAT|O_TRUNC, 0640); + if (ktfd =3D=3D -1) { + error("%s: truncate(): %s", __func__, strerror(errno)); + } else { + close(ktfd); + ktrace(ktfn, KTROP_SET, KTRFAC_SYSCALL, getpid()); + ret =3D ktrace(ktfn, KTROP_SET, + KTRFAC_SYSCALL|KTRFAC_SYSRET|KTRFAC_NAMEI|KTRFAC_PSIG|KTRFAC_STRUC= T|KTRFAC_CAPFAIL, + getpid()); + if (ret =3D=3D -1) + error("%s: ktrace(): %s", __func__, strerror(errno)); + } + setrlimit(RLIMIT_CORE, &rlim_infinity); + } while (0); +#endif /* child */ close(pmonitor->m_sendfd); close(pmonitor->m_log_recvfd); Index: crypto/openssh/sandbox-darwin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sandbox-darwin.c (revision 237273) +++ crypto/openssh/sandbox-darwin.c (working copy) @@ -30,17 +30,19 @@ #include =20 #include "log.h" +#include "monitor.h" #include "sandbox.h" #include "xmalloc.h" =20 /* Darwin/OS X sandbox */ =20 struct ssh_sandbox { + struct monitor *monitor; pid_t child_pid; }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -50,6 +52,7 @@ */ debug3("%s: preparing Darwin sandbox", __func__); box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; box->child_pid =3D 0; =20 return box; Index: crypto/openssh/sshd_config.5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sshd_config.5 (revision 237273) +++ crypto/openssh/sshd_config.5 (working copy) @@ -1083,14 +1083,14 @@ the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. -The default is -.Dq yes . If .Cm UsePrivilegeSeparation is set to .Dq sandbox then the pre-authentication unprivileged process is subject to additional restrictions. +The default is +.Dq sandbox . .It Cm VersionAddendum Specifies a string to append to the regular version string to identify OS- or site-specific modifications. Index: crypto/openssh/sshd_config =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sshd_config (revision 237273) +++ crypto/openssh/sshd_config (working copy) @@ -103,7 +103,7 @@ #PrintLastLog yes #TCPKeepAlive yes #UseLogin no -#UsePrivilegeSeparation yes +#UsePrivilegeSeparation sandbox #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 Index: crypto/openssh/sandbox-capsicum.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sandbox-capsicum.c (revision 0) +++ crypto/openssh/sandbox-capsicum.c (working copy) @@ -0,0 +1,96 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 Dag-Erling Sm=C3=B8rgrav + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "includes.h" + +#ifdef SANDBOX_CAPSICUM + +#include +#include + +#include +#include +#include + +#include "log.h" +#include "monitor.h" +#include "ssh-sandbox.h" +#include "xmalloc.h" + +/* Capsicum-based sandbox */ + +struct ssh_sandbox { + struct monitor *monitor; + pid_t child_pid; +}; + +struct ssh_sandbox * +ssh_sandbox_init(struct monitor *monitor) +{ + struct ssh_sandbox *box; + + debug3("%s: preparing Capsicum sandbox", __func__); + box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; + box->child_pid =3D 0; + + return box; +} + +static int +ssh_child_limitfd(int fd, cap_rights_t rights) +{ + int cd, serrno; + + if ((cd =3D cap_new(fd, rights)) =3D=3D -1) + return -1; + if (dup2(cd, fd) =3D=3D -1) { + serrno =3D errno; + close(cd); + errno =3D serrno; + return -1; + } + close(cd); + return 0; +} + +void +ssh_sandbox_child(struct ssh_sandbox *box) +{ + int cd; + + if (ssh_child_limitfd(box->monitor->m_recvfd, CAP_READ|CAP_WRITE|CAP_SEEK= ) =3D=3D -1) + fatal("%s: failed to wrap the network socket", __func__); + if (ssh_child_limitfd(box->monitor->m_log_sendfd, CAP_WRITE|CAP_SEEK) =3D= =3D -1) + fatal("%s: failed to wrap the logging socket", __func__); + cap_enter(); +} + +void +ssh_sandbox_parent_finish(struct ssh_sandbox *box) +{ + free(box); + debug3("%s: finished", __func__); +} + +void +ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid) +{ + box->child_pid =3D child_pid; +} + +#endif /* SANDBOX_CAPSICUM */ Index: crypto/openssh/sandbox-null.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sandbox-null.c (revision 237273) +++ crypto/openssh/sandbox-null.c (working copy) @@ -29,6 +29,7 @@ #include =20 #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 @@ -39,7 +40,7 @@ }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -48,6 +49,7 @@ * to return non-NULL to satisfy the API. */ box =3D xcalloc(1, sizeof(*box)); + (void)monitor; return box; } =20 Index: crypto/openssh/ssh-sandbox.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/ssh-sandbox.h (revision 237273) +++ crypto/openssh/ssh-sandbox.h (working copy) @@ -15,9 +15,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ =20 +struct monitor; struct ssh_sandbox; =20 -struct ssh_sandbox *ssh_sandbox_init(void); +struct ssh_sandbox *ssh_sandbox_init(struct monitor *); void ssh_sandbox_child(struct ssh_sandbox *); void ssh_sandbox_parent_finish(struct ssh_sandbox *); void ssh_sandbox_parent_preauth(struct ssh_sandbox *, pid_t); Index: crypto/openssh/config.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/config.h (revision 237273) +++ crypto/openssh/config.h (working copy) @@ -219,6 +219,12 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_BSTRING_H */ =20 +/* Define to 1 if you have the `cap_enter' function. */ +#define HAVE_CAP_ENTER 1 + +/* Capsicum Capability Mode */ +#define HAVE_CAP_MODE 1 + /* Define to 1 if you have the `clock' function. */ #define HAVE_CLOCK 1 =20 @@ -1342,6 +1348,9 @@ /* read(1) can return 0 for a non-closed fd */ /* #undef PTY_ZEROREAD */ =20 +/* Sandbox using Capsicum */ +#define SANDBOX_CAPSICUM 1 + /* Sandbox using Darwin sandbox_init(3) */ /* #undef SANDBOX_DARWIN */ =20 @@ -1349,11 +1358,14 @@ /* #undef SANDBOX_NULL */ =20 /* Sandbox using setrlimit(2) */ -#define SANDBOX_RLIMIT 1 +/* #undef SANDBOX_RLIMIT */ =20 /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ =20 +/* Sandbox using Capsicum */ +#define SANDBOX_CAPSICUM 1 + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ =20 Index: crypto/openssh/sandbox-systrace.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sandbox-systrace.c (revision 237273) +++ crypto/openssh/sandbox-systrace.c (working copy) @@ -38,6 +38,7 @@ =20 #include "atomicio.h" #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 @@ -75,7 +76,7 @@ }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; int s[2]; @@ -88,6 +89,7 @@ box->parent_sock =3D s[1]; box->systrace_fd =3D -1; box->child_pid =3D 0; + (void)monitor; =20 return box; } Index: secure/usr.sbin/sshd/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 --- secure/usr.sbin/sshd/Makefile (revision 237273) +++ secure/usr.sbin/sshd/Makefile (working copy) @@ -17,7 +17,8 @@ loginrec.c auth-pam.c auth-shadow.c auth-sia.c md5crypt.c \ sftp-server.c sftp-common.c \ roaming_common.c roaming_serv.c \ - sandbox-null.c sandbox-rlimit.c sandbox-systrace.c sandbox-darwin.c + sandbox-null.c sandbox-rlimit.c sandbox-systrace.c sandbox-darwin.c \ + sandbox-capsicum.c =20 # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile SRCS+=3D gss-genr.c --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Wed May 29 16:51:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7E60E58; Wed, 29 May 2013 16:51:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A91F4953; Wed, 29 May 2013 16:51:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TGp3QZ061692; Wed, 29 May 2013 16:51:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TGp3wU061691; Wed, 29 May 2013 16:51:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305291651.r4TGp3wU061691@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 29 May 2013 16:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251103 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 16:51:03 -0000 Author: marcel Date: Wed May 29 16:51:03 2013 New Revision: 251103 URL: http://svnweb.freebsd.org/changeset/base/251103 Log: Don't assign the copyright to the FreeBSD foundation for the years this file is in FreeBSD. There's formality to this that hasn't happened and Juniper is perfectly fine with being the holder. Discussed with: eadler, imp, jhb Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Wed May 29 13:36:33 2013 (r251102) +++ head/sys/mips/mips/db_trace.c Wed May 29 16:51:03 2013 (r251103) @@ -1,5 +1,4 @@ /*- - * Copyright (c) 2008-2013 The FreeBSD Foundation * Copyright (c) 2004-2005, Juniper Networks, Inc. * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Wed May 29 16:55:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAA611D2; Wed, 29 May 2013 16:55:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8C599E; Wed, 29 May 2013 16:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TGtX9K062743; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TGtXDx062742; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305291655.r4TGtXDx062742@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 16:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251104 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 16:55:33 -0000 Author: des Date: Wed May 29 16:55:33 2013 New Revision: 251104 URL: http://svnweb.freebsd.org/changeset/base/251104 Log: MF9 (r248915): remove harmless duplicate entry for VersionAddendum. Modified: stable/8/crypto/openssh/servconf.c Modified: stable/8/crypto/openssh/servconf.c ============================================================================== --- stable/8/crypto/openssh/servconf.c Wed May 29 16:51:03 2013 (r251103) +++ stable/8/crypto/openssh/servconf.c Wed May 29 16:55:33 2013 (r251104) @@ -499,7 +499,6 @@ static struct { { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, { "ipqos", sIPQoS, SSHCFG_ALL }, { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, - { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, { "hpndisabled", sHPNDisabled, SSHCFG_ALL }, { "hpnbuffersize", sHPNBufferSize, SSHCFG_ALL }, { "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL }, From owner-svn-src-all@FreeBSD.ORG Wed May 29 17:31:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9E978A8; Wed, 29 May 2013 17:31:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ABBEEAFD; Wed, 29 May 2013 17:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4THVZ9p076227; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4THVZWJ076226; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305291731.r4THVZWJ076226@svn.freebsd.org> From: Bryan Drewery Date: Wed, 29 May 2013 17:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251106 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 17:31:35 -0000 Author: bdrewery (ports committer) Date: Wed May 29 17:31:34 2013 New Revision: 251106 URL: http://svnweb.freebsd.org/changeset/base/251106 Log: MFH r250595: The HPN patch added a new BUG bit for SSH_BUG_LARGEWINDOW and the update to 6.1 added SSH_BUG_DYNAMIC_RPORT with the same value. Fix the HPN SSH_BUG_LARGEWINDOW bit so it is unique. Modified: stable/8/crypto/openssh/compat.h Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/compat.h ============================================================================== --- stable/8/crypto/openssh/compat.h Wed May 29 17:04:43 2013 (r251105) +++ stable/8/crypto/openssh/compat.h Wed May 29 17:31:34 2013 (r251106) @@ -60,7 +60,7 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x08000000 +#define SSH_BUG_LARGEWINDOW 0x10000000 void enable_compat13(void); void enable_compat20(void); From owner-svn-src-all@FreeBSD.ORG Wed May 29 17:58:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97376415; Wed, 29 May 2013 17:58:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-f54.google.com (mail-qe0-f54.google.com [209.85.128.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2B546D33; Wed, 29 May 2013 17:58:44 +0000 (UTC) Received: by mail-qe0-f54.google.com with SMTP id i11so5372524qej.27 for ; Wed, 29 May 2013 10:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OGayFVCphYUme3bF5MJIJUURSvf0rWwlV8nmi5ywoag=; b=eFwh8pjhyQP8ZU6qrjzorezXobXRdwClIcQAZTU0TpGM+FYdpeDRPfHJEZxIZxaYAo fI7Q96mX2Bp2Gd+AejicjEn02yygG+FrckH9UIdBN6Oqe2Eew55NPVwB++mZg7jQubBs Fh4rT3q3YeAj/we4VBxtEyv11u9+PHMhe2un6EGMDijjbncxcQYDq9jPgivX3EwZkzD2 sF1N8V6iM7znQF/mANsoa6M3u39NU3onfx3I2A3DOtfl2b/X0H8tb5ptHs+qucs0TnxQ yCHuchoGNiSoIGwrD6gC58am0w7KvYOwHJf7kWoILkSaTcdbqWk4fHMm73hQmqvKdM8r 19yQ== MIME-Version: 1.0 X-Received: by 10.224.52.212 with SMTP id j20mr4187754qag.64.1369850324434; Wed, 29 May 2013 10:58:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.199.66 with HTTP; Wed, 29 May 2013 10:58:44 -0700 (PDT) In-Reply-To: <51A5E4DE.5060007@FreeBSD.org> References: <201305290421.r4T4LgRc099595@svn.freebsd.org> <51A5E4DE.5060007@FreeBSD.org> Date: Wed, 29 May 2013 10:58:44 -0700 X-Google-Sender-Auth: Cgchrs8qADglhFfA0EPufdgnb2U Message-ID: Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 17:58:45 -0000 No, it actually failed to compile at all on some older 9-stable laptops.. Hence my confusion. Adrian On 29 May 2013 04:22, Dimitry Andric wrote: > On 2013-05-29 06:21, Adrian Chadd wrote: >> >> Author: adrian >> Date: Wed May 29 04:21:42 2013 >> New Revision: 251098 >> URL: http://svnweb.freebsd.org/changeset/base/251098 >> >> Log: >> Fix a false -> AH_FALSE. >> >> Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. >> It's been like this for a while. > > > Because 'false' will be implicitly converted to an enum HAL_BOOL value. > Adding a warning for such cases would result in a *lot* of noise, and > probably many angry developers. ;-) > > Note that in C++, such a call would result in an error: "no known > conversion from 'bool' to 'HAL_BOOL'". > From owner-svn-src-all@FreeBSD.ORG Wed May 29 19:17:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 686C0CBD; Wed, 29 May 2013 19:17:00 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B18B20D; Wed, 29 May 2013 19:17:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TJH02R012711; Wed, 29 May 2013 19:17:00 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TJH05P012710; Wed, 29 May 2013 19:17:00 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305291917.r4TJH05P012710@svn.freebsd.org> From: Chris Rees Date: Wed, 29 May 2013 19:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251107 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 19:17:00 -0000 Author: crees (doc,ports committer) Date: Wed May 29 19:16:59 2013 New Revision: 251107 URL: http://svnweb.freebsd.org/changeset/base/251107 Log: Make the instruction order for buildworld agree with UPDATING and the Handbook. Reviewed by: imp, bdrewery, netchild Approved by: gjb (mentor) Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed May 29 17:31:34 2013 (r251106) +++ head/Makefile Wed May 29 19:16:59 2013 (r251107) @@ -65,8 +65,8 @@ # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `mergemaster -p' # 7. `make installworld' -# 8. `make delete-old' -# 9. `mergemaster' (you may wish to use -i, along with -U or -F). +# 8. `mergemaster' (you may wish to use -i, along with -U or -F). +# 9. `make delete-old' # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) # From owner-svn-src-all@FreeBSD.ORG Wed May 29 19:41:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4DBE6EC; Wed, 29 May 2013 19:41:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95491349; Wed, 29 May 2013 19:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TJfbfR022031; Wed, 29 May 2013 19:41:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TJfaWN022025; Wed, 29 May 2013 19:41:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305291941.r4TJfaWN022025@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 29 May 2013 19:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251108 - in head/contrib/atf/atf-c++: . detail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 19:41:37 -0000 Author: marcel Date: Wed May 29 19:41:36 2013 New Revision: 251108 URL: http://svnweb.freebsd.org/changeset/base/251108 Log: Modify atf::fs::path::get_process_helpers_path API to properly handle pathing with detail/ tests. Based on patch pushed upstream to ATF project. Obtained from: Garrett Cooper Modified: head/contrib/atf/atf-c++/check_test.cpp head/contrib/atf/atf-c++/detail/process_test.cpp head/contrib/atf/atf-c++/detail/test_helpers.cpp head/contrib/atf/atf-c++/detail/test_helpers.hpp Modified: head/contrib/atf/atf-c++/check_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:41:36 2013 (r251108) @@ -61,7 +61,7 @@ std::auto_ptr< atf::check::check_result do_exec(const atf::tests::tc* tc, const char* helper_name) { std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(*tc).str()); + argv.push_back(get_process_helpers_path(*tc, false).str()); argv.push_back(helper_name); std::cout << "Executing " << argv[0] << " " << argv[1] << "\n"; @@ -74,7 +74,7 @@ std::auto_ptr< atf::check::check_result do_exec(const atf::tests::tc* tc, const char* helper_name, const char *carg2) { std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(*tc).str()); + argv.push_back(get_process_helpers_path(*tc, false).str()); argv.push_back(helper_name); argv.push_back(carg2); std::cout << "Executing " << argv[0] << " " << argv[1] << " " Modified: head/contrib/atf/atf-c++/detail/process_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:41:36 2013 (r251108) @@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::t using atf::process::exec; std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(tc).leaf_name()); + argv.push_back(get_process_helpers_path(tc, true).leaf_name()); argv.push_back(helper_name); - return exec(get_process_helpers_path(tc), + return exec(get_process_helpers_path(tc, true), atf::process::argv_array(argv), atf::process::stream_inherit(), atf::process::stream_inherit()); Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp ============================================================================== --- head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:41:36 2013 (r251108) @@ -82,10 +82,14 @@ header_check(const char *hdrname) } atf::fs::path -get_process_helpers_path(const atf::tests::tc& tc) +get_process_helpers_path(const atf::tests::tc& tc, bool is_detail) { - return atf::fs::path(tc.get_config_var("srcdir")) / - ".." / "atf-c" / "detail" / "process_helpers"; + if (is_detail) + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / ".." / "atf-c" / "detail" / "process_helpers"; + else + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / "atf-c" / "detail" / "process_helpers"; } bool Modified: head/contrib/atf/atf-c++/detail/test_helpers.hpp ============================================================================== --- head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:41:36 2013 (r251108) @@ -86,7 +86,7 @@ class tc; void header_check(const char*); void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bool); -atf::fs::path get_process_helpers_path(const atf::tests::tc&); +atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool); bool grep_file(const char*, const char*); bool grep_string(const std::string&, const char*); From owner-svn-src-all@FreeBSD.ORG Wed May 29 19:51:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C607FA99; Wed, 29 May 2013 19:51:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 91196393; Wed, 29 May 2013 19:51:43 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id uo1so9679766pbc.15 for ; Wed, 29 May 2013 12:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=Q/PLtYWLU90UeTusCaQzkxBHgU2f8oVhEVdyQURqOxM=; b=sn2JBKofCQ1O4rhiCgZmWP7+QBOB6pYdg2awPHsbqfbzoDKdbGRrrHa0N4YufPZaRD KEA3m/wDMTULmlDKd/fyyjJwrYsQ2EJLcI7FxGk7suhPoMR6K+GNI/lU6rzUD/wz7qlC osF4f0YNV8lCoSHjtxnVhk+Kmq2x+helh8qL6yrQ1sRvUwnKqwUfe6Ja7xlHT/oDl7Qu LD8e/MZENYTB3vpvtZYbrydlcXxXdg5IxBJHSEywljaYtJxgs2DjHtFtOPfdkGuAsh02 pW/hmm3qBP4NBwP9uWTG2H8QxVJO4te4o5k1lasC+NjVN65FS/Fzgk/M64rLYVeGptob rwfQ== X-Received: by 10.66.163.5 with SMTP id ye5mr4986244pab.60.1369857103400; Wed, 29 May 2013 12:51:43 -0700 (PDT) Received: from [10.35.247.147] (mobile-166-147-083-100.mycingular.net. [166.147.83.100]) by mx.google.com with ESMTPSA id qh4sm41122327pac.8.2013.05.29.12.51.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 12:51:42 -0700 (PDT) References: <201305291941.r4TJfaWN022025@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201305291941.r4TJfaWN022025@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <27261F76-9F6D-4A1A-AB35-50E2F8DC9311@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r251108 - in head/contrib/atf/atf-c++: . detail Date: Wed, 29 May 2013 12:51:35 -0700 To: Marcel Moolenaar Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 19:51:43 -0000 Thanks for this! Please don't commit the change I attached earlier to share/= atf/Makefile though--it makes an integration test pass but it causes runtime= to go to a crawl when running atf-run; that's why my demo at BSDCan didn't w= ork ;(.. Sent from my iPhone On May 29, 2013, at 12:41 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Wed May 29 19:41:36 2013 > New Revision: 251108 > URL: http://svnweb.freebsd.org/changeset/base/251108 >=20 > Log: > Modify atf::fs::path::get_process_helpers_path API to properly > handle pathing with detail/ tests. Based on patch pushed upstream to > ATF project. >=20 > Obtained from: Garrett Cooper >=20 > Modified: > head/contrib/atf/atf-c++/check_test.cpp > head/contrib/atf/atf-c++/detail/process_test.cpp > head/contrib/atf/atf-c++/detail/test_helpers.cpp > head/contrib/atf/atf-c++/detail/test_helpers.hpp >=20 > Modified: head/contrib/atf/atf-c++/check_test.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:16:59 2013 = (r251107) > +++ head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:41:36 2013 = (r251108) > @@ -61,7 +61,7 @@ std::auto_ptr< atf::check::check_result=20 > do_exec(const atf::tests::tc* tc, const char* helper_name) > { > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(*tc).str()); > + argv.push_back(get_process_helpers_path(*tc, false).str()); > argv.push_back(helper_name); > std::cout << "Executing " << argv[0] << " " << argv[1] << "\n"; >=20 > @@ -74,7 +74,7 @@ std::auto_ptr< atf::check::check_result=20 > do_exec(const atf::tests::tc* tc, const char* helper_name, const char *car= g2) > { > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(*tc).str()); > + argv.push_back(get_process_helpers_path(*tc, false).str()); > argv.push_back(helper_name); > argv.push_back(carg2); > std::cout << "Executing " << argv[0] << " " << argv[1] << " " >=20 > Modified: head/contrib/atf/atf-c++/detail/process_test.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::t > using atf::process::exec; >=20 > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(tc).leaf_name()); > + argv.push_back(get_process_helpers_path(tc, true).leaf_name()); > argv.push_back(helper_name); >=20 > - return exec(get_process_helpers_path(tc), > + return exec(get_process_helpers_path(tc, true), > atf::process::argv_array(argv), > atf::process::stream_inherit(), > atf::process::stream_inherit()); >=20 > Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -82,10 +82,14 @@ header_check(const char *hdrname) > } >=20 > atf::fs::path > -get_process_helpers_path(const atf::tests::tc& tc) > +get_process_helpers_path(const atf::tests::tc& tc, bool is_detail) > { > - return atf::fs::path(tc.get_config_var("srcdir")) / > - ".." / "atf-c" / "detail" / "process_helpers"; > + if (is_detail) > + return atf::fs::path(tc.get_config_var("srcdir")) / > + ".." / ".." / "atf-c" / "detail" / "process_helpers"; > + else > + return atf::fs::path(tc.get_config_var("srcdir")) / > + ".." / "atf-c" / "detail" / "process_helpers"; > } >=20 > bool >=20 > Modified: head/contrib/atf/atf-c++/detail/test_helpers.hpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -86,7 +86,7 @@ class tc; >=20 > void header_check(const char*); > void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bo= ol); > -atf::fs::path get_process_helpers_path(const atf::tests::tc&); > +atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool); > bool grep_file(const char*, const char*); > bool grep_string(const std::string&, const char*); >=20 > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Wed May 29 20:36:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141CD88F; Wed, 29 May 2013 20:36:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06715832; Wed, 29 May 2013 20:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TKaqPv040498; Wed, 29 May 2013 20:36:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TKaqec040496; Wed, 29 May 2013 20:36:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305292036.r4TKaqec040496@svn.freebsd.org> From: Eitan Adler Date: Wed, 29 May 2013 20:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251109 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 20:36:53 -0000 Author: eadler Date: Wed May 29 20:36:51 2013 New Revision: 251109 URL: http://svnweb.freebsd.org/changeset/base/251109 Log: Add support for tethering on the iPhone 4S PR: usb/179078 Submitted by: Christopher Sean Hilton MFC After: 1 week Modified: head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Wed May 29 19:41:36 2013 (r251108) +++ head/sys/dev/usb/net/if_ipheth.c Wed May 29 20:36:51 2013 (r251109) @@ -161,6 +161,9 @@ static const STRUCT_USB_HOST_ID ipheth_d {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4S, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed May 29 19:41:36 2013 (r251108) +++ head/sys/dev/usb/usbdevs Wed May 29 20:36:51 2013 (r251109) @@ -1087,6 +1087,7 @@ product APPLE IPOD_TOUCH 0x1291 iPod Tou product APPLE IPHONE_3G 0x1292 iPhone 3G product APPLE IPHONE_3GS 0x1294 iPhone 3GS product APPLE IPHONE_4 0x1297 iPhone 4 +product APPLE IPHONE_4S 0x12a0 iPhone 4S product APPLE IPHONE_5 0x12a8 iPhone 5 product APPLE IPAD 0x129a iPad product APPLE ETHERNET 0x1402 Ethernet A1277 From owner-svn-src-all@FreeBSD.ORG Wed May 29 21:07:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 567A4D33; Wed, 29 May 2013 21:07:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D716957; Wed, 29 May 2013 21:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TL7Prp051089; Wed, 29 May 2013 21:07:25 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TL7P3u051088; Wed, 29 May 2013 21:07:25 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292107.r4TL7P3u051088@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 21:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251110 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 21:07:25 -0000 Author: markj Date: Wed May 29 21:07:24 2013 New Revision: 251110 URL: http://svnweb.freebsd.org/changeset/base/251110 Log: MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 20:36:51 2013 (r251109) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:07:24 2013 (r251110) @@ -1450,16 +1450,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1545,7 +1556,7 @@ delete_oldest_timelog(const struct conf_ err(1, "Cannot open log directory '%s'", dir); dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -2310,10 +2321,10 @@ mtime_old_timelog(const char *file) dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-all@FreeBSD.ORG Wed May 29 21:08:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1418EAB; Wed, 29 May 2013 21:08:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4216965; Wed, 29 May 2013 21:08:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TL8N1R051369; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TL8NgK051368; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292108.r4TL8NgK051368@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 21:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251111 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 21:08:24 -0000 Author: markj Date: Wed May 29 21:08:23 2013 New Revision: 251111 URL: http://svnweb.freebsd.org/changeset/base/251111 Log: MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:07:24 2013 (r251110) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) @@ -1447,16 +1447,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1508,7 +1519,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dirfd, i, logcnt, max_logcnt; + int dir_fd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1540,9 +1551,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -2248,7 +2259,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dir_fd; + int dirfd; time_t t; struct dirent *dp; DIR *dirp; @@ -2273,13 +2284,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-all@FreeBSD.ORG Wed May 29 22:29:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFCB4A88; Wed, 29 May 2013 22:29:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0AD3CCA; Wed, 29 May 2013 22:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TMTXrA079439; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TMTXTO079438; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292229.r4TMTXTO079438@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 22:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251112 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:29:33 -0000 Author: markj Date: Wed May 29 22:29:33 2013 New Revision: 251112 URL: http://svnweb.freebsd.org/changeset/base/251112 Log: Revert my previous merge. There's a variable name difference between head and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I did the MFC, even after I tested. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) @@ -1447,27 +1447,16 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, - struct tm *tm) +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) { - struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) { - /* - * Some filesystems (e.g. NFS) don't fill out the d_type field - * and leave it set to DT_UNKNOWN; in this case we must obtain - * the file type ourselves. - */ - if (dp->d_type != DT_UNKNOWN || - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) - return (0); - } + if (dp->d_type != DT_REG) + return (0); /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1519,7 +1508,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dir_fd, i, logcnt, max_logcnt; + int dirfd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1551,9 +1540,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; /* @@ -2259,7 +2248,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dirfd; + int dir_fd; time_t t; struct dirent *dp; DIR *dirp; @@ -2284,13 +2273,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-all@FreeBSD.ORG Wed May 29 22:30:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F67EC01; Wed, 29 May 2013 22:30:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38AD1CD6; Wed, 29 May 2013 22:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TMUUZn079885; Wed, 29 May 2013 22:30:30 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TMUUPX079884; Wed, 29 May 2013 22:30:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292230.r4TMUUPX079884@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 22:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251113 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:30:30 -0000 Author: markj Date: Wed May 29 22:30:29 2013 New Revision: 251113 URL: http://svnweb.freebsd.org/changeset/base/251113 Log: Revert my previous merge. There's a variable name difference between head and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I did the MFC, even after I tested. Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r251113) @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, - struct tm *tm) +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) { - struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) { - /* - * Some filesystems (e.g. NFS) don't fill out the d_type field - * and leave it set to DT_UNKNOWN; in this case we must obtain - * the file type ourselves. - */ - if (dp->d_type != DT_UNKNOWN || - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) - return (0); - } + if (dp->d_type != DT_REG) + return (0); /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ err(1, "Cannot open log directory '%s'", dir); dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; /* @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-all@FreeBSD.ORG Wed May 29 22:35:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D891BDCA; Wed, 29 May 2013 22:35:37 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id A0449D0D; Wed, 29 May 2013 22:35:37 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 30F86358C67; Thu, 30 May 2013 00:35:36 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 111DF28493; Thu, 30 May 2013 00:35:36 +0200 (CEST) Date: Thu, 30 May 2013 00:35:36 +0200 From: Jilles Tjoelker To: Eitan Adler Subject: Re: svn commit: r251078 - head/bin/sleep Message-ID: <20130529223535.GA11142@stack.nl> References: <201305282207.r4SM7We8065840@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:35:37 -0000 On Wed, May 29, 2013 at 01:32:05AM +0200, Eitan Adler wrote: > On 29 May 2013 00:07, Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue May 28 22:07:31 2013 > > New Revision: 251078 > > URL: http://svnweb.freebsd.org/changeset/base/251078 > > Log: > > sleep: Improve nanosleep() error handling: > > * Work around kernel bugs that cause a spurious [EINTR] return if a > > debugger (such as truss(1)) is attached. > The the fact that this is a workaround be noted in a comment so the > code may be removed when the bug is fixed? Good point. I will add a comment soon. I do not expect a complete fix for the kernel bug soon, though. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed May 29 22:37:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4FEA8F44; Wed, 29 May 2013 22:37:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) by mx1.freebsd.org (Postfix) with ESMTP id 0647DD18; Wed, 29 May 2013 22:37:20 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id a14so26308677iee.41 for ; Wed, 29 May 2013 15:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=b9lMYYUcLvAD2UkGZjhWMpzx3vsd3m5NywEoY6Rs89A=; b=rQ2jInAvQP+4IqMy5xCWzWPNKBMR/QThHZ0fswaM4Js0ddg+ur3sUBoHAHDF1YEdAY pzr1LkoVFMZVeVcYnURWvHPUcE1u7EmkgQaGjGtO0sXUuMpfEJu3P+t4JVbBDOBjCH+V x7aiuv6bltSyeCcB3R/ChuYsDFxVfBUHg8qg/29eN/GLUAAeP1SzFqWY1dF2QI/x4vNP 3eN/bKsUyNtmYq7hVkCHBMpK5ryjoBjPZxW1qEk3xr92Z1y5vPXP4I93Pnr3s9J51Bbl nVtEwqkrYWBD3D8VyvV/Q6Mc9qBcI4wPCKtHqpNl0ksFD1Oe+p0hTKwuF9HkjlVtPgB8 aXvA== X-Received: by 10.50.128.134 with SMTP id no6mr10570885igb.10.1369867040763; Wed, 29 May 2013 15:37:20 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id y11sm11417508igy.10.2013.05.29.15.37.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 15:37:20 -0700 (PDT) Sender: Mark Johnston Date: Wed, 29 May 2013 18:37:17 -0400 From: Mark Johnston To: src-committers@freebsd.org Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130529223717.GB59966@raichu> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305292230.r4TMUUPX079884@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:37:21 -0000 I'm very sorry about this. I was going to merge r235647 first so that I wouldn't make the same mistake a second time, but I decided against it when I saw that the commit extended beyond newsyslog, and then managed to do the MFC incorrectly after verifying that newsyslog built on the stable branches. Is it possible to only do the newsyslog portion of this MFC, or is it a rule that either all or none of a given revision should be merged to the stable branches? Sorry again, -Mark On Wed, May 29, 2013 at 10:30:30PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed May 29 22:30:29 2013 > New Revision: 251113 > URL: http://svnweb.freebsd.org/changeset/base/251113 > > Log: > Revert my previous merge. There's a variable name difference between head > and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I > did the MFC, even after I tested. > > Modified: > stable/9/usr.sbin/newsyslog/newsyslog.c > Directory Properties: > stable/9/usr.sbin/newsyslog/ (props changed) > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.c > ============================================================================== > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r251113) > @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons > * tm if this is the case; otherwise return false. > */ > static int > -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, > - struct tm *tm) > +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) > { > - struct stat sb; > size_t logfname_len; > char *s; > int c; > > logfname_len = strlen(logfname); > > - if (dp->d_type != DT_REG) { > - /* > - * Some filesystems (e.g. NFS) don't fill out the d_type field > - * and leave it set to DT_UNKNOWN; in this case we must obtain > - * the file type ourselves. > - */ > - if (dp->d_type != DT_UNKNOWN || > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || > - !S_ISREG(sb.st_mode)) > - return (0); > - } > + if (dp->d_type != DT_REG) > + return (0); > /* Ignore everything but files with our logfile prefix. */ > if (strncmp(dp->d_name, logfname, logfname_len) != 0) > return (0); > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > err(1, "Cannot open log directory '%s'", dir); > dirfd = dirfd(dirp); > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > /* > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > dir_fd = dirfd(dirp); > /* Open the archive dir and find the most recent archive of logfname. */ > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { > + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { > warn("Cannot stat '%s'", file); > continue; > } From owner-svn-src-all@FreeBSD.ORG Wed May 29 23:56:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04A43D7A; Wed, 29 May 2013 23:56:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB549FA0; Wed, 29 May 2013 23:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TNun2v010095; Wed, 29 May 2013 23:56:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TNundR010094; Wed, 29 May 2013 23:56:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305292356.r4TNundR010094@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 May 2013 23:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251114 - head/sys/modules/ata/atacbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 23:56:50 -0000 Author: marius Date: Wed May 29 23:56:49 2013 New Revision: 251114 URL: http://svnweb.freebsd.org/changeset/base/251114 Log: Fix a typo in r249213; the second bus_if.h should have been isa_if.h. Modified: head/sys/modules/ata/atacbus/Makefile Modified: head/sys/modules/ata/atacbus/Makefile ============================================================================== --- head/sys/modules/ata/atacbus/Makefile Wed May 29 22:30:29 2013 (r251113) +++ head/sys/modules/ata/atacbus/Makefile Wed May 29 23:56:49 2013 (r251114) @@ -4,6 +4,6 @@ KMOD= atacbus SRCS= ata-cbus.c -SRCS+= ata_if.h isa_if.h bus_if.h device_if.h bus_if.h +SRCS+= ata_if.h bus_if.h device_if.h isa_if.h .include From owner-svn-src-all@FreeBSD.ORG Thu May 30 00:11:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15B052BF; Thu, 30 May 2013 00:11:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07365AE; Thu, 30 May 2013 00:11:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U0BN8i016422; Thu, 30 May 2013 00:11:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U0BNX7016414; Thu, 30 May 2013 00:11:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305300011.r4U0BNX7016414@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 00:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251115 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 00:11:24 -0000 Author: marius Date: Thu May 30 00:11:22 2013 New Revision: 251115 URL: http://svnweb.freebsd.org/changeset/base/251115 Log: - Remove pointless returns. - Make cm_data a void pointer and cm_flags unsigned as appropriate. MFC after: 3 days Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac.c Thu May 30 00:11:22 2013 (r251115) @@ -379,8 +379,6 @@ aac_add_event(struct aac_softc *sc, stru event->ev_type); break; } - - return; } /* @@ -1631,8 +1629,6 @@ aac_map_command_sg(void *arg, bus_dma_se aac_requeue_ready(cm); } } - - return; } /* @@ -2362,7 +2358,6 @@ aac_timeout(struct aac_softc *sc) "longer running! code= 0x%x\n", code); } } - return; } /* @@ -3372,8 +3367,6 @@ aac_handle_aif(struct aac_softc *sc, str /* Wakeup any poll()ers */ selwakeuppri(&sc->rcv_select, PRIBIO); mtx_unlock(&sc->aac_aifq_lock); - - return; } /* @@ -3788,6 +3781,4 @@ aac_get_bus_info(struct aac_softc *sc) if (found) bus_generic_attach(sc->aac_dev); - - return; } Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac_cam.c Thu May 30 00:11:22 2013 (r251115) @@ -163,8 +163,6 @@ aac_cam_event(struct aac_softc *sc, stru event->ev_type); break; } - - return; } static int @@ -515,8 +513,6 @@ aac_cam_action(struct cam_sim *sim, unio aac_enqueue_ready(cm); aac_startio(cm->cm_sc); - - return; } static void @@ -625,8 +621,6 @@ aac_cam_complete(struct aac_command *cm) aac_release_command(cm); xpt_done(ccb); - - return; } static u_int32_t Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac_disk.c Thu May 30 00:11:22 2013 (r251115) @@ -167,8 +167,6 @@ aac_disk_strategy(struct bio *bp) mtx_lock(&sc->ad_controller->aac_io_lock); aac_submit_bio(bp); mtx_unlock(&sc->ad_controller->aac_io_lock); - - return; } /* Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aacvar.h Thu May 30 00:11:22 2013 (r251115) @@ -158,13 +158,13 @@ struct aac_command struct aac_fib *cm_fib; /* FIB associated with this * command */ u_int64_t cm_fibphys; /* bus address of the FIB */ - struct bio *cm_data; /* pointer to data in kernel + void *cm_data; /* pointer to data in kernel * space */ u_int32_t cm_datalen; /* data length */ bus_dmamap_t cm_datamap; /* DMA map for bio data */ struct aac_sg_table *cm_sgtable; /* pointer to s/g table in * command */ - int cm_flags; + u_int cm_flags; #define AAC_CMD_MAPPED (1<<0) /* command has had its data * mapped */ #define AAC_CMD_DATAIN (1<<1) /* command involves data moving @@ -182,7 +182,7 @@ struct aac_command #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ - void (* cm_complete)(struct aac_command *cm); + void (*cm_complete)(struct aac_command *cm); void *cm_private; time_t cm_timestamp; /* command creation time */ int cm_queue; From owner-svn-src-all@FreeBSD.ORG Thu May 30 00:22:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B8CB537; Thu, 30 May 2013 00:22:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0337710C; Thu, 30 May 2013 00:22:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U0M7xY020024; Thu, 30 May 2013 00:22:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U0M7rX020019; Thu, 30 May 2013 00:22:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305300022.r4U0M7rX020019@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 00:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251116 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 00:22:08 -0000 Author: marius Date: Thu May 30 00:22:07 2013 New Revision: 251116 URL: http://svnweb.freebsd.org/changeset/base/251116 Log: Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the same support for aacp(4), I'm lacking the necessary hardware for testing, though. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aac.c Thu May 30 00:22:07 2013 (r251116) @@ -987,14 +987,18 @@ aac_startio(struct aac_softc *sc) * busdma. */ if (cm->cm_datalen != 0) { - error = bus_dmamap_load(sc->aac_buffer_dmat, - cm->cm_datamap, cm->cm_data, - cm->cm_datalen, - aac_map_command_sg, cm, 0); + if (cm->cm_flags & AAC_REQ_BIO) + error = bus_dmamap_load_bio( + sc->aac_buffer_dmat, cm->cm_datamap, + (struct bio *)cm->cm_private, + aac_map_command_sg, cm, 0); + else + error = bus_dmamap_load(sc->aac_buffer_dmat, + cm->cm_datamap, cm->cm_data, + cm->cm_datalen, aac_map_command_sg, cm, 0); if (error == EINPROGRESS) { fwprintf(sc, HBA_FLAGS_DBG_COMM_B, "freezing queue\n"); sc->flags |= AAC_QUEUE_FRZN; - error = 0; } else if (error != 0) panic("aac_startio: unexpected error %d from " "busdma", error); @@ -1199,9 +1203,9 @@ aac_bio_command(struct aac_softc *sc, st goto fail; /* fill out the command */ - cm->cm_data = (void *)bp->bio_data; cm->cm_datalen = bp->bio_bcount; cm->cm_complete = aac_bio_complete; + cm->cm_flags = AAC_REQ_BIO; cm->cm_private = bp; cm->cm_timestamp = time_uptime; Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aac_disk.c Thu May 30 00:22:07 2013 (r251116) @@ -397,6 +397,7 @@ aac_disk_attach(device_t dev) sc->unit = device_get_unit(dev); sc->ad_disk = disk_alloc(); sc->ad_disk->d_drv1 = sc; + sc->ad_disk->d_flags = DISKFLAG_UNMAPPED_BIO; sc->ad_disk->d_name = "aacd"; sc->ad_disk->d_maxsize = sc->ad_controller->aac_max_sectors << 9; sc->ad_disk->d_open = aac_disk_open; Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aacvar.h Thu May 30 00:22:07 2013 (r251116) @@ -181,6 +181,8 @@ struct aac_command #define AAC_ON_AACQ_MASK ((1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<10)) #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ +#define AAC_REQ_BIO (1 << 11) +#define AAC_REQ_CCB (1 << 12) void (*cm_complete)(struct aac_command *cm); void *cm_private; From owner-svn-src-all@FreeBSD.ORG Thu May 30 00:55:35 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97E7DE7B; Thu, 30 May 2013 00:55:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 88EA2757; Thu, 30 May 2013 00:55:28 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4U0tRFD029076; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4U0tRKo029075; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks) Date: Wed, 29 May 2013 19:55:27 -0500 From: Brooks Davis To: Mark Johnston Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130530005527.GA29026@lor.one-eyed-alien.net> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> <20130529223717.GB59966@raichu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20130529223717.GB59966@raichu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 00:55:35 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 06:37:17PM -0400, Mark Johnston wrote: > I'm very sorry about this. I was going to merge r235647 first so that I > wouldn't make the same mistake a second time, but I decided against it > when I saw that the commit extended beyond newsyslog, and then managed > to do the MFC incorrectly after verifying that newsyslog built on the > stable branches. Is it possible to only do the newsyslog portion of this > MFC, or is it a rule that either all or none of a given revision should > be merged to the stable branches? The approved way to merge a change like r235647 would be per-library and per-program so only merging changes to a single program would be fine. -- Brooks >=20 > Sorry again, > -Mark >=20 > On Wed, May 29, 2013 at 10:30:30PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Wed May 29 22:30:29 2013 > > New Revision: 251113 > > URL: http://svnweb.freebsd.org/changeset/base/251113 > >=20 > > Log: > > Revert my previous merge. There's a variable name difference between = head > > and stable (dirfd vs. dir_fd) and I managed to get it wrong again whe= n I > > did the MFC, even after I tested. > >=20 > > Modified: > > stable/9/usr.sbin/newsyslog/newsyslog.c > > Directory Properties: > > stable/9/usr.sbin/newsyslog/ (props changed) > >=20 > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r= 251112) > > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r= 251113) > > @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons > > * tm if this is the case; otherwise return false. > > */ > > static int > > -validate_old_timelog(int fd, const struct dirent *dp, const char *logf= name, > > - struct tm *tm) > > +validate_old_timelog(const struct dirent *dp, const char *logfname, st= ruct tm *tm) > > { > > - struct stat sb; > > size_t logfname_len; > > char *s; > > int c; > > =20 > > logfname_len =3D strlen(logfname); > > =20 > > - if (dp->d_type !=3D DT_REG) { > > - /* > > - * Some filesystems (e.g. NFS) don't fill out the d_type field > > - * and leave it set to DT_UNKNOWN; in this case we must obtain > > - * the file type ourselves. > > - */ > > - if (dp->d_type !=3D DT_UNKNOWN || > > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) !=3D 0 || > > - !S_ISREG(sb.st_mode)) > > - return (0); > > - } > > + if (dp->d_type !=3D DT_REG) > > + return (0); > > /* Ignore everything but files with our logfile prefix. */ > > if (strncmp(dp->d_name, logfname, logfname_len) !=3D 0) > > return (0); > > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > > err(1, "Cannot open log directory '%s'", dir); > > dirfd =3D dirfd(dirp); > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > /* > > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > > dir_fd =3D dirfd(dirp); > > /* Open the archive dir and find the most recent archive of logfname.= */ > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) =3D=3D -1) { > > + if (fstatat(dir_fd, logfname, &sb, 0) =3D=3D -1) { > > warn("Cannot stat '%s'", file); > > continue; > > } >=20 --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRpqN/XY6L6fI4GtQRAlWvAKCfo1o7ShOOvE56C8UJAzCIFtmbYQCZAYsQ Y8wYpxVeZGwlqaKU7QvsqnA= =SDiT -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 01:19:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B39C9E1; Thu, 30 May 2013 01:19:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 532CD9CF; Thu, 30 May 2013 01:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U1J3TJ038900; Thu, 30 May 2013 01:19:03 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U1J2pO038898; Thu, 30 May 2013 01:19:02 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305300119.r4U1J2pO038898@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 01:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251117 - in head/sys: dev/cfi geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 01:19:03 -0000 Author: brooks Date: Thu May 30 01:19:02 2013 New Revision: 251117 URL: http://svnweb.freebsd.org/changeset/base/251117 Log: MFP4 @222836 Add support for partitioning CFI disks from FDT using geom_flashmap. Sponsored by: DARPA, AFRL Modified: head/sys/dev/cfi/cfi_disk.c head/sys/geom/geom_flashmap.c Modified: head/sys/dev/cfi/cfi_disk.c ============================================================================== --- head/sys/dev/cfi/cfi_disk.c Thu May 30 00:22:07 2013 (r251116) +++ head/sys/dev/cfi/cfi_disk.c Thu May 30 01:19:02 2013 (r251117) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include struct cfi_disk_softc { @@ -64,6 +65,7 @@ static int cfi_disk_detach(device_t); static int cfi_disk_open(struct disk *); static int cfi_disk_close(struct disk *); static void cfi_io_proc(void *, int); +static int cfi_disk_getattr(struct bio *); static void cfi_disk_strategy(struct bio *); static int cfi_disk_ioctl(struct disk *, u_long, void *, int, struct thread *); @@ -95,6 +97,7 @@ cfi_disk_attach(device_t dev) sc->disk->d_strategy = cfi_disk_strategy; sc->disk->d_ioctl = cfi_disk_ioctl; sc->disk->d_dump = NULL; /* NB: no dumps */ + sc->disk->d_getattr = cfi_disk_getattr; sc->disk->d_sectorsize = CFI_DISK_SECSIZE; sc->disk->d_mediasize = sc->parent->sc_size; sc->disk->d_maxsize = CFI_DISK_MAXIOSIZE; @@ -275,6 +278,31 @@ cfi_io_proc(void *arg, int pending) } } +static int +cfi_disk_getattr(struct bio *bp) +{ + struct cfi_disk_softc *dsc; + struct cfi_softc *sc; + device_t dev; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) + return (ENXIO); + + dsc = bp->bio_disk->d_drv1; + sc = dsc->parent; + dev = sc->sc_dev; + + do { + if (g_handleattr(bp, "CFI::device", &dev, sizeof(device_t))) + break; + + return (ERESTART); + } while(0); + + return (EJUSTRETURN); +} + + static void cfi_disk_strategy(struct bio *bp) { Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Thu May 30 00:22:07 2013 (r251116) +++ head/sys/geom/geom_flashmap.c Thu May 30 01:19:02 2013 (r251117) @@ -186,8 +186,11 @@ g_flashmap_taste(struct g_class *mp, str do { size = sizeof(device_t); - if (g_io_getattr("NAND::device", cp, &size, &dev)) - break; + if (g_io_getattr("NAND::device", cp, &size, &dev)) { + size = sizeof(device_t); + if (g_io_getattr("CFI::device", cp, &size, &dev)) + break; + } nslices = g_flashmap_load(dev, &head); if (nslices == 0) From owner-svn-src-all@FreeBSD.ORG Thu May 30 01:22:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2421C5B; Thu, 30 May 2013 01:22:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB3BD9FF; Thu, 30 May 2013 01:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U1Movg041255; Thu, 30 May 2013 01:22:50 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U1Mo9T041253; Thu, 30 May 2013 01:22:50 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305300122.r4U1Mo9T041253@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 01:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251118 - head/sys/dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 01:22:51 -0000 Author: brooks Date: Thu May 30 01:22:50 2013 New Revision: 251118 URL: http://svnweb.freebsd.org/changeset/base/251118 Log: MFP4 @217311 Intel and Sharp flash power on with their blocks in a "locked" state. Unlocked them before attempting to perform an erase or write action and relock when the action is complete. Modified: head/sys/dev/cfi/cfi_core.c head/sys/dev/cfi/cfi_reg.h Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Thu May 30 01:19:02 2013 (r251117) +++ head/sys/dev/cfi/cfi_core.c Thu May 30 01:22:50 2013 (r251118) @@ -409,6 +409,16 @@ cfi_write_block(struct cfi_softc *sc) register_t intr; int error, i; + /* Intel flash must be unlocked before modification */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_UB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } + /* Erase the block. */ switch (sc->sc_cmdset) { case CFI_VEND_INTEL_ECS: @@ -477,6 +487,16 @@ cfi_write_block(struct cfi_softc *sc) out: cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + + /* Relock Intel flash */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } return (error); } Modified: head/sys/dev/cfi/cfi_reg.h ============================================================================== --- head/sys/dev/cfi/cfi_reg.h Thu May 30 01:19:02 2013 (r251117) +++ head/sys/dev/cfi/cfi_reg.h Thu May 30 01:22:50 2013 (r251118) @@ -105,8 +105,11 @@ struct cfi_qry { #define CFI_BCS_READ_ARRAY 0xff /* Intel commands. */ +#define CFI_INTEL_LB 0x01 /* Lock Block */ +#define CFI_INTEL_LBS 0x60 /* Lock Block Setup */ #define CFI_INTEL_READ_ID 0x90 /* Read Identifier */ #define CFI_INTEL_PP_SETUP 0xc0 /* Protection Program Setup */ +#define CFI_INTEL_UB 0xd0 /* Unlock Block */ /* NB: these are addresses for 16-bit accesses */ #define CFI_INTEL_PLR 0x80 /* Protection Lock Register */ From owner-svn-src-all@FreeBSD.ORG Thu May 30 04:46:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CF80D38; Thu, 30 May 2013 04:46:37 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA11D3B; Thu, 30 May 2013 04:46:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4kb2w012067; Thu, 30 May 2013 04:46:37 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4kbpc012062; Thu, 30 May 2013 04:46:37 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300446.r4U4kbpc012062@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251119 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 04:46:37 -0000 Author: das Date: Thu May 30 04:46:36 2013 New Revision: 251119 URL: http://svnweb.freebsd.org/changeset/base/251119 Log: Basic tests for complex inverse trig and hyperbolic functions. Added: head/tools/regression/lib/msun/test-invctrig.c (contents, props changed) Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Thu May 30 01:22:50 2013 (r251118) +++ head/tools/regression/lib/msun/Makefile Thu May 30 04:46:36 2013 (r251119) @@ -2,7 +2,8 @@ TESTS= test-cexp test-conj test-csqrt test-ctrig \ test-exponential test-fenv test-fma \ - test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ + test-fmaxmin test-ilogb test-invtrig test-invctrig \ + test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm Added: head/tools/regression/lib/msun/test-invctrig.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-invctrig.c Thu May 30 04:46:36 2013 (r251119) @@ -0,0 +1,442 @@ +/*- + * Copyright (c) 2008-2013 David Schultz + * 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. + */ + +/* + * Tests for casin[h](), cacos[h](), and catan[h](). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) +#define OPT_INVALID (ALL_STD_EXCEPT & ~FE_INVALID) +#define OPT_INEXACT (ALL_STD_EXCEPT & ~FE_INEXACT) +#define FLT_ULP() ldexpl(1.0, 1 - FLT_MANT_DIG) +#define DBL_ULP() ldexpl(1.0, 1 - DBL_MANT_DIG) +#define LDBL_ULP() ldexpl(1.0, 1 - LDBL_MANT_DIG) + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* Flags that determine whether to check the signs of the result. */ +#define CS_REAL 1 +#define CS_IMAG 2 +#define CS_BOTH (CS_REAL | CS_IMAG) + +#ifdef DEBUG +#define debug(...) printf(__VA_ARGS__) +#else +#define debug(...) (void)0 +#endif + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal((func)(_d), (result), (checksign))); \ + assert(((func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* + * Test within a given tolerance. The tolerance indicates relative error + * in ulps. + */ +#define test_p_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(cfpequal_tol((func)(_d), (result), (tol))); \ +} while (0) + +/* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + test_p(func, z, result, exceptmask, excepts, checksign); \ + test_p(func, conjl(z), conjl(result), exceptmask, excepts, checksign); \ +} while (0) +#define test_tol(func, z, result, tol) do { \ + test_p_tol(func, z, result, tol); \ + test_p_tol(func, conjl(z), conjl(result), tol); \ +} while (0) + +/* Test the given function in all precisions. */ +#define testall(func, x, result, exceptmask, excepts, checksign) do { \ + test(func, x, result, exceptmask, excepts, checksign); \ + test(func##f, x, result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_odd(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -(x), -result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_even(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -(x), result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test the given function in all precisions, within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(func, x, result, tol) do { \ + test_tol(func, x, result, (tol) * DBL_ULP()); \ + test_tol(func##f, x, result, (tol) * FLT_ULP()); \ +} while (0) +#define testall_odd_tol(func, x, result, tol) do { \ + testall_tol(func, x, result, tol); \ + testall_tol(func, -(x), -result, tol); \ +} while (0) +#define testall_even_tol(func, x, result, tol) do { \ + testall_tol(func, x, result, tol); \ + testall_tol(func, -(x), result, tol); \ +} while (0) + +static const long double +pi = 3.14159265358979323846264338327950280L, +c3pi = 9.42477796076937971538793014983850839L; + +/* + * Determine whether x and y are equal, with two special rules: + * +0.0 != -0.0 + * NaN == NaN + * If checksign is 0, we compare the absolute values instead. + */ +static int +fpequal(long double x, long double y, int checksign) +{ + if (isnan(x) && isnan(y)) + return (1); + if (checksign) + return (x == y && !signbit(x) == !signbit(y)); + else + return (fabsl(x) == fabsl(y)); +} + +static int +fpequal_tol(long double x, long double y, long double tol) +{ + fenv_t env; + int ret; + + if (isnan(x) && isnan(y)) + return (1); + if (!signbit(x) != !signbit(y)) + return (0); + if (x == y) + return (1); + if (tol == 0 || y == 0.0) + return (0); + + /* Hard case: need to check the tolerance. */ + feholdexcept(&env); + ret = fabsl(x - y) <= fabsl(y * tol); + fesetenv(&env); + return (ret); +} + +static int +cfpequal(long double complex x, long double complex y, int checksign) +{ + return (fpequal(creal(x), creal(y), checksign & CS_REAL) + && fpequal(cimag(x), cimag(y), checksign & CS_IMAG)); +} + +static int +cfpequal_tol(long double complex x, long double complex y, long double tol) +{ + return (fpequal_tol(creal(x), creal(y), tol) + && fpequal_tol(cimag(x), cimag(y), tol)); +} + + +/* Tests for 0 */ +void +test_zero(void) +{ + long double complex zero = CMPLXL(0.0, 0.0); + + testall_tol(cacosh, zero, CMPLXL(0.0, pi / 2), 1); + testall_tol(cacosh, -zero, CMPLXL(0.0, -pi / 2), 1); + testall_tol(cacos, zero, CMPLXL(pi / 2, -0.0), 1); + testall_tol(cacos, -zero, CMPLXL(pi / 2, 0.0), 1); + + testall_odd(casinh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(casin, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + + testall_odd(catanh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(catan, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); +} + +/* + * Tests for NaN inputs. + */ +void +test_nan() +{ + long double complex nan_nan = CMPLXL(NAN, NAN); + long double complex z; + + /* + * IN CACOSH CACOS CASINH CATANH + * NaN,NaN NaN,NaN NaN,NaN NaN,NaN NaN,NaN + * finite,NaN NaN,NaN* NaN,NaN* NaN,NaN* NaN,NaN* + * NaN,finite NaN,NaN* NaN,NaN* NaN,NaN* NaN,NaN* + * NaN,Inf Inf,NaN NaN,-Inf ?Inf,NaN ?0,pi/2 + * +-Inf,NaN Inf,NaN NaN,?Inf +-Inf,NaN +-0,NaN + * +-0,NaN NaN,NaN* pi/2,NaN NaN,NaN* +-0,NaN + * NaN,0 NaN,NaN* NaN,NaN* NaN,0 NaN,NaN* + * + * * = raise invalid + */ + z = nan_nan; + testall(cacosh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(cacos, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(casinh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(casin, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(catanh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(catan, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + + z = CMPLXL(0.5, NAN); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, 0); + testall(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 0.5); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, 0); + testall(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, INFINITY); + testall(cacosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall(cacosh, -z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall(cacos, z, CMPLXL(NAN, -INFINITY), ALL_STD_EXCEPT, 0, CS_IMAG); + testall(casinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, 0); + testall(casin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_tol(catanh, z, CMPLXL(0.0, pi / 2), 1); + testall(catan, z, CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, CS_IMAG); + + z = CMPLXL(INFINITY, NAN); + testall_even(cacosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_even(cacos, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_odd(casinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_odd(casin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_odd(catanh, z, CMPLXL(0.0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0.0), 1); + + z = CMPLXL(0.0, NAN); + /* XXX We allow a spurious inexact exception here. */ + testall_even(cacosh, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + testall_even_tol(cacos, z, CMPLXL(pi / 2, NAN), 1); + testall_odd(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(casin, z, CMPLXL(0.0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(catanh, z, CMPLXL(0.0, NAN), OPT_INVALID, 0, CS_REAL); + testall_odd(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 0.0); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, CS_IMAG); + testall(catan, z, CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, 0); +} + +void +test_inf(void) +{ + long double complex z; + + /* + * IN CACOSH CACOS CASINH CATANH + * Inf,Inf Inf,pi/4 pi/4,-Inf Inf,pi/4 0,pi/2 + * -Inf,Inf Inf,3pi/4 3pi/4,-Inf --- --- + * Inf,finite Inf,0 0,-Inf Inf,0 0,pi/2 + * -Inf,finite Inf,pi pi,-Inf --- --- + * finite,Inf Inf,pi/2 pi/2,-Inf Inf,pi/2 0,pi/2 + */ + z = CMPLXL(INFINITY, INFINITY); + testall_tol(cacosh, z, CMPLXL(INFINITY, pi / 4), 1); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -c3pi / 4), 1); + testall_tol(cacos, z, CMPLXL(pi / 4, -INFINITY), 1); + testall_tol(cacos, -z, CMPLXL(c3pi / 4, INFINITY), 1); + testall_odd_tol(casinh, z, CMPLXL(INFINITY, pi / 4), 1); + testall_odd_tol(casin, z, CMPLXL(pi / 4, INFINITY), 1); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); + + z = CMPLXL(INFINITY, 0.5); + /* XXX We allow a spurious inexact exception here. */ + testall(cacosh, z, CMPLXL(INFINITY, 0), OPT_INEXACT, 0, CS_BOTH); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -pi), 1); + testall(cacos, z, CMPLXL(0, -INFINITY), OPT_INEXACT, 0, CS_BOTH); + testall_tol(cacos, -z, CMPLXL(pi, INFINITY), 1); + testall_odd(casinh, z, CMPLXL(INFINITY, 0), OPT_INEXACT, 0, CS_BOTH); + testall_odd_tol(casin, z, CMPLXL(pi / 2, INFINITY), 1); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); + + z = CMPLXL(0.5, INFINITY); + testall_tol(cacosh, z, CMPLXL(INFINITY, pi / 2), 1); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -pi / 2), 1); + testall_tol(cacos, z, CMPLXL(pi / 2, -INFINITY), 1); + testall_tol(cacos, -z, CMPLXL(pi / 2, INFINITY), 1); + testall_odd_tol(casinh, z, CMPLXL(INFINITY, pi / 2), 1); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(casin, z, CMPLXL(0.0, INFINITY), OPT_INEXACT, 0, CS_BOTH); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); +} + +/* Tests along the real and imaginary axes. */ +void +test_axes(void) +{ + static const long double nums[] = { + -2, -1, -0.5, 0.5, 1, 2 + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { + /* Real axis */ + z = CMPLXL(nums[i], 0.0); + if (fabs(nums[i]) <= 1) { + testall_tol(cacosh, z, CMPLXL(0.0, acos(nums[i])), 1); + testall_tol(cacos, z, CMPLXL(acosl(nums[i]), -0.0), 1); + testall_tol(casin, z, CMPLXL(asinl(nums[i]), 0.0), 1); + testall_tol(catanh, z, CMPLXL(atanh(nums[i]), 0.0), 1); + } else { + testall_tol(cacosh, z, + CMPLXL(acosh(fabs(nums[i])), + (nums[i] < 0) ? pi : 0), 1); + testall_tol(cacos, z, + CMPLXL((nums[i] < 0) ? pi : 0, + -acosh(fabs(nums[i]))), 1); + testall_tol(casin, z, + CMPLXL(copysign(pi / 2, nums[i]), + acosh(fabs(nums[i]))), 1); + testall_tol(catanh, z, + CMPLXL(atanh(1 / nums[i]), pi / 2), 1); + } + testall_tol(casinh, z, CMPLXL(asinh(nums[i]), 0.0), 1); + testall_tol(catan, z, CMPLXL(atan(nums[i]), 0), 1); + + /* TODO: Test the imaginary axis. */ + } +} + +void +test_small(void) +{ + /* + * z = 0.75 + i 0.25 + * acos(z) = Pi/4 - i ln(2)/2 + * asin(z) = Pi/4 + i ln(2)/2 + * atan(z) = atan(4)/2 + i ln(17/9)/4 + */ + static const struct { + complex long double z; + complex long double acos_z; + complex long double asin_z; + complex long double atan_z; + } tests[] = { + { CMPLXL(0.75L, 0.25L), + CMPLXL(pi / 4, -0.34657359027997265470861606072908828L), + CMPLXL(pi / 4, 0.34657359027997265470861606072908828L), + CMPLXL(0.66290883183401623252961960521423782L, + 0.15899719167999917436476103600701878L) }, + }; + int i; + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + testall_tol(cacos, tests[i].z, tests[i].acos_z, 2); + testall_odd_tol(casin, tests[i].z, tests[i].asin_z, 2); + testall_odd_tol(catan, tests[i].z, tests[i].atan_z, 2); + } +} + +/* Test inputs that might cause overflow in a sloppy implementation. */ +void +test_large(void) +{ + + /* TODO: Write these tests */ +} + +int +main(int argc, char *argv[]) +{ + + printf("1..6\n"); + + test_zero(); + printf("ok 1 - invctrig zero\n"); + + test_nan(); + printf("ok 2 - invctrig nan\n"); + + test_inf(); + printf("ok 3 - invctrig inf\n"); + + test_axes(); + printf("ok 4 - invctrig axes\n"); + + test_small(); + printf("ok 5 - invctrig small\n"); + + test_large(); + printf("ok 6 - invctrig large\n"); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Thu May 30 04:47:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0978EAF; Thu, 30 May 2013 04:47:03 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2664D4B; Thu, 30 May 2013 04:47:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4l3bp012188; Thu, 30 May 2013 04:47:03 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4l33c012187; Thu, 30 May 2013 04:47:03 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300447.r4U4l33c012187@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251120 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 04:47:03 -0000 Author: das Date: Thu May 30 04:47:03 2013 New Revision: 251120 URL: http://svnweb.freebsd.org/changeset/base/251120 Log: Fix some harmless bugs in a test. Modified: head/tools/regression/lib/msun/test-rem.c Modified: head/tools/regression/lib/msun/test-rem.c ============================================================================== --- head/tools/regression/lib/msun/test-rem.c Thu May 30 04:46:36 2013 (r251119) +++ head/tools/regression/lib/msun/test-rem.c Thu May 30 04:47:03 2013 (r251120) @@ -67,8 +67,8 @@ main(int argc, char *argv[]) test(4, 4, 0, 1); test(0, 3.0, 0, 0); - testd(0x1p-1074, 1, 0x1p-1074, 0x1p-1074); - testf(0x1p-149, 1, 0x1p-149, 0x1p-149); + testd(0x1p-1074, 1, 0x1p-1074, 0); + testf(0x1p-149, 1, 0x1p-149, 0); test(3.0, 4, -1, 1); test(3.0, -4, -1, -1); testd(275 * 1193040, 275, 0, 1193040); From owner-svn-src-all@FreeBSD.ORG Thu May 30 04:49:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 058CFFF; Thu, 30 May 2013 04:49:29 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB45DD65; Thu, 30 May 2013 04:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4nSGS012635; Thu, 30 May 2013 04:49:28 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4nRqM012625; Thu, 30 May 2013 04:49:27 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300449.r4U4nRqM012625@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251121 - in head: include lib/msun lib/msun/man lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 04:49:29 -0000 Author: das Date: Thu May 30 04:49:26 2013 New Revision: 251121 URL: http://svnweb.freebsd.org/changeset/base/251121 Log: I'm happy to finally commit stephen@'s implementations of cacos, cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde Added: head/lib/msun/man/cacos.3 (contents, props changed) head/lib/msun/src/catrig.c (contents, props changed) head/lib/msun/src/catrigf.c (contents, props changed) Modified: head/include/complex.h head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/ccos.3 head/lib/msun/man/ccosh.3 head/lib/msun/man/complex.3 Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Thu May 30 04:47:03 2013 (r251120) +++ head/include/complex.h Thu May 30 04:49:26 2013 (r251121) @@ -63,9 +63,21 @@ __BEGIN_DECLS double cabs(double complex); float cabsf(float complex); long double cabsl(long double complex); +double complex cacos(double complex); +float complex cacosf(float complex); +double complex cacosh(double complex); +float complex cacoshf(float complex); double carg(double complex); float cargf(float complex); long double cargl(long double complex); +double complex casin(double complex); +float complex casinf(float complex); +double complex casinh(double complex); +float complex casinhf(float complex); +double complex catan(double complex); +float complex catanf(float complex); +double complex catanh(double complex); +float complex catanhf(float complex); double complex ccos(double complex); float complex ccosf(float complex); double complex ccosh(double complex); Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/Makefile Thu May 30 04:49:26 2013 (r251121) @@ -105,7 +105,8 @@ COMMON_SRCS+= e_acosl.c e_asinl.c e_atan .endif # C99 complex functions -COMMON_SRCS+= s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ +COMMON_SRCS+= catrig.c catrigf.c \ + s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ s_cimag.c s_cimagf.c s_cimagl.c \ s_conj.c s_conjf.c s_conjl.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ @@ -126,7 +127,7 @@ SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ - ceil.3 ccos.3 ccosh.3 cexp.3 \ + ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 \ cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ @@ -144,6 +145,9 @@ MLINKS+=atan.3 atanf.3 atan.3 atanl.3 MLINKS+=atanh.3 atanhf.3 MLINKS+=atan2.3 atan2f.3 atan2.3 atan2l.3 \ atan2.3 carg.3 atan2.3 cargf.3 atan2.3 cargl.3 +MLINKS+=cacos.3 cacosf.3 cacos.3 cacosh.3 cacos.3 cacoshf.3 \ + cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinh.3 cacos.3 casinhf.3 \ + cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanh.3 cacos.3 catanhf.3 MLINKS+=ccos.3 ccosf.3 ccos.3 csin.3 ccos.3 csinf.3 ccos.3 ctan.3 ccos.3 ctanf.3 MLINKS+=ccosh.3 ccoshf.3 ccosh.3 csinh.3 ccosh.3 csinhf.3 \ ccosh.3 ctanh.3 ccosh.3 ctanhf.3 Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/Symbol.map Thu May 30 04:49:26 2013 (r251121) @@ -237,6 +237,18 @@ FBSD_1.3 { fegetround; fesetround; fesetenv; + cacos; + cacosf; + cacosh; + cacoshf; + casin; + casinf; + casinh; + casinhf; + catan; + catanf; + catanh; + catanhf; csin; csinf; csinh; Added: head/lib/msun/man/cacos.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/man/cacos.3 Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,128 @@ +.\" Copyright (c) 2013 David Schultz +.\" 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 May 27, 2013 +.Dt CACOS 3 +.Os +.Sh NAME +.Nm cacos , +.Nm cacosf , +.Nm cacosh , +.Nm cacoshf , +.Nm casin , +.Nm casinf +.Nm casinh , +.Nm casinhf +.Nm catan , +.Nm catanf +.Nm catanh , +.Nm catanhf +.Nd complex arc trigonometric and hyperbolic functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn cacos "double complex z" +.Ft float complex +.Fn cacosf "float complex z" +.Ft double complex +.Fn cacosh "double complex z" +.Ft float complex +.Fn cacoshf "float complex z" +.Ft double complex +.Fn casin "double complex z" +.Ft float complex +.Fn casinf "float complex z" +.Ft double complex +.Fn casinh "double complex z" +.Ft float complex +.Fn casinhf "float complex z" +.Ft double complex +.Fn catan "double complex z" +.Ft float complex +.Fn catanf "float complex z" +.Ft double complex +.Fn catanh "double complex z" +.Ft float complex +.Fn catanhf "float complex z" +.Sh DESCRIPTION +The +.Fn cacos , +.Fn casin , +and +.Fn catan +functions compute the principal value of the inverse cosine, sine, +and tangent of the complex number +.Fa z , +respectively. +The +.Fn cacosh , +.Fn casinh , +and +.Fn catanh +functions compute the principal value of the inverse hyperbolic +cosine, sine, and tangent. +The +.Fn cacosf , +.Fn casinf , +.Fn catanf +.Fn cacoshf , +.Fn casinhf , +and +.Fn catanhf +functions perform the same operations in +.Fa float +precision. +.Pp +.ie '\*[.T]'utf8' +. ds Un \[cu] +.el +. ds Un U +. +There is no universal convention for defining the principal values of +these functions. The following table gives the branch cuts, and the +corresponding ranges for the return values, adopted by the C language. +.Bl -column ".Sy Function" ".Sy (-\*(If*I, -I) \*(Un (I, \*(If*I)" ".Sy [-\*(Pi/2*I, \*(Pi/2*I]" +.It Sy Function Ta Sy Branch Cut(s) Ta Sy Range +.It cacos Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [0, \*(Pi] +.It casin Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2, \*(Pi/2] +.It catan Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2, \*(Pi/2] +.It cacosh Ta (-\*(If, 1) Ta [-\*(Pi*I, \*(Pi*I] +.It casinh Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2*I, \*(Pi/2*I] +.It catanh Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2*I, \*(Pi/2*I] +.El +.Sh SEE ALSO +.Xr ccos 3 , +.Xr ccosh 3 , +.Xr complex 3 , +.Xr cos 3 , +.Xr math 3 , +.Xr sin 3 , +.Xr tan 3 +.Sh STANDARDS +These functions conform to +.St -isoC-99 . Modified: head/lib/msun/man/ccos.3 ============================================================================== --- head/lib/msun/man/ccos.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/ccos.3 Thu May 30 04:49:26 2013 (r251121) @@ -69,6 +69,7 @@ functions perform the same operations in .Fa float precision. .Sh SEE ALSO +.Xr cacos 3 , .Xr ccosh 3 , .Xr complex 3 , .Xr cos 3 , Modified: head/lib/msun/man/ccosh.3 ============================================================================== --- head/lib/msun/man/ccosh.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/ccosh.3 Thu May 30 04:49:26 2013 (r251121) @@ -69,6 +69,7 @@ functions perform the same operations in .Fa float precision. .Sh SEE ALSO +.Xr cacosh 3 , .Xr ccos 3 , .Xr complex 3 , .Xr cosh 3 , Modified: head/lib/msun/man/complex.3 ============================================================================== --- head/lib/msun/man/complex.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/complex.3 Thu May 30 04:49:26 2013 (r251121) @@ -89,6 +89,12 @@ creal compute the real part .\" Section 7.3.5-6 of ISO C99 standard .Ss Trigonometric and Hyperbolic Functions .Cl +cacos arc cosine +cacosh arc hyperbolic cosine +casin arc sine +casinh arc hyperbolic sine +catan arc tangent +catanh arc hyperbolic tangent ccos cosine ccosh hyperbolic cosine csin sine @@ -111,20 +117,8 @@ The functions described here conform to .St -isoC-99 . .Sh BUGS -The inverse trigonometric and hyperbolic functions -.Fn cacos , -.Fn cacosh , -.Fn casin , -.Fn casinh , -.Fn catan , -and -.Fn catanh -are not implemented. -.Pp The logarithmic functions .Fn clog -are not implemented. -.Pp -The power functions +and the power functions .Fn cpow are not implemented. Added: head/lib/msun/src/catrig.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/catrig.c Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,643 @@ +/*- + * Copyright (c) 2012 Stephen Montgomery-Smith + * 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 "math.h" +#include "math_private.h" + +#undef isinf +#define isinf(x) (fabs(x) == INFINITY) +#undef isnan +#define isnan(x) ((x) != (x)) +#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0) +#undef signbit +#define signbit(x) (__builtin_signbit(x)) + +/* We need that DBL_EPSILON^2/128 is larger than FOUR_SQRT_MIN. */ +static const double +A_crossover = 10, /* Hull et al suggest 1.5, but 10 works better */ +B_crossover = 0.6417, /* suggested by Hull et al */ +FOUR_SQRT_MIN = 0x1p-509, /* >= 4 * sqrt(DBL_MIN) */ +QUARTER_SQRT_MAX = 0x1p509, /* <= sqrt(DBL_MAX) / 4 */ +m_e = 2.7182818284590452e0, /* 0x15bf0a8b145769.0p-51 */ +m_ln2 = 6.9314718055994531e-1, /* 0x162e42fefa39ef.0p-53 */ +pio2_hi = 1.5707963267948966e0, /* 0x1921fb54442d18.0p-52 */ +RECIP_EPSILON = 1 / DBL_EPSILON, +SQRT_3_EPSILON = 2.5809568279517849e-8, /* 0x1bb67ae8584caa.0p-78 */ +SQRT_6_EPSILON = 3.6500241499888571e-8, /* 0x13988e1409212e.0p-77 */ +SQRT_MIN = 0x1p-511; /* >= sqrt(DBL_MIN) */ + +static const volatile double +pio2_lo = 6.1232339957367659e-17; /* 0x11a62633145c07.0p-106 */ +static const volatile float +tiny = 0x1p-100; + +static double complex clog_for_large_values(double complex z); + +/* + * Testing indicates that all these functions are accurate up to 4 ULP. + * The functions casin(h) and cacos(h) are about 2.5 times slower than asinh. + * The functions catan(h) are a little under 2 times slower than atanh. + * + * The code for casinh, casin, cacos, and cacosh comes first. The code is + * rather complicated, and the four functions are highly interdependent. + * + * The code for catanh and catan comes at the end. It is much simpler than + * the other functions, and the code for these can be disconnected from the + * rest of the code. + */ + +/* + * ================================ + * | casinh, casin, cacos, cacosh | + * ================================ + */ + +/* + * The algorithm is very close to that in "Implementing the complex arcsine + * and arccosine functions using exception handling" by T. E. Hull, Thomas F. + * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on + * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335, + * http://dl.acm.org/citation.cfm?id=275324. + * + * Throughout we use the convention z = x + I*y. + * + * casinh(z) = sign(x)*log(A+sqrt(A*A-1)) + I*asin(B) + * where + * A = (|z+I| + |z-I|) / 2 + * B = (|z+I| - |z-I|) / 2 = y/A + * + * These formulas become numerically unstable: + * (a) for Re(casinh(z)) when z is close to the line segment [-I, I] (that + * is, Re(casinh(z)) is close to 0); + * (b) for Im(casinh(z)) when z is close to either of the intervals + * [I, I*infinity) or (-I*infinity, -I] (that is, |Im(casinh(z))| is + * close to PI/2). + * + * These numerical problems are overcome by defining + * f(a, b) = (hypot(a, b) - b) / 2 = a*a / (hypot(a, b) + b) / 2 + * Then if A < A_crossover, we use + * log(A + sqrt(A*A-1)) = log1p((A-1) + sqrt((A-1)*(A+1))) + * A-1 = f(x, 1+y) + f(x, 1-y) + * and if B > B_crossover, we use + * asin(B) = atan2(y, sqrt(A*A - y*y)) = atan2(y, sqrt((A+y)*(A-y))) + * A-y = f(x, y+1) + f(x, y-1) + * where without loss of generality we have assumed that x and y are + * non-negative. + * + * Much of the difficulty comes because the intermediate computations may + * produce overflows or underflows. This is dealt with in the paper by Hull + * et al by using exception handling. We do this by detecting when + * computations risk underflow or overflow. The hardest part is handling the + * underflows when computing f(a, b). + * + * Note that the function f(a, b) does not appear explicitly in the paper by + * Hull et al, but the idea may be found on pages 308 and 309. Introducing the + * function f(a, b) allows us to concentrate many of the clever tricks in this + * paper into one function. + */ + +/* + * Function f(a, b, hypot_a_b) = (hypot(a, b) - b) / 2. + * Pass hypot(a, b) as the third argument. + */ +static inline double +f(double a, double b, double hypot_a_b) +{ + if (b < 0) + return ((hypot_a_b - b) / 2); + if (b == 0) + return (a / 2); + return (a * a / (hypot_a_b + b) / 2); +} + +/* + * All the hard work is contained in this function. + * x and y are assumed positive or zero, and less than RECIP_EPSILON. + * Upon return: + * rx = Re(casinh(z)) = -Im(cacos(y + I*x)). + * B_is_usable is set to 1 if the value of B is usable. + * If B_is_usable is set to 0, sqrt_A2my2 = sqrt(A*A - y*y), and new_y = y. + * If returning sqrt_A2my2 has potential to result in an underflow, it is + * rescaled, and new_y is similarly rescaled. + */ +static inline void +do_hard_work(double x, double y, double *rx, int *B_is_usable, double *B, + double *sqrt_A2my2, double *new_y) +{ + double R, S, A; /* A, B, R, and S are as in Hull et al. */ + double Am1, Amy; /* A-1, A-y. */ + + R = hypot(x, y + 1); /* |z+I| */ + S = hypot(x, y - 1); /* |z-I| */ + + /* A = (|z+I| + |z-I|) / 2 */ + A = (R + S) / 2; + /* + * Mathematically A >= 1. There is a small chance that this will not + * be so because of rounding errors. So we will make certain it is + * so. + */ + if (A < 1) + A = 1; + + if (A < A_crossover) { + /* + * Am1 = fp + fm, where fp = f(x, 1+y), and fm = f(x, 1-y). + * rx = log1p(Am1 + sqrt(Am1*(A+1))) + */ + if (y == 1 && x < DBL_EPSILON*DBL_EPSILON / 128) { + /* + * fp is of order x^2, and fm = x/2. + * A = 1 (inexactly). + */ + *rx = sqrt(x); + } else if (x >= DBL_EPSILON * fabs(y - 1)) { + /* + * Underflow will not occur because + * x >= DBL_EPSILON^2/128 >= FOUR_SQRT_MIN + */ + Am1 = f(x, 1 + y, R) + f(x, 1 - y, S); + *rx = log1p(Am1 + sqrt(Am1 * (A + 1))); + } else if (y < 1) { + /* + * fp = x*x/(1+y)/4, fm = x*x/(1-y)/4, and + * A = 1 (inexactly). + */ + *rx = x / sqrt((1 - y) * (1 + y)); + } else /* if (y > 1) */ { + /* + * A-1 = y-1 (inexactly). + */ + *rx = log1p((y - 1) + sqrt((y - 1) * (y + 1))); + } + } else { + *rx = log(A + sqrt(A * A - 1)); + } + + *new_y = y; + + if (y < FOUR_SQRT_MIN) { + /* + * Avoid a possible underflow caused by y/A. For casinh this + * would be legitimate, but will be picked up by invoking atan2 + * later on. For cacos this would not be legitimate. + */ + *B_is_usable = 0; + *sqrt_A2my2 = A * (2 / DBL_EPSILON); + *new_y = y * (2 / DBL_EPSILON); + return; + } + + /* B = (|z+I| - |z-I|) / 2 = y/A */ + *B = y / A; + *B_is_usable = 1; + + if (*B > B_crossover) { + *B_is_usable = 0; + /* + * Amy = fp + fm, where fp = f(x, y+1), and fm = f(x, y-1). + * sqrt_A2my2 = sqrt(Amy*(A+y)) + */ + if (y == 1 && x < DBL_EPSILON / 128) { + /* + * fp is of order x^2, and fm = x/2. + * A = 1 (inexactly). + */ + *sqrt_A2my2 = sqrt(x) * sqrt((A + y) / 2); + } else if (x >= DBL_EPSILON * fabs(y - 1)) { + /* + * Underflow will not occur because + * x >= DBL_EPSILON/128 >= FOUR_SQRT_MIN + * and + * x >= DBL_EPSILON^2 >= FOUR_SQRT_MIN + */ + Amy = f(x, y + 1, R) + f(x, y - 1, S); + *sqrt_A2my2 = sqrt(Amy * (A + y)); + } else if (y > 1) { + /* + * fp = x*x/(y+1)/4, fm = x*x/(y-1)/4, and + * A = y (inexactly). + * + * y < RECIP_EPSILON. So the following + * scaling should avoid any underflow problems. + */ + *sqrt_A2my2 = x * (4 / DBL_EPSILON / DBL_EPSILON) * y / + sqrt((y + 1) * (y - 1)); + *new_y = y * (4 / DBL_EPSILON / DBL_EPSILON); + } else /* if (y < 1) */ { + /* + * fm = 1-y >= DBL_EPSILON, fp is of order x^2, and + * A = 1 (inexactly). + */ + *sqrt_A2my2 = sqrt((1 - y) * (1 + y)); + } + } +} + +/* + * casinh(z) = z + O(z^3) as z -> 0 + * + * casinh(z) = sign(x)*clog(sign(x)*z) + O(1/z^2) as z -> infinity + * The above formula works for the imaginary part as well, because + * Im(casinh(z)) = sign(x)*atan2(sign(x)*y, fabs(x)) + O(y/z^3) + * as z -> infinity, uniformly in y + */ +double complex +casinh(double complex z) +{ + double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y; + int B_is_usable; + double complex w; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + + if (isnan(x) || isnan(y)) { + /* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */ + if (isinf(x)) + return (cpack(x, y + y)); + /* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */ + if (isinf(y)) + return (cpack(y, x + x)); + /* casinh(NaN + I*0) = NaN + I*0 */ + if (y == 0) + return (cpack(x + x, y)); + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + /* Bruce Evans tells me this is the way to do this: */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + /* clog...() will raise inexact unless x or y is infinite. */ + if (signbit(x) == 0) + w = clog_for_large_values(z) + m_ln2; + else + w = clog_for_large_values(-z) + m_ln2; + return (cpack(copysign(creal(w), x), copysign(cimag(w), y))); + } + + /* Avoid spuriously raising inexact for z = 0. */ + if (x == 0 && y == 0) + return (z); + + /* All remaining cases are inexact. */ + raise_inexact(); + + if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4) + return (z); + + do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y); + if (B_is_usable) + ry = asin(B); + else + ry = atan2(new_y, sqrt_A2my2); + return (cpack(copysign(rx, x), copysign(ry, y))); +} + +/* + * casin(z) = reverse(casinh(reverse(z))) + * where reverse(x + I*y) = y + I*x = I*conj(z). + */ +double complex +casin(double complex z) +{ + double complex w = casinh(cpack(cimag(z), creal(z))); + return (cpack(cimag(w), creal(w))); +} + +/* + * cacos(z) = PI/2 - casin(z) + * but do the computation carefully so cacos(z) is accurate when z is + * close to 1. + * + * cacos(z) = PI/2 - z + O(z^3) as z -> 0 + * + * cacos(z) = -sign(y)*I*clog(z) + O(1/z^2) as z -> infinity + * The above formula works for the real part as well, because + * Re(cacos(z)) = atan2(fabs(y), x) + O(y/z^3) + * as z -> infinity, uniformly in y + */ +double complex +cacos(double complex z) +{ + double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x; + int sx, sy; + int B_is_usable; + double complex w; + + x = creal(z); + y = cimag(z); + sx = signbit(x); + sy = signbit(y); + ax = fabs(x); + ay = fabs(y); + + if (isnan(x) || isnan(y)) { + /* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */ + if (isinf(x)) + return (cpack(y + y, -INFINITY)); + /* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */ + if (isinf(y)) + return (cpack(x + x, -y)); + /* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */ + if (x == 0) + return (cpack(pio2_hi + pio2_lo, y + y)); + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + /* clog...() will raise inexact unless x or y is infinite. */ + w = clog_for_large_values(z); + rx = fabs(cimag(w)); + ry = creal(w) + m_ln2; + if (sy == 0) + ry = -ry; + return (cpack(rx, ry)); + } + + /* Avoid spuriously raising inexact for z = 1. */ + if (x == 1 && y == 0) + return (cpack(0, -y)); + + /* All remaining cases are inexact. */ + raise_inexact(); + + if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON/4) + return (cpack(pio2_hi - (x - pio2_lo), -y)); + + do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x); + if (B_is_usable) { + if (sx==0) + rx = acos(B); + else + rx = acos(-B); + } else { + if (sx==0) + rx = atan2(sqrt_A2mx2, new_x); + else + rx = atan2(sqrt_A2mx2, -new_x); + } + if (sy == 0) + ry = -ry; + return (cpack(rx, ry)); +} + +/* + * cacosh(z) = I*cacos(z) or -I*cacos(z) + * where the sign is chosen so Re(cacosh(z)) >= 0. + */ +double complex +cacosh(double complex z) +{ + double complex w; + double rx, ry; + + w = cacos(z); + rx = creal(w); + ry = cimag(w); + /* cacosh(NaN + I*NaN) = NaN + I*NaN */ + if (isnan(rx) && isnan(ry)) + return (cpack(ry, rx)); + /* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */ + /* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */ + if (isnan(rx)) + return (cpack(fabs(ry), rx)); + /* cacosh(0 + I*NaN) = NaN + I*NaN */ + if (isnan(ry)) + return (cpack(ry, ry)); + return (cpack(fabs(ry), copysign(rx, cimag(z)))); +} + +/* + * Optimized version of clog() for |z| finite and larger than ~RECIP_EPSILON. + */ +static double complex +clog_for_large_values(double complex z) +{ + double x, y; + double ax, ay, t; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + /* + * Avoid overflow in hypot() when x and y are both very large. + * Divide x and y by E, and then add 1 to the logarithm. This depends + * on E being larger than sqrt(2). + * Dividing by E causes an insignificant loss of accuracy; however + * this method is still poor since it is uneccessarily slow. + */ + if (ax > DBL_MAX / 2) + return (cpack(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x))); + + /* + * Avoid overflow when x or y is large. Avoid underflow when x or + * y is small. + */ + if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN) + return (cpack(log(hypot(x, y)), atan2(y, x))); + + return (cpack(log(ax * ax + ay * ay) / 2, atan2(y, x))); +} + +/* + *============================================================================= + */ + +/* + * ================= + * | catanh, catan | + * ================= + */ + +/* + * sum_squares(x,y) = x*x + y*y (or just x*x if y*y would underflow). + * Assumes x*x and y*y will not overflow. + * Assumes x and y are finite. + * Assumes y is non-negative. + * Assumes fabs(x) >= DBL_EPSILON. + */ +static inline double +sum_squares(double x, double y) +{ + + /* Avoid underflow when y is small. */ + if (y < SQRT_MIN) + return (x * x); + return (x * x + y * y); +} + +/* + * real_part_reciprocal(x, y) = Re(1/(x+I*y)) = x/(x*x + y*y). + * Assumes x and y are not NaN, and one of x and y is larger than + * RECIP_EPSILON. We avoid unwarranted underflow. It is important to not use + * the code creal(1/z), because the imaginary part may produce an unwanted + * underflow. + * This is only called in a context where inexact is always raised before + * the call, so no effort is made to avoid or force inexact. + */ +static inline double +real_part_reciprocal(double x, double y) +{ + double scale; + uint32_t hx, hy; + int32_t ix, iy; + + /* + * This code is inspired by the C99 document n1124.pdf, Section G.5.1, + * example 2. + */ + GET_HIGH_WORD(hx, x); + ix = hx & 0x7ff00000; + GET_HIGH_WORD(hy, y); + iy = hy & 0x7ff00000; +#define BIAS (DBL_MAX_EXP - 1) +/* XXX more guard digits are useful iff there is extra precision. */ +#define CUTOFF (DBL_MANT_DIG / 2 + 1) /* just half or 1 guard digit */ + if (ix - iy >= CUTOFF << 20 || isinf(x)) + return (1 / x); /* +-Inf -> +-0 is special */ + if (iy - ix >= CUTOFF << 20) + return (x / y / y); /* should avoid double div, but hard */ + if (ix <= (BIAS + DBL_MAX_EXP / 2 - CUTOFF) << 20) + return (x / (x * x + y * y)); + scale = 1; + SET_HIGH_WORD(scale, 0x7ff00000 - ix); /* 2**(1-ilogb(x)) */ + x *= scale; + y *= scale; + return (x / (x * x + y * y) * scale); +} + +/* + * catanh(z) = log((1+z)/(1-z)) / 2 + * = log1p(4*x / |z-1|^2) / 4 + * + I * atan2(2*y, (1-x)*(1+x)-y*y) / 2 + * + * catanh(z) = z + O(z^3) as z -> 0 + * + * catanh(z) = 1/z + sign(y)*I*PI/2 + O(1/z^3) as z -> infinity + * The above formula works for the real part as well, because + * Re(catanh(z)) = x/|z|^2 + O(x/z^4) + * as z -> infinity, uniformly in x + */ +double complex +catanh(double complex z) +{ + double x, y, ax, ay, rx, ry; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + + /* This helps handle many cases. */ + if (y == 0 && ax <= 1) + return (cpack(atanh(x), y)); + + /* To ensure the same accuracy as atan(), and to filter out z = 0. */ + if (x == 0) + return (cpack(x, atan(y))); + + if (isnan(x) || isnan(y)) { + /* catanh(+-Inf + I*NaN) = +-0 + I*NaN */ + if (isinf(x)) + return (cpack(copysign(0, x), y + y)); + /* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */ + if (isinf(y)) { + return (cpack(copysign(0, x), + copysign(pio2_hi + pio2_lo, y))); + } + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + return (cpack(real_part_reciprocal(x, y), + copysign(pio2_hi + pio2_lo, y))); + } + + if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { + /* + * z = 0 was filtered out above. All other cases must raise + * inexact, but this is the only only that needs to do it + * explicitly. + */ + raise_inexact(); + return (z); + } + + if (ax == 1 && ay < DBL_EPSILON) + rx = (log(ay) - m_ln2) / -2; + else + rx = log1p(4 * ax / sum_squares(ax - 1, ay)) / 4; + + if (ax == 1) + ry = atan2(2, -ay) / 2; + else if (ay < DBL_EPSILON) + ry = atan2(2 * ay, (1 - ax) * (1 + ax)) / 2; + else + ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; + + return (cpack(copysign(rx, x), copysign(ry, y))); +} + +/* + * catan(z) = reverse(catanh(reverse(z))) + * where reverse(x + I*y) = y + I*x = I*conj(z). + */ +double complex +catan(double complex z) +{ + double complex w = catanh(cpack(cimag(z), creal(z))); + return (cpack(cimag(w), creal(w))); +} Added: head/lib/msun/src/catrigf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/catrigf.c Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,388 @@ +/*- + * Copyright (c) 2012 Stephen Montgomery-Smith + * 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. + */ + +/* + * The algorithm is very close to that in "Implementing the complex arcsine + * and arccosine functions using exception handling" by T. E. Hull, Thomas F. + * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on + * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335, + * http://dl.acm.org/citation.cfm?id=275324. + * + * The code for catrig.c contains complete comments. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "math.h" +#include "math_private.h" + +#undef isinf +#define isinf(x) (fabsf(x) == INFINITY) +#undef isnan +#define isnan(x) ((x) != (x)) +#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0) +#undef signbit +#define signbit(x) (__builtin_signbitf(x)) + +static const float +A_crossover = 10, +B_crossover = 0.6417, +FOUR_SQRT_MIN = 0x1p-61, +QUARTER_SQRT_MAX = 0x1p61, +m_e = 2.7182818285e0, /* 0xadf854.0p-22 */ +m_ln2 = 6.9314718056e-1, /* 0xb17218.0p-24 */ +pio2_hi = 1.5707962513e0, /* 0xc90fda.0p-23 */ +RECIP_EPSILON = 1 / FLT_EPSILON, +SQRT_3_EPSILON = 5.9801995673e-4, /* 0x9cc471.0p-34 */ +SQRT_6_EPSILON = 8.4572793338e-4, /* 0xddb3d7.0p-34 */ +SQRT_MIN = 0x1p-63; + +static const volatile float +pio2_lo = 7.5497899549e-8, /* 0xa22169.0p-47 */ +tiny = 0x1p-100; + +static float complex clog_for_large_values(float complex z); + +static inline float +f(float a, float b, float hypot_a_b) +{ + if (b < 0) + return ((hypot_a_b - b) / 2); + if (b == 0) + return (a / 2); + return (a * a / (hypot_a_b + b) / 2); +} + +static inline void +do_hard_work(float x, float y, float *rx, int *B_is_usable, float *B, + float *sqrt_A2my2, float *new_y) +{ + float R, S, A; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 05:27:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6343CB37; Thu, 30 May 2013 05:27:37 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF9BF67; Thu, 30 May 2013 05:27:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U5RbiP026256; Thu, 30 May 2013 05:27:37 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U5RbKO026255; Thu, 30 May 2013 05:27:37 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300527.r4U5RbKO026255@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 05:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r251122 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 05:27:37 -0000 Author: das Date: Thu May 30 05:27:36 2013 New Revision: 251122 URL: http://svnweb.freebsd.org/changeset/base/251122 Log: After many high-quality commits, release kargl@ from captivity. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu May 30 04:49:26 2013 (r251121) +++ svnadmin/conf/mentors Thu May 30 05:27:36 2013 (r251122) @@ -26,7 +26,6 @@ jceel wkoszek Co-mentor: cognet jinmei gnn jonathan rwatson jwd rmacklem -kargl das miwi rwatson monthadar adrian nork imp From owner-svn-src-all@FreeBSD.ORG Thu May 30 05:34:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B01BCFD; Thu, 30 May 2013 05:34:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 039F9F9B; Thu, 30 May 2013 05:34:29 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id EF480CA0; Thu, 30 May 2013 07:30:14 +0200 (CEST) Date: Thu, 30 May 2013 07:34:28 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130530053427.GA1384@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> <20130529125052.GA1383@garage.freebsd.pl> <867gih4ymu.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <867gih4ymu.fsf@nine.des.no> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 05:34:30 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 05:03:05PM +0200, Dag-Erling Sm=F8rgrav wrote: > Pawel Jakub Dawidek writes: > > AES-NI doesn't have to go through kernel at all and doing so is much > > slower. Not sure if our OpenSSL version already has native AES-NI > > support. If not it would be best to upgrade it. This would fix AES-NI > > at least. Other crypto HW that do need kernel driver would still need > > something here. I wonder if CRIOGET can't be done before setting rlimit. >=20 > The CRIOGET ioctl call happens deep inside OpenSSL. There may be a way > to pre-initialize the AES engine, but the unprivileged child doesn't > know which engine to use until after it's sandboxed. BTW. At least OpenSSL in HEAD already supports AES-NI natively. > > How does it work on OpenBSD then? >=20 > IIUC, they have sandboxing facilities in the base system and use those > instead of the extremely rudimentary rlimit-based implementation that we > use. They use systrace and from what I see they don't allow ioctl(2) in systrace policy. No idea then how they talk to the kernel crypto framework. > > > > Also what is the exact difference between "sandbox" and "yes" setti= ngs? > > > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case me= ans > > > a bunch of rlimit settings. > > I thought that simple "yes" setting does chroot to /var/empty, drops > > privileges to sshd user/group and sets rlimit? I'm trying to figure out > > the difference between those two settings. >=20 > In our case, the only difference is that "sandbox" uses setrlimit() to > prevent the unprivileged child from forking, opening files or appending > to open files. I see. > > > > The reason I ask is because I plan to experiment with OpenSSH > > > > sandboxing to use Capsicum and Casper. > > > You still have the patches I sent you? > > Probably somewhere in my INBOX. If you have them handy can you please > > resend them? >=20 > Attached. Thanks! If we want to protect against compromised child allocating too much resources, we could still leave rlimit to deny fork(2) and creating new descriptors. In capability sandbox one can still allocate descriptors using dup(2), socket(2), socketpair(2), etc. Capability mode doesn't protect against DoS. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGm5OMACgkQForvXbEpPzREIgCgjiwogJwqrrfB0B647PGTZYGF y9sAoLvBYaFaB+i6A62dYcvYA8XH+YGV =HMMI -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:20:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01F6F5A5; Thu, 30 May 2013 06:20:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E9898181; Thu, 30 May 2013 06:20:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6KNkv044180; Thu, 30 May 2013 06:20:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6KNwP044178; Thu, 30 May 2013 06:20:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305300620.r4U6KNwP044178@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 May 2013 06:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251123 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:20:24 -0000 Author: ed Date: Thu May 30 06:20:23 2013 New Revision: 251123 URL: http://svnweb.freebsd.org/changeset/base/251123 Log: Use #ifdef instead of #if defined. This makes these tests a bit more consistent with the tests done at the bottom of the file. Modified: head/lib/libcompiler_rt/__sync_fetch_and_op_n.h head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Modified: head/lib/libcompiler_rt/__sync_fetch_and_op_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Thu May 30 05:27:36 2013 (r251122) +++ head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Thu May 30 06:20:23 2013 (r251123) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined __clang__ +#ifdef __clang__ static TYPE atomic_func(volatile TYPE *ptr, TYPE value, ...) #else Modified: head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Thu May 30 05:27:36 2013 (r251122) +++ head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Thu May 30 06:20:23 2013 (r251123) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined __clang__ +#ifdef __clang__ static TYPE atomic_func(volatile TYPE *ptr, TYPE oldval, TYPE newval, ...) #else From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:20:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FB067D0; Thu, 30 May 2013 06:20:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A98C18E; Thu, 30 May 2013 06:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6KouE045699; Thu, 30 May 2013 06:20:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6Ko74045697; Thu, 30 May 2013 06:20:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305300620.r4U6Ko74045697@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 May 2013 06:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251124 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:20:51 -0000 Author: ed Date: Thu May 30 06:20:50 2013 New Revision: 251124 URL: http://svnweb.freebsd.org/changeset/base/251124 Log: Add __sync_synchronize(). This function can easily be implemented on top of the mb() macro provided by . Added: head/lib/libcompiler_rt/__sync_synchronize.c (contents, props changed) Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Thu May 30 06:20:23 2013 (r251123) +++ head/lib/libcompiler_rt/Makefile Thu May 30 06:20:50 2013 (r251124) @@ -164,6 +164,7 @@ SRCF+= __sync_fetch_and_add_4 \ __sync_fetch_and_sub_4 \ __sync_fetch_and_xor_4 \ __sync_lock_test_and_set_4 \ + __sync_synchronize \ __sync_val_compare_and_swap_4 .endif .if ${MACHINE_ARCH:Mmips64*} != "" Added: head/lib/libcompiler_rt/__sync_synchronize.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcompiler_rt/__sync_synchronize.c Thu May 30 06:20:50 2013 (r251124) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __clang__ +static void +atomic_func(void) +#else +void +__sync_synchronize(void) +#endif +{ + + mb(); +} + +#ifdef __clang__ +__strong_reference(atomic_func, __sync_synchronize); +#endif From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:41:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F9D2B16; Thu, 30 May 2013 06:41:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F85E241; Thu, 30 May 2013 06:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6fSrM052661; Thu, 30 May 2013 06:41:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6fQjs052648; Thu, 30 May 2013 06:41:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300641.r4U6fQjs052648@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 06:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251125 - in vendor/libpcap/dist: . pcap X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:41:28 -0000 Author: delphij Date: Thu May 30 06:41:26 2013 New Revision: 251125 URL: http://svnweb.freebsd.org/changeset/base/251125 Log: Vendor import of libpcap 1.4.0. Modified: vendor/libpcap/dist/CHANGES vendor/libpcap/dist/CREDITS vendor/libpcap/dist/README vendor/libpcap/dist/README.aix vendor/libpcap/dist/README.dag vendor/libpcap/dist/VERSION vendor/libpcap/dist/aclocal.m4 vendor/libpcap/dist/bpf_image.c vendor/libpcap/dist/config.h.in vendor/libpcap/dist/configure vendor/libpcap/dist/configure.in vendor/libpcap/dist/fad-getad.c vendor/libpcap/dist/fad-gifc.c vendor/libpcap/dist/fad-glifc.c vendor/libpcap/dist/fad-sita.c vendor/libpcap/dist/gencode.c vendor/libpcap/dist/grammar.y vendor/libpcap/dist/nametoaddr.c vendor/libpcap/dist/optimize.c vendor/libpcap/dist/pcap-bpf.c vendor/libpcap/dist/pcap-bt-linux.c vendor/libpcap/dist/pcap-bt-linux.h vendor/libpcap/dist/pcap-can-linux.c vendor/libpcap/dist/pcap-can-linux.h vendor/libpcap/dist/pcap-canusb-linux.c vendor/libpcap/dist/pcap-canusb-linux.h vendor/libpcap/dist/pcap-common.c vendor/libpcap/dist/pcap-dag.c vendor/libpcap/dist/pcap-dag.h vendor/libpcap/dist/pcap-dlpi.c vendor/libpcap/dist/pcap-filter.manmisc.in vendor/libpcap/dist/pcap-int.h vendor/libpcap/dist/pcap-libdlpi.c vendor/libpcap/dist/pcap-linux.c vendor/libpcap/dist/pcap-netfilter-linux.c vendor/libpcap/dist/pcap-netfilter-linux.h vendor/libpcap/dist/pcap-nit.c vendor/libpcap/dist/pcap-null.c vendor/libpcap/dist/pcap-pf.c vendor/libpcap/dist/pcap-septel.c vendor/libpcap/dist/pcap-septel.h vendor/libpcap/dist/pcap-sita.c vendor/libpcap/dist/pcap-snf.c vendor/libpcap/dist/pcap-snf.h vendor/libpcap/dist/pcap-snit.c vendor/libpcap/dist/pcap-snoop.c vendor/libpcap/dist/pcap-usb-linux.c vendor/libpcap/dist/pcap-usb-linux.h vendor/libpcap/dist/pcap-win32.c vendor/libpcap/dist/pcap.c vendor/libpcap/dist/pcap/bpf.h vendor/libpcap/dist/pcap/pcap.h vendor/libpcap/dist/pcap_breakloop.3pcap vendor/libpcap/dist/pcap_loop.3pcap vendor/libpcap/dist/pcap_offline_filter.3pcap vendor/libpcap/dist/scanner.l Modified: vendor/libpcap/dist/CHANGES ============================================================================== --- vendor/libpcap/dist/CHANGES Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/CHANGES Thu May 30 06:41:26 2013 (r251125) @@ -1,3 +1,35 @@ +Monday March 18, 2013 guy@alum.mit.edu +Summary for 1.4.0 libpcap release + Add netfilter/nfqueue interface. + If we don't have support for IPv6 address resolution, support, + in filter expressions, what IPv6 stuff we can. + Checks added for malloc()/realloc()/etc. failures. + Fix pcap-config to include -lpthread if canusb support is + present + Try to fix "pcap_parse not defined" problems when --without-flex + and --without-bison are used when you have Flex and Bison + Fix some issues with the pcap_loop man page. + Fix pcap_getnonblock() and pcap_setnonblock() to fill in the + supplied error message buffer + Fix typo that, it appeared, would cause pcap-libdlpi.c not to + compile (perhaps systems with libdlpi also have BPF and use + that instead) + Catch attempts to call pcap_compile() on a non-activated pcap_t + Fix crash on Linux with CAN-USB support without usbfs + Fix addition of VLAN tags for Linux cooked captures + Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl, so + that the driver can report either one if it doesn't support + SIOCETHTOOL + Add DLT_INFINIBAND and DLT_SCTP + Describe "proto XXX" and "protochain XXX" in the pcap-filter man + page + Handle either directories, or symlinks to directories, that + correspond to interfaces in /sys/class/net + Fix handling of VLAN tag insertion to check, on Linux 3.x + kernels, for VLAN tag valid flag + Clean up some man pages + Support libnl3 as well as libnl1 and libnl2 on Linux + Friday March 30, 2012. mcr@sandelman.ca Summary for 1.3.0 libpcap release Handle DLT_PFSYNC in {FreeBSD, other *BSD+Mac OS X, other}. Modified: vendor/libpcap/dist/CREDITS ============================================================================== --- vendor/libpcap/dist/CREDITS Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/CREDITS Thu May 30 06:41:26 2013 (r251125) @@ -22,6 +22,7 @@ Additional people who have contributed p Armando L. Caro Jr. Assar Westerlund Brian Ginsbach + Bill Parker Charles M. Hannum Chris G. Demetriou Chris Lightfoot @@ -59,6 +60,7 @@ Additional people who have contributed p Henri Doreau Hyung Sik Yoon Igor Khristophorov + Jakub Zawadzki Jan-Philip Velders Jason R. Thorpe Javier Achirica @@ -152,4 +154,4 @@ The original LBL crew: Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Also see: http://www.wide.ad.jp/itojun-award/ Modified: vendor/libpcap/dist/README ============================================================================== --- vendor/libpcap/dist/README Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/README Thu May 30 06:41:26 2013 (r251125) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 1.x.y of LIBPCAP can be retrieved with the CVS tag "libpcap_1_{x}rel{y}": cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_{x}rel{y} libpcap -Please submit patches against the master copy to the libpcap project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -91,15 +94,18 @@ a particular release of libpcap. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for libpcap at +requests, and feature requests may also be submitted on the GitHub issue +tracker for libpcap at - http://sourceforge.net/projects/libpcap/ + https://github.com/mcr/libpcap/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for libpcap. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for libpcap. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: vendor/libpcap/dist/README.aix ============================================================================== --- vendor/libpcap/dist/README.aix Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/README.aix Thu May 30 06:41:26 2013 (r251125) @@ -19,11 +19,13 @@ Using BPF: possible a description of the symptoms, including indications of the network link-layer type being wrong or time stamps being wrong). - If you fix the problems yourself, please submit a patch to + If you fix the problems yourself, please submit a patch by forking + the branch at - http://sourceforge.net/projects/libpcap/ + https://github.com/mcr/libpcap/issues - so we can incorporate them into the next release. + and issuing a pull request, so we can incorporate the fixes into the + next release. If you don't fix the problems yourself, you can, as a workaround, make libpcap use DLPI instead of BPF. Modified: vendor/libpcap/dist/README.dag ============================================================================== --- vendor/libpcap/dist/README.dag Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/README.dag Thu May 30 06:41:26 2013 (r251125) @@ -96,12 +96,20 @@ implemented. DAG cards by default capture entire packets including the L2 CRC/FCS. If the card is not configured to discard the CRC/FCS, this can confuse applications that use libpcap if they're not prepared for -packets to have an FCS. Libpcap now reads the environment variable -ERF_FCS_BITS to determine how many bits of CRC/FCS to strip from the -end of the captured frame. This defaults to 32 for use with -Ethernet. If the card is configured to strip the CRC/FCS, then set -ERF_FCS_BITS=0. If used with a HDLC/PoS/PPP/Frame Relay link with 16 -bit CRC/FCS, then set ERF_FCS_BITS=16. +packets to have an FCS. + +Libpcap now reads the environment variable ERF_FCS_BITS to determine +how many bits of CRC/FCS to strip from the end of the captured +frame. This defaults to 32 for use with Ethernet. If the card is +configured to strip the CRC/FCS, then set ERF_FCS_BITS=0. If used with +a HDLC/PoS/PPP/Frame Relay link with 16 bit CRC/FCS, then set +ERF_FCS_BITS=16. + +If you wish to create a pcap file that DOES contain the Ethernet FCS, +specify the environment variable ERF_DONT_STRIP_FCS. This will cause +the existing FCS to be captured into the pcap file. Note some +applications may incorrectly report capture errors or oversize packets +when reading these files. ---------------------------------------------------------------------- Modified: vendor/libpcap/dist/VERSION ============================================================================== --- vendor/libpcap/dist/VERSION Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/VERSION Thu May 30 06:41:26 2013 (r251125) @@ -1 +1 @@ -1.3.0 +1.4.0 Modified: vendor/libpcap/dist/aclocal.m4 ============================================================================== --- vendor/libpcap/dist/aclocal.m4 Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/aclocal.m4 Thu May 30 06:41:26 2013 (r251125) @@ -256,7 +256,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, sparc64*) case "$host_os" in - freebsd*) + freebsd*|openbsd*) PIC_OPT=-fPIC ;; esac @@ -458,7 +458,22 @@ dnl Check for flex, default to lex dnl Require flex 2.4 or higher dnl Check for bison, default to yacc dnl Default to lex/yacc if both flex and bison are not available -dnl Define the yy prefix string if using flex and bison +dnl +dnl If we're using flex and bison, pass -P to flex and -p to bison +dnl to define a prefix string for the lexer and parser +dnl +dnl If we're not using flex and bison, don't pass those options +dnl (as they might not work - although if "lex" is a wrapper for +dnl Flex and "yacc" is a wrapper for Bison, they will work), and +dnl define NEED_YYPARSE_WRAPPER (we *CANNOT* use YYBISON to check +dnl whether the wrapper is needed, as some people apparently, for +dnl some unknown reason, choose to use --without-flex and +dnl --without-bison on systems that have Flex and Bison, which +dnl means that the "yacc" they end up using is a wrapper that +dnl runs "bison -y", and at least some versions of Bison define +dnl YYBISON even if run with "-y", so we end up not compiling +dnl the yyparse wrapper and end up with a libpcap that doesn't +dnl define pcap_parse()) dnl dnl usage: dnl @@ -510,6 +525,8 @@ AC_DEFUN(AC_LBL_LEX_AND_YACC, if test "$$1" = flex -a -n "$3" ; then $1="$$1 -P$3" $2="$$2 -p $3" + else + AC_DEFINE(NEED_YYPARSE_WRAPPER,1,[if we need a pcap_parse wrapper around yyparse]) fi]) dnl Modified: vendor/libpcap/dist/bpf_image.c ============================================================================== --- vendor/libpcap/dist/bpf_image.c Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/bpf_image.c Thu May 30 06:41:26 2013 (r251125) @@ -292,11 +292,14 @@ bpf_image(p, n) break; } (void)snprintf(operand, sizeof operand, fmt, v); - (void)snprintf(image, sizeof image, - (BPF_CLASS(p->code) == BPF_JMP && - BPF_OP(p->code) != BPF_JA) ? - "(%03d) %-8s %-16s jt %d\tjf %d" - : "(%03d) %-8s %s", - n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + if (BPF_CLASS(p->code) == BPF_JMP && BPF_OP(p->code) != BPF_JA) { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %-16s jt %d\tjf %d", + n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + } else { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %s", + n, op, operand); + } return image; } Modified: vendor/libpcap/dist/config.h.in ============================================================================== --- vendor/libpcap/dist/config.h.in Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/config.h.in Thu May 30 06:41:26 2013 (r251125) @@ -58,6 +58,15 @@ /* if libnl exists and is version 2.x */ #undef HAVE_LIBNL_2_x +/* if libnl exists and is version 3.x */ +#undef HAVE_LIBNL_3_x + +/* libnl has NLE_FAILURE */ +#undef HAVE_LIBNL_NLE + +/* libnl has new-style socket api */ +#undef HAVE_LIBNL_SOCKETS + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -211,6 +220,9 @@ /* path for device for USB sniffing */ #undef LINUX_USB_MON_DEV +/* if we need a pcap_parse wrapper around yyparse */ +#undef NEED_YYPARSE_WRAPPER + /* Define to 1 if netinet/ether.h declares `ether_hostton' */ #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON @@ -232,9 +244,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -259,6 +268,9 @@ /* include ACN support */ #undef SITA +/* if struct sockaddr_hci has hci_channel member */ +#undef SOCKADDR_HCI_HAS_HCI_CHANNEL + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS Modified: vendor/libpcap/dist/configure ============================================================================== --- vendor/libpcap/dist/configure Thu May 30 06:20:50 2013 (r251124) +++ vendor/libpcap/dist/configure Thu May 30 06:41:26 2013 (r251125) @@ -1,84 +1,61 @@ #! /bin/sh # From configure.in Revision: 1.168 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67. -# +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' + PATH_SEPARATOR=: fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' + rm -f conf$$.sh fi -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi @@ -87,18 +64,20 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -109,321 +88,354 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` # CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$as_unset CDPATH + if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST + if (eval ":") 2>/dev/null; then + as_have_required=yes else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac + as_have_required=no fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes +if as_func_success; then + : else - as_have_required=no + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : +if as_func_ret_success; then + : else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( + case $as_dir in /*) for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac - as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' +if as_func_ret_success; then + : else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error + exitcode=1 + echo positional parameters were not saved. +fi -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : else - as_expr=false + exitcode=1 + echo as_func_success failed. fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : else - as_basename=false + exitcode=1 + echo as_func_ret_success failed. fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : else - as_dirname=false + exitcode=1 + echo positional parameters were not saved. fi -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:42:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34A72C73; Thu, 30 May 2013 06:42:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C444245; Thu, 30 May 2013 06:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6gAmO052824; Thu, 30 May 2013 06:42:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6gAWa052823; Thu, 30 May 2013 06:42:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300642.r4U6gAWa052823@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 06:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251126 - vendor/libpcap/1.4.0 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:42:11 -0000 Author: delphij Date: Thu May 30 06:42:10 2013 New Revision: 251126 URL: http://svnweb.freebsd.org/changeset/base/251126 Log: Tag libpcap 1.4.0. Added: vendor/libpcap/1.4.0/ - copied from r251125, vendor/libpcap/dist/ From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:46:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10D7EF10; Thu, 30 May 2013 06:46:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01997295; Thu, 30 May 2013 06:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6kR31053645; Thu, 30 May 2013 06:46:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6kQMb053630; Thu, 30 May 2013 06:46:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300646.r4U6kQMb053630@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 06:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251127 - in vendor/tcpdump/dist: . tests win32/Include X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:46:28 -0000 Author: delphij Date: Thu May 30 06:46:26 2013 New Revision: 251127 URL: http://svnweb.freebsd.org/changeset/base/251127 Log: Vendor import of tcpdump 4.4.0. Added: vendor/tcpdump/dist/print-msnlb.c vendor/tcpdump/dist/print-otv.c vendor/tcpdump/dist/print-vxlan.c vendor/tcpdump/dist/print-zeromq.c vendor/tcpdump/dist/tests/babel_auth.out vendor/tcpdump/dist/tests/babel_auth.pcap (contents, props changed) vendor/tcpdump/dist/tests/dhcpv6-AFTR-Name-RFC6334.out vendor/tcpdump/dist/tests/dhcpv6-AFTR-Name-RFC6334.pcap (contents, props changed) vendor/tcpdump/dist/tests/dhcpv6-ia-na.out vendor/tcpdump/dist/tests/dhcpv6-ia-na.pcap (contents, props changed) vendor/tcpdump/dist/tests/dhcpv6-ia-pd.out vendor/tcpdump/dist/tests/dhcpv6-ia-pd.pcap (contents, props changed) vendor/tcpdump/dist/tests/dhcpv6-ia-ta.out vendor/tcpdump/dist/tests/dhcpv6-ia-ta.pcap (contents, props changed) vendor/tcpdump/dist/tests/failure-outputs.txt vendor/tcpdump/dist/tests/forces2.pcap (contents, props changed) vendor/tcpdump/dist/tests/forces2vvv.out vendor/tcpdump/dist/tests/forces3.pcap (contents, props changed) vendor/tcpdump/dist/tests/igmpv3-queries.out vendor/tcpdump/dist/tests/igmpv3-queries.pcap (contents, props changed) vendor/tcpdump/dist/tests/mpbgp-linklocal-nexthop.out vendor/tcpdump/dist/tests/mpbgp-linklocal-nexthop.pcap (contents, props changed) vendor/tcpdump/dist/tests/msnlb.out vendor/tcpdump/dist/tests/msnlb.pcap (contents, props changed) vendor/tcpdump/dist/tests/msnlb2.out vendor/tcpdump/dist/tests/msnlb2.pcap (contents, props changed) vendor/tcpdump/dist/tests/ripv1v2.out vendor/tcpdump/dist/tests/ripv1v2.pcap (contents, props changed) vendor/tcpdump/dist/tests/ripv2_auth.out vendor/tcpdump/dist/tests/ripv2_auth.pcap (contents, props changed) vendor/tcpdump/dist/tests/spb.out vendor/tcpdump/dist/tests/spb.pcap (contents, props changed) vendor/tcpdump/dist/tests/spb_bpduv4.out vendor/tcpdump/dist/tests/spb_bpduv4.pcap (contents, props changed) vendor/tcpdump/dist/tests/zmtp1.out vendor/tcpdump/dist/tests/zmtp1.pcap (contents, props changed) vendor/tcpdump/dist/win32/Include/bittypes.h Modified: vendor/tcpdump/dist/CHANGES vendor/tcpdump/dist/CREDITS vendor/tcpdump/dist/Makefile.in vendor/tcpdump/dist/README vendor/tcpdump/dist/VERSION vendor/tcpdump/dist/addrtoname.c vendor/tcpdump/dist/checksum.c vendor/tcpdump/dist/configure vendor/tcpdump/dist/configure.in vendor/tcpdump/dist/ethertype.h vendor/tcpdump/dist/icmp6.h vendor/tcpdump/dist/interface.h vendor/tcpdump/dist/netdissect.h vendor/tcpdump/dist/nlpid.c vendor/tcpdump/dist/nlpid.h vendor/tcpdump/dist/print-802_11.c vendor/tcpdump/dist/print-babel.c vendor/tcpdump/dist/print-bgp.c vendor/tcpdump/dist/print-dhcp6.c vendor/tcpdump/dist/print-domain.c vendor/tcpdump/dist/print-ether.c vendor/tcpdump/dist/print-icmp6.c vendor/tcpdump/dist/print-isoclns.c vendor/tcpdump/dist/print-lldp.c vendor/tcpdump/dist/print-ntp.c vendor/tcpdump/dist/print-pppoe.c vendor/tcpdump/dist/print-rip.c vendor/tcpdump/dist/print-rpki-rtr.c vendor/tcpdump/dist/print-stp.c vendor/tcpdump/dist/print-tcp.c vendor/tcpdump/dist/print-udp.c vendor/tcpdump/dist/tcp.h vendor/tcpdump/dist/tcpdump.1.in vendor/tcpdump/dist/tcpdump.c vendor/tcpdump/dist/tests/TESTLIST vendor/tcpdump/dist/tests/TESTrun.sh vendor/tcpdump/dist/tests/icmpv6.out vendor/tcpdump/dist/tests/icmpv6.pcap vendor/tcpdump/dist/tests/print-A.out vendor/tcpdump/dist/tests/print-AA.out vendor/tcpdump/dist/udp.h Modified: vendor/tcpdump/dist/CHANGES ============================================================================== --- vendor/tcpdump/dist/CHANGES Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/CHANGES Thu May 30 06:46:26 2013 (r251127) @@ -1,3 +1,37 @@ +Thursday February 19, 2013 guy@alum.mit.edu. + Summary for 4.4.0 tcpdump release + RPKI-RTR (RFC6810) is now official (TCP Port 323) + Fix detection of OpenSSL libcrypto. + Add DNSSL (RFC6106) support. + Add "radius" as an option for -T. + Update Action codes for handle_action function according to + 802.11s amendment. + Decode DHCPv6 AFTR-Name option (RFC6334). + Updates for Babel. + Fix printing of infinite lifetime in ICMPv6. + Added support for SPB, SPBM Service Identifier, and Unicast + Address sub-TLV in ISIS. + Decode RIPv2 authentication up to RFC4822. + Fix RIP Request/full table decoding issues. + On Linux systems with cap-ng.h, drop root privileges + using Linux Capabilities. + Add support for reading multiple files. + +Wednesday November 28, 2012 guy@alum.mit.edu. + Summary for 4.3.1 tcpdump release + Print "LLDP, length N" for LLDP packets even when not in verbose + mode, so something is printed even if only the timestamp is + present + Document "-T carp" + Print NTP poll interval correctly (it's an exponent, so print + both its raw value and 2^value) + Document that "-e" is used to get MAC addresses + More clearly document that you need to escape or quote + backslashes in filter expressions on the command line + Fix some "the the" in the man page + Use the right maximum path length + Don't treat 192_1_2, when passed to -i, as an interface number + Friday April 3, 2011. mcr@sandelman.ca. Summary for 4.3.0 tcpdump release fixes for forces: SPARSE data (per RFC 5810) Modified: vendor/tcpdump/dist/CREDITS ============================================================================== --- vendor/tcpdump/dist/CREDITS Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/CREDITS Thu May 30 06:46:26 2013 (r251127) @@ -52,6 +52,7 @@ Additional people who have contributed p David Horn David Smith David Young + Denis Ovsienko Dmitry Eremin-Solenikov Don Ebright Eddie Kohler Modified: vendor/tcpdump/dist/Makefile.in ============================================================================== --- vendor/tcpdump/dist/Makefile.in Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/Makefile.in Thu May 30 06:46:26 2013 (r251127) @@ -84,7 +84,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ print-lmp.c print-lspping.c print-lwapp.c \ print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \ - print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ + print-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ print-pgm.c print-pim.c \ print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \ print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \ @@ -93,7 +93,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \ print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \ - print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c + print-wb.c print-zephyr.c print-zeromq.c print-vxlan.c print-otv.c signature.c setsignal.c tcpdump.c util.c LIBNETDISSECT_SRC=print-isakmp.c LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) @@ -263,93 +263,8 @@ EXTRA_DIST = \ stime.awk \ strcasecmp.c \ tcpdump.1.in \ - tests/02-sunrise-sunset-esp.pcap \ - tests/08-sunrise-sunset-aes.pcap \ - tests/08-sunrise-sunset-esp2.pcap \ - tests/QinQpacket.out \ - tests/QinQpacket.pcap \ - tests/QinQpacketv.out \ - tests/TESTLIST \ - tests/TESTonce \ - tests/TESTrun.sh \ - tests/babel.pcap \ - tests/babel1.out \ - tests/babel1v.out \ - tests/bgp-infinite-loop.pcap \ - tests/bgp_vpn_attrset.out \ - tests/bgp_vpn_attrset.pcap \ - tests/chdlc-slarp-short.pcap \ - tests/chdlc-slarp.pcap \ - tests/dio.out \ - tests/dio.pcap \ - tests/e1000g.out \ - tests/e1000g.pcap \ - tests/eapon1.gdbinit \ - tests/eapon1.out \ - tests/eapon1.pcap \ - tests/empty.uu \ - tests/esp-secrets.txt \ - tests/esp0.out \ - tests/esp1.gdbinit \ - tests/esp1.out \ - tests/esp2.gdbinit \ - tests/esp2.out \ - tests/esp3.gdbinit \ - tests/esp4.gdbinit \ - tests/esp5.gdbinit \ - tests/esp5.out \ - tests/espudp1.out \ - tests/espudp1.pcap \ - tests/forces1.out \ - tests/forces1.pcap \ - tests/forces1vvv.out \ - tests/forces1vvvv.out \ - tests/forces2v.out \ - tests/forces2vv.out \ - tests/forces3vvv.out \ - tests/icmpv6.out \ - tests/icmpv6.pcap \ - tests/ikev2four.out \ - tests/ikev2four.pcap \ - tests/ikev2fourv.out \ - tests/ikev2fourv4.out \ - tests/ikev2pI2-secrets.txt \ - tests/ikev2pI2.out \ - tests/ikev2pI2.pcap \ - tests/isakmp-delete-segfault.pcap \ - tests/isakmp-identification-segfault.pcap \ - tests/isakmp-pointer-loop.pcap \ - tests/isakmp1.out \ - tests/isakmp2.out \ - tests/isakmp3.out \ - tests/isakmp4.out \ - tests/isakmp4500.pcap \ - tests/isis-infinite-loop.pcap \ - tests/ldp-infinite-loop.pcap \ - tests/lmp.out \ - tests/lmp.pcap \ - tests/lmp.sh \ - tests/lspping-fec-ldp.pcap \ - tests/lspping-fec-rsvp.pcap \ - tests/mpls-ldp-hello.out \ - tests/mpls-ldp-hello.pcap \ - tests/mpls-traceroute.pcap \ - tests/ospf-gmpls.out \ - tests/ospf-gmpls.pcap \ - tests/pppoe.out \ - tests/pppoe.pcap \ - tests/print-A.out \ - tests/print-AA.out \ - tests/print-capX.out \ - tests/print-capXX.out \ - tests/print-flags.pcap \ - tests/print-flags.sh \ - tests/print-x.out \ - tests/print-xx.out \ - tests/rsvp-infinite-loop.pcap \ - tests/sflow_multiple_counter_30_pdus.out \ - tests/sflow_multiple_counter_30_pdus.pcap \ vfprintf.c \ + win32/Include/bittypes.h \ win32/Include/errno.h \ win32/Include/getopt.h \ win32/Include/w32_fzs.h \ @@ -358,6 +273,8 @@ EXTRA_DIST = \ win32/prj/WinDump.dsp \ win32/prj/WinDump.dsw +TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` + all: $(PROG) $(PROG): $(OBJ) @V_PCAPDEP@ @@ -443,9 +360,12 @@ TAGS: $(TAGFILES) releasetar: @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ mkdir $$name; \ - tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \ + tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \ tar -c -z -f $$name.tar.gz $$name; \ rm -rf $$name +testlist: + echo $(TEST_DIST) + depend: $(GENSRC) ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) Modified: vendor/tcpdump/dist/README ============================================================================== --- vendor/tcpdump/dist/README Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/README Thu May 30 06:46:26 2013 (r251127) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely": cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump -Please submit patches against the master copy to the tcpdump project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -68,16 +71,19 @@ documentation. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for tcpdump at +requests, and feature requests may also be submitted on the GitHub issue +tracker for tcpdump at - http://sourceforge.net/projects/tcpdump/ + https://github.com/mcr/tcpdump/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for tcpdump. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for tcpdump. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: vendor/tcpdump/dist/VERSION ============================================================================== --- vendor/tcpdump/dist/VERSION Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/VERSION Thu May 30 06:46:26 2013 (r251127) @@ -1 +1 @@ -4.3.0 +4.4.0 Modified: vendor/tcpdump/dist/addrtoname.c ============================================================================== --- vendor/tcpdump/dist/addrtoname.c Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/addrtoname.c Thu May 30 06:46:26 2013 (r251127) @@ -381,6 +381,9 @@ lookup_bytestring(register const u_char tp->e_addr2 = k; tp->e_bs = (u_char *) calloc(1, nlen + 1); + if (tp->e_bs == NULL) + error("lookup_bytestring: calloc"); + memcpy(tp->e_bs, bs, nlen); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) Modified: vendor/tcpdump/dist/checksum.c ============================================================================== --- vendor/tcpdump/dist/checksum.c Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/checksum.c Thu May 30 06:46:26 2013 (r251127) @@ -152,8 +152,6 @@ create_osi_cksum (const u_int8_t *pptr, u_int16_t checksum; int index; - checksum = 0; - c0 = 0; c1 = 0; Modified: vendor/tcpdump/dist/configure ============================================================================== --- vendor/tcpdump/dist/configure Thu May 30 06:42:10 2013 (r251126) +++ vendor/tcpdump/dist/configure Thu May 30 06:46:26 2013 (r251127) @@ -1,61 +1,84 @@ #! /bin/sh # From configure.in Revision: 1.204 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.68. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -64,20 +87,19 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -88,354 +110,328 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -fi -fi +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 06:46:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84A1710B; Thu, 30 May 2013 06:46:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E77B29C; Thu, 30 May 2013 06:46:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6kr2g053746; Thu, 30 May 2013 06:46:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6krSH053744; Thu, 30 May 2013 06:46:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300646.r4U6krSH053744@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 06:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251128 - vendor/tcpdump/4.4.0 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 06:46:53 -0000 Author: delphij Date: Thu May 30 06:46:52 2013 New Revision: 251128 URL: http://svnweb.freebsd.org/changeset/base/251128 Log: Tag tcpdump 4.4.0. Added: vendor/tcpdump/4.4.0/ - copied from r251127, vendor/tcpdump/dist/ From owner-svn-src-all@FreeBSD.ORG Thu May 30 07:13:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5063170F; Thu, 30 May 2013 07:13:29 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 2D30E632; Thu, 30 May 2013 07:13:29 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4U7DSCu091803; Thu, 30 May 2013 00:13:28 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4U7DST8091802; Thu, 30 May 2013 00:13:28 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 30 May 2013 00:13:28 -0700 From: David Schultz To: Xin LI Subject: Re: svn commit: r249035 - head/lib/libc/stdlib Message-ID: <20130530071328.GA91730@zim.MIT.EDU> References: <201304022341.r32NfL8L096954@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304022341.r32NfL8L096954@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 07:13:29 -0000 On Tue, Apr 02, 2013, Xin LI wrote: > Author: delphij > Date: Tue Apr 2 23:41:20 2013 > New Revision: 249035 > URL: http://svnweb.freebsd.org/changeset/base/249035 > > Log: > Replace access to /dev/random with the kernel pseudo-random number > source sysctl(KERN_ARND) and remove the fallback code. Thanks. I wanted to do this several years ago. Incidentally, the reason I didn't is that I had some concerns about sysctl(KERN_ARND) not being sufficiently fail-safe. There were a couple of issues, but the main one was that if something in the kernel asked for a random number before the random device was loaded, the result was not-so-random numbers. Furthermore, since the generator was seeded at that point, it continued to give out not-so-random numbers for some time. I added the following log message in the problematic case: "random device not loaded; using insecure entropy" According to a Google search, I'm not the only person to have triggered it. (I hit it because I dynamically link most drivers, including random.ko. I'm not sure about the others.) I think your patch is good, but the kernel-side issues probably bear some investigation. From owner-svn-src-all@FreeBSD.ORG Thu May 30 08:02:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6167D34D; Thu, 30 May 2013 08:02:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52B1A8DE; Thu, 30 May 2013 08:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U821S1080435; Thu, 30 May 2013 08:02:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U820JE080405; Thu, 30 May 2013 08:02:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300802.r4U820JE080405@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 08:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251129 - in head: contrib/libpcap contrib/libpcap/pcap lib/libpcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 08:02:02 -0000 Author: delphij Date: Thu May 30 08:02:00 2013 New Revision: 251129 URL: http://svnweb.freebsd.org/changeset/base/251129 Log: MFV: libpcap 1.4.0. MFC after: 4 weeks Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CREDITS head/contrib/libpcap/README head/contrib/libpcap/VERSION head/contrib/libpcap/bpf_image.c head/contrib/libpcap/config.h.in head/contrib/libpcap/configure head/contrib/libpcap/configure.in head/contrib/libpcap/fad-getad.c head/contrib/libpcap/fad-gifc.c head/contrib/libpcap/fad-glifc.c head/contrib/libpcap/fad-sita.c head/contrib/libpcap/gencode.c head/contrib/libpcap/grammar.y head/contrib/libpcap/nametoaddr.c head/contrib/libpcap/optimize.c head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-bt-linux.h head/contrib/libpcap/pcap-can-linux.c head/contrib/libpcap/pcap-can-linux.h head/contrib/libpcap/pcap-canusb-linux.c head/contrib/libpcap/pcap-canusb-linux.h head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dag.h head/contrib/libpcap/pcap-dlpi.c head/contrib/libpcap/pcap-filter.manmisc head/contrib/libpcap/pcap-filter.manmisc.in head/contrib/libpcap/pcap-int.h head/contrib/libpcap/pcap-libdlpi.c head/contrib/libpcap/pcap-linux.c head/contrib/libpcap/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netfilter-linux.h head/contrib/libpcap/pcap-nit.c head/contrib/libpcap/pcap-null.c head/contrib/libpcap/pcap-pf.c head/contrib/libpcap/pcap-septel.c head/contrib/libpcap/pcap-septel.h head/contrib/libpcap/pcap-sita.c head/contrib/libpcap/pcap-snf.c head/contrib/libpcap/pcap-snf.h head/contrib/libpcap/pcap-snit.c head/contrib/libpcap/pcap-snoop.c head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap-usb-linux.h head/contrib/libpcap/pcap-win32.c head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap_breakloop.3pcap head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_offline_filter.3pcap head/contrib/libpcap/scanner.l head/lib/libpcap/config.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/CHANGES Thu May 30 08:02:00 2013 (r251129) @@ -1,3 +1,35 @@ +Monday March 18, 2013 guy@alum.mit.edu +Summary for 1.4.0 libpcap release + Add netfilter/nfqueue interface. + If we don't have support for IPv6 address resolution, support, + in filter expressions, what IPv6 stuff we can. + Checks added for malloc()/realloc()/etc. failures. + Fix pcap-config to include -lpthread if canusb support is + present + Try to fix "pcap_parse not defined" problems when --without-flex + and --without-bison are used when you have Flex and Bison + Fix some issues with the pcap_loop man page. + Fix pcap_getnonblock() and pcap_setnonblock() to fill in the + supplied error message buffer + Fix typo that, it appeared, would cause pcap-libdlpi.c not to + compile (perhaps systems with libdlpi also have BPF and use + that instead) + Catch attempts to call pcap_compile() on a non-activated pcap_t + Fix crash on Linux with CAN-USB support without usbfs + Fix addition of VLAN tags for Linux cooked captures + Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl, so + that the driver can report either one if it doesn't support + SIOCETHTOOL + Add DLT_INFINIBAND and DLT_SCTP + Describe "proto XXX" and "protochain XXX" in the pcap-filter man + page + Handle either directories, or symlinks to directories, that + correspond to interfaces in /sys/class/net + Fix handling of VLAN tag insertion to check, on Linux 3.x + kernels, for VLAN tag valid flag + Clean up some man pages + Support libnl3 as well as libnl1 and libnl2 on Linux + Friday March 30, 2012. mcr@sandelman.ca Summary for 1.3.0 libpcap release Handle DLT_PFSYNC in {FreeBSD, other *BSD+Mac OS X, other}. Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/CREDITS Thu May 30 08:02:00 2013 (r251129) @@ -22,6 +22,7 @@ Additional people who have contributed p Armando L. Caro Jr. Assar Westerlund Brian Ginsbach + Bill Parker Charles M. Hannum Chris G. Demetriou Chris Lightfoot @@ -59,6 +60,7 @@ Additional people who have contributed p Henri Doreau Hyung Sik Yoon Igor Khristophorov + Jakub Zawadzki Jan-Philip Velders Jason R. Thorpe Javier Achirica @@ -152,4 +154,4 @@ The original LBL crew: Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Also see: http://www.wide.ad.jp/itojun-award/ Modified: head/contrib/libpcap/README ============================================================================== --- head/contrib/libpcap/README Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/README Thu May 30 08:02:00 2013 (r251129) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 1.x.y of LIBPCAP can be retrieved with the CVS tag "libpcap_1_{x}rel{y}": cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_{x}rel{y} libpcap -Please submit patches against the master copy to the libpcap project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -91,15 +94,18 @@ a particular release of libpcap. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for libpcap at +requests, and feature requests may also be submitted on the GitHub issue +tracker for libpcap at - http://sourceforge.net/projects/libpcap/ + https://github.com/mcr/libpcap/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for libpcap. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for libpcap. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: head/contrib/libpcap/VERSION ============================================================================== --- head/contrib/libpcap/VERSION Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/VERSION Thu May 30 08:02:00 2013 (r251129) @@ -1 +1 @@ -1.3.0 +1.4.0 Modified: head/contrib/libpcap/bpf_image.c ============================================================================== --- head/contrib/libpcap/bpf_image.c Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/bpf_image.c Thu May 30 08:02:00 2013 (r251129) @@ -292,11 +292,14 @@ bpf_image(p, n) break; } (void)snprintf(operand, sizeof operand, fmt, v); - (void)snprintf(image, sizeof image, - (BPF_CLASS(p->code) == BPF_JMP && - BPF_OP(p->code) != BPF_JA) ? - "(%03d) %-8s %-16s jt %d\tjf %d" - : "(%03d) %-8s %s", - n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + if (BPF_CLASS(p->code) == BPF_JMP && BPF_OP(p->code) != BPF_JA) { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %-16s jt %d\tjf %d", + n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + } else { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %s", + n, op, operand); + } return image; } Modified: head/contrib/libpcap/config.h.in ============================================================================== --- head/contrib/libpcap/config.h.in Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/config.h.in Thu May 30 08:02:00 2013 (r251129) @@ -58,6 +58,15 @@ /* if libnl exists and is version 2.x */ #undef HAVE_LIBNL_2_x +/* if libnl exists and is version 3.x */ +#undef HAVE_LIBNL_3_x + +/* libnl has NLE_FAILURE */ +#undef HAVE_LIBNL_NLE + +/* libnl has new-style socket api */ +#undef HAVE_LIBNL_SOCKETS + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -211,6 +220,9 @@ /* path for device for USB sniffing */ #undef LINUX_USB_MON_DEV +/* if we need a pcap_parse wrapper around yyparse */ +#undef NEED_YYPARSE_WRAPPER + /* Define to 1 if netinet/ether.h declares `ether_hostton' */ #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON @@ -232,9 +244,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -259,6 +268,9 @@ /* include ACN support */ #undef SITA +/* if struct sockaddr_hci has hci_channel member */ +#undef SOCKADDR_HCI_HAS_HCI_CHANNEL + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS Modified: head/contrib/libpcap/configure ============================================================================== --- head/contrib/libpcap/configure Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/configure Thu May 30 08:02:00 2013 (r251129) @@ -1,84 +1,61 @@ #! /bin/sh # From configure.in Revision: 1.168 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67. -# +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' + PATH_SEPARATOR=: fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' + rm -f conf$$.sh fi -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi @@ -87,18 +64,20 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -109,321 +88,354 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` # CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$as_unset CDPATH + if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST + if (eval ":") 2>/dev/null; then + as_have_required=yes else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac + as_have_required=no fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes +if as_func_success; then + : else - as_have_required=no + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : +if as_func_ret_success; then + : else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( + case $as_dir in /*) for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac - as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' +if as_func_ret_success; then + : else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error + exitcode=1 + echo positional parameters were not saved. +fi -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : else - as_expr=false + exitcode=1 + echo as_func_success failed. fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : else - as_basename=false + exitcode=1 + echo as_func_ret_success failed. fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : else - as_dirname=false + exitcode=1 + echo positional parameters were not saved. fi -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -440,7 +452,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -450,40 +463,49 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 11:08:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED559A5D; Thu, 30 May 2013 11:08:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE74E5E2; Thu, 30 May 2013 11:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UB8GZp044902; Thu, 30 May 2013 11:08:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UB8GqU044899; Thu, 30 May 2013 11:08:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301108.r4UB8GqU044899@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251130 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 11:08:17 -0000 Author: luigi Date: Thu May 30 11:08:16 2013 New Revision: 251130 URL: http://svnweb.freebsd.org/changeset/base/251130 Log: remove use of deprecated ioctl() Modified: head/tools/tools/netmap/nm_util.c head/tools/tools/netmap/pcap.c Modified: head/tools/tools/netmap/nm_util.c ============================================================================== --- head/tools/tools/netmap/nm_util.c Thu May 30 08:02:00 2013 (r251129) +++ head/tools/tools/netmap/nm_util.c Thu May 30 11:08:16 2013 (r251130) @@ -221,7 +221,6 @@ netmap_close(struct my_ring *me) D(""); if (me->mem) munmap(me->mem, me->memsize); - ioctl(me->fd, NIOCUNREGIF, NULL); close(me->fd); return (0); } Modified: head/tools/tools/netmap/pcap.c ============================================================================== --- head/tools/tools/netmap/pcap.c Thu May 30 08:02:00 2013 (r251129) +++ head/tools/tools/netmap/pcap.c Thu May 30 11:08:16 2013 (r251130) @@ -13,7 +13,7 @@ #define MY_PCAP #include "nm_util.h" -char *version = "$Id: pcap.c 11463 2012-07-30 15:26:02Z luigi $"; +char *version = "$Id$"; int verbose = 0; /* @@ -445,7 +445,6 @@ pcap_close(pcap_t *p) if (me->mem) munmap(me->mem, me->memsize); /* restore original flags ? */ - ioctl(me->fd, NIOCUNREGIF, NULL); close(me->fd); bzero(me, sizeof(*me)); free(me); From owner-svn-src-all@FreeBSD.ORG Thu May 30 11:09:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D05BBE8; Thu, 30 May 2013 11:09:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC1C35EE; Thu, 30 May 2013 11:09:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UB9fU5045232; Thu, 30 May 2013 11:09:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UB9ftS045231; Thu, 30 May 2013 11:09:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301109.r4UB9ftS045231@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251131 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 11:09:42 -0000 Author: luigi Date: Thu May 30 11:09:41 2013 New Revision: 251131 URL: http://svnweb.freebsd.org/changeset/base/251131 Log: add a compile-time option to copy packets instead of doing the buffer swapping. Modified: head/tools/tools/netmap/bridge.c Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Thu May 30 11:08:16 2013 (r251130) +++ head/tools/tools/netmap/bridge.c Thu May 30 11:09:41 2013 (r251131) @@ -14,7 +14,7 @@ int verbose = 0; -char *version = "$Id: bridge.c 12016 2013-01-23 17:24:22Z luigi $"; +char *version = "$Id$"; static int do_abort = 0; @@ -50,7 +50,12 @@ process_rings(struct netmap_ring *rxring while (limit-- > 0) { struct netmap_slot *rs = &rxring->slot[j]; struct netmap_slot *ts = &txring->slot[k]; +#ifdef NO_SWAP + char *rxbuf = NETMAP_BUF(rxring, rs->buf_idx); + char *txbuf = NETMAP_BUF(txring, ts->buf_idx); +#else uint32_t pkt; +#endif /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { @@ -58,20 +63,24 @@ process_rings(struct netmap_ring *rxring j, rs->buf_idx, k, ts->buf_idx); sleep(2); } +#ifndef NO_SWAP pkt = ts->buf_idx; ts->buf_idx = rs->buf_idx; rs->buf_idx = pkt; - +#endif /* copy the packet length. */ if (rs->len < 14 || rs->len > 2048) D("wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); else if (verbose > 1) D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); ts->len = rs->len; - +#ifdef NO_SWAP + pkt_copy(rxbuf, txbuf, ts->len); +#else /* report the buffer change. */ ts->flags |= NS_BUF_CHANGED; rs->flags |= NS_BUF_CHANGED; +#endif /* NO_SWAP */ j = NETMAP_RING_NEXT(rxring, j); k = NETMAP_RING_NEXT(txring, k); } From owner-svn-src-all@FreeBSD.ORG Thu May 30 11:10:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18716D67; Thu, 30 May 2013 11:10:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF0E05F9; Thu, 30 May 2013 11:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UBAgx4047095; Thu, 30 May 2013 11:10:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UBAgkL047094; Thu, 30 May 2013 11:10:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301110.r4UBAgkL047094@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251132 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 11:10:43 -0000 Author: luigi Date: Thu May 30 11:10:42 2013 New Revision: 251132 URL: http://svnweb.freebsd.org/changeset/base/251132 Log: add support for rate-limiting in the sender (-R ...) Obtained from: Giuseppe Lettieri Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Thu May 30 11:09:41 2013 (r251131) +++ head/tools/tools/netmap/pkt-gen.c Thu May 30 11:10:42 2013 (r251132) @@ -25,7 +25,7 @@ /* * $FreeBSD$ - * $Id: pkt-gen.c 12024 2013-01-25 05:41:51Z luigi $ + * $Id$ * * Example program to show how to build a multithreaded packet * source/sink using the netmap device. @@ -89,6 +89,9 @@ struct glob_arg { int dev_type; pcap_t *p; + int tx_rate; + struct timespec tx_period; + int affinity; int main_fd; int report_interval; @@ -114,7 +117,7 @@ struct targ { struct netmap_if *nifp; uint16_t qfirst, qlast; /* range of queues to scan */ volatile uint64_t count; - struct timeval tic, toc; + struct timespec tic, toc; int me; pthread_t thread; int affinity; @@ -669,6 +672,76 @@ ponger_body(void *data) return NULL; } +static __inline int +timespec_ge(const struct timespec *a, const struct timespec *b) +{ + + if (a->tv_sec > b->tv_sec) + return (1); + if (a->tv_sec < b->tv_sec) + return (0); + if (a->tv_nsec >= b->tv_nsec) + return (1); + return (0); +} + +static __inline struct timespec +timeval2spec(const struct timeval *a) +{ + struct timespec ts = { + .tv_sec = a->tv_sec, + .tv_nsec = a->tv_usec * 1000 + }; + return ts; +} + +static __inline struct timeval +timespec2val(const struct timespec *a) +{ + struct timeval tv = { + .tv_sec = a->tv_sec, + .tv_usec = a->tv_nsec / 1000 + }; + return tv; +} + + +static int +wait_time(struct timespec ts, struct timespec *wakeup_ts, long long *waited) +{ + struct timespec curtime; + + curtime.tv_sec = 0; + curtime.tv_nsec = 0; + + if (clock_gettime(CLOCK_REALTIME_PRECISE, &curtime) == -1) { + D("clock_gettime: %s", strerror(errno)); + return (-1); + } + while (timespec_ge(&ts, &curtime)) { + if (waited != NULL) + (*waited)++; + if (clock_gettime(CLOCK_REALTIME_PRECISE, &curtime) == -1) { + D("clock_gettime"); + return (-1); + } + } + if (wakeup_ts != NULL) + *wakeup_ts = curtime; + return (0); +} + +static __inline void +timespec_add(struct timespec *tsa, struct timespec *tsb) +{ + tsa->tv_sec += tsb->tv_sec; + tsa->tv_nsec += tsb->tv_nsec; + if (tsa->tv_nsec >= 1000000000) { + tsa->tv_sec++; + tsa->tv_nsec -= 1000000000; + } +} + static void * sender_body(void *data) @@ -680,7 +753,10 @@ sender_body(void *data) struct netmap_ring *txring; int i, n = targ->g->npackets / targ->g->nthreads, sent = 0; int options = targ->g->options | OPT_COPY; -D("start"); + struct timespec tmptime, nexttime = { 0, 0}; // XXX silence compiler + int rate_limit = targ->g->tx_rate; + long long waited = 0; + D("start"); if (setaffinity(targ->thread, targ->affinity)) goto quit; /* setup poll(2) mechanism. */ @@ -689,8 +765,18 @@ D("start"); fds[0].events = (POLLOUT); /* main loop.*/ - gettimeofday(&targ->tic, NULL); - + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->tic); + if (rate_limit) { + tmptime.tv_sec = 2; + tmptime.tv_nsec = 0; + timespec_add(&targ->tic, &tmptime); + targ->tic.tv_nsec = 0; + if (wait_time(targ->tic, NULL, NULL) == -1) { + D("wait_time: %s", strerror(errno)); + goto quit; + } + nexttime = targ->tic; + } if (targ->g->dev_type == DEV_PCAP) { int size = targ->g->pkt_size; void *pkt = &targ->pkt; @@ -718,8 +804,18 @@ D("start"); } } } else { + int tosend = 0; while (!targ->cancel && (n == 0 || sent < n)) { + if (rate_limit && tosend <= 0) { + tosend = targ->g->burst; + timespec_add(&nexttime, &targ->g->tx_period); + if (wait_time(nexttime, &tmptime, &waited) == -1) { + D("wait_time"); + goto quit; + } + } + /* * wait for available room in the send queue(s) */ @@ -737,7 +833,7 @@ D("start"); options &= ~OPT_COPY; } for (i = targ->qfirst; i < targ->qlast; i++) { - int m, limit = targ->g->burst; + int m, limit = rate_limit ? tosend : targ->g->burst; if (n > 0 && n - sent < limit) limit = n - sent; txring = NETMAP_TXRING(nifp, i); @@ -746,6 +842,7 @@ D("start"); m = send_packets(txring, &targ->pkt, targ->g->pkt_size, limit, options); sent += m; + tosend -= m; targ->count = sent; } } @@ -762,7 +859,7 @@ D("start"); } } - gettimeofday(&targ->toc, NULL); + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->toc); targ->completed = 1; targ->count = sent; @@ -834,7 +931,7 @@ receiver_body(void *data) } /* main loop, exit after 1s silence */ - gettimeofday(&targ->tic, NULL); + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->tic); if (targ->g->dev_type == DEV_PCAP) { while (!targ->cancel) { /* XXX should we poll ? */ @@ -852,8 +949,8 @@ receiver_body(void *data) while (!targ->cancel) { /* Once we started to receive packets, wait at most 1 seconds before quitting. */ - if (poll(fds, 1, 1 * 1000) <= 0 && targ->g->forever == 0) { - gettimeofday(&targ->toc, NULL); + if (poll(fds, 1, 1 * 1000) <= 0 && !targ->g->forever) { + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->toc); targ->toc.tv_sec -= 1; /* Subtract timeout time. */ break; } @@ -1085,11 +1182,13 @@ main_thread(struct glob_arg *g) timerclear(&tic); timerclear(&toc); for (i = 0; i < g->nthreads; i++) { + struct timespec t_tic, t_toc; /* * Join active threads, unregister interfaces and close * file descriptors. */ - pthread_join(targs[i].thread, NULL); + if (targs[i].used) + pthread_join(targs[i].thread, NULL); close(targs[i].fd); if (targs[i].completed == 0) @@ -1100,10 +1199,12 @@ main_thread(struct glob_arg *g) * how long it took to send all the packets. */ count += targs[i].count; - if (!timerisset(&tic) || timercmp(&targs[i].tic, &tic, <)) - tic = targs[i].tic; - if (!timerisset(&toc) || timercmp(&targs[i].toc, &toc, >)) - toc = targs[i].toc; + t_tic = timeval2spec(&tic); + t_toc = timeval2spec(&toc); + if (!timerisset(&tic) || timespec_ge(&targs[i].tic, &t_tic)) + tic = timespec2val(&targs[i].tic); + if (!timerisset(&toc) || timespec_ge(&targs[i].toc, &t_toc)) + toc = timespec2val(&targs[i].toc); } /* print output. */ @@ -1115,7 +1216,6 @@ main_thread(struct glob_arg *g) rx_output(count, delta_t); if (g->dev_type == DEV_NETMAP) { - ioctl(g->main_fd, NIOCUNREGIF, NULL); // XXX deprecated munmap(g->mmap_addr, g->mmap_size); close(g->main_fd); } @@ -1224,9 +1324,10 @@ main(int arc, char **argv) g.burst = 512; // default g.nthreads = 1; g.cpus = 1; + g.tx_rate = 0; while ( (ch = getopt(arc, argv, - "a:f:n:i:t:r:l:d:s:D:S:b:c:o:p:PT:w:Wv")) != -1) { + "a:f:n:i:t:r:l:d:s:D:S:b:c:o:p:PT:w:WvR:")) != -1) { struct sf *fn; switch(ch) { @@ -1325,6 +1426,10 @@ main(int arc, char **argv) break; case 'v': verbose++; + break; + case 'R': + g.tx_rate = atoi(optarg); + break; } } @@ -1473,6 +1578,23 @@ main(int arc, char **argv) g.options & OPT_MEMCPY ? " memcpy" : "", g.options & OPT_COPY ? " copy" : ""); } + + if (g.tx_rate == 0) { + g.tx_period.tv_sec = 0; + g.tx_period.tv_nsec = 0; + } else if (g.tx_rate == 1) { + g.tx_period.tv_sec = 1; + g.tx_period.tv_nsec = 0; + } else { + g.tx_period.tv_sec = 0; + g.tx_period.tv_nsec = (1e9 / g.tx_rate) * g.burst; + if (g.tx_period.tv_nsec > 1000000000) { + g.tx_period.tv_sec = g.tx_period.tv_nsec / 1000000000; + g.tx_period.tv_nsec = g.tx_period.tv_nsec % 1000000000; + } + } + D("Sending %d packets every %d.%09d ns", + g.burst, (int)g.tx_period.tv_sec, (int)g.tx_period.tv_nsec); /* Wait for PHY reset. */ D("Wait %d secs for phy reset", wait_link); sleep(wait_link); From owner-svn-src-all@FreeBSD.ORG Thu May 30 12:16:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18CF747B; Thu, 30 May 2013 12:16:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE6B1A60; Thu, 30 May 2013 12:16:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCGt2C069557; Thu, 30 May 2013 12:16:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCGtkk069554; Thu, 30 May 2013 12:16:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301216.r4UCGtkk069554@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 12:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251133 - in head/sys/dev: msk sk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:16:56 -0000 Author: marius Date: Thu May 30 12:16:55 2013 New Revision: 251133 URL: http://svnweb.freebsd.org/changeset/base/251133 Log: - Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method sees the actual PCI device which makes the request for DMA tag, instead of some descendant of the PCI device, by creating a pass-through trampoline. - Sprinkle const on tables. - Use NULL instead of 0 for pointers. - Take advantage of nitems(). MFC after: 1 week Modified: head/sys/dev/msk/if_msk.c head/sys/dev/sk/if_sk.c head/sys/dev/sk/if_skreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/msk/if_msk.c Thu May 30 12:16:55 2013 (r251133) @@ -162,7 +162,7 @@ TUNABLE_INT("hw.msk.jumbo_disable", &jum /* * Devices supported by this driver. */ -static struct msk_product { +static const struct msk_product { uint16_t msk_vendorid; uint16_t msk_deviceid; const char *msk_name; @@ -257,6 +257,7 @@ static int mskc_shutdown(device_t); static int mskc_setup_rambuffer(struct msk_softc *); static int mskc_suspend(device_t); static int mskc_resume(device_t); +static bus_dma_tag_t mskc_get_dma_tag(device_t, device_t); static void mskc_reset(struct msk_softc *); static int msk_probe(device_t); @@ -334,6 +335,8 @@ static device_method_t mskc_methods[] = DEVMETHOD(device_resume, mskc_resume), DEVMETHOD(device_shutdown, mskc_shutdown), + DEVMETHOD(bus_get_dma_tag, mskc_get_dma_tag), + DEVMETHOD_END }; @@ -368,9 +371,9 @@ static driver_t msk_driver = { static devclass_t msk_devclass; -DRIVER_MODULE(mskc, pci, mskc_driver, mskc_devclass, 0, 0); -DRIVER_MODULE(msk, mskc, msk_driver, msk_devclass, 0, 0); -DRIVER_MODULE(miibus, msk, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mskc, pci, mskc_driver, mskc_devclass, NULL, NULL); +DRIVER_MODULE(msk, mskc, msk_driver, msk_devclass, NULL, NULL); +DRIVER_MODULE(miibus, msk, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec msk_res_spec_io[] = { { SYS_RES_IOPORT, PCIR_BAR(1), RF_ACTIVE }, @@ -1180,15 +1183,14 @@ msk_ioctl(struct ifnet *ifp, u_long comm static int mskc_probe(device_t dev) { - struct msk_product *mp; + const struct msk_product *mp; uint16_t vendor, devid; int i; vendor = pci_get_vendor(dev); devid = pci_get_device(dev); mp = msk_products; - for (i = 0; i < sizeof(msk_products)/sizeof(msk_products[0]); - i++, mp++) { + for (i = 0; i < nitems(msk_products); i++, mp++) { if (vendor == mp->msk_vendorid && devid == mp->msk_deviceid) { device_set_desc(dev, mp->msk_name); return (BUS_PROBE_DEFAULT); @@ -2118,6 +2120,13 @@ mskc_detach(device_t dev) return (0); } +static bus_dma_tag_t +mskc_get_dma_tag(device_t bus, device_t child __unused) +{ + + return (bus_get_dma_tag(bus)); +} + struct msk_dmamap_arg { bus_addr_t msk_busaddr; }; Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/sk/if_sk.c Thu May 30 12:16:55 2013 (r251133) @@ -143,7 +143,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif -static struct sk_type sk_devs[] = { +static const struct sk_type sk_devs[] = { { VENDORID_SK, DEVICEID_SK_V1, @@ -193,6 +193,7 @@ static int skc_detach(device_t); static int skc_shutdown(device_t); static int skc_suspend(device_t); static int skc_resume(device_t); +static bus_dma_tag_t skc_get_dma_tag(device_t, device_t); static int sk_detach(device_t); static int sk_probe(device_t); static int sk_attach(device_t); @@ -296,6 +297,8 @@ static device_method_t skc_methods[] = { DEVMETHOD(device_resume, skc_resume), DEVMETHOD(device_shutdown, skc_shutdown), + DEVMETHOD(bus_get_dma_tag, skc_get_dma_tag), + DEVMETHOD_END }; @@ -330,9 +333,9 @@ static driver_t sk_driver = { static devclass_t sk_devclass; -DRIVER_MODULE(skc, pci, skc_driver, skc_devclass, 0, 0); -DRIVER_MODULE(sk, skc, sk_driver, sk_devclass, 0, 0); -DRIVER_MODULE(miibus, sk, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(skc, pci, skc_driver, skc_devclass, NULL, NULL); +DRIVER_MODULE(sk, skc, sk_driver, sk_devclass, NULL, NULL); +DRIVER_MODULE(miibus, sk, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec sk_res_spec_io[] = { { SYS_RES_IOPORT, PCIR_BAR(1), RF_ACTIVE }, @@ -1186,7 +1189,7 @@ static int skc_probe(dev) device_t dev; { - struct sk_type *t = sk_devs; + const struct sk_type *t = sk_devs; while(t->sk_name != NULL) { if ((pci_get_vendor(dev) == t->sk_vid) && @@ -1888,6 +1891,13 @@ skc_detach(dev) return(0); } +static bus_dma_tag_t +skc_get_dma_tag(device_t bus, device_t child __unused) +{ + + return (bus_get_dma_tag(bus)); +} + struct sk_dmamap_arg { bus_addr_t sk_busaddr; }; @@ -3185,7 +3195,7 @@ sk_init_xmac(sc_if) struct sk_softc *sc; struct ifnet *ifp; u_int16_t eaddr[(ETHER_ADDR_LEN+1)/2]; - struct sk_bcom_hack bhack[] = { + static const struct sk_bcom_hack bhack[] = { { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, Modified: head/sys/dev/sk/if_skreg.h ============================================================================== --- head/sys/dev/sk/if_skreg.h Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/sk/if_skreg.h Thu May 30 12:16:55 2013 (r251133) @@ -1289,7 +1289,7 @@ struct sk_type { u_int16_t sk_vid; u_int16_t sk_did; - char *sk_name; + const char *sk_name; }; #define SK_ADDR_LO(x) ((u_int64_t) (x) & 0xffffffff) From owner-svn-src-all@FreeBSD.ORG Thu May 30 12:18:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5045E7A6; Thu, 30 May 2013 12:18:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BD507A7B; Thu, 30 May 2013 12:18:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AB6FAB939; Thu, 30 May 2013 08:18:48 -0400 (EDT) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 Date: Thu, 30 May 2013 07:56:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305290421.r4T4LgRc099595@svn.freebsd.org> <51A5E4DE.5060007@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305300756.52601.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 30 May 2013 08:18:48 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:18:52 -0000 On Wednesday, May 29, 2013 1:58:44 pm Adrian Chadd wrote: > No, it actually failed to compile at all on some older 9-stable laptops.. > > Hence my confusion. defines the bool type in HEAD in the KERNEL: #ifdef _KERNEL ... #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus) #define __bool_true_false_are_defined 1 #define false 0 #define true 1 #if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) typedef int _Bool; #endif typedef _Bool bool; #endif /* !__bool_true_false_are_defined && !__cplusplus */ ... -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu May 30 12:25:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B375DBDE; Thu, 30 May 2013 12:25:38 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A990AF1; Thu, 30 May 2013 12:25:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCPcge072912; Thu, 30 May 2013 12:25:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCPcfB072907; Thu, 30 May 2013 12:25:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305301225.r4UCPcfB072907@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 May 2013 12:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251134 - in stable/9: secure/libexec/ssh-keysign share/examples/etc share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:25:38 -0000 Author: des Date: Thu May 30 12:25:37 2013 New Revision: 251134 URL: http://svnweb.freebsd.org/changeset/base/251134 Log: MFH (r248617): retire the mislabeled ENABLE_SUID_SSH knob. Modified: stable/9/secure/libexec/ssh-keysign/Makefile stable/9/share/examples/etc/make.conf stable/9/share/man/man5/make.conf.5 Directory Properties: stable/9/secure/libexec/ssh-keysign/ (props changed) stable/9/share/examples/ (props changed) stable/9/share/examples/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/secure/libexec/ssh-keysign/Makefile ============================================================================== --- stable/9/secure/libexec/ssh-keysign/Makefile Thu May 30 12:16:55 2013 (r251133) +++ stable/9/secure/libexec/ssh-keysign/Makefile Thu May 30 12:25:37 2013 (r251134) @@ -4,9 +4,7 @@ PROG= ssh-keysign SRCS= ssh-keysign.c readconf.c roaming_dummy.c MAN= ssh-keysign.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h -.if defined(ENABLE_SUID_SSH) -BINMODE=4511 -.endif +BINMODE=4555 DPADD= ${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD= -lssh -lcrypt -lcrypto -lz Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Thu May 30 12:16:55 2013 (r251133) +++ stable/9/share/examples/etc/make.conf Thu May 30 12:25:37 2013 (r251134) @@ -96,9 +96,6 @@ # Mtree will follow symlinks #MTREE_FOLLOWS_SYMLINKS= -L # -# To enable installing ssh(1) with the setuid bit turned on -#ENABLE_SUID_SSH= -# # To enable installing newgrp(1) with the setuid bit turned on. # Without the setuid bit, newgrp cannot change users' groups. #ENABLE_SUID_NEWGRP= Modified: stable/9/share/man/man5/make.conf.5 ============================================================================== --- stable/9/share/man/man5/make.conf.5 Thu May 30 12:16:55 2013 (r251133) +++ stable/9/share/man/man5/make.conf.5 Thu May 30 12:25:37 2013 (r251134) @@ -454,11 +454,6 @@ with the set-user-ID bit set. Otherwise, .Xr newgrp 1 will not be able to change users' groups. -.It Va ENABLE_SUID_SSH -.Pq Vt bool -Set this to install -.Xr ssh 1 -with the set-user-ID bit turned on. .It Va LOADER_TFTP_SUPPORT .Pq Vt bool By default the From owner-svn-src-all@FreeBSD.ORG Thu May 30 12:26:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92A56D47; Thu, 30 May 2013 12:26:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8264FAF4; Thu, 30 May 2013 12:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCQ0Zg073019; Thu, 30 May 2013 12:26:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCPxvg072998; Thu, 30 May 2013 12:25:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305301225.r4UCPxvg072998@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 May 2013 12:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251135 - in stable/9: crypto/openssh crypto/openssh/openbsd-compat crypto/openssh/scard secure/lib/libssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:26:00 -0000 Author: des Date: Thu May 30 12:25:58 2013 New Revision: 251135 URL: http://svnweb.freebsd.org/changeset/base/251135 Log: Pull in OpenSSH 6.2p2 from head. Added: stable/9/crypto/openssh/PROTOCOL.krl - copied unchanged from r248619, head/crypto/openssh/PROTOCOL.krl stable/9/crypto/openssh/krl.c - copied, changed from r248619, head/crypto/openssh/krl.c stable/9/crypto/openssh/krl.h - copied unchanged from r248619, head/crypto/openssh/krl.h stable/9/crypto/openssh/openbsd-compat/bsd-setres_id.c - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/bsd-setres_id.c stable/9/crypto/openssh/openbsd-compat/bsd-setres_id.h - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/bsd-setres_id.h stable/9/crypto/openssh/openbsd-compat/strtoull.c - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/strtoull.c stable/9/crypto/openssh/scard/ - copied from r248619, head/crypto/openssh/scard/ stable/9/crypto/openssh/umac128.c - copied, changed from r248619, head/crypto/openssh/umac128.c Deleted: stable/9/crypto/openssh/acss.c stable/9/crypto/openssh/acss.h stable/9/crypto/openssh/cipher-acss.c Modified: stable/9/crypto/openssh/ChangeLog stable/9/crypto/openssh/INSTALL stable/9/crypto/openssh/PROTOCOL stable/9/crypto/openssh/PROTOCOL.agent stable/9/crypto/openssh/README stable/9/crypto/openssh/auth-options.c stable/9/crypto/openssh/auth-rsa.c stable/9/crypto/openssh/auth.c stable/9/crypto/openssh/auth.h stable/9/crypto/openssh/auth1.c stable/9/crypto/openssh/auth2-chall.c stable/9/crypto/openssh/auth2-gss.c stable/9/crypto/openssh/auth2-jpake.c stable/9/crypto/openssh/auth2-pubkey.c stable/9/crypto/openssh/auth2.c stable/9/crypto/openssh/authfile.c stable/9/crypto/openssh/channels.c stable/9/crypto/openssh/cipher-aes.c stable/9/crypto/openssh/cipher-ctr.c stable/9/crypto/openssh/cipher.c stable/9/crypto/openssh/cipher.h stable/9/crypto/openssh/clientloop.c stable/9/crypto/openssh/clientloop.h stable/9/crypto/openssh/compat.c stable/9/crypto/openssh/config.h stable/9/crypto/openssh/config.h.in stable/9/crypto/openssh/defines.h stable/9/crypto/openssh/includes.h stable/9/crypto/openssh/kex.c stable/9/crypto/openssh/kex.h stable/9/crypto/openssh/key.c stable/9/crypto/openssh/key.h stable/9/crypto/openssh/log.c stable/9/crypto/openssh/log.h stable/9/crypto/openssh/loginrec.c stable/9/crypto/openssh/mac.c stable/9/crypto/openssh/moduli stable/9/crypto/openssh/moduli.5 stable/9/crypto/openssh/monitor.c stable/9/crypto/openssh/monitor.h stable/9/crypto/openssh/monitor_wrap.c stable/9/crypto/openssh/mux.c stable/9/crypto/openssh/myproposal.h stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.c stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.h stable/9/crypto/openssh/openbsd-compat/bsd-misc.c stable/9/crypto/openssh/openbsd-compat/bsd-misc.h stable/9/crypto/openssh/openbsd-compat/openbsd-compat.h stable/9/crypto/openssh/openbsd-compat/openssl-compat.h stable/9/crypto/openssh/openbsd-compat/sys-queue.h stable/9/crypto/openssh/openbsd-compat/sys-tree.h stable/9/crypto/openssh/openbsd-compat/vis.c stable/9/crypto/openssh/openbsd-compat/vis.h stable/9/crypto/openssh/packet.c stable/9/crypto/openssh/platform.c stable/9/crypto/openssh/platform.h stable/9/crypto/openssh/readconf.c stable/9/crypto/openssh/readconf.h stable/9/crypto/openssh/scp.1 stable/9/crypto/openssh/scp.c stable/9/crypto/openssh/servconf.c stable/9/crypto/openssh/servconf.h stable/9/crypto/openssh/serverloop.c stable/9/crypto/openssh/session.c stable/9/crypto/openssh/sftp-server.8 stable/9/crypto/openssh/sftp-server.c stable/9/crypto/openssh/sftp.1 stable/9/crypto/openssh/sftp.c stable/9/crypto/openssh/ssh-add.1 stable/9/crypto/openssh/ssh-add.c stable/9/crypto/openssh/ssh-gss.h stable/9/crypto/openssh/ssh-keygen.1 stable/9/crypto/openssh/ssh-keygen.c stable/9/crypto/openssh/ssh-keyscan.1 stable/9/crypto/openssh/ssh.1 stable/9/crypto/openssh/ssh.c stable/9/crypto/openssh/ssh_config stable/9/crypto/openssh/ssh_config.5 stable/9/crypto/openssh/ssh_namespace.h stable/9/crypto/openssh/sshconnect.c stable/9/crypto/openssh/sshconnect2.c stable/9/crypto/openssh/sshd.8 stable/9/crypto/openssh/sshd.c stable/9/crypto/openssh/sshd_config stable/9/crypto/openssh/sshd_config.5 stable/9/crypto/openssh/uidswap.c stable/9/crypto/openssh/umac.c stable/9/crypto/openssh/umac.h stable/9/crypto/openssh/version.h stable/9/secure/lib/libssh/Makefile Directory Properties: stable/9/crypto/openssh/ (props changed) stable/9/secure/lib/libssh/ (props changed) Modified: stable/9/crypto/openssh/ChangeLog ============================================================================== --- stable/9/crypto/openssh/ChangeLog Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/ChangeLog Thu May 30 12:25:58 2013 (r251135) @@ -1,3 +1,709 @@ +20130510 + - (djm) OpenBSD CVS Cherrypick + - djm@cvs.openbsd.org 2013/04/11 02:27:50 + [packet.c] + quiet disconnect notifications on the server from error() back to logit() + if it is a normal client closure; bz#2057 ok+feedback dtucker@ + - (djm) [version.h contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers for release. + +20130404 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/02/17 23:16:57 + [readconf.c ssh.c readconf.h sshconnect2.c] + Keep track of which IndentityFile options were manually supplied and which + were default options, and don't warn if the latter are missing. + ok markus@ + - dtucker@cvs.openbsd.org 2013/02/19 02:12:47 + [krl.c] + Remove bogus include. ok djm + - dtucker@cvs.openbsd.org 2013/02/22 04:45:09 + [ssh.c readconf.c readconf.h] + Don't complain if IdentityFiles specified in system-wide configs are + missing. ok djm, deraadt. + - markus@cvs.openbsd.org 2013/02/22 19:13:56 + [sshconnect.c] + support ProxyCommand=- (stdin/out already point to the proxy); ok djm@ + - djm@cvs.openbsd.org 2013/02/22 22:09:01 + [ssh.c] + Allow IdenityFile=none; ok markus deraadt (and dtucker for an earlier + version) + +20130401 + - (dtucker) [openbsd-compat/bsd-cygwin_util.{c,h}] Don't include windows.h + to avoid conflicting definitions of __int64, adding the required bits. + Patch from Corinna Vinschen. + +20120322 + - (djm) [contrib/ssh-copy-id contrib/ssh-copy-id.1] Updated to Phil + Hands' greatly revised version. + - (djm) Release 6.2p1 + +20120318 + - (djm) [configure.ac log.c scp.c sshconnect2.c openbsd-compat/vis.c] + [openbsd-compat/vis.h] FreeBSD's strnvis isn't compatible with OpenBSD's + so mark it as broken. Patch from des AT des.no + +20120317 + - (tim) [configure.ac] OpenServer 5 wants lastlog even though it has none + of the bits the configure test looks for. + +20120316 + - (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform + is unable to successfully compile them. Based on patch from des AT + des.no + - (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] + Add a usleep replacement for platforms that lack it; ok dtucker + - (djm) [session.c] FreeBSD needs setusercontext(..., LOGIN_SETUMASK) to + occur after UID switch; patch from John Marshall via des AT des.no; + ok dtucker@ + +20120312 + - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] + Improve portability of cipher-speed test, based mostly on a patch from + Iain Morgan. + - (dtucker) [auth.c configure.ac platform.c platform.h] Accept uid 2 ("bin") + in addition to root as an owner of system directories on AIX and HP-UX. + ok djm@ + +20130307 + - (dtucker) [INSTALL] Bump documented autoconf version to what we're + currently using. + - (dtucker) [defines.h] Remove SIZEOF_CHAR bits since the test for it + was removed in configure.ac rev 1.481 as it was redundant. + - (tim) [Makefile.in] Add another missing $(EXEEXT) I should have seen 3 days + ago. + - (djm) [configure.ac] Add a timeout to the select/rlimit test to give it a + chance to complete on broken systems; ok dtucker@ + +20130306 + - (dtucker) [regress/forward-control.sh] Wait longer for the forwarding + connection to start so that the test works on slower machines. + - (dtucker) [configure.ac] test that we can set number of file descriptors + to zero with setrlimit before enabling the rlimit sandbox. This affects + (at least) HPUX 11.11. + +20130305 + - (djm) [regress/modpipe.c] Compilation fix for AIX and parsing fix for + HP/UX. Spotted by Kevin Brott + - (dtucker) [configure.ac] use "=" for shell test and not "==". Spotted by + Amit Kulkarni and Kevin Brott. + - (dtucker) [Makefile.in] Remove trailing "\" on PATHS, which caused obscure + build breakage on (at least) HP-UX 11.11. Found by Amit Kulkarni and Kevin + Brott. + - (tim) [Makefile.in] Add missing $(EXEEXT). Found by Roumen Petrov. + +20130227 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + - (tim) [regress/forward-control.sh] use sh in case login shell is csh. + - (tim) [regress/integrity.sh] shell portability fix. + - (tim) [regress/integrity.sh] keep old solaris awk from hanging. + - (tim) [regress/krl.sh] keep old solaris awk from hanging. + +20130226 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/20 08:27:50 + [integrity.sh] + Add an option to modpipe that warns if the modification offset it not + reached in it's stream and turn it on for t-integrity. This should catch + cases where the session is not fuzzed for being too short (cf. my last + "oops" commit) + - (djm) [regress/integrity.sh] Run sshd via $SUDO; fixes tinderbox breakage + for UsePAM=yes configuration + +20130225 + - (dtucker) [configure.ac ssh-gss.h] bz#2073: additional #includes needed + to use Solaris native GSS libs. Patch from Pierre Ossman. + +20130223 + - (djm) [configure.ac includes.h loginrec.c mux.c sftp.c] Prefer + bsd/libutil.h to libutil.h to avoid deprecation warnings on Ubuntu. + ok tim + +20130222 + - (dtucker) [Makefile.in configure.ac] bz#2072: don't link krb5 libs to + ssh(1) since they're not needed. Patch from Pierre Ossman, ok djm. + - (dtucker) [configure.ac] bz#2073: look for Solaris' differently-named + libgss too. Patch from Pierre Ossman, ok djm. + - (djm) [configure.ac sandbox-seccomp-filter.c] Support for Linux + seccomp-bpf sandbox on ARM. Patch from shawnlandden AT gmail.com; + ok dtucker + +20130221 + - (tim) [regress/forward-control.sh] shell portability fix. + +20130220 + - (tim) [regress/cipher-speed.sh regress/try-ciphers.sh] shell portability fix. + - (tim) [krl.c Makefile.in regress/Makefile regress/modpipe.c] remove unneeded + err.h include from krl.c. Additional portability fixes for modpipe. OK djm + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/20 08:27:50 + [regress/integrity.sh regress/modpipe.c] + Add an option to modpipe that warns if the modification offset it not + reached in it's stream and turn it on for t-integrity. This should catch + cases where the session is not fuzzed for being too short (cf. my last + "oops" commit) + - djm@cvs.openbsd.org 2013/02/20 08:29:27 + [regress/modpipe.c] + s/Id/OpenBSD/ in RCS tag + +20130219 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/18 22:26:47 + [integrity.sh] + crank the offset yet again; it was still fuzzing KEX one of Darren's + portable test hosts at 2800 + - djm@cvs.openbsd.org 2013/02/19 02:14:09 + [integrity.sh] + oops, forgot to increase the output of the ssh command to ensure that + we actually reach $offset + - (djm) [regress/integrity.sh] Skip SHA2-based MACs on configurations that + lack support for SHA2. + - (djm) [regress/modpipe.c] Add local err, and errx functions for platforms + that do not have them. + +20130217 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/17 23:16:55 + [integrity.sh] + make the ssh command generates some output to ensure that there are at + least offset+tries bytes in the stream. + +20130216 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/16 06:08:45 + [integrity.sh] + make sure the fuzz offset is actually past the end of KEX for all KEX + types. diffie-hellman-group-exchange-sha256 requires an offset around + 2700. Noticed via test failures in portable OpenSSH on platforms that + lack ECC and this the more byte-frugal ECDH KEX algorithms. + +20130215 + - (djm) [contrib/suse/rc.sshd] Use SSHD_BIN consistently; bz#2056 from + Iain Morgan + - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] + Use getpgrp() if we don't have getpgid() (old BSDs, maybe others). + - (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoull.c + openbsd-compat/openbsd-compat.h] Add strtoull to compat library for + platforms that don't have it. + - (dtucker) [openbsd-compat/openbsd-compat.h] Add prototype for strtoul, + group strto* function prototypes together. + - (dtucker) [openbsd-compat/bsd-misc.c] Handle the case where setpgrp() takes + an argument. Pointed out by djm. + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/14 21:35:59 + [auth2-pubkey.c] + Correct error message that had a typo and was logging the wrong thing; + patch from Petr Lautrbach + - dtucker@cvs.openbsd.org 2013/02/15 00:21:01 + [sshconnect2.c] + Warn more loudly if an IdentityFile provided by the user cannot be read. + bz #1981, ok djm@ + +20130214 + - (djm) [regress/krl.sh] Don't use ecdsa keys in environment that lack ECC. + - (djm) [regress/krl.sh] typo; found by Iain Morgan + - (djm) [regress/integrity.sh] Start fuzzing from offset 2500 (instead + of 2300) to avoid clobbering the end of (non-MAC'd) KEX. Verified by + Iain Morgan + +20130212 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/24 21:45:37 + [krl.c] + fix handling of (unused) KRL signatures; skip string in correct buffer + - djm@cvs.openbsd.org 2013/01/24 22:08:56 + [krl.c] + skip serial lookup when cert's serial number is zero + - krw@cvs.openbsd.org 2013/01/25 05:00:27 + [krl.c] + Revert last. Breaks due to likely typo. Let djm@ fix later. + ok djm@ via dlg@ + - djm@cvs.openbsd.org 2013/01/25 10:22:19 + [krl.c] + redo last commit without the vi-vomit that snuck in: + skip serial lookup when cert's serial number is zero + (now with 100% better comment) + - djm@cvs.openbsd.org 2013/01/26 06:11:05 + [Makefile.in acss.c acss.h cipher-acss.c cipher.c] + [openbsd-compat/openssl-compat.h] + remove ACSS, now that it is gone from libcrypto too + - djm@cvs.openbsd.org 2013/01/27 10:06:12 + [krl.c] + actually use the xrealloc() return value; spotted by xi.wang AT gmail.com + - dtucker@cvs.openbsd.org 2013/02/06 00:20:42 + [servconf.c sshd_config sshd_config.5] + Change default of MaxStartups to 10:30:100 to start doing random early + drop at 10 connections up to 100 connections. This will make it harder + to DoS as CPUs have come a long way since the original value was set + back in 2000. Prompted by nion at debian org, ok markus@ + - dtucker@cvs.openbsd.org 2013/02/06 00:22:21 + [auth.c] + Fix comment, from jfree.e1 at gmail + - djm@cvs.openbsd.org 2013/02/08 00:41:12 + [sftp.c] + fix NULL deref when built without libedit and control characters + entered as command; debugging and patch from Iain Morgan an + Loganaden Velvindron in bz#1956 + - markus@cvs.openbsd.org 2013/02/10 21:19:34 + [version.h] + openssh 6.2 + - djm@cvs.openbsd.org 2013/02/10 23:32:10 + [ssh-keygen.c] + append to moduli file when screening candidates rather than overwriting. + allows resumption of interrupted screen; patch from Christophe Garault + in bz#1957; ok dtucker@ + - djm@cvs.openbsd.org 2013/02/10 23:35:24 + [packet.c] + record "Received disconnect" messages at ERROR rather than INFO priority, + since they are abnormal and result in a non-zero ssh exit status; patch + from Iain Morgan in bz#2057; ok dtucker@ + - dtucker@cvs.openbsd.org 2013/02/11 21:21:58 + [sshd.c] + Add openssl version to debug output similar to the client. ok markus@ + - djm@cvs.openbsd.org 2013/02/11 23:58:51 + [regress/try-ciphers.sh] + remove acss here too + - (djm) [regress/try-ciphers.sh] clean up CVS merge botch + +20130211 + - (djm) [configure.ac openbsd-compat/openssl-compat.h] Repair build on old + libcrypto that lacks EVP_CIPHER_CTX_ctrl + +20130208 + - (djm) [contrib/redhat/sshd.init] treat RETVAL as an integer; + patch from Iain Morgan in bz#2059 + - (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows + __attribute__ on return values and work around if necessary. ok djm@ + +20130207 + - (djm) [configure.ac] Don't probe seccomp capability of running kernel + at configure time; the seccomp sandbox will fall back to rlimit at + runtime anyway. Patch from plautrba AT redhat.com in bz#2011 + +20130120 + - (djm) [cipher-aes.c cipher-ctr.c openbsd-compat/openssl-compat.h] + Move prototypes for replacement ciphers to openssl-compat.h; fix EVP + prototypes for openssl-1.0.0-fips. + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2013/01/18 07:57:47 + [ssh-keygen.1] + tweak previous; + - jmc@cvs.openbsd.org 2013/01/18 07:59:46 + [ssh-keygen.c] + -u before -V in usage(); + - jmc@cvs.openbsd.org 2013/01/18 08:00:49 + [sshd_config.5] + tweak previous; + - jmc@cvs.openbsd.org 2013/01/18 08:39:04 + [ssh-keygen.1] + add -Q to the options list; ok djm + - jmc@cvs.openbsd.org 2013/01/18 21:48:43 + [ssh-keygen.1] + command-line (adj.) -> command line (n.); + - jmc@cvs.openbsd.org 2013/01/19 07:13:25 + [ssh-keygen.1] + fix some formatting; ok djm + - markus@cvs.openbsd.org 2013/01/19 12:34:55 + [krl.c] + RB_INSERT does not remove existing elments; ok djm@ + - (djm) [openbsd-compat/sys-tree.h] Sync with OpenBSD. krl.c needs newer + version. + - (djm) [regress/krl.sh] replacement for jot; most platforms lack it + +20130118 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/17 23:00:01 + [auth.c key.c key.h ssh-keygen.1 ssh-keygen.c sshd_config.5] + [krl.c krl.h PROTOCOL.krl] + add support for Key Revocation Lists (KRLs). These are a compact way to + represent lists of revoked keys and certificates, taking as little as + a single bit of incremental cost to revoke a certificate by serial number. + KRLs are loaded via the existing RevokedKeys sshd_config option. + feedback and ok markus@ + - djm@cvs.openbsd.org 2013/01/18 00:45:29 + [regress/Makefile regress/cert-userkey.sh regress/krl.sh] + Tests for Key Revocation Lists (KRLs) + - djm@cvs.openbsd.org 2013/01/18 03:00:32 + [krl.c] + fix KRL generation bug for list sections + +20130117 + - (djm) [regress/cipher-speed.sh regress/integrity.sh regress/try-ciphers.sh] + check for GCM support before testing GCM ciphers. + +20130112 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/12 11:22:04 + [cipher.c] + improve error message for integrity failure in AES-GCM modes; ok markus@ + - djm@cvs.openbsd.org 2013/01/12 11:23:53 + [regress/cipher-speed.sh regress/integrity.sh regress/try-ciphers.sh] + test AES-GCM modes; feedback markus@ + - (djm) [regress/integrity.sh] repair botched merge + +20130109 + - (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/12/14 05:26:43 + [auth.c] + use correct string in error message; from rustybsd at gmx.fr + - djm@cvs.openbsd.org 2013/01/02 00:32:07 + [clientloop.c mux.c] + channel_setup_local_fwd_listener() returns 0 on failure, not -ve + bz#2055 reported by mathieu.lacage AT gmail.com + - djm@cvs.openbsd.org 2013/01/02 00:33:49 + [PROTOCOL.agent] + correct format description for SSH_AGENTC_ADD_RSA_ID_CONSTRAINED + bz#2051 from david AT lechnology.com + - djm@cvs.openbsd.org 2013/01/03 05:49:36 + [servconf.h] + add a couple of ServerOptions members that should be copied to the privsep + child (for consistency, in this case they happen only to be accessed in + the monitor); ok dtucker@ + - djm@cvs.openbsd.org 2013/01/03 12:49:01 + [PROTOCOL] + fix description of MAC calculation for EtM modes; ok markus@ + - djm@cvs.openbsd.org 2013/01/03 12:54:49 + [sftp-server.8 sftp-server.c] + allow specification of an alternate start directory for sftp-server(8) + "I like this" markus@ + - djm@cvs.openbsd.org 2013/01/03 23:22:58 + [ssh-keygen.c] + allow fingerprinting of keys hosted in PKCS#11 tokens: ssh-keygen -lD ... + ok markus@ + - jmc@cvs.openbsd.org 2013/01/04 19:26:38 + [sftp-server.8 sftp-server.c] + sftp-server.8: add argument name to -d + sftp-server.c: add -d to usage() + ok djm + - markus@cvs.openbsd.org 2013/01/08 18:49:04 + [PROTOCOL authfile.c cipher.c cipher.h kex.c kex.h monitor_wrap.c] + [myproposal.h packet.c ssh_config.5 sshd_config.5] + support AES-GCM as defined in RFC 5647 (but with simpler KEX handling) + ok and feedback djm@ + - djm@cvs.openbsd.org 2013/01/09 05:40:17 + [ssh-keygen.c] + correctly initialise fingerprint type for fingerprinting PKCS#11 keys + - (djm) [cipher.c configure.ac openbsd-compat/openssl-compat.h] + Fix merge botch, automatically detect AES-GCM in OpenSSL, move a little + cipher compat code to openssl-compat.h + +20121217 + - (dtucker) [Makefile.in] Add some scaffolding so that the new regress + tests will work with VPATH directories. + +20121213 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/12/12 16:45:52 + [packet.c] + reset incoming_packet buffer for each new packet in EtM-case, too; + this happens if packets are parsed only parially (e.g. ignore + messages sent when su/sudo turn off echo); noted by sthen/millert + - naddy@cvs.openbsd.org 2012/12/12 16:46:10 + [cipher.c] + use OpenSSL's EVP_aes_{128,192,256}_ctr() API and remove our hand-rolled + counter mode code; ok djm@ + - (djm) [configure.ac cipher-ctr.c] Adapt EVP AES CTR change to retain our + compat code for older OpenSSL + - (djm) [cipher.c] Fix missing prototype for compat code + +20121212 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/12/11 22:16:21 + [monitor.c] + drain the log messages after receiving the keystate from the unpriv + child. otherwise it might block while sending. ok djm@ + - markus@cvs.openbsd.org 2012/12/11 22:31:18 + [PROTOCOL authfile.c cipher.c cipher.h kex.h mac.c myproposal.h] + [packet.c ssh_config.5 sshd_config.5] + add encrypt-then-mac (EtM) modes to openssh by defining new mac algorithms + that change the packet format and compute the MAC over the encrypted + message (including the packet size) instead of the plaintext data; + these EtM modes are considered more secure and used by default. + feedback and ok djm@ + - sthen@cvs.openbsd.org 2012/12/11 22:51:45 + [mac.c] + fix typo, s/tem/etm in hmac-ripemd160-tem. ok markus@ + - markus@cvs.openbsd.org 2012/12/11 22:32:56 + [regress/try-ciphers.sh] + add etm modes + - markus@cvs.openbsd.org 2012/12/11 22:42:11 + [regress/Makefile regress/modpipe.c regress/integrity.sh] + test the integrity of the packets; with djm@ + - markus@cvs.openbsd.org 2012/12/11 23:12:13 + [try-ciphers.sh] + add hmac-ripemd160-etm@openssh.com + - (djm) [mac.c] fix merge botch + - (djm) [regress/Makefile regress/integrity.sh] Make the integrity.sh test + work on platforms without 'jot' + - (djm) [regress/integrity.sh] Fix awk quoting, packet length skip + - (djm) [regress/Makefile] fix t-exec rule + +20121207 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/12/06 06:06:54 + [regress/keys-command.sh] + Fix some problems with the keys-command test: + - use string comparison rather than numeric comparison + - check for existing KEY_COMMAND file and don't clobber if it exists + - clean up KEY_COMMAND file if we do create it. + - check that KEY_COMMAND is executable (which it won't be if eg /var/run + is mounted noexec). + ok djm. + - jmc@cvs.openbsd.org 2012/12/03 08:33:03 + [ssh-add.1 sshd_config.5] + tweak previous; + - markus@cvs.openbsd.org 2012/12/05 15:42:52 + [ssh-add.c] + prevent double-free of comment; ok djm@ + - dtucker@cvs.openbsd.org 2012/12/07 01:51:35 + [serverloop.c] + Cast signal to int for logging. A no-op on openbsd (they're always ints) + but will prevent warnings in portable. ok djm@ + +20121205 + - (tim) [defines.h] Some platforms are missing ULLONG_MAX. Feedback djm@. + +20121203 + - (djm) [openbsd-compat/sys-queue.h] Sync with OpenBSD to get + TAILQ_FOREACH_SAFE needed for upcoming changes. + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/12/02 20:26:11 + [ssh_config.5 sshconnect2.c] + Make IdentitiesOnly apply to keys obtained from a PKCS11Provider. + This allows control of which keys are offered from tokens using + IdentityFile. ok markus@ + - djm@cvs.openbsd.org 2012/12/02 20:42:15 + [ssh-add.1 ssh-add.c] + make deleting explicit keys "ssh-add -d" symmetric with adding keys - + try to delete the corresponding certificate too and respect the -k option + to allow deleting of the key only; feedback and ok markus@ + - djm@cvs.openbsd.org 2012/12/02 20:46:11 + [auth-options.c channels.c servconf.c servconf.h serverloop.c session.c] + [sshd_config.5] + make AllowTcpForwarding accept "local" and "remote" in addition to its + current "yes"/"no" to allow the server to specify whether just local or + remote TCP forwarding is enabled. ok markus@ + - dtucker@cvs.openbsd.org 2012/10/05 02:20:48 + [regress/cipher-speed.sh regress/try-ciphers.sh] + Add umac-128@openssh.com to the list of MACs to be tested + - djm@cvs.openbsd.org 2012/10/19 05:10:42 + [regress/cert-userkey.sh] + include a serial number when generating certs + - djm@cvs.openbsd.org 2012/11/22 22:49:30 + [regress/Makefile regress/keys-command.sh] + regress for AuthorizedKeysCommand; hints from markus@ + - djm@cvs.openbsd.org 2012/12/02 20:47:48 + [Makefile regress/forward-control.sh] + regress for AllowTcpForwarding local/remote; ok markus@ + - djm@cvs.openbsd.org 2012/12/03 00:14:06 + [auth2-chall.c ssh-keygen.c] + Fix compilation with -Wall -Werror (trivial type fixes) + - (djm) [configure.ac] Turn on -g for gcc compilers. Helps pre-installation + debugging. ok dtucker@ + - (djm) [configure.ac] Revert previous. configure.ac already does this + for us. + +20121114 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/11/14 02:24:27 + [auth2-pubkey.c] + fix username passed to helper program + prepare stdio fds before closefrom() + spotted by landry@ + - djm@cvs.openbsd.org 2012/11/14 02:32:15 + [ssh-keygen.c] + allow the full range of unsigned serial numbers; 'fine' deraadt@ + - djm@cvs.openbsd.org 2012/12/02 20:34:10 + [auth.c auth.h auth1.c auth2-chall.c auth2-gss.c auth2-jpake.c auth2.c] + [monitor.c monitor.h] + Fixes logging of partial authentication when privsep is enabled + Previously, we recorded "Failed xxx" since we reset authenticated before + calling auth_log() in auth2.c. This adds an explcit "Partial" state. + + Add a "submethod" to auth_log() to report which submethod is used + for keyboard-interactive. + + Fix multiple authentication when one of the methods is + keyboard-interactive. + + ok markus@ + - dtucker@cvs.openbsd.org 2012/10/05 02:05:30 + [regress/multiplex.sh] + Use 'kill -0' to test for the presence of a pid since it's more portable + +20121107 + - (djm) OpenBSD CVS Sync + - eric@cvs.openbsd.org 2011/11/28 08:46:27 + [moduli.5] + fix formula + ok djm@ + - jmc@cvs.openbsd.org 2012/09/26 17:34:38 + [moduli.5] + last stage of rfc changes, using consistent Rs/Re blocks, and moving the + references into a STANDARDS section; + +20121105 + - (dtucker) [uidswap.c openbsd-compat/Makefile.in + openbsd-compat/bsd-setres_id.c openbsd-compat/bsd-setres_id.h + openbsd-compat/openbsd-compat.h] Move the fallback code for setting uids + and gids from uidswap.c to the compat library, which allows it to work with + the new setresuid calls in auth2-pubkey. with tim@, ok djm@ + - (dtucker) [auth2-pubkey.c] wrap paths.h in an ifdef for platforms that + don't have it. Spotted by tim@. + +20121104 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2012/10/31 08:04:50 + [sshd_config.5] + tweak previous; + - djm@cvs.openbsd.org 2012/11/04 10:38:43 + [auth2-pubkey.c sshd.c sshd_config.5] + Remove default of AuthorizedCommandUser. Administrators are now expected + to explicitly specify a user. feedback and ok markus@ + - djm@cvs.openbsd.org 2012/11/04 11:09:15 + [auth.h auth1.c auth2.c monitor.c servconf.c servconf.h sshd.c] + [sshd_config.5] + Support multiple required authentication via an AuthenticationMethods + option. This option lists one or more comma-separated lists of + authentication method names. Successful completion of all the methods in + any list is required for authentication to complete; + feedback and ok markus@ + +20121030 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/10/05 12:34:39 + [sftp.c] + fix signed vs unsigned warning; feedback & ok: djm@ + - djm@cvs.openbsd.org 2012/10/30 21:29:55 + [auth-rsa.c auth.c auth.h auth2-pubkey.c servconf.c servconf.h] + [sshd.c sshd_config sshd_config.5] + new sshd_config option AuthorizedKeysCommand to support fetching + authorized_keys from a command in addition to (or instead of) from + the filesystem. The command is run as the target server user unless + another specified via a new AuthorizedKeysCommandUser option. + + patch originally by jchadima AT redhat.com, reworked by me; feedback + and ok markus@ + +20121019 + - (tim) [buildpkg.sh.in] Double up on some backslashes so they end up in + the generated file as intended. + +20121005 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/09/17 09:54:44 + [sftp.c] + an XXX for later + - markus@cvs.openbsd.org 2012/09/17 13:04:11 + [packet.c] + clear old keys on rekeing; ok djm + - dtucker@cvs.openbsd.org 2012/09/18 10:36:12 + [sftp.c] + Add bounds check on sftp tab-completion. Part of a patch from from + Jean-Marc Robert via tech@, ok djm + - dtucker@cvs.openbsd.org 2012/09/21 10:53:07 + [sftp.c] + Fix improper handling of absolute paths when PWD is part of the completed + path. Patch from Jean-Marc Robert via tech@, ok djm. + - dtucker@cvs.openbsd.org 2012/09/21 10:55:04 + [sftp.c] + Fix handling of filenames containing escaped globbing characters and + escape "#" and "*". Patch from Jean-Marc Robert via tech@, ok djm. + - jmc@cvs.openbsd.org 2012/09/26 16:12:13 + [ssh.1] + last stage of rfc changes, using consistent Rs/Re blocks, and moving the + references into a STANDARDS section; + - naddy@cvs.openbsd.org 2012/10/01 13:59:51 + [monitor_wrap.c] + pasto; ok djm@ + - djm@cvs.openbsd.org 2012/10/02 07:07:45 + [ssh-keygen.c] + fix -z option, broken in revision 1.215 + - markus@cvs.openbsd.org 2012/10/04 13:21:50 + [myproposal.h ssh_config.5 umac.h sshd_config.5 ssh.1 sshd.8 mac.c] + add umac128 variant; ok djm@ at n2k12 + - dtucker@cvs.openbsd.org 2012/09/06 04:11:07 + [regress/try-ciphers.sh] + Restore missing space. (Id sync only). + - dtucker@cvs.openbsd.org 2012/09/09 11:51:25 + [regress/multiplex.sh] + Add test for ssh -Ostop + - dtucker@cvs.openbsd.org 2012/09/10 00:49:21 + [regress/multiplex.sh] + Log -O cmd output to the log file and make logging consistent with the + other tests. Test clean shutdown of an existing channel when testing + "stop". + - dtucker@cvs.openbsd.org 2012/09/10 01:51:19 + [regress/multiplex.sh] + use -Ocheck and waiting for completions by PID to make multiplexing test + less racy and (hopefully) more reliable on slow hardware. + - [Makefile umac.c] Add special-case target to build umac128.o. + - [umac.c] Enforce allowed umac output sizes. From djm@. + - [Makefile.in] "Using $< in a non-suffix rule context is a GNUmake idiom". + +20120917 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/09/13 23:37:36 + [servconf.c] + Fix comment line length + - markus@cvs.openbsd.org 2012/09/14 16:51:34 + [sshconnect.c] + remove unused variable + +20120907 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/09/06 09:50:13 + [clientloop.c] + Make the escape command help (~?) context sensitive so that only commands + that will work in the current session are shown. ok markus@ + - jmc@cvs.openbsd.org 2012/09/06 13:57:42 + [ssh.1] + missing letter in previous; + - dtucker@cvs.openbsd.org 2012/09/07 00:30:19 + [clientloop.c] + Print '^Z' instead of a raw ^Z when the sequence is not supported. ok djm@ + - dtucker@cvs.openbsd.org 2012/09/07 01:10:21 + [clientloop.c] + Merge escape help text for ~v and ~V; ok djm@ + - dtucker@cvs.openbsd.org 2012/09/07 06:34:21 + [clientloop.c] + when muxmaster is run with -N, make it shut down gracefully when a client + sends it "-O stop" rather than hanging around (bz#1985). ok djm@ + +20120906 + - (dtucker) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2012/08/15 18:25:50 + [ssh-keygen.1] + a little more info on certificate validity; + requested by Ross L Richardson, and provided by djm + - dtucker@cvs.openbsd.org 2012/08/17 00:45:45 + [clientloop.c clientloop.h mux.c] + Force a clean shutdown of ControlMaster client sessions when the ~. escape + sequence is used. This means that ~. should now work in mux clients even + if the server is no longer responding. Found by tedu, ok djm. + - djm@cvs.openbsd.org 2012/08/17 01:22:56 + [kex.c] + add some comments about better handling first-KEX-follows notifications + from the server. Nothing uses these right now. No binary change + - djm@cvs.openbsd.org 2012/08/17 01:25:58 + [ssh-keygen.c] + print details of which host lines were deleted when using + "ssh-keygen -R host"; ok markus@ + - djm@cvs.openbsd.org 2012/08/17 01:30:00 + [compat.c sshconnect.c] + Send client banner immediately, rather than waiting for the server to + move first for SSH protocol 2 connections (the default). Patch based on + one in bz#1999 by tls AT panix.com, feedback dtucker@ ok markus@ + - dtucker@cvs.openbsd.org 2012/09/06 04:37:39 + [clientloop.c log.c ssh.1 log.h] + Add ~v and ~V escape sequences to raise and lower the logging level + respectively. Man page help from jmc, ok deraadt jmc + +20120830 + - (dtucker) [moduli] Import new moduli file. + 20120828 - (djm) Release openssh-6.1 @@ -172,6 +878,7 @@ [dns.c dns.h key.c key.h ssh-keygen.c] add support for RFC6594 SSHFP DNS records for ECDSA key types. patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@ + (Original authors OndÅ™ej Surý, OndÅ™ej Caletka and Daniel Black) - djm@cvs.openbsd.org 2012/06/01 00:49:35 [PROTOCOL.mux] correct types of port numbers (integers, not strings); bz#2004 from Modified: stable/9/crypto/openssh/INSTALL ============================================================================== --- stable/9/crypto/openssh/INSTALL Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/INSTALL Thu May 30 12:25:58 2013 (r251135) @@ -89,7 +89,7 @@ http://nlnetlabs.nl/projects/ldns/ Autoconf: If you modify configure.ac or configure doesn't exist (eg if you checked -the code out of CVS yourself) then you will need autoconf-2.61 to rebuild +the code out of CVS yourself) then you will need autoconf-2.68 to rebuild the automatically generated files by running "autoreconf". Earlier versions may also work but this is not guaranteed. @@ -266,4 +266,4 @@ Please refer to the "reporting bugs" sec http://www.openssh.com/ -$Id: INSTALL,v 1.87 2011/11/04 00:25:25 dtucker Exp $ +$Id: INSTALL,v 1.88 2013/03/07 01:33:35 dtucker Exp $ Modified: stable/9/crypto/openssh/PROTOCOL ============================================================================== --- stable/9/crypto/openssh/PROTOCOL Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/PROTOCOL Thu May 30 12:25:58 2013 (r251135) @@ -51,6 +51,46 @@ and ecdsa-sha2-nistp521 curves over GF(p curve points encoded using point compression are NOT accepted or generated. +1.5 transport: Protocol 2 Encrypt-then-MAC MAC algorithms + +OpenSSH supports MAC algorithms, whose names contain "-etm", that +perform the calculations in a different order to that defined in RFC +4253. These variants use the so-called "encrypt then MAC" ordering, +calculating the MAC over the packet ciphertext rather than the +plaintext. This ordering closes a security flaw in the SSH transport +protocol, where decryption of unauthenticated ciphertext provided a +"decryption oracle" that could, in conjunction with cipher flaws, reveal +session plaintext. + +Specifically, the "-etm" MAC algorithms modify the transport protocol +to calculate the MAC over the packet ciphertext and to send the packet +length unencrypted. This is necessary for the transport to obtain the +length of the packet and location of the MAC tag so that it may be +verified without decrypting unauthenticated data. + +As such, the MAC covers: + + mac = MAC(key, sequence_number || packet_length || encrypted_packet) + +where "packet_length" is encoded as a uint32 and "encrypted_packet" +contains: + + byte padding_length + byte[n1] payload; n1 = packet_length - padding_length - 1 + byte[n2] random padding; n2 = padding_length + +1.6 transport: AES-GCM + +OpenSSH supports the AES-GCM algorithm as specified in RFC 5647. +Because of problems with the specification of the key exchange +the behaviour of OpenSSH differs from the RFC as follows: + +AES-GCM is only negotiated as the cipher algorithms +"aes128-gcm@openssh.com" or "aes256-gcm@openssh.com" and never as +an MAC algorithm. Additionally, if AES-GCM is selected as the cipher +the exchanged MAC algorithms are ignored and there doesn't have to be +a matching MAC. + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" @@ -291,4 +331,4 @@ link(oldpath, newpath) and will respond This extension is advertised in the SSH_FXP_VERSION hello with version "1". -$OpenBSD: PROTOCOL,v 1.17 2010/12/04 00:18:01 djm Exp $ +$OpenBSD: PROTOCOL,v 1.20 2013/01/08 18:49:04 markus Exp $ Modified: stable/9/crypto/openssh/PROTOCOL.agent ============================================================================== --- stable/9/crypto/openssh/PROTOCOL.agent Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/PROTOCOL.agent Thu May 30 12:25:58 2013 (r251135) @@ -152,7 +152,7 @@ fully specified using just rsa_q, rsa_p computation. "key_constraints" may only be present if the request type is -SSH_AGENTC_ADD_RSA_IDENTITY. +SSH_AGENTC_ADD_RSA_ID_CONSTRAINED. The agent will reply with a SSH_AGENT_SUCCESS if the key has been successfully added or a SSH_AGENT_FAILURE if an error occurred. @@ -557,4 +557,4 @@ Locking and unlocking affects both proto SSH_AGENT_CONSTRAIN_LIFETIME 1 SSH_AGENT_CONSTRAIN_CONFIRM 2 -$OpenBSD: PROTOCOL.agent,v 1.6 2010/08/31 11:54:45 djm Exp $ +$OpenBSD: PROTOCOL.agent,v 1.7 2013/01/02 00:33:49 djm Exp $ Copied: stable/9/crypto/openssh/PROTOCOL.krl (from r248619, head/crypto/openssh/PROTOCOL.krl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/crypto/openssh/PROTOCOL.krl Thu May 30 12:25:58 2013 (r251135, copy of r248619, head/crypto/openssh/PROTOCOL.krl) @@ -0,0 +1,164 @@ +This describes the key/certificate revocation list format for OpenSSH. + +1. Overall format + +The KRL consists of a header and zero or more sections. The header is: + +#define KRL_MAGIC 0x5353484b524c0a00ULL /* "SSHKRL\n\0" */ +#define KRL_FORMAT_VERSION 1 + + uint64 KRL_MAGIC + uint32 KRL_FORMAT_VERSION + uint64 krl_version + uint64 generated_date + uint64 flags + string reserved + string comment + +Where "krl_version" is a version number that increases each time the KRL +is modified, "generated_date" is the time in seconds since 1970-01-01 +00:00:00 UTC that the KRL was generated, "comment" is an optional comment +and "reserved" an extension field whose contents are currently ignored. +No "flags" are currently defined. + +Following the header are zero or more sections, each consisting of: + + byte section_type + string section_data + +Where "section_type" indicates the type of the "section_data". An exception +to this is the KRL_SECTION_SIGNATURE section, that has a slightly different +format (see below). + +The available section types are: + +#define KRL_SECTION_CERTIFICATES 1 +#define KRL_SECTION_EXPLICIT_KEY 2 +#define KRL_SECTION_FINGERPRINT_SHA1 3 +#define KRL_SECTION_SIGNATURE 4 + +3. Certificate serial section + +These sections use type KRL_SECTION_CERTIFICATES to revoke certificates by +serial number or key ID. The consist of the CA key that issued the +certificates to be revoked and a reserved field whose contents is currently +ignored. + + string ca_key + string reserved + +Followed by one or more sections: + + byte cert_section_type + string cert_section_data + +The certificate section types are: + +#define KRL_SECTION_CERT_SERIAL_LIST 0x20 +#define KRL_SECTION_CERT_SERIAL_RANGE 0x21 +#define KRL_SECTION_CERT_SERIAL_BITMAP 0x22 +#define KRL_SECTION_CERT_KEY_ID 0x23 + +2.1 Certificate serial list section + +This section is identified as KRL_SECTION_CERT_SERIAL_LIST. It revokes +certificates by listing their serial numbers. The cert_section_data in this +case contains: + + uint64 revoked_cert_serial + uint64 ... + +This section may appear multiple times. + +2.2. Certificate serial range section + +These sections use type KRL_SECTION_CERT_SERIAL_RANGE and hold +a range of serial numbers of certificates: + + uint64 serial_min + uint64 serial_max + +All certificates in the range serial_min <= serial <= serial_max are +revoked. + +This section may appear multiple times. + +2.3. Certificate serial bitmap section + +Bitmap sections use type KRL_SECTION_CERT_SERIAL_BITMAP and revoke keys +by listing their serial number in a bitmap. + + uint64 serial_offset + mpint revoked_keys_bitmap + +A bit set at index N in the bitmap corresponds to revocation of a keys with +serial number (serial_offset + N). + +This section may appear multiple times. + +2.4. Revoked key ID sections + +KRL_SECTION_CERT_KEY_ID sections revoke particular certificate "key +ID" strings. This may be useful in revoking all certificates +associated with a particular identity, e.g. a host or a user. + + string key_id[0] + ... + +This section must contain at least one "key_id". This section may appear +multiple times. + +3. Explicit key sections + +These sections, identified as KRL_SECTION_EXPLICIT_KEY, revoke keys +(not certificates). They are less space efficient than serial numbers, +but are able to revoke plain keys. + + string public_key_blob[0] + .... + +This section must contain at least one "public_key_blob". The blob +must be a raw key (i.e. not a certificate). + +This section may appear multiple times. + +4. SHA1 fingerprint sections + +These sections, identified as KRL_SECTION_FINGERPRINT_SHA1, revoke +plain keys (i.e. not certificates) by listing their SHA1 hashes: + + string public_key_hash[0] + .... + +This section must contain at least one "public_key_hash". The hash blob +is obtained by taking the SHA1 hash of the public key blob. Hashes in +this section must appear in numeric order, treating each hash as a big- +endian integer. + +This section may appear multiple times. + +5. KRL signature sections + +The KRL_SECTION_SIGNATURE section serves a different purpose to the +preceeding ones: to provide cryptographic authentication of a KRL that +is retrieved over a channel that does not provide integrity protection. +Its format is slightly different to the previously-described sections: +in order to simplify the signature generation, it includes as a "body" +two string components instead of one. + + byte KRL_SECTION_SIGNATURE + string signature_key + string signature + +The signature is calculated over the entire KRL from the KRL_MAGIC +to this subsection's "signature_key", including both and using the +signature generation rules appropriate for the type of "signature_key". + +This section must appear last in the KRL. If multiple signature sections +appear, they must appear consecutively at the end of the KRL file. + +Implementations that retrieve KRLs over untrusted channels must verify +signatures. Signature sections are optional for KRLs distributed by +trusted means. + +$OpenBSD: PROTOCOL.krl,v 1.2 2013/01/18 00:24:58 djm Exp $ Modified: stable/9/crypto/openssh/README ============================================================================== --- stable/9/crypto/openssh/README Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/README Thu May 30 12:25:58 2013 (r251135) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.1 for the release notes. +See http://www.openssh.com/txt/release-6.2p2 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.81 2012/08/22 11:57:13 djm Exp $ +$Id: README,v 1.82.2.1 2013/05/10 06:12:54 djm Exp $ Modified: stable/9/crypto/openssh/auth-options.c ============================================================================== --- stable/9/crypto/openssh/auth-options.c Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/auth-options.c Thu May 30 12:25:58 2013 (r251135) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.56 2011/10/18 04:58:26 djm Exp $ */ +/* $OpenBSD: auth-options.c,v 1.57 2012/12/02 20:46:11 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -349,7 +349,7 @@ auth_parse_options(struct passwd *pw, ch xfree(patterns); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 13:10:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72B7DEED; Thu, 30 May 2013 13:10:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 637E2F3B; Thu, 30 May 2013 13:10:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UDAdZX089844; Thu, 30 May 2013 13:10:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UDAcBq089837; Thu, 30 May 2013 13:10:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201305301310.r4UDAcBq089837@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 30 May 2013 13:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251136 - in vendor/byacc/dist: . package package/debian test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 13:10:39 -0000 Author: bapt Date: Thu May 30 13:10:38 2013 New Revision: 251136 URL: http://svnweb.freebsd.org/changeset/base/251136 Log: Import byacc 20130304 Modified: vendor/byacc/dist/CHANGES vendor/byacc/dist/VERSION vendor/byacc/dist/aclocal.m4 vendor/byacc/dist/config.guess vendor/byacc/dist/config.sub vendor/byacc/dist/config_h.in vendor/byacc/dist/configure vendor/byacc/dist/configure.in vendor/byacc/dist/main.c vendor/byacc/dist/makefile.in vendor/byacc/dist/output.c vendor/byacc/dist/package/byacc.spec vendor/byacc/dist/package/debian/changelog vendor/byacc/dist/skeleton.c vendor/byacc/dist/test/calc.tab.c vendor/byacc/dist/test/calc1.tab.c vendor/byacc/dist/test/calc1.y vendor/byacc/dist/test/calc2.tab.c vendor/byacc/dist/test/calc3.tab.c vendor/byacc/dist/test/code_calc.code.c vendor/byacc/dist/test/code_error.code.c vendor/byacc/dist/test/error.tab.c vendor/byacc/dist/test/ftp.output vendor/byacc/dist/test/ftp.tab.c vendor/byacc/dist/test/ftp.tab.h vendor/byacc/dist/test/ftp.y vendor/byacc/dist/test/grammar.tab.c vendor/byacc/dist/test/pure_calc.tab.c vendor/byacc/dist/test/pure_error.tab.c vendor/byacc/dist/test/quote_calc-s.tab.c vendor/byacc/dist/test/quote_calc.tab.c vendor/byacc/dist/test/quote_calc2-s.tab.c vendor/byacc/dist/test/quote_calc2.tab.c vendor/byacc/dist/test/quote_calc3-s.tab.c vendor/byacc/dist/test/quote_calc3.tab.c vendor/byacc/dist/test/quote_calc4-s.tab.c vendor/byacc/dist/test/quote_calc4.tab.c Modified: vendor/byacc/dist/CHANGES ============================================================================== --- vendor/byacc/dist/CHANGES Thu May 30 12:25:58 2013 (r251135) +++ vendor/byacc/dist/CHANGES Thu May 30 13:10:38 2013 (r251136) @@ -1,3 +1,117 @@ +2013-03-04 Thomas E. Dickey + + * package/debian/changelog, VERSION, package/byacc.spec: bump + + * aclocal.m4: + adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf. + + * output.c: + fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton). + also while testing that, found a case where the union_file is unused; added + a check for address that. + + * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen + + * test/ftp.y: fix most compiler warnings for "make check_make" + + * test/calc1.tab.c: regen + + * test/calc1.y: fix most compiler warnings for "make check_make" + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: quiet a gcc conversion-warning in yygrowstack() + + * configure: regen + + * aclocal.m4: + another fix for CF_GCC_VERSION to handle Debian's modification of gcc message. + +2013-02-10 Thomas E. Dickey + + * config.sub, config.guess: 2013-02-04 + +2012-10-03 Thomas E. Dickey + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * configure: regen + + * configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC + + * aclocal.m4: + moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc) + the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor. + + * aclocal.m4, configure.in: + Arian's change dropped my check for misused $CC variable - restore that with + alternate macro CF_PROG_CC. + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since + they are not needed. + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in + Adrian's suggested changes. + + * aclocal.m4: + CF_CLANG_COMPILER - check if the given compiler is really clang. + + * aclocal.m4: + add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around + old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1 + on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's + pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work + around by excluding that check for pre-3.x compilers. + + * aclocal.m4: + modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions + provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather + than appending to confdefs.h, since long-ago concern about the ability to + pass-through parameterized macros appears to be not a problem, testing with + 2.13 and 2.52 + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by + autoheader, updated macros: + CF_CHECK_CACHE + CF_DISABLE_LEAKS + CF_MKSTEMP + CF_MIXEDCASE_FILENAMES + CF_NO_LEAKS_OPTION + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + move existence-check for mkstemp out of the AC_TRY_RUN, to help with + cross-compiles + +2012-10-02 Thomas E. Dickey + + * config_h.in: + Adrian Bunk request - replace this with the output from autoheader + +2012-09-29 Adrian.Bunk + + * configure.in: + suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no + check is needed anymore for standard C compilers), drop AC_CONST (same + reason), modify AC_OUTPUT to rely upon template generated by autoheader. + bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT + as being obsolete with autoconf 2.52x + + * configure.in, main.c: drop check for atexit, because it is standard C + + * makefile.in: add assignment for datarootdir variable. + 2012-05-26 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump Modified: vendor/byacc/dist/VERSION ============================================================================== --- vendor/byacc/dist/VERSION Thu May 30 12:25:58 2013 (r251135) +++ vendor/byacc/dist/VERSION Thu May 30 13:10:38 2013 (r251136) @@ -1 +1 @@ -20120526 +20130304 Modified: vendor/byacc/dist/aclocal.m4 ============================================================================== --- vendor/byacc/dist/aclocal.m4 Thu May 30 12:25:58 2013 (r251135) +++ vendor/byacc/dist/aclocal.m4 Thu May 30 13:10:38 2013 (r251136) @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.19 2012/01/13 14:10:56 tom Exp $ +dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2011,2012 Thomas E. Dickey +dnl Copyright 2004-2012,2013 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -28,6 +28,32 @@ dnl sale, use or other dealings in this dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl ------------------ +dnl Conditionally generate script according to whether we're using a given autoconf. +dnl +dnl $1 = version to compare against +dnl $2 = code to use if AC_ACVERSION is at least as high as $1. +dnl $3 = code to use if AC_ACVERSION is older than $1. +define([CF_ACVERSION_CHECK], +[ +ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([m4_version_compare], +[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], +[CF_ACVERSION_COMPARE( +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 +dnl -------------------- +dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, +dnl MAJOR2, MINOR2, TERNARY2, +dnl PRINTABLE2, not FOUND, FOUND) +define([CF_ACVERSION_COMPARE], +[ifelse(builtin([eval], [$2 < $5]), 1, +[ifelse([$8], , ,[$8])], +[ifelse([$9], , ,[$9])])])dnl +dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS @@ -116,97 +142,6 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45 -dnl ---------------- -dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and -dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution. -AC_DEFUN([CF_ANSI_CC_CHECK], -[ -# This should have been defined by AC_PROG_CC -: ${CC:=cc} - -# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content -# into CC. This will not help with broken scripts that wrap the compiler with -# options, but eliminates a more common category of user confusion. -AC_MSG_CHECKING(\$CC variable) -case "$CC" in #(vi -*[[\ \ ]]-[[IUD]]*) - AC_MSG_RESULT(broken) - AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) - # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` - CC=`echo "$CC" | sed -e 's/[[ ]].*//'` - CF_ADD_CFLAGS($cf_flags) - ;; -*) - AC_MSG_RESULT(ok) - ;; -esac - -AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do - CF_ADD_CFLAGS($cf_arg) - AC_TRY_COMPILE( -[ -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif -],[ - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);};], - [cf_cv_ansi_cc="$cf_arg"; break]) -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" -]) - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CF_ADD_CFLAGS($cf_cv_ansi_cc) -else - AC_DEFINE(CC_HAS_PROTOS) -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 -dnl --------------- -dnl For programs that must use an ANSI compiler, obtain compiler options that -dnl will make it recognize prototypes. We'll do preprocessor checks in other -dnl macros, since tools such as unproto can fake prototypes, but only part of -dnl the preprocessor. -AC_DEFUN([CF_ANSI_CC_REQD], -[AC_REQUIRE([CF_ANSI_CC_CHECK]) -if test "$cf_cv_ansi_cc" = "no"; then - AC_MSG_ERROR( -[Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto]) -fi -])dnl -dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. @@ -236,7 +171,33 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 +dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49 +dnl --------------- +dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content +dnl into CC. This will not help with broken scripts that wrap the compiler with +dnl options, but eliminates a more common category of user confusion. +AC_DEFUN([CF_CC_ENV_FLAGS], +[ +# This should have been defined by AC_PROG_CC +: ${CC:=cc} + +AC_MSG_CHECKING(\$CC variable) +case "$CC" in #(vi +*[[\ \ ]]-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + # humor him... + cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` + CC=`echo "$CC" | sed -e 's/[[ ]].*//'` + CF_ADD_CFLAGS($cf_flags) + ;; +*) + AC_MSG_RESULT(ok) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -259,7 +220,7 @@ else system_name="`(hostname) 2>/dev/null`" fi fi -test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" @@ -271,7 +232,40 @@ if test ".$system_name" != ".$cf_cv_syst fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57 +dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39 +dnl ----------------- +dnl Check if the given compiler is really clang. clang's C driver defines +dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does +dnl not ignore some gcc options. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_CLANG_COMPILER],[ +ifelse([$2],,CLANG_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) + cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" + ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" + AC_TRY_COMPILE([],[ +#ifdef __clang__ +#else +make an error +#endif +],[ifelse([$2],,CLANG_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. @@ -286,7 +280,7 @@ dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, - [ --disable-echo display "compiling" commands], + [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' @@ -308,7 +302,7 @@ AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 +dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -326,12 +320,12 @@ AC_ARG_ENABLE(leaks, AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then - AC_DEFINE(NO_LEAKS) - AC_DEFINE(YY_NO_LEAKS) + AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) + AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -409,27 +403,27 @@ EOF test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute) cat conftest.h >>confdefs.h case $cf_attribute in #(vi + noreturn) #(vi + AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) + ;; printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 +dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], - [AC_DEFINE($3)ifelse([$4],,[ + [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} @@ -858,29 +863,17 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 -dnl ----------- -dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. -AC_DEFUN([CF_PROG_EXT], -[ -AC_REQUIRE([CF_CHECK_CACHE]) -case $cf_cv_system_name in -os2*) - CFLAGS="$CFLAGS -Zmt" - CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt" - # autoconf's macro sets -Zexe and suffix both, which conflict:w - LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" - ac_cv_exeext=.exe - ;; -esac - -AC_EXEEXT -AC_OBJEXT - -PROG_EXT="$EXEEXT" -AC_SUBST(PROG_EXT) -test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") +dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl ---------- +dnl standard check for CC, plus followup sanity checks +dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name +AC_DEFUN([CF_PROG_CC],[ +ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) +CF_GCC_VERSION +CF_ACVERSION_CHECK(2.52, + [AC_PROG_CC_STDC], + [CF_ANSI_CC_REQD]) +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 @@ -1025,7 +1018,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49 +dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1035,6 +1028,7 @@ dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ +AC_REQUIRE([AC_CANONICAL_HOST]) cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) Modified: vendor/byacc/dist/config.guess ============================================================================== --- vendor/byacc/dist/config.guess Thu May 30 12:25:58 2013 (r251135) +++ vendor/byacc/dist/config.guess Thu May 30 13:10:38 2013 (r251136) @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2911 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2011-01-01' +timestamp='2013-02-04' # This file 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 +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,26 +15,22 @@ timestamp='2011-01-01' # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +137,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -202,6 +194,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -220,10 +216,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) + *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac @@ -304,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -600,50 +596,50 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -792,21 +788,26 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,15 +862,22 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi @@ -877,30 +885,39 @@ EOF exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ - grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif @@ -937,7 +954,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -972,13 +989,13 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1096,7 +1113,7 @@ EOF && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1139,8 +1156,8 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) @@ -1168,9 +1185,9 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1185,6 +1202,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1215,12 +1235,12 @@ EOF i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi fi ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 13:11:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71EA32F7; Thu, 30 May 2013 13:11:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A800F75; Thu, 30 May 2013 13:11:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UDBvuu090191; Thu, 30 May 2013 13:11:57 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UDBvJI090190; Thu, 30 May 2013 13:11:57 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201305301311.r4UDBvJI090190@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 30 May 2013 13:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251137 - vendor/byacc/20130304 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 13:11:57 -0000 Author: bapt Date: Thu May 30 13:11:56 2013 New Revision: 251137 URL: http://svnweb.freebsd.org/changeset/base/251137 Log: Tag byacc 20130304 Added: vendor/byacc/20130304/ - copied from r251136, vendor/byacc/dist/ From owner-svn-src-all@FreeBSD.ORG Thu May 30 13:41:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 191B9AF8; Thu, 30 May 2013 13:41:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8BF229; Thu, 30 May 2013 13:41:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UDfJ6R000340; Thu, 30 May 2013 13:41:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UDfJeC000339; Thu, 30 May 2013 13:41:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301341.r4UDfJeC000339@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 13:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251138 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 13:41:20 -0000 Author: luigi Date: Thu May 30 13:41:19 2013 New Revision: 251138 URL: http://svnweb.freebsd.org/changeset/base/251138 Log: clarify usage of NETMAP_BUF Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Thu May 30 13:11:56 2013 (r251137) +++ head/sys/net/netmap_user.h Thu May 30 13:41:19 2013 (r251138) @@ -51,8 +51,8 @@ * ring->slot[i] gives us the i-th slot (we can access * directly plen, flags, bufindex) * - * char *buf = NETMAP_BUF(ring, index) returns a pointer to - * the i-th buffer + * char *buf = NETMAP_BUF(ring, x) returns a pointer to + * the buffer numbered x * * Since rings are circular, we have macros to compute the next index * i = NETMAP_RING_NEXT(ring, i); From owner-svn-src-all@FreeBSD.ORG Thu May 30 14:07:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 885718B8; Thu, 30 May 2013 14:07:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3DC605; Thu, 30 May 2013 14:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UE7E4x008730; Thu, 30 May 2013 14:07:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UE7E8j008728; Thu, 30 May 2013 14:07:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301407.r4UE7E8j008728@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 14:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251139 - in head: sys/dev/netmap sys/net tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 14:07:14 -0000 Author: luigi Date: Thu May 30 14:07:14 2013 New Revision: 251139 URL: http://svnweb.freebsd.org/changeset/base/251139 Log: Bring in a number of new features, mostly implemented by Michio Honda: - the VALE switch now support up to 254 destinations per switch, unicast or broadcast (multicast goes to all ports). - we can attach hw interfaces and the host stack to a VALE switch, which means we will be able to use it more or less as a native bridge (minor tweaks still necessary). A 'vale-ctl' program is supplied in tools/tools/netmap to attach/detach ports the switch, and list current configuration. - the lookup function in the VALE switch can be reassigned to something else, similar to the pf hooks. This will enable attaching the firewall, or other processing functions (e.g. in-kernel openvswitch) directly on the netmap port. The internal API used by device drivers does not change. Userspace applications should be recompiled because we bump NETMAP_API as we now use some fields in the struct nmreq that were previously ignored -- otherwise, data structures are the same. Manpages will be committed separately. Added: head/tools/tools/netmap/vale-ctl.c (contents, props changed) Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/net/netmap.h head/tools/tools/netmap/Makefile Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu May 30 13:41:19 2013 (r251138) +++ head/sys/dev/netmap/netmap.c Thu May 30 14:07:14 2013 (r251139) @@ -119,6 +119,9 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, mitiga int netmap_no_pendintr = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +int netmap_txsync_retry = 2; +SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, + &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); int netmap_drop = 0; /* debugging */ int netmap_flags = 0; /* debug flags */ @@ -128,25 +131,30 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, drop, SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -#ifdef NM_BRIDGE /* support for netmap bridge */ +#ifdef NM_BRIDGE /* support for netmap virtual switch, called VALE */ /* - * system parameters. + * system parameters (most of them in netmap_kern.h) + * NM_NAME prefix for switch port names, default "vale" + * NM_MAXPORTS number of ports + * NM_BRIDGES max number of switches in the system. + * XXX should become a sysctl or tunable * - * All switched ports have prefix NM_NAME. - * The switch has a max of NM_BDG_MAXPORTS ports (often stored in a bitmap, - * so a practical upper bound is 64). - * Each tx ring is read-write, whereas rx rings are readonly (XXX not done yet). + * Switch ports are named valeX:Y where X is the switch name and Y + * is the port. If Y matches a physical interface name, the port is + * connected to a physical device. + * + * Unlike physical interfaces, switch ports use their own memory region + * for rings and buffers. * The virtual interfaces use per-queue lock instead of core lock. * In the tx loop, we aggregate traffic in batches to make all operations * faster. The batch size is NM_BDG_BATCH */ -#define NM_NAME "vale" /* prefix for the interface */ -#define NM_BDG_MAXPORTS 16 /* up to 64 ? */ +#define NM_BDG_MAXRINGS 16 /* XXX unclear how many. */ #define NM_BRIDGE_RINGSIZE 1024 /* in the device */ #define NM_BDG_HASH 1024 /* forwarding table entries */ #define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ -#define NM_BRIDGES 4 /* number of bridges */ +#define NM_BRIDGES 8 /* number of bridges */ int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ @@ -174,14 +182,27 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge #define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) #define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) -static void bdg_netmap_attach(struct ifnet *ifp); +static void bdg_netmap_attach(struct netmap_adapter *); static int bdg_netmap_reg(struct ifnet *ifp, int onoff); +static int kern_netmap_regif(struct nmreq *nmr); + /* per-tx-queue entry */ struct nm_bdg_fwd { /* forwarding entry for a bridge */ void *buf; - uint64_t dst; /* dst mask */ - uint32_t src; /* src index ? */ - uint16_t len; /* src len */ + uint32_t ft_dst; /* dst port */ + uint16_t ft_len; /* src len */ + uint16_t ft_next; /* next packet to same destination */ +}; + +/* We need to build a list of buffers going to each destination. + * Each buffer is in one entry of struct nm_bdg_fwd, we use ft_next + * to build the list, and struct nm_bdg_q below for the queue. + * The structure should compact because potentially we have a lot + * of destinations. + */ +struct nm_bdg_q { + uint16_t bq_head; + uint16_t bq_tail; }; struct nm_hash_ent { @@ -198,26 +219,78 @@ struct nm_hash_ent { * The bridge is non blocking on the transmit ports. * * bdg_lock protects accesses to the bdg_ports array. + * This is a rw lock (or equivalent). */ struct nm_bridge { - struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; - int n_ports; - uint64_t act_ports; - int freelist; /* first buffer index */ - NM_SELINFO_T si; /* poll/select wait queue */ - NM_LOCK_T bdg_lock; /* protect the selinfo ? */ + int namelen; /* 0 means free */ - /* the forwarding table, MAC+ports */ - struct nm_hash_ent ht[NM_BDG_HASH]; + /* XXX what is the proper alignment/layout ? */ + NM_RWLOCK_T bdg_lock; /* protects bdg_ports */ + struct netmap_adapter *bdg_ports[NM_BDG_MAXPORTS]; - int namelen; /* 0 means free */ char basename[IFNAMSIZ]; + /* + * The function to decide the destination port. + * It returns either of an index of the destination port, + * NM_BDG_BROADCAST to broadcast this packet, or NM_BDG_NOPORT not to + * forward this packet. ring_nr is the source ring index, and the + * function may overwrite this value to forward this packet to a + * different ring index. + * This function must be set by netmap_bdgctl(). + */ + bdg_lookup_fn_t nm_bdg_lookup; + + /* the forwarding table, MAC+ports */ + struct nm_hash_ent ht[NM_BDG_HASH]; }; struct nm_bridge nm_bridges[NM_BRIDGES]; +NM_LOCK_T netmap_bridge_mutex; -#define BDG_LOCK(b) mtx_lock(&(b)->bdg_lock) -#define BDG_UNLOCK(b) mtx_unlock(&(b)->bdg_lock) +/* other OS will have these macros defined in their own glue code. */ + +#ifdef __FreeBSD__ +#define BDG_LOCK() mtx_lock(&netmap_bridge_mutex) +#define BDG_UNLOCK() mtx_unlock(&netmap_bridge_mutex) +#define BDG_WLOCK(b) rw_wlock(&(b)->bdg_lock) +#define BDG_WUNLOCK(b) rw_wunlock(&(b)->bdg_lock) +#define BDG_RLOCK(b) rw_rlock(&(b)->bdg_lock) +#define BDG_RUNLOCK(b) rw_runlock(&(b)->bdg_lock) + +/* set/get variables. OS-specific macros may wrap these + * assignments into read/write lock or similar + */ +#define BDG_SET_VAR(lval, p) (lval = p) +#define BDG_GET_VAR(lval) (lval) +#define BDG_FREE(p) free(p, M_DEVBUF) +#endif /* __FreeBSD__ */ + +static __inline int +nma_is_vp(struct netmap_adapter *na) +{ + return na->nm_register == bdg_netmap_reg; +} +static __inline int +nma_is_host(struct netmap_adapter *na) +{ + return na->nm_register == NULL; +} +static __inline int +nma_is_hw(struct netmap_adapter *na) +{ + /* In case of sw adapter, nm_register is NULL */ + return !nma_is_vp(na) && !nma_is_host(na); +} + +/* + * Regarding holding a NIC, if the NIC is owned by the kernel + * (i.e., bridge), neither another bridge nor user can use it; + * if the NIC is owned by a user, only users can share it. + * Evaluation must be done under NMA_LOCK(). + */ +#define NETMAP_OWNED_BY_KERN(ifp) (!nma_is_vp(NA(ifp)) && NA(ifp)->na_bdg) +#define NETMAP_OWNED_BY_ANY(ifp) \ + (NETMAP_OWNED_BY_KERN(ifp) || (NA(ifp)->refcount > 0)) /* * NA(ifp)->bdg_port port index @@ -245,15 +318,16 @@ pkt_copy(void *_src, void *_dst, int l) } } + /* * locate a bridge among the existing ones. * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. * We assume that this is called with a name of at least NM_NAME chars. */ static struct nm_bridge * -nm_find_bridge(const char *name) +nm_find_bridge(const char *name, int create) { - int i, l, namelen, e; + int i, l, namelen; struct nm_bridge *b = NULL; namelen = strlen(NM_NAME); /* base length */ @@ -268,29 +342,94 @@ nm_find_bridge(const char *name) namelen = IFNAMSIZ; ND("--- prefix is '%.*s' ---", namelen, name); - /* use the first entry for locking */ - BDG_LOCK(nm_bridges); // XXX do better - for (e = -1, i = 1; i < NM_BRIDGES; i++) { - b = nm_bridges + i; - if (b->namelen == 0) - e = i; /* record empty slot */ - else if (strncmp(name, b->basename, namelen) == 0) { + BDG_LOCK(); + /* lookup the name, remember empty slot if there is one */ + for (i = 0; i < NM_BRIDGES; i++) { + struct nm_bridge *x = nm_bridges + i; + + if (x->namelen == 0) { + if (create && b == NULL) + b = x; /* record empty slot */ + } else if (x->namelen != namelen) { + continue; + } else if (strncmp(name, x->basename, namelen) == 0) { ND("found '%.*s' at %d", namelen, name, i); + b = x; break; } } - if (i == NM_BRIDGES) { /* all full */ - if (e == -1) { /* no empty slot */ - b = NULL; - } else { - b = nm_bridges + e; - strncpy(b->basename, name, namelen); - b->namelen = namelen; - } + if (i == NM_BRIDGES && b) { /* name not found, can create entry */ + strncpy(b->basename, name, namelen); + b->namelen = namelen; + /* set the default function */ + b->nm_bdg_lookup = netmap_bdg_learning; + /* reset the MAC address table */ + bzero(b->ht, sizeof(struct nm_hash_ent) * NM_BDG_HASH); } - BDG_UNLOCK(nm_bridges); + BDG_UNLOCK(); return b; } + + +/* + * Free the forwarding tables for rings attached to switch ports. + */ +static void +nm_free_bdgfwd(struct netmap_adapter *na) +{ + int nrings, i; + struct netmap_kring *kring; + + nrings = nma_is_vp(na) ? na->num_tx_rings : na->num_rx_rings; + kring = nma_is_vp(na) ? na->tx_rings : na->rx_rings; + for (i = 0; i < nrings; i++) { + if (kring[i].nkr_ft) { + free(kring[i].nkr_ft, M_DEVBUF); + kring[i].nkr_ft = NULL; /* protect from freeing twice */ + } + } + if (nma_is_hw(na)) + nm_free_bdgfwd(SWNA(na->ifp)); +} + + +/* + * Allocate the forwarding tables for the rings attached to the bridge ports. + */ +static int +nm_alloc_bdgfwd(struct netmap_adapter *na) +{ + int nrings, l, i, num_dstq; + struct netmap_kring *kring; + + /* all port:rings + broadcast */ + num_dstq = NM_BDG_MAXPORTS * NM_BDG_MAXRINGS + 1; + l = sizeof(struct nm_bdg_fwd) * NM_BDG_BATCH; + l += sizeof(struct nm_bdg_q) * num_dstq; + l += sizeof(uint16_t) * NM_BDG_BATCH; + + nrings = nma_is_vp(na) ? na->num_tx_rings : na->num_rx_rings; + kring = nma_is_vp(na) ? na->tx_rings : na->rx_rings; + for (i = 0; i < nrings; i++) { + struct nm_bdg_fwd *ft; + struct nm_bdg_q *dstq; + int j; + + ft = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!ft) { + nm_free_bdgfwd(na); + return ENOMEM; + } + dstq = (struct nm_bdg_q *)(ft + NM_BDG_BATCH); + for (j = 0; j < num_dstq; j++) + dstq[j].bq_head = dstq[j].bq_tail = NM_BDG_BATCH; + kring[i].nkr_ft = ft; + } + if (nma_is_hw(na)) + nm_alloc_bdgfwd(SWNA(na->ifp)); + return 0; +} + #endif /* NM_BRIDGE */ @@ -413,20 +552,11 @@ netmap_dtor_locked(void *data) if (netmap_verbose) D("deleting last instance for %s", ifp->if_xname); /* - * there is a race here with *_netmap_task() and - * netmap_poll(), which don't run under NETMAP_REG_LOCK. - * na->refcount == 0 && na->ifp->if_capenable & IFCAP_NETMAP - * (aka NETMAP_DELETING(na)) are a unique marker that the - * device is dying. - * Before destroying stuff we sleep a bit, and then complete - * the job. NIOCREG should realize the condition and - * loop until they can continue; the other routines - * should check the condition at entry and quit if - * they cannot run. + * (TO CHECK) This function is only called + * when the last reference to this file descriptor goes + * away. This means we cannot have any pending poll() + * or interrupt routine operating on the structure. */ - na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - tsleep(na, 0, "NIOCUNREG", 4); - na->nm_lock(ifp, NETMAP_REG_LOCK, 0); na->nm_register(ifp, 0); /* off, clear IFCAP_NETMAP */ /* Wake up any sleeping threads. netmap_poll will * then return POLLERR @@ -437,6 +567,9 @@ netmap_dtor_locked(void *data) selwakeuppri(&na->rx_rings[i].si, PI_NET); selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); +#ifdef NM_BRIDGE + nm_free_bdgfwd(na); +#endif /* NM_BRIDGE */ /* release all buffers */ for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; @@ -458,49 +591,81 @@ netmap_dtor_locked(void *data) /* knlist_destroy(&na->tx_si.si_note); */ /* knlist_destroy(&na->rx_si.si_note); */ netmap_free_rings(na); - wakeup(na); + if (nma_is_hw(na)) + SWNA(ifp)->tx_rings = SWNA(ifp)->rx_rings = NULL; } netmap_if_free(nifp); } + +/* we assume netmap adapter exists */ static void nm_if_rele(struct ifnet *ifp) { #ifndef NM_BRIDGE if_rele(ifp); #else /* NM_BRIDGE */ - int i, full; + int i, full = 0, is_hw; struct nm_bridge *b; + struct netmap_adapter *na; - if (strncmp(ifp->if_xname, NM_NAME, sizeof(NM_NAME) - 1)) { + /* I can be called not only for get_ifp()-ed references where netmap's + * capability is guaranteed, but also for non-netmap-capable NICs. + */ + if (!NETMAP_CAPABLE(ifp) || !NA(ifp)->na_bdg) { if_rele(ifp); return; } if (!DROP_BDG_REF(ifp)) return; - b = ifp->if_bridge; - BDG_LOCK(nm_bridges); - BDG_LOCK(b); + + na = NA(ifp); + b = na->na_bdg; + is_hw = nma_is_hw(na); + + BDG_WLOCK(b); ND("want to disconnect %s from the bridge", ifp->if_xname); full = 0; + /* remove the entry from the bridge, also check + * if there are any leftover interfaces + * XXX we should optimize this code, e.g. going directly + * to na->bdg_port, and having a counter of ports that + * are connected. But it is not in a critical path. + * In NIC's case, index of sw na is always higher than hw na + */ for (i = 0; i < NM_BDG_MAXPORTS; i++) { - if (b->bdg_ports[i] == ifp) { - b->bdg_ports[i] = NULL; - bzero(ifp, sizeof(*ifp)); - free(ifp, M_DEVBUF); - break; - } - else if (b->bdg_ports[i] != NULL) + struct netmap_adapter *tmp = BDG_GET_VAR(b->bdg_ports[i]); + + if (tmp == na) { + /* disconnect from bridge */ + BDG_SET_VAR(b->bdg_ports[i], NULL); + na->na_bdg = NULL; + if (is_hw && SWNA(ifp)->na_bdg) { + /* disconnect sw adapter too */ + int j = SWNA(ifp)->bdg_port; + BDG_SET_VAR(b->bdg_ports[j], NULL); + SWNA(ifp)->na_bdg = NULL; + } + } else if (tmp != NULL) { full = 1; + } } - BDG_UNLOCK(b); + BDG_WUNLOCK(b); if (full == 0) { - ND("freeing bridge %d", b - nm_bridges); + ND("marking bridge %d as free", b - nm_bridges); b->namelen = 0; + b->nm_bdg_lookup = NULL; } - BDG_UNLOCK(nm_bridges); - if (i == NM_BDG_MAXPORTS) + if (na->na_bdg) { /* still attached to the bridge */ D("ouch, cannot find ifp to remove"); + } else if (is_hw) { + if_rele(ifp); + } else { + bzero(na, sizeof(*na)); + free(na, M_DEVBUF); + bzero(ifp, sizeof(*ifp)); + free(ifp, M_DEVBUF); + } #endif /* NM_BRIDGE */ } @@ -514,9 +679,13 @@ netmap_dtor(void *data) if (ifp) { struct netmap_adapter *na = NA(ifp); + if (na->na_bdg) + BDG_WLOCK(na->na_bdg); na->nm_lock(ifp, NETMAP_REG_LOCK, 0); netmap_dtor_locked(data); na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + if (na->na_bdg) + BDG_WUNLOCK(na->na_bdg); nm_if_rele(ifp); /* might also destroy *na */ } @@ -528,6 +697,7 @@ netmap_dtor(void *data) free(priv, M_DEVBUF); } + #ifdef __FreeBSD__ #include #include @@ -536,8 +706,16 @@ netmap_dtor(void *data) #include #include +/* + * In order to track whether pages are still mapped, we hook into + * the standard cdev_pager and intercept the constructor and + * destructor. + * XXX but then ? Do we really use the information ? + * Need to investigate. + */ static struct cdev_pager_ops saved_cdev_pager_ops; + static int netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color) @@ -548,6 +726,7 @@ netmap_dev_pager_ctor(void *handle, vm_o size, prot, foff, cred, color); } + static void netmap_dev_pager_dtor(void *handle) { @@ -562,6 +741,8 @@ static struct cdev_pager_ops netmap_cdev .cdev_pg_fault = NULL, }; + +// XXX check whether we need netmap_mmap_single _and_ netmap_mmap static int netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, vm_size_t objsize, vm_object_t *objp, int prot) @@ -630,6 +811,7 @@ netmap_mmap(__unused struct cdev *dev, return (*paddr ? 0 : ENOMEM); } + static int netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { @@ -639,6 +821,7 @@ netmap_close(struct cdev *dev, int fflag return 0; } + static int netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { @@ -677,6 +860,7 @@ netmap_open(struct cdev *dev, int oflags * might take a while before releasing the buffer. */ + /* * pass a chain of buffers to the host stack as coming from 'dst' */ @@ -701,6 +885,7 @@ struct mbq { int count; }; + /* * put a copy of the buffers marked NS_FORWARD into an mbuf chain. * Run from hwcur to cur - reserved @@ -745,6 +930,7 @@ netmap_grab_packets(struct netmap_kring q->tail = tail; } + /* * called under main lock to send packets from the host to the NIC * The host ring has packets from nr_hwcur to (cur - reserved) @@ -794,6 +980,7 @@ netmap_sw_to_nic(struct netmap_adapter * } } + /* * netmap_sync_to_host() passes packets up. We are called from a * system call in user process context, and the only contention @@ -827,6 +1014,18 @@ netmap_sync_to_host(struct netmap_adapte netmap_send_up(na->ifp, q.head); } + +/* SWNA(ifp)->txrings[0] is always NA(ifp)->txrings[NA(ifp)->num_txrings] */ +static int +netmap_bdg_to_host(struct ifnet *ifp, u_int ring_nr, int do_lock) +{ + (void)ring_nr; + (void)do_lock; + netmap_sync_to_host(NA(ifp)); + return 0; +} + + /* * rxsync backend for packets coming from the host stack. * They have been put in the queue by netmap_start() so we @@ -881,38 +1080,60 @@ netmap_sync_from_host(struct netmap_adap * Return ENXIO if the interface does not exist, EINVAL if netmap * is not supported by the interface. * If successful, hold a reference. + * + * During the NIC is attached to a bridge, reference is managed + * at na->na_bdg_refcount using ADD/DROP_BDG_REF() as well as + * virtual ports. Hence, on the final DROP_BDG_REF(), the NIC + * is detached from the bridge, then ifp's refcount is dropped (this + * is equivalent to that ifp is destroyed in case of virtual ports. + * + * This function uses if_rele() when we want to prevent the NIC from + * being detached from the bridge in error handling. But once refcount + * is acquired by this function, it must be released using nm_if_rele(). */ static int -get_ifp(const char *name, struct ifnet **ifp) +get_ifp(struct nmreq *nmr, struct ifnet **ifp) { + const char *name = nmr->nr_name; + int namelen = strlen(name); #ifdef NM_BRIDGE struct ifnet *iter = NULL; + int no_prefix = 0; do { struct nm_bridge *b; - int i, l, cand = -1; + struct netmap_adapter *na; + int i, cand = -1, cand2 = -1; - if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) + if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) { + no_prefix = 1; break; - b = nm_find_bridge(name); + } + b = nm_find_bridge(name, 1 /* create a new one if no exist */ ); if (b == NULL) { D("no bridges available for '%s'", name); return (ENXIO); } - /* XXX locking */ - BDG_LOCK(b); + /* Now we are sure that name starts with the bridge's name */ + BDG_WLOCK(b); /* lookup in the local list of ports */ for (i = 0; i < NM_BDG_MAXPORTS; i++) { - iter = b->bdg_ports[i]; - if (iter == NULL) { + na = BDG_GET_VAR(b->bdg_ports[i]); + if (na == NULL) { if (cand == -1) cand = i; /* potential insert point */ + else if (cand2 == -1) + cand2 = i; /* for host stack */ continue; } - if (!strcmp(iter->if_xname, name)) { + iter = na->ifp; + /* XXX make sure the name only contains one : */ + if (!strcmp(iter->if_xname, name) /* virtual port */ || + (namelen > b->namelen && !strcmp(iter->if_xname, + name + b->namelen + 1)) /* NIC */) { ADD_BDG_REF(iter); ND("found existing interface"); - BDG_UNLOCK(b); + BDG_WUNLOCK(b); break; } } @@ -921,23 +1142,73 @@ get_ifp(const char *name, struct ifnet * if (cand == -1) { D("bridge full, cannot create new port"); no_port: - BDG_UNLOCK(b); + BDG_WUNLOCK(b); *ifp = NULL; return EINVAL; } ND("create new bridge port %s", name); - /* space for forwarding list after the ifnet */ - l = sizeof(*iter) + - sizeof(struct nm_bdg_fwd)*NM_BDG_BATCH ; - iter = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); - if (!iter) - goto no_port; - strcpy(iter->if_xname, name); - bdg_netmap_attach(iter); - b->bdg_ports[cand] = iter; - iter->if_bridge = b; + /* + * create a struct ifnet for the new port. + * The forwarding table is attached to the kring(s). + */ + /* + * try see if there is a matching NIC with this name + * (after the bridge's name) + */ + iter = ifunit_ref(name + b->namelen + 1); + if (!iter) { /* this is a virtual port */ + /* Create a temporary NA with arguments, then + * bdg_netmap_attach() will allocate the real one + * and attach it to the ifp + */ + struct netmap_adapter tmp_na; + + if (nmr->nr_cmd) /* nr_cmd must be for a NIC */ + goto no_port; + bzero(&tmp_na, sizeof(tmp_na)); + /* bound checking */ + if (nmr->nr_tx_rings < 1) + nmr->nr_tx_rings = 1; + if (nmr->nr_tx_rings > NM_BDG_MAXRINGS) + nmr->nr_tx_rings = NM_BDG_MAXRINGS; + tmp_na.num_tx_rings = nmr->nr_tx_rings; + if (nmr->nr_rx_rings < 1) + nmr->nr_rx_rings = 1; + if (nmr->nr_rx_rings > NM_BDG_MAXRINGS) + nmr->nr_rx_rings = NM_BDG_MAXRINGS; + tmp_na.num_rx_rings = nmr->nr_rx_rings; + + iter = malloc(sizeof(*iter), M_DEVBUF, M_NOWAIT | M_ZERO); + if (!iter) + goto no_port; + strcpy(iter->if_xname, name); + tmp_na.ifp = iter; + /* bdg_netmap_attach creates a struct netmap_adapter */ + bdg_netmap_attach(&tmp_na); + } else if (NETMAP_CAPABLE(iter)) { /* this is a NIC */ + /* cannot attach the NIC that any user or another + * bridge already holds. + */ + if (NETMAP_OWNED_BY_ANY(iter) || cand2 == -1) { +ifunit_rele: + if_rele(iter); /* don't detach from bridge */ + goto no_port; + } + /* bind the host stack to the bridge */ + if (nmr->nr_arg1 == NETMAP_BDG_HOST) { + BDG_SET_VAR(b->bdg_ports[cand2], SWNA(iter)); + SWNA(iter)->bdg_port = cand2; + SWNA(iter)->na_bdg = b; + } + } else /* not a netmap-capable NIC */ + goto ifunit_rele; + na = NA(iter); + na->bdg_port = cand; + /* bind the port to the bridge (virtual ports are not active) */ + BDG_SET_VAR(b->bdg_ports[cand], na); + na->na_bdg = b; ADD_BDG_REF(iter); - BDG_UNLOCK(b); + BDG_WUNLOCK(b); ND("attaching virtual bridge %p", b); } while (0); *ifp = iter; @@ -949,8 +1220,16 @@ no_port: /* can do this if the capability exists and if_pspare[0] * points to the netmap descriptor. */ - if (NETMAP_CAPABLE(*ifp)) + if (NETMAP_CAPABLE(*ifp)) { +#ifdef NM_BRIDGE + /* Users cannot use the NIC attached to a bridge directly */ + if (no_prefix && NETMAP_OWNED_BY_KERN(*ifp)) { + if_rele(*ifp); /* don't detach from bridge */ + return EINVAL; + } else +#endif /* NM_BRIDGE */ return 0; /* valid pointer, we hold the refcount */ + } nm_if_rele(*ifp); return EINVAL; // not NETMAP capable } @@ -1059,6 +1338,296 @@ netmap_set_ringid(struct netmap_priv_d * return 0; } + +/* + * possibly move the interface to netmap-mode. + * If success it returns a pointer to netmap_if, otherwise NULL. + * This must be called with NMA_LOCK held. + */ +static struct netmap_if * +netmap_do_regif(struct netmap_priv_d *priv, struct ifnet *ifp, + uint16_t ringid, int *err) +{ + struct netmap_adapter *na = NA(ifp); + struct netmap_if *nifp = NULL; + int i, error; + + if (na->na_bdg) + BDG_WLOCK(na->na_bdg); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); + + /* ring configuration may have changed, fetch from the card */ + netmap_update_config(na); + priv->np_ifp = ifp; /* store the reference */ + error = netmap_set_ringid(priv, ringid); + if (error) + goto out; + nifp = netmap_if_new(ifp->if_xname, na); + if (nifp == NULL) { /* allocation failed */ + error = ENOMEM; + } else if (ifp->if_capenable & IFCAP_NETMAP) { + /* was already set */ + } else { + /* Otherwise set the card in netmap mode + * and make it use the shared buffers. + */ + for (i = 0 ; i < na->num_tx_rings + 1; i++) + mtx_init(&na->tx_rings[i].q_lock, "nm_txq_lock", + MTX_NETWORK_LOCK, MTX_DEF); + for (i = 0 ; i < na->num_rx_rings + 1; i++) { + mtx_init(&na->rx_rings[i].q_lock, "nm_rxq_lock", + MTX_NETWORK_LOCK, MTX_DEF); + } + if (nma_is_hw(na)) { + SWNA(ifp)->tx_rings = &na->tx_rings[na->num_tx_rings]; + SWNA(ifp)->rx_rings = &na->rx_rings[na->num_rx_rings]; + } + error = na->nm_register(ifp, 1); /* mode on */ +#ifdef NM_BRIDGE + if (!error) + error = nm_alloc_bdgfwd(na); +#endif /* NM_BRIDGE */ + if (error) { + netmap_dtor_locked(priv); + /* nifp is not yet in priv, so free it separately */ + netmap_if_free(nifp); + nifp = NULL; + } + + } +out: + *err = error; + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + if (na->na_bdg) + BDG_WUNLOCK(na->na_bdg); + return nifp; +} + + +/* Process NETMAP_BDG_ATTACH and NETMAP_BDG_DETACH */ +static int +kern_netmap_regif(struct nmreq *nmr) +{ + struct ifnet *ifp; + struct netmap_if *nifp; + struct netmap_priv_d *npriv; + int error; + + npriv = malloc(sizeof(*npriv), M_DEVBUF, M_NOWAIT|M_ZERO); + if (npriv == NULL) + return ENOMEM; + error = netmap_get_memory(npriv); + if (error) { +free_exit: + bzero(npriv, sizeof(*npriv)); + free(npriv, M_DEVBUF); + return error; + } + + NMA_LOCK(); + error = get_ifp(nmr, &ifp); + if (error) { /* no device, or another bridge or user owns the device */ + NMA_UNLOCK(); + goto free_exit; + } else if (!NETMAP_OWNED_BY_KERN(ifp)) { + /* got reference to a virtual port or direct access to a NIC. + * perhaps specified no bridge's prefix or wrong NIC's name + */ + error = EINVAL; +unref_exit: + nm_if_rele(ifp); + NMA_UNLOCK(); + goto free_exit; + } + + if (nmr->nr_cmd == NETMAP_BDG_DETACH) { + if (NA(ifp)->refcount == 0) { /* not registered */ + error = EINVAL; + goto unref_exit; + } + NMA_UNLOCK(); + + netmap_dtor(NA(ifp)->na_kpriv); /* unregister */ + NA(ifp)->na_kpriv = NULL; + nm_if_rele(ifp); /* detach from the bridge */ + goto free_exit; + } else if (NA(ifp)->refcount > 0) { /* already registered */ + error = EINVAL; + goto unref_exit; + } + + nifp = netmap_do_regif(npriv, ifp, nmr->nr_ringid, &error); + if (!nifp) + goto unref_exit; + wmb(); // XXX do we need it ? + npriv->np_nifp = nifp; + NA(ifp)->na_kpriv = npriv; + NMA_UNLOCK(); + D("registered %s to netmap-mode", ifp->if_xname); + return 0; +} + + +/* CORE_LOCK is not necessary */ +static void +netmap_swlock_wrapper(struct ifnet *dev, int what, u_int queueid) +{ + struct netmap_adapter *na = SWNA(dev); + + switch (what) { + case NETMAP_TX_LOCK: + mtx_lock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_TX_UNLOCK: + mtx_unlock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_RX_LOCK: + mtx_lock(&na->rx_rings[queueid].q_lock); + break; + + case NETMAP_RX_UNLOCK: + mtx_unlock(&na->rx_rings[queueid].q_lock); + break; + } +} + + +/* Initialize necessary fields of sw adapter located in right after hw's + * one. sw adapter attaches a pair of sw rings of the netmap-mode NIC. + * It is always activated and deactivated at the same tie with the hw's one. + * Thus we don't need refcounting on the sw adapter. + * Regardless of NIC's feature we use separate lock so that anybody can lock + * me independently from the hw adapter. + * Make sure nm_register is NULL to be handled as FALSE in nma_is_hw + */ +static void +netmap_attach_sw(struct ifnet *ifp) +{ + struct netmap_adapter *hw_na = NA(ifp); + struct netmap_adapter *na = SWNA(ifp); + + na->ifp = ifp; + na->separate_locks = 1; + na->nm_lock = netmap_swlock_wrapper; + na->num_rx_rings = na->num_tx_rings = 1; + na->num_tx_desc = hw_na->num_tx_desc; + na->num_rx_desc = hw_na->num_rx_desc; + na->nm_txsync = netmap_bdg_to_host; +} + + +/* exported to kernel callers */ +int +netmap_bdg_ctl(struct nmreq *nmr, bdg_lookup_fn_t func) +{ + struct nm_bridge *b; + struct netmap_adapter *na; + struct ifnet *iter; + char *name = nmr->nr_name; + int cmd = nmr->nr_cmd, namelen = strlen(name); + int error = 0, i, j; + + switch (cmd) { + case NETMAP_BDG_ATTACH: + case NETMAP_BDG_DETACH: + error = kern_netmap_regif(nmr); + break; + + case NETMAP_BDG_LIST: + /* this is used to enumerate bridges and ports */ + if (namelen) { /* look up indexes of bridge and port */ + if (strncmp(name, NM_NAME, strlen(NM_NAME))) { + error = EINVAL; + break; + } + b = nm_find_bridge(name, 0 /* don't create */); + if (!b) { + error = ENOENT; + break; + } + + BDG_RLOCK(b); + error = ENOENT; + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + na = BDG_GET_VAR(b->bdg_ports[i]); + if (na == NULL) + continue; + iter = na->ifp; + /* the former and the latter identify a + * virtual port and a NIC, respectively + */ + if (!strcmp(iter->if_xname, name) || + (namelen > b->namelen && + !strcmp(iter->if_xname, + name + b->namelen + 1))) { + /* bridge index */ + nmr->nr_arg1 = b - nm_bridges; + nmr->nr_arg2 = i; /* port index */ + error = 0; + break; + } + } + BDG_RUNLOCK(b); + } else { + /* return the first non-empty entry starting from + * bridge nr_arg1 and port nr_arg2. + * + * Users can detect the end of the same bridge by + * seeing the new and old value of nr_arg1, and can + * detect the end of all the bridge by error != 0 + */ + i = nmr->nr_arg1; + j = nmr->nr_arg2; + + for (error = ENOENT; error && i < NM_BRIDGES; i++) { + b = nm_bridges + i; + BDG_RLOCK(b); + for (; j < NM_BDG_MAXPORTS; j++) { + na = BDG_GET_VAR(b->bdg_ports[j]); + if (na == NULL) + continue; + iter = na->ifp; + nmr->nr_arg1 = i; + nmr->nr_arg2 = j; + strncpy(name, iter->if_xname, IFNAMSIZ); + error = 0; + break; + } + BDG_RUNLOCK(b); + j = 0; /* following bridges scan from 0 */ + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 14:09:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26040B7F; Thu, 30 May 2013 14:09:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F20F3641; Thu, 30 May 2013 14:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UE9wqq009397; Thu, 30 May 2013 14:09:58 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UE9wSP009396; Thu, 30 May 2013 14:09:58 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305301409.r4UE9wSP009396@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 14:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251140 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 14:09:59 -0000 Author: brooks Date: Thu May 30 14:09:58 2013 New Revision: 251140 URL: http://svnweb.freebsd.org/changeset/base/251140 Log: Always define INSTALL_DDIR and define it such that it contains no extra / characters rather than removing them later on. This should fix release builds. PR: conf/178963 Reviewed by: gjb, hrs Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) @@ -407,11 +407,12 @@ IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc .endif +_INSTALL_DDIR= ${DESTDIR}/${DISTDIR} +INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} .if defined(NO_ROOT) METALOG?= ${DESTDIR}/${DISTDIR}/METALOG IMAKE+= -DNO_ROOT METALOG=${METALOG} -INSTALL_DDIR= ${DESTDIR}/${DISTDIR} -INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR:S://:/:g:C:/$::} +INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} MTREEFLAGS+= -W .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) @@ -522,7 +523,7 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4.1: building includes" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes _libraries: @echo @echo "--------------------------------------------------------------" @@ -1014,7 +1015,7 @@ distributekernel distributekernel.debug: cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ - DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel \ + DESTDIR=${INSTALL_DDIR}/kernel \ ${.TARGET:S/distributekernel/install/} .if defined(NO_ROOT) sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ @@ -1028,7 +1029,7 @@ distributekernel distributekernel.debug: ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \ KERNEL=${INSTKERNNAME}.${_kernel} \ - DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel.${_kernel} \ + DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \ ${.TARGET:S/distributekernel/install/} sed -e 's|^./kernel|.|' \ ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ From owner-svn-src-all@FreeBSD.ORG Thu May 30 14:53:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E8B591B; Thu, 30 May 2013 14:53:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id DFE7CA13; Thu, 30 May 2013 14:53:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5E4BDB918; Thu, 30 May 2013 10:53:45 -0400 (EDT) From: John Baldwin To: Brooks Davis Subject: Re: svn commit: r251140 - head Date: Thu, 30 May 2013 10:53:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305301409.r4UE9wSP009396@svn.freebsd.org> In-Reply-To: <201305301409.r4UE9wSP009396@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305301053.23282.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 30 May 2013 10:53:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 14:53:46 -0000 On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > Author: brooks > Date: Thu May 30 14:09:58 2013 > New Revision: 251140 > URL: http://svnweb.freebsd.org/changeset/base/251140 > > Log: > Always define INSTALL_DDIR and define it such that it contains no extra > / characters rather than removing them later on. This should fix > release builds. > > PR: conf/178963 > Reviewed by: gjb, hrs > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > @@ -522,7 +523,7 @@ _includes: > @echo "--------------------------------------------------------------" > @echo ">>> stage 4.1: building includes" > @echo "--------------------------------------------------------------" > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > _libraries: > @echo > @echo "--------------------------------------------------------------" Did you mean to change this? It seems unrelated. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:25:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CE22A98; Thu, 30 May 2013 15:25:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F030DDD; Thu, 30 May 2013 15:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UFPsn7036662; Thu, 30 May 2013 15:25:54 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UFPsfU036661; Thu, 30 May 2013 15:25:54 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305301525.r4UFPsfU036661@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 15:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251141 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:25:54 -0000 Author: brooks Date: Thu May 30 15:25:54 2013 New Revision: 251141 URL: http://svnweb.freebsd.org/changeset/base/251141 Log: Restore (at least temporarily) SHARED=symlinks in the build includes stage of buildworld. This was accidentally included in r251140. Reported by: jhb Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) +++ head/Makefile.inc1 Thu May 30 15:25:54 2013 (r251141) @@ -523,7 +523,7 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4.1: building includes" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes + ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes _libraries: @echo @echo "--------------------------------------------------------------" From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:29:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E66FD103; Thu, 30 May 2013 15:29:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id AD752E76; Thu, 30 May 2013 15:29:34 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4UFTXmY037174; Thu, 30 May 2013 10:29:33 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4UFTXOA037173; Thu, 30 May 2013 10:29:33 -0500 (CDT) (envelope-from brooks) Date: Thu, 30 May 2013 10:29:33 -0500 From: Brooks Davis To: John Baldwin Subject: Re: svn commit: r251140 - head Message-ID: <20130530152933.GB36644@lor.one-eyed-alien.net> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: <201305301053.23282.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:29:36 -0000 --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > Author: brooks > > Date: Thu May 30 14:09:58 2013 > > New Revision: 251140 > > URL: http://svnweb.freebsd.org/changeset/base/251140 > >=20 > > Log: > > Always define INSTALL_DDIR and define it such that it contains no ext= ra > > / characters rather than removing them later on. This should fix > > release builds. > > =20 > > PR: conf/178963 > > Reviewed by: gjb, hrs > >=20 > > Modified: > > head/Makefile.inc1 > >=20 > > Modified: head/Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > @@ -522,7 +523,7 @@ _includes: > > @echo "--------------------------------------------------------------" > > @echo ">>> stage 4.1: building includes" > > @echo "--------------------------------------------------------------" > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > _libraries: > > @echo > > @echo "--------------------------------------------------------------" >=20 > Did you mean to change this? It seems unrelated. Oops, I forgot that I had that in for testing. Reverted in 251141. That said, the SHARED=3D(copies|symlinks) code should probably go on the chopping block. It's a lousy idea except for populating WORLDTMP and here it saves at most 1.5% in /usr/obj. Worse, the implementation is hand coded in each Makefile so it adds complexity for a mostly useless feature. -- Brooks --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRp3BdXY6L6fI4GtQRAm5/AJ47DB36CE0dJmFnDGZaUroYGAhhMwCgqCr2 zgUi+OupTRTuB5zOgeyiGMw= =Qqsd -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:37:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA9A04C9; Thu, 30 May 2013 15:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 14BB7F5D; Thu, 30 May 2013 15:37:54 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r4UFbpSj090176; Thu, 30 May 2013 18:37:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r4UFbpSj090176 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r4UFbpTl090175; Thu, 30 May 2013 18:37:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 May 2013 18:37:51 +0300 From: Konstantin Belousov To: Brooks Davis Subject: Re: svn commit: r251140 - head Message-ID: <20130530153750.GB3047@kib.kiev.ua> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PYiEBKzE38FzKR5p" Content-Disposition: inline In-Reply-To: <20130530152933.GB36644@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:37:55 -0000 --PYiEBKzE38FzKR5p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:29:33AM -0500, Brooks Davis wrote: > On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > > Author: brooks > > > Date: Thu May 30 14:09:58 2013 > > > New Revision: 251140 > > > URL: http://svnweb.freebsd.org/changeset/base/251140 > > >=20 > > > Log: > > > Always define INSTALL_DDIR and define it such that it contains no e= xtra > > > / characters rather than removing them later on. This should fix > > > release builds. > > > =20 > > > PR: conf/178963 > > > Reviewed by: gjb, hrs > > >=20 > > > Modified: > > > head/Makefile.inc1 > > >=20 > > > Modified: head/Makefile.inc1 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > > @@ -522,7 +523,7 @@ _includes: > > > @echo "------------------------------------------------------------= --" > > > @echo ">>> stage 4.1: building includes" > > > @echo "------------------------------------------------------------= --" > > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > > _libraries: > > > @echo > > > @echo "------------------------------------------------------------= --" > >=20 > > Did you mean to change this? It seems unrelated. >=20 > Oops, I forgot that I had that in for testing. Reverted in 251141. >=20 > That said, the SHARED=3D(copies|symlinks) code should probably go on the > chopping block. It's a lousy idea except for populating WORLDTMP and > here it saves at most 1.5% in /usr/obj. Worse, the implementation is > hand coded in each Makefile so it adds complexity for a mostly useless > feature. I disagree with the statement about the useless, at least for WORLDTMP it saves the full buildworld when a change in the usermode headers is done during the development. E.g., changing include/* or sys/sys/* still allows to build libc with buildenv, instead of spending 40+ minutes on the buildworld. --PYiEBKzE38FzKR5p Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRp3JOAAoJEJDCuSvBvK1BJQ8P/3sAS5LuOYQG6emQ8xMUdAz8 +f+0229U/r8XmujWOcDuU/C3sq1xrj4mSLFvTGtsicwmAWyiRgAcm33EW/o/fdH/ pxZFeYre/nRJhIbJ75JqrON3l07i8C6N6+dHqruv3hPLCRJ5pBW3dEDAnF1rjWJU vCVgaVhm0L8eViEPL2MZvV7m614HnKbd6uWpFP8mdHw2W/4tvjDg8fHo45ndJXv9 f4vcmne716x4+2BAKlMwJWplotGDnVUP7GUD9g+aclKriCxkiVtLZeSTEFLfeXHk SZW4tP68KIUrzvuSVzs7GGNjpLI0sgdq616PP5R4VbKGJLbHUB+5Sri5etJn+fIz K5RPkFLvznDfG9XjViM2cFt4PFTId/in8nxArQD6lelQpT7qMzN6PGwkcMqT3HHv AELmq9SiUzdznQ2/5/JtwtpWL55/WU0wdx3IXlYJiC9tBMhsIjAZxv/YJddGWqBb 4uPvTl2a/jUHV+a/yLmJrKiUm514+RL5MLfyKZukSTWIF5ssAS7H7VdrCvPPeVXP +pqxIqE5sJFASVv2A/ZxbvFS5+cT/DW9rIbAKZ5uoihtTfsc80lO+cDvlUI6kqQf ZN1qS7LKF0aizmxQCPeUT9nyJiw6/izP1qBZHhj+qAsOqg+p9L4iBI+yxRZY1bYP szRgHgytHXkHnJIxX426 =yGXJ -----END PGP SIGNATURE----- --PYiEBKzE38FzKR5p-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:45:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03165C2C; Thu, 30 May 2013 15:45:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 52E48C1; Thu, 30 May 2013 15:45:34 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4UFjSsx037346; Thu, 30 May 2013 10:45:28 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4UFjScZ037345; Thu, 30 May 2013 10:45:28 -0500 (CDT) (envelope-from brooks) Date: Thu, 30 May 2013 10:45:28 -0500 From: Brooks Davis To: Konstantin Belousov Subject: Re: svn commit: r251140 - head Message-ID: <20130530154528.GC36644@lor.one-eyed-alien.net> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: <20130530153750.GB3047@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:45:35 -0000 --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: > On Thu, May 30, 2013 at 10:29:33AM -0500, Brooks Davis wrote: > > On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > > > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > > > Author: brooks > > > > Date: Thu May 30 14:09:58 2013 > > > > New Revision: 251140 > > > > URL: http://svnweb.freebsd.org/changeset/base/251140 > > > >=20 > > > > Log: > > > > Always define INSTALL_DDIR and define it such that it contains no= extra > > > > / characters rather than removing them later on. This should fix > > > > release builds. > > > > =20 > > > > PR: conf/178963 > > > > Reviewed by: gjb, hrs > > > >=20 > > > > Modified: > > > > head/Makefile.inc1 > > > >=20 > > > > Modified: head/Makefile.inc1 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > > > @@ -522,7 +523,7 @@ _includes: > > > > @echo "----------------------------------------------------------= ----" > > > > @echo ">>> stage 4.1: building includes" > > > > @echo "----------------------------------------------------------= ----" > > > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > > > _libraries: > > > > @echo > > > > @echo "----------------------------------------------------------= ----" > > >=20 > > > Did you mean to change this? It seems unrelated. > >=20 > > Oops, I forgot that I had that in for testing. Reverted in 251141. > >=20 > > That said, the SHARED=3D(copies|symlinks) code should probably go on the > > chopping block. It's a lousy idea except for populating WORLDTMP and > > here it saves at most 1.5% in /usr/obj. Worse, the implementation is > > hand coded in each Makefile so it adds complexity for a mostly useless > > feature. >=20 > I disagree with the statement about the useless, at least for WORLDTMP > it saves the full buildworld when a change in the usermode headers is > done during the development. E.g., changing include/* or sys/sys/* > still allows to build libc with buildenv, instead of spending 40+ > minutes on the buildworld. Ok, that's fair. I won't touch the includes bits. I seriously doubt 40+ minutes given that -DNO_CLEAN should work fine in such a case. Do you agree that it's less than useful in the never exercised cases in share/examples and share/sendmail? -- Brooks --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRp3QXXY6L6fI4GtQRAuHnAKCJ9xdpsqEWnw1hWF+M8r7Gs21vWgCfRPl1 iPKZTWuL237Vcn8DE4Prf/U= =aGQY -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:50:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CD4CF94; Thu, 30 May 2013 15:50:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B60AB11E; Thu, 30 May 2013 15:50:29 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r4UFoPiE095396; Thu, 30 May 2013 18:50:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r4UFoPiE095396 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r4UFoP9j095394; Thu, 30 May 2013 18:50:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 May 2013 18:50:25 +0300 From: Konstantin Belousov To: Brooks Davis Subject: Re: svn commit: r251140 - head Message-ID: <20130530155025.GD3047@kib.kiev.ua> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> <20130530154528.GC36644@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cs+qLuUypMIXhRuC" Content-Disposition: inline In-Reply-To: <20130530154528.GC36644@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:50:30 -0000 --Cs+qLuUypMIXhRuC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:45:28AM -0500, Brooks Davis wrote: > On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: > > I disagree with the statement about the useless, at least for WORLDTMP > > it saves the full buildworld when a change in the usermode headers is > > done during the development. E.g., changing include/* or sys/sys/* > > still allows to build libc with buildenv, instead of spending 40+ > > minutes on the buildworld. >=20 > Ok, that's fair. I won't touch the includes bits. I seriously doubt > 40+ minutes given that -DNO_CLEAN should work fine in such a case. -DNO_CLEAN have very strange failure modes, esp. recently. >=20 > Do you agree that it's less than useful in the never exercised cases in > share/examples and share/sendmail? I only care about includes, at least for now. --Cs+qLuUypMIXhRuC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRp3VAAAoJEJDCuSvBvK1B4MgQAJYjITTUVNwj6zLOwtRVa5Pn jUBvPzMz+x6zdYMWnxJ9pqdzCWyXT4sqsnaTmVgKAVOzVtVM46MbGGGCUaL7jg2p HtbeorMrgIcJuabawaRjJh5ZgG0lpSs+uTfvW8TLjFCVmdhp+sbpx8b+/Kamu6Y+ d8Fcnpcfcg7kr7/oGYN/vGdUjlTHEbfscwQc0RRu0WcenZUGkFMpTa2l9q8yEUu7 +OYg7W3t6iqkjcc9fVd7UQVJGxz4zSNKRrlGvV22nZZ/MH9fBkkPuWu+JZ/qrxNn pFL8nPGkspltEpfJAgP0fTcNDeFy2ZsPf/tMEgucR7HARkPJLT8pnijMZcTvRQTG oISAMmOk6Gg5CrDW6Hnnnp97gXyPNJWT+47yjp63naBTo0eqnxT/U99Qec6fXQd2 fs2SdEvAs/HgFXY8lKlpGyCPmpQf+jabRc5nabbWezDXJ3y75G8e0oVcJMRoULNO W5Qs+o2SVEt4iX8zx37oQ6UaTY1SjV/wJT9fnFO4Khpi68y+O+FdWaSoUEO3H/GD bfr4eDR7Q1Nvz8vwRDMzAGC0gwsl6+3zNi9KFnInsjYbePSzZIGxH2wiBGwqTMWS x5ye3VOaMR7d4rib8l2E8BWQFbeCo7ysUYHBsoDmAYA+CNR0HBZtWm4mrqHDZASa 7yn17r8qDTZBUM5ld3ng =NbE8 -----END PGP SIGNATURE----- --Cs+qLuUypMIXhRuC-- From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:52:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 384E81E0; Thu, 30 May 2013 15:52:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id F1FF5138; Thu, 30 May 2013 15:52:15 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id un4so585417pbc.26 for ; Thu, 30 May 2013 08:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=ahp5jJUEAx2MRG0/urXVELdcD9od1QqbqAGYhNyQAIw=; b=YA/4th1xIUzBHhZy9ytK3FRbGty3LQV/kBuwRVwZlXmahafGnViMxK7leYNDRJihoL LOyhZsbMUnY4VqDgmuq9hC96LwwDG0Er3KdiFLwf1avbWyCHVkypGVrv+oCwVhPz+0RH TYqhJzYN3FwLaG8WliH35YjLRhg/y401rI4qSkZMPgdYTScH74NefgRUgTOMg5mdt8qA hjd7BxJBShgKhCqIrwteR57QDfM42wuIUvAw1ob4F4LC1ekHfKzWIwzVCARyOl2hfzeF lCdTnHlM0qm4tpNliCvGn/qN38lefCAnGqc44LfmprFj3Dh3lczGSWBZtFmfexaAqUz/ DuXA== X-Received: by 10.66.134.41 with SMTP id ph9mr9258485pab.150.1369929135823; Thu, 30 May 2013 08:52:15 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id bs2sm45369325pad.17.2013.05.30.08.52.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 08:52:14 -0700 (PDT) Subject: Re: svn commit: r251140 - head Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <20130530155025.GD3047@kib.kiev.ua> Date: Thu, 30 May 2013 08:52:10 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> <20130530154528.GC36644@lor.one-eyed-alien.net> <20130530155025.GD3047@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:52:16 -0000 On May 30, 2013, at 8:50 AM, Konstantin Belousov wrote: > On Thu, May 30, 2013 at 10:45:28AM -0500, Brooks Davis wrote: >> On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: >>> I disagree with the statement about the useless, at least for WORLDTMP >>> it saves the full buildworld when a change in the usermode headers is >>> done during the development. E.g., changing include/* or sys/sys/* >>> still allows to build libc with buildenv, instead of spending 40+ >>> minutes on the buildworld. >> >> Ok, that's fair. I won't touch the includes bits. I seriously doubt >> 40+ minutes given that -DNO_CLEAN should work fine in such a case. > -DNO_CLEAN have very strange failure modes, esp. recently. How "recent" is "recently", e.g. after the fmake -> bmake migration? Cheers, -Garrett From owner-svn-src-all@FreeBSD.ORG Thu May 30 15:56:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5A6341E; Thu, 30 May 2013 15:56:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-x234.google.com (mail-pb0-x234.google.com [IPv6:2607:f8b0:400e:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id 9806317E; Thu, 30 May 2013 15:56:38 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id xa12so595033pbc.39 for ; Thu, 30 May 2013 08:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=nF4BJWIDsBKeRovce/e38Sr0Dx1OV+mbygvHH9L065o=; b=F9haGIRJMuTX9zz/fI75jjwuVOgcr2tu8FgfbRMnlEcG7uk/07vEAYggmfcHSHerw7 Xkeis5sVGWsEk40kz0Km5L9YP+cQQ9ZXIPil+kZDXIi/wDjVb+J9E0rO8y9LQ1gsW7Xr 1Q6mifTucS33NZvcvXsdbeirYnfB14uLhtoEisCv5tM5HgI0DFilKB1GTclgOUC4ILCi NEbDHPKjzH3IYZiuVbNVGciZHvjFq5u+QeuRm5/0GIjz8vo0w1dIohxyBPm5RiQkjAYN L8u5IWnNI58imZ4uJLS7HN2Z5QJRyxYdNOhPgh8GJ89x7tJBfQgt1MhrkUERsgnCo8jq 741w== X-Received: by 10.69.2.228 with SMTP id br4mr8540930pbd.91.1369929398348; Thu, 30 May 2013 08:56:38 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id ra4sm45413339pab.9.2013.05.30.08.56.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 08:56:36 -0700 (PDT) Subject: Re: svn commit: r251140 - head Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201305301409.r4UE9wSP009396@svn.freebsd.org> Date: Thu, 30 May 2013 08:56:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305301409.r4UE9wSP009396@svn.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, hrs@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 15:56:38 -0000 On May 30, 2013, at 7:09 AM, Brooks Davis wrote: > Author: brooks > Date: Thu May 30 14:09:58 2013 > New Revision: 251140 > URL: http://svnweb.freebsd.org/changeset/base/251140 >=20 > Log: > Always define INSTALL_DDIR and define it such that it contains no = extra > / characters rather than removing them later on. This should fix > release builds. >=20 > PR: conf/178963 > Reviewed by: gjb, hrs This is similar to a fix/enhancement I've made to Makefile.inc1 on my = atf-tools-regression-convert branch: = https://github.com/yaneurabeya/freebsd/blob/atf-tools-regression-convert/M= akefile.inc1 . There are two key differences between my changes and this one: 1. I more consistently used INSTALL_DDIR in the Makefile as there were a = number of spots where it wasn't doing that, but instead explicitly = stating ${DESTDIR}/${DISTDIR}. 2. I properly deal with removing adjacent / by using the {2,} regexp = quantifier as the current code only deals with even number of repeating = /, not odd number of repeating / (not sure why this even mattered in the = first place because this should be properly handled by whatever tool is = calculating the absolute path, but I won't question why this is being = done any further). Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Thu May 30 16:09:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 187C4932; Thu, 30 May 2013 16:09:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0ACAC248; Thu, 30 May 2013 16:09:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UG9vWK051401; Thu, 30 May 2013 16:09:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UG9u2O051398; Thu, 30 May 2013 16:09:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301609.r4UG9u2O051398@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 16:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251142 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 16:09:57 -0000 Author: marius Date: Thu May 30 16:09:56 2013 New Revision: 251142 URL: http://svnweb.freebsd.org/changeset/base/251142 Log: - As a follow-up to r247565, make firmware images that do not require patching at runtime actually const. - Remove pointless softc members by employing the corresponding constants directly. - Remove pointless returns. - Remove unnecessary inclusion of opt_device_polling.h. - Replace an outdated and now bogus comment in bce_tick() with the appropriate one. MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcefw.h head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bce.c Thu May 30 16:09:56 2013 (r251142) @@ -375,7 +375,8 @@ static void bce_release_resources (struc /****************************************************************************/ static void bce_fw_cap_init (struct bce_softc *); static int bce_fw_sync (struct bce_softc *, u32); -static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); +static void bce_load_rv2p_fw (struct bce_softc *, const u32 *, u32, + u32); static void bce_load_cpu_fw (struct bce_softc *, struct cpu_reg *, struct fw_info *); static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); @@ -1019,7 +1020,6 @@ bce_set_tunables(struct bce_softc *sc) sc->bce_tx_ticks = DEFAULT_TX_TICKS; sc->bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; } - } @@ -1332,23 +1332,6 @@ bce_attach(device_t dev) /* Fetch the permanent Ethernet MAC address. */ bce_get_mac_addr(sc); - /* - * Trip points control how many BDs - * should be ready before generating an - * interrupt while ticks control how long - * a BD can sit in the chain before - * generating an interrupt. Set the default - * values for the RX and TX chains. - */ - - /* Not used for L2. */ - sc->bce_comp_prod_trip_int = 0; - sc->bce_comp_prod_trip = 0; - sc->bce_com_ticks_int = 0; - sc->bce_com_ticks = 0; - sc->bce_cmd_ticks_int = 0; - sc->bce_cmd_ticks = 0; - /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; @@ -1935,7 +1918,6 @@ bce_miibus_read_reg(device_t dev, int ph DB_PRINT_PHY_REG(reg, val); return (val & 0xffff); - } @@ -3037,7 +3019,6 @@ bce_get_rx_buffer_sizes(struct bce_softc roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - sc->rx_bd_mbuf_align_pad; - sc->pg_bd_mbuf_alloc_size = MCLBYTES; } else { if ((mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN) > MCLBYTES) { @@ -3067,7 +3048,6 @@ bce_get_rx_buffer_sizes(struct bce_softc sc->rx_bd_mbuf_align_pad); DBEXIT(BCE_VERBOSE_LOAD); - } /****************************************************************************/ @@ -3484,8 +3464,6 @@ bce_dma_map_addr(void *arg, bus_dma_segm } else { *busaddr = segs->ds_addr; } - - return; } @@ -3793,21 +3771,17 @@ bce_dma_alloc(device_t dev) * Create a DMA tag for RX mbufs. */ if (bce_hdr_split == TRUE) - max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? + max_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? MCLBYTES : sc->rx_bd_mbuf_alloc_size); else - max_size = max_seg_size = MJUM9BYTES; - max_segments = 1; + max_size = MJUM9BYTES; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " - "(max size = 0x%jX max segments = %d, max segment " - "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, - max_segments, (uintmax_t) max_seg_size); + "(max size = 0x%jX)\n", __FUNCTION__, (uintmax_t)max_size); if (bus_dma_tag_create(sc->parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - max_size, max_segments, max_seg_size, 0, NULL, NULL, - &sc->rx_mbuf_tag)) { + max_size, 1, max_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate RX mbuf DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3873,12 +3847,9 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for page mbufs. */ - max_size = max_seg_size = ((sc->pg_bd_mbuf_alloc_size < MCLBYTES) ? - MCLBYTES : sc->pg_bd_mbuf_alloc_size); - if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, - sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - max_size, 1, max_seg_size, 0, NULL, NULL, &sc->pg_mbuf_tag)) { + sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, + 1, MCLBYTES, 0, NULL, NULL, &sc->pg_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate page mbuf " "DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -4028,7 +3999,7 @@ bce_fw_sync_exit: /* Nothing. */ /****************************************************************************/ static void -bce_load_rv2p_fw(struct bce_softc *sc, u32 *rv2p_code, +bce_load_rv2p_fw(struct bce_softc *sc, const u32 *rv2p_code, u32 rv2p_code_len, u32 rv2p_proc) { int i; @@ -5244,24 +5215,28 @@ bce_blockinit(struct bce_softc *sc) REG_WR(sc, BCE_HC_STATISTICS_ADDR_H, BCE_ADDR_HI(sc->stats_block_paddr)); - /* Program various host coalescing parameters. */ + /* + * Program various host coalescing parameters. + * Trip points control how many BDs should be ready before generating + * an interrupt while ticks control how long a BD can sit in the chain + * before generating an interrupt. + */ REG_WR(sc, BCE_HC_TX_QUICK_CONS_TRIP, - (sc->bce_tx_quick_cons_trip_int << 16) | sc->bce_tx_quick_cons_trip); + (sc->bce_tx_quick_cons_trip_int << 16) | + sc->bce_tx_quick_cons_trip); REG_WR(sc, BCE_HC_RX_QUICK_CONS_TRIP, - (sc->bce_rx_quick_cons_trip_int << 16) | sc->bce_rx_quick_cons_trip); - REG_WR(sc, BCE_HC_COMP_PROD_TRIP, - (sc->bce_comp_prod_trip_int << 16) | sc->bce_comp_prod_trip); + (sc->bce_rx_quick_cons_trip_int << 16) | + sc->bce_rx_quick_cons_trip); REG_WR(sc, BCE_HC_TX_TICKS, (sc->bce_tx_ticks_int << 16) | sc->bce_tx_ticks); REG_WR(sc, BCE_HC_RX_TICKS, (sc->bce_rx_ticks_int << 16) | sc->bce_rx_ticks); - REG_WR(sc, BCE_HC_COM_TICKS, - (sc->bce_com_ticks_int << 16) | sc->bce_com_ticks); - REG_WR(sc, BCE_HC_CMD_TICKS, - (sc->bce_cmd_ticks_int << 16) | sc->bce_cmd_ticks); - REG_WR(sc, BCE_HC_STATS_TICKS, - (sc->bce_stats_ticks & 0xffff00)); + REG_WR(sc, BCE_HC_STATS_TICKS, sc->bce_stats_ticks & 0xffff00); REG_WR(sc, BCE_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ + /* Not used for L2. */ + REG_WR(sc, BCE_HC_COMP_PROD_TRIP, 0); + REG_WR(sc, BCE_HC_COM_TICKS, 0); + REG_WR(sc, BCE_HC_CMD_TICKS, 0); /* Configure the Host Coalescing block. */ val = BCE_HC_CONFIG_RX_TMR_MODE | BCE_HC_CONFIG_TX_TMR_MODE | @@ -5554,15 +5529,14 @@ bce_get_pg_buf(struct bce_softc *sc, str m_new->m_data = m_new->m_ext.ext_buf; } - m_new->m_len = sc->pg_bd_mbuf_alloc_size; + m_new->m_len = MCLBYTES; /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ map = sc->pg_mbuf_map[*prod_idx]; error = bus_dmamap_load(sc->pg_mbuf_tag, map, mtod(m_new, void *), - sc->pg_bd_mbuf_alloc_size, bce_dma_map_addr, - &busaddr, BUS_DMA_NOWAIT); + MCLBYTES, bce_dma_map_addr, &busaddr, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5586,7 +5560,7 @@ bce_get_pg_buf(struct bce_softc *sc, str pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(busaddr)); pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(busaddr)); - pgbd->rx_bd_len = htole32(sc->pg_bd_mbuf_alloc_size); + pgbd->rx_bd_len = htole32(MCLBYTES); pgbd->rx_bd_flags = htole32(RX_BD_FLAGS_START | RX_BD_FLAGS_END); /* Save the mbuf and update our counter. */ @@ -5974,10 +5948,9 @@ bce_free_rx_chain(struct bce_softc *sc) /* Clear each RX chain page. */ for (i = 0; i < sc->rx_pages; i++) - if (sc->rx_bd_chain[i] != NULL) { + if (sc->rx_bd_chain[i] != NULL) bzero((char *)sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - } sc->free_rx_bd = sc->max_rx_bd; @@ -6041,7 +6014,7 @@ bce_init_pg_chain(struct bce_softc *sc) CTX_WR(sc, GET_CID_ADDR(RX_CID), BCE_L2CTX_RX_PG_BUF_SIZE, 0); /* Configure the rx_bd and page chain mbuf cluster size. */ - val = (sc->rx_bd_mbuf_data_len << 16) | sc->pg_bd_mbuf_alloc_size; + val = (sc->rx_bd_mbuf_data_len << 16) | MCLBYTES; CTX_WR(sc, GET_CID_ADDR(RX_CID), BCE_L2CTX_RX_PG_BUF_SIZE, val); /* Configure the context reserved for jumbo support. */ @@ -7163,10 +7136,9 @@ bce_init_locked(struct bce_softc *sc) ether_mtu = ifp->if_mtu; else { if (bce_hdr_split == TRUE) { - if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + - sc->pg_bd_mbuf_alloc_size)) - ether_mtu = sc->rx_bd_mbuf_data_len + - sc->pg_bd_mbuf_alloc_size; + if (ifp->if_mtu <= sc->rx_bd_mbuf_data_len + MCLBYTES) + ether_mtu = sc->rx_bd_mbuf_data_len + + MCLBYTES; else ether_mtu = ifp->if_mtu; } else { @@ -7194,9 +7166,6 @@ bce_init_locked(struct bce_softc *sc) bce_set_rx_mode(sc); if (bce_hdr_split == TRUE) { - DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", - __FUNCTION__, sc->pg_bd_mbuf_alloc_size); - /* Init page buffer descriptor chain. */ bce_init_pg_chain(sc); } @@ -7690,7 +7659,6 @@ bce_start_locked(struct ifnet *ifp) bce_start_locked_exit: DBEXIT(BCE_VERBOSE_SEND | BCE_VERBOSE_CTX); - return; } @@ -8491,11 +8459,7 @@ bce_tick(void *xsc) /* Update the statistics from the hardware statistics block. */ bce_stats_update(sc); - /* - * ToDo: This is a safety measure. Need to re-evaluate - * high level processing logic and eliminate this code. - */ - /* Top off the receive and page chains. */ + /* Ensure page and RX chains get refilled in low-memory situations. */ if (bce_hdr_split == TRUE) bce_fill_pg_chain(sc); bce_fill_rx_chain(sc); @@ -8544,7 +8508,6 @@ bce_tick(void *xsc) bce_tick_exit: DBEXIT(BCE_EXTREME_MISC); - return; } static void @@ -11627,7 +11590,5 @@ bce_breakpoint(struct bce_softc *sc) /* Call the debugger. */ breakpoint(); - - return; } #endif Modified: head/sys/dev/bce/if_bcefw.h ============================================================================== --- head/sys/dev/bce/if_bcefw.h Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bcefw.h Thu May 30 16:09:56 2013 (r251142) @@ -57,7 +57,7 @@ u32 bce_COM_b06FwSbssAddr = 0x08004aa0; int bce_COM_b06FwSbssLen = 0x38; u32 bce_COM_b06FwSDataAddr = 0x00000000; int bce_COM_b06FwSDataLen = 0x0; -u32 bce_COM_b06FwText[(0x4a68/4) + 1] = { +const u32 bce_COM_b06FwText[(0x4a68/4) + 1] = { 0xa000046, 0x0, 0x0, 0xd, 0x636f6d36, 0x2e302e31, 0x35000000, 0x6000f02, 0x0, 0x3, 0xc8, @@ -1249,14 +1249,14 @@ u32 bce_COM_b06FwText[(0x4a68/4) + 1] = 0x440fffe, 0x24020002, 0xaf5101c0, 0xa34201c4, 0x3c021000, 0xaf4201f8, 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0020, 0x0 }; -u32 bce_COM_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwRodata[(0x14/4) + 1] = { +const u32 bce_COM_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwRodata[(0x14/4) + 1] = { 0x8000acc, 0x8000b14, 0x8000b98, 0x8000be4, 0x8000c20, 0x0 }; -u32 bce_COM_b06FwBss[(0xc4/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwBss[(0xc4/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_RXP_b06FwReleaseMajor = 0x6; @@ -1275,7 +1275,7 @@ u32 bce_RXP_b06FwSbssAddr = 0x08007320; int bce_RXP_b06FwSbssLen = 0x4c; u32 bce_RXP_b06FwSDataAddr = 0x00000000; int bce_RXP_b06FwSDataLen = 0x0; -u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = { +const u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = { 0xa000c84, 0x0, 0x0, 0xd, 0x72787036, 0x2e302e31, 0x35000000, 0x6000f03, 0x0, 0x1, 0x0, @@ -3114,15 +3114,15 @@ u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = 0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3c021000, 0x27bd0028, 0x3e00008, 0xaf4201b8, 0x0 }; -u32 bce_RXP_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwRodata[(0x24/4) + 1] = { +const u32 bce_RXP_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwRodata[(0x24/4) + 1] = { 0x8003430, 0x8003430, 0x80033a8, 0x80033e0, 0x8003414, 0x8003438, 0x8003438, 0x8003438, 0x8003318, 0x0 }; -u32 bce_RXP_b06FwBss[(0x440/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwSbss[(0x4c/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwBss[(0x440/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwSbss[(0x4c/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TPAT_b06FwReleaseMajor = 0x6; @@ -3141,7 +3141,7 @@ u32 bce_TPAT_b06FwSbssAddr = 0x08001c00; int bce_TPAT_b06FwSbssLen = 0x44; u32 bce_TPAT_b06FwSDataAddr = 0x00000000; int bce_TPAT_b06FwSDataLen = 0x0; -u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = { +const u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = { 0xa000124, 0x0, 0x0, 0xd, 0x74706136, 0x2e302e31, 0x35000000, 0x6000f01, 0x0, 0x0, 0x0, @@ -3524,11 +3524,11 @@ u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = 0x14a0fffb, 0x42042, 0xc35021, 0x8fbf0010, 0xa4c02, 0x312200ff, 0x27bd0018, 0xaf8a002c, 0x3e00008, 0xaf890030, 0x0 }; -u32 bce_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TXP_b06FwReleaseMajor = 0x6; @@ -3547,7 +3547,7 @@ u32 bce_TXP_b06FwSbssAddr = 0x08003c20; int bce_TXP_b06FwSbssLen = 0x68; u32 bce_TXP_b06FwSDataAddr = 0x00000000; int bce_TXP_b06FwSDataLen = 0x0; -u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = { +const u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = { 0xa00002a, 0x0, 0x0, 0xd, 0x74787036, 0x2e302e31, 0x35000000, 0x6000f00, 0x0, 0x136, 0xea60, @@ -4509,11 +4509,11 @@ u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = 0x3c010800, 0xac243d58, 0x3c010800, 0xac233d68, 0x3c010800, 0xac223d60, 0x3e00008, 0x0, 0x0 }; -u32 bce_TXP_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwRodata[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwBss[(0x14c/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwSbss[(0x68/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwRodata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwBss[(0x14c/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwSbss[(0x68/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_CP_b06FwReleaseMajor = 0x6; @@ -4532,7 +4532,7 @@ u32 bce_CP_b06FwSbssAddr = 0x08005884; int bce_CP_b06FwSbssLen = 0xf1; u32 bce_CP_b06FwSDataAddr = 0x00000000; int bce_CP_b06FwSDataLen = 0x0; -u32 bce_CP_b06FwText[(0x5688/4) + 1] = { +const u32 bce_CP_b06FwText[(0x5688/4) + 1] = { 0xa000028, 0x0, 0x0, 0xd, 0x6370362e, 0x302e3135, 0x0, 0x6000f04, 0x0, 0x0, 0x0, @@ -5918,7 +5918,7 @@ u32 bce_CP_b06FwText[(0x5688/4) + 1] = { 0x27bd0030, 0x8f83001c, 0x8c620004, 0x10400003, 0x0, 0x3e00008, 0x0, 0x8c640010, 0x8c650008, 0xa001527, 0x8c66000c, 0x0 }; -u32 bce_CP_b06FwData[(0x84/4) + 1] = { +const u32 bce_CP_b06FwData[(0x84/4) + 1] = { 0x0, 0x1b, 0xf, 0xa, 0x8, 0x6, 0x5, 0x5, 0x4, 0x4, 0x3, @@ -5928,7 +5928,7 @@ u32 bce_CP_b06FwData[(0x84/4) + 1] = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x0 }; -u32 bce_CP_b06FwRodata[(0x158/4) + 1] = { +const u32 bce_CP_b06FwRodata[(0x158/4) + 1] = { 0x8000f24, 0x8000d6c, 0x8000fb8, 0x8001060, 0x8000f4c, 0x8000f8c, 0x8001194, 0x8000d88, 0x80011b8, 0x8000dd8, 0x8001554, @@ -5951,12 +5951,12 @@ u32 bce_CP_b06FwRodata[(0x158/4) + 1] = 0x8002e1c, 0x8002de4, 0x8002df0, 0x8002dfc, 0x8002e08, 0x80052e8, 0x80052a8, 0x8005274, 0x8005248, 0x8005224, 0x80051e0, 0x0 }; -u32 bce_CP_b06FwBss[(0x5d8/4) + 1] = { 0x0 }; -u32 bce_CP_b06FwSbss[(0xf1/4) + 1] = { 0x0 }; -u32 bce_CP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwBss[(0x5d8/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwSbss[(0xf1/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; -u32 bce_rv2p_proc1[] = { +const u32 bce_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x0106000f, 0x00000008, 0x0500ffff, @@ -6681,7 +6681,7 @@ u32 bce_TXP_b09FwSbssAddr = 0x08003d88; int bce_TXP_b09FwSbssLen = 0x64; u32 bce_TXP_b09FwSDataAddr = 0x00000000; int bce_TXP_b09FwSDataLen = 0x0; -u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = { +const u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = { 0xa00002a, 0x0, 0x0, 0xd, 0x74787036, 0x2e302e31, 0x37000000, 0x6001100, 0x0, 0x136, 0xea60, @@ -7661,15 +7661,15 @@ u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = 0xac263fcc, 0x3c010800, 0xac253fc4, 0x3c010800, 0xac243fc0, 0x3c010800, 0xac233fd0, 0x3c010800, 0xac223fc8, 0x3e00008, 0x0, 0x0 }; -u32 bce_TXP_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwRodata[(0x30/4) + 1] = { +const u32 bce_TXP_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwRodata[(0x30/4) + 1] = { 0x80000940, 0x80000900, 0x80080100, 0x80080080, 0x80080000, 0x800e0000, 0x80080080, 0x80080000, 0x80000a80, 0x80000a00, 0x80000980, 0x80000900, 0x0 }; -u32 bce_TXP_b09FwBss[(0x24c/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwSbss[(0x64/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwBss[(0x24c/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwSbss[(0x64/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TPAT_b09FwReleaseMajor = 0x6; @@ -7688,7 +7688,7 @@ u32 bce_TPAT_b09FwSbssAddr = 0x08001720; int bce_TPAT_b09FwSbssLen = 0x3c; u32 bce_TPAT_b09FwSDataAddr = 0x00000000; int bce_TPAT_b09FwSDataLen = 0x0; -u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = { +const u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = { 0xa000124, 0x0, 0x0, 0xd, 0x74706136, 0x2e302e31, 0x37000000, 0x6001101, 0x0, 0x0, 0x0, @@ -7994,12 +7994,12 @@ u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = 0x0, 0x0, 0x2402ffff, 0x2463ffff, 0x1462fffa, 0x24840004, 0x3e00008, 0x0, 0x0 }; -u32 bce_TPAT_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwRodata[(0x4/4) + 1] = { +const u32 bce_TPAT_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwRodata[(0x4/4) + 1] = { 0x1, 0x0 }; -u32 bce_TPAT_b09FwBss[(0x12b4/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwSbss[(0x3c/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwBss[(0x12b4/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwSbss[(0x3c/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_COM_b09FwReleaseMajor = 0x6; @@ -8018,7 +8018,7 @@ u32 bce_COM_b09FwSbssAddr = 0x08005608; int bce_COM_b09FwSbssLen = 0x30; u32 bce_COM_b09FwSDataAddr = 0x00000000; int bce_COM_b09FwSDataLen = 0x0; -u32 bce_COM_b09FwText[(0x5594/4) + 1] = { +const u32 bce_COM_b09FwText[(0x5594/4) + 1] = { 0xa000046, 0x0, 0x0, 0xd, 0x636f6d36, 0x2e302e31, 0x37000000, 0x6001102, 0x0, 0x3, 0xc8, @@ -9389,15 +9389,15 @@ u32 bce_COM_b09FwText[(0x5594/4) + 1] = 0x40f809, 0x0, 0xa001560, 0x0, 0xd, 0x3c1c0800, 0x279c5608, 0x8fbf0010, 0x3e00008, 0x27bd0018, 0x0 }; -u32 bce_COM_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwRodata[(0x38/4) + 1] = { +const u32 bce_COM_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwRodata[(0x38/4) + 1] = { 0x80080240, 0x80080100, 0x80080080, 0x80080000, 0xc80, 0x3200, 0x8000e98, 0x8000ef4, 0x8000f88, 0x8001028, 0x8001074, 0x80080100, 0x80080080, 0x80080000, 0x0 }; -u32 bce_COM_b09FwBss[(0x11c/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwSbss[(0x30/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwBss[(0x11c/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwSbss[(0x30/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_RXP_b09FwReleaseMajor = 0x6; @@ -9416,7 +9416,7 @@ u32 bce_RXP_b09FwSbssAddr = 0x08009400; int bce_RXP_b09FwSbssLen = 0x78; u32 bce_RXP_b09FwSDataAddr = 0x00000000; int bce_RXP_b09FwSDataLen = 0x0; -u32 bce_RXP_b09FwText[(0x9090/4) + 1] = { +const u32 bce_RXP_b09FwText[(0x9090/4) + 1] = { 0xa000c84, 0x0, 0x0, 0xd, 0x72787036, 0x2e302e31, 0x37000000, 0x6001103, 0x0, 0x1, 0x0, @@ -11786,9 +11786,9 @@ u32 bce_RXP_b09FwRodata[(0x33c/4) + 1] = 0x8007fc0, 0x8007fc0, 0x8007fc0, 0x8007fc0, 0x8007fe8, 0x8008b6c, 0x8008cc8, 0x8008ca8, 0x8008710, 0x8008b84, 0x0 }; -u32 bce_RXP_b09FwBss[(0x1bc/4) + 1] = { 0x0 }; -u32 bce_RXP_b09FwSbss[(0x78/4) + 1] = { 0x0 }; -u32 bce_RXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwBss[(0x1bc/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwSbss[(0x78/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_CP_b09FwReleaseMajor = 0x6; @@ -11807,7 +11807,7 @@ u32 bce_CP_b09FwSbssAddr = 0x080059b0; int bce_CP_b09FwSbssLen = 0xa8; u32 bce_CP_b09FwSDataAddr = 0x00000000; int bce_CP_b09FwSDataLen = 0x0; -u32 bce_CP_b09FwText[(0x5744/4) + 1] = { +const u32 bce_CP_b09FwText[(0x5744/4) + 1] = { 0xa000028, 0x0, 0x0, 0xd, 0x6370362e, 0x302e3137, 0x0, 0x6001104, 0x0, 0x0, 0x0, @@ -13205,7 +13205,7 @@ u32 bce_CP_b09FwText[(0x5744/4) + 1] = { 0xa00156a, 0x8fbf001c, 0xe0010d1, 0x0, 0x5040ff9e, 0x8fbf001c, 0x9259007d, 0x3330003f, 0xa0015c6, 0x36020040, 0x0 }; -u32 bce_CP_b09FwData[(0x84/4) + 1] = { +const u32 bce_CP_b09FwData[(0x84/4) + 1] = { 0x0, 0x1b, 0xf, 0xa, 0x8, 0x6, 0x5, 0x5, 0x4, 0x4, 0x3, @@ -13215,7 +13215,7 @@ u32 bce_CP_b09FwData[(0x84/4) + 1] = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x0 }; -u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = { +const u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = { 0x80080100, 0x80080080, 0x80080000, 0xc00, 0x3080, 0x80011d0, 0x800127c, 0x8001294, 0x80012a8, @@ -13245,12 +13245,12 @@ u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = 0x80080080, 0x80080000, 0x80080080, 0x8004c64, 0x8004c9c, 0x8004be4, 0x8004c64, 0x8004c64, 0x80049b8, 0x8004c64, 0x8005050, 0x0 }; -u32 bce_CP_b09FwBss[(0x19c/4) + 1] = { 0x0 }; -u32 bce_CP_b09FwSbss[(0xa8/4) + 1] = { 0x0 }; -u32 bce_CP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwBss[(0x19c/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwSbss[(0xa8/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; -u32 bce_xi_rv2p_proc1[] = { +const u32 bce_xi_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x05060011, 0x00000008, 0x0500ffff, @@ -13541,7 +13541,7 @@ u32 bce_xi_rv2p_proc1[] = { }; -u32 bce_xi_rv2p_proc2[] = { +const u32 bce_xi_rv2p_proc2[] = { 0x00000010, 0xb1800004, 0x0000001f, 0x05060011, 0x00000008, 0x050000ff, @@ -14008,9 +14008,9 @@ u32 bce_xi_rv2p_proc2[] = { 0x00000010, 0x001f0000, 0x00000018, 0x8000fe35, }; - -u32 bce_xi90_rv2p_proc1[] = { + +const u32 bce_xi90_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x03060011, 0x00000008, 0x0500ffff, @@ -14316,7 +14316,7 @@ u32 bce_xi90_rv2p_proc1[] = { }; -u32 bce_xi90_rv2p_proc2[] = { +const u32 bce_xi90_rv2p_proc2[] = { 0x00000010, 0xb1800004, 0x0000001f, 0x03060011, 0x00000008, 0x050000ff, @@ -14849,6 +14849,3 @@ u32 bce_xi90_rv2p_proc2[] = { bce_rv2p_proc2[BCE_RV2P_PROC2_MAX_BD_PAGE_LOC] = \ (bce_rv2p_proc2[BCE_RV2P_PROC2_MAX_BD_PAGE_LOC] & ~0xFFFF) | (value); \ } - - - Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bcereg.h Thu May 30 16:09:56 2013 (r251142) @@ -32,10 +32,6 @@ #ifndef _BCEREG_H_DEFINED #define _BCEREG_H_DEFINED -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" -#endif - #include #include #include @@ -6336,13 +6332,13 @@ struct fw_info { u32 bss_addr; u32 bss_len; u32 bss_index; - u32 *bss; + const u32 *bss; /* Read-only section. */ u32 rodata_addr; u32 rodata_len; u32 rodata_index; - u32 *rodata; + const u32 *rodata; }; #define RV2P_PROC1 0 @@ -6421,6 +6417,8 @@ struct fw_info { struct bce_softc { + struct mtx bce_mtx; + /* Interface info */ struct ifnet *bce_ifp; @@ -6448,8 +6446,6 @@ struct bce_softc /* IRQ Resource Handle */ struct resource *bce_res_irq; - struct mtx bce_mtx; - /* Interrupt handler. */ void *bce_intrhand; @@ -6563,14 +6559,6 @@ struct bce_softc u16 bce_rx_ticks; u32 bce_stats_ticks; - /* ToDo: Can these be removed? */ - u16 bce_comp_prod_trip_int; - u16 bce_comp_prod_trip; - u16 bce_com_ticks_int; - u16 bce_com_ticks; - u16 bce_cmd_ticks_int; - u16 bce_cmd_ticks; - /* The address of the integrated PHY on the MII bus. */ int bce_phy_addr; @@ -6603,11 +6591,9 @@ struct bce_softc int watchdog_timer; /* Frame size and mbuf allocation size for RX frames. */ - u32 max_frame_size; int rx_bd_mbuf_alloc_size; int rx_bd_mbuf_data_len; int rx_bd_mbuf_align_pad; - int pg_bd_mbuf_alloc_size; /* Receive mode settings (i.e promiscuous, multicast, etc.). */ u32 rx_mode; From owner-svn-src-all@FreeBSD.ORG Thu May 30 16:16:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C96A3C40; Thu, 30 May 2013 16:16:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA7612AD; Thu, 30 May 2013 16:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UGGTtO054442; Thu, 30 May 2013 16:16:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UGGStA054435; Thu, 30 May 2013 16:16:28 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201305301616.r4UGGStA054435@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 30 May 2013 16:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251143 - in head/contrib/byacc: . package package/debian test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 16:16:29 -0000 Author: bapt Date: Thu May 30 16:16:28 2013 New Revision: 251143 URL: http://svnweb.freebsd.org/changeset/base/251143 Log: Update byacc to 20130304 Modified: head/contrib/byacc/CHANGES head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/config_h.in head/contrib/byacc/configure head/contrib/byacc/configure.in head/contrib/byacc/main.c head/contrib/byacc/makefile.in head/contrib/byacc/output.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/skeleton.c head/contrib/byacc/test/calc.tab.c head/contrib/byacc/test/calc1.tab.c head/contrib/byacc/test/calc1.y head/contrib/byacc/test/calc2.tab.c head/contrib/byacc/test/calc3.tab.c head/contrib/byacc/test/code_calc.code.c head/contrib/byacc/test/code_error.code.c head/contrib/byacc/test/error.tab.c head/contrib/byacc/test/ftp.output head/contrib/byacc/test/ftp.tab.c head/contrib/byacc/test/ftp.tab.h head/contrib/byacc/test/ftp.y head/contrib/byacc/test/grammar.tab.c head/contrib/byacc/test/pure_calc.tab.c head/contrib/byacc/test/pure_error.tab.c head/contrib/byacc/test/quote_calc-s.tab.c head/contrib/byacc/test/quote_calc.tab.c head/contrib/byacc/test/quote_calc2-s.tab.c head/contrib/byacc/test/quote_calc2.tab.c head/contrib/byacc/test/quote_calc3-s.tab.c head/contrib/byacc/test/quote_calc3.tab.c head/contrib/byacc/test/quote_calc4-s.tab.c head/contrib/byacc/test/quote_calc4.tab.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/CHANGES Thu May 30 16:16:28 2013 (r251143) @@ -1,3 +1,117 @@ +2013-03-04 Thomas E. Dickey + + * package/debian/changelog, VERSION, package/byacc.spec: bump + + * aclocal.m4: + adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf. + + * output.c: + fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton). + also while testing that, found a case where the union_file is unused; added + a check for address that. + + * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen + + * test/ftp.y: fix most compiler warnings for "make check_make" + + * test/calc1.tab.c: regen + + * test/calc1.y: fix most compiler warnings for "make check_make" + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: quiet a gcc conversion-warning in yygrowstack() + + * configure: regen + + * aclocal.m4: + another fix for CF_GCC_VERSION to handle Debian's modification of gcc message. + +2013-02-10 Thomas E. Dickey + + * config.sub, config.guess: 2013-02-04 + +2012-10-03 Thomas E. Dickey + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * configure: regen + + * configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC + + * aclocal.m4: + moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc) + the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor. + + * aclocal.m4, configure.in: + Arian's change dropped my check for misused $CC variable - restore that with + alternate macro CF_PROG_CC. + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since + they are not needed. + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in + Adrian's suggested changes. + + * aclocal.m4: + CF_CLANG_COMPILER - check if the given compiler is really clang. + + * aclocal.m4: + add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around + old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1 + on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's + pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work + around by excluding that check for pre-3.x compilers. + + * aclocal.m4: + modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions + provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather + than appending to confdefs.h, since long-ago concern about the ability to + pass-through parameterized macros appears to be not a problem, testing with + 2.13 and 2.52 + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by + autoheader, updated macros: + CF_CHECK_CACHE + CF_DISABLE_LEAKS + CF_MKSTEMP + CF_MIXEDCASE_FILENAMES + CF_NO_LEAKS_OPTION + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + move existence-check for mkstemp out of the AC_TRY_RUN, to help with + cross-compiles + +2012-10-02 Thomas E. Dickey + + * config_h.in: + Adrian Bunk request - replace this with the output from autoheader + +2012-09-29 Adrian.Bunk + + * configure.in: + suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no + check is needed anymore for standard C compilers), drop AC_CONST (same + reason), modify AC_OUTPUT to rely upon template generated by autoheader. + bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT + as being obsolete with autoconf 2.52x + + * configure.in, main.c: drop check for atexit, because it is standard C + + * makefile.in: add assignment for datarootdir variable. + 2012-05-26 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/VERSION Thu May 30 16:16:28 2013 (r251143) @@ -1 +1 @@ -20120526 +20130304 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/aclocal.m4 Thu May 30 16:16:28 2013 (r251143) @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.19 2012/01/13 14:10:56 tom Exp $ +dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2011,2012 Thomas E. Dickey +dnl Copyright 2004-2012,2013 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -28,6 +28,32 @@ dnl sale, use or other dealings in this dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl ------------------ +dnl Conditionally generate script according to whether we're using a given autoconf. +dnl +dnl $1 = version to compare against +dnl $2 = code to use if AC_ACVERSION is at least as high as $1. +dnl $3 = code to use if AC_ACVERSION is older than $1. +define([CF_ACVERSION_CHECK], +[ +ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([m4_version_compare], +[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], +[CF_ACVERSION_COMPARE( +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 +dnl -------------------- +dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, +dnl MAJOR2, MINOR2, TERNARY2, +dnl PRINTABLE2, not FOUND, FOUND) +define([CF_ACVERSION_COMPARE], +[ifelse(builtin([eval], [$2 < $5]), 1, +[ifelse([$8], , ,[$8])], +[ifelse([$9], , ,[$9])])])dnl +dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS @@ -116,97 +142,6 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45 -dnl ---------------- -dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and -dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution. -AC_DEFUN([CF_ANSI_CC_CHECK], -[ -# This should have been defined by AC_PROG_CC -: ${CC:=cc} - -# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content -# into CC. This will not help with broken scripts that wrap the compiler with -# options, but eliminates a more common category of user confusion. -AC_MSG_CHECKING(\$CC variable) -case "$CC" in #(vi -*[[\ \ ]]-[[IUD]]*) - AC_MSG_RESULT(broken) - AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) - # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` - CC=`echo "$CC" | sed -e 's/[[ ]].*//'` - CF_ADD_CFLAGS($cf_flags) - ;; -*) - AC_MSG_RESULT(ok) - ;; -esac - -AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do - CF_ADD_CFLAGS($cf_arg) - AC_TRY_COMPILE( -[ -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif -],[ - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);};], - [cf_cv_ansi_cc="$cf_arg"; break]) -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" -]) - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CF_ADD_CFLAGS($cf_cv_ansi_cc) -else - AC_DEFINE(CC_HAS_PROTOS) -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 -dnl --------------- -dnl For programs that must use an ANSI compiler, obtain compiler options that -dnl will make it recognize prototypes. We'll do preprocessor checks in other -dnl macros, since tools such as unproto can fake prototypes, but only part of -dnl the preprocessor. -AC_DEFUN([CF_ANSI_CC_REQD], -[AC_REQUIRE([CF_ANSI_CC_CHECK]) -if test "$cf_cv_ansi_cc" = "no"; then - AC_MSG_ERROR( -[Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto]) -fi -])dnl -dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. @@ -236,7 +171,33 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 +dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49 +dnl --------------- +dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content +dnl into CC. This will not help with broken scripts that wrap the compiler with +dnl options, but eliminates a more common category of user confusion. +AC_DEFUN([CF_CC_ENV_FLAGS], +[ +# This should have been defined by AC_PROG_CC +: ${CC:=cc} + +AC_MSG_CHECKING(\$CC variable) +case "$CC" in #(vi +*[[\ \ ]]-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + # humor him... + cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` + CC=`echo "$CC" | sed -e 's/[[ ]].*//'` + CF_ADD_CFLAGS($cf_flags) + ;; +*) + AC_MSG_RESULT(ok) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -259,7 +220,7 @@ else system_name="`(hostname) 2>/dev/null`" fi fi -test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" @@ -271,7 +232,40 @@ if test ".$system_name" != ".$cf_cv_syst fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57 +dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39 +dnl ----------------- +dnl Check if the given compiler is really clang. clang's C driver defines +dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does +dnl not ignore some gcc options. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_CLANG_COMPILER],[ +ifelse([$2],,CLANG_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) + cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" + ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" + AC_TRY_COMPILE([],[ +#ifdef __clang__ +#else +make an error +#endif +],[ifelse([$2],,CLANG_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. @@ -286,7 +280,7 @@ dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, - [ --disable-echo display "compiling" commands], + [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' @@ -308,7 +302,7 @@ AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 +dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -326,12 +320,12 @@ AC_ARG_ENABLE(leaks, AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then - AC_DEFINE(NO_LEAKS) - AC_DEFINE(YY_NO_LEAKS) + AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) + AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -409,27 +403,27 @@ EOF test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute) cat conftest.h >>confdefs.h case $cf_attribute in #(vi + noreturn) #(vi + AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) + ;; printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 +dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], - [AC_DEFINE($3)ifelse([$4],,[ + [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} @@ -858,29 +863,17 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 -dnl ----------- -dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. -AC_DEFUN([CF_PROG_EXT], -[ -AC_REQUIRE([CF_CHECK_CACHE]) -case $cf_cv_system_name in -os2*) - CFLAGS="$CFLAGS -Zmt" - CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt" - # autoconf's macro sets -Zexe and suffix both, which conflict:w - LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" - ac_cv_exeext=.exe - ;; -esac - -AC_EXEEXT -AC_OBJEXT - -PROG_EXT="$EXEEXT" -AC_SUBST(PROG_EXT) -test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") +dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl ---------- +dnl standard check for CC, plus followup sanity checks +dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name +AC_DEFUN([CF_PROG_CC],[ +ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) +CF_GCC_VERSION +CF_ACVERSION_CHECK(2.52, + [AC_PROG_CC_STDC], + [CF_ANSI_CC_REQD]) +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 @@ -1025,7 +1018,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49 +dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1035,6 +1028,7 @@ dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ +AC_REQUIRE([AC_CANONICAL_HOST]) cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/config.guess Thu May 30 16:16:28 2013 (r251143) @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2911 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2011-01-01' +timestamp='2013-02-04' # This file 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 +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,26 +15,22 @@ timestamp='2011-01-01' # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +137,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -202,6 +194,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -220,10 +216,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) + *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac @@ -304,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -600,50 +596,50 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -792,21 +788,26 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,15 +862,22 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi @@ -877,30 +885,39 @@ EOF exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ - grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif @@ -937,7 +954,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -972,13 +989,13 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1096,7 +1113,7 @@ EOF && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1139,8 +1156,8 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) @@ -1168,9 +1185,9 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1185,6 +1202,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1215,12 +1235,12 @@ EOF i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi fi ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 16:51:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E250F703; Thu, 30 May 2013 16:51:49 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C492165B; Thu, 30 May 2013 16:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UGpnb9066971; Thu, 30 May 2013 16:51:49 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UGpms6066966; Thu, 30 May 2013 16:51:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305301651.r4UGpms6066966@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 16:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251144 - in stable/9/sys: fs/udf kern sys ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 16:51:50 -0000 Author: scottl Date: Thu May 30 16:51:48 2013 New Revision: 251144 URL: http://svnweb.freebsd.org/changeset/base/251144 Log: MFC r248282, in a modified fashion. From the original changelog: Add currently unused flag argument to the cluster_read(), cluster_write() and cluster_wbuild() functions. The flags to be allowed are a subset of the GB_* flags for getblk(). This merge adds a cluster_*_gb() API variant instead of changing the ABI with an added argument to the existing API. Most API consumers that were changed in the original rev have been left un-changed in this merge to reduce churn. The mergeinfo is recorded though for future merging convenience. This is effectively a no-op for the moment. Submitted by: kib, FF Obtained from: Netflix Modified: stable/9/sys/fs/udf/udf_vnops.c stable/9/sys/kern/vfs_bio.c stable/9/sys/kern/vfs_cluster.c stable/9/sys/sys/buf.h stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -479,8 +479,9 @@ udf_read(struct vop_read_args *ap) rablock = lbn + 1; if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { if (lblktosize(udfmp, rablock) < fsize) { - error = cluster_read(vp, fsize, lbn, size, NOCRED, - uio->uio_resid, (ap->a_ioflag >> 16), &bp); + error = cluster_read(vp, fsize, lbn, size, + NOCRED, uio->uio_resid, + (ap->a_ioflag >> 16), &bp); } else { error = bread(vp, lbn, size, NOCRED, &bp); } Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144) @@ -1830,7 +1830,7 @@ vfs_bio_awrite(struct buf *bp) if (ncl != 1) { BUF_UNLOCK(bp); nwritten = cluster_wbuild(vp, size, lblkno - j, ncl); - return nwritten; + return (nwritten); } } bremfree(bp); Modified: stable/9/sys/kern/vfs_cluster.c ============================================================================== --- stable/9/sys/kern/vfs_cluster.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_cluster.c Thu May 30 16:51:48 2013 (r251144) @@ -87,15 +87,18 @@ extern vm_page_t bogus_page; * cluster_read replaces bread. */ int -cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) - struct vnode *vp; - u_quad_t filesize; - daddr_t lblkno; - long size; - struct ucred *cred; - long totread; - int seqcount; - struct buf **bpp; +cluster_read(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, struct buf **bpp) +{ + + return (cluster_read_gb(vp, filesize, lblkno, size, cred, totread, + seqcount, 0, bpp)); +} + +int +cluster_read_gb(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, int gbflags, + struct buf **bpp) { struct buf *bp, *rbp, *reqbp; struct bufobj *bo; @@ -610,6 +613,14 @@ cluster_wbuild_wb(struct vnode *vp, long void cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount) { + + cluster_write_gb(vp, bp, filesize, seqcount, 0); +} + +void +cluster_write_gb(struct vnode *vp, struct buf *bp, u_quad_t filesize, + int seqcount, int gbflags) +{ daddr_t lbn; int maxclen, cursize; int lblocksize; @@ -754,11 +765,15 @@ cluster_write(struct vnode *vp, struct b * the current block (if last_bp == NULL). */ int -cluster_wbuild(vp, size, start_lbn, len) - struct vnode *vp; - long size; - daddr_t start_lbn; - int len; +cluster_wbuild(struct vnode *vp, long size, daddr_t start_lbn, int len) +{ + + return (cluster_wbuild_gb(vp, size, start_lbn, len, 0)); +} + +int +cluster_wbuild_gb(struct vnode *vp, long size, daddr_t start_lbn, int len, + int gbflags) { struct buf *bp, *tbp; struct bufobj *bo; Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144) @@ -514,6 +514,10 @@ int cluster_read(struct vnode *, u_quad_ struct ucred *, long, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int); +int cluster_read_gb(struct vnode *, u_quad_t, daddr_t, long, + struct ucred *, long, int, int, struct buf **); +int cluster_wbuild_gb(struct vnode *, long, daddr_t, int, int); +void cluster_write_gb(struct vnode *, struct buf *, u_quad_t, int, int); void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -518,7 +518,8 @@ ffs_read(ap) * doing sequential access. */ error = cluster_read(vp, ip->i_size, lbn, - size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); + size, NOCRED, blkoffset + uio->uio_resid, + seqcount, &bp); } else if (seqcount > 1) { /* * If we are NOT allowed to cluster, then From owner-svn-src-all@FreeBSD.ORG Thu May 30 17:17:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F965B8D; Thu, 30 May 2013 17:17:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27C287AF; Thu, 30 May 2013 17:17:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UHHNEc075333; Thu, 30 May 2013 17:17:23 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UHHMub075329; Thu, 30 May 2013 17:17:22 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305301717.r4UHHMub075329@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 17:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251145 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 17:17:23 -0000 Author: scottl Date: Thu May 30 17:17:22 2013 New Revision: 251145 URL: http://svnweb.freebsd.org/changeset/base/251145 Log: MFC r248504: Add a convenience macro bread_gb() to wrap a call to breadn_flags(). Comparing with bread(), it adds an argument to pass the flags to getblk(). The API implementation of bread() and friends is different in FreeBSD 9, so this merge is a little more complicated than the original commit. Submitted by: kib, FF Obtained from: Netflix Modified: stable/9/sys/kern/vfs_bio.c stable/9/sys/sys/buf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144) +++ stable/9/sys/kern/vfs_bio.c Thu May 30 17:17:22 2013 (r251145) @@ -833,6 +833,18 @@ breada(struct vnode * vp, daddr_t * rabl } /* + * Operates like bread, but with getblk flags. + */ +int +bread_gb(struct vnode * vp, daddr_t blkno, int cnt, struct ucred * cred, + int gbflags, struct buf **bpp) +{ + + return (breadn_flags(vp, blkno, cnt, NULL, NULL, 0, + cred, gbflags, bpp)); +} + +/* * Operates like bread, but also starts asynchronous I/O on * read-ahead blocks. */ Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144) +++ stable/9/sys/sys/buf.h Thu May 30 17:17:22 2013 (r251145) @@ -484,6 +484,8 @@ int buf_dirty_count_severe(void); void bremfree(struct buf *); void bremfreef(struct buf *); /* XXX Force bremfree, only for nfs. */ int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); +int bread_gb(struct vnode *, daddr_t, int, struct ucred *, + int gbflags, struct buf **); void breada(struct vnode *, daddr_t *, int *, int, struct ucred *); int breadn(struct vnode *, daddr_t, int, daddr_t *, int *, int, struct ucred *, struct buf **); From owner-svn-src-all@FreeBSD.ORG Thu May 30 17:24:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01670265; Thu, 30 May 2013 17:24:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E799383B; Thu, 30 May 2013 17:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UHOaJn078319; Thu, 30 May 2013 17:24:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UHOadW078318; Thu, 30 May 2013 17:24:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301724.r4UHOadW078318@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 17:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251146 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 17:24:37 -0000 Author: marius Date: Thu May 30 17:24:36 2013 New Revision: 251146 URL: http://svnweb.freebsd.org/changeset/base/251146 Log: - Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are not altered or actually needed there any longer. - Honor errors passed to the DMA mapping callbacks. - In bce_get_rx_buf(), do not reserve stack space for more DMA segments than actually necessary. - In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9). - In bce_rx_intr(), remove a pointless check for an empty mbuf pointer which can only happen in case of a severe programming error. Moreover, recovering from that situation would require way more actions with header splitting enabled (which it is by default). - Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the firmware has been told to keep it. [1] Obtained from: OpenBSD [1] MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 17:17:22 2013 (r251145) +++ head/sys/dev/bce/if_bce.c Thu May 30 17:24:36 2013 (r251146) @@ -399,14 +399,12 @@ static int bce_blockinit (struct bce static int bce_init_tx_chain (struct bce_softc *); static void bce_free_tx_chain (struct bce_softc *); -static int bce_get_rx_buf (struct bce_softc *, - struct mbuf *, u16 *, u16 *, u32 *); +static int bce_get_rx_buf (struct bce_softc *, u16, u16, u32 *); static int bce_init_rx_chain (struct bce_softc *); static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -static int bce_get_pg_buf (struct bce_softc *, - struct mbuf *, u16 *, u16 *); +static int bce_get_pg_buf (struct bce_softc *, u16, u16); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); static void bce_free_pg_chain (struct bce_softc *); @@ -3544,7 +3542,7 @@ bce_dma_alloc(device_t dev) sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, &sc->status_block_paddr, BUS_DMA_NOWAIT); - if (error) { + if (error || sc->status_block_paddr == 0) { BCE_PRINTF("%s(%d): Could not map status block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3581,7 +3579,7 @@ bce_dma_alloc(device_t dev) sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, &sc->stats_block_paddr, BUS_DMA_NOWAIT); - if(error) { + if (error || sc->stats_block_paddr == 0) { BCE_PRINTF("%s(%d): Could not map statistics block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3633,7 +3631,7 @@ bce_dma_alloc(device_t dev) sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, &sc->ctx_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->ctx_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map CTX " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3678,7 +3676,7 @@ bce_dma_alloc(device_t dev) BCE_TX_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->tx_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->tx_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map TX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3755,7 +3753,7 @@ bce_dma_alloc(device_t dev) BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->rx_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->rx_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map RX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3832,7 +3830,7 @@ bce_dma_alloc(device_t dev) BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->pg_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map page descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -5351,29 +5349,27 @@ bce_blockinit_exit: /* 0 for success, positive value for failure. */ /****************************************************************************/ static int -bce_get_rx_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, - u16 *chain_prod, u32 *prod_bseq) +bce_get_rx_buf(struct bce_softc *sc, u16 prod, u16 chain_prod, u32 *prod_bseq) { - bus_dmamap_t map; - bus_dma_segment_t segs[BCE_MAX_SEGMENTS]; + bus_dma_segment_t segs[1]; struct mbuf *m_new = NULL; struct rx_bd *rxbd; int nsegs, error, rc = 0; #ifdef BCE_DEBUG - u16 debug_chain_prod = *chain_prod; + u16 debug_chain_prod = chain_prod; #endif DBENTER(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); /* Make sure the inputs are valid. */ - DBRUNIF((*chain_prod > MAX_RX_BD_ALLOC), + DBRUNIF((chain_prod > MAX_RX_BD_ALLOC), BCE_PRINTF("%s(%d): RX producer out of range: " "0x%04X > 0x%04X\n", __FILE__, __LINE__, - *chain_prod, (u16) MAX_RX_BD_ALLOC)); + chain_prod, (u16)MAX_RX_BD_ALLOC)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(enter): prod = 0x%04X, " "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", __FUNCTION__, - *prod, *chain_prod, *prod_bseq); + prod, chain_prod, *prod_bseq); /* Update some debug statistic counters */ DBRUNIF((sc->free_rx_bd < sc->rx_low_watermark), @@ -5381,35 +5377,28 @@ bce_get_rx_buf(struct bce_softc *sc, str DBRUNIF((sc->free_rx_bd == sc->max_rx_bd), sc->rx_empty_count++); - /* Check whether this is a new mbuf allocation. */ - if (m == NULL) { + /* Simulate an mbuf allocation failure. */ + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; + rc = ENOBUFS; + goto bce_get_rx_buf_exit); - /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), - sc->mbuf_alloc_failed_count++; - sc->mbuf_alloc_failed_sim_count++; - rc = ENOBUFS; - goto bce_get_rx_buf_exit); - - /* This is a new mbuf allocation. */ - if (bce_hdr_split == TRUE) - MGETHDR(m_new, M_NOWAIT, MT_DATA); - else - m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, - sc->rx_bd_mbuf_alloc_size); - - if (m_new == NULL) { - sc->mbuf_alloc_failed_count++; - rc = ENOBUFS; - goto bce_get_rx_buf_exit; - } + /* This is a new mbuf allocation. */ + if (bce_hdr_split == TRUE) + MGETHDR(m_new, M_NOWAIT, MT_DATA); + else + m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + sc->rx_bd_mbuf_alloc_size); - DBRUN(sc->debug_rx_mbuf_alloc++); - } else { - /* Reuse an existing mbuf. */ - m_new = m; + if (m_new == NULL) { + sc->mbuf_alloc_failed_count++; + rc = ENOBUFS; + goto bce_get_rx_buf_exit; } + DBRUN(sc->debug_rx_mbuf_alloc++); + /* Make sure we have a valid packet header. */ M_ASSERTPKTHDR(m_new); @@ -5420,9 +5409,8 @@ bce_get_rx_buf(struct bce_softc *sc, str /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ - map = sc->rx_mbuf_map[*chain_prod]; - error = bus_dmamap_load_mbuf_sg(sc->rx_mbuf_tag, map, m_new, - segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->rx_mbuf_tag, + sc->rx_mbuf_map[chain_prod], m_new, segs, &nsegs, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5443,7 +5431,7 @@ bce_get_rx_buf(struct bce_softc *sc, str __FUNCTION__, nsegs)); /* Setup the rx_bd for the segment. */ - rxbd = &sc->rx_bd_chain[RX_PAGE(*chain_prod)][RX_IDX(*chain_prod)]; + rxbd = &sc->rx_bd_chain[RX_PAGE(chain_prod)][RX_IDX(chain_prod)]; rxbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[0].ds_addr)); rxbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[0].ds_addr)); @@ -5452,15 +5440,15 @@ bce_get_rx_buf(struct bce_softc *sc, str *prod_bseq += segs[0].ds_len; /* Save the mbuf and update our counter. */ - sc->rx_mbuf_ptr[*chain_prod] = m_new; + sc->rx_mbuf_ptr[chain_prod] = m_new; sc->free_rx_bd -= nsegs; DBRUNMSG(BCE_INSANE_RECV, bce_dump_rx_mbuf_chain(sc, debug_chain_prod, nsegs)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(exit): prod = 0x%04X, " - "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", - __FUNCTION__, *prod, *chain_prod, *prod_bseq); + "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", __FUNCTION__, prod, + chain_prod, *prod_bseq); bce_get_rx_buf_exit: DBEXIT(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); @@ -5476,67 +5464,56 @@ bce_get_rx_buf_exit: /* 0 for success, positive value for failure. */ /****************************************************************************/ static int -bce_get_pg_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, - u16 *prod_idx) +bce_get_pg_buf(struct bce_softc *sc, u16 prod, u16 prod_idx) { - bus_dmamap_t map; - bus_addr_t busaddr; + bus_dma_segment_t segs[1]; struct mbuf *m_new = NULL; struct rx_bd *pgbd; - int error, rc = 0; + int error, nsegs, rc = 0; #ifdef BCE_DEBUG - u16 debug_prod_idx = *prod_idx; + u16 debug_prod_idx = prod_idx; #endif DBENTER(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); /* Make sure the inputs are valid. */ - DBRUNIF((*prod_idx > MAX_PG_BD_ALLOC), + DBRUNIF((prod_idx > MAX_PG_BD_ALLOC), BCE_PRINTF("%s(%d): page producer out of range: " "0x%04X > 0x%04X\n", __FILE__, __LINE__, - *prod_idx, (u16) MAX_PG_BD_ALLOC)); + prod_idx, (u16)MAX_PG_BD_ALLOC)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(enter): prod = 0x%04X, " - "chain_prod = 0x%04X\n", __FUNCTION__, *prod, *prod_idx); + "chain_prod = 0x%04X\n", __FUNCTION__, prod, prod_idx); /* Update counters if we've hit a new low or run out of pages. */ DBRUNIF((sc->free_pg_bd < sc->pg_low_watermark), sc->pg_low_watermark = sc->free_pg_bd); DBRUNIF((sc->free_pg_bd == sc->max_pg_bd), sc->pg_empty_count++); - /* Check whether this is a new mbuf allocation. */ - if (m == NULL) { - - /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), - sc->mbuf_alloc_failed_count++; - sc->mbuf_alloc_failed_sim_count++; - rc = ENOBUFS; - goto bce_get_pg_buf_exit); - - /* This is a new mbuf allocation. */ - m_new = m_getcl(M_NOWAIT, MT_DATA, 0); - if (m_new == NULL) { - sc->mbuf_alloc_failed_count++; - rc = ENOBUFS; - goto bce_get_pg_buf_exit; - } - - DBRUN(sc->debug_pg_mbuf_alloc++); - } else { - /* Reuse an existing mbuf. */ - m_new = m; - m_new->m_data = m_new->m_ext.ext_buf; + /* Simulate an mbuf allocation failure. */ + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; + rc = ENOBUFS; + goto bce_get_pg_buf_exit); + + /* This is a new mbuf allocation. */ + m_new = m_getcl(M_NOWAIT, MT_DATA, 0); + if (m_new == NULL) { + sc->mbuf_alloc_failed_count++; + rc = ENOBUFS; + goto bce_get_pg_buf_exit; } + DBRUN(sc->debug_pg_mbuf_alloc++); + m_new->m_len = MCLBYTES; /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ - map = sc->pg_mbuf_map[*prod_idx]; - error = bus_dmamap_load(sc->pg_mbuf_tag, map, mtod(m_new, void *), - MCLBYTES, bce_dma_map_addr, &busaddr, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->pg_mbuf_tag, + sc->pg_mbuf_map[prod_idx], m_new, segs, &nsegs, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5550,28 +5527,32 @@ bce_get_pg_buf(struct bce_softc *sc, str goto bce_get_pg_buf_exit; } + /* All mbufs must map to a single segment. */ + KASSERT(nsegs == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nsegs)); + /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREREAD) here? */ /* * The page chain uses the same rx_bd data structure * as the receive chain but doesn't require a byte sequence (bseq). */ - pgbd = &sc->pg_bd_chain[PG_PAGE(*prod_idx)][PG_IDX(*prod_idx)]; + pgbd = &sc->pg_bd_chain[PG_PAGE(prod_idx)][PG_IDX(prod_idx)]; - pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(busaddr)); - pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(busaddr)); + pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[0].ds_addr)); + pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[0].ds_addr)); pgbd->rx_bd_len = htole32(MCLBYTES); pgbd->rx_bd_flags = htole32(RX_BD_FLAGS_START | RX_BD_FLAGS_END); /* Save the mbuf and update our counter. */ - sc->pg_mbuf_ptr[*prod_idx] = m_new; + sc->pg_mbuf_ptr[prod_idx] = m_new; sc->free_pg_bd--; DBRUNMSG(BCE_INSANE_RECV, bce_dump_pg_mbuf_chain(sc, debug_prod_idx, 1)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(exit): prod = 0x%04X, " - "prod_idx = 0x%04X\n", __FUNCTION__, *prod, *prod_idx); + "prod_idx = 0x%04X\n", __FUNCTION__, prod, prod_idx); bce_get_pg_buf_exit: DBEXIT(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); @@ -5893,7 +5874,7 @@ bce_fill_rx_chain(struct bce_softc *sc) /* Keep filling the RX chain until it's full. */ while (sc->free_rx_bd > 0) { prod_idx = RX_CHAIN_IDX(prod); - if (bce_get_rx_buf(sc, NULL, &prod, &prod_idx, &prod_bseq)) { + if (bce_get_rx_buf(sc, prod, prod_idx, &prod_bseq)) { /* Bail out if we can't add an mbuf to the chain. */ break; } @@ -5907,13 +5888,11 @@ bce_fill_rx_chain(struct bce_softc *sc) /* We should never end up pointing to a next page pointer. */ DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE), BCE_PRINTF("%s(): Invalid rx_prod value: 0x%04X\n", - __FUNCTION__, sc->rx_prod)); + __FUNCTION__, rx_prod)); /* Write the mailbox and tell the chip about the waiting rx_bd's. */ - REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_BDIDX, sc->rx_prod); - REG_WR(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_BSEQ, sc->rx_prod_bseq); + REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_BDIDX, prod); + REG_WR(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_BSEQ, prod_bseq); DBEXIT(BCE_VERBOSE_RESET | BCE_EXTREME_RECV | BCE_VERBOSE_LOAD | BCE_VERBOSE_CTX); @@ -6064,7 +6043,7 @@ bce_fill_pg_chain(struct bce_softc *sc) /* Keep filling the page chain until it's full. */ while (sc->free_pg_bd > 0) { prod_idx = PG_CHAIN_IDX(prod); - if (bce_get_pg_buf(sc, NULL, &prod, &prod_idx)) { + if (bce_get_pg_buf(sc, prod, prod_idx)) { /* Bail out if we can't add an mbuf to the chain. */ break; } @@ -6076,14 +6055,14 @@ bce_fill_pg_chain(struct bce_softc *sc) DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE), BCE_PRINTF("%s(): Invalid pg_prod value: 0x%04X\n", - __FUNCTION__, sc->pg_prod)); + __FUNCTION__, pg_prod)); /* * Write the mailbox and tell the chip about * the new rx_bd's in the page chain. */ - REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_PG_BDIDX, sc->pg_prod); + REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_PG_BDIDX, + prod); DBEXIT(BCE_VERBOSE_RESET | BCE_EXTREME_RECV | BCE_VERBOSE_LOAD | BCE_VERBOSE_CTX); @@ -6598,14 +6577,6 @@ bce_rx_intr(struct bce_softc *sc) DBRUN(sc->debug_rx_mbuf_alloc--); sc->free_rx_bd++; - if(m0 == NULL) { - DBPRINT(sc, BCE_EXTREME_RECV, - "%s(): Oops! Empty mbuf pointer " - "found in sc->rx_mbuf_ptr[0x%04X]!\n", - __FUNCTION__, sw_rx_cons_idx); - goto bce_rx_int_next_rx; - } - /* * Frames received on the NetXteme II are prepended * with an l2_fhdr structure which provides status @@ -6764,7 +6735,7 @@ bce_rx_intr(struct bce_softc *sc) m_freem(m0); m0 = NULL; - goto bce_rx_int_next_rx; + goto bce_rx_intr_next_rx; } /* Send the packet to the appropriate interface. */ @@ -6775,7 +6746,6 @@ bce_rx_intr(struct bce_softc *sc) /* Validate the checksum if offload enabled. */ if (ifp->if_capenable & IFCAP_RXCSUM) { - /* Check for an IP datagram. */ if (!(status & L2_FHDR_STATUS_SPLIT) && (status & L2_FHDR_STATUS_IP_DATAGRAM)) { @@ -6805,7 +6775,8 @@ bce_rx_intr(struct bce_softc *sc) } /* Attach the VLAN tag. */ - if (status & L2_FHDR_STATUS_L2_VLAN_TAG) { + if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && + !(sc->rx_mode & BCE_EMAC_RX_MODE_KEEP_VLAN_TAG)) { DBRUN(sc->vlan_tagged_frames_rcvd++); if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { DBRUN(sc->vlan_tagged_frames_stripped++); @@ -6844,7 +6815,7 @@ bce_rx_intr(struct bce_softc *sc) /* Increment received packet statistics. */ ifp->if_ipackets++; -bce_rx_int_next_rx: +bce_rx_intr_next_rx: sw_rx_cons = NEXT_RX_BD(sw_rx_cons); /* If we have a packet, pass it up the stack */ @@ -8094,8 +8065,9 @@ bce_set_rx_mode(struct bce_softc *sc) /* Enable all multicast addresses. */ for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) { - REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), 0xffffffff); - } + REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), + 0xffffffff); + } sort_mode |= BCE_RPM_SORT_USER0_MC_EN; } else { /* Accept one or more multicast(s). */ From owner-svn-src-all@FreeBSD.ORG Thu May 30 19:14:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2B9F237; Thu, 30 May 2013 19:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3808ECA; Thu, 30 May 2013 19:14:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJEbbt017326; Thu, 30 May 2013 19:14:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJEZuU017310; Thu, 30 May 2013 19:14:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305301914.r4UJEZuU017310@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 19:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251147 - in stable/9/sys: fs/nfs fs/nfsclient kern nfsclient sys tools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:14:37 -0000 Author: jhb Date: Thu May 30 19:14:34 2013 New Revision: 251147 URL: http://svnweb.freebsd.org/changeset/base/251147 Log: MFC 246417,247116,248584: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Instead of setting PBDRY on individual sleeps, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. - Ignore thread suspend requests due to SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/kern/kern_sig.c stable/9/sys/kern/kern_thread.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_trap.c stable/9/sys/kern/vfs_export.c stable/9/sys/kern/vfs_lookup.c stable/9/sys/nfsclient/nfs_krpc.c stable/9/sys/nfsclient/nfs_vfsops.c stable/9/sys/sys/mount.h stable/9/sys/sys/signalvar.h stable/9/sys/tools/vnode_if.awk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:14:34 2013 (r251147) @@ -952,7 +952,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -973,7 +972,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -1002,8 +1001,9 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:14:34 2013 (r251147) @@ -133,7 +133,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/kern_sig.c Thu May 30 19:14:34 2013 (r251147) @@ -2352,6 +2352,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2392,12 +2399,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2517,6 +2525,40 @@ tdsigcleanup(struct thread *td) } /* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) +{ + struct thread *td; + + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); + return (1); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop() +{ + struct thread *td; + + td = curthread; + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + +/* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; @@ -2548,7 +2590,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2663,10 +2705,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/kern_thread.c Thu May 30 19:14:34 2013 (r251147) @@ -796,6 +796,17 @@ thread_suspend_check(int return_instead) return (ERESTART); /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + + /* * If the process is waiting for us to exit, * this thread should just suicide. * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. Modified: stable/9/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/9/sys/kern/subr_sleepqueue.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/subr_sleepqueue.c Thu May 30 19:14:34 2013 (r251147) @@ -351,8 +351,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -599,7 +597,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -746,7 +744,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: stable/9/sys/kern/subr_trap.c ============================================================================== --- stable/9/sys/kern/subr_trap.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/subr_trap.c Thu May 30 19:14:34 2013 (r251147) @@ -141,6 +141,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held.", td->td_locks)); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/9/sys/kern/vfs_export.c ============================================================================== --- stable/9/sys/kern/vfs_export.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/vfs_export.c Thu May 30 19:14:34 2013 (r251147) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/9/sys/kern/vfs_lookup.c ============================================================================== --- stable/9/sys/kern/vfs_lookup.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/vfs_lookup.c Thu May 30 19:14:34 2013 (r251147) @@ -348,7 +348,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: stable/9/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/9/sys/nfsclient/nfs_krpc.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/nfsclient/nfs_krpc.c Thu May 30 19:14:34 2013 (r251147) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,9 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/9/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vfsops.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/nfsclient/nfs_vfsops.c Thu May 30 19:14:34 2013 (r251147) @@ -146,7 +146,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(oldnfs, 1); Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/sys/mount.h Thu May 30 19:14:34 2013 (r251147) @@ -517,6 +517,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -654,31 +655,6 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) -#define VFS_RECLAIM_LOWERVP(MP, VP) \ - ({if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) \ - (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); }) - #define VFS_NEEDSGIANT_(MP) \ ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) @@ -714,9 +690,127 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_UNLINK_LOWERVP(MP, VP) do { \ if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ } \ } while (0) Modified: stable/9/sys/sys/signalvar.h ============================================================================== --- stable/9/sys/sys/signalvar.h Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/sys/signalvar.h Thu May 30 19:14:34 2013 (r251147) @@ -328,6 +328,8 @@ extern struct mtx sigio_lock; #define SIGPROCMASK_PS_LOCKED 0x0004 int cursig(struct thread *td, int stop_allowed); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: stable/9/sys/tools/vnode_if.awk ============================================================================== --- stable/9/sys/tools/vnode_if.awk Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/tools/vnode_if.awk Thu May 30 19:14:34 2013 (r251147) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -378,10 +379,12 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); From owner-svn-src-all@FreeBSD.ORG Thu May 30 19:24:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46B977B7; Thu, 30 May 2013 19:24:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37362F6B; Thu, 30 May 2013 19:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJOWgp020880; Thu, 30 May 2013 19:24:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJOT2g020861; Thu, 30 May 2013 19:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305301924.r4UJOT2g020861@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 19:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251148 - in stable/8/sys: fs/nfs fs/nfsclient gnu/fs/ext2fs kern nfsclient sys tools X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:24:32 -0000 Author: jhb Date: Thu May 30 19:24:29 2013 New Revision: 251148 URL: http://svnweb.freebsd.org/changeset/base/251148 Log: MFC 246417,247116,248584: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Instead of setting PBDRY on individual sleeps, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. - Ignore thread suspend requests due to SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_thread.c stable/8/sys/kern/subr_sleepqueue.c stable/8/sys/kern/subr_trap.c stable/8/sys/kern/vfs_export.c stable/8/sys/kern/vfs_lookup.c stable/8/sys/nfsclient/nfs_krpc.c stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/sys/mount.h stable/8/sys/sys/signalvar.h stable/8/sys/tools/vnode_if.awk Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:24:29 2013 (r251148) @@ -885,7 +885,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -906,7 +905,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -935,8 +934,9 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -130,7 +130,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(newnfs, 1); Modified: stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:24:29 2013 (r251148) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_sig.c Thu May 30 19:24:29 2013 (r251148) @@ -2351,6 +2351,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2391,12 +2398,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2519,6 +2527,40 @@ tdsigcleanup(struct thread *td) } /* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) +{ + struct thread *td; + + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); + return (1); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop() +{ + struct thread *td; + + td = curthread; + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + +/* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; @@ -2550,7 +2592,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2665,10 +2707,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_thread.c Thu May 30 19:24:29 2013 (r251148) @@ -741,6 +741,17 @@ thread_suspend_check(int return_instead) (p->p_flag & P_SINGLE_BOUNDARY) && return_instead) return (ERESTART); + /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + /* If thread will exit, flush its pending signals */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) sigqueue_flush(&td->td_sigqueue); Modified: stable/8/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:24:29 2013 (r251148) @@ -351,8 +351,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -591,7 +589,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -738,7 +736,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_trap.c Thu May 30 19:24:29 2013 (r251148) @@ -134,6 +134,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held.", td->td_locks)); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/8/sys/kern/vfs_export.c ============================================================================== --- stable/8/sys/kern/vfs_export.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_export.c Thu May 30 19:24:29 2013 (r251148) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_lookup.c Thu May 30 19:24:29 2013 (r251148) @@ -323,7 +323,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:24:29 2013 (r251148) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,9 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -144,7 +144,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: stable/8/sys/sys/mount.h ============================================================================== --- stable/8/sys/sys/mount.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/mount.h Thu May 30 19:24:29 2013 (r251148) @@ -465,6 +465,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -598,28 +599,6 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) - #define VFS_NEEDSGIANT_(MP) \ ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) @@ -651,6 +630,122 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/signalvar.h Thu May 30 19:24:29 2013 (r251148) @@ -327,6 +327,8 @@ extern int kern_logsigexit; /* Sysctl va * Machine-independent functions: */ int cursig(struct thread *td, int stop_allowed); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: stable/8/sys/tools/vnode_if.awk ============================================================================== --- stable/8/sys/tools/vnode_if.awk Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/tools/vnode_if.awk Thu May 30 19:24:29 2013 (r251148) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -378,10 +379,12 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); From owner-svn-src-all@FreeBSD.ORG Thu May 30 19:51:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8053E1DA; Thu, 30 May 2013 19:51:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7187F196; Thu, 30 May 2013 19:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJpYhF030671; Thu, 30 May 2013 19:51:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJpY2l030670; Thu, 30 May 2013 19:51:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305301951.r4UJpY2l030670@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 19:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251149 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:51:34 -0000 Author: kib Date: Thu May 30 19:51:33 2013 New Revision: 251149 URL: http://svnweb.freebsd.org/changeset/base/251149 Log: Assert that OBJ_TMPFS flag on the vm object for the tmpfs node is cleared when the tmpfs node is going away. Tested by: bdrewery, pho Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu May 30 19:24:29 2013 (r251148) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu May 30 19:51:33 2013 (r251149) @@ -314,6 +314,8 @@ tmpfs_free_node(struct tmpfs_mount *tmp, TMPFS_LOCK(tmp); tmp->tm_pages_used -= uobj->size; TMPFS_UNLOCK(tmp); + KASSERT((uobj->flags & OBJ_TMPFS) == 0, + ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); vm_object_deallocate(uobj); } break; From owner-svn-src-all@FreeBSD.ORG Thu May 30 19:53:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B50F7449; Thu, 30 May 2013 19:53:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A7BD91AA; Thu, 30 May 2013 19:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJrVoo031124; Thu, 30 May 2013 19:53:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJrVf5031123; Thu, 30 May 2013 19:53:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305301953.r4UJrVf5031123@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 19:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251150 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:53:31 -0000 Author: kib Date: Thu May 30 19:53:31 2013 New Revision: 251150 URL: http://svnweb.freebsd.org/changeset/base/251150 Log: Remove the capitalization in the assertion message. Print the address of the object to get useful information from optimizated kernels dump. Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 30 19:51:33 2013 (r251149) +++ head/sys/vm/vm_object.c Thu May 30 19:53:31 2013 (r251150) @@ -557,7 +557,7 @@ vm_object_deallocate(vm_object_t object) (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { KASSERT((object->flags & OBJ_TMPFS) == 0, - ("Shadowed tmpfs v_object")); + ("shadowed tmpfs v_object %p", object)); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:00:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57F85751; Thu, 30 May 2013 20:00:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE70217; Thu, 30 May 2013 20:00:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UK0KIE032723; Thu, 30 May 2013 20:00:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UK0KYp032722; Thu, 30 May 2013 20:00:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305302000.r4UK0KYp032722@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 20:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251151 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:00:20 -0000 Author: kib Date: Thu May 30 20:00:19 2013 New Revision: 251151 URL: http://svnweb.freebsd.org/changeset/base/251151 Log: After the object lock was dropped, the object' reference count could change. Retest the ref_count and return from the function to not execute the further code which assumes that ref_count == 1 if it is not. Also, do not leak vnode lock if other thread cleared OBJ_TMPFS flag meantime. Reported by: bdrewery Tested by: bdrewery, pho Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 30 19:53:31 2013 (r251150) +++ head/sys/vm/vm_object.c Thu May 30 20:00:19 2013 (r251151) @@ -536,15 +536,15 @@ vm_object_deallocate(vm_object_t object) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vdrop(vp); VM_OBJECT_WLOCK(object); - if (object->type == OBJT_DEAD) { + if (object->type == OBJT_DEAD || + object->ref_count != 1) { VM_OBJECT_WUNLOCK(object); VOP_UNLOCK(vp, 0); return; - } else if ((object->flags & OBJ_TMPFS) != 0) { - if (object->ref_count == 1) - VOP_UNSET_TEXT(vp); - VOP_UNLOCK(vp, 0); } + if ((object->flags & OBJ_TMPFS) != 0) + VOP_UNSET_TEXT(vp); + VOP_UNLOCK(vp, 0); } if (object->shadow_count == 0 && object->handle == NULL && From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:09:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6C01A5D; Thu, 30 May 2013 20:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7C542AF; Thu, 30 May 2013 20:09:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UK9Lue036107; Thu, 30 May 2013 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UK9Lbt036106; Thu, 30 May 2013 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305302009.r4UK9Lbt036106@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 20:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251152 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:09:22 -0000 Author: jhb Date: Thu May 30 20:09:21 2013 New Revision: 251152 URL: http://svnweb.freebsd.org/changeset/base/251152 Log: MFC 249567: mdoc: remove superfluous paragraph macro. Modified: stable/9/lib/libc/gen/sem_wait.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/sem_wait.3 ============================================================================== --- stable/9/lib/libc/gen/sem_wait.3 Thu May 30 20:00:19 2013 (r251151) +++ stable/9/lib/libc/gen/sem_wait.3 Thu May 30 20:09:21 2013 (r251152) @@ -78,7 +78,6 @@ Additionally, .Fn sem_wait will fail if: .Bl -tag -width Er -.Pp .It Bq Er EINTR A signal interrupted this function. .El From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:11:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6762DC49; Thu, 30 May 2013 20:11:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59B482D0; Thu, 30 May 2013 20:11:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKBWBK038313; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKBWqN038312; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305302011.r4UKBWqN038312@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 20:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251153 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:11:32 -0000 Author: jhb Date: Thu May 30 20:11:31 2013 New Revision: 251153 URL: http://svnweb.freebsd.org/changeset/base/251153 Log: MFC 249566-249567: Document that sem_wait() can fail with EINTR if it is interrupted by a signal. Modified: stable/8/lib/libc/gen/sem_wait.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/sem_wait.3 ============================================================================== --- stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:09:21 2013 (r251152) +++ stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:11:31 2013 (r251153) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd April 16, 2013 .Dt SEM_WAIT 3 .Os .Sh NAME @@ -75,6 +75,13 @@ points to an invalid semaphore. .El .Pp Additionally, +.Fn sem_wait +will fail if: +.Bl -tag -width Er +.It Bq Er EINTR +A signal interrupted this function. +.El +Additionally, .Fn sem_trywait will fail if: .Bl -tag -width Er From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:40:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D8BC463; Thu, 30 May 2013 20:40:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC106A2; Thu, 30 May 2013 20:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKeLT0046831; Thu, 30 May 2013 20:40:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKeHDo046790; Thu, 30 May 2013 20:40:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302040.r4UKeHDo046790@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251154 - in stable/9: contrib/less usr.bin/less X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:40:22 -0000 Author: delphij Date: Thu May 30 20:40:16 2013 New Revision: 251154 URL: http://svnweb.freebsd.org/changeset/base/251154 Log: MFC: less v458. Modified: stable/9/contrib/less/NEWS stable/9/contrib/less/README stable/9/contrib/less/cmdbuf.c stable/9/contrib/less/configure stable/9/contrib/less/configure.ac stable/9/contrib/less/defines.ds stable/9/contrib/less/defines.h.in stable/9/contrib/less/defines.o2 stable/9/contrib/less/defines.o9 stable/9/contrib/less/defines.wn stable/9/contrib/less/help.c stable/9/contrib/less/less.hlp stable/9/contrib/less/less.man stable/9/contrib/less/less.nro stable/9/contrib/less/lessecho.man stable/9/contrib/less/lessecho.nro stable/9/contrib/less/lesskey.man stable/9/contrib/less/lesskey.nro stable/9/contrib/less/option.c stable/9/contrib/less/opttbl.c stable/9/contrib/less/output.c stable/9/contrib/less/position.c stable/9/contrib/less/screen.c stable/9/contrib/less/version.c stable/9/usr.bin/less/defines.h Directory Properties: stable/9/contrib/less/ (props changed) stable/9/usr.bin/less/ (props changed) Modified: stable/9/contrib/less/NEWS ============================================================================== --- stable/9/contrib/less/NEWS Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/NEWS Thu May 30 20:40:16 2013 (r251154) @@ -11,6 +11,25 @@ ====================================================================== + Major changes between "less" versions 451 and 458 + +* Allow backslash escaping of metacharacters in LESS environment variable + after the --use-backslash option. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +* Fix display bug when using up/down arrow on the command line. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: stable/9/contrib/less/README ============================================================================== --- stable/9/contrib/less/README Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/README Thu May 30 20:40:16 2013 (r251154) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 458 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 458, released 04 Apr 2013. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/9/contrib/less/cmdbuf.c ============================================================================== --- stable/9/contrib/less/cmdbuf.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/cmdbuf.c Thu May 30 20:40:16 2013 (r251154) @@ -727,9 +727,9 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; - strcpy(cmdbuf, s); cmd_home(); clear_eol(); + strcpy(cmdbuf, s); for (cp = cmdbuf; *cp != '\0'; ) cmd_right(); return (CC_OK); Modified: stable/9/contrib/less/configure ============================================================================== --- stable/9/contrib/less/configure Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/configure Thu May 30 20:40:16 2013 (r251154) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: stable/9/contrib/less/configure.ac ============================================================================== --- stable/9/contrib/less/configure.ac Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/configure.ac Thu May 30 20:40:16 2013 (r251154) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: stable/9/contrib/less/defines.ds ============================================================================== --- stable/9/contrib/less/defines.ds Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.ds Thu May 30 20:40:16 2013 (r251154) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: stable/9/contrib/less/defines.h.in ============================================================================== --- stable/9/contrib/less/defines.h.in Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.h.in Thu May 30 20:40:16 2013 (r251154) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: stable/9/contrib/less/defines.o2 ============================================================================== --- stable/9/contrib/less/defines.o2 Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.o2 Thu May 30 20:40:16 2013 (r251154) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/9/contrib/less/defines.o9 ============================================================================== --- stable/9/contrib/less/defines.o9 Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.o9 Thu May 30 20:40:16 2013 (r251154) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: stable/9/contrib/less/defines.wn ============================================================================== --- stable/9/contrib/less/defines.wn Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.wn Thu May 30 20:40:16 2013 (r251154) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/9/contrib/less/help.c ============================================================================== --- stable/9/contrib/less/help.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/help.c Thu May 30 20:40:16 2013 (r251154) @@ -110,7 +110,7 @@ constant char helpdata[] = { ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', +' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', Modified: stable/9/contrib/less/less.hlp ============================================================================== --- stable/9/contrib/less/less.hlp Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.hlp Thu May 30 20:40:16 2013 (r251154) @@ -107,7 +107,7 @@ Most options may be changed either on the command line, or from within less by using the - or -- command. Options may be given in one of two forms: either a single - character preceded by a -, or a name preceeded by --. + character preceded by a -, or a name preceded by --. -? ........ --help Display help (from command line). Modified: stable/9/contrib/less/less.man ============================================================================== --- stable/9/contrib/less/less.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.man Thu May 30 20:40:16 2013 (r251154) @@ -437,13 +437,18 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a dollar + sign ($) is found. For example, you can set two -D options on MS-DOS like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + If the --use-backslash option appears earlier in the options, then a + dollar sign or backslash may be included literally in an option string + by preceding it with a backslash. If the --use-backslash option is not + in effect, then backslashes are not treated specially, and there is no + way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less @@ -836,11 +841,6 @@ LESS(1) actual scroll remains at the specified fraction of the screen width. - --no-keypad - Disables sending the keypad initialization and deinitialization - strings to the terminal. This is sometimes useful if the keypad - strings make the numeric keypad behave in an undesirable manner. - --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the @@ -851,6 +851,18 @@ LESS(1) has been created with the same name as the original (now renamed) file), less will display the contents of that new file. + --no-keypad + Disables sending the keypad initialization and deinitialization + strings to the terminal. This is sometimes useful if the keypad + strings make the numeric keypad behave in an undesirable manner. + + --use-backslash + This option changes the interpretations of options which follow + this one. After the --use-backslash option, any backslash in an + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option + strings. + -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins @@ -1597,8 +1609,8 @@ LESS(1) AUTHOR - Mark Nudelman - Send bug reports or comments to bug-less@gnu.org. + Mark Nudelman + Send bug reports or comments to See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. For more information, see the less homepage at @@ -1606,4 +1618,4 @@ LESS(1) - Version 451: 21 Jul 2012 LESS(1) + Version 458: 04 Apr 2013 LESS(1) Modified: stable/9/contrib/less/less.nro ============================================================================== --- stable/9/contrib/less/less.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 451: 21 Jul 2012" +.TH LESS 1 "Version 458: 04 Apr 2013" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -455,13 +455,18 @@ If an option appears in the LESS variabl to its default value on the command line by beginning the command line option with "\-+". .sp -For options like \-P or \-D which take a following string, -a dollar sign ($) must be used to signal the end of the string. -For example, to set two \-D options on MS-DOS, you must have -a dollar sign between them, like this: +Some options like \-k or \-D require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. +For example, you can set two \-D options on MS-DOS like this: .sp -LESS="-Dn9.1$-Ds4.1" +LESS="Dn9.1$Ds4.1" .sp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less @@ -890,11 +895,6 @@ If the number is specified as a fraction scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. -.IP "\-\-no-keypad" -Disables sending the keypad initialization and deinitialization strings -to the terminal. -This is sometimes useful if the keypad strings make the numeric -keypad behave in an undesirable manner. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .I less @@ -908,6 +908,16 @@ If the reopen succeeds and the file is a with the same name as the original (now renamed) file), .I less will display the contents of that new file. +.IP "\-\-no-keypad" +Disables sending the keypad initialization and deinitialization strings +to the terminal. +This is sometimes useful if the keypad strings make the numeric +keypad behave in an undesirable manner. +.IP "\-\-use-backslash" +This option changes the interpretations of options which follow this one. +After the \-\-use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. @@ -1739,9 +1749,9 @@ See the GNU General Public License for m .SH AUTHOR .PP -Mark Nudelman +Mark Nudelman .br -Send bug reports or comments to bug-less@gnu.org. +Send bug reports or comments to .br See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. .br Modified: stable/9/contrib/less/lessecho.man ============================================================================== --- stable/9/contrib/less/lessecho.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lessecho.man Thu May 30 20:40:16 2013 (r251154) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 451: 21 Jul 2012 LESSECHO(1) + Version 458: 04 Apr 2013 LESSECHO(1) Modified: stable/9/contrib/less/lessecho.nro ============================================================================== --- stable/9/contrib/less/lessecho.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lessecho.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 451: 21 Jul 2012" +.TH LESSECHO 1 "Version 458: 04 Apr 2013" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/9/contrib/less/lesskey.man ============================================================================== --- stable/9/contrib/less/lesskey.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lesskey.man Thu May 30 20:40:16 2013 (r251154) @@ -353,4 +353,4 @@ LESSKEY(1) - Version 451: 21 Jul 2012 LESSKEY(1) + Version 458: 04 Apr 2013 LESSKEY(1) Modified: stable/9/contrib/less/lesskey.nro ============================================================================== --- stable/9/contrib/less/lesskey.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lesskey.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 451: 21 Jul 2012" +.TH LESSKEY 1 "Version 458: 04 Apr 2013" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/9/contrib/less/option.c ============================================================================== --- stable/9/contrib/less/option.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/option.c Thu May 30 20:40:16 2013 (r251154) @@ -30,6 +30,7 @@ extern int screen_trashed; extern int less_is_more; extern int quit_at_eof; extern char *every_first_cmd; +extern int opt_use_backslash; /* * Return a printable description of an option. @@ -146,10 +147,13 @@ scan_option(s) */ plusoption = TRUE; s = optstring(s, &str, propt('+'), NULL); + if (s == NULL) + return; if (*str == '+') - every_first_cmd = save(++str); + every_first_cmd = save(str+1); else ungetsc(str); + free(str); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -202,7 +206,7 @@ scan_option(s) parg.p_string = printopt; error("The %s option should not be followed by =", &parg); - quit(QUIT_ERROR); + return; } s++; } else @@ -223,7 +227,7 @@ scan_option(s) else error("There is no %s option (\"less --help\" for help)", &parg); - quit(QUIT_ERROR); + return; } str = NULL; @@ -260,6 +264,8 @@ scan_option(s) while (*s == ' ') s++; s = optstring(s, &str, printopt, o->odesc[1]); + if (s == NULL) + return; break; case NUMBER: if (*s == '\0') @@ -275,6 +281,8 @@ scan_option(s) */ if (o->ofunc != NULL) (*o->ofunc)(INIT, str); + if (str != NULL) + free(str); } } @@ -558,35 +566,33 @@ optstring(s, p_str, printopt, validchars char *validchars; { register char *p; + register char *out; if (*s == '\0') { nostring(printopt); - quit(QUIT_ERROR); + return (NULL); } - *p_str = s; + /* Alloc could be more than needed, but not worth trimming. */ + *p_str = (char *) ecalloc(strlen(s)+1, sizeof(char)); + out = *p_str; + for (p = s; *p != '\0'; p++) { - if (*p == END_OPTION_STRING || - (validchars != NULL && strchr(validchars, *p) == NULL)) + if (opt_use_backslash && *p == '\\' && p[1] != '\0') { - switch (*p) - { - case END_OPTION_STRING: - case ' ': case '\t': case '-': - /* Replace the char with a null to terminate string. */ - *p++ = '\0'; - break; - default: - /* Cannot replace char; make a copy of the string. */ - *p_str = (char *) ecalloc(p-s+1, sizeof(char)); - strncpy(*p_str, s, p-s); - (*p_str)[p-s] = '\0'; + /* Take next char literally. */ + ++p; + } else + { + if (*p == END_OPTION_STRING || + (validchars != NULL && strchr(validchars, *p) == NULL)) + /* End of option string. */ break; - } - break; } + *out++ = *p; } + *out = '\0'; return (p); } @@ -609,8 +615,6 @@ num_error(printopt, errp) parg.p_string = printopt; error("Number is required after %s", &parg); } - quit(QUIT_ERROR); - /* NOTREACHED */ return (-1); } Modified: stable/9/contrib/less/opttbl.c ============================================================================== --- stable/9/contrib/less/opttbl.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/opttbl.c Thu May 30 20:40:16 2013 (r251154) @@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESS public int quit_on_intr; /* Quit on interrupt */ public int follow_mode; /* F cmd Follows file desc or file name? */ public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */ +public int opt_use_backslash; /* Use backslash escaping in option parsing */ #if HILITE_SEARCH public int hilite_search; /* Highlight matched search patterns? */ #endif @@ -115,6 +116,7 @@ static struct optname pound_optname = { static struct optname keypad_optname = { "no-keypad", NULL }; static struct optname oldbot_optname = { "old-bot", NULL }; static struct optname follow_optname = { "follow-name", NULL }; +static struct optname use_backslash_optname = { "use-backslash", NULL }; /* @@ -446,6 +448,14 @@ static struct loption option[] = NULL } }, + { OLETTER_NONE, &use_backslash_optname, + BOOL, OPT_OFF, &opt_use_backslash, NULL, + { + "Use backslash escaping in command line parameters", + "Don't use backslash escaping in command line parameters", + NULL + } + }, { '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } } }; Modified: stable/9/contrib/less/output.c ============================================================================== --- stable/9/contrib/less/output.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/output.c Thu May 30 20:40:16 2013 (r251154) @@ -278,8 +278,13 @@ flush() */ if (p[-2] == '[') { +#if MSDOS_COMPILER==WIN32C + fg |= FOREGROUND_INTENSITY; + bg |= BACKGROUND_INTENSITY; +#else fg = bo_fg_color; bg = bo_bg_color; +#endif } else fg |= 8; } else if (at & 2) Modified: stable/9/contrib/less/position.c ============================================================================== --- stable/9/contrib/less/position.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/position.c Thu May 30 20:40:16 2013 (r251154) @@ -162,7 +162,7 @@ empty_lines(s, e) register int i; for (i = s; i <= e; i++) - if (table[i] != NULL_POSITION) + if (table[i] != NULL_POSITION && table[i] != 0) return (0); return (1); } Modified: stable/9/contrib/less/screen.c ============================================================================== --- stable/9/contrib/less/screen.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/screen.c Thu May 30 20:40:16 2013 (r251154) @@ -802,7 +802,7 @@ scrsize() else if ((n = ltgetnum("li")) > 0) sc_height = n; #endif - else + if (sc_height <= 0) sc_height = DEF_SC_HEIGHT; if (sys_width > 0) @@ -813,7 +813,7 @@ scrsize() else if ((n = ltgetnum("co")) > 0) sc_width = n; #endif - else + if (sc_width <= 0) sc_width = DEF_SC_WIDTH; } Modified: stable/9/contrib/less/version.c ============================================================================== --- stable/9/contrib/less/version.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/version.c Thu May 30 20:40:16 2013 (r251154) @@ -753,6 +753,15 @@ v448 6/15/12 Print name of regex libr v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:42:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B483625; Thu, 30 May 2013 20:42:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C95A6C6; Thu, 30 May 2013 20:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKgunr048888; Thu, 30 May 2013 20:42:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKgpZF048852; Thu, 30 May 2013 20:42:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302042.r4UKgpZF048852@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251155 - in stable/8: contrib/less usr.bin/less X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:42:56 -0000 Author: delphij Date: Thu May 30 20:42:51 2013 New Revision: 251155 URL: http://svnweb.freebsd.org/changeset/base/251155 Log: MFC: less v458. Modified: stable/8/contrib/less/NEWS stable/8/contrib/less/README stable/8/contrib/less/cmdbuf.c stable/8/contrib/less/configure stable/8/contrib/less/configure.ac stable/8/contrib/less/defines.ds stable/8/contrib/less/defines.h.in stable/8/contrib/less/defines.o2 stable/8/contrib/less/defines.o9 stable/8/contrib/less/defines.wn stable/8/contrib/less/help.c stable/8/contrib/less/less.hlp stable/8/contrib/less/less.man stable/8/contrib/less/less.nro stable/8/contrib/less/lessecho.man stable/8/contrib/less/lessecho.nro stable/8/contrib/less/lesskey.man stable/8/contrib/less/lesskey.nro stable/8/contrib/less/option.c stable/8/contrib/less/opttbl.c stable/8/contrib/less/output.c stable/8/contrib/less/position.c stable/8/contrib/less/screen.c stable/8/contrib/less/version.c stable/8/usr.bin/less/defines.h Directory Properties: stable/8/contrib/less/ (props changed) stable/8/usr.bin/less/ (props changed) Modified: stable/8/contrib/less/NEWS ============================================================================== --- stable/8/contrib/less/NEWS Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/NEWS Thu May 30 20:42:51 2013 (r251155) @@ -11,6 +11,25 @@ ====================================================================== + Major changes between "less" versions 451 and 458 + +* Allow backslash escaping of metacharacters in LESS environment variable + after the --use-backslash option. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +* Fix display bug when using up/down arrow on the command line. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: stable/8/contrib/less/README ============================================================================== --- stable/8/contrib/less/README Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/README Thu May 30 20:42:51 2013 (r251155) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 458 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 458, released 04 Apr 2013. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/8/contrib/less/cmdbuf.c ============================================================================== --- stable/8/contrib/less/cmdbuf.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/cmdbuf.c Thu May 30 20:42:51 2013 (r251155) @@ -727,9 +727,9 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; - strcpy(cmdbuf, s); cmd_home(); clear_eol(); + strcpy(cmdbuf, s); for (cp = cmdbuf; *cp != '\0'; ) cmd_right(); return (CC_OK); Modified: stable/8/contrib/less/configure ============================================================================== --- stable/8/contrib/less/configure Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure Thu May 30 20:42:51 2013 (r251155) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: stable/8/contrib/less/configure.ac ============================================================================== --- stable/8/contrib/less/configure.ac Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure.ac Thu May 30 20:42:51 2013 (r251155) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: stable/8/contrib/less/defines.ds ============================================================================== --- stable/8/contrib/less/defines.ds Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.ds Thu May 30 20:42:51 2013 (r251155) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: stable/8/contrib/less/defines.h.in ============================================================================== --- stable/8/contrib/less/defines.h.in Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.h.in Thu May 30 20:42:51 2013 (r251155) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: stable/8/contrib/less/defines.o2 ============================================================================== --- stable/8/contrib/less/defines.o2 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o2 Thu May 30 20:42:51 2013 (r251155) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/defines.o9 ============================================================================== --- stable/8/contrib/less/defines.o9 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o9 Thu May 30 20:42:51 2013 (r251155) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: stable/8/contrib/less/defines.wn ============================================================================== --- stable/8/contrib/less/defines.wn Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.wn Thu May 30 20:42:51 2013 (r251155) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/help.c ============================================================================== --- stable/8/contrib/less/help.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/help.c Thu May 30 20:42:51 2013 (r251155) @@ -110,7 +110,7 @@ constant char helpdata[] = { ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', +' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', Modified: stable/8/contrib/less/less.hlp ============================================================================== --- stable/8/contrib/less/less.hlp Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.hlp Thu May 30 20:42:51 2013 (r251155) @@ -107,7 +107,7 @@ Most options may be changed either on the command line, or from within less by using the - or -- command. Options may be given in one of two forms: either a single - character preceded by a -, or a name preceeded by --. + character preceded by a -, or a name preceded by --. -? ........ --help Display help (from command line). Modified: stable/8/contrib/less/less.man ============================================================================== --- stable/8/contrib/less/less.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.man Thu May 30 20:42:51 2013 (r251155) @@ -437,13 +437,18 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a dollar + sign ($) is found. For example, you can set two -D options on MS-DOS like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + If the --use-backslash option appears earlier in the options, then a + dollar sign or backslash may be included literally in an option string + by preceding it with a backslash. If the --use-backslash option is not + in effect, then backslashes are not treated specially, and there is no + way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less @@ -836,11 +841,6 @@ LESS(1) actual scroll remains at the specified fraction of the screen width. - --no-keypad - Disables sending the keypad initialization and deinitialization - strings to the terminal. This is sometimes useful if the keypad - strings make the numeric keypad behave in an undesirable manner. - --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the @@ -851,6 +851,18 @@ LESS(1) has been created with the same name as the original (now renamed) file), less will display the contents of that new file. + --no-keypad + Disables sending the keypad initialization and deinitialization + strings to the terminal. This is sometimes useful if the keypad + strings make the numeric keypad behave in an undesirable manner. + + --use-backslash + This option changes the interpretations of options which follow + this one. After the --use-backslash option, any backslash in an + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option + strings. + -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins @@ -1597,8 +1609,8 @@ LESS(1) AUTHOR - Mark Nudelman - Send bug reports or comments to bug-less@gnu.org. + Mark Nudelman + Send bug reports or comments to See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. For more information, see the less homepage at @@ -1606,4 +1618,4 @@ LESS(1) - Version 451: 21 Jul 2012 LESS(1) + Version 458: 04 Apr 2013 LESS(1) Modified: stable/8/contrib/less/less.nro ============================================================================== --- stable/8/contrib/less/less.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 451: 21 Jul 2012" +.TH LESS 1 "Version 458: 04 Apr 2013" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -455,13 +455,18 @@ If an option appears in the LESS variabl to its default value on the command line by beginning the command line option with "\-+". .sp -For options like \-P or \-D which take a following string, -a dollar sign ($) must be used to signal the end of the string. -For example, to set two \-D options on MS-DOS, you must have -a dollar sign between them, like this: +Some options like \-k or \-D require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. +For example, you can set two \-D options on MS-DOS like this: .sp -LESS="-Dn9.1$-Ds4.1" +LESS="Dn9.1$Ds4.1" .sp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less @@ -890,11 +895,6 @@ If the number is specified as a fraction scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. -.IP "\-\-no-keypad" -Disables sending the keypad initialization and deinitialization strings -to the terminal. -This is sometimes useful if the keypad strings make the numeric -keypad behave in an undesirable manner. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .I less @@ -908,6 +908,16 @@ If the reopen succeeds and the file is a with the same name as the original (now renamed) file), .I less will display the contents of that new file. +.IP "\-\-no-keypad" +Disables sending the keypad initialization and deinitialization strings +to the terminal. +This is sometimes useful if the keypad strings make the numeric +keypad behave in an undesirable manner. +.IP "\-\-use-backslash" +This option changes the interpretations of options which follow this one. +After the \-\-use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. @@ -1739,9 +1749,9 @@ See the GNU General Public License for m .SH AUTHOR .PP -Mark Nudelman +Mark Nudelman .br -Send bug reports or comments to bug-less@gnu.org. +Send bug reports or comments to .br See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. .br Modified: stable/8/contrib/less/lessecho.man ============================================================================== --- stable/8/contrib/less/lessecho.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.man Thu May 30 20:42:51 2013 (r251155) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 451: 21 Jul 2012 LESSECHO(1) + Version 458: 04 Apr 2013 LESSECHO(1) Modified: stable/8/contrib/less/lessecho.nro ============================================================================== --- stable/8/contrib/less/lessecho.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 451: 21 Jul 2012" +.TH LESSECHO 1 "Version 458: 04 Apr 2013" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/8/contrib/less/lesskey.man ============================================================================== --- stable/8/contrib/less/lesskey.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.man Thu May 30 20:42:51 2013 (r251155) @@ -353,4 +353,4 @@ LESSKEY(1) - Version 451: 21 Jul 2012 LESSKEY(1) + Version 458: 04 Apr 2013 LESSKEY(1) Modified: stable/8/contrib/less/lesskey.nro ============================================================================== --- stable/8/contrib/less/lesskey.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 451: 21 Jul 2012" +.TH LESSKEY 1 "Version 458: 04 Apr 2013" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/8/contrib/less/option.c ============================================================================== --- stable/8/contrib/less/option.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/option.c Thu May 30 20:42:51 2013 (r251155) @@ -30,6 +30,7 @@ extern int screen_trashed; extern int less_is_more; extern int quit_at_eof; extern char *every_first_cmd; +extern int opt_use_backslash; /* * Return a printable description of an option. @@ -146,10 +147,13 @@ scan_option(s) */ plusoption = TRUE; s = optstring(s, &str, propt('+'), NULL); + if (s == NULL) + return; if (*str == '+') - every_first_cmd = save(++str); + every_first_cmd = save(str+1); else ungetsc(str); + free(str); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -202,7 +206,7 @@ scan_option(s) parg.p_string = printopt; error("The %s option should not be followed by =", &parg); - quit(QUIT_ERROR); + return; } s++; } else @@ -223,7 +227,7 @@ scan_option(s) else error("There is no %s option (\"less --help\" for help)", &parg); - quit(QUIT_ERROR); + return; } str = NULL; @@ -260,6 +264,8 @@ scan_option(s) while (*s == ' ') s++; s = optstring(s, &str, printopt, o->odesc[1]); + if (s == NULL) + return; break; case NUMBER: if (*s == '\0') @@ -275,6 +281,8 @@ scan_option(s) */ if (o->ofunc != NULL) (*o->ofunc)(INIT, str); + if (str != NULL) + free(str); } } @@ -558,35 +566,33 @@ optstring(s, p_str, printopt, validchars char *validchars; { register char *p; + register char *out; if (*s == '\0') { nostring(printopt); - quit(QUIT_ERROR); + return (NULL); } - *p_str = s; + /* Alloc could be more than needed, but not worth trimming. */ + *p_str = (char *) ecalloc(strlen(s)+1, sizeof(char)); + out = *p_str; + for (p = s; *p != '\0'; p++) { - if (*p == END_OPTION_STRING || - (validchars != NULL && strchr(validchars, *p) == NULL)) + if (opt_use_backslash && *p == '\\' && p[1] != '\0') { - switch (*p) - { - case END_OPTION_STRING: - case ' ': case '\t': case '-': - /* Replace the char with a null to terminate string. */ - *p++ = '\0'; - break; - default: - /* Cannot replace char; make a copy of the string. */ - *p_str = (char *) ecalloc(p-s+1, sizeof(char)); - strncpy(*p_str, s, p-s); - (*p_str)[p-s] = '\0'; + /* Take next char literally. */ + ++p; + } else + { + if (*p == END_OPTION_STRING || + (validchars != NULL && strchr(validchars, *p) == NULL)) + /* End of option string. */ break; - } - break; } + *out++ = *p; } + *out = '\0'; return (p); } @@ -609,8 +615,6 @@ num_error(printopt, errp) parg.p_string = printopt; error("Number is required after %s", &parg); } - quit(QUIT_ERROR); - /* NOTREACHED */ return (-1); } Modified: stable/8/contrib/less/opttbl.c ============================================================================== --- stable/8/contrib/less/opttbl.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/opttbl.c Thu May 30 20:42:51 2013 (r251155) @@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESS public int quit_on_intr; /* Quit on interrupt */ public int follow_mode; /* F cmd Follows file desc or file name? */ public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */ +public int opt_use_backslash; /* Use backslash escaping in option parsing */ #if HILITE_SEARCH public int hilite_search; /* Highlight matched search patterns? */ #endif @@ -115,6 +116,7 @@ static struct optname pound_optname = { static struct optname keypad_optname = { "no-keypad", NULL }; static struct optname oldbot_optname = { "old-bot", NULL }; static struct optname follow_optname = { "follow-name", NULL }; +static struct optname use_backslash_optname = { "use-backslash", NULL }; /* @@ -446,6 +448,14 @@ static struct loption option[] = NULL } }, + { OLETTER_NONE, &use_backslash_optname, + BOOL, OPT_OFF, &opt_use_backslash, NULL, + { + "Use backslash escaping in command line parameters", + "Don't use backslash escaping in command line parameters", + NULL + } + }, { '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } } }; Modified: stable/8/contrib/less/output.c ============================================================================== --- stable/8/contrib/less/output.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/output.c Thu May 30 20:42:51 2013 (r251155) @@ -278,8 +278,13 @@ flush() */ if (p[-2] == '[') { +#if MSDOS_COMPILER==WIN32C + fg |= FOREGROUND_INTENSITY; + bg |= BACKGROUND_INTENSITY; +#else fg = bo_fg_color; bg = bo_bg_color; +#endif } else fg |= 8; } else if (at & 2) Modified: stable/8/contrib/less/position.c ============================================================================== --- stable/8/contrib/less/position.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/position.c Thu May 30 20:42:51 2013 (r251155) @@ -162,7 +162,7 @@ empty_lines(s, e) register int i; for (i = s; i <= e; i++) - if (table[i] != NULL_POSITION) + if (table[i] != NULL_POSITION && table[i] != 0) return (0); return (1); } Modified: stable/8/contrib/less/screen.c ============================================================================== --- stable/8/contrib/less/screen.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/screen.c Thu May 30 20:42:51 2013 (r251155) @@ -802,7 +802,7 @@ scrsize() else if ((n = ltgetnum("li")) > 0) sc_height = n; #endif - else + if (sc_height <= 0) sc_height = DEF_SC_HEIGHT; if (sys_width > 0) @@ -813,7 +813,7 @@ scrsize() else if ((n = ltgetnum("co")) > 0) sc_width = n; #endif - else + if (sc_width <= 0) sc_width = DEF_SC_WIDTH; } Modified: stable/8/contrib/less/version.c ============================================================================== --- stable/8/contrib/less/version.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/version.c Thu May 30 20:42:51 2013 (r251155) @@ -753,6 +753,15 @@ v448 6/15/12 Print name of regex libr v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:45:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A40D808; Thu, 30 May 2013 20:45:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D69774F; Thu, 30 May 2013 20:45:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKjvqU049545; Thu, 30 May 2013 20:45:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKjvxW049544; Thu, 30 May 2013 20:45:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302045.r4UKjvxW049544@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251156 - stable/9/bin/kenv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:45:58 -0000 Author: delphij Date: Thu May 30 20:45:57 2013 New Revision: 251156 URL: http://svnweb.freebsd.org/changeset/base/251156 Log: MFC r250666: Constify parameters, no functional or binary change. Modified: stable/9/bin/kenv/kenv.c Directory Properties: stable/9/bin/kenv/ (props changed) Modified: stable/9/bin/kenv/kenv.c ============================================================================== --- stable/9/bin/kenv/kenv.c Thu May 30 20:42:51 2013 (r251155) +++ stable/9/bin/kenv/kenv.c Thu May 30 20:45:57 2013 (r251156) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); static void usage(void); static int kdumpenv(void); -static int kgetenv(char *); -static int ksetenv(char *, char *); -static int kunsetenv(char *); +static int kgetenv(const char *); +static int ksetenv(const char *, char *); +static int kunsetenv(const char *); static int hflag = 0; static int Nflag = 0; @@ -170,7 +170,7 @@ kdumpenv(void) } static int -kgetenv(char *env) +kgetenv(const char *env) { char buf[1024]; int ret; @@ -186,7 +186,7 @@ kgetenv(char *env) } static int -ksetenv(char *env, char *val) +ksetenv(const char *env, char *val) { int ret; @@ -197,7 +197,7 @@ ksetenv(char *env, char *val) } static int -kunsetenv(char *env) +kunsetenv(const char *env) { int ret; From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:46:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C895B9A5; Thu, 30 May 2013 20:46:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA951767; Thu, 30 May 2013 20:46:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKkuq1049775; Thu, 30 May 2013 20:46:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKkubT049774; Thu, 30 May 2013 20:46:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302046.r4UKkubT049774@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251157 - stable/9/sbin/tunefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:46:56 -0000 Author: delphij Date: Thu May 30 20:46:56 2013 New Revision: 251157 URL: http://svnweb.freebsd.org/changeset/base/251157 Log: MFC r250718: Constify string pointers. Modified: stable/9/sbin/tunefs/tunefs.c Directory Properties: stable/9/sbin/tunefs/ (props changed) Modified: stable/9/sbin/tunefs/tunefs.c ============================================================================== --- stable/9/sbin/tunefs/tunefs.c Thu May 30 20:45:57 2013 (r251156) +++ stable/9/sbin/tunefs/tunefs.c Thu May 30 20:46:56 2013 (r251157) @@ -82,8 +82,8 @@ void sbdirty(void); int main(int argc, char *argv[]) { - char *avalue, *jvalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; - char *tvalue; + const char *avalue, *jvalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; + const char *tvalue; const char *special, *on; const char *name; int active; @@ -712,7 +712,7 @@ journal_findfile(void) } static void -dir_clear_block(char *block, off_t off) +dir_clear_block(const char *block, off_t off) { struct direct *dp; From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:51:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 34E27D27; Thu, 30 May 2013 20:51:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 176557C4; Thu, 30 May 2013 20:51:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKpOoN052188; Thu, 30 May 2013 20:51:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKpM6p052173; Thu, 30 May 2013 20:51:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302051.r4UKpM6p052173@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251158 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:51:24 -0000 Author: delphij Date: Thu May 30 20:51:22 2013 New Revision: 251158 URL: http://svnweb.freebsd.org/changeset/base/251158 Log: MFV: tcpdump 4.4.0. MFC after: 4 weeks Added: head/contrib/tcpdump/print-msnlb.c - copied unchanged from r251129, vendor/tcpdump/dist/print-msnlb.c head/contrib/tcpdump/print-otv.c - copied, changed from r251129, vendor/tcpdump/dist/print-otv.c head/contrib/tcpdump/print-vxlan.c - copied, changed from r251129, vendor/tcpdump/dist/print-vxlan.c head/contrib/tcpdump/print-zeromq.c - copied unchanged from r251129, vendor/tcpdump/dist/print-zeromq.c Modified: head/contrib/tcpdump/CHANGES head/contrib/tcpdump/CREDITS head/contrib/tcpdump/Makefile.in head/contrib/tcpdump/README head/contrib/tcpdump/VERSION head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/checksum.c head/contrib/tcpdump/configure head/contrib/tcpdump/configure.in head/contrib/tcpdump/ethertype.h head/contrib/tcpdump/icmp6.h head/contrib/tcpdump/interface.h head/contrib/tcpdump/netdissect.h head/contrib/tcpdump/nlpid.c head/contrib/tcpdump/nlpid.h head/contrib/tcpdump/print-802_11.c head/contrib/tcpdump/print-babel.c head/contrib/tcpdump/print-bgp.c head/contrib/tcpdump/print-dhcp6.c head/contrib/tcpdump/print-domain.c head/contrib/tcpdump/print-ether.c head/contrib/tcpdump/print-icmp6.c head/contrib/tcpdump/print-isoclns.c head/contrib/tcpdump/print-lldp.c head/contrib/tcpdump/print-ntp.c head/contrib/tcpdump/print-pppoe.c head/contrib/tcpdump/print-rip.c head/contrib/tcpdump/print-rpki-rtr.c head/contrib/tcpdump/print-stp.c head/contrib/tcpdump/print-tcp.c head/contrib/tcpdump/print-udp.c head/contrib/tcpdump/tcp.h head/contrib/tcpdump/tcpdump.1.in head/contrib/tcpdump/tcpdump.c head/contrib/tcpdump/udp.h head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h head/usr.sbin/tcpdump/tcpdump/tcpdump.1 Directory Properties: head/contrib/tcpdump/ (props changed) Modified: head/contrib/tcpdump/CHANGES ============================================================================== --- head/contrib/tcpdump/CHANGES Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/CHANGES Thu May 30 20:51:22 2013 (r251158) @@ -1,3 +1,37 @@ +Thursday February 19, 2013 guy@alum.mit.edu. + Summary for 4.4.0 tcpdump release + RPKI-RTR (RFC6810) is now official (TCP Port 323) + Fix detection of OpenSSL libcrypto. + Add DNSSL (RFC6106) support. + Add "radius" as an option for -T. + Update Action codes for handle_action function according to + 802.11s amendment. + Decode DHCPv6 AFTR-Name option (RFC6334). + Updates for Babel. + Fix printing of infinite lifetime in ICMPv6. + Added support for SPB, SPBM Service Identifier, and Unicast + Address sub-TLV in ISIS. + Decode RIPv2 authentication up to RFC4822. + Fix RIP Request/full table decoding issues. + On Linux systems with cap-ng.h, drop root privileges + using Linux Capabilities. + Add support for reading multiple files. + +Wednesday November 28, 2012 guy@alum.mit.edu. + Summary for 4.3.1 tcpdump release + Print "LLDP, length N" for LLDP packets even when not in verbose + mode, so something is printed even if only the timestamp is + present + Document "-T carp" + Print NTP poll interval correctly (it's an exponent, so print + both its raw value and 2^value) + Document that "-e" is used to get MAC addresses + More clearly document that you need to escape or quote + backslashes in filter expressions on the command line + Fix some "the the" in the man page + Use the right maximum path length + Don't treat 192_1_2, when passed to -i, as an interface number + Friday April 3, 2011. mcr@sandelman.ca. Summary for 4.3.0 tcpdump release fixes for forces: SPARSE data (per RFC 5810) Modified: head/contrib/tcpdump/CREDITS ============================================================================== --- head/contrib/tcpdump/CREDITS Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/CREDITS Thu May 30 20:51:22 2013 (r251158) @@ -52,6 +52,7 @@ Additional people who have contributed p David Horn David Smith David Young + Denis Ovsienko Dmitry Eremin-Solenikov Don Ebright Eddie Kohler Modified: head/contrib/tcpdump/Makefile.in ============================================================================== --- head/contrib/tcpdump/Makefile.in Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/Makefile.in Thu May 30 20:51:22 2013 (r251158) @@ -84,7 +84,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ print-lmp.c print-lspping.c print-lwapp.c \ print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \ - print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ + print-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ print-pgm.c print-pim.c \ print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \ print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \ @@ -93,7 +93,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \ print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \ - print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c + print-wb.c print-zephyr.c print-zeromq.c print-vxlan.c print-otv.c signature.c setsignal.c tcpdump.c util.c LIBNETDISSECT_SRC=print-isakmp.c LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) @@ -263,93 +263,8 @@ EXTRA_DIST = \ stime.awk \ strcasecmp.c \ tcpdump.1.in \ - tests/02-sunrise-sunset-esp.pcap \ - tests/08-sunrise-sunset-aes.pcap \ - tests/08-sunrise-sunset-esp2.pcap \ - tests/QinQpacket.out \ - tests/QinQpacket.pcap \ - tests/QinQpacketv.out \ - tests/TESTLIST \ - tests/TESTonce \ - tests/TESTrun.sh \ - tests/babel.pcap \ - tests/babel1.out \ - tests/babel1v.out \ - tests/bgp-infinite-loop.pcap \ - tests/bgp_vpn_attrset.out \ - tests/bgp_vpn_attrset.pcap \ - tests/chdlc-slarp-short.pcap \ - tests/chdlc-slarp.pcap \ - tests/dio.out \ - tests/dio.pcap \ - tests/e1000g.out \ - tests/e1000g.pcap \ - tests/eapon1.gdbinit \ - tests/eapon1.out \ - tests/eapon1.pcap \ - tests/empty.uu \ - tests/esp-secrets.txt \ - tests/esp0.out \ - tests/esp1.gdbinit \ - tests/esp1.out \ - tests/esp2.gdbinit \ - tests/esp2.out \ - tests/esp3.gdbinit \ - tests/esp4.gdbinit \ - tests/esp5.gdbinit \ - tests/esp5.out \ - tests/espudp1.out \ - tests/espudp1.pcap \ - tests/forces1.out \ - tests/forces1.pcap \ - tests/forces1vvv.out \ - tests/forces1vvvv.out \ - tests/forces2v.out \ - tests/forces2vv.out \ - tests/forces3vvv.out \ - tests/icmpv6.out \ - tests/icmpv6.pcap \ - tests/ikev2four.out \ - tests/ikev2four.pcap \ - tests/ikev2fourv.out \ - tests/ikev2fourv4.out \ - tests/ikev2pI2-secrets.txt \ - tests/ikev2pI2.out \ - tests/ikev2pI2.pcap \ - tests/isakmp-delete-segfault.pcap \ - tests/isakmp-identification-segfault.pcap \ - tests/isakmp-pointer-loop.pcap \ - tests/isakmp1.out \ - tests/isakmp2.out \ - tests/isakmp3.out \ - tests/isakmp4.out \ - tests/isakmp4500.pcap \ - tests/isis-infinite-loop.pcap \ - tests/ldp-infinite-loop.pcap \ - tests/lmp.out \ - tests/lmp.pcap \ - tests/lmp.sh \ - tests/lspping-fec-ldp.pcap \ - tests/lspping-fec-rsvp.pcap \ - tests/mpls-ldp-hello.out \ - tests/mpls-ldp-hello.pcap \ - tests/mpls-traceroute.pcap \ - tests/ospf-gmpls.out \ - tests/ospf-gmpls.pcap \ - tests/pppoe.out \ - tests/pppoe.pcap \ - tests/print-A.out \ - tests/print-AA.out \ - tests/print-capX.out \ - tests/print-capXX.out \ - tests/print-flags.pcap \ - tests/print-flags.sh \ - tests/print-x.out \ - tests/print-xx.out \ - tests/rsvp-infinite-loop.pcap \ - tests/sflow_multiple_counter_30_pdus.out \ - tests/sflow_multiple_counter_30_pdus.pcap \ vfprintf.c \ + win32/Include/bittypes.h \ win32/Include/errno.h \ win32/Include/getopt.h \ win32/Include/w32_fzs.h \ @@ -358,6 +273,8 @@ EXTRA_DIST = \ win32/prj/WinDump.dsp \ win32/prj/WinDump.dsw +TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` + all: $(PROG) $(PROG): $(OBJ) @V_PCAPDEP@ @@ -443,9 +360,12 @@ TAGS: $(TAGFILES) releasetar: @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ mkdir $$name; \ - tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \ + tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \ tar -c -z -f $$name.tar.gz $$name; \ rm -rf $$name +testlist: + echo $(TEST_DIST) + depend: $(GENSRC) ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) Modified: head/contrib/tcpdump/README ============================================================================== --- head/contrib/tcpdump/README Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/README Thu May 30 20:51:22 2013 (r251158) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely": cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump -Please submit patches against the master copy to the tcpdump project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -68,16 +71,19 @@ documentation. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for tcpdump at +requests, and feature requests may also be submitted on the GitHub issue +tracker for tcpdump at - http://sourceforge.net/projects/tcpdump/ + https://github.com/mcr/tcpdump/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for tcpdump. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for tcpdump. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: head/contrib/tcpdump/VERSION ============================================================================== --- head/contrib/tcpdump/VERSION Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/VERSION Thu May 30 20:51:22 2013 (r251158) @@ -1 +1 @@ -4.3.0 +4.4.0 Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/addrtoname.c Thu May 30 20:51:22 2013 (r251158) @@ -383,6 +383,9 @@ lookup_bytestring(register const u_char tp->e_addr2 = k; tp->e_bs = (u_char *) calloc(1, nlen + 1); + if (tp->e_bs == NULL) + error("lookup_bytestring: calloc"); + memcpy(tp->e_bs, bs, nlen); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) Modified: head/contrib/tcpdump/checksum.c ============================================================================== --- head/contrib/tcpdump/checksum.c Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/checksum.c Thu May 30 20:51:22 2013 (r251158) @@ -152,8 +152,6 @@ create_osi_cksum (const u_int8_t *pptr, u_int16_t checksum; int index; - checksum = 0; - c0 = 0; c1 = 0; Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/configure Thu May 30 20:51:22 2013 (r251158) @@ -1,61 +1,84 @@ #! /bin/sh # From configure.in Revision: 1.204 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.68. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -64,20 +87,19 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -88,354 +110,328 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -fi -fi +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 20:54:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48756F13; Thu, 30 May 2013 20:54:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3ABBF7FD; Thu, 30 May 2013 20:54:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKsIOh052721; Thu, 30 May 2013 20:54:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKsIQX052720; Thu, 30 May 2013 20:54:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305302054.r4UKsIQX052720@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251159 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:54:18 -0000 Author: marius Date: Thu May 30 20:54:17 2013 New Revision: 251159 URL: http://svnweb.freebsd.org/changeset/base/251159 Log: - Checking for spurious interrupts is only necessary when using INTx. Actually, this may be further optimized for controller variants supporting one-shot MSIs but I'm lacking the necessary hardware for testing. - Add some missing synchronization of the statistics and status DMA maps. MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 20:51:22 2013 (r251158) +++ head/sys/dev/bce/if_bce.c Thu May 30 20:54:17 2013 (r251159) @@ -7876,7 +7876,7 @@ bce_watchdog_exit: /* interrupt causes (PHY, TX, RX). */ /* */ /* Returns: */ -/* 0 for success, positive value for failure. */ +/* Nothing. */ /****************************************************************************/ static void bce_intr(void *xsc) @@ -7898,16 +7898,16 @@ bce_intr(void *xsc) DBRUN(sc->interrupts_generated++); /* Synchnorize before we read from interface's status block */ - bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_POSTREAD); /* - * If the hardware status block index - * matches the last value read by the - * driver and we haven't asserted our - * interrupt then there's nothing to do. + * If the hardware status block index matches the last value read + * by the driver and we haven't asserted our interrupt then there's + * nothing to do. This may only happen in case of INTx due to the + * interrupt arriving at the CPU before the status block is updated. */ - if ((sc->status_block->status_idx == sc->last_status_idx) && + if ((sc->bce_flags & (BCE_USING_MSI_FLAG | BCE_USING_MSIX_FLAG)) == 0 && + sc->status_block->status_idx == sc->last_status_idx && (REG_RD(sc, BCE_PCICFG_MISC_STATUS) & BCE_PCICFG_MISC_STATUS_INTA_VALUE)) { DBPRINT(sc, BCE_VERBOSE_INTR, "%s(): Spurious interrupt.\n", @@ -7995,11 +7995,9 @@ bce_intr(void *xsc) if ((hw_rx_cons == sc->hw_rx_cons) && (hw_tx_cons == sc->hw_tx_cons)) break; - } - bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_PREREAD); /* Re-enable interrupts. */ bce_enable_intr(sc, 0); @@ -8124,6 +8122,8 @@ bce_stats_update(struct bce_softc *sc) ifp = sc->bce_ifp; + bus_dmamap_sync(sc->stats_tag, sc->stats_map, BUS_DMASYNC_POSTREAD); + stats = (struct statistics_block *) sc->stats_block; /* @@ -8651,6 +8651,8 @@ bce_sysctl_stats_clear(SYSCTL_HANDLER_AR stats = (struct statistics_block *) sc->stats_block; bzero(stats, sizeof(struct statistics_block)); + bus_dmamap_sync(sc->stats_tag, sc->stats_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Clear the internal H/W statistics counters. */ REG_WR(sc, BCE_HC_COMMAND, BCE_HC_COMMAND_CLR_STAT_NOW); @@ -10636,6 +10638,8 @@ bce_dump_status_block(struct bce_softc * { struct status_block *sblk; + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_POSTREAD); + sblk = sc->status_block; BCE_PRINTF( @@ -10698,6 +10702,8 @@ bce_dump_stats_block(struct bce_softc *s { struct statistics_block *sblk; + bus_dmamap_sync(sc->stats_tag, sc->stats_map, BUS_DMASYNC_POSTREAD); + sblk = sc->stats_block; BCE_PRINTF( From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:24:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D4D387E; Thu, 30 May 2013 21:24:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80696A35; Thu, 30 May 2013 21:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULOYvg063562; Thu, 30 May 2013 21:24:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULOYw0063561; Thu, 30 May 2013 21:24:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302124.r4ULOYw0063561@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251160 - head/usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:24:34 -0000 Author: delphij Date: Thu May 30 21:24:33 2013 New Revision: 251160 URL: http://svnweb.freebsd.org/changeset/base/251160 Log: Convert Makefile to have only one file for each line, while I'm there, sort SRCS to ease future upgrades. Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Thu May 30 20:54:17 2013 (r251159) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Thu May 30 21:24:33 2013 (r251160) @@ -7,41 +7,136 @@ TCPDUMP_DISTDIR?= ${.CURDIR}/../../../co PROG= tcpdump -SRCS = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c \ - ipproto.c nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ - print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c print-arcnet.c \ - print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \ - print-beep.c print-bfd.c print-bgp.c print-bootp.c print-bt.c \ - print-carp.c print-cdp.c \ - print-cfm.c print-chdlc.c print-cip.c print-cnfp.c print-dccp.c \ - print-decnet.c print-domain.c print-dtp.c print-dvmrp.c print-enc.c \ - print-egp.c print-eap.c print-eigrp.c \ - print-esp.c print-ether.c print-fddi.c print-forces.c print-fr.c \ - print-gre.c print-hsrp.c print-icmp.c print-igmp.c \ - print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \ - print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \ - print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ - print-lmp.c print-lspping.c \ - print-lwapp.c print-lwres.c print-mobile.c print-mpls.c print-msdp.c \ - print-msnlb.c \ +SRCS= addrtoname.c \ + af.c \ + checksum.c \ + cpack.c \ + gmpls.c \ + gmt2local.c \ + in_cksum.c \ + ipproto.c \ + l2vpn.c \ + machdep.c \ + nlpid.c \ + oui.c \ + parsenfsfh.c \ + print-802_11.c \ + print-802_15_4.c \ + print-ah.c \ + print-aodv.c \ + print-ap1394.c \ + print-arcnet.c \ + print-arp.c \ + print-ascii.c \ + print-atalk.c \ + print-atm.c \ + print-beep.c \ + print-bfd.c \ + print-bgp.c \ + print-bootp.c \ + print-bt.c \ + print-carp.c \ + print-cdp.c \ + print-cfm.c \ + print-chdlc.c \ + print-cip.c \ + print-cnfp.c \ + print-dccp.c \ + print-decnet.c \ + print-domain.c \ + print-dtp.c \ + print-dvmrp.c \ + print-eap.c \ + print-egp.c \ + print-eigrp.c \ + print-enc.c \ + print-esp.c \ + print-ether.c \ + print-fddi.c \ + print-forces.c \ + print-fr.c \ + print-gre.c \ + print-hsrp.c \ + print-icmp.c \ + print-igmp.c \ + print-igrp.c \ + print-ip.c \ + print-ipcomp.c \ + print-ipfc.c \ + print-ipnet.c \ + print-ipx.c \ + print-isakmp.c \ + print-isoclns.c \ + print-juniper.c \ + print-krb.c \ + print-l2tp.c \ + print-lane.c \ + print-ldp.c \ + print-llc.c \ + print-lldp.c \ + print-lmp.c \ + print-lspping.c \ + print-lwapp.c \ + print-lwres.c \ + print-mobile.c \ print-mpcp.c \ - print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ + print-mpls.c \ + print-msdp.c \ + print-msnlb.c \ + print-nfs.c \ + print-ntp.c \ + print-null.c \ + print-olsr.c \ + print-ospf.c \ print-otv.c \ print-pfsync.c \ - print-pgm.c print-pim.c print-ppi.c print-ppp.c print-pppoe.c \ - print-pptp.c print-radius.c print-raw.c print-rip.c \ + print-pgm.c \ + print-pim.c \ + print-ppi.c \ + print-ppp.c \ + print-pppoe.c \ + print-pptp.c \ + print-radius.c \ + print-raw.c \ + print-rip.c \ print-rpki-rtr.c \ - print-rrcp.c print-rsvp.c print-rx.c print-sctp.c print-sflow.c \ - print-sip.c print-sl.c print-sll.c \ - print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ - print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ - print-timed.c print-tipc.c \ - print-token.c print-udld.c print-udp.c print-vjc.c \ - print-vqp.c print-vrrp.c print-vtp.c \ + print-rrcp.c \ + print-rsvp.c \ + print-rx.c \ + print-sctp.c \ + print-sflow.c \ + print-sip.c \ + print-sl.c \ + print-sll.c \ + print-slow.c \ + print-smb.c \ + print-snmp.c \ + print-stp.c \ + print-sunatm.c \ + print-sunrpc.c \ + print-symantec.c \ + print-syslog.c \ + print-tcp.c \ + print-telnet.c \ + print-tftp.c \ + print-timed.c \ + print-tipc.c \ + print-token.c \ + print-udld.c \ + print-udp.c \ + print-vjc.c \ + print-vqp.c \ + print-vrrp.c \ + print-vtp.c \ print-vxlan.c \ - print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \ + print-wb.c \ + print-zephyr.c \ print-zeromq.c \ - print-smb.c signature.c smbutil.c \ + setsignal.c \ + signature.c \ + smbutil.c \ + tcpdump.c \ + util.c \ version.c CLEANFILES+= version.c @@ -50,9 +145,16 @@ CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -D_U_="__attribute__((unused))" .if ${MK_INET6_SUPPORT} != "no" -SRCS+= print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c \ - print-icmp6.c print-babel.c print-frag6.c print-rt6.c print-ospf6.c \ - print-dhcp6.c +SRCS+= print-babel.c \ + print-dhcp6.c \ + print-frag6.c \ + print-icmp6.c \ + print-ip6.c \ + print-ip6opts.c \ + print-mobility.c \ + print-ospf6.c \ + print-ripng.c \ + print-rt6.c CFLAGS+= -DINET6 .endif .if ${MACHINE_CPUARCH} != "i386" From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:25:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49906A24; Thu, 30 May 2013 21:25:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BECCA4B; Thu, 30 May 2013 21:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULPuQZ063844; Thu, 30 May 2013 21:25:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULPuaE063843; Thu, 30 May 2013 21:25:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302125.r4ULPuaE063843@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251161 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:25:56 -0000 Author: delphij Date: Thu May 30 21:25:55 2013 New Revision: 251161 URL: http://svnweb.freebsd.org/changeset/base/251161 Log: Diff reduction against tcpdump revision 949a22064d3534eddeb8aa2b9c36a50e45fe16fa. Modified: head/contrib/tcpdump/interface.h Modified: head/contrib/tcpdump/interface.h ============================================================================== --- head/contrib/tcpdump/interface.h Thu May 30 21:24:33 2013 (r251160) +++ head/contrib/tcpdump/interface.h Thu May 30 21:25:55 2013 (r251161) @@ -224,7 +224,6 @@ extern void ntp_print(const u_char *, u_ extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *); extern void ospf_print(const u_char *, u_int, const u_char *); extern void olsr_print (const u_char *, u_int, int); -extern void otv_print(const u_char *, u_int); extern void pimv1_print(const u_char *, u_int); extern void cisco_autorp_print(const u_char *, u_int); extern void rsvp_print(const u_char *, u_int); @@ -324,7 +323,7 @@ extern u_int bt_if_print(const struct pc extern u_int usb_linux_48_byte_print(const struct pcap_pkthdr *, const u_char *); extern u_int usb_linux_64_byte_print(const struct pcap_pkthdr *, const u_char *); extern void vxlan_print(const u_char *, u_int); - +extern void otv_print(const u_char *, u_int); #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:49:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A23901EF; Thu, 30 May 2013 21:49:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 944A3C01; Thu, 30 May 2013 21:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULnhxg071461; Thu, 30 May 2013 21:49:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULnhmr071460; Thu, 30 May 2013 21:49:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302149.r4ULnhmr071460@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251162 - stable/9/sys/dev/hptiop X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:49:43 -0000 Author: delphij Date: Thu May 30 21:49:43 2013 New Revision: 251162 URL: http://svnweb.freebsd.org/changeset/base/251162 Log: MFC r250050: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/9/sys/dev/hptiop/hptiop.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Thu May 30 21:25:55 2013 (r251161) +++ stable/9/sys/dev/hptiop/hptiop.c Thu May 30 21:49:43 2013 (r251162) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:50:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 975BF3C9; Thu, 30 May 2013 21:50:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A463C1C; Thu, 30 May 2013 21:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULoPvB071700; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULoPW4071699; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302150.r4ULoPW4071699@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251163 - stable/8/sys/dev/hptiop X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:50:25 -0000 Author: delphij Date: Thu May 30 21:50:25 2013 New Revision: 251163 URL: http://svnweb.freebsd.org/changeset/base/251163 Log: MFC r250050: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/8/sys/dev/hptiop/hptiop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/hptiop/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:49:43 2013 (r251162) +++ stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:50:25 2013 (r251163) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:54:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213D85F3; Thu, 30 May 2013 21:54:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 029AFCD8; Thu, 30 May 2013 21:54:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULsnFE074068; Thu, 30 May 2013 21:54:49 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULsmZJ074053; Thu, 30 May 2013 21:54:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305302154.r4ULsmZJ074053@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 21:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:54:50 -0000 Author: scottl Date: Thu May 30 21:54:48 2013 New Revision: 251164 URL: http://svnweb.freebsd.org/changeset/base/251164 Log: MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. Submitted by: jhb Obtained from: Netflix Modified: stable/9/sys/dev/advansys/adv_eisa.c stable/9/sys/dev/advansys/adv_isa.c stable/9/sys/dev/advansys/adv_pci.c stable/9/sys/dev/advansys/advansys.c stable/9/sys/dev/advansys/advansys.h stable/9/sys/dev/advansys/advlib.c stable/9/sys/dev/advansys/advlib.h stable/9/sys/dev/advansys/adw_pci.c stable/9/sys/dev/advansys/adwcam.c stable/9/sys/dev/advansys/adwlib.c stable/9/sys/dev/advansys/adwlib.h stable/9/sys/dev/advansys/adwvar.h stable/9/sys/dev/aha/aha.c stable/9/sys/dev/aha/aha_isa.c stable/9/sys/dev/aha/aha_mca.c stable/9/sys/dev/aha/ahareg.h stable/9/sys/dev/ahb/ahb.c stable/9/sys/dev/ahb/ahbreg.h stable/9/sys/dev/buslogic/bt.c stable/9/sys/dev/buslogic/bt_eisa.c stable/9/sys/dev/buslogic/bt_isa.c stable/9/sys/dev/buslogic/bt_mca.c stable/9/sys/dev/buslogic/bt_pci.c stable/9/sys/dev/buslogic/btreg.h stable/9/sys/dev/dpt/dpt.h stable/9/sys/dev/dpt/dpt_eisa.c stable/9/sys/dev/dpt/dpt_isa.c stable/9/sys/dev/dpt/dpt_pci.c stable/9/sys/dev/dpt/dpt_scsi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/advansys/adv_eisa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_eisa.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_eisa.c Thu May 30 21:54:48 2013 (r251164) @@ -131,17 +131,27 @@ adv_eisa_probe(device_t dev) return 0; } +/* + * The adv_b stuff to handle twin-channel cards will not work in its current + * incarnation. It tries to reuse the same softc since adv_alloc() doesn't + * actually allocate a softc. It also tries to reuse the same unit number + * for both sims. This can be re-enabled if someone fixes it properly. + */ static int adv_eisa_attach(device_t dev) { struct adv_softc *adv; +#if 0 struct adv_softc *adv_b; +#endif struct resource *io; struct resource *irq; int rid, error; void *ih; +#if 0 adv_b = NULL; +#endif rid = 0; io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); @@ -162,8 +172,8 @@ adv_eisa_attach(device_t dev) switch (eisa_get_id(dev) & ~0xF) { case EISA_DEVICE_ID_ADVANSYS_750: - adv_b = adv_alloc(dev, rman_get_bustag(io), - rman_get_bushandle(io) + ADV_EISA_OFFSET_CHAN2); +#if 0 + adv_b = adv_alloc(dev, io, ADV_EISA_OFFSET_CHAN2); if (adv_b == NULL) goto bad; @@ -183,26 +193,28 @@ adv_eisa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_EISA_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv_b->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv_b), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv_b); goto bad; } adv_b->init_level++; +#endif /* FALLTHROUGH */ case EISA_DEVICE_ID_ADVANSYS_740: - adv = adv_alloc(dev, rman_get_bustag(io), - rman_get_bushandle(io) + ADV_EISA_OFFSET_CHAN1); + adv = adv_alloc(dev, io, ADV_EISA_OFFSET_CHAN1); if (adv == NULL) { +#if 0 if (adv_b != NULL) adv_free(adv_b); +#endif goto bad; } @@ -222,13 +234,13 @@ adv_eisa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_EISA_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv); goto bad; } @@ -244,7 +256,7 @@ adv_eisa_attach(device_t dev) if (overrun_buf == NULL) { /* Need to allocate our overrun buffer */ if (bus_dma_tag_create( - /* parent */ adv->parent_dmat, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 8, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, @@ -255,8 +267,8 @@ adv_eisa_attach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &overrun_dmat) != 0) { adv_free(adv); goto bad; @@ -292,14 +304,17 @@ adv_eisa_attach(device_t dev) if (adv_init(adv) != 0) { adv_free(adv); +#if 0 if (adv_b != NULL) adv_free(adv_b); - return(-1); +#endif + goto bad; } adv->max_dma_count = ADV_EISA_MAX_DMA_COUNT; adv->max_dma_addr = ADV_EISA_MAX_DMA_ADDR; +#if 0 if (adv_b != NULL) { /* * Stop the chip. @@ -317,24 +332,33 @@ adv_eisa_attach(device_t dev) adv_b->max_dma_addr = ADV_EISA_MAX_DMA_ADDR; } } +#endif /* * Enable our interrupt handler. */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr, - adv, &ih); + if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, + adv_intr, adv, &ih) != 0) { + adv_free(adv); + goto bad; + } - /* Attach sub-devices - always succeeds */ - adv_attach(adv); + /* Attach sub-devices */ + if (adv_attach(adv) != 0) { + adv_free(adv); + goto bad; + } +#if 0 if (adv_b != NULL) adv_attach(adv_b); +#endif return 0; bad: bus_release_resource(dev, SYS_RES_IOPORT, 0, io); bus_release_resource(dev, SYS_RES_IRQ, 0, irq); - return -1; + return ENXIO; } static device_method_t adv_eisa_methods[] = { Modified: stable/9/sys/dev/advansys/adv_isa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_isa.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_isa.c Thu May 30 21:54:48 2013 (r251164) @@ -135,12 +135,13 @@ adv_isa_probe(device_t dev) if ((port_index > max_port_index) || (iobase != adv_isa_ioports[port_index])) { if (bootverbose) - printf("adv%d: Invalid baseport of 0x%lx specified. " - "Nearest valid baseport is 0x%x. Failing " - "probe.\n", device_get_unit(dev), iobase, - (port_index <= max_port_index) ? - adv_isa_ioports[port_index] : - adv_isa_ioports[max_port_index]); + device_printf(dev, + "Invalid baseport of 0x%lx specified. " + "Nearest valid baseport is 0x%x. Failing " + "probe.\n", iobase, + (port_index <= max_port_index) ? + adv_isa_ioports[port_index] : + adv_isa_ioports[max_port_index]); return ENXIO; } max_port_index = port_index; @@ -169,8 +170,7 @@ adv_isa_probe(device_t dev) if (iores == NULL) continue; - if (adv_find_signature(rman_get_bustag(iores), - rman_get_bushandle(iores)) == 0) { + if (adv_find_signature(iores) == 0) { bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); continue; } @@ -179,8 +179,7 @@ adv_isa_probe(device_t dev) * Got one. Now allocate our softc * and see if we can initialize the card. */ - adv = adv_alloc(dev, rman_get_bustag(iores), - rman_get_bushandle(iores)); + adv = adv_alloc(dev, iores, 0); if (adv == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); break; @@ -238,13 +237,13 @@ adv_isa_probe(device_t dev) /* nsegments */ ~0, /* maxsegsz */ maxsegsz, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, + "Could not allocate DMA tag - error %d\n", error); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); break; @@ -335,8 +334,11 @@ adv_isa_probe(device_t dev) irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY| + INTR_MPSAFE, NULL, adv_intr, adv, &ih) != 0) { + if (irqres != NULL) + bus_release_resource(dev, SYS_RES_IRQ, rid, + irqres); bus_dmamap_unload(overrun_dmat, overrun_dmamap); bus_dmamem_free(overrun_dmat, overrun_buf, overrun_dmamap); Modified: stable/9/sys/dev/advansys/adv_pci.c ============================================================================== --- stable/9/sys/dev/advansys/adv_pci.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_pci.c Thu May 30 21:54:48 2013 (r251164) @@ -138,7 +138,6 @@ adv_pci_attach(device_t dev) { struct adv_softc *adv; u_int32_t id; - u_int32_t command; int error, rid, irqrid; void *ih; struct resource *iores, *irqres; @@ -146,19 +145,8 @@ adv_pci_attach(device_t dev) /* * Determine the chip version. */ - id = pci_read_config(dev, PCIR_DEVVENDOR, /*bytes*/4); - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); - - /* - * These cards do not allow memory mapped accesses, so we must - * ensure that I/O accesses are available or we won't be able - * to talk to them. - */ - if ((command & (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN)) - != (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN)) { - command |= PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); - } + id = pci_get_devid(dev); + pci_enable_busmaster(dev); /* * Early chips can't handle non-zero latency timer settings. @@ -174,13 +162,12 @@ adv_pci_attach(device_t dev) if (iores == NULL) return ENXIO; - if (adv_find_signature(rman_get_bustag(iores), - rman_get_bushandle(iores)) == 0) { + if (adv_find_signature(iores) == 0) { bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; } - adv = adv_alloc(dev, rman_get_bustag(iores), rman_get_bushandle(iores)); + adv = adv_alloc(dev, iores, 0); if (adv == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; @@ -199,13 +186,13 @@ adv_pci_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_PCI_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; @@ -227,8 +214,8 @@ adv_pci_attach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &overrun_dmat) != 0) { bus_dma_tag_destroy(adv->parent_dmat); adv_free(adv); @@ -308,14 +295,22 @@ adv_pci_attach(device_t dev) irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid, RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, NULL, - adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, + NULL, adv_intr, adv, &ih) != 0) { + if (irqres != NULL) + bus_release_resource(dev, SYS_RES_IRQ, irqrid, irqres); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; } - adv_attach(adv); + if (adv_attach(adv) != 0) { + bus_teardown_intr(dev, irqres, ih); + bus_release_resource(dev, SYS_RES_IRQ, irqrid, irqres); + adv_free(adv); + bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); + return ENXIO; + } return 0; } Modified: stable/9/sys/dev/advansys/advansys.c ============================================================================== --- stable/9/sys/dev/advansys/advansys.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advansys.c Thu May 30 21:54:48 2013 (r251164) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); static void adv_action(struct cam_sim *sim, union ccb *ccb); static void adv_execute_ccb(void *arg, bus_dma_segment_t *dm_segs, int nsegments, int error); +static void adv_intr_locked(struct adv_softc *adv); static void adv_poll(struct cam_sim *sim); static void adv_run_doneq(struct adv_softc *adv); static struct adv_ccb_info * @@ -97,15 +99,14 @@ static __inline struct adv_ccb_info * adv_get_ccb_info(struct adv_softc *adv) { struct adv_ccb_info *cinfo; - int opri; - opri = splcam(); + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); if ((cinfo = SLIST_FIRST(&adv->free_ccb_infos)) != NULL) { SLIST_REMOVE_HEAD(&adv->free_ccb_infos, links); } else { cinfo = adv_alloc_ccb_info(adv); } - splx(opri); return (cinfo); } @@ -113,12 +114,11 @@ adv_get_ccb_info(struct adv_softc *adv) static __inline void adv_free_ccb_info(struct adv_softc *adv, struct adv_ccb_info *cinfo) { - int opri; - opri = splcam(); + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); cinfo->state = ACCB_FREE; SLIST_INSERT_HEAD(&adv->free_ccb_infos, cinfo, links); - splx(opri); } static __inline void @@ -139,6 +139,9 @@ adv_clear_state(struct adv_softc *adv, u static void adv_clear_state_really(struct adv_softc *adv, union ccb* ccb) { + + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); if ((adv->state & ADV_BUSDMA_BLOCK_CLEARED) != 0) adv->state &= ~(ADV_BUSDMA_BLOCK_CLEARED|ADV_BUSDMA_BLOCK); if ((adv->state & ADV_RESOURCE_SHORTAGE) != 0) { @@ -164,13 +167,14 @@ adv_clear_state_really(struct adv_softc */ ccb_h = LIST_FIRST(&adv->pending_ccbs); while (ccb_h != NULL) { - ccb_h->timeout_ch = - timeout(adv_timeout, (caddr_t)ccb_h, - (ccb_h->timeout * hz) / 1000); + cinfo = ccb_h->ccb_cinfo_ptr; + callout_reset(&cinfo->timer, + ccb_h->timeout * hz / 1000, adv_timeout, + ccb_h); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } adv->state &= ~ADV_IN_TIMEOUT; - printf("%s: No longer in timeout\n", adv_name(adv)); + device_printf(adv->dev, "No longer in timeout\n"); } } if (adv->state == 0) @@ -186,15 +190,6 @@ adv_map(void *arg, bus_dma_segment_t *se *physaddr = segs->ds_addr; } -char * -adv_name(struct adv_softc *adv) -{ - static char name[10]; - - snprintf(name, sizeof(name), "adv%d", adv->unit); - return (name); -} - static void adv_action(struct cam_sim *sim, union ccb *ccb) { @@ -203,6 +198,7 @@ adv_action(struct cam_sim *sim, union cc CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("adv_action\n")); adv = (struct adv_softc *)cam_sim_softc(sim); + mtx_assert(&adv->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -229,10 +225,8 @@ adv_action(struct cam_sim *sim, union cc * to a single buffer */ if ((ccb_h->flags & CAM_DATA_PHYS) == 0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load(adv->buffer_dmat, cinfo->dmamap, @@ -250,7 +244,6 @@ adv_action(struct cam_sim *sim, union cc adv_set_state(adv, ADV_BUSDMA_BLOCK); } - splx(s); } else { struct bus_dma_segment seg; @@ -299,7 +292,6 @@ adv_action(struct cam_sim *sim, union cc target_bit_vector targ_mask; struct adv_transinfo *tconf; u_int update_type; - int s; cts = &ccb->cts; targ_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id); @@ -320,7 +312,6 @@ adv_action(struct cam_sim *sim, union cc break; } - s = splcam(); scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if ((update_type & ADV_TRANS_GOAL) != 0) { @@ -387,7 +378,6 @@ adv_action(struct cam_sim *sim, union cc spi->sync_offset, update_type); } - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -400,7 +390,6 @@ adv_action(struct cam_sim *sim, union cc struct ccb_trans_settings *cts; struct adv_transinfo *tconf; target_bit_vector target_mask; - int s; cts = &ccb->cts; target_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id); @@ -416,7 +405,6 @@ adv_action(struct cam_sim *sim, union cc scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; - s = splcam(); if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { tconf = &adv->tinfo[cts->ccb_h.target_id].current; if ((adv->disc_enable & target_mask) != 0) @@ -432,7 +420,6 @@ adv_action(struct cam_sim *sim, union cc } spi->sync_period = tconf->period; spi->sync_offset = tconf->offset; - splx(s); spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT; spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET @@ -454,13 +441,10 @@ adv_action(struct cam_sim *sim, union cc } case XPT_RESET_BUS: /* Reset the specified SCSI bus */ { - int s; - s = splcam(); adv_stop_execution(adv); adv_reset_bus(adv, /*initiate_reset*/TRUE); adv_start_execution(adv); - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -521,13 +505,14 @@ adv_execute_ccb(void *arg, bus_dma_segme struct adv_ccb_info *cinfo; struct adv_scsi_q scsiq; struct adv_sg_head sghead; - int s; csio = (struct ccb_scsiio *)arg; ccb_h = &csio->ccb_h; sim = xpt_path_sim(ccb_h->path); adv = (struct adv_softc *)cam_sim_softc(sim); cinfo = (struct adv_ccb_info *)csio->ccb_h.ccb_cinfo_ptr; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); /* * Setup our done routine to release the simq on @@ -596,8 +581,6 @@ adv_execute_ccb(void *arg, bus_dma_segme scsiq.sg_head = NULL; } - s = splcam(); - /* * Last time we need to check if this SCB needs to * be aborted. @@ -608,7 +591,6 @@ adv_execute_ccb(void *arg, bus_dma_segme adv_clear_state(adv, (union ccb *)csio); adv_free_ccb_info(adv, cinfo); xpt_done((union ccb *)csio); - splx(s); return; } @@ -621,16 +603,14 @@ adv_execute_ccb(void *arg, bus_dma_segme adv_clear_state(adv, (union ccb *)csio); adv_free_ccb_info(adv, cinfo); xpt_done((union ccb *)csio); - splx(s); return; } cinfo->state |= ACCB_ACTIVE; ccb_h->status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&adv->pending_ccbs, ccb_h, sim_links.le); /* Schedule our timeout */ - ccb_h->timeout_ch = - timeout(adv_timeout, csio, (ccb_h->timeout * hz)/1000); - splx(s); + callout_reset(&cinfo->timer, ccb_h->timeout * hz /1000, adv_timeout, + csio); } static struct adv_ccb_info * @@ -641,11 +621,12 @@ adv_alloc_ccb_info(struct adv_softc *adv cinfo = &adv->ccb_infos[adv->ccb_infos_allocated]; cinfo->state = ACCB_FREE; + callout_init_mtx(&cinfo->timer, &adv->lock, 0); error = bus_dmamap_create(adv->buffer_dmat, /*flags*/0, &cinfo->dmamap); if (error != 0) { - printf("%s: Unable to allocate CCB info " - "dmamap - error %d\n", adv_name(adv), error); + device_printf(adv->dev, "Unable to allocate CCB info " + "dmamap - error %d\n", error); return (NULL); } adv->ccb_infos_allocated++; @@ -655,28 +636,28 @@ adv_alloc_ccb_info(struct adv_softc *adv static void adv_destroy_ccb_info(struct adv_softc *adv, struct adv_ccb_info *cinfo) { + + callout_drain(&cinfo->timer); bus_dmamap_destroy(adv->buffer_dmat, cinfo->dmamap); } void adv_timeout(void *arg) { - int s; union ccb *ccb; struct adv_softc *adv; - struct adv_ccb_info *cinfo; + struct adv_ccb_info *cinfo, *cinfo2; ccb = (union ccb *)arg; adv = (struct adv_softc *)xpt_path_sim(ccb->ccb_h.path)->softc; cinfo = (struct adv_ccb_info *)ccb->ccb_h.ccb_cinfo_ptr; + mtx_assert(&adv->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("Timed out\n"); - s = splcam(); /* Have we been taken care of already?? */ if (cinfo == NULL || cinfo->state == ACCB_FREE) { - splx(s); return; } @@ -702,7 +683,8 @@ adv_timeout(void *arg) ccb_h = LIST_FIRST(&adv->pending_ccbs); while (ccb_h != NULL) { - untimeout(adv_timeout, ccb_h, ccb_h->timeout_ch); + cinfo2 = ccb_h->ccb_cinfo_ptr; + callout_stop(&cinfo2->timer); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } @@ -713,8 +695,7 @@ adv_timeout(void *arg) adv_abort_ccb(adv, ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb, CAM_CMD_TIMEOUT, /*queued_only*/FALSE); - ccb->ccb_h.timeout_ch = - timeout(adv_timeout, ccb, 2 * hz); + callout_reset(&cinfo->timer, 2 * hz, adv_timeout, ccb); } else { /* Our attempt to perform an abort failed, go for a reset */ xpt_print_path(ccb->ccb_h.path); @@ -724,11 +705,10 @@ adv_timeout(void *arg) adv_reset_bus(adv, /*initiate_reset*/TRUE); } adv_start_execution(adv); - splx(s); } struct adv_softc * -adv_alloc(device_t dev, bus_space_tag_t tag, bus_space_handle_t bsh) +adv_alloc(device_t dev, struct resource *res, long offset) { struct adv_softc *adv = device_get_softc(dev); @@ -738,9 +718,9 @@ adv_alloc(device_t dev, bus_space_tag_t LIST_INIT(&adv->pending_ccbs); SLIST_INIT(&adv->free_ccb_infos); adv->dev = dev; - adv->unit = device_get_unit(dev); - adv->tag = tag; - adv->bsh = bsh; + adv->res = res; + adv->reg_off = offset; + mtx_init(&adv->lock, "adv", NULL, MTX_DEF); return(adv); } @@ -773,6 +753,7 @@ adv_free(struct adv_softc *adv) if (adv->ccb_infos != NULL) free(adv->ccb_infos, M_DEVBUF); case 0: + mtx_destroy(&adv->lock); break; } } @@ -786,6 +767,7 @@ adv_init(struct adv_softc *adv) u_int16_t config_lsw; u_int16_t config_msw; + mtx_lock(&adv->lock); adv_lib_init(adv); /* @@ -794,14 +776,16 @@ adv_init(struct adv_softc *adv) adv_write_lram_16(adv, ADV_HALTCODE_W, 0x00FE); adv_stop_execution(adv); if (adv_stop_chip(adv) == 0 || adv_is_chip_halted(adv) == 0) { - printf("adv%d: Unable to halt adapter. Initialization" - "failed\n", adv->unit); + mtx_unlock(&adv->lock); + device_printf(adv->dev, + "Unable to halt adapter. Initialization failed\n"); return (1); } ADV_OUTW(adv, ADV_REG_PROG_COUNTER, ADV_MCODE_START_ADDR); if (ADV_INW(adv, ADV_REG_PROG_COUNTER) != ADV_MCODE_START_ADDR) { - printf("adv%d: Unable to set program counter. Initialization" - "failed\n", adv->unit); + mtx_unlock(&adv->lock); + device_printf(adv->dev, + "Unable to set program counter. Initialization failed\n"); return (1); } @@ -876,8 +860,8 @@ adv_init(struct adv_softc *adv) } else { u_int8_t sync_data; - printf("adv%d: Warning EEPROM Checksum mismatch. " - "Using default device parameters\n", adv->unit); + device_printf(adv->dev, "Warning EEPROM Checksum mismatch. " + "Using default device parameters\n"); /* Set reasonable defaults since we can't read the EEPROM */ adv->isa_dma_speed = /*ADV_DEF_ISA_DMA_SPEED*/1; @@ -940,13 +924,15 @@ adv_init(struct adv_softc *adv) * to be 100% correct. */ if (adv_set_eeprom_config(adv, &eeprom_config) != 0) - printf("%s: WARNING! Failure writing to EEPROM.\n", - adv_name(adv)); + device_printf(adv->dev, + "WARNING! Failure writing to EEPROM.\n"); #endif adv_set_chip_scsiid(adv, adv->scsi_id); - if (adv_init_lram_and_mcode(adv)) + if (adv_init_lram_and_mcode(adv)) { + mtx_unlock(&adv->lock); return (1); + } adv->disc_enable = adv->user_disc_enable; @@ -969,10 +955,12 @@ adv_init(struct adv_softc *adv) } adv_write_lram_8(adv, ADVV_USE_TAGGED_QNG_B, TARGET_BIT_VECTOR_SET); adv_write_lram_8(adv, ADVV_CAN_TAGGED_QNG_B, TARGET_BIT_VECTOR_SET); - printf("adv%d: AdvanSys %s Host Adapter, SCSI ID %d, queue depth %d\n", - adv->unit, (adv->type & ADV_ULTRA) && (max_sync == 0) - ? "Ultra SCSI" : "SCSI", - adv->scsi_id, adv->max_openings); + device_printf(adv->dev, + "AdvanSys %s Host Adapter, SCSI ID %d, queue depth %d\n", + (adv->type & ADV_ULTRA) && (max_sync == 0) + ? "Ultra SCSI" : "SCSI", + adv->scsi_id, adv->max_openings); + mtx_unlock(&adv->lock); return (0); } @@ -980,14 +968,24 @@ void adv_intr(void *arg) { struct adv_softc *adv; + + adv = arg; + mtx_lock(&adv->lock); + adv_intr_locked(adv); + mtx_unlock(&adv->lock); +} + +void +adv_intr_locked(struct adv_softc *adv) +{ u_int16_t chipstat; u_int16_t saved_ram_addr; u_int8_t ctrl_reg; u_int8_t saved_ctrl_reg; u_int8_t host_flag; - adv = (struct adv_softc *)arg; - + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); chipstat = ADV_INW(adv, ADV_CHIP_STATUS); /* Is it for us? */ @@ -1000,7 +998,7 @@ adv_intr(void *arg) ADV_CC_TEST)); if ((chipstat & (ADV_CSW_SCSI_RESET_LATCH|ADV_CSW_SCSI_RESET_ACTIVE))) { - printf("Detected Bus Reset\n"); + device_printf(adv->dev, "Detected Bus Reset\n"); adv_reset_bus(adv, /*initiate_reset*/FALSE); return; } @@ -1128,9 +1126,11 @@ adv_done(struct adv_softc *adv, union cc { struct adv_ccb_info *cinfo; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); cinfo = (struct adv_ccb_info *)ccb->ccb_h.ccb_cinfo_ptr; LIST_REMOVE(&ccb->ccb_h, sim_links.le); - untimeout(adv_timeout, ccb, ccb->ccb_h.timeout_ch); + callout_stop(&cinfo->timer); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -1239,7 +1239,7 @@ adv_done(struct adv_softc *adv, union cc case QHSTA_M_MICRO_CODE_ERROR_HALT: default: panic("%s: Unhandled Host status error %x", - adv_name(adv), host_stat); + device_get_nameunit(adv->dev), host_stat); /* NOTREACHED */ } break; @@ -1280,7 +1280,8 @@ adv_done(struct adv_softc *adv, union cc static void adv_poll(struct cam_sim *sim) { - adv_intr(cam_sim_softc(sim)); + + adv_intr_locked(cam_sim_softc(sim)); } /* @@ -1350,7 +1351,7 @@ adv_attach(adv) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &adv->lock, &adv->buffer_dmat) != 0) { return (ENXIO); } @@ -1371,7 +1372,7 @@ adv_attach(adv) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &adv->lock, &adv->sense_dmat) != 0) { return (ENXIO); } @@ -1398,8 +1399,8 @@ adv_attach(adv) * Fire up the chip */ if (adv_start_chip(adv) != 1) { - printf("adv%d: Unable to start on board processor. Aborting.\n", - adv->unit); + device_printf(adv->dev, + "Unable to start on board processor. Aborting.\n"); return (ENXIO); } @@ -1413,8 +1414,8 @@ adv_attach(adv) /* * Construct our SIM entry. */ - adv->sim = cam_sim_alloc(adv_action, adv_poll, "adv", adv, adv->unit, - &Giant, 1, adv->max_openings, devq); + adv->sim = cam_sim_alloc(adv_action, adv_poll, "adv", adv, + device_get_unit(adv->dev), &adv->lock, 1, adv->max_openings, devq); if (adv->sim == NULL) return (ENOMEM); @@ -1423,8 +1424,10 @@ adv_attach(adv) * * XXX Twin Channel EISA Cards??? */ + mtx_lock(&adv->lock); if (xpt_bus_register(adv->sim, adv->dev, 0) != CAM_SUCCESS) { cam_sim_free(adv->sim, /*free devq*/TRUE); + mtx_unlock(&adv->lock); return (ENXIO); } @@ -1433,6 +1436,7 @@ adv_attach(adv) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(adv->sim)); cam_sim_free(adv->sim, /*free devq*/TRUE); + mtx_unlock(&adv->lock); return (ENXIO); } @@ -1442,6 +1446,7 @@ adv_attach(adv) csa.callback = advasync; csa.callback_arg = adv; xpt_action((union ccb *)&csa); + mtx_unlock(&adv->lock); return (0); } MODULE_DEPEND(adv, cam, 1, 1, 1); Modified: stable/9/sys/dev/advansys/advansys.h ============================================================================== --- stable/9/sys/dev/advansys/advansys.h Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advansys.h Thu May 30 21:54:48 2013 (r251164) @@ -38,9 +38,7 @@ #include -struct adv_softc * adv_alloc(device_t dev, bus_space_tag_t tag, - bus_space_handle_t bsh); -char * adv_name(struct adv_softc *adv); +struct adv_softc * adv_alloc(device_t dev, struct resource *res, long offset); void adv_map(void *arg, bus_dma_segment_t *segs, int nseg, int error); void adv_free(struct adv_softc *adv); @@ -50,6 +48,6 @@ int adv_attach(struct adv_softc *adv); void adv_done(struct adv_softc *adv, union ccb* ccb, u_int done_stat, u_int host_stat, u_int scsi_stat, u_int q_no); -timeout_t adv_timeout; +void adv_timeout(void *arg); #endif /* _ADVANSYS_H_ */ Modified: stable/9/sys/dev/advansys/advlib.c ============================================================================== --- stable/9/sys/dev/advansys/advlib.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advlib.c Thu May 30 21:54:48 2013 (r251164) @@ -45,7 +45,10 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include +#include #include #include @@ -298,6 +301,7 @@ advasync(void *callback_arg, u_int32_t c struct adv_softc *adv; adv = (struct adv_softc *)callback_arg; + mtx_assert(&adv->lock, MA_OWNED); switch (code) { case AC_FOUND_DEVICE: { @@ -460,12 +464,12 @@ adv_write_lram_16(struct adv_softc *adv, * found, 0 otherwise. */ int -adv_find_signature(bus_space_tag_t tag, bus_space_handle_t bsh) +adv_find_signature(struct resource *res) { u_int16_t signature; - if (bus_space_read_1(tag, bsh, ADV_SIGNATURE_BYTE) == ADV_1000_ID1B) { - signature = bus_space_read_2(tag, bsh, ADV_SIGNATURE_WORD); + if (bus_read_1(res, ADV_SIGNATURE_BYTE) == ADV_1000_ID1B) { + signature = bus_read_2(res, ADV_SIGNATURE_WORD); if ((signature == ADV_1000_ID0W) || (signature == ADV_1000_ID0W_FIX)) return (1); @@ -594,8 +598,8 @@ adv_init_lram_and_mcode(struct adv_softc retval = adv_load_microcode(adv, 0, (u_int16_t *)adv_mcode, adv_mcode_size); if (retval != adv_mcode_chksum) { - printf("adv%d: Microcode download failed checksum!\n", - adv->unit); + device_printf(adv->dev, + "Microcode download failed checksum!\n"); return (1); } @@ -692,6 +696,8 @@ adv_execute_scsi_queue(struct adv_softc u_int8_t sg_entry_cnt_minus_one; u_int8_t tid_no; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); scsiq->q1.q_no = 0; retval = 1; /* Default to error case */ target_ix = scsiq->q2.target_ix; @@ -938,6 +944,8 @@ adv_isr_chip_halted(struct adv_softc *ad u_int8_t q_cntl; u_int8_t tid_no; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); int_halt_code = adv_read_lram_16(adv, ADVV_HALTCODE_W); halt_qp = adv_read_lram_8(adv, ADVV_CURCDB_B); halt_q_addr = ADV_QNO_TO_QADDR(halt_qp); @@ -966,6 +974,7 @@ adv_isr_chip_halted(struct adv_softc *ad target_mask, tid_no); } else if (int_halt_code == ADV_HALT_CHK_CONDITION) { struct adv_target_transinfo* tinfo; + struct adv_ccb_info *cinfo; union ccb *ccb; u_int32_t cinfo_index; u_int8_t tag_code; @@ -1008,6 +1017,7 @@ adv_isr_chip_halted(struct adv_softc *ad */ cinfo_index = adv_read_lram_32(adv, halt_q_addr + ADV_SCSIQ_D_CINFO_IDX); + cinfo = &adv->ccb_infos[cinfo_index]; ccb = adv->ccb_infos[cinfo_index].ccb; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:56:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26C577AD; Thu, 30 May 2013 21:56:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F332DCFB; Thu, 30 May 2013 21:56:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULurN7074557; Thu, 30 May 2013 21:56:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULur6b074556; Thu, 30 May 2013 21:56:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302156.r4ULur6b074556@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251165 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:56:54 -0000 Author: delphij Date: Thu May 30 21:56:53 2013 New Revision: 251165 URL: http://svnweb.freebsd.org/changeset/base/251165 Log: MFC r241031 (des): Slight stylification. Modified: stable/9/lib/libc/stdlib/random.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/random.c ============================================================================== --- stable/9/lib/libc/stdlib/random.c Thu May 30 21:54:48 2013 (r251164) +++ stable/9/lib/libc/stdlib/random.c Thu May 30 21:56:53 2013 (r251165) @@ -216,10 +216,8 @@ static int rand_deg = DEG_3; static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; -static inline uint32_t good_rand(int32_t); - -static inline uint32_t good_rand (x) - int32_t x; +static inline uint32_t +good_rand(int32_t x) { #ifdef USE_WEAK_SEEDING /* @@ -264,8 +262,7 @@ static inline uint32_t good_rand (x) * for default usage relies on values produced by this routine. */ void -srandom(x) - unsigned long x; +srandom(unsigned long x) { int i, lim; @@ -295,7 +292,7 @@ srandom(x) * a fixed seed. */ void -srandomdev() +srandomdev(void) { int fd, done; size_t len; @@ -351,10 +348,7 @@ srandomdev() * complain about mis-alignment, but you should disregard these messages. */ char * -initstate(seed, arg_state, n) - unsigned long seed; /* seed for R.N.G. */ - char *arg_state; /* pointer to state array */ - long n; /* # bytes of state info */ +initstate(unsigned long seed, char *arg_state, long n) { char *ostate = (char *)(&state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; @@ -366,7 +360,7 @@ initstate(seed, arg_state, n) if (n < BREAK_0) { (void)fprintf(stderr, "random: not enough state (%ld bytes); ignored.\n", n); - return(0); + return (0); } if (n < BREAK_1) { rand_type = TYPE_0; @@ -396,7 +390,7 @@ initstate(seed, arg_state, n) int_arg_state[0] = rand_type; else int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; - return(ostate); + return (ostate); } /* @@ -419,8 +413,7 @@ initstate(seed, arg_state, n) * complain about mis-alignment, but you should disregard these messages. */ char * -setstate(arg_state) - char *arg_state; /* pointer to state array */ +setstate(char *arg_state) { uint32_t *new_state = (uint32_t *)arg_state; uint32_t type = new_state[0] % MAX_TYPES; @@ -451,7 +444,7 @@ setstate(arg_state) fptr = &state[(rear + rand_sep) % rand_deg]; } end_ptr = &state[rand_deg]; /* set end_ptr too */ - return(ostate); + return (ostate); } /* @@ -472,7 +465,7 @@ setstate(arg_state) * Returns a 31-bit random number. */ long -random() +random(void) { uint32_t i; uint32_t *f, *r; @@ -497,5 +490,5 @@ random() fptr = f; rptr = r; } - return((long)i); + return ((long)i); } From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:57:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C7A309BF; Thu, 30 May 2013 21:57:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA300D12; Thu, 30 May 2013 21:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULveOg074733; Thu, 30 May 2013 21:57:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULveEN074732; Thu, 30 May 2013 21:57:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305302157.r4ULveEN074732@svn.freebsd.org> From: Mark Johnston Date: Thu, 30 May 2013 21:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251166 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:57:40 -0000 Author: markj Date: Thu May 30 21:57:40 2013 New Revision: 251166 URL: http://svnweb.freebsd.org/changeset/base/251166 Log: Add macros which allow one to define SDT probes with six or seven arguments; they are needed when porting some of the Solaris providers (ip, iscsi, and tcp in particular). dtrace_probe() only takes five arguments from the probe site, so we need to add the appropriate cast to allow for more than five arguments. The extra arguments are later copied out of dtrace_probe()'s stack frame by dtrace_getarg() (or the provider-specific getarg method) as needed. MFC after: 1 week Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Thu May 30 21:56:53 2013 (r251165) +++ head/sys/sys/sdt.h Thu May 30 21:57:40 2013 (r251166) @@ -91,6 +91,10 @@ #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2) #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE_DEFINE6(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5) +#define SDT_PROBE_DEFINE7(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5, arg6) #define SDT_PROBE0(prov, mod, func, name) #define SDT_PROBE1(prov, mod, func, name, arg0) @@ -98,6 +102,9 @@ #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) #define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) #else @@ -233,6 +240,27 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); + +#define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5, arg6) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6); + #define SDT_PROBE0(prov, mod, func, name) \ SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0) #define SDT_PROBE1(prov, mod, func, name, arg0) \ @@ -245,6 +273,27 @@ struct sdt_provider { SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\ + } while (0) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \ + sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \ + (uintptr_t)arg6); \ + } while (0) typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *); typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *); From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:59:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 61ABBBCA; Thu, 30 May 2013 21:59:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5436ED50; Thu, 30 May 2013 21:59:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULxU4X075098; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULxUx3075097; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305302159.r4ULxUx3075097@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 May 2013 21:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251167 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:59:30 -0000 Author: pjd Date: Thu May 30 21:59:29 2013 New Revision: 251167 URL: http://svnweb.freebsd.org/changeset/base/251167 Log: If the -r option is given we cannot enter capability mode. The option tells kdump to convert numeric UIDs and GIDs into user and group names plus to convert times and dates into locallized versions. This all needs opening various files at various occasions. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu May 30 21:57:40 2013 (r251166) +++ head/usr.bin/kdump/kdump.c Thu May 30 21:59:29 2013 (r251167) @@ -240,8 +240,10 @@ main(int argc, char *argv[]) * XXXPJD: There should be strerror_init() and strsignal_init() in libc. */ (void)catopen("libc", NL_CAT_LOCALE); - if (cap_enter() < 0 && errno != ENOSYS) - err(1, "unable to enter capability mode"); + if (resolv == 0) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + } limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); From owner-svn-src-all@FreeBSD.ORG Thu May 30 22:01:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9934E4F; Thu, 30 May 2013 22:01:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80FAD7F; Thu, 30 May 2013 22:01:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UM17ct077215; Thu, 30 May 2013 22:01:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UM17EA077209; Thu, 30 May 2013 22:01:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302201.r4UM17EA077209@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 22:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251168 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 22:01:08 -0000 Author: delphij Date: Thu May 30 22:01:06 2013 New Revision: 251168 URL: http://svnweb.freebsd.org/changeset/base/251168 Log: MFC r249035: Replace access to /dev/random with the kernel pseudo-random number source sysctl(KERN_ARND) and remove the fallback code. Obtained from: OpenBSD Modified: stable/9/lib/libc/stdlib/rand.3 stable/9/lib/libc/stdlib/rand.c stable/9/lib/libc/stdlib/random.3 stable/9/lib/libc/stdlib/random.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/rand.3 ============================================================================== --- stable/9/lib/libc/stdlib/rand.3 Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/rand.3 Thu May 30 22:01:06 2013 (r251168) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RAND 3 .Os .Sh NAME @@ -91,9 +91,7 @@ seeded with a value of 1. .Pp The .Fn sranddev -function initializes a seed using the -.Xr random 4 -random number device which returns good random numbers. +function initializes a seed using pseudo-random numbers obtained from the kernel. .Pp The .Fn rand_r Modified: stable/9/lib/libc/stdlib/rand.c ============================================================================== --- stable/9/lib/libc/stdlib/rand.c Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/rand.c Thu May 30 22:01:06 2013 (r251168) @@ -36,11 +36,10 @@ static char sccsid[] = "@(#)rand.c 8.1 ( __FBSDID("$FreeBSD$"); #include "namespace.h" -#include /* for sranddev() */ +#include +#include #include -#include /* for sranddev() */ #include -#include /* for sranddev() */ #include "un-namespace.h" #ifdef TEST @@ -112,28 +111,20 @@ u_int seed; * sranddev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. */ void sranddev() { - int fd, done; + int mib[2]; + size_t len; - done = 0; - fd = _open("/dev/random", O_RDONLY, 0); - if (fd >= 0) { - if (_read(fd, (void *) &next, sizeof(next)) == sizeof(next)) - done = 1; - _close(fd); - } - - if (!done) { - struct timeval tv; - - gettimeofday(&tv, NULL); - srand((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); - } + len = sizeof(next); + + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + sysctl(mib, 2, (void *)&next, &len, NULL, 0); } Modified: stable/9/lib/libc/stdlib/random.3 ============================================================================== --- stable/9/lib/libc/stdlib/random.3 Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/random.3 Thu May 30 22:01:06 2013 (r251168) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RANDOM 3 .Os .Sh NAME @@ -106,8 +106,8 @@ as the seed. .Pp The .Fn srandomdev -routine initializes a state array using data from -.Xr random 4 . +routine initializes a state array using +pseudo-random numbers obtained from the kernel. Note that this particular seeding procedure can generate states which are impossible to reproduce by calling Modified: stable/9/lib/libc/stdlib/random.c ============================================================================== --- stable/9/lib/libc/stdlib/random.c Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/random.c Thu May 30 22:01:06 2013 (r251168) @@ -34,12 +34,11 @@ static char sccsid[] = "@(#)random.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" -#include /* for srandomdev() */ -#include /* for srandomdev() */ +#include +#include #include #include #include -#include /* for srandomdev() */ #include "un-namespace.h" /* @@ -284,39 +283,28 @@ srandom(unsigned long x) * srandomdev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. Note that this particular seeding - * procedure can generate states which are impossible to reproduce by - * calling srandom() with any value, since the succeeding terms in the - * state buffer are no longer derived from the LC algorithm applied to - * a fixed seed. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. + * + * Note that this particular seeding procedure can generate states + * which are impossible to reproduce by calling srandom() with any + * value, since the succeeding terms in the state buffer are no longer + * derived from the LC algorithm applied to a fixed seed. */ void srandomdev(void) { - int fd, done; + int mib[2]; size_t len; if (rand_type == TYPE_0) - len = sizeof state[0]; + len = sizeof(state[0]); else - len = rand_deg * sizeof state[0]; - - done = 0; - fd = _open("/dev/random", O_RDONLY, 0); - if (fd >= 0) { - if (_read(fd, (void *) state, len) == (ssize_t) len) - done = 1; - _close(fd); - } + len = rand_deg * sizeof(state[0]); - if (!done) { - struct timeval tv; - - gettimeofday(&tv, NULL); - srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); - return; - } + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + sysctl(mib, 2, state, &len, NULL, 0); if (rand_type != TYPE_0) { fptr = &state[rand_sep]; From owner-svn-src-all@FreeBSD.ORG Fri May 31 00:21:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD8A08B4; Fri, 31 May 2013 00:21:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFFF57D1; Fri, 31 May 2013 00:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0L6L9025688; Fri, 31 May 2013 00:21:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0L6Nd025687; Fri, 31 May 2013 00:21:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305310021.r4V0L6Nd025687@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 00:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251169 - head/contrib/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 00:21:06 -0000 Author: delphij Date: Fri May 31 00:21:05 2013 New Revision: 251169 URL: http://svnweb.freebsd.org/changeset/base/251169 Log: Remove unused files. Deleted: head/contrib/less/Makefile.aut head/contrib/less/Makefile.dsb head/contrib/less/Makefile.dsg head/contrib/less/Makefile.dsu head/contrib/less/Makefile.in head/contrib/less/Makefile.o2e head/contrib/less/Makefile.o9c head/contrib/less/Makefile.o9u head/contrib/less/Makefile.wnb head/contrib/less/Makefile.wnm head/contrib/less/configure head/contrib/less/configure.ac head/contrib/less/defines.ds head/contrib/less/defines.h.in head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/install.sh head/contrib/less/less.man head/contrib/less/lessecho.man head/contrib/less/lesskey.man head/contrib/less/mkfuncs.awk head/contrib/less/mkinstalldirs From owner-svn-src-all@FreeBSD.ORG Fri May 31 00:31:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31E3DC4E; Fri, 31 May 2013 00:31:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6B4850; Fri, 31 May 2013 00:31:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0VkSK029240; Fri, 31 May 2013 00:31:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0VkYv029235; Fri, 31 May 2013 00:31:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305310031.r4V0VkYv029235@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 00:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251170 - head/contrib/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 00:31:47 -0000 Author: delphij Date: Fri May 31 00:31:45 2013 New Revision: 251170 URL: http://svnweb.freebsd.org/changeset/base/251170 Log: Revert files with no local changes to their vendor state to ease future upgrading. Modified: head/contrib/less/less.h head/contrib/less/line.c head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/search.c Modified: head/contrib/less/less.h ============================================================================== --- head/contrib/less/less.h Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/less.h Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/line.c ============================================================================== --- head/contrib/less/line.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/line.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/prompt.c ============================================================================== --- head/contrib/less/prompt.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/prompt.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/screen.c ============================================================================== --- head/contrib/less/screen.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/screen.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/search.c ============================================================================== --- head/contrib/less/search.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/search.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * @@ -28,7 +27,6 @@ extern int linenums; extern int sc_height; extern int jump_sline; extern int bs_mode; -extern int less_is_more; extern int ctldisp; extern int status_col; extern void * constant ml_search; From owner-svn-src-all@FreeBSD.ORG Fri May 31 00:43:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3906F13; Fri, 31 May 2013 00:43:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2EA78DE; Fri, 31 May 2013 00:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0hj0Y033056; Fri, 31 May 2013 00:43:45 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0hgZn033028; Fri, 31 May 2013 00:43:42 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201305310043.r4V0hgZn033028@svn.freebsd.org> From: Jeff Roberson Date: Fri, 31 May 2013 00:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251171 - in head/sys: fs/ext2fs fs/nandfs fs/nfsclient fs/nfsserver kern nfsclient nfsserver sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 00:43:45 -0000 Author: jeff Date: Fri May 31 00:43:41 2013 New Revision: 251171 URL: http://svnweb.freebsd.org/changeset/base/251171 Log: - Convert the bufobj lock to rwlock. - Use a shared bufobj lock in getblk() and inmem(). - Convert softdep's lk to rwlock to match the bufobj lock. - Move INFREECNT to b_flags and protect it with the buf lock. - Remove unnecessary locking around bremfree() and BKGRDINPROG. Sponsored by: EMC / Isilon Storage Division Discussed with: mckusick, kib, mdf Modified: head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/nandfs/nandfs_segment.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_serv.c head/sys/sys/buf.h head/sys/sys/bufobj.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/ext2fs/ext2_inode.c Fri May 31 00:43:41 2013 (r251171) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/nandfs/nandfs_segment.c ============================================================================== --- head/sys/fs/nandfs/nandfs_segment.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nandfs/nandfs_segment.c Fri May 31 00:43:41 2013 (r251171) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -702,7 +703,7 @@ nandfs_save_buf(struct buf *bp, uint64_t if (bp->b_bufobj != bo) { BO_LOCK(bp->b_bufobj); BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, - BO_MTX(bp->b_bufobj)); + BO_LOCKPTR(bp->b_bufobj)); KASSERT(BUF_ISLOCKED(bp), ("Problem with locking buffer")); } Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri May 31 00:43:41 2013 (r251171) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -556,7 +557,7 @@ restart_locked: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~(B_ASYNC | B_MANAGED); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:43:41 2013 (r251171) @@ -2852,7 +2852,7 @@ loop: error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo), "nfsfsync", slpflag, slptimeo); + BO_LOCKPTR(bo), "nfsfsync", slpflag, slptimeo); if (error == 0) { BUF_UNLOCK(bp); goto loop; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 31 00:43:41 2013 (r251171) @@ -1321,7 +1321,7 @@ nfsvno_fsync(struct vnode *vp, u_int64_t */ if ((bp = gbincore(&vp->v_bufobj, lblkno)) != NULL) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | - LK_INTERLOCK, BO_MTX(bo)) == ENOLCK) { + LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { BO_LOCK(bo); continue; /* retry */ } Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_bio.c Fri May 31 00:43:41 2013 (r251171) @@ -418,11 +418,9 @@ bufcountwakeup(struct buf *bp) { int old; - KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p already counted as free", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags |= BV_INFREECNT; + bp->b_flags |= B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, 1); KASSERT(old >= 0 && old < nbuf, ("numfreebuffers climbed to %d", old + 1)); @@ -670,11 +668,10 @@ bufinit(void) for (i = 0; i < nbuf; i++) { bp = &buf[i]; bzero(bp, sizeof *bp); - bp->b_flags = B_INVAL; /* we're just an empty header */ + bp->b_flags = B_INVAL | B_INFREECNT; bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; - bp->b_vflags = BV_INFREECNT; /* buf is counted as free */ bp->b_xflags = 0; LIST_INIT(&bp->b_dep); BUF_LOCKINIT(bp); @@ -848,16 +845,14 @@ bremfree(struct buf *bp) ("bremfree: buffer %p already marked for delayed removal.", bp)); KASSERT(bp->b_qindex != QUEUE_NONE, ("bremfree: buffer %p not on a queue.", bp)); - BUF_ASSERT_HELD(bp); + BUF_ASSERT_XLOCKED(bp); bp->b_flags |= B_REMFREE; /* Fixup numfreebuffers count. */ if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { - KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + KASSERT((bp->b_flags & B_INFREECNT) != 0, ("buf %p not counted in numfreebuffers", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags &= ~BV_INFREECNT; + bp->b_flags &= ~B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, -1); KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); } @@ -892,7 +887,7 @@ bremfreel(struct buf *bp) bp, bp->b_vp, bp->b_flags); KASSERT(bp->b_qindex != QUEUE_NONE, ("bremfreel: buffer %p not on a queue.", bp)); - BUF_ASSERT_HELD(bp); + BUF_ASSERT_XLOCKED(bp); mtx_assert(&bqlock, MA_OWNED); TAILQ_REMOVE(&bufqueues[bp->b_qindex], bp, b_freelist); @@ -916,11 +911,9 @@ bremfreel(struct buf *bp) * numfreebuffers. */ if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { - KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + KASSERT((bp->b_flags & B_INFREECNT) != 0, ("buf %p not counted in numfreebuffers", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags &= ~BV_INFREECNT; + bp->b_flags &= ~B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, -1); KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); } @@ -1476,15 +1469,10 @@ brelse(struct buf *bp) bp->b_flags &= ~B_RELBUF; else if (buf_vm_page_count_severe()) { /* - * The locking of the BO_LOCK is not necessary since - * BKGRDINPROG cannot be set while we hold the buf - * lock, it can only be cleared if it is already - * pending. - */ - if (bp->b_vp) { - if (!(bp->b_vflags & BV_BKGRDINPROG)) - bp->b_flags |= B_RELBUF; - } else + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ + if (!(bp->b_vflags & BV_BKGRDINPROG)) bp->b_flags |= B_RELBUF; } @@ -1603,16 +1591,9 @@ brelse(struct buf *bp) /* enqueue */ mtx_lock(&bqlock); /* Handle delayed bremfree() processing. */ - if (bp->b_flags & B_REMFREE) { - struct bufobj *bo; - - bo = bp->b_bufobj; - if (bo != NULL) - BO_LOCK(bo); + if (bp->b_flags & B_REMFREE) bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } + if (bp->b_qindex != QUEUE_NONE) panic("brelse: free buffer onto another queue???"); @@ -1676,16 +1657,8 @@ brelse(struct buf *bp) * if B_INVAL is set ). */ - if (!(bp->b_flags & B_DELWRI)) { - struct bufobj *bo; - - bo = bp->b_bufobj; - if (bo != NULL) - BO_LOCK(bo); + if (!(bp->b_flags & B_DELWRI)) bufcountwakeup(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } /* * Something we can maybe free or reuse @@ -1730,11 +1703,7 @@ bqrelse(struct buf *bp) if (bp->b_flags & B_MANAGED) { if (bp->b_flags & B_REMFREE) { mtx_lock(&bqlock); - if (bo != NULL) - BO_LOCK(bo); bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); mtx_unlock(&bqlock); } bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); @@ -1744,13 +1713,9 @@ bqrelse(struct buf *bp) mtx_lock(&bqlock); /* Handle delayed bremfree() processing. */ - if (bp->b_flags & B_REMFREE) { - if (bo != NULL) - BO_LOCK(bo); + if (bp->b_flags & B_REMFREE) bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } + if (bp->b_qindex != QUEUE_NONE) panic("bqrelse: free buffer onto another queue???"); /* buffers with stale but valid contents */ @@ -1762,13 +1727,11 @@ bqrelse(struct buf *bp) #endif } else { /* - * The locking of the BO_LOCK for checking of the - * BV_BKGRDINPROG is not necessary since the - * BV_BKGRDINPROG cannot be set while we hold the buf - * lock, it can only be cleared if it is already - * pending. + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. */ - if (!buf_vm_page_count_severe() || (bp->b_vflags & BV_BKGRDINPROG)) { + if (!buf_vm_page_count_severe() || + (bp->b_vflags & BV_BKGRDINPROG)) { bp->b_qindex = QUEUE_CLEAN; TAILQ_INSERT_TAIL(&bufqueues[QUEUE_CLEAN], bp, b_freelist); @@ -1788,13 +1751,8 @@ bqrelse(struct buf *bp) } mtx_unlock(&bqlock); - if ((bp->b_flags & B_INVAL) || !(bp->b_flags & B_DELWRI)) { - if (bo != NULL) - BO_LOCK(bo); + if ((bp->b_flags & B_INVAL) || !(bp->b_flags & B_DELWRI)) bufcountwakeup(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } /* * Something we can maybe free or reuse. @@ -1940,7 +1898,7 @@ vfs_bio_awrite(struct buf *bp) size = vp->v_mount->mnt_stat.f_iosize; maxcl = MAXPHYS / size; - BO_LOCK(bo); + BO_RLOCK(bo); for (i = 1; i < maxcl; i++) if (vfs_bio_clcheck(vp, size, lblkno + i, bp->b_blkno + ((i * size) >> DEV_BSHIFT)) == 0) @@ -1950,7 +1908,7 @@ vfs_bio_awrite(struct buf *bp) if (vfs_bio_clcheck(vp, size, lblkno - j, bp->b_blkno - ((j * size) >> DEV_BSHIFT)) == 0) break; - BO_UNLOCK(bo); + BO_RUNLOCK(bo); --j; ncl = i + j; /* @@ -2145,7 +2103,7 @@ getnewbuf_reuse_bp(struct buf *bp, int q bp->b_flags &= B_UNMAPPED | B_KVAALLOC; bp->b_ioflags = 0; bp->b_xflags = 0; - KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p still counted as free?", bp)); bp->b_vflags = 0; bp->b_vp = NULL; @@ -2293,24 +2251,19 @@ restart: */ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) continue; - if (bp->b_vp) { - BO_LOCK(bp->b_bufobj); - if (bp->b_vflags & BV_BKGRDINPROG) { - BO_UNLOCK(bp->b_bufobj); - BUF_UNLOCK(bp); - continue; - } - BO_UNLOCK(bp->b_bufobj); + /* + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ + if (bp->b_vflags & BV_BKGRDINPROG) { + BUF_UNLOCK(bp); + continue; } KASSERT(bp->b_qindex == qindex, ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); - if (bp->b_bufobj != NULL) - BO_LOCK(bp->b_bufobj); bremfreel(bp); - if (bp->b_bufobj != NULL) - BO_UNLOCK(bp->b_bufobj); mtx_unlock(&bqlock); /* * NOTE: nbp is now entirely invalid. We can only restart @@ -2653,14 +2606,15 @@ flushbufqueues(struct vnode *lvp, int qu BUF_UNLOCK(bp); continue; } - BO_LOCK(bp->b_bufobj); + /* + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ if ((bp->b_vflags & BV_BKGRDINPROG) != 0 || (bp->b_flags & B_DELWRI) == 0) { - BO_UNLOCK(bp->b_bufobj); BUF_UNLOCK(bp); continue; } - BO_UNLOCK(bp->b_bufobj); if (bp->b_flags & B_INVAL) { bremfreel(bp); mtx_unlock(&bqlock); @@ -2737,9 +2691,9 @@ incore(struct bufobj *bo, daddr_t blkno) { struct buf *bp; - BO_LOCK(bo); + BO_RLOCK(bo); bp = gbincore(bo, blkno); - BO_UNLOCK(bo); + BO_RUNLOCK(bo); return (bp); } @@ -3053,7 +3007,7 @@ loop: mtx_unlock(&nblock); } - BO_LOCK(bo); + BO_RLOCK(bo); bp = gbincore(bo, blkno); if (bp != NULL) { int lockflags; @@ -3067,7 +3021,7 @@ loop: lockflags |= LK_NOWAIT; error = BUF_TIMELOCK(bp, lockflags, - BO_MTX(bo), "getblk", slpflag, slptimeo); + BO_LOCKPTR(bo), "getblk", slpflag, slptimeo); /* * If we slept and got the lock we have to restart in case @@ -3094,11 +3048,8 @@ loop: bp->b_flags |= B_CACHE; if (bp->b_flags & B_MANAGED) MPASS(bp->b_qindex == QUEUE_NONE); - else { - BO_LOCK(bo); + else bremfree(bp); - BO_UNLOCK(bo); - } /* * check for size inconsistencies for non-VMIO case. @@ -3193,7 +3144,7 @@ loop: * returned by getnewbuf() is locked. Note that the returned * buffer is also considered valid (not marked B_INVAL). */ - BO_UNLOCK(bo); + BO_RUNLOCK(bo); /* * If the user does not want us to create the buffer, bail out * here. @@ -4400,7 +4351,7 @@ bufobj_wrefl(struct bufobj *bo) { KASSERT(bo != NULL, ("NULL bo in bufobj_wref")); - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); bo->bo_numoutput++; } @@ -4434,11 +4385,11 @@ bufobj_wwait(struct bufobj *bo, int slpf int error; KASSERT(bo != NULL, ("NULL bo in bufobj_wwait")); - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); error = 0; while (bo->bo_numoutput) { bo->bo_flag |= BO_WWAIT; - error = msleep(&bo->bo_numoutput, BO_MTX(bo), + error = msleep(&bo->bo_numoutput, BO_LOCKPTR(bo), slpflag | (PRIBIO + 1), "bo_wwait", timeo); if (error) break; @@ -4596,7 +4547,7 @@ DB_COMMAND(countfreebufs, db_coundfreebu for (i = 0; i < nbuf; i++) { bp = &buf[i]; - if ((bp->b_vflags & BV_INFREECNT) != 0) + if ((bp->b_flags & B_INFREECNT) != 0) nfree++; else used++; Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_cluster.c Fri May 31 00:43:41 2013 (r251171) @@ -133,7 +133,7 @@ cluster_read(struct vnode *vp, u_quad_t return 0; } else { bp->b_flags &= ~B_RAM; - BO_LOCK(bo); + BO_RLOCK(bo); for (i = 1; i < maxra; i++) { /* * Stop if the buffer does not exist or it @@ -156,7 +156,7 @@ cluster_read(struct vnode *vp, u_quad_t BUF_UNLOCK(rbp); } } - BO_UNLOCK(bo); + BO_RUNLOCK(bo); if (i >= maxra) { return 0; } @@ -396,17 +396,16 @@ cluster_rbuild(struct vnode *vp, u_quad_ * (marked B_CACHE), or locked (may be doing a * background write), or if the buffer is not * VMIO backed. The clustering code can only deal - * with VMIO-backed buffers. + * with VMIO-backed buffers. The bo lock is not + * required for the BKGRDINPROG check since it + * can not be set without the buf lock. */ - BO_LOCK(bo); if ((tbp->b_vflags & BV_BKGRDINPROG) || (tbp->b_flags & B_CACHE) || (tbp->b_flags & B_VMIO) == 0) { - BO_UNLOCK(bo); bqrelse(tbp); break; } - BO_UNLOCK(bo); /* * The buffer must be completely invalid in order to @@ -790,7 +789,7 @@ cluster_wbuild(struct vnode *vp, long si continue; } if (BUF_LOCK(tbp, - LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, BO_MTX(bo))) { + LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, BO_LOCKPTR(bo))) { ++start_lbn; --len; continue; @@ -891,7 +890,7 @@ cluster_wbuild(struct vnode *vp, long si */ if (BUF_LOCK(tbp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, - BO_MTX(bo))) + BO_LOCKPTR(bo))) break; if ((tbp->b_flags & (B_VMIO | B_CLUSTEROK | Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_default.c Fri May 31 00:43:41 2013 (r251171) @@ -662,7 +662,7 @@ loop2: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_INTERLOCK | LK_SLEEPFAIL, - BO_MTX(bo)) != 0) { + BO_LOCKPTR(bo)) != 0) { BO_LOCK(bo); goto loop1; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_subr.c Fri May 31 00:43:41 2013 (r251171) @@ -1073,7 +1073,7 @@ alloc: */ bo = &vp->v_bufobj; bo->__bo_vnode = vp; - mtx_init(BO_MTX(bo), "bufobj interlock", NULL, MTX_DEF); + rw_init(BO_LOCKPTR(bo), "bufobj interlock"); bo->bo_ops = &buf_ops_bio; bo->bo_private = vp; TAILQ_INIT(&bo->bo_clean.bv_hd); @@ -1331,7 +1331,7 @@ flushbuflist(struct bufv *bufv, int flag daddr_t lblkno; b_xflags_t xflags; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); retval = 0; TAILQ_FOREACH_SAFE(bp, &bufv->bv_hd, b_bobufs, nbp) { @@ -1347,7 +1347,7 @@ flushbuflist(struct bufv *bufv, int flag } retval = EAGAIN; error = BUF_TIMELOCK(bp, - LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_MTX(bo), + LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo), "flushbuf", slpflag, slptimeo); if (error) { BO_LOCK(bo); @@ -1369,17 +1369,13 @@ flushbuflist(struct bufv *bufv, int flag */ if (((bp->b_flags & (B_DELWRI | B_INVAL)) == B_DELWRI) && (flags & V_SAVE)) { - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= B_ASYNC; bwrite(bp); BO_LOCK(bo); return (EAGAIN); /* XXX: why not loop ? */ } - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1426,12 +1422,10 @@ restart: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1452,11 +1446,9 @@ restart: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1484,15 +1476,13 @@ restartsync: */ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) { + BO_LOCKPTR(bo)) == ENOLCK) { goto restart; } VNASSERT((bp->b_flags & B_DELWRI), vp, ("buf(%p) on dirty queue without DELWRI", bp)); - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bawrite(bp); BO_LOCK(bo); goto restartsync; @@ -1512,7 +1502,7 @@ buf_vlist_remove(struct buf *bp) struct bufv *bv; KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); - ASSERT_BO_LOCKED(bp->b_bufobj); + ASSERT_BO_WLOCKED(bp->b_bufobj); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) != (BX_VNDIRTY|BX_VNCLEAN), ("buf_vlist_remove: Buf %p is on two lists", bp)); @@ -1538,7 +1528,7 @@ buf_vlist_add(struct buf *bp, struct buf struct buf *n; int error; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) == 0, ("buf_vlist_add: Buf %p has existing xflags %d", bp, bp->b_xflags)); bp->b_xflags |= xflags; @@ -1598,7 +1588,7 @@ bgetvp(struct vnode *vp, struct buf *bp) struct bufobj *bo; bo = &vp->v_bufobj; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); VNASSERT(bp->b_vp == NULL, bp->b_vp, ("bgetvp: not free")); CTR3(KTR_BUF, "bgetvp(%p) vp %p flags %X", bp, vp, bp->b_flags); @@ -1657,7 +1647,7 @@ vn_syncer_add_to_worklist(struct bufobj { int slot; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); mtx_lock(&sync_mtx); if (bo->bo_flag & BO_ONWORKLST) @@ -2422,7 +2412,7 @@ vdropl(struct vnode *vp) rangelock_destroy(&vp->v_rl); lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); - mtx_destroy(BO_MTX(bo)); + rw_destroy(BO_LOCKPTR(bo)); uma_zfree(vnode_zone, vp); } Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsclient/nfs_subs.c Fri May 31 00:43:41 2013 (r251171) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsclient/nfs_vnops.c Fri May 31 00:43:41 2013 (r251171) @@ -3177,7 +3177,7 @@ loop: error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo), "nfsfsync", slpflag, slptimeo); + BO_LOCKPTR(bo), "nfsfsync", slpflag, slptimeo); if (error == 0) { BUF_UNLOCK(bp); goto loop; Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsserver/nfs_serv.c Fri May 31 00:43:41 2013 (r251171) @@ -3387,7 +3387,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd */ if ((bp = gbincore(&vp->v_bufobj, lblkno)) != NULL) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | - LK_INTERLOCK, BO_MTX(bo)) == ENOLCK) { + LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { BO_LOCK(bo); continue; /* retry */ } Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri May 31 00:31:45 2013 (r251170) +++ head/sys/sys/buf.h Fri May 31 00:43:41 2013 (r251171) @@ -215,7 +215,7 @@ struct buf { #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ #define B_00800000 0x00800000 /* Available flag. */ #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ -#define B_02000000 0x02000000 /* Available flag. */ +#define B_INFREECNT 0x02000000 /* buf is counted in numfreebufs */ #define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */ #define B_MANAGED 0x08000000 /* Managed by FS. */ #define B_RAM 0x10000000 /* Read ahead mark (flag) */ @@ -224,7 +224,7 @@ struct buf { #define B_REMFREE 0x80000000 /* Delayed bremfree */ #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ - "\33paging\32needsgiant\31nocopy\30b23\27relbuf\26dirty\25b20" \ + "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ "\15b12\14b11\13eintr\12done\11persist\10delwri\7validsuspwrt" \ "\6cache\5deferred\4direct\3async\2needcommit\1age" @@ -248,9 +248,8 @@ struct buf { #define BV_SCANNED 0x00000001 /* VOP_FSYNC funcs mark written bufs */ #define BV_BKGRDINPROG 0x00000002 /* Background write in progress */ #define BV_BKGRDWAIT 0x00000004 /* Background write waiting */ -#define BV_INFREECNT 0x80000000 /* buf is counted in numfreebufs */ -#define PRINT_BUF_VFLAGS "\20\40infreecnt\3bkgrdwait\2bkgrdinprog\1scanned" +#define PRINT_BUF_VFLAGS "\20\3bkgrdwait\2bkgrdinprog\1scanned" #ifdef _KERNEL /* @@ -271,7 +270,7 @@ extern const char *buf_wmesg; /* Defaul * Get a lock sleeping non-interruptably until it becomes available. */ #define BUF_LOCK(bp, locktype, interlock) \ - _lockmgr_args(&(bp)->b_lock, (locktype), (interlock), \ + _lockmgr_args_rw(&(bp)->b_lock, (locktype), (interlock), \ LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, \ LOCK_FILE, LOCK_LINE) @@ -279,7 +278,7 @@ extern const char *buf_wmesg; /* Defaul * Get a lock sleeping with specified interruptably and timeout. */ #define BUF_TIMELOCK(bp, locktype, interlock, wmesg, catch, timo) \ - _lockmgr_args(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \ + _lockmgr_args_rw(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \ (interlock), (wmesg), (PRIBIO + 4) | (catch), (timo), \ LOCK_FILE, LOCK_LINE) Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Fri May 31 00:31:45 2013 (r251170) +++ head/sys/sys/bufobj.h Fri May 31 00:43:41 2013 (r251171) @@ -53,7 +53,7 @@ #include #include -#include +#include #include struct bufobj; @@ -89,7 +89,7 @@ struct buf_ops { #define BO_BDFLUSH(bo, bp) ((bo)->bo_ops->bop_bdflush((bo), (bp))) struct bufobj { - struct mtx bo_mtx; /* Mutex which protects "i" things */ + struct rwlock bo_lock; /* Lock which protects "i" things */ struct buf_ops *bo_ops; /* - Buffer operations */ struct vm_object *bo_object; /* v Place to store VM object */ LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ @@ -113,11 +113,14 @@ struct bufobj { #define BO_ONWORKLST (1 << 0) /* On syncer work-list */ #define BO_WWAIT (1 << 1) /* Wait for output to complete */ -#define BO_MTX(bo) (&(bo)->bo_mtx) -#define BO_LOCK(bo) mtx_lock(BO_MTX((bo))) -#define BO_UNLOCK(bo) mtx_unlock(BO_MTX((bo))) -#define ASSERT_BO_LOCKED(bo) mtx_assert(BO_MTX((bo)), MA_OWNED) -#define ASSERT_BO_UNLOCKED(bo) mtx_assert(BO_MTX((bo)), MA_NOTOWNED) +#define BO_LOCKPTR(bo) (&(bo)->bo_lock) +#define BO_LOCK(bo) rw_wlock(BO_LOCKPTR((bo))) +#define BO_UNLOCK(bo) rw_wunlock(BO_LOCKPTR((bo))) +#define BO_RLOCK(bo) rw_rlock(BO_LOCKPTR((bo))) +#define BO_RUNLOCK(bo) rw_runlock(BO_LOCKPTR((bo))) +#define ASSERT_BO_WLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_WLOCKED) +#define ASSERT_BO_LOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_LOCKED) +#define ASSERT_BO_UNLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_UNLOCKED) void bufobj_wdrop(struct bufobj *bo); void bufobj_wref(struct bufobj *bo); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_inode.c Fri May 31 00:43:41 2013 (r251171) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri May 31 00:43:41 2013 (r251171) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2204,10 +2205,8 @@ ffs_bdflush(bo, bp) if (bp_bdskip) { VI_LOCK(devvp); if (!ffs_bp_snapblk(vp, nbp)) { - if (BO_MTX(bo) != VI_MTX(vp)) { - VI_UNLOCK(devvp); - BO_LOCK(bo); - } + VI_UNLOCK(devvp); + BO_LOCK(bo); BUF_UNLOCK(nbp); continue; } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_softdep.c Fri May 31 00:43:41 2013 (r251171) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -554,7 +555,7 @@ softdep_check_suspend(struct mount *mp, (void) softdep_accdeps; bo = &devvp->v_bufobj; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); MNT_ILOCK(mp); while (mp->mnt_secondary_writes != 0) { @@ -808,7 +809,7 @@ struct jextent { */ static void softdep_error(char *, int); static void drain_output(struct vnode *); -static struct buf *getdirtybuf(struct buf *, struct mtx *, int); +static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); static void clear_remove(void); static void clear_inodedeps(void); static void unlinked_inodedep(struct mount *, struct inodedep *); @@ -1030,12 +1031,12 @@ static void softdep_disk_write_complete( static void softdep_deallocate_dependencies(struct buf *); static int softdep_count_dependencies(struct buf *bp, int); -static struct mtx lk; -MTX_SYSINIT(softdep_lock, &lk, "Softdep Lock", MTX_DEF); +static struct rwlock lk; +RW_SYSINIT(softdep_lock, &lk, "Softdep Lock"); -#define TRY_ACQUIRE_LOCK(lk) mtx_trylock(lk) -#define ACQUIRE_LOCK(lk) mtx_lock(lk) -#define FREE_LOCK(lk) mtx_unlock(lk) +#define TRY_ACQUIRE_LOCK(lk) rw_try_wlock(lk) +#define ACQUIRE_LOCK(lk) rw_wlock(lk) +#define FREE_LOCK(lk) rw_wunlock(lk) #define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) #define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) @@ -1073,7 +1074,7 @@ worklist_insert(head, item, locked) { if (locked) - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (item->wk_state & ONWORKLIST) panic("worklist_insert: %p %s(0x%X) already on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1088,7 +1089,7 @@ worklist_remove(item, locked) { if (locked) - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if ((item->wk_state & ONWORKLIST) == 0) panic("worklist_remove: %p %s(0x%X) not on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1161,7 +1162,7 @@ jwork_move(dst, src) freedep = freedep_merge(WK_FREEDEP(wk), freedep); } - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); while ((wk = LIST_FIRST(src)) != NULL) { WORKLIST_REMOVE(wk); WORKLIST_INSERT(dst, wk); @@ -1212,7 +1213,7 @@ workitem_free(item, type) int type; { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); #ifdef DEBUG if (item->wk_state & ONWORKLIST) @@ -1428,7 +1429,7 @@ softdep_flush(void) static void worklist_speedup(void) { - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (req_pending == 0) { req_pending = 1; wakeup(&req_pending); @@ -1462,7 +1463,7 @@ add_to_worklist(wk, flags) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); if (wk->wk_state & ONWORKLIST) panic("add_to_worklist: %s(0x%X) already on list", @@ -1604,7 +1605,7 @@ process_removes(vp) struct mount *mp; ino_t inum; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = vp->v_mount; inum = VTOI(vp)->i_number; @@ -1654,7 +1655,7 @@ process_truncates(vp) ino_t inum; int cgwait; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = vp->v_mount; inum = VTOI(vp)->i_number; @@ -1727,7 +1728,7 @@ process_worklist_item(mp, target, flags) int matchcnt; int error; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); KASSERT(mp != NULL, ("process_worklist_item: NULL mp")); /* * If we are being called because of a process doing a @@ -2061,7 +2062,7 @@ pagedep_lookup(mp, bp, ino, lbn, flags, int ret; int i; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (bp) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_PAGEDEP) { @@ -2150,7 +2151,7 @@ inodedep_lookup(mp, inum, flags, inodede struct inodedep_hashhead *inodedephd; struct fs *fs; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); fs = VFSTOUFS(mp)->um_fs; inodedephd = INODEDEP_HASH(fs, inum); @@ -2704,7 +2705,7 @@ add_to_journal(wk) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); if (wk->wk_state & ONWORKLIST) panic("add_to_journal: %s(0x%X) already on list", @@ -2730,7 +2731,7 @@ remove_from_journal(wk) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); #ifdef SUJ_DEBUG { @@ -2898,7 +2899,7 @@ softdep_prelink(dvp, vp) struct ufsmount *ump; ump = VFSTOUFS(dvp->v_mount); - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); /* * Nothing to do if we have sufficient journal space. * If we currently hold the snapshot lock, we must avoid @@ -4986,7 +4987,7 @@ bmsafemap_lookup(mp, bp, cg, newbmsafema struct worklist *wk; struct fs *fs; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); KASSERT(bp != NULL, ("bmsafemap_lookup: missing buffer")); LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_BMSAFEMAP) { @@ -5257,7 +5258,7 @@ allocdirect_merge(adphead, newadp, oldad struct freefrag *freefrag; freefrag = NULL; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (newadp->ad_oldblkno != oldadp->ad_newblkno || newadp->ad_oldsize != oldadp->ad_newsize || newadp->ad_offset >= NDADDR) @@ -5718,7 +5719,7 @@ indirdep_lookup(mp, ip, bp) struct fs *fs; ufs2_daddr_t blkno; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); indirdep = NULL; newindirdep = NULL; fs = ip->i_fs; @@ -5797,7 +5798,7 @@ setup_allocindir_phase2(bp, ip, inodedep struct freefrag *freefrag; struct mount *mp; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = UFSTOVFS(ip->i_ump); fs = ip->i_fs; if (bp->b_lblkno >= 0) @@ -6130,7 +6131,7 @@ complete_trunc_indir(freework) BUF_UNLOCK(bp); ACQUIRE_LOCK(&lk); } - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); freework->fw_state |= DEPCOMPLETE; TAILQ_REMOVE(&indirdep->ir_trunc, freework, fw_next); /* @@ -6874,7 +6875,7 @@ restart: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 31 01:01:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8993B3EB; Fri, 31 May 2013 01:01:17 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA899F2; Fri, 31 May 2013 01:01:16 +0000 (UTC) Received: by mail-qe0-f47.google.com with SMTP id f6so569473qej.6 for ; Thu, 30 May 2013 18:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=O9wXmPMzZqW3Rs4h2J0M1iqpoic2VtW1FtignLIFu/0=; b=VYGT8iw7LEu6kQ5rctYjzQ24MSYn4qiPAHoc064NkR8AYbii859hFJ4mlHzu5tZfX5 hIVbXFueTagP9m/2RGNe/3Fb/x6Ib8ju1zIaDZ9VSxAn3Bde7mH4gThuZS6edGGwuBaK stSUxfL4VXxJQEGdmZsV+0ZSoJJn31Lfob296z7tg8oW0eY5/D2gG7MKFtW7vV1w0kFA njtmFGpD6lVu03irqf3BDR4PYT/3h6sXIkmmZZTU5gHnet/uQjStlGD7c/YXOf2dCOrK FIVVM3zYjxs3kdQW23J+5x5v4zKtbjMFEFcf2Cheki/S50bVLtpqY8A0smy6wGAl2kqb bpuw== MIME-Version: 1.0 X-Received: by 10.224.182.136 with SMTP id cc8mr8313738qab.10.1369962076155; Thu, 30 May 2013 18:01:16 -0700 (PDT) Received: by 10.49.3.193 with HTTP; Thu, 30 May 2013 18:01:16 -0700 (PDT) In-Reply-To: <201305310043.r4V0hgZn033028@svn.freebsd.org> References: <201305310043.r4V0hgZn033028@svn.freebsd.org> Date: Thu, 30 May 2013 21:01:16 -0400 Message-ID: Subject: Re: svn commit: r251171 - in head/sys: fs/ext2fs fs/nandfs fs/nfsclient fs/nfsserver kern nfsclient nfsserver sys ufs/ffs From: Benjamin Kaduk To: Jeff Roberson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 01:01:17 -0000 On Thu, May 30, 2013 at 8:43 PM, Jeff Roberson wrote: > Author: jeff > Date: Fri May 31 00:43:41 2013 > New Revision: 251171 > URL: http://svnweb.freebsd.org/changeset/base/251171 > > Log: > - Convert the bufobj lock to rwlock. > - Use a shared bufobj lock in getblk() and inmem(). > - Convert softdep's lk to rwlock to match the bufobj lock. > - Move INFREECNT to b_flags and protect it with the buf lock. > - Remove unnecessary locking around bremfree() and BKGRDINPROG. > Do we need a __FreeBSD_version bump for out-of-tree filesystems? -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Fri May 31 01:55:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DAB67CA4; Fri, 31 May 2013 01:55:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id AD7F4EFF; Fri, 31 May 2013 01:55:37 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4454323F804; Thu, 30 May 2013 21:55:35 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 4454323F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 30 May 2013 21:55:33 -0400 From: Glen Barber To: Scott Long Subject: Re: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt Message-ID: <20130531015533.GD1619@glenbarber.us> References: <201305302154.r4ULsmZJ074053@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BI5RvnYi6R4T2M87" Content-Disposition: inline In-Reply-To: <201305302154.r4ULsmZJ074053@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 01:55:37 -0000 --BI5RvnYi6R4T2M87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 09:54:48PM +0000, Scott Long wrote: > Author: scottl > Date: Thu May 30 21:54:48 2013 > New Revision: 251164 > URL: http://svnweb.freebsd.org/changeset/base/251164 >=20 > Log: > MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 > =20 > Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. > =20 I think this breaks stable/9. /src/sys/dev/aha/ahareg.h:300: error: field 'timer' has incomplete type /src/sys/dev/aha/aha_mca.c: In function 'aha_mca_attach': /src/sys/dev/aha/aha_mca.c:194: error: 'aha' undeclared (first use in this function) /src/sys/dev/aha/aha_mca.c:194: error: (Each undeclared identifier is reported only once /src/sys/dev/aha/aha_mca.c:194: error: for each function it appears in.) *** Error code 1 Stop in /obj/i386.i386/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2013-05-31 01:51:07 - WARNING: /usr/bin/make returned exit code 1 TB --- 2013-05-31 01:51:07 - ERROR: failed to build LINT kernel TB --- 2013-05-31 01:51:07 - 8352.52 user 914.26 system 10844.89 real http://tinderbox.freebsd.org/tinderbox-freebsd9-build-RELENG_9-i386-i386.fu= ll Glen --BI5RvnYi6R4T2M87 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRqAMVAAoJEFJPDDeguUajLtMH/35tMunPjJSfrG3Q5re4zJiZ 78btz/alxdC35JfEFj7QreNhLB9ROCIXZyIOossSjP2dRAcgw2jC2QLbTORSijgY FW3owaHRA0iC6aCgHfz57CJkLFpLCov79fszX7ig+vT4a+oxmsYXClAFIpMAvLlb i9ayAQiHgZhuUM9BQHUScuGaDzFzOBC/QaT683Mgd6vpRFP8cKEB4TcyEgbG1ZWw O3rZPb2HeolUTOZgxi2kKBYu1BwJqYjMYN6LVhEXap+PWAWpHKgKg2PbCK6/kLGH vGdZQ7BG16ee2w7dgw3sHr9nIFYofOmymdxnZsUVeTFE8DLU8nDZFaAjtB5yhE4= =DgLP -----END PGP SIGNATURE----- --BI5RvnYi6R4T2M87-- From owner-svn-src-all@FreeBSD.ORG Fri May 31 03:14:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80DB71114; Fri, 31 May 2013 03:14:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74317B4E; Fri, 31 May 2013 03:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V3EoLa087788; Fri, 31 May 2013 03:14:50 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V3Eo59087787; Fri, 31 May 2013 03:14:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305310314.r4V3Eo59087787@svn.freebsd.org> From: Sean Bruno Date: Fri, 31 May 2013 03:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251172 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 03:14:50 -0000 Author: sbruno Date: Fri May 31 03:14:49 2013 New Revision: 251172 URL: http://svnweb.freebsd.org/changeset/base/251172 Log: xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. MFC this if svn 249468-242726 is shoveled back to stable/9 Obtained from: Yahoo! Inc. Modified: head/sys/dev/mfi/mfi_cam.c Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Fri May 31 00:43:41 2013 (r251171) +++ head/sys/dev/mfi/mfi_cam.c Fri May 31 03:14:49 2013 (r251172) @@ -318,13 +318,16 @@ mfip_cam_rescan(struct mfi_softc *sc, ui } sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); device_printf(sc->mfi_dev, "Cannot create path for bus rescan.\n"); return; } + mtx_unlock(&sc->mfi_io_lock); xpt_rescan(ccb); From owner-svn-src-all@FreeBSD.ORG Fri May 31 03:30:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D33DA156A; Fri, 31 May 2013 03:30:12 +0000 (UTC) Date: Fri, 31 May 2013 03:30:12 +0000 From: Alexey Dokuchaev To: David Schultz Subject: Re: svn commit: r251121 - in head: include lib/msun lib/msun/man lib/msun/src Message-ID: <20130531033012.GB42068@FreeBSD.org> References: <201305300449.r4U4nRqM012625@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305300449.r4U4nRqM012625@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 03:30:12 -0000 On Thu, May 30, 2013 at 04:49:27AM +0000, David Schultz wrote: > New Revision: 251121 > URL: http://svnweb.freebsd.org/changeset/base/251121 > > Log: > I'm happy to finally commit stephen@'s implementations of cacos, > cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ > for working on these. This is awesome, but I did not see __FreeBSD_version bumped. Many ports rely on math functions, and having coherent OSVERSIONs really helps to decide when some function is natively supported, or emulation code required. ./danfe From owner-svn-src-all@FreeBSD.ORG Fri May 31 04:19:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 256651D79; Fri, 31 May 2013 04:19:14 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1658FE02; Fri, 31 May 2013 04:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4JDto009283; Fri, 31 May 2013 04:19:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4JDR9009282; Fri, 31 May 2013 04:19:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305310419.r4V4JDR9009282@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 04:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251173 - head/tools/regression/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 04:19:14 -0000 Author: obrien Date: Fri May 31 04:19:13 2013 New Revision: 251173 URL: http://svnweb.freebsd.org/changeset/base/251173 Log: Allow building with clang (which is being really stupid here...). Modified: head/tools/regression/filemon/timed-forkb.c Modified: head/tools/regression/filemon/timed-forkb.c ============================================================================== --- head/tools/regression/filemon/timed-forkb.c Fri May 31 03:14:49 2013 (r251172) +++ head/tools/regression/filemon/timed-forkb.c Fri May 31 04:19:13 2013 (r251173) @@ -45,6 +45,7 @@ #define SLEEP 20 /* seconds */ #endif +extern int verbose; int verbose; static void From owner-svn-src-all@FreeBSD.ORG Fri May 31 04:27:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2308E6; Fri, 31 May 2013 04:27:41 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4F01E64; Fri, 31 May 2013 04:27:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4Rf2j012377; Fri, 31 May 2013 04:27:41 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4RfSq012376; Fri, 31 May 2013 04:27:41 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305310427.r4V4RfSq012376@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 04:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251174 - head/tools/regression/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 04:27:41 -0000 Author: obrien Date: Fri May 31 04:27:41 2013 New Revision: 251174 URL: http://svnweb.freebsd.org/changeset/base/251174 Log: Different approach to making all compilers happy. Modified: head/tools/regression/filemon/timed-forkb.c Modified: head/tools/regression/filemon/timed-forkb.c ============================================================================== --- head/tools/regression/filemon/timed-forkb.c Fri May 31 04:19:13 2013 (r251173) +++ head/tools/regression/filemon/timed-forkb.c Fri May 31 04:27:41 2013 (r251174) @@ -45,8 +45,7 @@ #define SLEEP 20 /* seconds */ #endif -extern int verbose; -int verbose; +static int verbose; static void usage(void) From owner-svn-src-all@FreeBSD.ORG Fri May 31 04:43:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 795694AE; Fri, 31 May 2013 04:43:20 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE82F0C; Fri, 31 May 2013 04:43:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4hKJJ018320; Fri, 31 May 2013 04:43:20 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4hKvo018319; Fri, 31 May 2013 04:43:20 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305310443.r4V4hKvo018319@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 04:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251175 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 04:43:20 -0000 Author: gibbs Date: Fri May 31 04:43:19 2013 New Revision: 251175 URL: http://svnweb.freebsd.org/changeset/base/251175 Log: Apply the ad* => ada* IDE device name transition to the Xen block front driver. Submitted by: Bei Guan Reviewed by: gibbs MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 04:27:41 2013 (r251174) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 04:43:19 2013 (r251175) @@ -148,16 +148,16 @@ blkfront_vdevice_to_unit(uint32_t vdevic int base; const char *name; } info[] = { - {3, 6, 0, "ad"}, /* ide0 */ - {22, 6, 2, "ad"}, /* ide1 */ - {33, 6, 4, "ad"}, /* ide2 */ - {34, 6, 6, "ad"}, /* ide3 */ - {56, 6, 8, "ad"}, /* ide4 */ - {57, 6, 10, "ad"}, /* ide5 */ - {88, 6, 12, "ad"}, /* ide6 */ - {89, 6, 14, "ad"}, /* ide7 */ - {90, 6, 16, "ad"}, /* ide8 */ - {91, 6, 18, "ad"}, /* ide9 */ + {3, 6, 0, "ada"}, /* ide0 */ + {22, 6, 2, "ada"}, /* ide1 */ + {33, 6, 4, "ada"}, /* ide2 */ + {34, 6, 6, "ada"}, /* ide3 */ + {56, 6, 8, "ada"}, /* ide4 */ + {57, 6, 10, "ada"}, /* ide5 */ + {88, 6, 12, "ada"}, /* ide6 */ + {89, 6, 14, "ada"}, /* ide7 */ + {90, 6, 16, "ada"}, /* ide8 */ + {91, 6, 18, "ada"}, /* ide9 */ {8, 4, 0, "da"}, /* scsi disk0 */ {65, 4, 16, "da"}, /* scsi disk1 */ From owner-svn-src-all@FreeBSD.ORG Fri May 31 04:46:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B4B662E; Fri, 31 May 2013 04:46:00 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D025F1B; Fri, 31 May 2013 04:46:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4jx8H018879; Fri, 31 May 2013 04:45:59 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4jx7N018878; Fri, 31 May 2013 04:45:59 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305310445.r4V4jx7N018878@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 04:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251176 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 04:46:00 -0000 Author: gibbs Date: Fri May 31 04:45:59 2013 New Revision: 251176 URL: http://svnweb.freebsd.org/changeset/base/251176 Log: Make netif_free() safe to call on a partially initialized softc. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri May 31 04:43:19 2013 (r251175) +++ head/sys/dev/xen/netfront/netfront.c Fri May 31 04:45:59 2013 (r251176) @@ -2177,8 +2177,11 @@ netif_free(struct netfront_info *info) callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); ifmedia_removeall(&info->sc_media); - ether_ifdetach(info->xn_ifp); - if_free(info->xn_ifp); + if (info->xn_ifp != NULL) { + ether_ifdetach(info->xn_ifp); + if_free(info->xn_ifp); + info->xn_ifp = NULL; + } } static void From owner-svn-src-all@FreeBSD.ORG Fri May 31 06:42:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76A1779F; Fri, 31 May 2013 06:42:48 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 4025C80C; Fri, 31 May 2013 06:42:48 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id BD6E5BC135; Fri, 31 May 2013 06:42:39 +0000 (UTC) Date: Fri, 31 May 2013 08:42:39 +0200 From: Jeremie Le Hen To: Marcel Moolenaar Subject: Re: svn commit: r250991 - in head: contrib/jemalloc/include/jemalloc include lib/libc/stdlib/jemalloc Message-ID: <20130531064239.GF70224@caravan.chchile.org> Mail-Followup-To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201305251859.r4PIxChc053341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305251859.r4PIxChc053341@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 06:42:48 -0000 Hi Marcel, On Sat, May 25, 2013 at 06:59:12PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Sat May 25 18:59:11 2013 > New Revision: 250991 > URL: http://svnweb.freebsd.org/changeset/base/250991 > > Log: > Make the malloc(3) family of functions weak and make their non-weak > implementations visible for use by applications. The functions $F that > are now weak symbols are: > allocm, calloc, dallocm, free, malloc, malloc_usable_size, > nallocm, posix_memalign, rallocm, realloc, sallocm > > The non-weak implementations of $F are exported as __$F. > > Submitted by: stevek@juniper.net > Reviewed by: jasone@, kib@ > Approved by: jasone@ (jemalloc) > Obtained from: juniper Networks, Inc I don't understand what this brings. If an application want to override malloc() et al., it can just do it and the dynamic linker won't look up the libc's version. Would you mind giving an example of what is now possible with this change? Thanks, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Fri May 31 11:41:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C70FFA1D; Fri, 31 May 2013 11:41:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9091995; Fri, 31 May 2013 11:41:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VBf23O064182; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VBf2uL064180; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305311141.r4VBf2uL064180@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 May 2013 11:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251178 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 11:41:02 -0000 Author: kib Date: Fri May 31 11:41:01 2013 New Revision: 251178 URL: http://svnweb.freebsd.org/changeset/base/251178 Log: MFC r250966: Fix the data corruption on the swap-backed md. Assign the rv variable a success code if the pager was not asked for the page. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Fri May 31 09:37:33 2013 (r251177) +++ stable/9/sys/dev/md/md.c Fri May 31 11:41:01 2013 (r251178) @@ -669,7 +669,9 @@ mdstart_swap(struct md_s *sc, struct bio sf = sf_buf_alloc(m, SFB_CPUPRIVATE); VM_OBJECT_LOCK(sc->object); if (bp->bio_cmd == BIO_READ) { - if (m->valid != VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); @@ -691,6 +693,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); @@ -702,6 +706,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); From owner-svn-src-all@FreeBSD.ORG Fri May 31 13:27:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0729943; Fri, 31 May 2013 13:27:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BC95519E; Fri, 31 May 2013 13:27:44 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1C1D2B943; Fri, 31 May 2013 09:27:44 -0400 (EDT) From: John Baldwin To: Glen Barber Subject: Re: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt Date: Fri, 31 May 2013 08:44:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305302154.r4ULsmZJ074053@svn.freebsd.org> <20130531015533.GD1619@glenbarber.us> In-Reply-To: <20130531015533.GD1619@glenbarber.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201305310844.35667.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 31 May 2013 09:27:44 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 13:27:45 -0000 On Thursday, May 30, 2013 9:55:33 pm Glen Barber wrote: > On Thu, May 30, 2013 at 09:54:48PM +0000, Scott Long wrote: > > Author: scottl > > Date: Thu May 30 21:54:48 2013 > > New Revision: 251164 > > URL: http://svnweb.freebsd.org/changeset/base/251164 > > > > Log: > > MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 > > > > Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. > > > > I think this breaks stable/9. > > /src/sys/dev/aha/ahareg.h:300: error: field 'timer' has incomplete type > /src/sys/dev/aha/aha_mca.c: In function 'aha_mca_attach': > /src/sys/dev/aha/aha_mca.c:194: error: 'aha' undeclared (first use in > this function) > /src/sys/dev/aha/aha_mca.c:194: error: (Each undeclared identifier is > reported only once > /src/sys/dev/aha/aha_mca.c:194: error: for each function it appears in.) > *** Error code 1 > > Stop in /obj/i386.i386/src/sys/LINT. Probably needs 214611 merged. I will test it once I finish an svn up of my tree and commit a different MFC I had running a universe last night (unless someone beats me to it). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 31 14:36:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB3E0F5A; Fri, 31 May 2013 14:36:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD0AB804; Fri, 31 May 2013 14:36:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEa9ak025063; Fri, 31 May 2013 14:36:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEa99t025062; Fri, 31 May 2013 14:36:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311436.r4VEa99t025062@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 14:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251179 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 14:36:10 -0000 Author: jhb Date: Fri May 31 14:36:09 2013 New Revision: 251179 URL: http://svnweb.freebsd.org/changeset/base/251179 Log: MFC 250219: Fix two bugs in the current NUMA-aware allocation code: - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() to allocate a page from a specific freelist. In the NUMA case it did not properly map the public VM_FREELIST_* constants to the correct backing freelists, nor did it try all NUMA domains for allocations from VM_FREELIST_DEFAULT. - vm_phys_alloc_pages() did not pin the thread and each call to vm_phys_alloc_freelist_pages() fetched the current domain to choose which freelist to use. If a thread migrated domains during the loop in vm_phys_alloc_pages() it could skip one of the freelists. If the other freelists were out of memory then it is possible that vm_phys_alloc_pages() would fail to allocate a page even though pages were available resulting in a panic in vm_page_alloc(). Modified: stable/9/sys/vm/vm_phys.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_phys.c ============================================================================== --- stable/9/sys/vm/vm_phys.c Fri May 31 11:41:01 2013 (r251178) +++ stable/9/sys/vm/vm_phys.c Fri May 31 14:36:09 2013 (r251179) @@ -117,6 +117,8 @@ SYSCTL_OID(_vm, OID_AUTO, phys_lookup_li NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); #endif +static vm_page_t vm_phys_alloc_domain_pages(int domain, int flind, int pool, + int order); static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind); @@ -430,10 +432,20 @@ vm_page_t vm_phys_alloc_pages(int pool, int order) { vm_page_t m; - int flind; + int domain, flind; + + KASSERT(pool < VM_NFREEPOOL, + ("vm_phys_alloc_pages: pool %d is out of range", pool)); + KASSERT(order < VM_NFREEORDER, + ("vm_phys_alloc_pages: order %d is out of range", order)); +#if VM_NDOMAIN > 1 + domain = PCPU_GET(domain); +#else + domain = 0; +#endif for (flind = 0; flind < vm_nfreelists; flind++) { - m = vm_phys_alloc_freelist_pages(flind, pool, order); + m = vm_phys_alloc_domain_pages(domain, flind, pool, order); if (m != NULL) return (m); } @@ -446,11 +458,12 @@ vm_phys_alloc_pages(int pool, int order) */ vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order) -{ - struct vm_freelist *fl; - struct vm_freelist *alt; - int domain, oind, pind; +{ +#if VM_NDOMAIN > 1 vm_page_t m; + int i, ndomains; +#endif + int domain; KASSERT(flind < VM_NFREELIST, ("vm_phys_alloc_freelist_pages: freelist %d is out of range", flind)); @@ -460,10 +473,39 @@ vm_phys_alloc_freelist_pages(int flind, ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); #if VM_NDOMAIN > 1 + /* + * This routine expects to be called with a VM_FREELIST_* constant. + * On a system with multiple domains we need to adjust the flind + * appropriately. If it is for VM_FREELIST_DEFAULT we need to + * iterate over the per-domain lists. + */ domain = PCPU_GET(domain); + ndomains = vm_nfreelists - VM_NFREELIST + 1; + if (flind == VM_FREELIST_DEFAULT) { + m = NULL; + for (i = 0; i < ndomains; i++, flind++) { + m = vm_phys_alloc_domain_pages(domain, flind, pool, + order); + if (m != NULL) + break; + } + return (m); + } else if (flind > VM_FREELIST_DEFAULT) + flind += ndomains - 1; #else domain = 0; #endif + return (vm_phys_alloc_domain_pages(domain, flind, pool, order)); +} + +static vm_page_t +vm_phys_alloc_domain_pages(int domain, int flind, int pool, int order) +{ + struct vm_freelist *fl; + struct vm_freelist *alt; + int oind, pind; + vm_page_t m; + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); fl = (*vm_phys_lookup_lists[domain][flind])[pool]; for (oind = order; oind < VM_NFREEORDER; oind++) { From owner-svn-src-all@FreeBSD.ORG Fri May 31 14:45:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F2DC4853; Fri, 31 May 2013 14:45:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5007885; Fri, 31 May 2013 14:45:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEjPGV029368; Fri, 31 May 2013 14:45:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEjPb7029367; Fri, 31 May 2013 14:45:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305311445.r4VEjPb7029367@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 14:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251180 - head/tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 14:45:26 -0000 Author: jilles Date: Fri May 31 14:45:25 2013 New Revision: 251180 URL: http://svnweb.freebsd.org/changeset/base/251180 Log: sh: Add test cases for break outside a loop. In most shells (including our sh), break outside a loop does nothing with status 0, or at least does not abort. Therefore, scripts sometimes (buggily) depend on this. Added: head/tools/regression/bin/sh/builtins/break4.4 (contents, props changed) head/tools/regression/bin/sh/builtins/break5.4 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/break4.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break4.4 Fri May 31 14:45:25 2013 (r251180) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 Added: head/tools/regression/bin/sh/builtins/break5.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break5.4 Fri May 31 14:45:25 2013 (r251180) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 From owner-svn-src-all@FreeBSD.ORG Fri May 31 14:48:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 995A7EDE; Fri, 31 May 2013 14:48:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF3B8B5; Fri, 31 May 2013 14:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEmbg8030308; Fri, 31 May 2013 14:48:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEmbFO030307; Fri, 31 May 2013 14:48:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305311448.r4VEmbFO030307@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 14:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251181 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 14:48:37 -0000 Author: jilles Date: Fri May 31 14:48:37 2013 New Revision: 251181 URL: http://svnweb.freebsd.org/changeset/base/251181 Log: fork(2): #include is not needed. Modified: head/lib/libc/sys/fork.2 Modified: head/lib/libc/sys/fork.2 ============================================================================== --- head/lib/libc/sys/fork.2 Fri May 31 14:45:25 2013 (r251180) +++ head/lib/libc/sys/fork.2 Fri May 31 14:48:37 2013 (r251181) @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 31, 2013 .Dt FORK 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft pid_t .Fn fork void From owner-svn-src-all@FreeBSD.ORG Fri May 31 15:19:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30DAB53E; Fri, 31 May 2013 15:19:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 233C9A4B; Fri, 31 May 2013 15:19:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VFJ1fq042270; Fri, 31 May 2013 15:19:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VFJ1hq042269; Fri, 31 May 2013 15:19:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311519.r4VFJ1hq042269@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 15:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251182 - stable/9/sys/dev/aha X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 15:19:01 -0000 Author: jhb Date: Fri May 31 15:19:00 2013 New Revision: 251182 URL: http://svnweb.freebsd.org/changeset/base/251182 Log: MFC 241611: Fix aha(4) build with i386 LINT (which includes 'device mca'). Modified: stable/9/sys/dev/aha/aha_mca.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aha/aha_mca.c ============================================================================== --- stable/9/sys/dev/aha/aha_mca.c Fri May 31 14:48:37 2013 (r251181) +++ stable/9/sys/dev/aha/aha_mca.c Fri May 31 15:19:00 2013 (r251182) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -191,7 +192,7 @@ aha_mca_attach (device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY | - INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); + INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); aha_detach(sc); From owner-svn-src-all@FreeBSD.ORG Fri May 31 16:00:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE6A8157; Fri, 31 May 2013 16:00:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C11A7D66; Fri, 31 May 2013 16:00:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VG0gIZ058025; Fri, 31 May 2013 16:00:42 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VG0gkY058024; Fri, 31 May 2013 16:00:42 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305311600.r4VG0gkY058024@svn.freebsd.org> From: Alan Cox Date: Fri, 31 May 2013 16:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251183 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 16:00:42 -0000 Author: alc Date: Fri May 31 16:00:42 2013 New Revision: 251183 URL: http://svnweb.freebsd.org/changeset/base/251183 Log: Simplify the definition of vm_page_lock_assert(). There is no compelling reason to inline the implementation of vm_page_lock_assert() in the !KLD_MODULES case. Use the same implementation for both KLD_MODULES and !KLD_MODULES. Reviewed by: kib Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri May 31 15:19:00 2013 (r251182) +++ head/sys/vm/vm_page.h Fri May 31 16:00:42 2013 (r251183) @@ -222,18 +222,17 @@ extern struct mtx_padalign pa_lock[]; #define vm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_unlock(m) vm_page_unlock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_trylock(m) vm_page_trylock_KBI((m), LOCK_FILE, LOCK_LINE) -#if defined(INVARIANTS) -#define vm_page_lock_assert(m, a) \ - vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) -#else -#define vm_page_lock_assert(m, a) -#endif #else /* !KLD_MODULE */ #define vm_page_lockptr(m) (PA_LOCKPTR(VM_PAGE_TO_PHYS((m)))) #define vm_page_lock(m) mtx_lock(vm_page_lockptr((m))) #define vm_page_unlock(m) mtx_unlock(vm_page_lockptr((m))) #define vm_page_trylock(m) mtx_trylock(vm_page_lockptr((m))) -#define vm_page_lock_assert(m, a) mtx_assert(vm_page_lockptr((m)), (a)) +#endif +#if defined(INVARIANTS) +#define vm_page_lock_assert(m, a) \ + vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) +#else +#define vm_page_lock_assert(m, a) #endif /* From owner-svn-src-all@FreeBSD.ORG Fri May 31 16:15:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC221619; Fri, 31 May 2013 16:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF100E0C; Fri, 31 May 2013 16:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VGFMlF062964; Fri, 31 May 2013 16:15:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VGFMDZ062963; Fri, 31 May 2013 16:15:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311615.r4VGFMDZ062963@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 16:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251184 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 16:15:22 -0000 Author: jhb Date: Fri May 31 16:15:22 2013 New Revision: 251184 URL: http://svnweb.freebsd.org/changeset/base/251184 Log: Style fixes to vn_ioctl(). Suggested by: bde Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri May 31 16:00:42 2013 (r251183) +++ head/sys/kern/vfs_vnops.c Fri May 31 16:15:22 2013 (r251184) @@ -1355,31 +1355,32 @@ vn_ioctl(fp, com, data, active_cred, td) struct ucred *active_cred; struct thread *td; { - struct vnode *vp = fp->f_vnode; struct vattr vattr; + struct vnode *vp; int error; - error = ENOTTY; + vp = fp->f_vnode; switch (vp->v_type) { - case VREG: case VDIR: - if (com == FIONREAD) { + case VREG: + switch (com) { + case FIONREAD: vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); - if (!error) + if (error == 0) *(int *)data = vattr.va_size - fp->f_offset; - } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ - error = 0; - else - error = VOP_IOCTL(vp, com, data, fp->f_flag, - active_cred, td); - break; - + return (error); + case FIONBIO: + case FIOASYNC: + return (0); + default: + return (VOP_IOCTL(vp, com, data, fp->f_flag, + active_cred, td)); + } default: - break; + return (ENOTTY); } - return (error); } /* From owner-svn-src-all@FreeBSD.ORG Fri May 31 17:23:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04B7AB66; Fri, 31 May 2013 17:23:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB98F114; Fri, 31 May 2013 17:23:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHNcVB087354; Fri, 31 May 2013 17:23:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHNcif087353; Fri, 31 May 2013 17:23:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305311723.r4VHNcif087353@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 May 2013 17:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251186 - head/usr.sbin/acpi/acpidump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 17:23:39 -0000 Author: jkim Date: Fri May 31 17:23:38 2013 New Revision: 251186 URL: http://svnweb.freebsd.org/changeset/base/251186 Log: Fix a long standing logic bug introduced in r167814. The code was added to get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code and we always fell back to the previous method, i. e., sysctlbyname(3). MFC after: 3 days Modified: head/usr.sbin/acpi/acpidump/acpi_user.c Modified: head/usr.sbin/acpi/acpidump/acpi_user.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi_user.c Fri May 31 17:01:53 2013 (r251185) +++ head/usr.sbin/acpi/acpidump/acpi_user.c Fri May 31 17:23:38 2013 (r251186) @@ -172,7 +172,7 @@ acpi_find_rsd_ptr(void) addr = 0; /* Attempt to use kenv or sysctl to find RSD PTR record. */ - if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) == 0) + if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) > 0) addr = strtoul(buf, NULL, 0); if (addr == 0) { len = sizeof(addr); From owner-svn-src-all@FreeBSD.ORG Fri May 31 17:27:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 905D6D8B; Fri, 31 May 2013 17:27:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8318C153; Fri, 31 May 2013 17:27:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHRjUj088085; Fri, 31 May 2013 17:27:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHRjux088083; Fri, 31 May 2013 17:27:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305311727.r4VHRjux088083@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 17:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251187 - head/sys/dev/mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 17:27:45 -0000 Author: delphij Date: Fri May 31 17:27:44 2013 New Revision: 251187 URL: http://svnweb.freebsd.org/changeset/base/251187 Log: Explicitly use a pair of parentheses to ensure correct evaluation ordering for bitwise operation. Submitted by: swildner (DragonFly) MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt_raid.c head/sys/dev/mpt/mpt_user.c Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_raid.c Fri May 31 17:27:44 2013 (r251187) @@ -605,7 +605,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); + (write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST))); se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | raid_handler_id); Modified: head/sys/dev/mpt/mpt_user.c ============================================================================== --- head/sys/dev/mpt/mpt_user.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_user.c Fri May 31 17:27:44 2013 (r251187) @@ -548,8 +548,8 @@ mpt_user_raid_action(struct mpt_softc *m MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : - MPI_SGE_FLAGS_IOC_TO_HOST)); + (raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : + MPI_SGE_FLAGS_IOC_TO_HOST))); } se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | user_handler_id); From owner-svn-src-all@FreeBSD.ORG Fri May 31 17:30:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAA23CB; Fri, 31 May 2013 17:30:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCF418C; Fri, 31 May 2013 17:30:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHUCTc088610; Fri, 31 May 2013 17:30:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHUCSg088609; Fri, 31 May 2013 17:30:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305311730.r4VHUCSg088609@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 31 May 2013 17:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251188 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 17:30:12 -0000 Author: marcel Date: Fri May 31 17:30:12 2013 New Revision: 251188 URL: http://svnweb.freebsd.org/changeset/base/251188 Log: Fix "automatic" login, broken by revision 69825 (12 years, 5 months ago). The "automatic" login feature is described as follows: The USER environment variable holds the name of the person telnetting in. This is the username of the person on the client machine. The traditional behaviour is to execute login(1) with this username first, meaning that login(1) will prompt for the password only. If login fails, login(1) will retry, but now prompt for the username before prompting for the password. This feature got broken by how the environment got scrubbed. Before the change in r69825 we removed variables that we deemed dangerous. Starting with r69825 we only keep those variable we know to be safe. The USER environment variable fell through the cracks. It suddenly got scrubbed (i.e. removed from the environment) while still being checked for. It also got explicitly removed from the environment to handle the failed login case. The fix is to obtain the value of the USER environment variable before we scrub the environment and used the "cached" in subsequent checks. This guarantees that the environment does not contain the USER variable in the end, while still being able to implement "automatic" login. Obtained from: Juniper Networks, Inc. Modified: head/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Fri May 31 17:27:44 2013 (r251187) +++ head/contrib/telnet/telnetd/sys_term.c Fri May 31 17:30:12 2013 (r251188) @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -1026,6 +1026,10 @@ void start_login(char *host undef1, int autologin undef1, char *name undef1) { char **argv; + char *user; + + user = getenv("USER"); + user = (user != NULL) ? strdup(user) : NULL; scrub_env(); @@ -1160,9 +1164,9 @@ start_login(char *host undef1, int autol # endif } else #endif - if (getenv("USER")) { + if (user != NULL) { argv = addarg(argv, "--"); - argv = addarg(argv, getenv("USER")); + argv = addarg(argv, user); #if defined(LOGIN_ARGS) && defined(NO_LOGIN_P) { char **cpp; @@ -1170,17 +1174,6 @@ start_login(char *host undef1, int autol argv = addarg(argv, *cpp); } #endif - /* - * Assume that login will set the USER variable - * correctly. For SysV systems, this means that - * USER will no longer be set, just LOGNAME by - * login. (The problem is that if the auto-login - * fails, and the user then specifies a different - * account name, he can get logged in with both - * LOGNAME and USER in his environment, but the - * USER value will be wrong. - */ - unsetenv("USER"); } #ifdef AUTHENTICATION #if defined(NO_LOGIN_F) && defined(LOGIN_R) @@ -1190,6 +1183,9 @@ start_login(char *host undef1, int autol #endif /* AUTHENTICATION */ closelog(); + if (user != NULL) + free(user); + if (altlogin == NULL) { altlogin = _PATH_LOGIN; } From owner-svn-src-all@FreeBSD.ORG Fri May 31 19:07:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A270F75E; Fri, 31 May 2013 19:07:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93168824; Fri, 31 May 2013 19:07:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VJ7Lxq022781; Fri, 31 May 2013 19:07:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VJ7Hp8022745; Fri, 31 May 2013 19:07:17 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305311907.r4VJ7Hp8022745@svn.freebsd.org> From: Devin Teske Date: Fri, 31 May 2013 19:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251190 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/share security share share/media startup startup/share timezone timezone/share usermgmt usermg... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 19:07:21 -0000 Author: dteske Date: Fri May 31 19:07:17 2013 New Revision: 251190 URL: http://svnweb.freebsd.org/changeset/base/251190 Log: Improve portion of the dialog(1) API in dialog.subr responsible for calculating widget sizes. Instead of forking a sub-shell to calculate the optimum size for a widget, use a byRef style call-out to set variables in the parent namespace. For example, instead of: size=$( f_dialog_buttonbox_size title btitle msg ) $DIALOG --title title --backtitle btitle --msgbox msg $size The new API replaces the above with the following: f_dialog_buttonbox_size height width title btitle msg $DIALOG --title title --backtitle btitle --msgbox msg $height $width This reduces the number of forks, improves performance, and makes the code more readable by revealing the argument-order for widget sizing. It also makes performing minor adjustments to the calculated values easier as you no longer have to split-out the response (which required knowledge of ordering so was counter-intuitive). Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/bsdconfig Fri May 31 19:07:17 2013 (r251190) @@ -145,7 +145,7 @@ dialog_menu_main() local title="$DIALOG_TITLE" local btitle="$DIALOG_BACKTITLE" local prompt="$msg_menu_text" - local menu_list size + local menu_list menu_list=" 'X' '$msg_exit' '$msg_exit_bsdconfig' @@ -179,12 +179,13 @@ dialog_menu_main() index=$(( $index + 1 )) done - size=$( eval f_dialog_menu_with_help_size \ - \"\$title\" \ - \"\$btitle\" \ - \"\$prompt\" \ - \"\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_with_help_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -198,7 +199,9 @@ dialog_menu_main() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size $menu_list \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/console Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="$hline_configure_system_console_settings" local prompt="$msg_console_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '7 $msg_ttys' '$msg_choose_console_terminal_type' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -77,7 +78,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/font Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_font" local prompt="$msg_font_menu_text" @@ -70,12 +70,13 @@ dialog_menu_main() 'e $msg_swiss' '$msg_swiss_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get font8x8 )" in [Nn][Oo]|'') defaultitem="1 $msg_none";; @@ -102,7 +103,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/keymap Fri May 31 19:07:17 2013 (r251190) @@ -77,7 +77,7 @@ KEYMAP_NAMES=" # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_keyboard_map" local prompt="$msg_keymap_menu_text" @@ -110,12 +110,13 @@ dialog_menu_main() }' ) - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get keymap )" in be.iso) defaultitem="$msg_belgian";; @@ -200,7 +201,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/repeat Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_keyboard_repeat_rate" local prompt="$msg_repeat_menu_text" @@ -60,12 +60,13 @@ dialog_menu_main() '$msg_fast' '$msg_fast_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get keyrate )" in slow) defaultitem="$msg_slow";; @@ -82,7 +83,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/saver Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_screen_saver" local prompt="$msg_saver_menu_text" @@ -70,12 +70,13 @@ dialog_menu_main() '$msg_timeout' '$msg_timeout_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get saver )" in blank) defaultitem="1 $msg_blank" ;; @@ -101,7 +102,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/screenmap Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_screen_map" local prompt="$msg_screenmap_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '6 $msg_koi8_u_to_ibm866u' '$msg_koi8_u_to_ibm866u_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get scrnmap )" in [Nn][Oo]|'') defaultitem="1 $msg_none" ;; @@ -86,7 +87,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/ttys Fri May 31 19:07:17 2013 (r251190) @@ -72,16 +72,16 @@ TTY_MENU_LIST=" # dialog_menu_main() { - local size local hline="$hline_choose_a_terminal_type" local prompt="$msg_ttys_menu_text" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $TTY_MENU_LIST ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $TTY_MENU_LIST local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -90,7 +90,8 @@ dialog_menu_main() --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $TTY_MENU_LIST \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/disable Fri May 31 19:07:17 2013 (r251190) @@ -86,16 +86,14 @@ f_sysrc_delete moused_flags || f_die f_dialog_title "$msg_message" hline="$hline_press_enter_or_space" prompt="$msg_mouse_daemon_is_disabled" -size=$( f_dialog_buttonbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$prompt" ) -eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --msgbox \"\$prompt\" $size +f_dialog_buttonbox_size height width \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" +$DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --msgbox "$prompt" $height $width exit $SUCCESS Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/mouse Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="" local prompt="$msg_menu_text" @@ -61,12 +61,13 @@ dialog_menu_main() '6 $msg_disable' '$msg_disable_the_mouse_daemon' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -76,7 +77,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/port Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="" local prompt="$msg_port_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '6 $msg_busmouse' '$msg_busmouse_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get moused_port )" in /dev/psm0) defaultitem="1 $msg_ps2" ;; @@ -86,7 +87,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/type Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="" local prompt="$msg_protocol_menu_text" @@ -66,12 +66,13 @@ dialog_menu_main() 'A $msg_thinkingmouse' '$msg_thinkingmouse_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get moused_type )" in auto) defaultitem="1 $msg_auto" ;; @@ -94,7 +95,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/networking Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="$hline_arrows_tab_enter" menu_list=" @@ -59,12 +59,13 @@ dialog_menu_main() '4' '$msg_dns_nameservers' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -74,7 +75,9 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\" $size $menu_list \ + --menu \"\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri May 31 19:07:17 2013 (r251190) @@ -142,14 +142,15 @@ f_dialog_menu_netdev() # # Ask user to select an interface # - local prompt size + local prompt prompt="$msg_select_network_interface" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $interfaces ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $interfaces local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -158,7 +159,8 @@ f_dialog_menu_netdev() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $interfaces \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -175,7 +177,7 @@ f_dialog_menu_netdev() f_dialog_menu_netdev_edit() { local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5" - local prompt menu_list size + local prompt menu_list height width rows # # Create a duplicate set of variables for change-tracking... @@ -216,12 +218,12 @@ f_dialog_menu_netdev_edit() '4 $msg_netmask' '$netmask' '5 $msg_options' '$options' " - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -233,7 +235,8 @@ f_dialog_menu_netdev_edit() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri May 31 19:07:17 2013 (r251190) @@ -393,10 +393,12 @@ f_dialog_input_nameserver() # f_dialog_menu_nameservers() { + + local height width rows local opt_exit="$msg_return_to_previous_menu" local opt_add="$msg_add_nameserver" local hline="$hline_arrows_tab_enter" - local prompt size defaultitem= + local prompt defaultitem= # # Loop forever until the user has finished configuring nameservers @@ -427,12 +429,12 @@ f_dialog_menu_nameservers() # # Display configuration-edit menu # - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -441,7 +443,8 @@ f_dialog_menu_nameservers() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/password/share/password.subr Fri May 31 19:07:17 2013 (r251190) @@ -46,23 +46,25 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_dialog_input_password() { local hline="$hline_alnum_punc_tab_enter" - local msg size rmsg rsize + local msg rmsg msg=$( printf "$msg_enter_new_password" ) - size=$( f_dialog_inputbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$msg" \ - "" \ - "$hline" ) + local height1 width1 + f_dialog_inputbox_size height1 width1 \ + "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" \ + "$msg" \ + "" \ + "$hline" rmsg=$( printf "$msg_reenter_password" ) - rsize=$( f_dialog_inputbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$rmsg" \ - "" \ - "$hline" ) + local height2 width2 + f_dialog_inputbox_size height2 width2 \ + "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" \ + "$rmsg" \ + "" \ + "$hline" # # Loop until the user provides taint-free/valid input @@ -70,14 +72,15 @@ f_dialog_input_password() local retval _password1 _password2 while :; do local dialog_inputbox - dialog_inputbox=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --insecure \ - --passwordbox \"\$msg\" $size \ + dialog_inputbox=$( $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --cancel-label "$msg_cancel" \ + --insecure \ + --passwordbox "$msg" \ + $height1 $width1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -88,14 +91,15 @@ f_dialog_input_password() # Return if user has either pressed ESC or chosen Cancel/No [ $retval -eq $SUCCESS ] || return $retval - dialog_inputbox=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --insecure \ - --passwordbox \"\$rmsg\" $rsize \ + dialog_inputbox=$( $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --cancel-label "$msg_cancel" \ + --insecure \ + --passwordbox "$rmsg" \ + $height2 $width2 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Fri May 31 19:07:17 2013 (r251190) @@ -51,7 +51,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_select_securelevel_to_operate_at" local prompt="$msg_securelevels_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '$msg_network_secure' '$msg_network_secure_mode' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get kern_securelevel_enable )" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) @@ -91,7 +92,8 @@ dialog_menu_main() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/security/security Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size mark=" " defaultitem= + local menu_list mark=" " defaultitem= local hline="$hline_arrows_tab_enter" local prompt="$msg_menu_text" @@ -97,12 +97,13 @@ dialog_menu_main() # Update default-item if appropriate [ "$ditem" = 3 ] && defaultitem="3 [$mark] $msg_nfs_port" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -112,7 +113,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/share/device.subr Fri May 31 19:07:17 2013 (r251190) @@ -607,13 +607,13 @@ f_device_menu() menu_list="$menu_list '$dev' '$desc'" done - local size mtag - size=$( eval f_dialog_menu_size \ - \"\$title\" \ - \"\$btitle\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local errexit= case $- in *e*) errexit=1; esac @@ -630,7 +630,8 @@ f_device_menu() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ } \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri May 31 19:07:17 2013 (r251190) @@ -83,6 +83,28 @@ unset XDIALOG_INFOBOX_TIMEOUT # : ${DEFAULT_TERMINAL_SIZE:=24 80} +# +# Minimum width(s) for various dialog(1) implementations (sensible global +# default(s) for all widgets of a given variant) +# +: ${DIALOG_MIN_WIDTH:=24} +: ${XDIALOG_MIN_WIDTH:=35} + +# +# When manually sizing Xdialog(1) widgets such as calendar and timebox, you'll +# need to know the size of the embedded GUI objects because the height passed +# to Xdialog(1) for these widgets has to be tall enough to accomodate them. +# +# These values are helpful when manually sizing with dialog(1) too, but in a +# different way. dialog(1) does not make you accomodate the custom items in the +# height (but does for width) -- a height of 3 will display three lines and a +# full calendar, for example (whereas Xdialog will truncate the calendar if +# given a height of 3). For dialog(1), use these values for making sure that +# the height does not exceed max_height (obtained by f_dialog_max_size()). +# +DIALOG_CALENDAR_HEIGHT=15 +DIALOG_TIMEBOX_HEIGHT=6 + ############################################################ GENERIC FUNCTIONS # f_dialog_title [$new_title] @@ -174,889 +196,1163 @@ f_dialog_backtitle_restore() ############################################################ SIZE FUNCTIONS -# f_dialog_infobox_size $title $backtitle $prompt [$hline] -# -# Not all versions of dialog(1) perform auto-sizing of the width and height of -# `--infobox' boxes sensibly. +# f_dialog_max_size $var_height $var_width # -# This function helps solve this issue by taking as arguments (in order of -# appearance) the title, backtitle, prompt, and [optionally] hline returning -# the optimal width and height for the box (not exceeding the actual terminal -# width or height). +# Get the maximum height and width for a dialog widget and store the values in +# $var_height and $var_width (respectively). # -# Newline character sequences (``\n'') in $prompt are expanded as-is done by -# dialog(1). -# -# Output is in the format of "height width". -# -f_dialog_infobox_size() +f_dialog_max_size() { - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 - local min_width max_size - + local __var_height="$1" __var_width="$2" __max_size + [ "$__var_height" -o "$__var_width" ] || return $FAILURE if [ "$USE_XDIALOG" ]; then - min_width=35 - max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION + __max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION else - min_width=24 - max_size=$( stty size 2> /dev/null ) # usually "24 80" - : ${max_size:=$DEFAULT_TERMINAL_SIZE} + __max_size=$( stty size 2> /dev/null ) # usually "24 80" + : ${__max_size:=$DEFAULT_TERMINAL_SIZE} fi + [ "$__var_height" ] && setvar "$__var_height" "${__max_size%%[$IFS]*}" + [ "$__var_width" ] && setvar "$__var_width" "${__max_size##*[$IFS]}" +} - local max_height="${max_size%%[$IFS]*}" - local max_width="${max_size##*[$IFS]}" - local height width=$min_width +# f_dialog_size_constrain $var_height $var_width [$min_height [$min_width]] +# +# Modify $var_height to be no-less-than $min_height (if given; zero otherwise) +# and no-greater-than terminal height (or screen height if $USE_XDIALOG is +# set). +# +# Also modify $var_width to be no-less-than $XDIALOG_MIN_WIDTH (or +# $XDIALOG_MIN_WIDTH if $_USE_XDIALOG is set) and no-greater-than terminal +# or screen width. The use of $[X]DIALOG_MIN_WIDTH can be overridden by +# passing $min_width. +# +# Return status is success unless one of the passed arguments is invalid +# or all of the $var_* arguments are either NULL or missing. +# +f_dialog_size_constrain() +{ + local __var_height="$1" __var_width="$2" + local __min_height="$3" __min_width="$4" + local __retval=$SUCCESS + + # Return failure unless at least one var_* argument is passed + [ "$__var_height" -o "$__var_width" ] || return $FAILURE # - # Bump width for long titles (but don't exceed terminal width). + # Print debug warnings if any given (non-NULL) argument are invalid + # NOTE: Don't change the name of $__{var,min,}{height,width} # - n=$(( ${#title} + 4 )) - if [ $n -gt $width -a $n -gt $min_width ]; then - # Add 16.6% width for Xdialog(1) - [ "$USE_XDIALOG" ] && n=$(( $n + $n / 6 )) + local __height __width + local __arg __cp __fname=f_dialog_size_constrain + for __arg in height width; do + debug= f_getvar __var_$__arg __cp + [ "$__cp" ] || continue + if ! f_getvar "$__cp" __$__arg; then + f_dprintf "%s: var_%s variable \`%s' not set" \ + $__fname $__arg "$__cp" + __retval=$FAILURE + elif ! eval f_isinteger \$__$__arg; then + f_dprintf "%s: var_%s variable value not a number" \ + $__fname $__arg + __retval=$FAILURE + fi + done + for __arg in height width; do + debug= f_getvar __min_$__arg __cp + [ "$__cp" ] || continue + f_isinteger "$__cp" && continue + f_dprintf "%s: min_%s value not a number" $__fname $__arg + __retval=$FAILURE + setvar __min_$__arg "" + done - if [ $n -lt $max_width ]; then - width=$n - else - width=$max_width + # Obtain maximum height and width values + # NOTE: Function name appended to prevent __var_{height,width} values + # from becoming local (and thus preventing setvar from working). + local __max_height_size_constain __max_width_size_constrain + f_dialog_max_size \ + __max_height_size_constrain __max_width_size_constrain + + # Adjust height if desired + if [ "$__var_height" ]; then + if [ $__height -lt ${__min_height:-0} ]; then + setvar "$__var_height" $__min_height + elif [ $__height -gt $__max_height_size_constrain ]; then + setvar "$__var_height" $__max_height_size_constrain fi fi - # - # For Xdialog(1), bump width for long backtitles (which appear within - # the window; don't exceed maximum width). - # - if [ "$USE_XDIALOG" ]; then - n=$(( ${#btitle} + 4 )) - n=$(( $n + $n / 6 )) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 31 19:13:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 703669FF; Fri, 31 May 2013 19:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6135A85C; Fri, 31 May 2013 19:13:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VJDNgC025748; Fri, 31 May 2013 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VJDNCx025746; Fri, 31 May 2013 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311913.r4VJDNCx025746@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 19:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251191 - in stable/9/sys: conf x86/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 19:13:23 -0000 Author: jhb Date: Fri May 31 19:13:22 2013 New Revision: 251191 URL: http://svnweb.freebsd.org/changeset/base/251191 Log: MFC 246805: Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel config file. Modified: stable/9/sys/conf/options stable/9/sys/x86/acpica/srat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri May 31 19:07:17 2013 (r251190) +++ stable/9/sys/conf/options Fri May 31 19:13:22 2013 (r251191) @@ -594,6 +594,7 @@ VFS_BIO_DEBUG opt_global.h VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h +VM_NDOMAIN opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h Modified: stable/9/sys/x86/acpica/srat.c ============================================================================== --- stable/9/sys/x86/acpica/srat.c Fri May 31 19:07:17 2013 (r251190) +++ stable/9/sys/x86/acpica/srat.c Fri May 31 19:13:22 2013 (r251191) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri May 31 19:20:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 07772C0D; Fri, 31 May 2013 19:20:20 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx1.freebsd.org (Postfix) with ESMTP id C200F898; Fri, 31 May 2013 19:20:19 +0000 (UTC) Received: by mail-pd0-f175.google.com with SMTP id 4so692180pdd.34 for ; Fri, 31 May 2013 12:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IKadP4tM1Bs+v9Ac/aW4OmeA0lYB/cr3KKxYYhaO79k=; b=rJqdJGPFrUOUM9uE04SAsjerGx13G2XOwtdH0CaQksyv+vAkke6+748CfTx40ieb9+ FqPIprqtx4WxWZ0oTdYmyW7X7OZ18hAubAcMA6vtoGbjSsL4zjYDH7mJ6ycGm+gMWdCY xr/dIFiAGi1InxhSLMNa8Ao1LzpJY1LobR/t4GII3AjH0Gldmts5Kkf15j4TVDMb9Snu diKz0dPOsA2yqQxF85em5vgS5gM5Yp9EOpIPo0Srwo9MYOu6eL0TwCY0D+qcwsmfKdv0 FtvjM52Ovqi+pOOr3Kji8aJmK5rWSMuwcsdGDFdQ3WJMfuds8QS5ht57vbi+Zc4PilCy WJUQ== X-Received: by 10.66.163.5 with SMTP id ye5mr14871407pab.60.1370028019126; Fri, 31 May 2013 12:20:19 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id qh4sm51027592pac.8.2013.05.31.12.20.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 12:20:18 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <51A8F7EF.8030804@FreeBSD.org> Date: Fri, 31 May 2013 12:20:15 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r251191 - in stable/9/sys: conf x86/acpica References: <201305311913.r4VJDNCx025746@svn.freebsd.org> In-Reply-To: <201305311913.r4VJDNCx025746@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 19:20:20 -0000 On 05/31/13 12:13, John Baldwin wrote: > Author: jhb > Date: Fri May 31 19:13:22 2013 > New Revision: 251191 > URL: http://svnweb.freebsd.org/changeset/base/251191 > > Log: > MFC 246805: > Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel > config file. Is this going to live long in 9? Or will be replaced with MAXMEMDOM like it was in head? Navdeep > > Modified: > stable/9/sys/conf/options > stable/9/sys/x86/acpica/srat.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/conf/ (props changed) > > Modified: stable/9/sys/conf/options > ============================================================================== > --- stable/9/sys/conf/options Fri May 31 19:07:17 2013 (r251190) > +++ stable/9/sys/conf/options Fri May 31 19:13:22 2013 (r251191) > @@ -594,6 +594,7 @@ VFS_BIO_DEBUG opt_global.h > VM_KMEM_SIZE opt_vm.h > VM_KMEM_SIZE_SCALE opt_vm.h > VM_KMEM_SIZE_MAX opt_vm.h > +VM_NDOMAIN opt_vm.h > VM_NRESERVLEVEL opt_vm.h > VM_LEVEL_0_ORDER opt_vm.h > NO_SWAPPING opt_vm.h > > Modified: stable/9/sys/x86/acpica/srat.c > ============================================================================== > --- stable/9/sys/x86/acpica/srat.c Fri May 31 19:07:17 2013 (r251190) > +++ stable/9/sys/x86/acpica/srat.c Fri May 31 19:13:22 2013 (r251191) > @@ -28,6 +28,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_vm.h" > + > #include > #include > #include > From owner-svn-src-all@FreeBSD.ORG Fri May 31 20:07:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F61E69E; Fri, 31 May 2013 20:07:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0243CA38; Fri, 31 May 2013 20:07:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VK7Q9A043710; Fri, 31 May 2013 20:07:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VK7QJD043709; Fri, 31 May 2013 20:07:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305312007.r4VK7QJD043709@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 May 2013 20:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251192 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 20:07:27 -0000 Author: ed Date: Fri May 31 20:07:26 2013 New Revision: 251192 URL: http://svnweb.freebsd.org/changeset/base/251192 Log: Fix misspelling of structure field name. Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Fri May 31 19:13:22 2013 (r251191) +++ head/include/stdatomic.h Fri May 31 20:07:26 2013 (r251192) @@ -123,7 +123,7 @@ enum memory_order { #if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->val) + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) #else #define atomic_is_lock_free(obj) \ ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) From owner-svn-src-all@FreeBSD.ORG Fri May 31 20:11:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2998F859; Fri, 31 May 2013 20:11:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01905A4C; Fri, 31 May 2013 20:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VKB7Tx046196; Fri, 31 May 2013 20:11:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VKB7ZN046195; Fri, 31 May 2013 20:11:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305312011.r4VKB7ZN046195@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 May 2013 20:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251193 - stable/9/contrib/libc++/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 20:11:08 -0000 Author: dim Date: Fri May 31 20:11:07 2013 New Revision: 251193 URL: http://svnweb.freebsd.org/changeset/base/251193 Log: MFC r251066: Fix warnings from newer clang versions about constexpr member functions not being implicitly const in libc++'s header. The warnings have been introduced because of new language rules recently adopted by the C++ WG. More info: Modified: stable/9/contrib/libc++/include/chrono Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/9/contrib/libc++/include/chrono ============================================================================== --- stable/9/contrib/libc++/include/chrono Fri May 31 20:07:26 2013 (r251192) +++ stable/9/contrib/libc++/include/chrono Fri May 31 20:11:07 2013 (r251193) @@ -468,7 +468,7 @@ template ::type _Ct; return _Ct(__lhs).count() == _Ct(__rhs).count(); @@ -479,7 +479,7 @@ template struct __duration_eq<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() == __rhs.count();} }; @@ -509,7 +509,7 @@ template ::type _Ct; return _Ct(__lhs).count() < _Ct(__rhs).count(); @@ -520,7 +520,7 @@ template struct __duration_lt<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() < __rhs.count();} }; From owner-svn-src-all@FreeBSD.ORG Fri May 31 20:46:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B82EEE; Fri, 31 May 2013 20:46:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC3A8B83; Fri, 31 May 2013 20:46:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VKk8mj057203; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VKk8Fc057202; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312046.r4VKk8Fc057202@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 20:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251194 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 20:46:08 -0000 Author: jilles Date: Fri May 31 20:46:08 2013 New Revision: 251194 URL: http://svnweb.freebsd.org/changeset/base/251194 Log: fork(2): Add information about fork() in multi-threaded processes. There is nothing about pthread_atfork(3) or extensions like calling malloc(3) in the child process as this may be unreliable or broken. Modified: head/lib/libc/sys/fork.2 Modified: head/lib/libc/sys/fork.2 ============================================================================== --- head/lib/libc/sys/fork.2 Fri May 31 20:11:07 2013 (r251193) +++ head/lib/libc/sys/fork.2 Fri May 31 20:46:08 2013 (r251194) @@ -73,6 +73,17 @@ are set to 0; see .It All interval timers are cleared; see .Xr setitimer 2 . +.It +The child process has only one thread, +corresponding to the calling thread in the parent process. +If the process has more than one thread, +locks and other resources held by the other threads are not released +and therefore only async-signal-safe functions +(see +.Xr sigaction 2 ) +are guaranteed to work in the child process until a call to +.Xr execve 2 +or a similar function. .El .Sh RETURN VALUES Upon successful completion, @@ -124,6 +135,7 @@ There is insufficient swap space for the .Xr rfork 2 , .Xr setitimer 2 , .Xr setrlimit 2 , +.Xr sigaction 2 , .Xr vfork 2 , .Xr wait 2 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Fri May 31 21:05:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EFC747D9; Fri, 31 May 2013 21:05:07 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0080CE5; Fri, 31 May 2013 21:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VL57XA064173; Fri, 31 May 2013 21:05:07 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VL57mw064171; Fri, 31 May 2013 21:05:07 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312105.r4VL57mw064171@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 21:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251195 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 21:05:08 -0000 Author: gibbs Date: Fri May 31 21:05:07 2013 New Revision: 251195 URL: http://svnweb.freebsd.org/changeset/base/251195 Log: Style cleanups. No intended functional changes. o This driver is the "xbd" driver, not the "blkfront", "blkif", "xbf", or "xb" driver. Use the "xbd_" naming conventions for all functions, structures, and constants. o The prevailing convention for structure fields in this driver is to prefix them with an abreviation of the structure type. Update "recently added" fields to match this style. o Remove unused data structures. o Remove superfluous casts. o Make a pass over the whole driver and bring it closer to style(9) conformance. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 20:46:08 2013 (r251194) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 21:05:07 2013 (r251195) @@ -1,6 +1,7 @@ /* * XenBSD block device driver * + * Copyright (c) 2010-2013 Spectra Logic Corporation * Copyright (c) 2009 Scott Long, Yahoo! * Copyright (c) 2009 Frank Suchomel, Citrix * Copyright (c) 2009 Doug F. Rabson, Citrix @@ -70,17 +71,17 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" /* prototypes */ -static void xb_free_command(struct xb_command *cm); -static void xb_startio(struct xb_softc *sc); -static void blkfront_connect(struct xb_softc *); -static void blkfront_closing(device_t); -static int blkfront_detach(device_t); -static int setup_blkring(struct xb_softc *); -static void blkif_int(void *); -static void blkfront_initialize(struct xb_softc *); -static int blkif_completion(struct xb_command *); -static void blkif_free(struct xb_softc *); -static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); +static void xbd_free_command(struct xbd_command *cm); +static void xbd_startio(struct xbd_softc *sc); +static void xbd_connect(struct xbd_softc *); +static void xbd_closing(device_t); +static int xbd_detach(device_t); +static int xbd_setup_ring(struct xbd_softc *); +static void xbd_int(void *); +static void xbd_initialize(struct xbd_softc *); +static int xbd_completion(struct xbd_command *); +static void xbd_free(struct xbd_softc *); +static void xbd_queue_cb(void *, bus_dma_segment_t *, int, int); static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); @@ -93,18 +94,18 @@ static MALLOC_DEFINE(M_XENBLOCKFRONT, "x static void vbd_update(void); #endif -#define BLKIF_STATE_DISCONNECTED 0 -#define BLKIF_STATE_CONNECTED 1 -#define BLKIF_STATE_SUSPENDED 2 +#define XBD_STATE_DISCONNECTED 0 +#define XBD_STATE_CONNECTED 1 +#define XBD_STATE_SUSPENDED 2 #ifdef notyet -static char *blkif_state_name[] = { - [BLKIF_STATE_DISCONNECTED] = "disconnected", - [BLKIF_STATE_CONNECTED] = "connected", - [BLKIF_STATE_SUSPENDED] = "closed", +static char *xbd_state_name[] = { + [XBD_STATE_DISCONNECTED] = "disconnected", + [XBD_STATE_CONNECTED] = "connected", + [XBD_STATE_SUSPENDED] = "closed", }; -static char * blkif_status_name[] = { +static char * xbd_status_name[] = { [BLKIF_INTERFACE_STATUS_CLOSED] = "closed", [BLKIF_INTERFACE_STATUS_DISCONNECTED] = "disconnected", [BLKIF_INTERFACE_STATUS_CONNECTED] = "connected", @@ -118,17 +119,17 @@ static char * blkif_status_name[] = { #define DPRINTK(fmt, args...) #endif -static int blkif_open(struct disk *dp); -static int blkif_close(struct disk *dp); -static int blkif_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); -static int blkif_queue_request(struct xb_softc *sc, struct xb_command *cm); -static void xb_strategy(struct bio *bp); +static int xbd_open(struct disk *dp); +static int xbd_close(struct disk *dp); +static int xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); +static int xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm); +static void xbd_strategy(struct bio *bp); // In order to quiesce the device during kernel dumps, outstanding requests to // DOM0 for disk reads/writes need to be accounted for. -static int xb_dump(void *, void *, vm_offset_t, off_t, size_t); +static int xbd_dump(void *, void *, vm_offset_t, off_t, size_t); -/* XXX move to xb_vbd.c when VBD update support is added */ +/* XXX move to xbd_vbd.c when VBD update support is added */ #define MAX_VBDS 64 #define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ @@ -140,7 +141,7 @@ static int xb_dump(void *, void *, vm_of * with blkfront as the emulated drives, easing transition slightly. */ static void -blkfront_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) +xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) { static struct vdev_info { int major; @@ -203,34 +204,34 @@ blkfront_vdevice_to_unit(uint32_t vdevic } int -xlvbd_add(struct xb_softc *sc, blkif_sector_t sectors, +xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, int vdevice, uint16_t vdisk_info, unsigned long sector_size) { - int unit, error = 0; + int unit, error = 0; const char *name; - blkfront_vdevice_to_unit(vdevice, &unit, &name); + xbd_vdevice_to_unit(vdevice, &unit, &name); - sc->xb_unit = unit; + sc->xbd_unit = unit; if (strcmp(name, "xbd")) - device_printf(sc->xb_dev, "attaching as %s%d\n", name, unit); + device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); - sc->xb_disk = disk_alloc(); - sc->xb_disk->d_unit = sc->xb_unit; - sc->xb_disk->d_open = blkif_open; - sc->xb_disk->d_close = blkif_close; - sc->xb_disk->d_ioctl = blkif_ioctl; - sc->xb_disk->d_strategy = xb_strategy; - sc->xb_disk->d_dump = xb_dump; - sc->xb_disk->d_name = name; - sc->xb_disk->d_drv1 = sc; - sc->xb_disk->d_sectorsize = sector_size; - - sc->xb_disk->d_mediasize = sectors * sector_size; - sc->xb_disk->d_maxsize = sc->max_request_size; - sc->xb_disk->d_flags = 0; - disk_create(sc->xb_disk, DISK_VERSION); + sc->xbd_disk = disk_alloc(); + sc->xbd_disk->d_unit = sc->xbd_unit; + sc->xbd_disk->d_open = xbd_open; + sc->xbd_disk->d_close = xbd_close; + sc->xbd_disk->d_ioctl = xbd_ioctl; + sc->xbd_disk->d_strategy = xbd_strategy; + sc->xbd_disk->d_dump = xbd_dump; + sc->xbd_disk->d_name = name; + sc->xbd_disk->d_drv1 = sc; + sc->xbd_disk->d_sectorsize = sector_size; + + sc->xbd_disk->d_mediasize = sectors * sector_size; + sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; + sc->xbd_disk->d_flags = 0; + disk_create(sc->xbd_disk, DISK_VERSION); return error; } @@ -242,9 +243,9 @@ xlvbd_add(struct xb_softc *sc, blkif_sec * the sortq and kick the controller. */ static void -xb_strategy(struct bio *bp) +xbd_strategy(struct bio *bp) { - struct xb_softc *sc = (struct xb_softc *)bp->bio_disk->d_drv1; + struct xbd_softc *sc = bp->bio_disk->d_drv1; /* bogus disk? */ if (sc == NULL) { @@ -258,25 +259,25 @@ xb_strategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - mtx_lock(&sc->xb_io_lock); + mtx_lock(&sc->xbd_io_lock); - xb_enqueue_bio(sc, bp); - xb_startio(sc); + xbd_enqueue_bio(sc, bp); + xbd_startio(sc); - mtx_unlock(&sc->xb_io_lock); + mtx_unlock(&sc->xbd_io_lock); return; } static void -xb_bio_complete(struct xb_softc *sc, struct xb_command *cm) +xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) { struct bio *bp; - bp = cm->bp; + bp = cm->cm_bp; - if ( unlikely(cm->status != BLKIF_RSP_OKAY) ) { + if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { disk_err(bp, "disk error" , -1, 0); - printf(" status: %x\n", cm->status); + printf(" status: %x\n", cm->cm_status); bp->bio_flags |= BIO_ERROR; } @@ -285,24 +286,24 @@ xb_bio_complete(struct xb_softc *sc, str else bp->bio_resid = 0; - xb_free_command(cm); + xbd_free_command(cm); biodone(bp); } // Quiesce the disk writes for a dump file before allowing the next buffer. static void -xb_quiesce(struct xb_softc *sc) +xbd_quiesce(struct xbd_softc *sc) { - int mtd; + int mtd; // While there are outstanding requests - while (!TAILQ_EMPTY(&sc->cm_busy)) { - RING_FINAL_CHECK_FOR_RESPONSES(&sc->ring, mtd); + while (!TAILQ_EMPTY(&sc->xbd_cm_busy)) { + RING_FINAL_CHECK_FOR_RESPONSES(&sc->xbd_ring, mtd); if (mtd) { /* Recieved request completions, update queue. */ - blkif_int(sc); + xbd_int(sc); } - if (!TAILQ_EMPTY(&sc->cm_busy)) { + if (!TAILQ_EMPTY(&sc->xbd_cm_busy)) { /* * Still pending requests, wait for the disk i/o * to complete. @@ -314,60 +315,60 @@ xb_quiesce(struct xb_softc *sc) /* Kernel dump function for a paravirtualized disk device */ static void -xb_dump_complete(struct xb_command *cm) +xbd_dump_complete(struct xbd_command *cm) { - xb_enqueue_complete(cm); + xbd_enqueue_complete(cm); } static int -xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, - size_t length) +xbd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, + size_t length) { - struct disk *dp = arg; - struct xb_softc *sc = (struct xb_softc *) dp->d_drv1; - struct xb_command *cm; - size_t chunk; - int sbp; - int rc = 0; + struct disk *dp = arg; + struct xbd_softc *sc = dp->d_drv1; + struct xbd_command *cm; + size_t chunk; + int sbp; + int rc = 0; if (length <= 0) return (rc); - xb_quiesce(sc); /* All quiet on the western front. */ + xbd_quiesce(sc); /* All quiet on the western front. */ /* * If this lock is held, then this module is failing, and a * successful kernel dump is highly unlikely anyway. */ - mtx_lock(&sc->xb_io_lock); + mtx_lock(&sc->xbd_io_lock); /* Split the 64KB block as needed */ for (sbp=0; length > 0; sbp++) { - cm = xb_dequeue_free(sc); + cm = xbd_dequeue_free(sc); if (cm == NULL) { - mtx_unlock(&sc->xb_io_lock); - device_printf(sc->xb_dev, "dump: no more commands?\n"); + mtx_unlock(&sc->xbd_io_lock); + device_printf(sc->xbd_dev, "dump: no more commands?\n"); return (EBUSY); } - if (gnttab_alloc_grant_references(sc->max_request_segments, - &cm->gref_head) != 0) { - xb_free_command(cm); - mtx_unlock(&sc->xb_io_lock); - device_printf(sc->xb_dev, "no more grant allocs?\n"); + if (gnttab_alloc_grant_references(sc->xbd_max_request_segments, + &cm->cm_gref_head) != 0) { + xbd_free_command(cm); + mtx_unlock(&sc->xbd_io_lock); + device_printf(sc->xbd_dev, "no more grant allocs?\n"); return (EBUSY); } - chunk = length > sc->max_request_size - ? sc->max_request_size : length; - cm->data = virtual; - cm->datalen = chunk; - cm->operation = BLKIF_OP_WRITE; - cm->sector_number = offset / dp->d_sectorsize; - cm->cm_complete = xb_dump_complete; + chunk = length > sc->xbd_max_request_size ? + sc->xbd_max_request_size : length; + cm->cm_data = virtual; + cm->cm_datalen = chunk; + cm->cm_operation = BLKIF_OP_WRITE; + cm->cm_sector_number = offset / dp->d_sectorsize; + cm->cm_complete = xbd_dump_complete; - xb_enqueue_ready(cm); + xbd_enqueue_ready(cm); length -= chunk; offset += chunk; @@ -375,21 +376,21 @@ xb_dump(void *arg, void *virtual, vm_off } /* Tell DOM0 to do the I/O */ - xb_startio(sc); - mtx_unlock(&sc->xb_io_lock); + xbd_startio(sc); + mtx_unlock(&sc->xbd_io_lock); /* Poll for the completion. */ - xb_quiesce(sc); /* All quite on the eastern front */ + xbd_quiesce(sc); /* All quite on the eastern front */ /* If there were any errors, bail out... */ - while ((cm = xb_dequeue_complete(sc)) != NULL) { - if (cm->status != BLKIF_RSP_OKAY) { - device_printf(sc->xb_dev, + while ((cm = xbd_dequeue_complete(sc)) != NULL) { + if (cm->cm_status != BLKIF_RSP_OKAY) { + device_printf(sc->xbd_dev, "Dump I/O failed at sector %jd\n", - cm->sector_number); + cm->cm_sector_number); rc = EIO; } - xb_free_command(cm); + xbd_free_command(cm); } return (rc); @@ -397,7 +398,7 @@ xb_dump(void *arg, void *virtual, vm_off static int -blkfront_probe(device_t dev) +xbd_probe(device_t dev) { if (!strcmp(xenbus_get_type(dev), "vbd")) { @@ -410,37 +411,35 @@ blkfront_probe(device_t dev) } static void -xb_setup_sysctl(struct xb_softc *xb) +xbd_setup_sysctl(struct xbd_softc *xbd) { struct sysctl_ctx_list *sysctl_ctx = NULL; - struct sysctl_oid *sysctl_tree = NULL; + struct sysctl_oid *sysctl_tree = NULL; - sysctl_ctx = device_get_sysctl_ctx(xb->xb_dev); + sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); if (sysctl_ctx == NULL) return; - sysctl_tree = device_get_sysctl_tree(xb->xb_dev); + sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); if (sysctl_tree == NULL) return; SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_requests", CTLFLAG_RD, &xb->max_requests, -1, - "maximum outstanding requests (negotiated)"); + "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, + "maximum outstanding requests (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_segments", CTLFLAG_RD, - &xb->max_request_segments, 0, - "maximum number of pages per requests (negotiated)"); + "max_request_segments", CTLFLAG_RD, + &xbd->xbd_max_request_segments, 0, + "maximum number of pages per requests (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_size", CTLFLAG_RD, - &xb->max_request_size, 0, - "maximum size in bytes of a request (negotiated)"); + "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "ring_pages", CTLFLAG_RD, - &xb->ring_pages, 0, - "communication channel pages (negotiated)"); + "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, + "communication channel pages (negotiated)"); } /* @@ -449,9 +448,9 @@ xb_setup_sysctl(struct xb_softc *xb) * ok. */ static int -blkfront_attach(device_t dev) +xbd_attach(device_t dev) { - struct xb_softc *sc; + struct xbd_softc *sc; const char *name; uint32_t vdevice; int error; @@ -467,25 +466,25 @@ blkfront_attach(device_t dev) return (error); } - blkfront_vdevice_to_unit(vdevice, &unit, &name); + xbd_vdevice_to_unit(vdevice, &unit, &name); if (!strcmp(name, "xbd")) device_set_unit(dev, unit); sc = device_get_softc(dev); - mtx_init(&sc->xb_io_lock, "blkfront i/o lock", NULL, MTX_DEF); - xb_initq_free(sc); - xb_initq_busy(sc); - xb_initq_ready(sc); - xb_initq_complete(sc); - xb_initq_bio(sc); - for (i = 0; i < XBF_MAX_RING_PAGES; i++) - sc->ring_ref[i] = GRANT_INVALID_REF; - - sc->xb_dev = dev; - sc->vdevice = vdevice; - sc->connected = BLKIF_STATE_DISCONNECTED; + mtx_init(&sc->xbd_io_lock, "blkfront i/o lock", NULL, MTX_DEF); + xbd_initq_free(sc); + xbd_initq_busy(sc); + xbd_initq_ready(sc); + xbd_initq_complete(sc); + xbd_initq_bio(sc); + for (i = 0; i < XBD_MAX_RING_PAGES; i++) + sc->xbd_ring_ref[i] = GRANT_INVALID_REF; + + sc->xbd_dev = dev; + sc->xbd_vdevice = vdevice; + sc->xbd_connected = XBD_STATE_DISCONNECTED; - xb_setup_sysctl(sc); + xbd_setup_sysctl(sc); /* Wait for backend device to publish its protocol capabilities. */ xenbus_set_state(dev, XenbusStateInitialising); @@ -494,48 +493,48 @@ blkfront_attach(device_t dev) } static int -blkfront_suspend(device_t dev) +xbd_suspend(device_t dev) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); int retval; int saved_state; /* Prevent new requests being issued until we fix things up. */ - mtx_lock(&sc->xb_io_lock); - saved_state = sc->connected; - sc->connected = BLKIF_STATE_SUSPENDED; + mtx_lock(&sc->xbd_io_lock); + saved_state = sc->xbd_connected; + sc->xbd_connected = XBD_STATE_SUSPENDED; /* Wait for outstanding I/O to drain. */ retval = 0; - while (TAILQ_EMPTY(&sc->cm_busy) == 0) { - if (msleep(&sc->cm_busy, &sc->xb_io_lock, - PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { + while (TAILQ_EMPTY(&sc->xbd_cm_busy) == 0) { + if (msleep(&sc->xbd_cm_busy, &sc->xbd_io_lock, + PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { retval = EBUSY; break; } } - mtx_unlock(&sc->xb_io_lock); + mtx_unlock(&sc->xbd_io_lock); if (retval != 0) - sc->connected = saved_state; + sc->xbd_connected = saved_state; return (retval); } static int -blkfront_resume(device_t dev) +xbd_resume(device_t dev) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); - DPRINTK("blkfront_resume: %s\n", xenbus_get_node(dev)); + DPRINTK("xbd_resume: %s\n", xenbus_get_node(dev)); - blkif_free(sc); - blkfront_initialize(sc); + xbd_free(sc); + xbd_initialize(sc); return (0); } static void -blkfront_initialize(struct xb_softc *sc) +xbd_initialize(struct xbd_softc *sc) { const char *otherend_path; const char *node_path; @@ -543,7 +542,7 @@ blkfront_initialize(struct xb_softc *sc) int error; int i; - if (xenbus_get_state(sc->xb_dev) != XenbusStateInitialising) { + if (xenbus_get_state(sc->xbd_dev) != XenbusStateInitialising) { /* Initialization has already been performed. */ return; } @@ -553,10 +552,12 @@ blkfront_initialize(struct xb_softc *sc) * setting fails. */ max_ring_page_order = 0; - sc->ring_pages = 1; - sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->max_request_size = XBF_SEGS_TO_SIZE(sc->max_request_segments); - sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); + sc->xbd_ring_pages = 1; + sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; + sc->xbd_max_request_size = + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); + sc->xbd_max_request_blocks = + BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); /* * Protocol negotiation. @@ -569,266 +570,279 @@ blkfront_initialize(struct xb_softc *sc) * \note xs_scanf() does not update variables for unmatched * fields. */ - otherend_path = xenbus_get_otherend_path(sc->xb_dev); - node_path = xenbus_get_node(sc->xb_dev); + otherend_path = xenbus_get_otherend_path(sc->xbd_dev); + node_path = xenbus_get_node(sc->xbd_dev); /* Support both backend schemes for relaying ring page limits. */ (void)xs_scanf(XST_NIL, otherend_path, - "max-ring-page-order", NULL, "%" PRIu32, - &max_ring_page_order); - sc->ring_pages = 1 << max_ring_page_order; + "max-ring-page-order", NULL, "%" PRIu32, + &max_ring_page_order); + sc->xbd_ring_pages = 1 << max_ring_page_order; (void)xs_scanf(XST_NIL, otherend_path, - "max-ring-pages", NULL, "%" PRIu32, - &sc->ring_pages); - if (sc->ring_pages < 1) - sc->ring_pages = 1; + "max-ring-pages", NULL, "%" PRIu32, + &sc->xbd_ring_pages); + if (sc->xbd_ring_pages < 1) + sc->xbd_ring_pages = 1; - sc->max_requests = BLKIF_MAX_RING_REQUESTS(sc->ring_pages * PAGE_SIZE); + sc->xbd_max_requests = + BLKIF_MAX_RING_REQUESTS(sc->xbd_ring_pages * PAGE_SIZE); (void)xs_scanf(XST_NIL, otherend_path, - "max-requests", NULL, "%" PRIu32, - &sc->max_requests); + "max-requests", NULL, "%" PRIu32, + &sc->xbd_max_requests); (void)xs_scanf(XST_NIL, otherend_path, - "max-request-segments", NULL, "%" PRIu32, - &sc->max_request_segments); + "max-request-segments", NULL, "%" PRIu32, + &sc->xbd_max_request_segments); (void)xs_scanf(XST_NIL, otherend_path, - "max-request-size", NULL, "%" PRIu32, - &sc->max_request_size); + "max-request-size", NULL, "%" PRIu32, + &sc->xbd_max_request_size); - if (sc->ring_pages > XBF_MAX_RING_PAGES) { - device_printf(sc->xb_dev, "Back-end specified ring-pages of " - "%u limited to front-end limit of %zu.\n", - sc->ring_pages, XBF_MAX_RING_PAGES); - sc->ring_pages = XBF_MAX_RING_PAGES; + if (sc->xbd_ring_pages > XBD_MAX_RING_PAGES) { + device_printf(sc->xbd_dev, + "Back-end specified ring-pages of %u " + "limited to front-end limit of %zu.\n", + sc->xbd_ring_pages, XBD_MAX_RING_PAGES); + sc->xbd_ring_pages = XBD_MAX_RING_PAGES; } - if (powerof2(sc->ring_pages) == 0) { + if (powerof2(sc->xbd_ring_pages) == 0) { uint32_t new_page_limit; - new_page_limit = 0x01 << (fls(sc->ring_pages) - 1); - device_printf(sc->xb_dev, "Back-end specified ring-pages of " - "%u is not a power of 2. Limited to %u.\n", - sc->ring_pages, new_page_limit); - sc->ring_pages = new_page_limit; - } - - if (sc->max_requests > XBF_MAX_REQUESTS) { - device_printf(sc->xb_dev, "Back-end specified max_requests of " - "%u limited to front-end limit of %u.\n", - sc->max_requests, XBF_MAX_REQUESTS); - sc->max_requests = XBF_MAX_REQUESTS; - } - - if (sc->max_request_segments > XBF_MAX_SEGMENTS_PER_REQUEST) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_segments of %u limited to " - "front-end limit of %u.\n", - sc->max_request_segments, - XBF_MAX_SEGMENTS_PER_REQUEST); - sc->max_request_segments = XBF_MAX_SEGMENTS_PER_REQUEST; - } - - if (sc->max_request_size > XBF_MAX_REQUEST_SIZE) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_size of %u limited to front-end " - "limit of %u.\n", sc->max_request_size, - XBF_MAX_REQUEST_SIZE); - sc->max_request_size = XBF_MAX_REQUEST_SIZE; + new_page_limit = 0x01 << (fls(sc->xbd_ring_pages) - 1); + device_printf(sc->xbd_dev, + "Back-end specified ring-pages of %u " + "is not a power of 2. Limited to %u.\n", + sc->xbd_ring_pages, new_page_limit); + sc->xbd_ring_pages = new_page_limit; + } + + if (sc->xbd_max_requests > XBD_MAX_REQUESTS) { + device_printf(sc->xbd_dev, + "Back-end specified max_requests of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_requests, XBD_MAX_REQUESTS); + sc->xbd_max_requests = XBD_MAX_REQUESTS; + } + + if (sc->xbd_max_request_segments > XBD_MAX_SEGMENTS_PER_REQUEST) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_segments of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_request_segments, + XBD_MAX_SEGMENTS_PER_REQUEST); + sc->xbd_max_request_segments = XBD_MAX_SEGMENTS_PER_REQUEST; + } + + if (sc->xbd_max_request_size > XBD_MAX_REQUEST_SIZE) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_size of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_request_size, + XBD_MAX_REQUEST_SIZE); + sc->xbd_max_request_size = XBD_MAX_REQUEST_SIZE; } - if (sc->max_request_size > XBF_SEGS_TO_SIZE(sc->max_request_segments)) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_size of %u limited to front-end " - "limit of %u. (Too few segments.)\n", - sc->max_request_size, - XBF_SEGS_TO_SIZE(sc->max_request_segments)); - sc->max_request_size = - XBF_SEGS_TO_SIZE(sc->max_request_segments); + if (sc->xbd_max_request_size > + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments)) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_size of %u " + "limited to front-end limit of %u. (Too few segments.)\n", + sc->xbd_max_request_size, + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments)); + sc->xbd_max_request_size = + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); } - sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); + sc->xbd_max_request_blocks = + BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); /* Allocate datastructures based on negotiated values. */ - error = bus_dma_tag_create(bus_get_dma_tag(sc->xb_dev), /* parent */ - 512, PAGE_SIZE, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sc->max_request_size, - sc->max_request_segments, - PAGE_SIZE, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &sc->xb_io_lock, /* lockarg */ - &sc->xb_io_dmat); + error = bus_dma_tag_create( + bus_get_dma_tag(sc->xbd_dev), /* parent */ + 512, PAGE_SIZE, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sc->xbd_max_request_size, + sc->xbd_max_request_segments, + PAGE_SIZE, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->xbd_io_lock, /* lockarg */ + &sc->xbd_io_dmat); if (error != 0) { - xenbus_dev_fatal(sc->xb_dev, error, - "Cannot allocate parent DMA tag\n"); + xenbus_dev_fatal(sc->xbd_dev, error, + "Cannot allocate parent DMA tag\n"); return; } /* Per-transaction data allocation. */ - sc->shadow = malloc(sizeof(*sc->shadow) * sc->max_requests, - M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); - if (sc->shadow == NULL) { - bus_dma_tag_destroy(sc->xb_io_dmat); - xenbus_dev_fatal(sc->xb_dev, error, - "Cannot allocate request structures\n"); + sc->xbd_shadow = malloc(sizeof(*sc->xbd_shadow) * sc->xbd_max_requests, + M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); + if (sc->xbd_shadow == NULL) { + bus_dma_tag_destroy(sc->xbd_io_dmat); + xenbus_dev_fatal(sc->xbd_dev, error, + "Cannot allocate request structures\n"); return; } - for (i = 0; i < sc->max_requests; i++) { - struct xb_command *cm; + for (i = 0; i < sc->xbd_max_requests; i++) { + struct xbd_command *cm; - cm = &sc->shadow[i]; - cm->sg_refs = malloc(sizeof(grant_ref_t) - * sc->max_request_segments, - M_XENBLOCKFRONT, M_NOWAIT); - if (cm->sg_refs == NULL) + cm = &sc->xbd_shadow[i]; + cm->cm_sg_refs = malloc( + sizeof(grant_ref_t) * sc->xbd_max_request_segments, + M_XENBLOCKFRONT, M_NOWAIT); + if (cm->cm_sg_refs == NULL) break; - cm->id = i; + cm->cm_id = i; cm->cm_sc = sc; - if (bus_dmamap_create(sc->xb_io_dmat, 0, &cm->map) != 0) + if (bus_dmamap_create(sc->xbd_io_dmat, 0, &cm->cm_map) != 0) break; - xb_free_command(cm); + xbd_free_command(cm); } - if (setup_blkring(sc) != 0) + if (xbd_setup_ring(sc) != 0) return; /* Support both backend schemes for relaying ring page limits. */ - if (sc->ring_pages > 1) { + if (sc->xbd_ring_pages > 1) { error = xs_printf(XST_NIL, node_path, - "num-ring-pages","%u", sc->ring_pages); + "num-ring-pages","%u", + sc->xbd_ring_pages); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/num-ring-pages", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/num-ring-pages", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "ring-page-order", "%u", - fls(sc->ring_pages) - 1); + "ring-page-order", "%u", + fls(sc->xbd_ring_pages) - 1); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-page-order", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-page-order", + node_path); return; } } error = xs_printf(XST_NIL, node_path, - "max-requests","%u", sc->max_requests); + "max-requests","%u", + sc->xbd_max_requests); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-requests", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-requests", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "max-request-segments","%u", sc->max_request_segments); + "max-request-segments","%u", + sc->xbd_max_request_segments); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-request-segments", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-request-segments", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "max-request-size","%u", sc->max_request_size); + "max-request-size","%u", + sc->xbd_max_request_size); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-request-size", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-request-size", + node_path); return; } error = xs_printf(XST_NIL, node_path, "event-channel", - "%u", irq_to_evtchn_port(sc->irq)); + "%u", irq_to_evtchn_port(sc->xbd_irq)); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/event-channel", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/event-channel", + node_path); return; } - error = xs_printf(XST_NIL, node_path, - "protocol", "%s", XEN_IO_PROTO_ABI_NATIVE); + error = xs_printf(XST_NIL, node_path, "protocol", + "%s", XEN_IO_PROTO_ABI_NATIVE); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/protocol", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/protocol", + node_path); return; } - xenbus_set_state(sc->xb_dev, XenbusStateInitialised); + xenbus_set_state(sc->xbd_dev, XenbusStateInitialised); } static int -setup_blkring(struct xb_softc *sc) +xbd_setup_ring(struct xbd_softc *sc) { blkif_sring_t *sring; uintptr_t sring_page_addr; int error; int i; - sring = malloc(sc->ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, - M_NOWAIT|M_ZERO); + sring = malloc(sc->xbd_ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, + M_NOWAIT|M_ZERO); if (sring == NULL) { - xenbus_dev_fatal(sc->xb_dev, ENOMEM, "allocating shared ring"); + xenbus_dev_fatal(sc->xbd_dev, ENOMEM, "allocating shared ring"); return (ENOMEM); } SHARED_RING_INIT(sring); - FRONT_RING_INIT(&sc->ring, sring, sc->ring_pages * PAGE_SIZE); + FRONT_RING_INIT(&sc->xbd_ring, sring, sc->xbd_ring_pages * PAGE_SIZE); for (i = 0, sring_page_addr = (uintptr_t)sring; - i < sc->ring_pages; + i < sc->xbd_ring_pages; i++, sring_page_addr += PAGE_SIZE) { - error = xenbus_grant_ring(sc->xb_dev, - (vtomach(sring_page_addr) >> PAGE_SHIFT), &sc->ring_ref[i]); + error = xenbus_grant_ring(sc->xbd_dev, + (vtomach(sring_page_addr) >> PAGE_SHIFT), + &sc->xbd_ring_ref[i]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "granting ring_ref(%d)", i); + xenbus_dev_fatal(sc->xbd_dev, error, + "granting ring_ref(%d)", i); return (error); } } - if (sc->ring_pages == 1) { - error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - "ring-ref", "%u", sc->ring_ref[0]); + if (sc->xbd_ring_pages == 1) { + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + "ring-ref", "%u", sc->xbd_ring_ref[0]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-ref", - xenbus_get_node(sc->xb_dev)); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-ref", + xenbus_get_node(sc->xbd_dev)); return (error); } } else { - for (i = 0; i < sc->ring_pages; i++) { + for (i = 0; i < sc->xbd_ring_pages; i++) { char ring_ref_name[]= "ring_refXX"; snprintf(ring_ref_name, sizeof(ring_ref_name), - "ring-ref%u", i); - error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - ring_ref_name, "%u", sc->ring_ref[i]); + "ring-ref%u", i); + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + ring_ref_name, "%u", sc->xbd_ring_ref[i]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/%s", - xenbus_get_node(sc->xb_dev), - ring_ref_name); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/%s", + xenbus_get_node(sc->xbd_dev), + ring_ref_name); return (error); } } } error = bind_listening_port_to_irqhandler( - xenbus_get_otherend_id(sc->xb_dev), - "xbd", (driver_intr_t *)blkif_int, sc, - INTR_TYPE_BIO | INTR_MPSAFE, &sc->irq); + xenbus_get_otherend_id(sc->xbd_dev), + "xbd", (driver_intr_t *)xbd_int, sc, + INTR_TYPE_BIO | INTR_MPSAFE, &sc->xbd_irq); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, + xenbus_dev_fatal(sc->xbd_dev, error, "bind_evtchn_to_irqhandler failed"); return (error); } @@ -840,9 +854,9 @@ setup_blkring(struct xb_softc *sc) * Callback received when the backend's state changes. */ static void -blkfront_backend_changed(device_t dev, XenbusState backend_state) +xbd_backend_changed(device_t dev, XenbusState backend_state) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); DPRINTK("backend_state=%d\n", backend_state); @@ -856,47 +870,47 @@ blkfront_backend_changed(device_t dev, X *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 31 21:25:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A100FC4E; Fri, 31 May 2013 21:25:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91D5BDB0; Fri, 31 May 2013 21:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLPpng071506; Fri, 31 May 2013 21:25:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLPppF071505; Fri, 31 May 2013 21:25:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312125.r4VLPppF071505@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 21:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251196 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 21:25:51 -0000 Author: jilles Date: Fri May 31 21:25:51 2013 New Revision: 251196 URL: http://svnweb.freebsd.org/changeset/base/251196 Log: sigaction(2): Extend description of async-signal safe functions: * Improve description when unsafe functions are unsafe. * Add various safe functions from POSIX.1-2008 and Austin Group issue #692. Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Fri May 31 21:05:07 2013 (r251195) +++ head/lib/libc/sys/sigaction.2 Fri May 31 21:25:51 2013 (r251196) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd September 27, 2012 +.Dd May 31, 2013 .Dt SIGACTION 2 .Os .Sh NAME @@ -346,13 +346,19 @@ Any attempt to do so will be silently ig The following functions are either reentrant or not interruptible by signals and are async-signal safe. Therefore applications may -invoke them, without restriction, from signal-catching functions: +invoke them, without restriction, from signal-catching functions +or from a child process after calling +.Xr fork 2 +in a multi-threaded process: .Pp Base Interfaces: .Pp +.Fn _Exit , .Fn _exit , +.Fn accept , .Fn access , .Fn alarm , +.Fn bind , .Fn cfgetispeed , .Fn cfgetospeed , .Fn cfsetispeed , @@ -361,41 +367,65 @@ Base Interfaces: .Fn chmod , .Fn chown , .Fn close , +.Fn connect , .Fn creat , .Fn dup , .Fn dup2 , +.Fn execl , .Fn execle , +.Fn execv , .Fn execve , +.Fn fchdir , +.Fn fchmod , +.Fn fchown , .Fn fcntl , .Fn fork , -.Fn fpathconf , .Fn fstat , .Fn fsync , +.Fn ftruncate , .Fn getegid , .Fn geteuid , .Fn getgid , .Fn getgroups , +.Fn getpeername , .Fn getpgrp , .Fn getpid , .Fn getppid , +.Fn getsockname , +.Fn getsockopt , .Fn getuid , .Fn kill , .Fn link , +.Fn listen , .Fn lseek , +.Fn lstat , .Fn mkdir , .Fn mkfifo , +.Fn mknod , .Fn open , -.Fn pathconf , .Fn pause , .Fn pipe , +.Fn poll , +.Fn pselect , +.Fn pthread_sigmask , .Fn raise , .Fn read , +.Fn readlink , +.Fn recv , +.Fn recvfrom , +.Fn recvmsg , .Fn rename , .Fn rmdir , +.Fn select , +.Fn send , +.Fn sendmsg , +.Fn sendto , .Fn setgid , .Fn setpgid , .Fn setsid , +.Fn setsockopt , .Fn setuid , +.Fn shutdown , .Fn sigaction , .Fn sigaddset , .Fn sigdelset , @@ -407,8 +437,11 @@ Base Interfaces: .Fn sigprocmask , .Fn sigsuspend , .Fn sleep , +.Fn sockatmark , +.Fn socket , +.Fn socketpair , .Fn stat , -.Fn sysconf , +.Fn symlink , .Fn tcdrain , .Fn tcflow , .Fn tcflush , @@ -427,11 +460,16 @@ Base Interfaces: .Fn waitpid , .Fn write . .Pp +X/Open Systems Interfaces: +.Pp +.Fn sigpause , +.Fn sigset , +.Fn utimes . +.Pp Realtime Interfaces: .Pp .Fn aio_error , .Fn clock_gettime , -.Fn sigpause , .Fn timer_getoverrun , .Fn aio_return , .Fn fdatasync , @@ -439,27 +477,84 @@ Realtime Interfaces: .Fn timer_gettime , .Fn aio_suspend , .Fn sem_post , -.Fn sigset , .Fn timer_settime . .Pp -.Tn ANSI C -Interfaces: +Base Interfaces not specified as async-signal safe by +.Tn POSIX : .Pp -.Fn strcpy , +.Fn fpathconf , +.Fn pathconf , +.Fn sysconf . +.Pp +Base Interfaces not specified as async-signal safe by +.Tn POSIX , +but planned to be: +.Pp +.Fn ffs , +.Fn htonl , +.Fn htons , +.Fn memccpy , +.Fn memchr , +.Fn memcmp , +.Fn memcpy , +.Fn memmove , +.Fn memset , +.Fn ntohl , +.Fn ntohs , +.Fn stpcpy , +.Fn stpncpy , .Fn strcat , -.Fn strncpy , +.Fn strchr , +.Fn strcmp , +.Fn strcpy , +.Fn strcspn , +.Fn strlen , .Fn strncat , -and perhaps some others. +.Fn strncmp , +.Fn strncpy , +.Fn strnlen , +.Fn strpbrk , +.Fn strrchr , +.Fn strspn , +.Fn strstr , +.Fn strtok_r , +.Fn wcpcpy , +.Fn wcpncpy , +.Fn wcscat , +.Fn wcschr , +.Fn wcscmp , +.Fn wcscpy , +.Fn wcscspn , +.Fn wcslen , +.Fn wcsncat , +.Fn wcsncmp , +.Fn wcsncpy , +.Fn wcsnlen , +.Fn wcspbrk , +.Fn wcsrchr , +.Fn wcsspn , +.Fn wcsstr , +.Fn wcstok , +.Fn wmemchr , +.Fn wmemcmp , +.Fn wmemcpy , +.Fn wmemmove , +.Fn wmemset . .Pp Extension Interfaces: .Pp .Fn strlcpy , .Fn strlcat . .Pp +In addition, reading or writing +.Va errno +is async-signal safe. +.Pp All functions not in the above lists are considered to be unsafe with respect to signals. That is to say, the behaviour of such -functions when called from a signal handler is undefined. +functions is undefined when they are called from a signal handler +that interrupted an unsafe function. In general though, signal handlers should do little more than set a flag; most other actions are not safe. .Pp From owner-svn-src-all@FreeBSD.ORG Fri May 31 21:31:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CABD6EC8; Fri, 31 May 2013 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB30ADF0; Fri, 31 May 2013 21:31:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLVcqr074133; Fri, 31 May 2013 21:31:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLVcd5074132; Fri, 31 May 2013 21:31:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312131.r4VLVcd5074132@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 21:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251197 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 21:31:38 -0000 Author: jilles Date: Fri May 31 21:31:38 2013 New Revision: 251197 URL: http://svnweb.freebsd.org/changeset/base/251197 Log: sigaction(2): *at system calls are async-signal safe. Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Fri May 31 21:25:51 2013 (r251196) +++ head/lib/libc/sys/sigaction.2 Fri May 31 21:31:38 2013 (r251197) @@ -375,12 +375,16 @@ Base Interfaces: .Fn execle , .Fn execv , .Fn execve , +.Fn faccessat , .Fn fchdir , .Fn fchmod , +.Fn fchmodat , .Fn fchown , +.Fn fchownat , .Fn fcntl , .Fn fork , .Fn fstat , +.Fn fstatat , .Fn fsync , .Fn ftruncate , .Fn getegid , @@ -396,13 +400,18 @@ Base Interfaces: .Fn getuid , .Fn kill , .Fn link , +.Fn linkat , .Fn listen , .Fn lseek , .Fn lstat , .Fn mkdir , +.Fn mkdirat , .Fn mkfifo , +.Fn mkfifoat , .Fn mknod , +.Fn mknodat , .Fn open , +.Fn openat , .Fn pause , .Fn pipe , .Fn poll , @@ -411,10 +420,12 @@ Base Interfaces: .Fn raise , .Fn read , .Fn readlink , +.Fn readlinkat , .Fn recv , .Fn recvfrom , .Fn recvmsg , .Fn rename , +.Fn renameat , .Fn rmdir , .Fn select , .Fn send , @@ -442,6 +453,7 @@ Base Interfaces: .Fn socketpair , .Fn stat , .Fn symlink , +.Fn symlinkat , .Fn tcdrain , .Fn tcflow , .Fn tcflush , @@ -455,6 +467,7 @@ Base Interfaces: .Fn umask , .Fn uname , .Fn unlink , +.Fn unlinkat , .Fn utime , .Fn wait , .Fn waitpid , @@ -543,6 +556,7 @@ but planned to be: .Pp Extension Interfaces: .Pp +.Fn futimesat , .Fn strlcpy , .Fn strlcat . .Pp From owner-svn-src-all@FreeBSD.ORG Fri May 31 21:43:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C05C23F; Fri, 31 May 2013 21:43:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CECAE32; Fri, 31 May 2013 21:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLhIfu077973; Fri, 31 May 2013 21:43:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLhIAr077972; Fri, 31 May 2013 21:43:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305312143.r4VLhIAr077972@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 21:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251198 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 21:43:18 -0000 Author: obrien Date: Fri May 31 21:43:17 2013 New Revision: 251198 URL: http://svnweb.freebsd.org/changeset/base/251198 Log: Add a "kern.features" MIB for 32bit support under a 64bit kernel. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri May 31 21:31:38 2013 (r251197) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri May 31 21:43:17 2013 (r251198) @@ -104,6 +104,8 @@ __FBSDID("$FreeBSD$"); #include #include +FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD"); + #ifndef __mips__ CTASSERT(sizeof(struct timeval32) == 8); CTASSERT(sizeof(struct timespec32) == 8); From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:08:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B422A1F for ; Fri, 31 May 2013 22:08:55 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm31-vm1.bullet.mail.ne1.yahoo.com (nm31-vm1.bullet.mail.ne1.yahoo.com [98.138.229.41]) by mx1.freebsd.org (Postfix) with ESMTP id EA316EF1 for ; Fri, 31 May 2013 22:08:54 +0000 (UTC) Received: from [98.138.226.177] by nm31.bullet.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 Received: from [98.138.226.125] by tm12.bullet.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 Received: from [127.0.0.1] by smtp204.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1370037740; bh=HU2qbs4ZeyXJx6l5Ppa9YKmcPZoWBLxR5ptr8SL2nNo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=i9eDkEfEZAGn/TahldlxF0et/KM+fspOKupgyrxx44o+XTeezFzR8CtnsCaABLBfcGXqbCB6DShjOZwRjnMHwuLhd9x41iiGMt4hT1eDmxk1x8vuaQYBwUV2syox6rJwkT4+dWhfCDj4nLMYi6Fatz1SGL9B4NzRlqrSf7e3/lc= X-Yahoo-Newman-Id: 631479.59786.bm@smtp204.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: cX7SEhEVM1nhOtYc3o6DF40GFTAOs8Ir1KmqeTdextPR_qe 0.Jh..fI91m_4qC8nTFzWFMLvmgkNM4JUH4oSxPWP1NNtHbnVyZOckN6.aKi I_QwysycXn0QlPbyG1MfnC7WijcZvyommsIIOOS.tretuJ52dqijUHkHKXyl JgBSGwLOHAup6ZnGM5x55Nj2lD7mQdHui4VoMt0c8ZCQgWT1_UfkhtxUiZmy _qkkjit_axsFMSPtJY5Tp._dBtw6eLdd4vn1Fk_X9dGhcJvXR.5MA2B3EoRS 7KffO1FyYmEGRe8nd7DTpI8BKbFHtrzNg3K92Ggnje_BouQt5UOoGW_JqfE. LYhkJ7m2byg.WECXQx5kQW.6nX0GqsBuMU0cF1gfncTAIy469uAw4Nd1SVWU BWVtEP8ZFZJnSDGSt.Z23gpfS653mO0TdRuo2Z4GCsnvPQEZ1evYLmk4yhfm t5yWRo9kAHWqlE_la1jzJG4HXHcI9L1yDzwDdc.1wWlr2b.aGxz1iK70bXZb D X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from [192.168.254.206] (scott4long@168.103.85.57 with ) by smtp204.mail.ne1.yahoo.com with SMTP; 31 May 2013 15:02:20 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r251182 - stable/9/sys/dev/aha From: Scott Long In-Reply-To: <201305311519.r4VFJ1hq042269@svn.freebsd.org> Date: Fri, 31 May 2013 16:02:18 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305311519.r4VFJ1hq042269@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1503) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:08:55 -0000 Thanks! Scott On May 31, 2013, at 9:19 AM, John Baldwin wrote: > Author: jhb > Date: Fri May 31 15:19:00 2013 > New Revision: 251182 > URL: http://svnweb.freebsd.org/changeset/base/251182 >=20 > Log: > MFC 241611: > Fix aha(4) build with i386 LINT (which includes 'device mca'). >=20 > Modified: > stable/9/sys/dev/aha/aha_mca.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) >=20 > Modified: stable/9/sys/dev/aha/aha_mca.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/dev/aha/aha_mca.c Fri May 31 14:48:37 2013 = (r251181) > +++ stable/9/sys/dev/aha/aha_mca.c Fri May 31 15:19:00 2013 = (r251182) > @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > #include > #include > @@ -191,7 +192,7 @@ aha_mca_attach (device_t dev) > } >=20 > error =3D bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | = INTR_ENTROPY | > - INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); > + INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih); > if (error) { > device_printf(dev, "Unable to register interrupt = handler\n"); > aha_detach(sc); From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:09:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7282BB9A; Fri, 31 May 2013 22:09:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63824EFF; Fri, 31 May 2013 22:09:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VM9W8M086297; Fri, 31 May 2013 22:09:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VM9WJ7086296; Fri, 31 May 2013 22:09:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312209.r4VM9WJ7086296@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251203 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:09:32 -0000 Author: jilles Date: Fri May 31 22:09:31 2013 New Revision: 251203 URL: http://svnweb.freebsd.org/changeset/base/251203 Log: dup(2): Clarify return value, in particular of dup2(). Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Fri May 31 22:08:25 2013 (r251202) +++ head/lib/libc/sys/dup.2 Fri May 31 22:09:31 2013 (r251203) @@ -28,7 +28,7 @@ .\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd June 1, 2013 .Dt DUP 2 .Os .Sh NAME @@ -113,10 +113,11 @@ is a valid descriptor, then .Fn dup2 is successful, and does nothing. .Sh RETURN VALUES -The value -1 is returned if an error occurs in either call. -The external variable +These calls return the new file descriptor if successful; +otherwise the value -1 is returned and +the external variable .Va errno -indicates the cause of the error. +is set to indicate the cause of the error. .Sh ERRORS The .Fn dup From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:21:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 58E08EB5; Fri, 31 May 2013 22:21:38 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AB91F42; Fri, 31 May 2013 22:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMLcn4091944; Fri, 31 May 2013 22:21:38 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMLcwv091943; Fri, 31 May 2013 22:21:38 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312221.r4VMLcwv091943@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 22:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251204 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:21:38 -0000 Author: gibbs Date: Fri May 31 22:21:37 2013 New Revision: 251204 URL: http://svnweb.freebsd.org/changeset/base/251204 Log: Style cleanups. No intended functional changes. o Group functions by by their functionality. o Remove superfluous declarations. o Remove more unused (#ifdef'd out) code. Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:09:31 2013 (r251203) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:21:37 2013 (r251204) @@ -70,20 +70,22 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -/* prototypes */ -static void xbd_free_command(struct xbd_command *cm); -static void xbd_startio(struct xbd_softc *sc); -static void xbd_connect(struct xbd_softc *); +/*--------------------------- Forward Declarations ---------------------------*/ static void xbd_closing(device_t); -static int xbd_detach(device_t); -static int xbd_setup_ring(struct xbd_softc *); -static void xbd_int(void *); -static void xbd_initialize(struct xbd_softc *); -static int xbd_completion(struct xbd_command *); -static void xbd_free(struct xbd_softc *); -static void xbd_queue_cb(void *, bus_dma_segment_t *, int, int); +static void xbd_startio(struct xbd_softc *sc); -static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); +/*---------------------------------- Macros ----------------------------------*/ +#if 0 +#define DPRINTK(fmt, args...) printf("[XEN] %s:%d: " fmt ".\n", __func__, __LINE__, ##args) +#else +#define DPRINTK(fmt, args...) +#endif + +/* XXX move to xbd_vbd.c when VBD update support is added */ +#define MAX_VBDS 64 + +#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ +#define XBD_SECTOR_SHFT 9 #define GRANT_INVALID_REF 0 @@ -98,199 +100,361 @@ static void vbd_update(void); #define XBD_STATE_CONNECTED 1 #define XBD_STATE_SUSPENDED 2 -#ifdef notyet -static char *xbd_state_name[] = { - [XBD_STATE_DISCONNECTED] = "disconnected", - [XBD_STATE_CONNECTED] = "connected", - [XBD_STATE_SUSPENDED] = "closed", -}; - -static char * xbd_status_name[] = { - [BLKIF_INTERFACE_STATUS_CLOSED] = "closed", - [BLKIF_INTERFACE_STATUS_DISCONNECTED] = "disconnected", - [BLKIF_INTERFACE_STATUS_CONNECTED] = "connected", - [BLKIF_INTERFACE_STATUS_CHANGED] = "changed", -}; -#endif - -#if 0 -#define DPRINTK(fmt, args...) printf("[XEN] %s:%d: " fmt ".\n", __func__, __LINE__, ##args) -#else -#define DPRINTK(fmt, args...) -#endif +/*---------------------------- Global Static Data ----------------------------*/ +static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); -static int xbd_open(struct disk *dp); -static int xbd_close(struct disk *dp); -static int xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); -static int xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm); -static void xbd_strategy(struct bio *bp); - -// In order to quiesce the device during kernel dumps, outstanding requests to -// DOM0 for disk reads/writes need to be accounted for. -static int xbd_dump(void *, void *, vm_offset_t, off_t, size_t); +/*---------------------------- Command Processing ----------------------------*/ +static inline void +flush_requests(struct xbd_softc *sc) +{ + int notify; -/* XXX move to xbd_vbd.c when VBD update support is added */ -#define MAX_VBDS 64 + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->xbd_ring, notify); -#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ -#define XBD_SECTOR_SHFT 9 + if (notify) + notify_remote_via_irq(sc->xbd_irq); +} -/* - * Translate Linux major/minor to an appropriate name and unit - * number. For HVM guests, this allows us to use the same drive names - * with blkfront as the emulated drives, easing transition slightly. - */ static void -xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) +xbd_free_command(struct xbd_command *cm) { - static struct vdev_info { - int major; - int shift; - int base; - const char *name; - } info[] = { - {3, 6, 0, "ada"}, /* ide0 */ - {22, 6, 2, "ada"}, /* ide1 */ - {33, 6, 4, "ada"}, /* ide2 */ - {34, 6, 6, "ada"}, /* ide3 */ - {56, 6, 8, "ada"}, /* ide4 */ - {57, 6, 10, "ada"}, /* ide5 */ - {88, 6, 12, "ada"}, /* ide6 */ - {89, 6, 14, "ada"}, /* ide7 */ - {90, 6, 16, "ada"}, /* ide8 */ - {91, 6, 18, "ada"}, /* ide9 */ - {8, 4, 0, "da"}, /* scsi disk0 */ - {65, 4, 16, "da"}, /* scsi disk1 */ - {66, 4, 32, "da"}, /* scsi disk2 */ - {67, 4, 48, "da"}, /* scsi disk3 */ - {68, 4, 64, "da"}, /* scsi disk4 */ - {69, 4, 80, "da"}, /* scsi disk5 */ - {70, 4, 96, "da"}, /* scsi disk6 */ - {71, 4, 112, "da"}, /* scsi disk7 */ - {128, 4, 128, "da"}, /* scsi disk8 */ - {129, 4, 144, "da"}, /* scsi disk9 */ - {130, 4, 160, "da"}, /* scsi disk10 */ - {131, 4, 176, "da"}, /* scsi disk11 */ - {132, 4, 192, "da"}, /* scsi disk12 */ - {133, 4, 208, "da"}, /* scsi disk13 */ - {134, 4, 224, "da"}, /* scsi disk14 */ - {135, 4, 240, "da"}, /* scsi disk15 */ + KASSERT((cm->cm_flags & XBD_ON_XBDQ_MASK) == 0, + ("Freeing command that is still on a queue\n")); - {202, 4, 0, "xbd"}, /* xbd */ + cm->cm_flags = 0; + cm->cm_bp = NULL; + cm->cm_complete = NULL; + xbd_enqueue_free(cm); +} - {0, 0, 0, NULL}, - }; - int major = vdevice >> 8; - int minor = vdevice & 0xff; - int i; +static void +xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct xbd_softc *sc; + struct xbd_command *cm; + blkif_request_t *ring_req; + struct blkif_request_segment *sg; + struct blkif_request_segment *last_block_sg; + grant_ref_t *sg_ref; + vm_paddr_t buffer_ma; + uint64_t fsect, lsect; + int ref; + int op; + int block_segs; - if (vdevice & (1 << 28)) { - *unit = (vdevice & ((1 << 28) - 1)) >> 8; - *name = "xbd"; + cm = arg; + sc = cm->cm_sc; + + if (error) { + printf("error %d in xbd_queue_cb\n", error); + cm->cm_bp->bio_error = EIO; + biodone(cm->cm_bp); + xbd_free_command(cm); return; } - for (i = 0; info[i].major; i++) { - if (info[i].major == major) { - *unit = info[i].base + (minor >> info[i].shift); - *name = info[i].name; - return; - } - } + /* Fill out a communications ring structure. */ + ring_req = RING_GET_REQUEST(&sc->xbd_ring, sc->xbd_ring.req_prod_pvt); + sc->xbd_ring.req_prod_pvt++; + ring_req->id = cm->cm_id; + ring_req->operation = cm->cm_operation; + ring_req->sector_number = cm->cm_sector_number; + ring_req->handle = (blkif_vdev_t)(uintptr_t)sc->xbd_disk; + ring_req->nr_segments = nsegs; + cm->cm_nseg = nsegs; - *unit = minor >> 4; - *name = "xbd"; -} + block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK); + sg = ring_req->seg; + last_block_sg = sg + block_segs; + sg_ref = cm->cm_sg_refs; -int -xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, - int vdevice, uint16_t vdisk_info, unsigned long sector_size) -{ - int unit, error = 0; - const char *name; + while (1) { - xbd_vdevice_to_unit(vdevice, &unit, &name); + while (sg < last_block_sg) { + buffer_ma = segs->ds_addr; + fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; + lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; - sc->xbd_unit = unit; + KASSERT(lsect <= 7, ("XEN disk driver data cannot " + "cross a page boundary")); - if (strcmp(name, "xbd")) - device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); + /* install a grant reference. */ + ref = gnttab_claim_grant_reference(&cm->cm_gref_head); - sc->xbd_disk = disk_alloc(); - sc->xbd_disk->d_unit = sc->xbd_unit; - sc->xbd_disk->d_open = xbd_open; - sc->xbd_disk->d_close = xbd_close; - sc->xbd_disk->d_ioctl = xbd_ioctl; - sc->xbd_disk->d_strategy = xbd_strategy; - sc->xbd_disk->d_dump = xbd_dump; - sc->xbd_disk->d_name = name; - sc->xbd_disk->d_drv1 = sc; - sc->xbd_disk->d_sectorsize = sector_size; + /* + * GNTTAB_LIST_END == 0xffffffff, but it is private + * to gnttab.c. + */ + KASSERT(ref != ~0, ("grant_reference failed")); - sc->xbd_disk->d_mediasize = sectors * sector_size; - sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = 0; - disk_create(sc->xbd_disk, DISK_VERSION); + gnttab_grant_foreign_access_ref( + ref, + xenbus_get_otherend_id(sc->xbd_dev), + buffer_ma >> PAGE_SHIFT, + ring_req->operation == BLKIF_OP_WRITE); - return error; -} + *sg_ref = ref; + *sg = (struct blkif_request_segment) { + .gref = ref, + .first_sect = fsect, + .last_sect = lsect + }; + sg++; + sg_ref++; + segs++; + nsegs--; + } + block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK); + if (block_segs == 0) + break; -/************************ end VBD support *****************/ + sg = BLKRING_GET_SEG_BLOCK(&sc->xbd_ring, + sc->xbd_ring.req_prod_pvt); + sc->xbd_ring.req_prod_pvt++; + last_block_sg = sg + block_segs; + } -/* - * Read/write routine for a buffer. Finds the proper unit, place it on - * the sortq and kick the controller. - */ -static void -xbd_strategy(struct bio *bp) -{ - struct xbd_softc *sc = bp->bio_disk->d_drv1; + if (cm->cm_operation == BLKIF_OP_READ) + op = BUS_DMASYNC_PREREAD; + else if (cm->cm_operation == BLKIF_OP_WRITE) + op = BUS_DMASYNC_PREWRITE; + else + op = 0; + bus_dmamap_sync(sc->xbd_io_dmat, cm->cm_map, op); - /* bogus disk? */ - if (sc == NULL) { - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - biodone(bp); - return; - } + gnttab_free_grant_references(cm->cm_gref_head); + + xbd_enqueue_busy(cm); /* - * Place it in the queue of disk activities for this disk + * This flag means that we're probably executing in the busdma swi + * instead of in the startio context, so an explicit flush is needed. */ - mtx_lock(&sc->xbd_io_lock); - - xbd_enqueue_bio(sc, bp); - xbd_startio(sc); + if (cm->cm_flags & XBD_CMD_FROZEN) + flush_requests(sc); - mtx_unlock(&sc->xbd_io_lock); return; } -static void -xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) +static int +xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm) { - struct bio *bp; - - bp = cm->cm_bp; + int error; - if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { - disk_err(bp, "disk error" , -1, 0); - printf(" status: %x\n", cm->cm_status); - bp->bio_flags |= BIO_ERROR; + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); + if (error == EINPROGRESS) { + printf("EINPROGRESS\n"); + sc->xbd_flags |= XBD_FROZEN; + cm->cm_flags |= XBD_CMD_FROZEN; + return (0); } - if (bp->bio_flags & BIO_ERROR) - bp->bio_error = EIO; - else + return (error); +} + +static void +xbd_restart_queue_callback(void *arg) +{ + struct xbd_softc *sc = arg; + + mtx_lock(&sc->xbd_io_lock); + + xbd_startio(sc); + + mtx_unlock(&sc->xbd_io_lock); +} + +static struct xbd_command * +xbd_bio_command(struct xbd_softc *sc) +{ + struct xbd_command *cm; + struct bio *bp; + + if (unlikely(sc->xbd_connected != XBD_STATE_CONNECTED)) + return (NULL); + + bp = xbd_dequeue_bio(sc); + if (bp == NULL) + return (NULL); + + if ((cm = xbd_dequeue_free(sc)) == NULL) { + xbd_requeue_bio(sc, bp); + return (NULL); + } + + if (gnttab_alloc_grant_references(sc->xbd_max_request_segments, + &cm->cm_gref_head) != 0) { + gnttab_request_free_callback(&sc->xbd_callback, + xbd_restart_queue_callback, sc, + sc->xbd_max_request_segments); + xbd_requeue_bio(sc, bp); + xbd_enqueue_free(cm); + sc->xbd_flags |= XBD_FROZEN; + return (NULL); + } + + cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; + cm->cm_operation = (bp->bio_cmd == BIO_READ) ? + BLKIF_OP_READ : BLKIF_OP_WRITE; + cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; + + return (cm); +} + +/* + * Dequeue buffers and place them in the shared communication ring. + * Return when no more requests can be accepted or all buffers have + * been queued. + * + * Signal XEN once the ring has been filled out. + */ +static void +xbd_startio(struct xbd_softc *sc) +{ + struct xbd_command *cm; + int error, queued = 0; + + mtx_assert(&sc->xbd_io_lock, MA_OWNED); + + if (sc->xbd_connected != XBD_STATE_CONNECTED) + return; + + while (RING_FREE_REQUESTS(&sc->xbd_ring) >= + sc->xbd_max_request_blocks) { + if (sc->xbd_flags & XBD_FROZEN) + break; + + cm = xbd_dequeue_ready(sc); + + if (cm == NULL) + cm = xbd_bio_command(sc); + + if (cm == NULL) + break; + + if ((error = xbd_queue_request(sc, cm)) != 0) { + printf("xbd_queue_request returned %d\n", error); + break; + } + queued++; + } + + if (queued != 0) + flush_requests(sc); +} + +static void +xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) +{ + struct bio *bp; + + bp = cm->cm_bp; + + if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { + disk_err(bp, "disk error" , -1, 0); + printf(" status: %x\n", cm->cm_status); + bp->bio_flags |= BIO_ERROR; + } + + if (bp->bio_flags & BIO_ERROR) + bp->bio_error = EIO; + else bp->bio_resid = 0; xbd_free_command(cm); biodone(bp); } -// Quiesce the disk writes for a dump file before allowing the next buffer. +static int +xbd_completion(struct xbd_command *cm) +{ + gnttab_end_foreign_access_references(cm->cm_nseg, cm->cm_sg_refs); + return (BLKIF_SEGS_TO_BLOCKS(cm->cm_nseg)); +} + +static void +xbd_int(void *xsc) +{ + struct xbd_softc *sc = xsc; + struct xbd_command *cm; + blkif_response_t *bret; + RING_IDX i, rp; + int op; + + mtx_lock(&sc->xbd_io_lock); + + if (unlikely(sc->xbd_connected == XBD_STATE_DISCONNECTED)) { + mtx_unlock(&sc->xbd_io_lock); + return; + } + + again: + rp = sc->xbd_ring.sring->rsp_prod; + rmb(); /* Ensure we see queued responses up to 'rp'. */ + + for (i = sc->xbd_ring.rsp_cons; i != rp;) { + bret = RING_GET_RESPONSE(&sc->xbd_ring, i); + cm = &sc->xbd_shadow[bret->id]; + + xbd_remove_busy(cm); + i += xbd_completion(cm); + + if (cm->cm_operation == BLKIF_OP_READ) + op = BUS_DMASYNC_POSTREAD; + else if (cm->cm_operation == BLKIF_OP_WRITE) + op = BUS_DMASYNC_POSTWRITE; + else + op = 0; + bus_dmamap_sync(sc->xbd_io_dmat, cm->cm_map, op); + bus_dmamap_unload(sc->xbd_io_dmat, cm->cm_map); + + /* + * If commands are completing then resources are probably + * being freed as well. It's a cheap assumption even when + * wrong. + */ + sc->xbd_flags &= ~XBD_FROZEN; + + /* + * Directly call the i/o complete routine to save an + * an indirection in the common case. + */ + cm->cm_status = bret->status; + if (cm->cm_bp) + xbd_bio_complete(sc, cm); + else if (cm->cm_complete != NULL) + cm->cm_complete(cm); + else + xbd_free_command(cm); + } + + sc->xbd_ring.rsp_cons = i; + + if (i != sc->xbd_ring.req_prod_pvt) { + int more_to_do; + RING_FINAL_CHECK_FOR_RESPONSES(&sc->xbd_ring, more_to_do); + if (more_to_do) + goto again; + } else { + sc->xbd_ring.sring->rsp_event = i + 1; + } + + xbd_startio(sc); + + if (unlikely(sc->xbd_connected == XBD_STATE_SUSPENDED)) + wakeup(&sc->xbd_cm_busy); + + mtx_unlock(&sc->xbd_io_lock); +} + +/*------------------------------- Dump Support -------------------------------*/ +/** + * Quiesce the disk writes for a dump file before allowing the next buffer. + */ static void xbd_quiesce(struct xbd_softc *sc) { @@ -396,171 +560,375 @@ xbd_dump(void *arg, void *virtual, vm_of return (rc); } - +/*----------------------------- Disk Entrypoints -----------------------------*/ static int -xbd_probe(device_t dev) +xbd_open(struct disk *dp) { + struct xbd_softc *sc = dp->d_drv1; - if (!strcmp(xenbus_get_type(dev), "vbd")) { - device_set_desc(dev, "Virtual Block Device"); - device_quiet(dev); - return (0); + if (sc == NULL) { + printf("xb%d: not found", sc->xbd_unit); + return (ENXIO); } - return (ENXIO); + sc->xbd_flags |= XBD_OPEN; + sc->xbd_users++; + return (0); } -static void -xbd_setup_sysctl(struct xbd_softc *xbd) +static int +xbd_close(struct disk *dp) { - struct sysctl_ctx_list *sysctl_ctx = NULL; - struct sysctl_oid *sysctl_tree = NULL; - - sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); - if (sysctl_ctx == NULL) - return; + struct xbd_softc *sc = dp->d_drv1; - sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); - if (sysctl_tree == NULL) - return; + if (sc == NULL) + return (ENXIO); + sc->xbd_flags &= ~XBD_OPEN; + if (--(sc->xbd_users) == 0) { + /* + * Check whether we have been instructed to close. We will + * have ignored this request initially, as the device was + * still mounted. + */ + if (xenbus_get_otherend_state(sc->xbd_dev) == + XenbusStateClosing) + xbd_closing(sc->xbd_dev); + } + return (0); +} - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, - "maximum outstanding requests (negotiated)"); +static int +xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td) +{ + struct xbd_softc *sc = dp->d_drv1; - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_segments", CTLFLAG_RD, - &xbd->xbd_max_request_segments, 0, - "maximum number of pages per requests (negotiated)"); + if (sc == NULL) + return (ENXIO); - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, - "maximum size in bytes of a request (negotiated)"); - - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, - "communication channel pages (negotiated)"); + return (ENOTTY); } /* - * Setup supplies the backend dir, virtual device. We place an event - * channel and shared frame entries. We watch backend to wait if it's - * ok. + * Read/write routine for a buffer. Finds the proper unit, place it on + * the sortq and kick the controller. */ -static int -xbd_attach(device_t dev) +static void +xbd_strategy(struct bio *bp) { - struct xbd_softc *sc; - const char *name; - uint32_t vdevice; - int error; - int i; - int unit; + struct xbd_softc *sc = bp->bio_disk->d_drv1; - /* FIXME: Use dynamic device id if this is not set. */ - error = xs_scanf(XST_NIL, xenbus_get_node(dev), - "virtual-device", NULL, "%" PRIu32, &vdevice); - if (error) { - xenbus_dev_fatal(dev, error, "reading virtual-device"); - device_printf(dev, "Couldn't determine virtual device.\n"); - return (error); + /* bogus disk? */ + if (sc == NULL) { + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + return; } - xbd_vdevice_to_unit(vdevice, &unit, &name); - if (!strcmp(name, "xbd")) - device_set_unit(dev, unit); - - sc = device_get_softc(dev); - mtx_init(&sc->xbd_io_lock, "blkfront i/o lock", NULL, MTX_DEF); - xbd_initq_free(sc); - xbd_initq_busy(sc); - xbd_initq_ready(sc); - xbd_initq_complete(sc); - xbd_initq_bio(sc); - for (i = 0; i < XBD_MAX_RING_PAGES; i++) - sc->xbd_ring_ref[i] = GRANT_INVALID_REF; - - sc->xbd_dev = dev; - sc->xbd_vdevice = vdevice; - sc->xbd_connected = XBD_STATE_DISCONNECTED; - - xbd_setup_sysctl(sc); + /* + * Place it in the queue of disk activities for this disk + */ + mtx_lock(&sc->xbd_io_lock); - /* Wait for backend device to publish its protocol capabilities. */ - xenbus_set_state(dev, XenbusStateInitialising); + xbd_enqueue_bio(sc, bp); + xbd_startio(sc); - return (0); + mtx_unlock(&sc->xbd_io_lock); + return; } -static int -xbd_suspend(device_t dev) +/*------------------------------ Ring Management -----------------------------*/ +static int +xbd_setup_ring(struct xbd_softc *sc) { - struct xbd_softc *sc = device_get_softc(dev); - int retval; - int saved_state; + blkif_sring_t *sring; + uintptr_t sring_page_addr; + int error; + int i; - /* Prevent new requests being issued until we fix things up. */ - mtx_lock(&sc->xbd_io_lock); - saved_state = sc->xbd_connected; - sc->xbd_connected = XBD_STATE_SUSPENDED; + sring = malloc(sc->xbd_ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, + M_NOWAIT|M_ZERO); + if (sring == NULL) { + xenbus_dev_fatal(sc->xbd_dev, ENOMEM, "allocating shared ring"); + return (ENOMEM); + } + SHARED_RING_INIT(sring); + FRONT_RING_INIT(&sc->xbd_ring, sring, sc->xbd_ring_pages * PAGE_SIZE); - /* Wait for outstanding I/O to drain. */ - retval = 0; - while (TAILQ_EMPTY(&sc->xbd_cm_busy) == 0) { - if (msleep(&sc->xbd_cm_busy, &sc->xbd_io_lock, - PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { - retval = EBUSY; - break; + for (i = 0, sring_page_addr = (uintptr_t)sring; + i < sc->xbd_ring_pages; + i++, sring_page_addr += PAGE_SIZE) { + + error = xenbus_grant_ring(sc->xbd_dev, + (vtomach(sring_page_addr) >> PAGE_SHIFT), + &sc->xbd_ring_ref[i]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "granting ring_ref(%d)", i); + return (error); } } - mtx_unlock(&sc->xbd_io_lock); + if (sc->xbd_ring_pages == 1) { + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + "ring-ref", "%u", sc->xbd_ring_ref[0]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-ref", + xenbus_get_node(sc->xbd_dev)); + return (error); + } + } else { + for (i = 0; i < sc->xbd_ring_pages; i++) { + char ring_ref_name[]= "ring_refXX"; - if (retval != 0) - sc->xbd_connected = saved_state; + snprintf(ring_ref_name, sizeof(ring_ref_name), + "ring-ref%u", i); + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + ring_ref_name, "%u", sc->xbd_ring_ref[i]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/%s", + xenbus_get_node(sc->xbd_dev), + ring_ref_name); + return (error); + } + } + } - return (retval); + error = bind_listening_port_to_irqhandler( + xenbus_get_otherend_id(sc->xbd_dev), + "xbd", (driver_intr_t *)xbd_int, sc, + INTR_TYPE_BIO | INTR_MPSAFE, &sc->xbd_irq); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "bind_evtchn_to_irqhandler failed"); + return (error); + } + + return (0); } -static int -xbd_resume(device_t dev) +/*-------------------------- Initialization/Teardown -------------------------*/ +static void +xbd_setup_sysctl(struct xbd_softc *xbd) { - struct xbd_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *sysctl_ctx = NULL; + struct sysctl_oid *sysctl_tree = NULL; + + sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); + if (sysctl_ctx == NULL) + return; - DPRINTK("xbd_resume: %s\n", xenbus_get_node(dev)); + sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); + if (sysctl_tree == NULL) + return; - xbd_free(sc); - xbd_initialize(sc); - return (0); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, + "maximum outstanding requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_segments", CTLFLAG_RD, + &xbd->xbd_max_request_segments, 0, + "maximum number of pages per requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, + "communication channel pages (negotiated)"); } +/* + * Translate Linux major/minor to an appropriate name and unit + * number. For HVM guests, this allows us to use the same drive names + * with blkfront as the emulated drives, easing transition slightly. + */ static void -xbd_initialize(struct xbd_softc *sc) +xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) { - const char *otherend_path; - const char *node_path; - uint32_t max_ring_page_order; - int error; + static struct vdev_info { + int major; + int shift; + int base; + const char *name; + } info[] = { + {3, 6, 0, "ada"}, /* ide0 */ + {22, 6, 2, "ada"}, /* ide1 */ + {33, 6, 4, "ada"}, /* ide2 */ + {34, 6, 6, "ada"}, /* ide3 */ + {56, 6, 8, "ada"}, /* ide4 */ + {57, 6, 10, "ada"}, /* ide5 */ + {88, 6, 12, "ada"}, /* ide6 */ + {89, 6, 14, "ada"}, /* ide7 */ + {90, 6, 16, "ada"}, /* ide8 */ + {91, 6, 18, "ada"}, /* ide9 */ + + {8, 4, 0, "da"}, /* scsi disk0 */ + {65, 4, 16, "da"}, /* scsi disk1 */ + {66, 4, 32, "da"}, /* scsi disk2 */ + {67, 4, 48, "da"}, /* scsi disk3 */ + {68, 4, 64, "da"}, /* scsi disk4 */ + {69, 4, 80, "da"}, /* scsi disk5 */ + {70, 4, 96, "da"}, /* scsi disk6 */ + {71, 4, 112, "da"}, /* scsi disk7 */ + {128, 4, 128, "da"}, /* scsi disk8 */ + {129, 4, 144, "da"}, /* scsi disk9 */ + {130, 4, 160, "da"}, /* scsi disk10 */ + {131, 4, 176, "da"}, /* scsi disk11 */ + {132, 4, 192, "da"}, /* scsi disk12 */ + {133, 4, 208, "da"}, /* scsi disk13 */ + {134, 4, 224, "da"}, /* scsi disk14 */ + {135, 4, 240, "da"}, /* scsi disk15 */ + + {202, 4, 0, "xbd"}, /* xbd */ + + {0, 0, 0, NULL}, + }; + int major = vdevice >> 8; + int minor = vdevice & 0xff; int i; - if (xenbus_get_state(sc->xbd_dev) != XenbusStateInitialising) { - /* Initialization has already been performed. */ + if (vdevice & (1 << 28)) { + *unit = (vdevice & ((1 << 28) - 1)) >> 8; + *name = "xbd"; return; } - /* - * Protocol defaults valid even if negotiation for a - * setting fails. - */ - max_ring_page_order = 0; - sc->xbd_ring_pages = 1; - sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->xbd_max_request_size = - XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); - sc->xbd_max_request_blocks = - BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); + for (i = 0; info[i].major; i++) { + if (info[i].major == major) { + *unit = info[i].base + (minor >> info[i].shift); + *name = info[i].name; + return; + } + } - /* - * Protocol negotiation. + *unit = minor >> 4; + *name = "xbd"; +} + +int +xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, + int vdevice, uint16_t vdisk_info, unsigned long sector_size) +{ + int unit, error = 0; + const char *name; + + xbd_vdevice_to_unit(vdevice, &unit, &name); + + sc->xbd_unit = unit; + + if (strcmp(name, "xbd")) + device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); + + sc->xbd_disk = disk_alloc(); + sc->xbd_disk->d_unit = sc->xbd_unit; + sc->xbd_disk->d_open = xbd_open; + sc->xbd_disk->d_close = xbd_close; + sc->xbd_disk->d_ioctl = xbd_ioctl; + sc->xbd_disk->d_strategy = xbd_strategy; + sc->xbd_disk->d_dump = xbd_dump; + sc->xbd_disk->d_name = name; + sc->xbd_disk->d_drv1 = sc; + sc->xbd_disk->d_sectorsize = sector_size; + + sc->xbd_disk->d_mediasize = sectors * sector_size; + sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; + sc->xbd_disk->d_flags = 0; + disk_create(sc->xbd_disk, DISK_VERSION); + + return error; +} + +static void +xbd_free(struct xbd_softc *sc) +{ + uint8_t *sring_page_ptr; + int i; + + /* Prevent new requests being issued until we fix things up. */ + mtx_lock(&sc->xbd_io_lock); + sc->xbd_connected = XBD_STATE_DISCONNECTED; + mtx_unlock(&sc->xbd_io_lock); + + /* Free resources associated with old device channel. */ + if (sc->xbd_ring.sring != NULL) { + sring_page_ptr = (uint8_t *)sc->xbd_ring.sring; + for (i = 0; i < sc->xbd_ring_pages; i++) { + grant_ref_t *ref; + + ref = &sc->xbd_ring_ref[i]; + if (*ref != GRANT_INVALID_REF) { + gnttab_end_foreign_access_ref(*ref); + *ref = GRANT_INVALID_REF; + } + sring_page_ptr += PAGE_SIZE; + } + free(sc->xbd_ring.sring, M_XENBLOCKFRONT); + sc->xbd_ring.sring = NULL; + } + + if (sc->xbd_shadow) { + + for (i = 0; i < sc->xbd_max_requests; i++) { + struct xbd_command *cm; + + cm = &sc->xbd_shadow[i]; + if (cm->cm_sg_refs != NULL) { + free(cm->cm_sg_refs, M_XENBLOCKFRONT); + cm->cm_sg_refs = NULL; + } + + bus_dmamap_destroy(sc->xbd_io_dmat, cm->cm_map); + } + free(sc->xbd_shadow, M_XENBLOCKFRONT); + sc->xbd_shadow = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:33:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18BBB384; Fri, 31 May 2013 22:33:29 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A05FF9C; Fri, 31 May 2013 22:33:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMXSTC095823; Fri, 31 May 2013 22:33:28 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMXStp095822; Fri, 31 May 2013 22:33:28 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312233.r4VMXStp095822@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 22:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251206 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:33:29 -0000 Author: gibbs Date: Fri May 31 22:33:28 2013 New Revision: 251206 URL: http://svnweb.freebsd.org/changeset/base/251206 Log: Style changes. No intended functional changes. o rename flush_requests => xbd_flush_requests o rename xbd_setup_ring => xbd_alloc_ring Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:23:17 2013 (r251205) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:33:28 2013 (r251206) @@ -105,7 +105,7 @@ static MALLOC_DEFINE(M_XENBLOCKFRONT, "x /*---------------------------- Command Processing ----------------------------*/ static inline void -flush_requests(struct xbd_softc *sc) +xbd_flush_requests(struct xbd_softc *sc) { int notify; @@ -232,7 +232,7 @@ xbd_queue_cb(void *arg, bus_dma_segment_ * instead of in the startio context, so an explicit flush is needed. */ if (cm->cm_flags & XBD_CMD_FROZEN) - flush_requests(sc); + xbd_flush_requests(sc); return; } @@ -344,7 +344,7 @@ xbd_startio(struct xbd_softc *sc) } if (queued != 0) - flush_requests(sc); + xbd_flush_requests(sc); } static void @@ -640,7 +640,7 @@ xbd_strategy(struct bio *bp) /*------------------------------ Ring Management -----------------------------*/ static int -xbd_setup_ring(struct xbd_softc *sc) +xbd_alloc_ring(struct xbd_softc *sc) { blkif_sring_t *sring; uintptr_t sring_page_addr; @@ -1071,7 +1071,7 @@ xbd_initialize(struct xbd_softc *sc) xbd_free_command(cm); } - if (xbd_setup_ring(sc) != 0) + if (xbd_alloc_ring(sc) != 0) return; /* Support both backend schemes for relaying ring page limits. */ From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:53:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3BCC781; Fri, 31 May 2013 22:53:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5C276F; Fri, 31 May 2013 22:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMrikG002802; Fri, 31 May 2013 22:53:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMriSR002801; Fri, 31 May 2013 22:53:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305312253.r4VMriSR002801@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 22:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r251207 - vendor/tcpdump/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:53:44 -0000 Author: delphij Date: Fri May 31 22:53:44 2013 New Revision: 251207 URL: http://svnweb.freebsd.org/changeset/base/251207 Log: Apply vendor commit 654f1b3fc5, this is slight different from our version as discussed with upstream. Modified: vendor/tcpdump/dist/print-rip.c Modified: vendor/tcpdump/dist/print-rip.c ============================================================================== --- vendor/tcpdump/dist/print-rip.c Fri May 31 22:33:28 2013 (r251206) +++ vendor/tcpdump/dist/print-rip.c Fri May 31 22:53:44 2013 (r251207) @@ -141,7 +141,7 @@ rip_entry_print_v2(register const struct putchar (isprint(*p) ? *p : '.'); } else if (auth_type == 3) { printf("\n\t Auth header:"); - printf(" Packet Len %u,", EXTRACT_16BITS(&ni->rip_dest)); + printf(" Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4)); printf(" Key-ID %u,", *((u_int8_t *)ni + 6)); printf(" Auth Data Len %u,", *((u_int8_t *)ni + 7)); printf(" SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask)); From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:54:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 74C918E4; Fri, 31 May 2013 22:54:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 566D67A; Fri, 31 May 2013 22:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMsLsr002968; Fri, 31 May 2013 22:54:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMsKnB002964; Fri, 31 May 2013 22:54:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312254.r4VMsKnB002964@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251208 - in head: bin/test tools/regression/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:54:21 -0000 Author: jilles Date: Fri May 31 22:54:20 2013 New Revision: 251208 URL: http://svnweb.freebsd.org/changeset/base/251208 Log: test: Remove -ntXY and -otXY primaries. This reverts commit r247274. As maintainer of sh, I disapprove of this feature addition. It is too specific and can be done without easily using find(1) or stat(1). I will add some hints to the test(1) man page shortly. In general, FreeBSD sh is not the place to invent new shell language features. This is how it has been maintained and adding features randomly does not work with that. The new syntax (e.g. [ FILE1 -ntca FILE2 ]) looks cryptic to me. Modified: head/bin/test/test.1 head/bin/test/test.c head/tools/regression/bin/test/regress.sh Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:53:44 2013 (r251207) +++ head/bin/test/test.1 Fri May 31 22:54:20 2013 (r251208) @@ -169,65 +169,15 @@ True if .Ar file exists and is a socket. .It Ar file1 Fl nt Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and -.Ar file1 -is newer than -.Ar file2 . -.It Ar file1 Fl nt Ns Ar X Ns Ar Y Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and +True if .Ar file1 -has a more recent last access time -.Pq Ar X Ns = Ns Cm a , -inode creation time -.Pq Ar X Ns = Ns Cm b , -change time -.Pq Ar X Ns = Ns Cm c , -or modification time -.Pq Ar X Ns = Ns Cm m -than the last access time -.Pq Ar Y Ns = Ns Cm a , -inode creation time -.Pq Ar Y Ns = Ns Cm b , -change time -.Pq Ar Y Ns = Ns Cm c , -or modification time -.Pq Ar Y Ns = Ns Cm m -of +exists and is newer than .Ar file2 . -Note that -.Ic -ntmm -is equivalent to -.Ic -nt . .It Ar file1 Fl ot Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and +True if .Ar file1 -is older than +exists and is older than .Ar file2 . -Note that -.Ar file1 -.Ic -ot -.Ar file2 -is equivalent to -.Ar file2 -.Ic -nt -.Ar file1 -.It Ar file1 Fl ot Ns Ar X Ns Ar Y Ar file2 -Equivalent to -.Ar file2 -.Ic -nt Ns Ar Y Ns Ar X -.Ar file1 . .It Ar file1 Fl ef Ar file2 True if .Ar file1 Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Fri May 31 22:53:44 2013 (r251207) +++ head/bin/test/test.c Fri May 31 22:54:20 2013 (r251208) @@ -63,7 +63,7 @@ error(const char *msg, ...) "-u"|"-g"|"-k"|"-s"|"-t"|"-z"|"-n"|"-o"|"-O"|"-G"|"-L"|"-S"; binary-operator ::= "="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-le"|"-lt"| - "-nt"|"-nt[abcm][abcm]"|"-ot"|"-ot[abcm][abcm])"|"-ef"; + "-nt"|"-ot"|"-ef"; operand ::= */ @@ -85,38 +85,8 @@ enum token { FILSUID, FILSGID, FILSTCK, - FILNTAA, - FILNTAB, - FILNTAC, - FILNTAM, - FILNTBA, - FILNTBB, - FILNTBC, - FILNTBM, - FILNTCA, - FILNTCB, - FILNTCC, - FILNTCM, - FILNTMA, - FILNTMB, - FILNTMC, - FILNTMM, - FILOTAA, - FILOTAB, - FILOTAC, - FILOTAM, - FILOTBA, - FILOTBB, - FILOTBC, - FILOTBM, - FILOTCA, - FILOTCB, - FILOTCC, - FILOTCM, - FILOTMA, - FILOTMB, - FILOTMC, - FILOTMM, + FILNT, + FILOT, FILEQ, FILUID, FILGID, @@ -148,16 +118,9 @@ enum token_types { PAREN }; -enum time_types { - ATIME, - BTIME, - CTIME, - MTIME -}; - static struct t_op { - char op_text[6]; - char op_num, op_type; + char op_text[4]; + short op_num, op_type; } const ops [] = { {"-r", FILRD, UNOP}, {"-w", FILWR, UNOP}, @@ -191,40 +154,8 @@ static struct t_op { {"-gt", INTGT, BINOP}, {"-le", INTLE, BINOP}, {"-lt", INTLT, BINOP}, - {"-nt", FILNTMM, BINOP}, - {"-ntaa", FILNTAA, BINOP}, - {"-ntab", FILNTAB, BINOP}, - {"-ntac", FILNTAC, BINOP}, - {"-ntam", FILNTAM, BINOP}, - {"-ntba", FILNTBA, BINOP}, - {"-ntbb", FILNTBB, BINOP}, - {"-ntbc", FILNTBC, BINOP}, - {"-ntbm", FILNTBM, BINOP}, - {"-ntca", FILNTCA, BINOP}, - {"-ntcb", FILNTCB, BINOP}, - {"-ntcc", FILNTCC, BINOP}, - {"-ntcm", FILNTCM, BINOP}, - {"-ntma", FILNTMA, BINOP}, - {"-ntmb", FILNTMB, BINOP}, - {"-ntmc", FILNTMC, BINOP}, - {"-ntmm", FILNTMM, BINOP}, - {"-ot", FILOTMM, BINOP}, - {"-otaa", FILOTAA, BINOP}, - {"-otab", FILOTBB, BINOP}, - {"-otac", FILOTAC, BINOP}, - {"-otam", FILOTAM, BINOP}, - {"-otba", FILOTBA, BINOP}, - {"-otbb", FILOTBB, BINOP}, - {"-otbc", FILOTBC, BINOP}, - {"-otbm", FILOTBM, BINOP}, - {"-otca", FILOTCA, BINOP}, - {"-otcb", FILOTCB, BINOP}, - {"-otcc", FILOTCC, BINOP}, - {"-otcm", FILOTCM, BINOP}, - {"-otma", FILOTMA, BINOP}, - {"-otmb", FILOTMB, BINOP}, - {"-otmc", FILOTMC, BINOP}, - {"-otmm", FILOTMM, BINOP}, + {"-nt", FILNT, BINOP}, + {"-ot", FILOT, BINOP}, {"-ef", FILEQ, BINOP}, {"!", UNOT, BUNOP}, {"-a", BAND, BBINOP}, @@ -249,10 +180,10 @@ static int intcmp(const char *, const ch static int isunopoperand(void); static int islparenoperand(void); static int isrparenoperand(void); -static int newerf(const char *, const char *, enum time_types, - enum time_types); +static int newerf(const char *, const char *); static int nexpr(enum token); static int oexpr(enum token); +static int olderf(const char *, const char *); static int primary(enum token); static void syntax(const char *, const char *); static enum token t_lex(char *); @@ -422,70 +353,10 @@ binop(void) return intcmp(opnd1, opnd2) <= 0; case INTLT: return intcmp(opnd1, opnd2) < 0; - case FILNTAA: - return newerf(opnd1, opnd2, ATIME, ATIME); - case FILNTAB: - return newerf(opnd1, opnd2, ATIME, BTIME); - case FILNTAC: - return newerf(opnd1, opnd2, ATIME, CTIME); - case FILNTAM: - return newerf(opnd1, opnd2, ATIME, MTIME); - case FILNTBA: - return newerf(opnd1, opnd2, BTIME, ATIME); - case FILNTBB: - return newerf(opnd1, opnd2, BTIME, BTIME); - case FILNTBC: - return newerf(opnd1, opnd2, BTIME, CTIME); - case FILNTBM: - return newerf(opnd1, opnd2, BTIME, MTIME); - case FILNTCA: - return newerf(opnd1, opnd2, CTIME, ATIME); - case FILNTCB: - return newerf(opnd1, opnd2, CTIME, BTIME); - case FILNTCC: - return newerf(opnd1, opnd2, CTIME, CTIME); - case FILNTCM: - return newerf(opnd1, opnd2, CTIME, MTIME); - case FILNTMA: - return newerf(opnd1, opnd2, MTIME, ATIME); - case FILNTMB: - return newerf(opnd1, opnd2, MTIME, BTIME); - case FILNTMC: - return newerf(opnd1, opnd2, MTIME, CTIME); - case FILNTMM: - return newerf(opnd1, opnd2, MTIME, MTIME); - case FILOTAA: - return newerf(opnd2, opnd1, ATIME, ATIME); - case FILOTAB: - return newerf(opnd2, opnd1, BTIME, ATIME); - case FILOTAC: - return newerf(opnd2, opnd1, CTIME, ATIME); - case FILOTAM: - return newerf(opnd2, opnd1, MTIME, ATIME); - case FILOTBA: - return newerf(opnd2, opnd1, ATIME, BTIME); - case FILOTBB: - return newerf(opnd2, opnd1, BTIME, BTIME); - case FILOTBC: - return newerf(opnd2, opnd1, CTIME, BTIME); - case FILOTBM: - return newerf(opnd2, opnd1, MTIME, BTIME); - case FILOTCA: - return newerf(opnd2, opnd1, ATIME, CTIME); - case FILOTCB: - return newerf(opnd2, opnd1, BTIME, CTIME); - case FILOTCC: - return newerf(opnd2, opnd1, CTIME, CTIME); - case FILOTCM: - return newerf(opnd2, opnd1, MTIME, CTIME); - case FILOTMA: - return newerf(opnd2, opnd1, ATIME, MTIME); - case FILOTMB: - return newerf(opnd2, opnd1, BTIME, MTIME); - case FILOTMC: - return newerf(opnd2, opnd1, CTIME, MTIME); - case FILOTMM: - return newerf(opnd2, opnd1, MTIME, MTIME); + case FILNT: + return newerf (opnd1, opnd2); + case FILOT: + return olderf (opnd1, opnd2); case FILEQ: return equalf (opnd1, opnd2); default: @@ -699,34 +570,25 @@ intcmp (const char *s1, const char *s2) } static int -newerf (const char *f1, const char *f2, enum time_types t1, enum time_types t2) +newerf (const char *f1, const char *f2) { struct stat b1, b2; - struct timespec *ts1, *ts2; if (stat(f1, &b1) != 0 || stat(f2, &b2) != 0) return 0; - switch (t1) { - case ATIME: ts1 = &b1.st_atim; break; - case BTIME: ts1 = &b1.st_birthtim; break; - case CTIME: ts1 = &b1.st_ctim; break; - default: ts1 = &b1.st_mtim; break; - } - - switch (t2) { - case ATIME: ts2 = &b2.st_atim; break; - case BTIME: ts2 = &b2.st_birthtim; break; - case CTIME: ts2 = &b2.st_ctim; break; - default: ts2 = &b2.st_mtim; break; - } - - if (ts1->tv_sec > ts2->tv_sec) + if (b1.st_mtim.tv_sec > b2.st_mtim.tv_sec) return 1; - if (ts1->tv_sec < ts2->tv_sec) + if (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec) return 0; - return (ts1->tv_nsec > ts2->tv_nsec); + return (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec); +} + +static int +olderf (const char *f1, const char *f2) +{ + return (newerf(f2, f1)); } static int Modified: head/tools/regression/bin/test/regress.sh ============================================================================== --- head/tools/regression/bin/test/regress.sh Fri May 31 22:53:44 2013 (r251207) +++ head/tools/regression/bin/test/regress.sh Fri May 31 22:54:20 2013 (r251208) @@ -52,7 +52,7 @@ t () } count=0 -echo "1..266" +echo "1..130" t 0 'b = b' t 0 'b == b' @@ -194,66 +194,3 @@ t 1 '\( ! -a \)' t 0 '\( -n -o \)' t 1 '\( -z -o \)' t 1 '\( ! -o \)' - -# Test all file timestamp comparison operators -s() { - t ${1} "${35} -nt ${36}" - t ${2} "${35} -ntaa ${36}" - t ${3} "${35} -ntab ${36}" - t ${4} "${35} -ntac ${36}" - t ${5} "${35} -ntam ${36}" - t ${6} "${35} -ntba ${36}" - t ${7} "${35} -ntbb ${36}" - t ${8} "${35} -ntbc ${36}" - t ${9} "${35} -ntbm ${36}" - t ${10} "${35} -ntca ${36}" - t ${11} "${35} -ntcb ${36}" - t ${12} "${35} -ntcc ${36}" - t ${13} "${35} -ntcm ${36}" - t ${14} "${35} -ntma ${36}" - t ${15} "${35} -ntmb ${36}" - t ${16} "${35} -ntmc ${36}" - t ${17} "${35} -ntmm ${36}" - t ${18} "${35} -ot ${36}" - t ${19} "${35} -otaa ${36}" - t ${20} "${35} -otab ${36}" - t ${21} "${35} -otac ${36}" - t ${22} "${35} -otam ${36}" - t ${23} "${35} -otba ${36}" - t ${24} "${35} -otbb ${36}" - t ${25} "${35} -otbc ${36}" - t ${26} "${35} -otbm ${36}" - t ${27} "${35} -otca ${36}" - t ${28} "${35} -otcb ${36}" - t ${29} "${35} -otcc ${36}" - t ${30} "${35} -otcm ${36}" - t ${31} "${35} -otma ${36}" - t ${32} "${35} -otmb ${36}" - t ${33} "${35} -otmc ${36}" - t ${34} "${35} -otmm ${36}" -} - -a=/tmp/test$$.1 -b=/tmp/test$$.2 -trap "rm -f $a $b" EXIT - -# Tests 131-164 -s 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 1 1 $a $b - -touch $a -# Tests 165-198 -s 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 1 1 $a $b - -sleep 2 # Ensure $b is newer than $a -touch $b -# Tests 199-232 -s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $a $b - -sleep 2 -echo >$b # Updates mtime & ctime -sleep 2 -touch -A 01 -a $b - -# $b now has ctime > mtime > atime > btime -# Tests 233-266 -s 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1 $b $b From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:55:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EBADABB; Fri, 31 May 2013 22:55:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9101988; Fri, 31 May 2013 22:55:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMtLiT003290; Fri, 31 May 2013 22:55:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMtLOC003289; Fri, 31 May 2013 22:55:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312255.r4VMtLOC003289@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251209 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:55:21 -0000 Author: jilles Date: Fri May 31 22:55:21 2013 New Revision: 251209 URL: http://svnweb.freebsd.org/changeset/base/251209 Log: test(1): List non-standard primaries. Modified: head/bin/test/test.1 Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:54:20 2013 (r251208) +++ head/bin/test/test.1 Fri May 31 22:55:21 2013 (r251209) @@ -32,7 +32,7 @@ .\" @(#)test.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd December 27, 2012 +.Dd June 1, 2013 .Dt TEST 1 .Os .Sh NAME @@ -349,6 +349,17 @@ The utility implements a superset of the .St -p1003.2 specification. +The primaries +.Cm < , +.Cm == , +.Cm > , +.Fl ef , +.Fl nt , +.Fl ot , +.Fl G , +and +.Fl O +are extensions. .Sh BUGS Both sides are always evaluated in .Fl a From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:55:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7CF03ABF; Fri, 31 May 2013 22:55:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5378B; Fri, 31 May 2013 22:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMtOth003336; Fri, 31 May 2013 22:55:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMtOBO003335; Fri, 31 May 2013 22:55:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305312255.r4VMtOBO003335@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 22:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251210 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:55:24 -0000 Author: delphij Date: Fri May 31 22:55:23 2013 New Revision: 251210 URL: http://svnweb.freebsd.org/changeset/base/251210 Log: MFV: Redo the fixup using the submitted version accepted by upstream. Modified: head/contrib/tcpdump/print-rip.c Directory Properties: head/contrib/tcpdump/ (props changed) Modified: head/contrib/tcpdump/print-rip.c ============================================================================== --- head/contrib/tcpdump/print-rip.c Fri May 31 22:55:21 2013 (r251209) +++ head/contrib/tcpdump/print-rip.c Fri May 31 22:55:23 2013 (r251210) @@ -17,8 +17,6 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $FreeBSD$ */ #ifndef lint @@ -143,7 +141,7 @@ rip_entry_print_v2(register const struct putchar (isprint(*p) ? *p : '.'); } else if (auth_type == 3) { printf("\n\t Auth header:"); - printf(" Packet Len %u,", EXTRACT_16BITS((u_int16_t *)ni + 2)); + printf(" Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4)); printf(" Key-ID %u,", *((u_int8_t *)ni + 6)); printf(" Auth Data Len %u,", *((u_int8_t *)ni + 7)); printf(" SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask)); From owner-svn-src-all@FreeBSD.ORG Fri May 31 22:57:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3739DAC; Fri, 31 May 2013 22:57:04 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E593F98; Fri, 31 May 2013 22:57:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMv4XO003660; Fri, 31 May 2013 22:57:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMv40W003659; Fri, 31 May 2013 22:57:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312257.r4VMv40W003659@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251211 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:57:05 -0000 Author: jilles Date: Fri May 31 22:57:04 2013 New Revision: 251211 URL: http://svnweb.freebsd.org/changeset/base/251211 Log: test(1): Add information about replacing -nt/-ot. Modified: head/bin/test/test.1 Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:55:23 2013 (r251210) +++ head/bin/test/test.1 Fri May 31 22:57:04 2013 (r251211) @@ -331,6 +331,20 @@ missing. .It >1 An error occurred. .El +.Sh EXAMPLES +Implement +.Li test FILE1 -nt FILE2 +using only +.Tn POSIX +functionality: +.Pp +.Dl test -n \&"$(find -L -- FILE1 -prune -newer FILE2 2>/dev/null)\&" +.Pp +This can be modified using non-standard +.Xr find 1 +primaries like +.Cm -newerca +to compare other timestamps. .Sh COMPATIBILITY For compatibility with some other implementations, the @@ -341,7 +355,9 @@ with the same meaning. .Sh SEE ALSO .Xr builtin 1 , .Xr expr 1 , +.Xr find 1 , .Xr sh 1 , +.Xr stat 1 , .Xr symlink 7 .Sh STANDARDS The From owner-svn-src-all@FreeBSD.ORG Fri May 31 23:31:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F370844C; Fri, 31 May 2013 23:31:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BDA0C18A; Fri, 31 May 2013 23:31:17 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id ECD29368; Sat, 1 Jun 2013 01:26:55 +0200 (CEST) Date: Sat, 1 Jun 2013 01:31:10 +0200 From: Pawel Jakub Dawidek To: Jilles Tjoelker Subject: Re: svn commit: r251197 - head/lib/libc/sys Message-ID: <20130531233109.GD1387@garage.freebsd.pl> References: <201305312131.r4VLVcd5074132@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="veXX9dWIonWZEC6h" Content-Disposition: inline In-Reply-To: <201305312131.r4VLVcd5074132@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 23:31:18 -0000 --veXX9dWIonWZEC6h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2013 at 09:31:38PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Fri May 31 21:31:38 2013 > New Revision: 251197 > URL: http://svnweb.freebsd.org/changeset/base/251197 >=20 > Log: > sigaction(2): *at system calls are async-signal safe. Isn't chflags(2) family safe as well? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --veXX9dWIonWZEC6h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGpMr0ACgkQForvXbEpPzQFCgCeORfa4EJVKktWLtWmJ9ZwhF+I m8YAoIW/ToJJpgiOFLziA8Yxx6pWplqs =CxX7 -----END PGP SIGNATURE----- --veXX9dWIonWZEC6h-- From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 01:02:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99DA2E81; Sat, 1 Jun 2013 01:02:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A96A603; Sat, 1 Jun 2013 01:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5112P7t047902; Sat, 1 Jun 2013 01:02:25 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5112O9A047896; Sat, 1 Jun 2013 01:02:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306010102.r5112O9A047896@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 01:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251212 - in head/contrib/gcc: . config/i386 doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 01:02:25 -0000 Author: pfg Date: Sat Jun 1 01:02:24 2013 New Revision: 251212 URL: http://svnweb.freebsd.org/changeset/base/251212 Log: GCC: bring back experimental support for amdfam10/barcelona CPUs. Initial support for the AMD amdfam10 chipsets has been available in the gcc43 branch under GPLv2. AMD and some linux distributions (OpenSUSE) did a backport of the amdfam10 support and made it available. This is a revised subset of the support initially brought in in r236962 and later reverted. The collateral efects seem to have disappeared but it is still recommended to set the CPUTYPE with caution. Reviewed by: jkim (ages ago) MFC after: 3 weeks Added: head/contrib/gcc/config/i386/ammintrin.h (contents, props changed) Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config.gcc head/contrib/gcc/config/i386/athlon.md head/contrib/gcc/config/i386/driver-i386.c head/contrib/gcc/config/i386/emmintrin.h head/contrib/gcc/config/i386/i386.c head/contrib/gcc/config/i386/i386.h head/contrib/gcc/config/i386/i386.md head/contrib/gcc/config/i386/i386.opt head/contrib/gcc/config/i386/pmmintrin.h head/contrib/gcc/config/i386/sse.md head/contrib/gcc/config/i386/tmmintrin.h head/contrib/gcc/doc/extend.texi head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/ChangeLog.gcc43 Sat Jun 1 01:02:24 2013 (r251212) @@ -1,3 +1,8 @@ +2007-05-01 Dwarakanath Rajagopal (r124341) + + * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of + 'AMD Family 10 core'. + 2007-05-01 Dwarakanath Rajagopal (r124339) * config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3 @@ -5,6 +10,12 @@ with SSE3 instruction set support. * doc/invoke.texi: Likewise. +2007-05-01 Dwarakanath Rajagopal (r124330) + + * config/i386/i386.c (override_options): Tuning 32-byte loop + alignment for amdfam10 architecture. Increasing the max loop + alignment to 24 bytes. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -21,6 +32,17 @@ * config/i386/i386.c (ix86_handle_option): Handle SSSE3. +2007-03-28 Dwarakanath Rajagopal (r123313) + + * config.gcc: Accept barcelona as a variant of amdfam10. + * config/i386/i386.c (override_options): Likewise. + * doc/invoke.texi: Likewise. + +2007-02-09 Dwarakanath Rajagopal (r121763) + + * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. + (bit_SSE4a): New. + 2007-02-08 Harsha Jagasia (r121726) * config/i386/xmmintrin.h: Make inclusion of emmintrin.h @@ -38,6 +60,168 @@ * config/i386/i386.c (override_options): Set PTA_SSSE3 for core2. +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_fldxf_k8, athlon_fld_k8, + athlon_fstxf_k8, athlon_fst_k8, athlon_fist, athlon_fmov, + athlon_fadd_load, athlon_fadd_load_k8, athlon_fadd, athlon_fmul, + athlon_fmul_load, athlon_fmul_load_k8, athlon_fsgn, + athlon_fdiv_load, athlon_fdiv_load_k8, athlon_fdiv_k8, + athlon_fpspc_load, athlon_fpspc, athlon_fcmov_load, + athlon_fcmov_load_k8, athlon_fcmov_k8, athlon_fcomi_load_k8, + athlon_fcomi, athlon_fcom_load_k8, athlon_fcom): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.md (x86_sahf_1, cmpfp_i_mixed, cmpfp_i_sse, + cmpfp_i_i387, cmpfp_iu_mixed, cmpfp_iu_sse, cmpfp_iu_387, + swapsi, swaphi_1, swapqi_1, swapdi_rex64, fix_truncsfdi_sse, + fix_truncdfdi_sse, fix_truncsfsi_sse, fix_truncdfsi_sse, + x86_fldcw_1, floatsisf2_mixed, floatsisf2_sse, floatdisf2_mixed, + floatdisf2_sse, floatsidf2_mixed, floatsidf2_sse, + floatdidf2_mixed, floatdidf2_sse, muldi3_1_rex64, mulsi3_1, + mulsi3_1_zext, mulhi3_1, mulqi3_1, umulqihi3_1, mulqihi3_insn, + umulditi3_insn, umulsidi3_insn, mulditi3_insn, mulsidi3_insn, + umuldi3_highpart_rex64, umulsi3_highpart_insn, + umulsi3_highpart_zext, smuldi3_highpart_rex64, + smulsi3_highpart_insn, smulsi3_highpart_zext, x86_64_shld, + x86_shld_1, x86_64_shrd, sqrtsf2_mixed, sqrtsf2_sse, + sqrtsf2_i387, sqrtdf2_mixed, sqrtdf2_sse, sqrtdf2_i387, + sqrtextendsfdf2_i387, sqrtxf2, sqrtextendsfxf2_i387, + sqrtextenddfxf2_i387): Added amdfam10_decode. + + * config/i386/athlon.md (athlon_idirect_amdfam10, + athlon_ivector_amdfam10, athlon_idirect_load_amdfam10, + athlon_ivector_load_amdfam10, athlon_idirect_both_amdfam10, + athlon_ivector_both_amdfam10, athlon_idirect_store_amdfam10, + athlon_ivector_store_amdfam10): New define_insn_reservation. + (athlon_idirect_loadmov, athlon_idirect_movstore): Added + amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_call_amdfam10, + athlon_pop_amdfam10, athlon_lea_amdfam10): New + define_insn_reservation. + (athlon_branch, athlon_push, athlon_leave_k8, athlon_imul_k8, + athlon_imul_k8_DI, athlon_imul_mem_k8, athlon_imul_mem_k8_DI, + athlon_idiv, athlon_idiv_mem, athlon_str): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseld_amdfam10, + athlon_mmxld_amdfam10, athlon_ssest_amdfam10, + athlon_mmxssest_short_amdfam10): New define_insn_reservation. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseins_amdfam10): New + define_insn_reservation. + * config/i386/i386.md (sseins): Added sseins to define_attr type + and define_attr unit. + * config/i386/sse.md: Set type attribute to sseins for insertq + and insertqi. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (sselog_load_amdfam10, sselog_amdfam10, + ssecmpvector_load_amdfam10, ssecmpvector_amdfam10, + ssecomi_load_amdfam10, ssecomi_amdfam10, + sseaddvector_load_amdfam10, sseaddvector_amdfam10): New + define_insn_reservation. + (ssecmp_load_k8, ssecmp, sseadd_load_k8, seadd): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (cvtss2sd_load_amdfam10, + cvtss2sd_amdfam10, cvtps2pd_load_amdfam10, cvtps2pd_amdfam10, + cvtsi2sd_load_amdfam10, cvtsi2ss_load_amdfam10, + cvtsi2sd_amdfam10, cvtsi2ss_amdfam10, cvtsd2ss_load_amdfam10, + cvtsd2ss_amdfam10, cvtpd2ps_load_amdfam10, cvtpd2ps_amdfam10, + cvtsX2si_load_amdfam10, cvtsX2si_amdfam10): New + define_insn_reservation. + + * config/i386/sse.md (cvtsi2ss, cvtsi2ssq, cvtss2si, + cvtss2siq, cvttss2si, cvttss2siq, cvtsi2sd, cvtsi2sdq, + cvtsd2si, cvtsd2siq, cvttsd2si, cvttsd2siq, + cvtpd2dq, cvttpd2dq, cvtsd2ss, cvtss2sd, + cvtpd2ps, cvtps2pd): Added amdfam10_decode attribute. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_ssedivvector_amdfam10, + athlon_ssedivvector_load_amdfam10, athlon_ssemulvector_amdfam10, + athlon_ssemulvector_load_amdfam10): New define_insn_reservation. + (athlon_ssediv, athlon_ssediv_load_k8, athlon_ssemul, + athlon_ssemul_load_k8): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_SSE_UNALIGNED_MOVE_OPTIMAL): New macro. + (x86_sse_unaligned_move_optimal): New variable. + + * config/i386/i386.c (x86_sse_unaligned_move_optimal): Enable for + m_AMDFAM10. + (ix86_expand_vector_move_misalign): Add code to generate movupd/movups + for unaligned vector SSE double/single precision loads for AMDFAM10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_AMDFAM10): New macro. + (TARGET_CPU_CPP_BUILTINS): Add code for amdfam10. + Define TARGET_CPU_DEFAULT_amdfam10. + (TARGET_CPU_DEFAULT_NAMES): Add amdfam10. + (processor_type): Add PROCESSOR_AMDFAM10. + + * config/i386/i386.md: Add amdfam10 as a new cpu attribute to match + processor_type in config/i386/i386.h. + Enable imul peepholes for TARGET_AMDFAM10. + + * config.gcc: Add support for --with-cpu option for amdfam10. + + * config/i386/i386.c (amdfam10_cost): New variable. + (m_AMDFAM10): New macro. + (m_ATHLON_K8_AMDFAM10): New macro. + (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen, + x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_simode_fiop, + x86_promote_QImode, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_accumulate_outgoing_args, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_sse_typeless_stores, + x86_use_ffreep, x86_use_incdec, x86_four_jump_limit, + x86_schedule, x86_use_bt, x86_cmpxchg16b, x86_pad_returns): + Enable/disable for amdfam10. + (override_options): Add amdfam10_cost to processor_target_table. + Set up PROCESSOR_AMDFAM10 for amdfam10 entry in + processor_alias_table. + (ix86_issue_rate): Add PROCESSOR_AMDFAM10. + (ix86_adjust_cost): Add code for amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.opt: Add new Advanced Bit Manipulation (-mabm) + instruction set feature flag. Add new (-mpopcnt) flag for popcnt + instruction. Add new SSE4A (-msse4a) instruction set feature flag. + * config/i386/i386.h: Add builtin definition for SSE4A. + * config/i386/i386.md: Add support for ABM instructions + (popcnt and lzcnt). + * config/i386/sse.md: Add support for SSE4A instructions + (movntss, movntsd, extrq, insertq). + * config/i386/i386.c: Add support for ABM and SSE4A builtins. + Add -march=amdfam10 flag. + * config/i386/ammintrin.h: Add support for SSE4A intrinsics. + * doc/invoke.texi: Add documentation on flags for sse4a, abm, popcnt + and amdfam10. + * doc/extend.texi: Add documentation for SSE4A builtins. + +2007-01-24 Jakub Jelinek (r121140) + + * config/i386/i386.h (x86_cmpxchg16b): Remove const. + (TARGET_CMPXCHG16B): Define to x86_cmpxchg16b. + * config/i386/i386.c (x86_cmpxchg16b): Remove const. + (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b + for CPUs that have PTA_CX16 set. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. @@ -47,6 +231,11 @@ PR target/30040 * config/i386/driver-i386.c (bit_SSSE3): New. +2006-11-27 Uros Bizjak (r119260) + + * config/i386/i386.c (x86_ext_80387_constants): Add m_K8, m_CORE2 + and m_GENERIC64. + 2006-11-18 Vladimir Makarov (r118973) * doc/invoke.texi (core2): Add item. @@ -182,7 +371,7 @@ * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. -2006-10-22 H.J. Lu +2006-10-22 H.J. Lu (r117959) * config/i386/tmmintrin.h: Remove the duplicated content. Modified: head/contrib/gcc/config.gcc ============================================================================== --- head/contrib/gcc/config.gcc Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/config.gcc Sat Jun 1 01:02:24 2013 (r251212) @@ -269,12 +269,12 @@ xscale-*-*) i[34567]86-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" ;; x86_64-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" need_64bit_hwint=yes ;; ia64-*-*) @@ -1209,14 +1209,14 @@ i[34567]86-*-solaris2*) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 exit 1 ;; esac @@ -2515,6 +2515,9 @@ if test x$with_cpu = x ; then ;; i686-*-* | i786-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2555,6 +2558,9 @@ if test x$with_cpu = x ; then ;; x86_64-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2795,7 +2801,7 @@ case "${target}" in esac # OK ;; - "" | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) + "" | amdfam10 | barcelona | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) Added: head/contrib/gcc/config/i386/ammintrin.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/i386/ammintrin.h Sat Jun 1 01:02:24 2013 (r251212) @@ -0,0 +1,73 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC 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, or (at your option) + any later version. + + GCC 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 GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the AMD Programmers + Manual Update, version 2.x */ + +#ifndef _AMMINTRIN_H_INCLUDED +#define _AMMINTRIN_H_INCLUDED + +#ifndef __SSE4A__ +# error "SSE4A instruction set not enabled" +#else + +/* We need definitions from the SSE3, SSE2 and SSE header files*/ +#include + +static __inline void __attribute__((__always_inline__)) +_mm_stream_sd (double * __P, __m128d __Y) +{ + __builtin_ia32_movntsd (__P, (__v2df) __Y); +} + +static __inline void __attribute__((__always_inline__)) +_mm_stream_ss (float * __P, __m128 __Y) +{ + __builtin_ia32_movntss (__P, (__v4sf) __Y); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_extract_si64 (__m128i __X, __m128i __Y) +{ + return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y); +} + +#define _mm_extracti_si64(X, I, L) \ +((__m128i) __builtin_ia32_extrqi ((__v2di)(X), I, L)) + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_si64 (__m128i __X,__m128i __Y) +{ + return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y); +} + +#define _mm_inserti_si64(X, Y, I, L) \ +((__m128i) __builtin_ia32_insertqi ((__v2di)(X), (__v2di)(Y), I, L)) + + +#endif /* __SSE4A__ */ + +#endif /* _AMMINTRIN_H_INCLUDED */ Modified: head/contrib/gcc/config/i386/athlon.md ============================================================================== --- head/contrib/gcc/config/i386/athlon.md Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/config/i386/athlon.md Sat Jun 1 01:02:24 2013 (r251212) @@ -29,6 +29,8 @@ (const_string "vector")] (const_string "direct"))) +(define_attr "amdfam10_decode" "direct,vector,double" + (const_string "direct")) ;; ;; decode0 decode1 decode2 ;; \ | / @@ -131,18 +133,22 @@ ;; Jump instructions are executed in the branch unit completely transparent to us (define_insn_reservation "athlon_branch" 0 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "ibr")) "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_call" 0 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "call,callv")) "athlon-vector,athlon-ieu") +(define_insn_reservation "athlon_call_amdfam10" 0 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "call,callv")) + "athlon-double,athlon-ieu") ;; Latency of push operation is 3 cycles, but ESP value is available ;; earlier (define_insn_reservation "athlon_push" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "push")) "athlon-direct,athlon-agu,athlon-store") (define_insn_reservation "athlon_pop" 4 @@ -153,12 +159,16 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "pop")) "athlon-double,(athlon-ieu+athlon-load)") +(define_insn_reservation "athlon_pop_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "pop")) + "athlon-direct,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "leave")) "athlon-vector,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "leave")) "athlon-double,(athlon-ieu+athlon-load)") @@ -167,6 +177,11 @@ (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "lea")) "athlon-direct,athlon-agu,nothing") +;; Lea executes in AGU unit with 1 cycle latency on AMDFAM10 +(define_insn_reservation "athlon_lea_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "lea")) + "athlon-direct,athlon-agu,nothing") ;; Mul executes in special multiplier unit attached to IEU0 (define_insn_reservation "athlon_imul" 5 @@ -176,29 +191,35 @@ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0") ;; ??? Widening multiply is vector or double. (define_insn_reservation "athlon_imul_k8_DI" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "none,unknown")))) "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "none,unknown"))) "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0") +(define_insn_reservation "athlon_imul_amdfam10_HI" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "imul") + (and (eq_attr "mode" "HI") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_mem" 8 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8_DI" 7 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "load,both")))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu") @@ -209,21 +230,23 @@ ;; other instructions. ;; ??? Experiments show that the idiv can overlap with roughly 6 cycles ;; of the other code +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_idiv" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "none,unknown"))) "athlon-vector,(athlon-ieu0*6+(athlon-fpsched,athlon-fvector))") (define_insn_reservation "athlon_idiv_mem" 9 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "load,both"))) "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))") ;; The parallelism of string instructions is not documented. Model it same way ;; as idiv to create smaller automata. This probably does not matter much. +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_str" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "str") (eq_attr "memory" "load,both,store"))) "athlon-vector,athlon-load,athlon-ieu0*6") @@ -234,34 +257,62 @@ (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-direct,athlon-ieu") +(define_insn_reservation "athlon_idirect_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_ivector" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-vector,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_loadmov" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "load"))) "athlon-direct,athlon-load") + (define_insn_reservation "athlon_idirect_load" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-direct,athlon-load,athlon-ieu") +(define_insn_reservation "athlon_idirect_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-direct,athlon-load,athlon-ieu") (define_insn_reservation "athlon_ivector_load" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_movstore" 1 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "store"))) "athlon-direct,athlon-agu,athlon-store") + (define_insn_reservation "athlon_idirect_both" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -270,6 +321,15 @@ "athlon-direct,athlon-load, athlon-ieu,athlon-store, athlon-store") +(define_insn_reservation "athlon_idirect_both_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-direct,athlon-load, + athlon-ieu,athlon-store, + athlon-store") + (define_insn_reservation "athlon_ivector_both" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -279,6 +339,16 @@ athlon-ieu, athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_both_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-vector,athlon-load, + athlon-ieu, + athlon-ieu, + athlon-store") + (define_insn_reservation "athlon_idirect_store" 1 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -286,6 +356,14 @@ (eq_attr "memory" "store")))) "athlon-direct,(athlon-ieu+athlon-agu), athlon-store") +(define_insn_reservation "athlon_idirect_store_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-direct,(athlon-ieu+athlon-agu), + athlon-store") + (define_insn_reservation "athlon_ivector_store" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -293,6 +371,13 @@ (eq_attr "memory" "store")))) "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_store_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, + athlon-store") ;; Athlon floatin point unit (define_insn_reservation "athlon_fldxf" 12 @@ -302,7 +387,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,athlon-fpload2,athlon-fvector*9") (define_insn_reservation "athlon_fldxf_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "load") (eq_attr "mode" "XF")))) @@ -314,7 +399,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fany") (define_insn_reservation "athlon_fld_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") @@ -326,7 +411,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,(athlon-fpsched+athlon-agu),(athlon-store2+(athlon-fvector*7))") (define_insn_reservation "athlon_fstxf_k8" 8 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "store,both") (eq_attr "mode" "XF")))) @@ -337,16 +422,16 @@ (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fst_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fist" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fistp,fisttp")) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fmov" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmov")) "athlon-direct,athlon-fpsched,athlon-faddmul") (define_insn_reservation "athlon_fadd_load" 4 @@ -355,12 +440,12 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fop") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fop")) "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_fmul_load" 4 @@ -369,16 +454,16 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fmul_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmul") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") (define_insn_reservation "athlon_fmul" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmul")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fsgn" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fsgn")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_load" 24 @@ -387,7 +472,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fdiv_load_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fdiv") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") @@ -396,16 +481,16 @@ (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_k8" 11 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fpspc_load" 103 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "fpspc") (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload,athlon-fvector") (define_insn_reservation "athlon_fpspc" 100 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fpspc")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load" 7 @@ -418,12 +503,12 @@ (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load_k8" 17 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmov") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fvector") (define_insn_reservation "athlon_fcmov_k8" 15 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") ;; fcomi is vector decoded by uses only one pipe. @@ -434,13 +519,13 @@ (eq_attr "memory" "load")))) "athlon-vector,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcomi_load_k8" 5 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (and (eq_attr "athlon_decode" "vector") (eq_attr "memory" "load")))) "athlon-vector,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcomi" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "athlon_decode" "vector") (eq_attr "type" "fcmp"))) "athlon-vector,athlon-fpsched,athlon-fadd") @@ -450,18 +535,18 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcom_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcom" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fcmp")) "athlon-direct,athlon-fpsched,athlon-fadd") ;; Never seen by the scheduler because we still don't do post reg-stack ;; scheduling. ;(define_insn_reservation "athlon_fxch" 2 -; (and (eq_attr "cpu" "athlon,k8,generic64") +; (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") ; (eq_attr "type" "fxch")) ; "athlon-direct,athlon-fpsched,athlon-fany") @@ -516,6 +601,23 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") +;; On AMDFAM10 all double, single and integer packed and scalar SSEx data +;; loads generated are direct path, latency of 2 and do not use any FP +;; executions units. No seperate entries for movlpx/movhpx loads, which +;; are direct path, latency of 4 and use the FADD/FMUL FP execution units, +;; as they will not be generated. +(define_insn_reservation "athlon_sseld_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8") +;; On AMDFAM10 MMX data loads generated are direct path, latency of 4 +;; and can use any FP executions units +(define_insn_reservation "athlon_mmxld_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8, athlon-fany") (define_insn_reservation "athlon_mmxssest" 3 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") @@ -533,6 +635,25 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") +;; On AMDFAM10 all double, single and integer packed SSEx data stores +;; generated are all double path, latency of 2 and use the FSTORE FP +;; execution unit. No entries seperate for movupx/movdqu, which are +;; vector path, latency of 3 and use the FSTORE*2 FP execution unit, +;; as they will not be generated. +(define_insn_reservation "athlon_ssest_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (and (eq_attr "mode" "V4SF,V2DF,TI") + (eq_attr "memory" "store,both")))) + "athlon-double,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store)*2)") +;; On AMDFAM10 all double, single and integer scalar SSEx and MMX +;; data stores generated are all direct path, latency of 2 and use +;; the FSTORE FP execution unit +(define_insn_reservation "athlon_mmxssest_short_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov,ssemov") + (eq_attr "memory" "store,both"))) + "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_movaps_k8" 2 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") @@ -578,6 +699,11 @@ (and (eq_attr "type" "sselog,sselog1") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fmul*2)") +(define_insn_reservation "athlon_sselog_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sselog,sselog1") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,(athlon-fadd|athlon-fmul)") (define_insn_reservation "athlon_sselog" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sselog,sselog1")) @@ -586,6 +712,11 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sselog,sselog1")) "athlon-double,athlon-fpsched,athlon-fmul") +(define_insn_reservation "athlon_sselog_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sselog,sselog1")) + "athlon-direct,athlon-fpsched,(athlon-fadd|athlon-fmul)") + ;; ??? pcmp executes in addmul, probably not worthwhile to bother about that. (define_insn_reservation "athlon_ssecmp_load" 2 (and (eq_attr "cpu" "athlon") @@ -594,13 +725,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_ssecmp_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (and (eq_attr "mode" "SF,DF,DI,TI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmp" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (eq_attr "mode" "SF,DF,DI,TI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -614,6 +745,11 @@ (and (eq_attr "type" "ssecmp") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecmp") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmpvector" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "ssecmp")) @@ -622,6 +758,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssecmp")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "ssecmp")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_ssecomi_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssecomi") @@ -632,10 +772,20 @@ (and (eq_attr "type" "ssecomi") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_load_amdfam10" 5 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecomi") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecomi" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "ssecmp")) "athlon-vector,athlon-fpsched,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") +;; It seems athlon_ssecomi has a bug in the attr_type, fixed for amdfam10 + (eq_attr "type" "ssecomi")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_sseadd_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "sseadd") @@ -643,13 +793,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_sseadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (and (eq_attr "mode" "SF,DF,DI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (eq_attr "mode" "SF,DF,DI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -663,6 +813,11 @@ (and (eq_attr "type" "sseadd") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sseadd") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseaddvector" 5 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sseadd")) @@ -671,6 +826,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sseadd")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sseadd")) + "athlon-direct,athlon-fpsched,athlon-fadd") ;; Conversions behaves very irregularly and the scheduling is critical here. ;; Take each instruction separately. Assume that the mode is always set to the @@ -684,12 +843,25 @@ (and (eq_attr "mode" "DF") (eq_attr "memory" "load"))))) "athlon-direct,athlon-fploadk8,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_load_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "double") + (and (eq_attr "mode" "DF") + (eq_attr "memory" "load"))))) + "athlon-double,athlon-fploadk8,(athlon-faddmul+athlon-fstore)") (define_insn_reservation "athlon_ssecvt_cvtss2sd" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "direct") (eq_attr "mode" "DF")))) "athlon-direct,athlon-fpsched,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "vector") + (eq_attr "mode" "DF")))) + "athlon-vector,athlon-fpsched,athlon-faddmul,(athlon-fstore*2)") ;; cvtps2pd. Model same way the other double decoded FP conversions. (define_insn_reservation "athlon_ssecvt_cvtps2pd_load_k8" 5 (and (eq_attr "cpu" "k8,athlon,generic64") @@ -698,12 +870,25 @@ (and (eq_attr "mode" "V2DF,V4SF,TI") (eq_attr "memory" "load"))))) "athlon-double,athlon-fpload2k8,(athlon-fstore*2)") +(define_insn_reservation "athlon_ssecvt_cvtps2pd_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 02:07:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 431CF692; Sat, 1 Jun 2013 02:07:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 24FCB7FD; Sat, 1 Jun 2013 02:07:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5127c2B070186; Sat, 1 Jun 2013 02:07:38 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5127c0u070185; Sat, 1 Jun 2013 02:07:38 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201306010207.r5127c0u070185@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 1 Jun 2013 02:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251213 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 02:07:38 -0000 Author: np Date: Sat Jun 1 02:07:37 2013 New Revision: 251213 URL: http://svnweb.freebsd.org/changeset/base/251213 Log: cxgbe(4): Some more debug sysctls. These work on both T4 and T5 based cards. dev.t5nex.0.misc.cim_ma_la: CIM MA logic analyzer dev.t5nex.0.misc.cim_pif_la: CIM PIF logic analyzer dev.t5nex.0.misc.mps_tcam: MPS TCAM entries dev.t5nex.0.misc.tp_la: TP logic analyzer dev.t5nex.0.misc.ulprx_la: ULPRX logic analyzer Obtained from: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Jun 1 01:02:24 2013 (r251212) +++ head/sys/dev/cxgbe/t4_main.c Sat Jun 1 02:07:37 2013 (r251213) @@ -382,6 +382,8 @@ static int sysctl_handle_t4_reg64(SYSCTL static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); static int sysctl_cim_la(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS); static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); @@ -390,13 +392,16 @@ static int sysctl_fcoe_stats(SYSCTL_HAND static int sysctl_hw_sched(SYSCTL_HANDLER_ARGS); static int sysctl_lb_stats(SYSCTL_HANDLER_ARGS); static int sysctl_meminfo(SYSCTL_HANDLER_ARGS); +static int sysctl_mps_tcam(SYSCTL_HANDLER_ARGS); static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS); static int sysctl_pm_stats(SYSCTL_HANDLER_ARGS); static int sysctl_rdma_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tcp_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tids(SYSCTL_HANDLER_ARGS); static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_tp_la(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); +static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); #endif static inline void txq_start(struct ifnet *, struct sge_txq *); @@ -4220,6 +4225,10 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cim_la, "A", "CIM logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ma_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", CTLTYPE_STRING | CTLFLAG_RD, sc, 0 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); @@ -4254,6 +4263,10 @@ t4_sysctls(struct adapter *sc) sysctl_cim_ibq_obq, "A", "CIM OBQ 7 (SGE1-RX)"); } + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_pif_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cim_qcfg, "A", "CIM queue configuration"); @@ -4290,6 +4303,10 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_meminfo, "A", "memory regions"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mps_tcam", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_mps_tcam, "A", "MPS TCAM entries"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "path_mtus", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_path_mtus, "A", "path MTUs"); @@ -4314,10 +4331,18 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_err_stats, "A", "TP error statistics"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_tp_la, "A", "TP logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tx_rate, "A", "Tx rate"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ulprx_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_ulprx_la, "A", "ULPRX logic analyzer"); + if (is_t5(sc)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wcwr_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, @@ -4912,6 +4937,92 @@ done: } static int +sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int i; + struct sbuf *sb; + uint32_t *buf, *p; + int rc; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(2 * CIM_MALA_SIZE * 5 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_cim_read_ma_la(sc, buf, buf + 5 * CIM_MALA_SIZE); + p = buf; + + for (i = 0; i < CIM_MALA_SIZE; i++, p += 5) { + sbuf_printf(sb, "\n%02x%08x%08x%08x%08x", p[4], p[3], p[2], + p[1], p[0]); + } + + sbuf_printf(sb, "\n\nCnt ID Tag UE Data RDY VLD"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 5) { + sbuf_printf(sb, "\n%3u %2u %x %u %08x%08x %u %u", + (p[2] >> 10) & 0xff, (p[2] >> 7) & 7, + (p[2] >> 3) & 0xf, (p[2] >> 2) & 1, + (p[1] >> 2) | ((p[2] & 3) << 30), + (p[0] >> 2) | ((p[1] & 3) << 30), (p[0] >> 1) & 1, + p[0] & 1); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int +sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int i; + struct sbuf *sb; + uint32_t *buf, *p; + int rc; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(2 * CIM_PIFLA_SIZE * 6 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_cim_read_pif_la(sc, buf, buf + 6 * CIM_PIFLA_SIZE, NULL, NULL); + p = buf; + + sbuf_printf(sb, "Cntl ID DataBE Addr Data"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 6) { + sbuf_printf(sb, "\n %02x %02x %04x %08x %08x%08x%08x%08x", + (p[5] >> 22) & 0xff, (p[5] >> 16) & 0x3f, p[5] & 0xffff, + p[4], p[3], p[2], p[1], p[0]); + } + + sbuf_printf(sb, "\n\nCntl ID Data"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 6) { + sbuf_printf(sb, "\n %02x %02x %08x%08x%08x%08x", + (p[4] >> 6) & 0xff, p[4] & 0x3f, p[3], p[2], p[1], p[0]); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; @@ -5534,6 +5645,104 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) return (rc); } +static inline void +tcamxy2valmask(uint64_t x, uint64_t y, uint8_t *addr, uint64_t *mask) +{ + *mask = x | y; + y = htobe64(y); + memcpy(addr, (char *)&y + 2, ETHER_ADDR_LEN); +} + +static int +sysctl_mps_tcam(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i, n; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, + "Idx Ethernet address Mask Vld Ports PF" + " VF Replication P0 P1 P2 P3 ML"); + n = is_t4(sc) ? NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; + for (i = 0; i < n; i++) { + uint64_t tcamx, tcamy, mask; + uint32_t cls_lo, cls_hi; + uint8_t addr[ETHER_ADDR_LEN]; + + tcamy = t4_read_reg64(sc, MPS_CLS_TCAM_Y_L(i)); + tcamx = t4_read_reg64(sc, MPS_CLS_TCAM_X_L(i)); + cls_lo = t4_read_reg(sc, MPS_CLS_SRAM_L(i)); + cls_hi = t4_read_reg(sc, MPS_CLS_SRAM_H(i)); + + if (tcamx & tcamy) + continue; + + tcamxy2valmask(tcamx, tcamy, addr, &mask); + sbuf_printf(sb, "\n%3u %02x:%02x:%02x:%02x:%02x:%02x %012jx" + " %c %#x%4u%4d", i, addr[0], addr[1], addr[2], + addr[3], addr[4], addr[5], (uintmax_t)mask, + (cls_lo & F_SRAM_VLD) ? 'Y' : 'N', + G_PORTMAP(cls_hi), G_PF(cls_lo), + (cls_lo & F_VF_VALID) ? G_VF(cls_lo) : -1); + + if (cls_lo & F_REPLICATE) { + struct fw_ldst_cmd ldst_cmd; + + memset(&ldst_cmd, 0, sizeof(ldst_cmd)); + ldst_cmd.op_to_addrspace = + htobe32(V_FW_CMD_OP(FW_LDST_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_MPS)); + ldst_cmd.cycles_to_len16 = htobe32(FW_LEN16(ldst_cmd)); + ldst_cmd.u.mps.fid_ctl = + htobe16(V_FW_LDST_CMD_FID(FW_LDST_MPS_RPLC) | + V_FW_LDST_CMD_CTL(i)); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, + "t4mps"); + if (rc) + break; + rc = -t4_wr_mbox(sc, sc->mbox, &ldst_cmd, + sizeof(ldst_cmd), &ldst_cmd); + end_synchronized_op(sc, 0); + + if (rc != 0) { + sbuf_printf(sb, + " ------------ error %3u ------------", rc); + rc = 0; + } else { + sbuf_printf(sb, " %08x %08x %08x %08x", + be32toh(ldst_cmd.u.mps.rplc127_96), + be32toh(ldst_cmd.u.mps.rplc95_64), + be32toh(ldst_cmd.u.mps.rplc63_32), + be32toh(ldst_cmd.u.mps.rplc31_0)); + } + } else + sbuf_printf(sb, "%36s", ""); + + sbuf_printf(sb, "%4u%3u%3u%3u %#3x", G_SRAM_PRIO0(cls_lo), + G_SRAM_PRIO1(cls_lo), G_SRAM_PRIO2(cls_lo), + G_SRAM_PRIO3(cls_lo), (cls_lo >> S_MULTILISTEN0) & 0xf); + } + + if (rc) + (void) sbuf_finish(sb); + else + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS) { @@ -5771,6 +5980,242 @@ sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS) return (rc); } +struct field_desc { + const char *name; + u_int start; + u_int width; +}; + +static void +field_desc_show(struct sbuf *sb, uint64_t v, const struct field_desc *f) +{ + char buf[32]; + int line_size = 0; + + while (f->name) { + uint64_t mask = (1ULL << f->width) - 1; + int len = snprintf(buf, sizeof(buf), "%s: %ju", f->name, + ((uintmax_t)v >> f->start) & mask); + + if (line_size + len >= 79) { + line_size = 8; + sbuf_printf(sb, "\n "); + } + sbuf_printf(sb, "%s ", buf); + line_size += len + 1; + f++; + } + sbuf_printf(sb, "\n"); +} + +static struct field_desc tp_la0[] = { + { "RcfOpCodeOut", 60, 4 }, + { "State", 56, 4 }, + { "WcfState", 52, 4 }, + { "RcfOpcSrcOut", 50, 2 }, + { "CRxError", 49, 1 }, + { "ERxError", 48, 1 }, + { "SanityFailed", 47, 1 }, + { "SpuriousMsg", 46, 1 }, + { "FlushInputMsg", 45, 1 }, + { "FlushInputCpl", 44, 1 }, + { "RssUpBit", 43, 1 }, + { "RssFilterHit", 42, 1 }, + { "Tid", 32, 10 }, + { "InitTcb", 31, 1 }, + { "LineNumber", 24, 7 }, + { "Emsg", 23, 1 }, + { "EdataOut", 22, 1 }, + { "Cmsg", 21, 1 }, + { "CdataOut", 20, 1 }, + { "EreadPdu", 19, 1 }, + { "CreadPdu", 18, 1 }, + { "TunnelPkt", 17, 1 }, + { "RcfPeerFin", 16, 1 }, + { "RcfReasonOut", 12, 4 }, + { "TxCchannel", 10, 2 }, + { "RcfTxChannel", 8, 2 }, + { "RxEchannel", 6, 2 }, + { "RcfRxChannel", 5, 1 }, + { "RcfDataOutSrdy", 4, 1 }, + { "RxDvld", 3, 1 }, + { "RxOoDvld", 2, 1 }, + { "RxCongestion", 1, 1 }, + { "TxCongestion", 0, 1 }, + { NULL } +}; + +static struct field_desc tp_la1[] = { + { "CplCmdIn", 56, 8 }, + { "CplCmdOut", 48, 8 }, + { "ESynOut", 47, 1 }, + { "EAckOut", 46, 1 }, + { "EFinOut", 45, 1 }, + { "ERstOut", 44, 1 }, + { "SynIn", 43, 1 }, + { "AckIn", 42, 1 }, + { "FinIn", 41, 1 }, + { "RstIn", 40, 1 }, + { "DataIn", 39, 1 }, + { "DataInVld", 38, 1 }, + { "PadIn", 37, 1 }, + { "RxBufEmpty", 36, 1 }, + { "RxDdp", 35, 1 }, + { "RxFbCongestion", 34, 1 }, + { "TxFbCongestion", 33, 1 }, + { "TxPktSumSrdy", 32, 1 }, + { "RcfUlpType", 28, 4 }, + { "Eread", 27, 1 }, + { "Ebypass", 26, 1 }, + { "Esave", 25, 1 }, + { "Static0", 24, 1 }, + { "Cread", 23, 1 }, + { "Cbypass", 22, 1 }, + { "Csave", 21, 1 }, + { "CPktOut", 20, 1 }, + { "RxPagePoolFull", 18, 2 }, + { "RxLpbkPkt", 17, 1 }, + { "TxLpbkPkt", 16, 1 }, + { "RxVfValid", 15, 1 }, + { "SynLearned", 14, 1 }, + { "SetDelEntry", 13, 1 }, + { "SetInvEntry", 12, 1 }, + { "CpcmdDvld", 11, 1 }, + { "CpcmdSave", 10, 1 }, + { "RxPstructsFull", 8, 2 }, + { "EpcmdDvld", 7, 1 }, + { "EpcmdFlush", 6, 1 }, + { "EpcmdTrimPrefix", 5, 1 }, + { "EpcmdTrimPostfix", 4, 1 }, + { "ERssIp4Pkt", 3, 1 }, + { "ERssIp6Pkt", 2, 1 }, + { "ERssTcpUdpPkt", 1, 1 }, + { "ERssFceFipPkt", 0, 1 }, + { NULL } +}; + +static struct field_desc tp_la2[] = { + { "CplCmdIn", 56, 8 }, + { "MpsVfVld", 55, 1 }, + { "MpsPf", 52, 3 }, + { "MpsVf", 44, 8 }, + { "SynIn", 43, 1 }, + { "AckIn", 42, 1 }, + { "FinIn", 41, 1 }, + { "RstIn", 40, 1 }, + { "DataIn", 39, 1 }, + { "DataInVld", 38, 1 }, + { "PadIn", 37, 1 }, + { "RxBufEmpty", 36, 1 }, + { "RxDdp", 35, 1 }, + { "RxFbCongestion", 34, 1 }, + { "TxFbCongestion", 33, 1 }, + { "TxPktSumSrdy", 32, 1 }, + { "RcfUlpType", 28, 4 }, + { "Eread", 27, 1 }, + { "Ebypass", 26, 1 }, + { "Esave", 25, 1 }, + { "Static0", 24, 1 }, + { "Cread", 23, 1 }, + { "Cbypass", 22, 1 }, + { "Csave", 21, 1 }, + { "CPktOut", 20, 1 }, + { "RxPagePoolFull", 18, 2 }, + { "RxLpbkPkt", 17, 1 }, + { "TxLpbkPkt", 16, 1 }, + { "RxVfValid", 15, 1 }, + { "SynLearned", 14, 1 }, + { "SetDelEntry", 13, 1 }, + { "SetInvEntry", 12, 1 }, + { "CpcmdDvld", 11, 1 }, + { "CpcmdSave", 10, 1 }, + { "RxPstructsFull", 8, 2 }, + { "EpcmdDvld", 7, 1 }, + { "EpcmdFlush", 6, 1 }, + { "EpcmdTrimPrefix", 5, 1 }, + { "EpcmdTrimPostfix", 4, 1 }, + { "ERssIp4Pkt", 3, 1 }, + { "ERssIp6Pkt", 2, 1 }, + { "ERssTcpUdpPkt", 1, 1 }, + { "ERssFceFipPkt", 0, 1 }, + { NULL } +}; + +static void +tp_la_show(struct sbuf *sb, uint64_t *p, int idx) +{ + + field_desc_show(sb, *p, tp_la0); +} + +static void +tp_la_show2(struct sbuf *sb, uint64_t *p, int idx) +{ + + if (idx) + sbuf_printf(sb, "\n"); + field_desc_show(sb, p[0], tp_la0); + if (idx < (TPLA_SIZE / 2 - 1) || p[1] != ~0ULL) + field_desc_show(sb, p[1], tp_la0); +} + +static void +tp_la_show3(struct sbuf *sb, uint64_t *p, int idx) +{ + + if (idx) + sbuf_printf(sb, "\n"); + field_desc_show(sb, p[0], tp_la0); + if (idx < (TPLA_SIZE / 2 - 1) || p[1] != ~0ULL) + field_desc_show(sb, p[1], (p[0] & (1 << 17)) ? tp_la2 : tp_la1); +} + +static int +sysctl_tp_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + uint64_t *buf, *p; + int rc; + u_int i, inc; + void (*show_func)(struct sbuf *, uint64_t *, int); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(TPLA_SIZE * sizeof(uint64_t), M_CXGBE, M_ZERO | M_WAITOK); + + t4_tp_read_la(sc, buf, NULL); + p = buf; + + switch (G_DBGLAMODE(t4_read_reg(sc, A_TP_DBG_LA_CONFIG))) { + case 2: + inc = 2; + show_func = tp_la_show2; + break; + case 3: + inc = 2; + show_func = tp_la_show3; + break; + default: + inc = 1; + show_func = tp_la_show; + } + + for (i = 0; i < TPLA_SIZE / inc; i++, p += inc) + (*show_func)(sb, p, i); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS) { @@ -5802,6 +6247,41 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) } static int +sysctl_ulprx_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + uint32_t *buf, *p; + int rc, i; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(ULPRX_LA_SIZE * 8 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_ulprx_read_la(sc, buf); + p = buf; + + sbuf_printf(sb, " Pcmd Type Message" + " Data"); + for (i = 0; i < ULPRX_LA_SIZE; i++, p += 8) { + sbuf_printf(sb, "\n%08x%08x %4x %08x %08x%08x%08x%08x", + p[1], p[0], p[2], p[3], p[7], p[6], p[5], p[4]); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 04:02:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E380C364; Sat, 1 Jun 2013 04:02:52 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC71DCD3; Sat, 1 Jun 2013 04:02:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5142pqp011662; Sat, 1 Jun 2013 04:02:51 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5142pA4011661; Sat, 1 Jun 2013 04:02:51 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201306010402.r5142pA4011661@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 1 Jun 2013 04:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251214 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 04:02:53 -0000 Author: gibbs Date: Sat Jun 1 04:02:51 2013 New Revision: 251214 URL: http://svnweb.freebsd.org/changeset/base/251214 Log: sys/dev/xen/blkfront/blkfront.c: Remove local, and incorrect, definition for the value of an invalid grant reference. Extract ring cleanup code into xbd_free_ring() function for symetry with xbd_alloc_ring(). This process also eliminated an initialized but unused variable. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 02:07:37 2013 (r251213) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:02:51 2013 (r251214) @@ -87,8 +87,6 @@ static void xbd_startio(struct xbd_softc #define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ #define XBD_SECTOR_SHFT 9 -#define GRANT_INVALID_REF 0 - /* Control whether runtime update of vbds is enabled. */ #define ENABLE_VBD_UPDATE 0 @@ -709,6 +707,24 @@ xbd_alloc_ring(struct xbd_softc *sc) return (0); } +static void +xbd_free_ring(struct xbd_softc *sc) +{ + int i; + + if (sc->xbd_ring.sring == NULL) + return; + + for (i = 0; i < sc->xbd_ring_pages; i++) { + if (sc->xbd_ring_ref[i] != GRANT_REF_INVALID) { + gnttab_end_foreign_access_ref(sc->xbd_ring_ref[i]); + sc->xbd_ring_ref[i] = GRANT_REF_INVALID; + } + } + free(sc->xbd_ring.sring, M_XENBLOCKFRONT); + sc->xbd_ring.sring = NULL; +} + /*-------------------------- Initialization/Teardown -------------------------*/ static void xbd_setup_sysctl(struct xbd_softc *xbd) @@ -846,7 +862,6 @@ xbd_instance_create(struct xbd_softc *sc static void xbd_free(struct xbd_softc *sc) { - uint8_t *sring_page_ptr; int i; /* Prevent new requests being issued until we fix things up. */ @@ -855,22 +870,7 @@ xbd_free(struct xbd_softc *sc) mtx_unlock(&sc->xbd_io_lock); /* Free resources associated with old device channel. */ - if (sc->xbd_ring.sring != NULL) { - sring_page_ptr = (uint8_t *)sc->xbd_ring.sring; - for (i = 0; i < sc->xbd_ring_pages; i++) { - grant_ref_t *ref; - - ref = &sc->xbd_ring_ref[i]; - if (*ref != GRANT_INVALID_REF) { - gnttab_end_foreign_access_ref(*ref); - *ref = GRANT_INVALID_REF; - } - sring_page_ptr += PAGE_SIZE; - } - free(sc->xbd_ring.sring, M_XENBLOCKFRONT); - sc->xbd_ring.sring = NULL; - } - + xbd_free_ring(sc); if (sc->xbd_shadow) { for (i = 0; i < sc->xbd_max_requests; i++) { @@ -1277,7 +1277,7 @@ xbd_attach(device_t dev) xbd_initq_complete(sc); xbd_initq_bio(sc); for (i = 0; i < XBD_MAX_RING_PAGES; i++) - sc->xbd_ring_ref[i] = GRANT_INVALID_REF; + sc->xbd_ring_ref[i] = GRANT_REF_INVALID; sc->xbd_dev = dev; sc->xbd_vdevice = vdevice; From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 04:07:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5178150F; Sat, 1 Jun 2013 04:07:57 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 436BCCEF; Sat, 1 Jun 2013 04:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5147vWs012814; Sat, 1 Jun 2013 04:07:57 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5147vGE012813; Sat, 1 Jun 2013 04:07:57 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201306010407.r5147vGE012813@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 1 Jun 2013 04:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251215 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 04:07:57 -0000 Author: gibbs Date: Sat Jun 1 04:07:56 2013 New Revision: 251215 URL: http://svnweb.freebsd.org/changeset/base/251215 Log: sys/dev/xen/blkfront/blkfront.c: Remove dead code. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:02:51 2013 (r251214) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:07:56 2013 (r251215) @@ -81,19 +81,8 @@ static void xbd_startio(struct xbd_softc #define DPRINTK(fmt, args...) #endif -/* XXX move to xbd_vbd.c when VBD update support is added */ -#define MAX_VBDS 64 - -#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ #define XBD_SECTOR_SHFT 9 -/* Control whether runtime update of vbds is enabled. */ -#define ENABLE_VBD_UPDATE 0 - -#if ENABLE_VBD_UPDATE -static void vbd_update(void); -#endif - #define XBD_STATE_DISCONNECTED 0 #define XBD_STATE_CONNECTED 1 #define XBD_STATE_SUSPENDED 2 From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 08:07:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B6B1C98; Sat, 1 Jun 2013 08:07:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDB35F9; Sat, 1 Jun 2013 08:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51879i0095185; Sat, 1 Jun 2013 08:07:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51879Gw095183; Sat, 1 Jun 2013 08:07:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306010807.r51879Gw095183@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Jun 2013 08:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251216 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 08:07:09 -0000 Author: ed Date: Sat Jun 1 08:07:09 2013 New Revision: 251216 URL: http://svnweb.freebsd.org/changeset/base/251216 Log: Pull in r183033 and r183036 from LLVM trunk: Add support for optimized (non-generic) atomic libcalls. For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc) provide atomic functions that pass parameters by value and return results directly. libgcc and libcompiler-rt only provide optimized libcalls for __atomic_fetch_*, as generic libcalls on non-integer types would make little sense. This means that we can finally make __atomic_fetch_* work on architectures for which we don't provide these operations as builtins (e.g. ARM). This should fix the dreaded "cannot compile this atomic library call yet" error that would pop up once every while. This should make it possible for me to get C11 atomics working on all of our platforms. Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Sat Jun 1 04:07:56 2013 (r251215) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Sat Jun 1 08:07:09 2013 (r251216) @@ -15,6 +15,7 @@ #include "CGCall.h" #include "CodeGenModule.h" #include "clang/AST/ASTContext.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Operator.h" @@ -317,6 +318,21 @@ EmitValToTemp(CodeGenFunction &CGF, Expr return DeclPtr; } +static void +AddDirectArgument(CodeGenFunction &CGF, CallArgList &Args, + bool UseOptimizedLibcall, llvm::Value *Val, QualType ValTy) { + if (UseOptimizedLibcall) { + // Load value and pass it to the function directly. + unsigned Align = CGF.getContext().getTypeAlignInChars(ValTy).getQuantity(); + Val = CGF.EmitLoadOfScalar(Val, false, Align, ValTy); + Args.add(RValue::get(Val), ValTy); + } else { + // Non-optimized functions always take a reference. + Args.add(RValue::get(CGF.EmitCastToVoidPtr(Val)), + CGF.getContext().VoidPtrTy); + } +} + RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest) { QualType AtomicTy = E->getPtr()->getType()->getPointeeType(); QualType MemTy = AtomicTy; @@ -424,76 +440,137 @@ RValue CodeGenFunction::EmitAtomicExpr(A // Use a library call. See: http://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary . if (UseLibcall) { + bool UseOptimizedLibcall = false; + switch (E->getOp()) { + case AtomicExpr::AO__c11_atomic_fetch_add: + case AtomicExpr::AO__atomic_fetch_add: + case AtomicExpr::AO__c11_atomic_fetch_and: + case AtomicExpr::AO__atomic_fetch_and: + case AtomicExpr::AO__c11_atomic_fetch_or: + case AtomicExpr::AO__atomic_fetch_or: + case AtomicExpr::AO__c11_atomic_fetch_sub: + case AtomicExpr::AO__atomic_fetch_sub: + case AtomicExpr::AO__c11_atomic_fetch_xor: + case AtomicExpr::AO__atomic_fetch_xor: + // For these, only library calls for certain sizes exist. + UseOptimizedLibcall = true; + break; + default: + // Only use optimized library calls for sizes for which they exist. + if (Size == 1 || Size == 2 || Size == 4 || Size == 8) + UseOptimizedLibcall = true; + break; + } - SmallVector Params; CallArgList Args; - // Size is always the first parameter - Args.add(RValue::get(llvm::ConstantInt::get(SizeTy, Size)), - getContext().getSizeType()); - // Atomic address is always the second parameter + if (!UseOptimizedLibcall) { + // For non-optimized library calls, the size is the first parameter + Args.add(RValue::get(llvm::ConstantInt::get(SizeTy, Size)), + getContext().getSizeType()); + } + // Atomic address is the first or second parameter Args.add(RValue::get(EmitCastToVoidPtr(Ptr)), getContext().VoidPtrTy); - const char* LibCallName; - QualType RetTy = getContext().VoidTy; + std::string LibCallName; + QualType RetTy; + bool HaveRetTy = false; switch (E->getOp()) { // There is only one libcall for compare an exchange, because there is no // optimisation benefit possible from a libcall version of a weak compare // and exchange. - // bool __atomic_compare_exchange(size_t size, void *obj, void *expected, + // bool __atomic_compare_exchange(size_t size, void *mem, void *expected, // void *desired, int success, int failure) + // bool __atomic_compare_exchange_N(T *mem, T *expected, T desired, + // int success, int failure) case AtomicExpr::AO__c11_atomic_compare_exchange_weak: case AtomicExpr::AO__c11_atomic_compare_exchange_strong: case AtomicExpr::AO__atomic_compare_exchange: case AtomicExpr::AO__atomic_compare_exchange_n: LibCallName = "__atomic_compare_exchange"; RetTy = getContext().BoolTy; + HaveRetTy = true; Args.add(RValue::get(EmitCastToVoidPtr(Val1)), getContext().VoidPtrTy); - Args.add(RValue::get(EmitCastToVoidPtr(Val2)), - getContext().VoidPtrTy); + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val2, MemTy); Args.add(RValue::get(Order), getContext().IntTy); Order = OrderFail; break; // void __atomic_exchange(size_t size, void *mem, void *val, void *return, // int order) + // T __atomic_exchange_N(T *mem, T val, int order) case AtomicExpr::AO__c11_atomic_exchange: case AtomicExpr::AO__atomic_exchange_n: case AtomicExpr::AO__atomic_exchange: LibCallName = "__atomic_exchange"; - Args.add(RValue::get(EmitCastToVoidPtr(Val1)), - getContext().VoidPtrTy); - Args.add(RValue::get(EmitCastToVoidPtr(Dest)), - getContext().VoidPtrTy); + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); break; // void __atomic_store(size_t size, void *mem, void *val, int order) + // void __atomic_store_N(T *mem, T val, int order) case AtomicExpr::AO__c11_atomic_store: case AtomicExpr::AO__atomic_store: case AtomicExpr::AO__atomic_store_n: LibCallName = "__atomic_store"; - Args.add(RValue::get(EmitCastToVoidPtr(Val1)), - getContext().VoidPtrTy); + RetTy = getContext().VoidTy; + HaveRetTy = true; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); break; // void __atomic_load(size_t size, void *mem, void *return, int order) + // T __atomic_load_N(T *mem, int order) case AtomicExpr::AO__c11_atomic_load: case AtomicExpr::AO__atomic_load: case AtomicExpr::AO__atomic_load_n: LibCallName = "__atomic_load"; - Args.add(RValue::get(EmitCastToVoidPtr(Dest)), - getContext().VoidPtrTy); break; -#if 0 - // These are only defined for 1-16 byte integers. It is not clear what - // their semantics would be on anything else... - case AtomicExpr::Add: LibCallName = "__atomic_fetch_add_generic"; break; - case AtomicExpr::Sub: LibCallName = "__atomic_fetch_sub_generic"; break; - case AtomicExpr::And: LibCallName = "__atomic_fetch_and_generic"; break; - case AtomicExpr::Or: LibCallName = "__atomic_fetch_or_generic"; break; - case AtomicExpr::Xor: LibCallName = "__atomic_fetch_xor_generic"; break; -#endif + // T __atomic_fetch_add_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_add: + case AtomicExpr::AO__atomic_fetch_add: + LibCallName = "__atomic_fetch_add"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_and_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_and: + case AtomicExpr::AO__atomic_fetch_and: + LibCallName = "__atomic_fetch_and"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_or_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_or: + case AtomicExpr::AO__atomic_fetch_or: + LibCallName = "__atomic_fetch_or"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_sub_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_sub: + case AtomicExpr::AO__atomic_fetch_sub: + LibCallName = "__atomic_fetch_sub"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_xor_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_xor: + case AtomicExpr::AO__atomic_fetch_xor: + LibCallName = "__atomic_fetch_xor"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; default: return EmitUnsupportedRValue(E, "atomic library call"); } + + // Optimized functions have the size in their name. + if (UseOptimizedLibcall) + LibCallName += "_" + llvm::utostr(Size); + // By default, assume we return a value of the atomic type. + if (!HaveRetTy) { + if (UseOptimizedLibcall) { + // Value is returned directly. + RetTy = MemTy; + } else { + // Value is returned through parameter before the order. + RetTy = getContext().VoidTy; + Args.add(RValue::get(EmitCastToVoidPtr(Dest)), + getContext().VoidPtrTy); + } + } // order is always the last parameter Args.add(RValue::get(Order), getContext().IntTy); @@ -504,7 +581,7 @@ RValue CodeGenFunction::EmitAtomicExpr(A llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FuncInfo); llvm::Constant *Func = CGM.CreateRuntimeFunction(FTy, LibCallName); RValue Res = EmitCall(FuncInfo, Func, ReturnValueSlot(), Args); - if (E->isCmpXChg()) + if (!RetTy->isVoidType()) return Res; if (E->getType()->isVoidType()) return RValue::get(0); From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 10:57:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64670D18; Sat, 1 Jun 2013 10:57:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53690AA0; Sat, 1 Jun 2013 10:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51AvQJH053348; Sat, 1 Jun 2013 10:57:26 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51AvPxE053344; Sat, 1 Jun 2013 10:57:25 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306011057.r51AvPxE053344@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 10:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251217 - in releng/8.4/release/doc/en_US.ISO8859-1: errata relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 10:57:26 -0000 Author: hrs Date: Sat Jun 1 10:57:25 2013 New Revision: 251217 URL: http://svnweb.freebsd.org/changeset/base/251217 Log: Document SA-12:01 to :08 and SA-13:02 to :05. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/errata/article.xml releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/8.4/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 1 08:07:09 2013 (r251216) +++ releng/8.4/release/doc/en_US.ISO8859-1/errata/article.xml Sat Jun 1 10:57:25 2013 (r251217) @@ -14,7 +14,7 @@ ]]> - + ]]> ]> @@ -125,18 +125,15 @@ Security Advisories - No advisory. - - Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 08:07:09 2013 (r251216) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 10:57:25 2013 (r251217) @@ -119,31 +119,130 @@ advisories available from . - From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:10:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C951F16; Sat, 1 Jun 2013 11:10:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F34DAF7; Sat, 1 Jun 2013 11:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51BAfLQ059284; Sat, 1 Jun 2013 11:10:41 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BAfsp059283; Sat, 1 Jun 2013 11:10:41 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306011110.r51BAfsp059283@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 11:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251218 - releng/8.4/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:10:41 -0000 Author: hrs Date: Sat Jun 1 11:10:40 2013 New Revision: 251218 URL: http://svnweb.freebsd.org/changeset/base/251218 Log: Trim copyright year. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Jun 1 10:57:25 2013 (r251217) +++ releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Jun 1 11:10:40 2013 (r251218) @@ -18,19 +18,6 @@ $FreeBSD$ - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 2013 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:14:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AFDE7138; Sat, 1 Jun 2013 11:14:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A27FCB0A; Sat, 1 Jun 2013 11:14:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51BEZFW060140; Sat, 1 Jun 2013 11:14:35 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BEZ4A060139; Sat, 1 Jun 2013 11:14:35 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306011114.r51BEZ4A060139@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 11:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251219 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:14:35 -0000 Author: hrs Date: Sat Jun 1 11:14:35 2013 New Revision: 251219 URL: http://svnweb.freebsd.org/changeset/base/251219 Log: Update relnotes item: kernel thread CPU affinity configuration bug fixed, run(4) Logitec LAN-W300NU2 support, IPv6 multi-FIB support, SO_PROTOCOL/SO_PROTOTYPE sockopt added, isci(4) more Intel C600 chip ids added, mpt(4) and mfi(4) attach conflict issue fixed, nullfs(5) panic fixed, rc.d scripts' ^T output goes to stderr, and tcsh updated to 6.18.01. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 11:10:40 2013 (r251218) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 11:14:35 2013 (r251219) @@ -248,7 +248,8 @@ Kernel Changes - + A bug which could cause a kernel thread + to have a wrong CPU affinity configuration has been fixed. Boot Loader Changes @@ -270,25 +271,44 @@ Network Interface Support - + The &man.run.4; driver now supports + Logitec LAN-W300NU2. Network Protocols - + &os; IPv6 stack now supports multiple + FIBs. One can use &man.setfib.1; to select a different + routing table for IPv6. + + SO_PROTOCOL and + SO_PROTOTYPE socket option have been + added. These are socket level options to get the protocol + number found in Linux or + Solaris. For more detail, see + &man.setsockopt.2; manual page. Disks and Storage - + The &man.isci.4; driver now supports + Intel C600 Serial Attached SCSI controllers with chip IDs from + 0x1d6c to 0x1d6f. + + A bug which could make the &man.mpt.4; + driver attach LSI MegaRAID cards which should be handled by + the &man.mfi.4; driver has been fixed. File Systems + Several bugs in &man.nullfs.5; which + could cause a system panic have been fixed. + ZFS is upgraded to support zpool feature flags. ZFS pool creation defaults to version 28 allowing upgrades to &os; 9.1-RELEASE, which does not support @@ -328,6 +348,17 @@ + + <filename>/etc/rc.d</filename> Scripts + + The rc.d scripts + now display script filename + running to standard error when + SIGINFO is issued. This message was sent + to standard output and could prevent redirection from + working. + + <filename>/etc/periodic</filename> Scripts @@ -338,7 +369,8 @@ Contributed Software - + TENEX C shell + (&man.tcsh.1;) has been updated to version 6.18.01. From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:27:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3ACD1500; Sat, 1 Jun 2013 11:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 160B3BDA; Sat, 1 Jun 2013 11:27:56 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-244.nwrknj.fios.verizon.net [173.70.85.244]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0B43CB987; Sat, 1 Jun 2013 07:27:54 -0400 (EDT) From: John Baldwin To: Navdeep Parhar Subject: Re: svn commit: r251191 - in stable/9/sys: conf x86/acpica Date: Sat, 1 Jun 2013 07:26:40 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201305311913.r4VJDNCx025746@svn.freebsd.org> <51A8F7EF.8030804@FreeBSD.org> In-Reply-To: <51A8F7EF.8030804@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201306010726.41079.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 01 Jun 2013 07:27:54 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:27:56 -0000 On Friday, May 31, 2013 03:20:15 PM Navdeep Parhar wrote: > On 05/31/13 12:13, John Baldwin wrote: > > Author: jhb > > Date: Fri May 31 19:13:22 2013 > > New Revision: 251191 > > URL: http://svnweb.freebsd.org/changeset/base/251191 > > > > Log: > > MFC 246805: > > Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel > > config file. > > Is this going to live long in 9? Or will be replaced with MAXMEMDOM > like it was in head? I do not expect the NUMA changes in 10 to be merged to 9. We could perhaps rename the option here to match, though they have different semantics (the old stuff is first-touch rather than round-robin). There are actually folks using the older stuff in production it turns out (not just my employer), so having it as an option still makes sense I think. If avoiding a future name change seems more important then I'm fine with merging the name change. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:27:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48881505; Sat, 1 Jun 2013 11:27:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2665EBDD; Sat, 1 Jun 2013 11:27:58 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-244.nwrknj.fios.verizon.net [173.70.85.244]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7E0E5B94F; Sat, 1 Jun 2013 07:27:53 -0400 (EDT) From: John Baldwin To: "David E. O'Brien" Subject: Re: svn commit: r251198 - head/sys/compat/freebsd32 Date: Sat, 1 Jun 2013 07:18:43 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201305312143.r4VLhIAr077972@svn.freebsd.org> In-Reply-To: <201305312143.r4VLhIAr077972@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201306010718.43795.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 01 Jun 2013 07:27:53 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:27:58 -0000 On Friday, May 31, 2013 05:43:18 PM David E. O'Brien wrote: > Author: obrien > Date: Fri May 31 21:43:17 2013 > New Revision: 251198 > URL: http://svnweb.freebsd.org/changeset/base/251198 > > Log: > Add a "kern.features" MIB for 32bit support under a 64bit kernel. I suggest calling it 'compat_freebsd32' to match the kernel option name. We've already decided that compat_freebsd32 does not actually mean compatiblity with FreeBSD 32.x in terms of our kernel option naming. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:31:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D143F7FE; Sat, 1 Jun 2013 11:31:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33B9DBF4; Sat, 1 Jun 2013 11:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51BVAso066368; Sat, 1 Jun 2013 11:31:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BVAI8066367; Sat, 1 Jun 2013 11:31:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306011131.r51BVAI8066367@svn.freebsd.org> From: John Baldwin Date: Sat, 1 Jun 2013 11:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251220 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:31:10 -0000 Author: jhb Date: Sat Jun 1 11:31:09 2013 New Revision: 251220 URL: http://svnweb.freebsd.org/changeset/base/251220 Log: Remove an unused macro we originally got from BSD/OS. Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Jun 1 11:14:35 2013 (r251219) +++ head/sys/sys/mutex.h Sat Jun 1 11:31:09 2013 (r251220) @@ -426,12 +426,6 @@ do { \ } #endif -#define UGAR(rval) do { \ - int _val = (rval); \ - mtx_unlock(&Giant); \ - return (_val); \ -} while (0) - struct mtx_args { void *ma_mtx; const char *ma_desc; From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 11:42:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 27FC7B64; Sat, 1 Jun 2013 11:42:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD60C47; Sat, 1 Jun 2013 11:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51Bglcm070028; Sat, 1 Jun 2013 11:42:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BglSK070027; Sat, 1 Jun 2013 11:42:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306011142.r51BglSK070027@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Jun 2013 11:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251221 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:42:48 -0000 Author: marius Date: Sat Jun 1 11:42:47 2013 New Revision: 251221 URL: http://svnweb.freebsd.org/changeset/base/251221 Log: Move an assertion to the right spot; only bus_dmamap_load_mbuf(9) requires a pkthdr being present but that's not the case for either _bus_dmamap_load_mbuf_sg() or bus_dmamap_load_mbuf_sg(9). Reported by: sbruno MFC after: 1 week Modified: head/sys/kern/subr_bus_dma.c Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sat Jun 1 11:31:09 2013 (r251220) +++ head/sys/kern/subr_bus_dma.c Sat Jun 1 11:42:47 2013 (r251221) @@ -104,8 +104,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d struct mbuf *m; int error; - M_ASSERTPKTHDR(m0); - error = 0; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { @@ -323,6 +321,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dma_segment_t *segs; int nsegs, error; + M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; nsegs = -1; error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, NULL, &nsegs, flags); From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 12:22:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3ADCA2AC; Sat, 1 Jun 2013 12:22:00 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0A5E10; Sat, 1 Jun 2013 12:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51CM0L0085050; Sat, 1 Jun 2013 12:22:00 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51CM0uN085044; Sat, 1 Jun 2013 12:22:00 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201306011222.r51CM0uN085044@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 1 Jun 2013 12:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251222 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 12:22:00 -0000 Author: nyan Date: Sat Jun 1 12:21:59 2013 New Revision: 251222 URL: http://svnweb.freebsd.org/changeset/base/251222 Log: MFi386: revision 251039 Use slightly more idiomatic expression to get the address of array. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Jun 1 11:42:47 2013 (r251221) +++ head/sys/pc98/pc98/machdep.c Sat Jun 1 12:21:59 2013 (r251222) @@ -2789,7 +2789,7 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 12:27:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79CD0472; Sat, 1 Jun 2013 12:27:49 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53CA1E27; Sat, 1 Jun 2013 12:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51CRm1p086046; Sat, 1 Jun 2013 12:27:48 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51CRmtv086045; Sat, 1 Jun 2013 12:27:48 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201306011227.r51CRmtv086045@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 1 Jun 2013 12:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251223 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 12:27:49 -0000 Author: nyan Date: Sat Jun 1 12:27:48 2013 New Revision: 251223 URL: http://svnweb.freebsd.org/changeset/base/251223 Log: MFi386: revision 245848 Always update the hw.uart.console hint. Modified: head/sys/boot/pc98/libpc98/comconsole.c Modified: head/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- head/sys/boot/pc98/libpc98/comconsole.c Sat Jun 1 12:21:59 2013 (r251222) +++ head/sys/boot/pc98/libpc98/comconsole.c Sat Jun 1 12:27:48 2013 (r251223) @@ -50,7 +50,6 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); -static void set_hw_console_hint(void); static int comc_ischar(void); static int comc_parseint(const char *string); static uint32_t comc_parse_pcidev(const char *string); @@ -202,27 +201,14 @@ comc_port_set(struct env_var *ev, int fl } if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_port != port) { + comc_port != port) comc_setup(comc_curspeed, port); - set_hw_console_hint(); - } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); return (CMD_OK); } -static void -set_hw_console_hint(void) -{ - char intbuf[64]; - - unsetenv("hw.uart.console"); - sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); - env_setenv("hw.uart.console", EV_VOLATILE, intbuf, - env_noset, env_nounset); -} - /* * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] @@ -288,7 +274,6 @@ comc_pcidev_handle(uint32_t locator) comc_port_set, env_nounset); comc_setup(comc_curspeed, port); - set_hw_console_hint(); comc_locator = locator; return (CMD_OK); @@ -318,8 +303,10 @@ static void comc_setup(int speed, int port) { static int TRY_COUNT = 1000000; + char intbuf[64]; int tries; + unsetenv("hw.uart.console"); comc_curspeed = speed; comc_port = port; @@ -334,9 +321,11 @@ comc_setup(int speed, int port) inb(comc_port + com_data); while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); - if (tries < TRY_COUNT) + if (tries < TRY_COUNT) { comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); - else + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); + } else comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 13:10:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C286DF1; Sat, 1 Jun 2013 13:10:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2FDAF68; Sat, 1 Jun 2013 13:10:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51DAPDf000729; Sat, 1 Jun 2013 13:10:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51DAPc7000724; Sat, 1 Jun 2013 13:10:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306011310.r51DAPc7000724@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Jun 2013 13:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251224 - stable/9/sys/dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 13:10:26 -0000 Author: marius Date: Sat Jun 1 13:10:24 2013 New Revision: 251224 URL: http://svnweb.freebsd.org/changeset/base/251224 Log: MFC: r249203 (partial) - Make ata_str2mode() static, it's not used outside of ata-all.c. - Move ata_timeout() to ata-all.c so we don't need to expose both this function and ata_cam_end_transaction() but only the former. - Move ata_cmd2str() from ata-queue.c to ata-all.c. - Add some missing prototypes. Modified: stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ata/ata-all.h stable/9/sys/dev/ata/ata-lowlevel.c stable/9/sys/dev/ata/ata-queue.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-all.c Sat Jun 1 13:10:24 2013 (r251224) @@ -72,22 +72,26 @@ static struct cdevsw ata_cdevsw = { /* prototypes */ #ifndef ATA_CAM +static void bswap(int8_t *, int); +static void btrim(int8_t *, int); +static void bpack(int8_t *, int8_t *, int); static void ata_boot_attach(void); static device_t ata_add_child(device_t, struct ata_device *, int); #else static void ataaction(struct cam_sim *sim, union ccb *ccb); static void atapoll(struct cam_sim *sim); +static void ata_cam_begin_transaction(device_t dev, union ccb *ccb); +static void ata_cam_end_transaction(device_t dev, struct ata_request *request); +static void ata_cam_request_sense(device_t dev, struct ata_request *request); +static int ata_check_ids(device_t dev, union ccb *ccb); +static void ata_periodic_poll(void *data); #endif static void ata_conn_event(void *, int); -#ifndef ATA_CAM -static void bswap(int8_t *, int); -static void btrim(int8_t *, int); -static void bpack(int8_t *, int8_t *, int); -#endif +static void ata_init(void); static void ata_interrupt_locked(void *data); -#ifdef ATA_CAM -static void ata_periodic_poll(void *data); -#endif +static int ata_module_event_handler(module_t mod, int what, void *arg); +static int ata_str2mode(const char *str); +static void ata_uninit(void); /* global vars */ MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer"); @@ -1246,6 +1250,120 @@ ata_unit2str(struct ata_device *atadev) #endif const char * +ata_cmd2str(struct ata_request *request) +{ + static char buffer[20]; + + if (request->flags & ATA_R_ATAPI) { + switch (request->u.atapi.sense.key ? + request->u.atapi.saved_cmd : request->u.atapi.ccb[0]) { + case 0x00: return ("TEST_UNIT_READY"); + case 0x01: return ("REZERO"); + case 0x03: return ("REQUEST_SENSE"); + case 0x04: return ("FORMAT"); + case 0x08: return ("READ"); + case 0x0a: return ("WRITE"); + case 0x10: return ("WEOF"); + case 0x11: return ("SPACE"); + case 0x12: return ("INQUIRY"); + case 0x15: return ("MODE_SELECT"); + case 0x19: return ("ERASE"); + case 0x1a: return ("MODE_SENSE"); + case 0x1b: return ("START_STOP"); + case 0x1e: return ("PREVENT_ALLOW"); + case 0x23: return ("ATAPI_READ_FORMAT_CAPACITIES"); + case 0x25: return ("READ_CAPACITY"); + case 0x28: return ("READ_BIG"); + case 0x2a: return ("WRITE_BIG"); + case 0x2b: return ("LOCATE"); + case 0x34: return ("READ_POSITION"); + case 0x35: return ("SYNCHRONIZE_CACHE"); + case 0x3b: return ("WRITE_BUFFER"); + case 0x3c: return ("READ_BUFFER"); + case 0x42: return ("READ_SUBCHANNEL"); + case 0x43: return ("READ_TOC"); + case 0x45: return ("PLAY_10"); + case 0x47: return ("PLAY_MSF"); + case 0x48: return ("PLAY_TRACK"); + case 0x4b: return ("PAUSE"); + case 0x51: return ("READ_DISK_INFO"); + case 0x52: return ("READ_TRACK_INFO"); + case 0x53: return ("RESERVE_TRACK"); + case 0x54: return ("SEND_OPC_INFO"); + case 0x55: return ("MODE_SELECT_BIG"); + case 0x58: return ("REPAIR_TRACK"); + case 0x59: return ("READ_MASTER_CUE"); + case 0x5a: return ("MODE_SENSE_BIG"); + case 0x5b: return ("CLOSE_TRACK/SESSION"); + case 0x5c: return ("READ_BUFFER_CAPACITY"); + case 0x5d: return ("SEND_CUE_SHEET"); + case 0x96: return ("SERVICE_ACTION_IN"); + case 0xa1: return ("BLANK_CMD"); + case 0xa3: return ("SEND_KEY"); + case 0xa4: return ("REPORT_KEY"); + case 0xa5: return ("PLAY_12"); + case 0xa6: return ("LOAD_UNLOAD"); + case 0xad: return ("READ_DVD_STRUCTURE"); + case 0xb4: return ("PLAY_CD"); + case 0xbb: return ("SET_SPEED"); + case 0xbd: return ("MECH_STATUS"); + case 0xbe: return ("READ_CD"); + case 0xff: return ("POLL_DSC"); + } + } else { + switch (request->u.ata.command) { + case 0x00: return ("NOP"); + case 0x08: return ("DEVICE_RESET"); + case 0x20: return ("READ"); + case 0x24: return ("READ48"); + case 0x25: return ("READ_DMA48"); + case 0x26: return ("READ_DMA_QUEUED48"); + case 0x27: return ("READ_NATIVE_MAX_ADDRESS48"); + case 0x29: return ("READ_MUL48"); + case 0x30: return ("WRITE"); + case 0x34: return ("WRITE48"); + case 0x35: return ("WRITE_DMA48"); + case 0x36: return ("WRITE_DMA_QUEUED48"); + case 0x37: return ("SET_MAX_ADDRESS48"); + case 0x39: return ("WRITE_MUL48"); + case 0x70: return ("SEEK"); + case 0xa0: return ("PACKET_CMD"); + case 0xa1: return ("ATAPI_IDENTIFY"); + case 0xa2: return ("SERVICE"); + case 0xb0: return ("SMART"); + case 0xc0: return ("CFA ERASE"); + case 0xc4: return ("READ_MUL"); + case 0xc5: return ("WRITE_MUL"); + case 0xc6: return ("SET_MULTI"); + case 0xc7: return ("READ_DMA_QUEUED"); + case 0xc8: return ("READ_DMA"); + case 0xca: return ("WRITE_DMA"); + case 0xcc: return ("WRITE_DMA_QUEUED"); + case 0xe6: return ("SLEEP"); + case 0xe7: return ("FLUSHCACHE"); + case 0xea: return ("FLUSHCACHE48"); + case 0xec: return ("ATA_IDENTIFY"); + case 0xef: + switch (request->u.ata.feature) { + case 0x03: return ("SETFEATURES SET TRANSFER MODE"); + case 0x02: return ("SETFEATURES ENABLE WCACHE"); + case 0x82: return ("SETFEATURES DISABLE WCACHE"); + case 0xaa: return ("SETFEATURES ENABLE RCACHE"); + case 0x55: return ("SETFEATURES DISABLE RCACHE"); + } + sprintf(buffer, "SETFEATURES 0x%02x", + request->u.ata.feature); + return (buffer); + case 0xf5: return ("SECURITY_FREE_LOCK"); + case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); + case 0xf9: return ("SET_MAX_ADDRESS"); + } + } + sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); + return (buffer); +} + +const char * ata_mode2str(int mode) { switch (mode) { @@ -1275,7 +1393,7 @@ ata_mode2str(int mode) } } -int +static int ata_str2mode(const char *str) { @@ -1463,6 +1581,40 @@ bpack(int8_t *src, int8_t *dst, int len) } #endif +void +ata_timeout(struct ata_request *request) +{ + struct ata_channel *ch; + + ch = device_get_softc(request->parent); + //request->flags |= ATA_R_DEBUG; + ATA_DEBUG_RQ(request, "timeout"); + + /* + * If we have an ATA_ACTIVE request running, we flag the request + * ATA_R_TIMEOUT so ata_cam_end_transaction()/ata_finish() will handle + * it correctly. + * Also, NULL out the running request so we wont loose the race with + * an eventual interrupt arriving late. + */ + if (ch->state == ATA_ACTIVE) { + request->flags |= ATA_R_TIMEOUT; + if (ch->dma.unload) + ch->dma.unload(request); + ch->running = NULL; + ch->state = ATA_IDLE; +#ifdef ATA_CAM + ata_cam_end_transaction(ch->dev, request); +#endif + mtx_unlock(&ch->state_mtx); +#ifndef ATA_CAM + ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); + ata_finish(request); +#endif + } else + mtx_unlock(&ch->state_mtx); +} + #ifdef ATA_CAM static void ata_cam_begin_transaction(device_t dev, union ccb *ccb) @@ -1620,7 +1772,7 @@ ata_cam_process_sense(device_t dev, stru ata_reinit(dev); } -void +static void ata_cam_end_transaction(device_t dev, struct ata_request *request) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/9/sys/dev/ata/ata-all.h ============================================================================== --- stable/9/sys/dev/ata/ata-all.h Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-all.h Sat Jun 1 13:10:24 2013 (r251224) @@ -625,12 +625,13 @@ int ata_getparam(struct ata_device *atad void ata_default_registers(device_t dev); void ata_udelay(int interval); const char *ata_unit2str(struct ata_device *atadev); +const char *ata_cmd2str(struct ata_request *request); const char *ata_mode2str(int mode); void ata_setmode(device_t dev); void ata_print_cable(device_t dev, u_int8_t *who); -int ata_str2mode(const char *str); const char *ata_satarev2str(int rev); int ata_atapi(device_t dev, int target); +void ata_timeout(struct ata_request *); #ifndef ATA_CAM int ata_identify(device_t dev); void ata_modify_if_48bit(struct ata_request *request); @@ -639,8 +640,6 @@ int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); int ata_limit_mode(device_t dev, int mode, int maxmode); int ata_check_80pin(device_t dev, int mode); -#else -void ata_cam_end_transaction(device_t dev, struct ata_request *request); #endif /* ata-queue.c: */ @@ -649,11 +648,9 @@ int ata_atapicmd(device_t dev, u_int8_t void ata_queue_request(struct ata_request *request); void ata_start(device_t dev); void ata_finish(struct ata_request *request); -void ata_timeout(struct ata_request *); void ata_catch_inflight(device_t dev); void ata_fail_requests(device_t dev); void ata_drop_requests(device_t dev); -const char *ata_cmd2str(struct ata_request *request); /* ata-lowlevel.c: */ void ata_generic_hw(device_t dev); Modified: stable/9/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/9/sys/dev/ata/ata-lowlevel.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-lowlevel.c Sat Jun 1 13:10:24 2013 (r251224) @@ -605,7 +605,7 @@ ata_generic_reset(device_t dev) } /* must be called with ATA channel locked and state_mtx held */ -int +static int ata_generic_status(device_t dev) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/9/sys/dev/ata/ata-queue.c ============================================================================== --- stable/9/sys/dev/ata/ata-queue.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-queue.c Sat Jun 1 13:10:24 2013 (r251224) @@ -510,40 +510,6 @@ ata_completed(void *context, int dummy) } #endif -void -ata_timeout(struct ata_request *request) -{ - struct ata_channel *ch = device_get_softc(request->parent); - - //request->flags |= ATA_R_DEBUG; - ATA_DEBUG_RQ(request, "timeout"); - - /* - * if we have an ATA_ACTIVE request running, we flag the request - * ATA_R_TIMEOUT so ata_finish will handle it correctly - * also NULL out the running request so we wont loose - * the race with an eventual interrupt arriving late - */ - if (ch->state == ATA_ACTIVE) { - request->flags |= ATA_R_TIMEOUT; - if (ch->dma.unload) - ch->dma.unload(request); - ch->running = NULL; - ch->state = ATA_IDLE; -#ifdef ATA_CAM - ata_cam_end_transaction(ch->dev, request); -#endif - mtx_unlock(&ch->state_mtx); -#ifndef ATA_CAM - ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); - ata_finish(request); -#endif - } - else { - mtx_unlock(&ch->state_mtx); - } -} - #ifndef ATA_CAM void ata_fail_requests(device_t dev) @@ -684,120 +650,6 @@ ata_sort_queue(struct ata_channel *ch, s } #endif -const char * -ata_cmd2str(struct ata_request *request) -{ - static char buffer[20]; - - if (request->flags & ATA_R_ATAPI) { - switch (request->u.atapi.sense.key ? - request->u.atapi.saved_cmd : request->u.atapi.ccb[0]) { - case 0x00: return ("TEST_UNIT_READY"); - case 0x01: return ("REZERO"); - case 0x03: return ("REQUEST_SENSE"); - case 0x04: return ("FORMAT"); - case 0x08: return ("READ"); - case 0x0a: return ("WRITE"); - case 0x10: return ("WEOF"); - case 0x11: return ("SPACE"); - case 0x12: return ("INQUIRY"); - case 0x15: return ("MODE_SELECT"); - case 0x19: return ("ERASE"); - case 0x1a: return ("MODE_SENSE"); - case 0x1b: return ("START_STOP"); - case 0x1e: return ("PREVENT_ALLOW"); - case 0x23: return ("ATAPI_READ_FORMAT_CAPACITIES"); - case 0x25: return ("READ_CAPACITY"); - case 0x28: return ("READ_BIG"); - case 0x2a: return ("WRITE_BIG"); - case 0x2b: return ("LOCATE"); - case 0x34: return ("READ_POSITION"); - case 0x35: return ("SYNCHRONIZE_CACHE"); - case 0x3b: return ("WRITE_BUFFER"); - case 0x3c: return ("READ_BUFFER"); - case 0x42: return ("READ_SUBCHANNEL"); - case 0x43: return ("READ_TOC"); - case 0x45: return ("PLAY_10"); - case 0x47: return ("PLAY_MSF"); - case 0x48: return ("PLAY_TRACK"); - case 0x4b: return ("PAUSE"); - case 0x51: return ("READ_DISK_INFO"); - case 0x52: return ("READ_TRACK_INFO"); - case 0x53: return ("RESERVE_TRACK"); - case 0x54: return ("SEND_OPC_INFO"); - case 0x55: return ("MODE_SELECT_BIG"); - case 0x58: return ("REPAIR_TRACK"); - case 0x59: return ("READ_MASTER_CUE"); - case 0x5a: return ("MODE_SENSE_BIG"); - case 0x5b: return ("CLOSE_TRACK/SESSION"); - case 0x5c: return ("READ_BUFFER_CAPACITY"); - case 0x5d: return ("SEND_CUE_SHEET"); - case 0x96: return ("SERVICE_ACTION_IN"); - case 0xa1: return ("BLANK_CMD"); - case 0xa3: return ("SEND_KEY"); - case 0xa4: return ("REPORT_KEY"); - case 0xa5: return ("PLAY_12"); - case 0xa6: return ("LOAD_UNLOAD"); - case 0xad: return ("READ_DVD_STRUCTURE"); - case 0xb4: return ("PLAY_CD"); - case 0xbb: return ("SET_SPEED"); - case 0xbd: return ("MECH_STATUS"); - case 0xbe: return ("READ_CD"); - case 0xff: return ("POLL_DSC"); - } - } - else { - switch (request->u.ata.command) { - case 0x00: return ("NOP"); - case 0x08: return ("DEVICE_RESET"); - case 0x20: return ("READ"); - case 0x24: return ("READ48"); - case 0x25: return ("READ_DMA48"); - case 0x26: return ("READ_DMA_QUEUED48"); - case 0x27: return ("READ_NATIVE_MAX_ADDRESS48"); - case 0x29: return ("READ_MUL48"); - case 0x30: return ("WRITE"); - case 0x34: return ("WRITE48"); - case 0x35: return ("WRITE_DMA48"); - case 0x36: return ("WRITE_DMA_QUEUED48"); - case 0x37: return ("SET_MAX_ADDRESS48"); - case 0x39: return ("WRITE_MUL48"); - case 0x70: return ("SEEK"); - case 0xa0: return ("PACKET_CMD"); - case 0xa1: return ("ATAPI_IDENTIFY"); - case 0xa2: return ("SERVICE"); - case 0xb0: return ("SMART"); - case 0xc0: return ("CFA ERASE"); - case 0xc4: return ("READ_MUL"); - case 0xc5: return ("WRITE_MUL"); - case 0xc6: return ("SET_MULTI"); - case 0xc7: return ("READ_DMA_QUEUED"); - case 0xc8: return ("READ_DMA"); - case 0xca: return ("WRITE_DMA"); - case 0xcc: return ("WRITE_DMA_QUEUED"); - case 0xe6: return ("SLEEP"); - case 0xe7: return ("FLUSHCACHE"); - case 0xea: return ("FLUSHCACHE48"); - case 0xec: return ("ATA_IDENTIFY"); - case 0xef: - switch (request->u.ata.feature) { - case 0x03: return ("SETFEATURES SET TRANSFER MODE"); - case 0x02: return ("SETFEATURES ENABLE WCACHE"); - case 0x82: return ("SETFEATURES DISABLE WCACHE"); - case 0xaa: return ("SETFEATURES ENABLE RCACHE"); - case 0x55: return ("SETFEATURES DISABLE RCACHE"); - } - sprintf(buffer, "SETFEATURES 0x%02x", request->u.ata.feature); - return buffer; - case 0xf5: return ("SECURITY_FREE_LOCK"); - case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); - case 0xf9: return ("SET_MAX_ADDRESS"); - } - } - sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); - return buffer; -} - #ifndef ATA_CAM static const char * ata_skey2str(u_int8_t skey) From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 14:16:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8BFAE9CE; Sat, 1 Jun 2013 14:16:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3A6155; Sat, 1 Jun 2013 14:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51EGrac024564; Sat, 1 Jun 2013 14:16:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51EGq41024554; Sat, 1 Jun 2013 14:16:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306011416.r51EGq41024554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 14:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251225 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 14:16:53 -0000 Author: pfg Date: Sat Jun 1 14:16:51 2013 New Revision: 251225 URL: http://svnweb.freebsd.org/changeset/base/251225 Log: BFD: Use time_t instead of long for archive timestamps. This basically follows the suggestion in the binutils code and is more in line with what BSD ar(1) does. Obtained from: OpenBSD MFC after: 2 weeks. Modified: head/contrib/binutils/bfd/archive.c head/contrib/binutils/bfd/bfd-in2.h head/contrib/binutils/bfd/bfdio.c head/contrib/binutils/bfd/coff-rs6000.c head/contrib/binutils/bfd/ecoff.c head/contrib/binutils/bfd/libbfd-in.h head/contrib/binutils/bfd/libbfd.h Modified: head/contrib/binutils/bfd/archive.c ============================================================================== --- head/contrib/binutils/bfd/archive.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 14:16:51 2013 (r251225) @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c /* ar headers are space padded, not null padded! */ memset (hdr, ' ', sizeof (struct ar_hdr)); - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", - status.st_mtime); + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", + (long long)status.st_mtime); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, st if (aloser == hdr->arelt) \ return -1; +#define fooll(arelt, stelt, size) \ + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ + if (aloser == hdr->arelt) \ + return -1; + /* Some platforms support special notations for large IDs. */ #ifdef HPUX_LARGE_AR_IDS # define foo2(arelt, stelt, size) \ @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st # define foo2(arelt, stelt, size) foo (arelt, stelt, size) #endif - foo (ar_date, st_mtime, 10); + fooll (ar_date, st_mtime, 10); foo2 (ar_uid, st_uid, 10); foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); Modified: head/contrib/binutils/bfd/bfd-in2.h ============================================================================== --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 14:16:51 2013 (r251225) @@ -38,6 +38,7 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include /* time_t */ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) #ifndef SABER /* This hack is to avoid a problem with some strict ANSI C preprocessors. @@ -1141,7 +1142,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se /* Extracted from bfdio.c. */ -long bfd_get_mtime (bfd *abfd); +time_t bfd_get_mtime (bfd *abfd); file_ptr bfd_get_size (bfd *abfd); Modified: head/contrib/binutils/bfd/bfdio.c ============================================================================== --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 14:16:51 2013 (r251225) @@ -377,7 +377,7 @@ FUNCTION bfd_get_mtime SYNOPSIS - long bfd_get_mtime (bfd *abfd); + time_t bfd_get_mtime (bfd *abfd); DESCRIPTION Return the file modification time (as read from the file system, or @@ -385,7 +385,7 @@ DESCRIPTION */ -long +time_t bfd_get_mtime (bfd *abfd) { struct stat buf; Modified: head/contrib/binutils/bfd/coff-rs6000.c ============================================================================== --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 14:16:51 2013 (r251225) @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1678,6 +1678,7 @@ xcoff_write_armap_old (abfd, elength, ma static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define FMT20 "%-20lld" #define FMT12 "%-12d" +#define FMT12_LL "%-12lld" #define FMT12_OCTAL "%-12o" #define FMT4 "%-4d" #define PRINT20(d, v) \ @@ -1688,6 +1689,10 @@ static char buff20[XCOFFARMAGBIG_ELEMENT sprintf (buff20, FMT12, (int)(v)), \ memcpy ((void *) (d), buff20, 12) +#define PRINT12_LL(d, v) \ + sprintf (buff20, FMT12_LL, (long long)(v)), \ + memcpy ((void *) (d), buff20, 12) + #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ memcpy ((void *) (d), buff20, 12) @@ -2152,7 +2157,7 @@ xcoff_write_archive_contents_old (abfd) } sprintf (ahdrp->size, "%ld", (long) s.st_size); - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); + sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); sprintf (ahdrp->uid, "%ld", (long) s.st_uid); sprintf (ahdrp->gid, "%ld", (long) s.st_gid); sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); @@ -2388,7 +2393,7 @@ xcoff_write_archive_contents_big (abfd) } PRINT20 (ahdrp->size, s.st_size); - PRINT12 (ahdrp->date, s.st_mtime); + PRINT12_LL (ahdrp->date, s.st_mtime); PRINT12 (ahdrp->uid, s.st_uid); PRINT12 (ahdrp->gid, s.st_gid); PRINT12_OCTAL (ahdrp->mode, s.st_mode); Modified: head/contrib/binutils/bfd/ecoff.c ============================================================================== --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 14:16:51 2013 (r251225) @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, linker just checks the archive name; the GNU linker may check the date. */ stat (abfd->filename, &statbuf); - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); + sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); /* The DECstation uses zeroes for the uid, gid and mode of the armap. */ Modified: head/contrib/binutils/bfd/libbfd-in.h ============================================================================== --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 14:16:51 2013 (r251225) @@ -71,8 +71,7 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - /* when more compilers are standard C, this can be a time_t */ - long armap_timestamp; /* Timestamp value written into armap. + time_t armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, Modified: head/contrib/binutils/bfd/libbfd.h ============================================================================== --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 14:16:51 2013 (r251225) @@ -76,8 +76,7 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - /* when more compilers are standard C, this can be a time_t */ - long armap_timestamp; /* Timestamp value written into armap. + time_t armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 15:02:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 372BFB23; Sat, 1 Jun 2013 15:02:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2889B2B9; Sat, 1 Jun 2013 15:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51F2FZc041281; Sat, 1 Jun 2013 15:02:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51F2FqS041279; Sat, 1 Jun 2013 15:02:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306011502.r51F2FqS041279@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 15:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251226 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 15:02:16 -0000 Author: hrs Date: Sat Jun 1 15:02:15 2013 New Revision: 251226 URL: http://svnweb.freebsd.org/changeset/base/251226 Log: Update relnotes item: vnet context bug fixed, dirty pages flushing issue fixed, pathname-only boot.config(5) problem fixed, UFS1 handling in boot loader on big endian platforms fixed, gptboot altlba handling changed, zfsboot -q option issue fixed, workaround for AMD CPU 10h/12h erratum 721 added, atkbdc(4) PNP0320 support added, cpufreq(4) frequency tuning calculation fixed, hwpmc(4) deadlock fixed, pci(4) HT-MSI mapping support, uart(4) serial over LAN on Intel 4 serries chipset support, usb(4) suspend handling improved, ale(4) link state handling improved, flow control support, bge(4) watchdog timeout issue fixed, if_ierrors handling fixed, cas(4),gem(4),hme(4) have been added to GENERIC for amd64/i386, fxp(4) extra media change issue fixed, iwn(4) Intel Centrino 6150 support, re(4)/rl(4) RTL8139 support improved, re(4) intermittent link up/down issue on RTL8169 fixed, rl(4) WoL support is disabled by default, run(4) firmware initinalization changed, run(4) updated to 0.236, sf(4) system load issue fixed, u3g(4) new Qualcomm modems added as supported devices, if_bridge(4) the number of forwarding cache entries bumped, ipfw(4) table arg improved, ipfw(4) net.inet.ip.fw.tables_max added, vlan(4) EUI64 part of an IPv6 address fixed, a panic in multicast routing on vimage kernel fixed, a panic in ng_patch(4) fixed, SCTP stack now supports ng_iface(4) and stf(4), SCTP stack now supports net.inet.udp.checksum sysctl for encap, new sysctl kern.features.ata_cam added, cam(4) now tries READ CAPACITY(16), isci(4) READ CAPACITY(16) bug fixed, PART_LDM geom class added, tmpfs(5) is not experimental anymore, xen(4) blkfront driver attach issue fixed, NFS stale name cache issue fixed, NFS nametimeo parameter added, daemon(8) -r, devfs(5) ruleset=number mount option and -u support added, libpmc more PMCs support, libradius rad_bind_to(3) added, libutil priority class capability bug fixed, pam_unix(8) passwordtime capability support, procstat(1) osreldate support, remquo(3) bug fixed, rtld(1) performance improved, sh(1) arithmetic expansion improved, unzip(1) -Z zfs list -t snapshot improved in performance, zfs get -t datatype added, ISC BIND 9.6-ESV-R6, tz2012a, and pkg_create(1) -p option improved. Approved by: re (implicitly) Added: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent (contents, props changed) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 14:16:51 2013 (r251225) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 15:02:15 2013 (r251226) @@ -5,6 +5,8 @@ %release; + +%man-refs; ]>
@@ -251,16 +253,84 @@ A bug which could cause a kernel thread to have a wrong CPU affinity configuration has been fixed. + A bug in VIMAGE &man.jail.8; which could + make the network subsystem run on an wrong vnet context has been + fixed. + + A bug that changes to a mapped + file with the &man.mmap.2; system call were not flushed + properly under certain circumstances has been fixed. If a + process has an NFS-backed file and adds changes to it, + normally the changes are written into the backing store + automatically. However, the NFS client recognized the + modified parts are written successfully even when the write + operation was failed for some reason such as permission + denied. + Boot Loader Changes - + A bug in + &os; boot block has been fixed. A pathname of the third + stage loader (or kernel) in the &man.boot.config.5; + configuration file could not be recognized. + + A bug in &man.loader.8; which could + prevents a UFS1 filesystem on big endian platforms from + booting. + + The gptboot + boot block now reads the backup GPT header from the last LBA + only when the primary GPT header and tables are invalid. + This mitigates interoperability issues with some + &man.geom.4; providers like MIRROR which + use the last LBA for the metadata. + + A bug in the + zfsboot boot block which could + prevent option from working has been + fixed. Hardware Support - + A workaround for Erratum + 721 for AMD Processor Family 10h and 12h has been + implemented. Under a highly specific and detailed set of + internal timing conditions, the processor may incorrectly + update the stack pointer after a long series of push and/or + near-call instructions, or a long series of pop and/or + near-return instructions. + + The + &man.atkbdc.4; driver now supports a keyboard controller + which has PnP ID PNP0320. This can be + found on machines which have Japanese PS/2 keyboard with + 106/109 keys. + + A bug in &man.cpufreq.4; which could + prevent CPU frequency tuning from working properly has been + fixed. + + A bug in &man.hwpmc.4; driver which + could cause a deadlock in &man.pmcstat.8; utility has been + fixed. + + The &man.pci.4; driver + now supports mapping between MSI (Message Signaled Interrupt) + and HyperTransport interrupt messages on HyperTransport to PCI + bus briges. This change improves handling of MSIs on AMD + CPUs. + + The &man.uart.4; + driver now supports Intel AMT Serial Port for Remote + Keyboard and Text (KT) Redirection (Serial Over LAN) on + Intel 4 Series Chipset family. + + The &man.usb.4; driver now handles + suspend events synchronously. This fixed problems of + suspend and resume. Multimedia Support @@ -271,18 +341,115 @@ Network Interface Support + Link state change handling in the + &man.ale.4; network driver has been improved. + + The &man.ale.4; network driver now + supports flow control. + + A bug in the &man.bge.4; network + driver which could cause watchdog timeout on BCM5704 + controller connected behind AMD 8131 PCI-X bridge has been + fixed. + + A bug in + if_ierrors counter in the &man.bge.4; + driver running on BCM5700, 5701, 5702, 5703, or 5704 + controller has been fixed. It reported only the number of + discarded packets. + + &man.cas.4;, + &man.gem.4;, and &man.hme.4; drivers have been added to + GENERIC kernel. + + The &man.fxp.4; network driver has + been improved. It does not cause unnecessary media change + in controller reconfiguration such as promiscuos mode + change which leads to an extra link + reestablishment. + + The &man.iwn.4; driver now supports + Intel Centrino 6150 wireless N and WiMAX chipsets. + + A bug in the &man.re.4; and + &man.rl.4; network drivers which could cause a problem on + RTL8139 family has been fixed. + + A bug in the &man.re.4; network + driver which could cause intermittent link up/down on + RTL8169 controller has been fixed. + + WoL (Wake-on-LAN) support + in the &man.rl.4; driver is now disabled by + default. + The &man.run.4; driver now supports Logitec LAN-W300NU2. + + The &man.run.4; network driver now + load the firmware upon initialization, not attachment. + This fixes an issue when the root filesystem is not + available at the time of the device detection. + + The &man.run.4; driver has been + updated to firmware verion 0.236. + + The &man.sf.4; network driver has + been improved. A system load fluctuation under high network + load has been fixed. + + The &man.u3g.4; driver now supports + Qualcomm Vertex Wireless 110L modem, Qualcomm 3G modem, and + Qualcomm Vertex VW110L modem. Network Protocols + The default number of the bridge + forwarding cache entries of the &man.if.bridge.4; pseudo + network interface driver has been increased from + 100 to 2000. + + The table argument + in the &man.ipfw.4; packet filter rule syntax now supports + IP address, interface name, port number, and jail ID. The + following syntax is valid: + + skipto tablearg ip from any to any via table(42) in + + A new &man.sysctl.8; variable + net.inet.ip.fw.tables_max has been added + to specify the maximum number of tables. The default value + is 128. + + A bug in &os; IPv6 stack has been + fixed. It could cause a &man.vlan.4; pseudo network + interface to get the EUI64 part in an autoconfigured IPv6 + address from an unrelated Ethernet interface on the + system. + &os; IPv6 stack now supports multiple FIBs. One can use &man.setfib.1; to select a different routing table for IPv6. + A bug which could cause a system panic + in multicast routing in kernel with + kernel option has been fixed. This option is disabled in + GENERIC kernel. + + A bug in the &man.ng.patch.4; + &man.netgraph.4; node which could cause a system panic has + been fixed. + + &os; SCTP stack now supports + &man.ng.iface.4; and &man.stf.4; interface. + + &os; SCTP stack now supports + net.inet.udp.checksum &man.sysctl.8; + variable for SCTP over UDP over IPv4 encapsulation. + SO_PROTOCOL and SO_PROTOTYPE socket option have been added. These are socket level options to get the protocol @@ -294,18 +461,63 @@ Disks and Storage + A new &man.sysctl.8; + kern.features.ata_cam has been added. + This shows whether ATA_CAM kernel option + is enabled or not. This option is disabled in + GENERIC kernel. + + The &man.cam.4; driver now uses + READ CAPACITY(16) SCSI command to get + device information by default when possible. This enables + to detect whether Logical Block Provisioning (also known as + TRIM or UNMAP) in + SBC-3 (SCSI Block Commands-3) Specification is supported on + the device. + The &man.isci.4; driver now supports Intel C600 Serial Attached SCSI controllers with chip IDs from 0x1d6c to 0x1d6f. + A bug in the &man.isci.4; driver which + could not correctly handle READ + CAPACITY(16) SCSI command for an SATA device has + been fixed. + A bug which could make the &man.mpt.4; driver attach LSI MegaRAID cards which should be handled by the &man.mfi.4; driver has been fixed. + + The PART_LDM + &man.geom.4; class has been added. This partition scheme has + support for Logical Disk Manager, which is also known as + dynamic volumes in Microsoft Windows NT. Note that JBOD, + RAID0, and RAID5 volumes are not supported yet. + + The &man.tmpfs.5; filesystem is not an + experimental implementation anymore. + + A bug in the &man.xen.4; + blkfront driver has been fixed. + It could not attach on Citrix XenServer configurations that + advertise the multi-page ring extension. File Systems + Bugs in &os; NFS subsystem has been + fixed. They could cause stale name cache entries on an NFS + client. + + &os; NFS subsystem now supports a + timeout parameter on positive name cache entries on the NFS + client side. nametimeo mount option has + been added to specify the timeout. The default value is + 60 seconds, and one can disable the + positive name caching by setting it to + 0. + Several bugs in &man.nullfs.5; which could cause a system panic have been fixed. @@ -346,7 +558,70 @@ Userland Changes - + The &man.daemon.8; utility now supports + flag to restart the program if it has been + terminated. + + The &man.devfs.5; mount now supports + mount option and updating the + existing mount by using flag in the + &man.mount.8; utility. This new option sets the specified + ruleset number as the active ruleset of the new devfs mount + and applies all its rules at mount time. If the specified + ruleset doesn't exist, a new empty ruleset is created. + + The libpmc + library has been updated to support more PMCs (Performance + Monitoring Counters) in Intel Core i7 and Xeon 5500 family + based on Intel documentatino as of October 2011. + Specifically, DTLB_MISSES.PDE_MISS and + DTLB_MISSES.LARGE_WALK_COMPLETED have been + added. + + The libradius + now supports &man.rad.bind.to.3; function. + + A bug in the the + libutil library has been fixed. It + could prevent configuration of priority + class capability in /etc/login.conf + (LOGIN_SETPRIORITY in + &man.setusercontext.3; function) from working when the + password is not set. + + A bug in &man.pam.unix.8; module has + been fixed. It could prevent passwordtime + login capability in &man.login.conf.5; from working. + + The &man.procstat.1; utility now + displays osreldate in binary information + for a process. + + A bug in the &man.remquo.3; functions + where the quotient did not always have the correct sign when + the remainder was 0, and another bug that the remainder and + quotient were both off by a bit in certain cases involving + subnormal remainders, have been fixed. Note that these bugs + affected all platforms except &arch.amd64; and + &arch.i386;. + + The &man.rtld.1; dynamic linker has been + improved in performance of TLS (Thread Local Storage) + handling. + + The &man.sh.1; program now allows + underscore characters in the arithmetic expansion. + + The &man.unzip.1; program now supports a + flag to enable + zipinfo mode. + + zfs list -t snapshot + command has been improved dramatically in performance. + + zfs get command now + supports option. <filename>/etc/rc.d</filename> Scripts @@ -369,14 +644,23 @@ Contributed Software + ISC BIND has + been updated to 9.6-ESV-R6. + TENEX C shell (&man.tcsh.1;) has been updated to version 6.18.01. + + The timezone + database has been updated to + tzdata2012a release. Ports/Packages Collection Infrastructure - + The &man.pkg.create.1; program now + allows a relative pathname in the + option. Added: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 15:02:15 2013 (r251226) @@ -0,0 +1,4 @@ + + +rad_bind_to3"> +boot.config5"> From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 17:39:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03AF0D6F for ; Sat, 1 Jun 2013 17:39:14 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx1.freebsd.org (Postfix) with ESMTP id B88B98B7 for ; Sat, 1 Jun 2013 17:39:13 +0000 (UTC) Received: by mail-vc0-f174.google.com with SMTP id hr11so1795926vcb.5 for ; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=FGJCg0dfbYTazk5e0bViUkclICVZRmTVrpWG4PBowMjphdQFkI9M7gW32wd2KKHo5R 0rPCROe0H+B0ekgO+A9l4/9xC1SKEtAwDcXepsUkL4AQgCaX/xcNBDAldpwT2MeE0Mnx 88fXFdWNf5TnGxLPP3tigwNVr062U3CV5A27U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=b8CP+Ry5lCveMX27n5BRi9XnbmlrpF3IVChXxOiZjKO4VGYXSzOqa7+oQVEky43ZwK cOSODgiCC3xuwTJerGc6691UA5HvzFadY2nPjyRGFWnTx7YDbGld7CRHTvCtglnBuezO Jc+NmBxER5kJAwC/BZr+OgUqLFsCDuGq+Ha3CWe96cQS+DZjWH+qqYxAlKZekIFhNrmd vO9lV0oeVCJSLRfVALW1ZjTELgCiM+1LvHPG+5ImKtWWKXQfUXguPiisse7sC6K/92PC 1KqzvIS8F2rrHCEoAWRaYW467+yp+f0exa3bt5F3QB2nlwfKGE/ZJ5bafexgTZNo3dte zTXA== MIME-Version: 1.0 X-Received: by 10.58.15.193 with SMTP id z1mr14769405vec.40.1370108347632; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) Received: by 10.220.119.2 with HTTP; Sat, 1 Jun 2013 10:39:07 -0700 (PDT) In-Reply-To: <201306011416.r51EGq41024554@svn.freebsd.org> References: <201306011416.r51EGq41024554@svn.freebsd.org> Date: Sat, 1 Jun 2013 10:39:07 -0700 Message-ID: Subject: Re: svn commit: r251225 - head/contrib/binutils/bfd From: Peter Wemm To: "Pedro F. Giffuni" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkZPgngVYHzwp7QvkMN08GTaHs49SzCDiYCFf3WuqhL6ayCRWcufqwlpE9ssfKZV1w2785M Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 17:39:14 -0000 FYI, this broke i386 builds. Please fix it. /scratch/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/bfdio.c:389:1: error: conflicting types for 'bfd_get_mtime' bfd_get_mtime (bfd *abfd) ^ /scratch/src/gnu/usr.bin/binutils/libbfd/bfd.h:1150:6: note: previous declaration is here long bfd_get_mtime (bfd *abfd); ^ 1 error generated. On Sat, Jun 1, 2013 at 7:16 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jun 1 14:16:51 2013 > New Revision: 251225 > URL: http://svnweb.freebsd.org/changeset/base/251225 > > Log: > BFD: Use time_t instead of long for archive timestamps. > > This basically follows the suggestion in the binutils code and is more > in line with what BSD ar(1) does. > > Obtained from: OpenBSD > MFC after: 2 weeks. > > Modified: > head/contrib/binutils/bfd/archive.c > head/contrib/binutils/bfd/bfd-in2.h > head/contrib/binutils/bfd/bfdio.c > head/contrib/binutils/bfd/coff-rs6000.c > head/contrib/binutils/bfd/ecoff.c > head/contrib/binutils/bfd/libbfd-in.h > head/contrib/binutils/bfd/libbfd.h > > Modified: head/contrib/binutils/bfd/archive.c > ============================================================================== > --- head/contrib/binutils/bfd/archive.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c > /* ar headers are space padded, not null padded! */ > memset (hdr, ' ', sizeof (struct ar_hdr)); > > - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", > - status.st_mtime); > + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", > + (long long)status.st_mtime); > #ifdef HPUX_LARGE_AR_IDS > /* HP has a very "special" way to handle UID/GID's with numeric values > > 99999. */ > @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > if (aloser == hdr->arelt) \ > return -1; > > +#define fooll(arelt, stelt, size) \ > + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ > + if (aloser == hdr->arelt) \ > + return -1; > + > /* Some platforms support special notations for large IDs. */ > #ifdef HPUX_LARGE_AR_IDS > # define foo2(arelt, stelt, size) \ > @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > # define foo2(arelt, stelt, size) foo (arelt, stelt, size) > #endif > > - foo (ar_date, st_mtime, 10); > + fooll (ar_date, st_mtime, 10); > foo2 (ar_uid, st_uid, 10); > foo2 (ar_gid, st_gid, 10); > foo (ar_mode, st_mode, 8); > > Modified: head/contrib/binutils/bfd/bfd-in2.h > ============================================================================== > --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -38,6 +38,7 @@ extern "C" { > > #include "ansidecl.h" > #include "symcat.h" > +#include /* time_t */ > #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) > #ifndef SABER > /* This hack is to avoid a problem with some strict ANSI C preprocessors. > @@ -1141,7 +1142,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se > > > /* Extracted from bfdio.c. */ > -long bfd_get_mtime (bfd *abfd); > +time_t bfd_get_mtime (bfd *abfd); > > file_ptr bfd_get_size (bfd *abfd); > > > Modified: head/contrib/binutils/bfd/bfdio.c > ============================================================================== > --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -377,7 +377,7 @@ FUNCTION > bfd_get_mtime > > SYNOPSIS > - long bfd_get_mtime (bfd *abfd); > + time_t bfd_get_mtime (bfd *abfd); > > DESCRIPTION > Return the file modification time (as read from the file system, or > @@ -385,7 +385,7 @@ DESCRIPTION > > */ > > -long > +time_t > bfd_get_mtime (bfd *abfd) > { > struct stat buf; > > Modified: head/contrib/binutils/bfd/coff-rs6000.c > ============================================================================== > --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1678,6 +1678,7 @@ xcoff_write_armap_old (abfd, elength, ma > static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; > #define FMT20 "%-20lld" > #define FMT12 "%-12d" > +#define FMT12_LL "%-12lld" > #define FMT12_OCTAL "%-12o" > #define FMT4 "%-4d" > #define PRINT20(d, v) \ > @@ -1688,6 +1689,10 @@ static char buff20[XCOFFARMAGBIG_ELEMENT > sprintf (buff20, FMT12, (int)(v)), \ > memcpy ((void *) (d), buff20, 12) > > +#define PRINT12_LL(d, v) \ > + sprintf (buff20, FMT12_LL, (long long)(v)), \ > + memcpy ((void *) (d), buff20, 12) > + > #define PRINT12_OCTAL(d, v) \ > sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ > memcpy ((void *) (d), buff20, 12) > @@ -2152,7 +2157,7 @@ xcoff_write_archive_contents_old (abfd) > } > > sprintf (ahdrp->size, "%ld", (long) s.st_size); > - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); > + sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); > sprintf (ahdrp->uid, "%ld", (long) s.st_uid); > sprintf (ahdrp->gid, "%ld", (long) s.st_gid); > sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); > @@ -2388,7 +2393,7 @@ xcoff_write_archive_contents_big (abfd) > } > > PRINT20 (ahdrp->size, s.st_size); > - PRINT12 (ahdrp->date, s.st_mtime); > + PRINT12_LL (ahdrp->date, s.st_mtime); > PRINT12 (ahdrp->uid, s.st_uid); > PRINT12 (ahdrp->gid, s.st_gid); > PRINT12_OCTAL (ahdrp->mode, s.st_mode); > > Modified: head/contrib/binutils/bfd/ecoff.c > ============================================================================== > --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, > linker just checks the archive name; the GNU linker may check the > date. */ > stat (abfd->filename, &statbuf); > - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); > + sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); > > /* The DECstation uses zeroes for the uid, gid and mode of the > armap. */ > > Modified: head/contrib/binutils/bfd/libbfd-in.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -71,8 +71,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, > > Modified: head/contrib/binutils/bfd/libbfd.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -76,8 +76,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 17:53:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA8098DF for ; Sat, 1 Jun 2013 17:53:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm42-vm8.bullet.mail.ne1.yahoo.com (nm42-vm8.bullet.mail.ne1.yahoo.com [98.138.120.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7738B95D for ; Sat, 1 Jun 2013 17:53:29 +0000 (UTC) Received: from [98.138.90.53] by nm42.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 Received: from [98.138.84.45] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 Received: from [127.0.0.1] by smtp113.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 X-Yahoo-Newman-Id: 300840.24710.bm@smtp113.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 1L6YgvgVM1kfIYYa4ACvefLoLw.R5LPoC6RDaAzFWyEICpl zS.6G1_f73kq8ZciUIQtCeiERsc_C6g4rnU9QHSZEeJzojtPylVWnsiWXN5X xJAhioQu0ZHkZM5Usu_nzJJRF.ab8vEjqGbfE2B21fxuTHmBWis_1KqIMLyC GHYTT4XU0pOFUYFY6Co8NHYOpjRHFfokFRUbop9055Qelq9rZtr4ExaPWdLC N25kXVzk6o1D4gdM.Y6kafnaUhvd_z7ExJCSNnhzrg3KLiiIukw4PgDw0hkq 9KO9bEhq4qaCm9TxeSrt.DlDbw_wZMQrxm18SUL9cep3DqePgauZZ0_3DnSw LAC9qdmsPKbUZRHGW9QoEo3n3smEr_2OHKC4ZrkDQconJIqTi7pua74ObaUv lUKJZF.G83gjjtYWxeYxowcFoWHxc0YoXtG7174lb4t3EAFRQfbr_M8iMlo3 a_lSCHBvhEI6OqWONVkWxnMrQ3LFMu4RzBgI8fSD__KoLHKIXBxDmnPc- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp113.mail.ne1.yahoo.com with SMTP; 01 Jun 2013 10:48:09 -0700 PDT Message-ID: <51AA33D6.2050404@FreeBSD.org> Date: Sat, 01 Jun 2013 12:48:06 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130407 Thunderbird/17.0.5 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r251225 - head/contrib/binutils/bfd References: <201306011416.r51EGq41024554@svn.freebsd.org> 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, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 17:53:29 -0000 On 01.06.2013 12:39, Peter Wemm wrote: > FYI, this broke i386 builds. Please fix it. > > /scratch/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/bfdio.c:389:1: > error: conflicting types for 'bfd_get_mtime' > bfd_get_mtime (bfd *abfd) > ^ > /scratch/src/gnu/usr.bin/binutils/libbfd/bfd.h:1150:6: note: previous > declaration is here > long bfd_get_mtime (bfd *abfd); > ^ > 1 error generated. > > Sorry.. will fix now ... Pedro. From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 18:03:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4B15D80; Sat, 1 Jun 2013 18:03:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5A9E99B; Sat, 1 Jun 2013 18:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51I33jY048639; Sat, 1 Jun 2013 18:03:03 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51I326l048629; Sat, 1 Jun 2013 18:03:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306011803.r51I326l048629@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 18:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251227 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 18:03:04 -0000 Author: pfg Date: Sat Jun 1 18:03:01 2013 New Revision: 251227 URL: http://svnweb.freebsd.org/changeset/base/251227 Log: Revert: Use time_t instead of long for archive timestamps. Back out for now: this breaks the i386 build and requires some revision. Modified: head/contrib/binutils/bfd/archive.c head/contrib/binutils/bfd/bfd-in2.h head/contrib/binutils/bfd/bfdio.c head/contrib/binutils/bfd/coff-rs6000.c head/contrib/binutils/bfd/ecoff.c head/contrib/binutils/bfd/libbfd-in.h head/contrib/binutils/bfd/libbfd.h Modified: head/contrib/binutils/bfd/archive.c ============================================================================== --- head/contrib/binutils/bfd/archive.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 18:03:01 2013 (r251227) @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c /* ar headers are space padded, not null padded! */ memset (hdr, ' ', sizeof (struct ar_hdr)); - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", - (long long)status.st_mtime); + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", + status.st_mtime); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1458,11 +1458,6 @@ bfd_generic_stat_arch_elt (bfd *abfd, st if (aloser == hdr->arelt) \ return -1; -#define fooll(arelt, stelt, size) \ - buf->stelt = strtoll (hdr->arelt, &aloser, size); \ - if (aloser == hdr->arelt) \ - return -1; - /* Some platforms support special notations for large IDs. */ #ifdef HPUX_LARGE_AR_IDS # define foo2(arelt, stelt, size) \ @@ -1489,7 +1484,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st # define foo2(arelt, stelt, size) foo (arelt, stelt, size) #endif - fooll (ar_date, st_mtime, 10); + foo (ar_date, st_mtime, 10); foo2 (ar_uid, st_uid, 10); foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); Modified: head/contrib/binutils/bfd/bfd-in2.h ============================================================================== --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 18:03:01 2013 (r251227) @@ -38,7 +38,6 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" -#include /* time_t */ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) #ifndef SABER /* This hack is to avoid a problem with some strict ANSI C preprocessors. @@ -1142,7 +1141,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se /* Extracted from bfdio.c. */ -time_t bfd_get_mtime (bfd *abfd); +long bfd_get_mtime (bfd *abfd); file_ptr bfd_get_size (bfd *abfd); Modified: head/contrib/binutils/bfd/bfdio.c ============================================================================== --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 18:03:01 2013 (r251227) @@ -377,7 +377,7 @@ FUNCTION bfd_get_mtime SYNOPSIS - time_t bfd_get_mtime (bfd *abfd); + long bfd_get_mtime (bfd *abfd); DESCRIPTION Return the file modification time (as read from the file system, or @@ -385,7 +385,7 @@ DESCRIPTION */ -time_t +long bfd_get_mtime (bfd *abfd) { struct stat buf; Modified: head/contrib/binutils/bfd/coff-rs6000.c ============================================================================== --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 18:03:01 2013 (r251227) @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); - s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); - s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1678,7 +1678,6 @@ xcoff_write_armap_old (abfd, elength, ma static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define FMT20 "%-20lld" #define FMT12 "%-12d" -#define FMT12_LL "%-12lld" #define FMT12_OCTAL "%-12o" #define FMT4 "%-4d" #define PRINT20(d, v) \ @@ -1689,10 +1688,6 @@ static char buff20[XCOFFARMAGBIG_ELEMENT sprintf (buff20, FMT12, (int)(v)), \ memcpy ((void *) (d), buff20, 12) -#define PRINT12_LL(d, v) \ - sprintf (buff20, FMT12_LL, (long long)(v)), \ - memcpy ((void *) (d), buff20, 12) - #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ memcpy ((void *) (d), buff20, 12) @@ -2157,7 +2152,7 @@ xcoff_write_archive_contents_old (abfd) } sprintf (ahdrp->size, "%ld", (long) s.st_size); - sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); + sprintf (ahdrp->date, "%ld", (long) s.st_mtime); sprintf (ahdrp->uid, "%ld", (long) s.st_uid); sprintf (ahdrp->gid, "%ld", (long) s.st_gid); sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); @@ -2393,7 +2388,7 @@ xcoff_write_archive_contents_big (abfd) } PRINT20 (ahdrp->size, s.st_size); - PRINT12_LL (ahdrp->date, s.st_mtime); + PRINT12 (ahdrp->date, s.st_mtime); PRINT12 (ahdrp->uid, s.st_uid); PRINT12 (ahdrp->gid, s.st_gid); PRINT12_OCTAL (ahdrp->mode, s.st_mode); Modified: head/contrib/binutils/bfd/ecoff.c ============================================================================== --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 18:03:01 2013 (r251227) @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, linker just checks the archive name; the GNU linker may check the date. */ stat (abfd->filename, &statbuf); - sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); + sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); /* The DECstation uses zeroes for the uid, gid and mode of the armap. */ Modified: head/contrib/binutils/bfd/libbfd-in.h ============================================================================== --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 18:03:01 2013 (r251227) @@ -71,7 +71,8 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - time_t armap_timestamp; /* Timestamp value written into armap. + /* when more compilers are standard C, this can be a time_t */ + long armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, Modified: head/contrib/binutils/bfd/libbfd.h ============================================================================== --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 18:03:01 2013 (r251227) @@ -76,7 +76,8 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - time_t armap_timestamp; /* Timestamp value written into armap. + /* when more compilers are standard C, this can be a time_t */ + long armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 19:07:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B90EA9D; Sat, 1 Jun 2013 19:07:04 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB00B52; Sat, 1 Jun 2013 19:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51J74bB070106; Sat, 1 Jun 2013 19:07:04 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51J74Fi070104; Sat, 1 Jun 2013 19:07:04 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306011907.r51J74Fi070104@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 19:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251228 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 19:07:04 -0000 Author: hrs Date: Sat Jun 1 19:07:03 2013 New Revision: 251228 URL: http://svnweb.freebsd.org/changeset/base/251228 Log: Update relnotes item: debug.kdb.breack_to_debugger, debug.kdb.alt_break_to_debugger added, kern.stop_scheduler_on_panic added, usb(4) multi-TT hub support, wbwd(4) added, bce(4) jumbo frame fixed, bce(4) remote PHYs support, iwn(4) Intel Centrino Wireless-N 100/130 support, igb(4) CPU binding on an SMP machine changed, ixgbe(4) TSO issue fixed, u3g(4) SIM5218 support, FIB handling improved: locking removal, net.fibs tunable, TCP host cache issue fixed, ATA_CAM compat shims added, da(4) subsequent BIO_DELETE request gathering, da(4) new device support, mfi(4) LSI MegaRAID SAS ThuderBolt support, GEOM_MULTIPATH improvements, GEOM_RAID DDF metadata support, NFS: a workaround for a non-FreeBSD server implemented, vfs.zfs.txg.timeout is now writable, dot.cshrc changed, fetch(1) percent-encoded user and password support, PROFIL_USE_PID variable for gprof profiling data generation, lastcomm(1) +format option added, libusb_get_max_iso_packet_size(3) added, pam_exec(8) return_prog_exit_status option added, setbuf(1) and libstdbuf library added, traceroute(8) bugfix, usbdump(8) filtering support, and usbhidctl(1) -z flag. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 18:03:01 2013 (r251227) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 19:07:03 2013 (r251228) @@ -257,6 +257,21 @@ make the network subsystem run on an wrong vnet context has been fixed. + debug.kdb.break_to_debugger + and debug.kdb.alt_break_to_debugger have been + added as &man.sysctl.8; variables and loader tunables. These + are disabled by default and + and kernel options now + set them enabled. These changes allow + GENERIC kernel to support break-to-debugger + capability. + + A new &man.sysctl.8; variable + kern.stop_scheduler_on_panic has been + added. When set to 1, only one thread runs + uninterruptedly after a system panic and the other CPUs are + stopped. The default value is 0. + A bug that changes to a mapped file with the &man.mmap.2; system call were not flushed properly under certain circumstances has been fixed. If a @@ -332,6 +347,16 @@ suspend events synchronously. This fixed problems of suspend and resume. + The &man.usb.4; driver now supports + multi-TT mode operation, which can have one transaction + translator for each downstream-facing port on a USB hub. + This allows more bandwidth for isochronous FULL speed + application connected through a High Speed USB HUB. + + The &man.wbwd.4; driver, which + supports the watchdog timer found in Winbond Super I/O + chips, has been added. + Multimedia Support @@ -347,6 +372,17 @@ The &man.ale.4; network driver now supports flow control. + A bug in the &man.bce.4; network + driver has been fixed. It could prevent jumbo frame + configuration from working. + + The &man.bce.4; network driver now + supports remote PHYs, which allow the controller to perform + MDIO type accesses to a remote transceiver by using message + pages defined through MRBE (MultiRate Backplane + Ethernet). This is found on machines such as the Dell + PowerEdge M610 Blade. + A bug in the &man.bge.4; network driver which could cause watchdog timeout on BCM5704 controller connected behind AMD 8131 PCI-X bridge has been @@ -368,8 +404,21 @@ change which leads to an extra link reestablishment. - The &man.iwn.4; driver now supports - Intel Centrino 6150 wireless N and WiMAX chipsets. + The &man.igb.4; network driver now + attempts to attach as many CPUs as possible to each queue. + If the number of CPUs are greater than or equal to the + number of queues, all of queues are bound to different + CPUs. + + The &man.iwn.4; driver now + supports Intel Centrino 6150 wireless N and WiMAX + chipsets, and Intel Centrino Wireless-N 100/130 + devices. + + A bug in &man.ixgbe.4; network + driver has been fixed. It could cause a packet loss in + TCP communication when TSO (TCP Segmentation Offload) is + enabled. A bug in the &man.re.4; and &man.rl.4; network drivers which could cause a problem on @@ -398,9 +447,10 @@ been improved. A system load fluctuation under high network load has been fixed. - The &man.u3g.4; driver now supports - Qualcomm Vertex Wireless 110L modem, Qualcomm 3G modem, and - Qualcomm Vertex VW110L modem. + The &man.u3g.4; driver now + supports Qualcomm Vertex Wireless 110L modem, Qualcomm 3G + modem, Qualcomm Vertex VW110L modem, and SIMCom + SIM5218. @@ -443,6 +493,17 @@ &man.netgraph.4; node which could cause a system panic has been fixed. + &os; routing table handling has been + improved. It can now perform packet forwarding even while a + user application is reading the whole routing table via + &man.sysctl.8;. + + A loader tunable + net.fibs now supports to specify the + number of routing tables. The + kernel option can still be used to set the default number of + routing tables. + &os; SCTP stack now supports &man.ng.iface.4; and &man.stf.4; interface. @@ -456,11 +517,30 @@ number found in Linux or Solaris. For more detail, see &man.setsockopt.2; manual page. + + An issue in &os; &man.tcp.4; host + cache has been fixed. It could cause extra ICMP message + exchanges when an ICMP unreach is received but allocation of + the corresponding TCP host cache is failed. Disks and Storage + The &man.ata.4; driver now creates + symbolic links for backward compatibility when + kernel option is enabled. In a + kernel with , an ATA/SATA disk is + recognized as a device node with a name + ada0 instead of + ad0. A symbolic link + /dev/ad0 is automatically generated for + /dev/ada0 to keep backward + compatibility. This symbolic link generation can be + controlled by a + kern.cam.ada.legacy_aliases (enabled by + default when is set). + A new &man.sysctl.8; kern.features.ata_cam has been added. This shows whether ATA_CAM kernel option @@ -475,6 +555,15 @@ SBC-3 (SCSI Block Commands-3) Specification is supported on the device. + The &man.da.4; driver has been + improved in performance of subsequent + BIO_DELETE requests handled as a single + TRIM request. + + The &man.da.4; now supports Olympus + FE-210 camera, LG UP3S MP3 player, and Laser MP3-2GA13 + MP3. + The &man.isci.4; driver now supports Intel C600 Serial Attached SCSI controllers with chip IDs from 0x1d6c to 0x1d6f. @@ -484,16 +573,38 @@ CAPACITY(16) SCSI command for an SATA device has been fixed. + The &man.mfi.4; driver now supports + LSI MegaRAID SAS cards named "Drake Skinny" and + "ThunderBolt". This includes Dell PERC H810/H800/H710/H700 + and Intel RAID Controller RS25DB080/RS25NB008. + A bug which could make the &man.mpt.4; driver attach LSI MegaRAID cards which should be handled by the &man.mfi.4; driver has been fixed. + The MULTIPATH + &man.geom.4; class has been updated. It now supports + Active/Active mode, Active/Read mode as hybrid of + Active/Active and Active/Passive, keeping a failed path + without removing the geom provider, manual configuration + without on-disk metadata, and add, remove, fail, restore, + configure subcommands in the &man.gmultipath.8; utility to + manage the configured paths. + The PART_LDM &man.geom.4; class has been added. This partition scheme has support for Logical Disk Manager, which is also known as dynamic volumes in Microsoft Windows NT. Note that JBOD, RAID0, and RAID5 volumes are not supported yet. + The RAID + &man.geom.4; class now supports the DDF metadata format, + which is defined in the SNIA Common RAID Disk Data Format + Specification v2.0. It can read non-degraded + RAID4/5/5E/5EE/5R/6/MDF volumes. An + option in &man.graid.8; utility can be used to specify byte + order for the DDF metadata. + The &man.tmpfs.5; filesystem is not an experimental implementation anymore. @@ -518,9 +629,19 @@ positive name caching by setting it to 0. + A workaround has been implemented in + &os; NFS subsystem to handle a reply to an NFS create RPC + which do not include file attributes under certain + circumstances. This improves interoperability between + non-&os; NFS servers and &os; NFS clients. + Several bugs in &man.nullfs.5; which could cause a system panic have been fixed. + The &man.sysctl.8; variable + vfs.zfs.txg.timeout has been changed from + read-only to writable. + ZFS is upgraded to support zpool feature flags. ZFS pool creation defaults to version 28 allowing upgrades to &os; 9.1-RELEASE, which does not support @@ -558,6 +679,11 @@ Userland Changes + The default + dot.cshrc file for &man.csh.1; and + &man.tcsh.1; has been changed. For more detail, see + /usr/share/skel/dot.cshrc. + The &man.daemon.8; utility now supports flag to restart the program if it has been terminated. @@ -570,6 +696,20 @@ and applies all its rules at mount time. If the specified ruleset doesn't exist, a new empty ruleset is created. + The &man.fetch.1; utility now supports + percent-encoded string in user and password component of a + URL. + + A new environment variable + PROFIL_USE_PID has been added to generate + profiling data for the &man.gprof.1; utility with a filename + including the process ID. + + The &man.lastcomm.1; utility now + supports + option to specify &man.strftime.3; format for process start + and exit times. + The libpmc library has been updated to support more PMCs (Performance Monitoring Counters) in Intel Core i7 and Xeon 5500 family @@ -581,6 +721,9 @@ The libradius now supports &man.rad.bind.to.3; function. + The &man.libusb.3; library now supports + &man.libusb.get.max.iso.packet.size.3; function. + A bug in the the libutil library has been fixed. It could prevent configuration of priority @@ -589,6 +732,12 @@ &man.setusercontext.3; function) from working when the password is not set. + The &man.pam.exec.8; module now supports + . When this option is + enabled, the program exit status is used as the + &man.pam.exec.8; return code. It allows the program to tell + why the step failed (user unknown, for example). + A bug in &man.pam.unix.8; module has been fixed. It could prevent passwordtime login capability in &man.login.conf.5; from working. @@ -609,13 +758,30 @@ improved in performance of TLS (Thread Local Storage) handling. + The &man.setbuf.1; utility and + libstdbuf library have been added. + This controls the default buffering behavior of standard stdio + streams. + The &man.sh.1; program now allows underscore characters in the arithmetic expansion. + A bug in &man.traceroute.8; utility + which could result in not accepting any incoming packets has + been fixed. + The &man.unzip.1; program now supports a flag to enable zipinfo mode. + The &man.usbdump.8; utility now supports + filtering USB devices and USB endpoints. + + The &man.usbhidctl.1; utility now + supports flag for reading operation. It + allows to not request current values from the device, but only + receive changes. + zfs list -t snapshot command has been improved dramatically in performance. Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 18:03:01 2013 (r251227) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 19:07:03 2013 (r251228) @@ -1,4 +1,6 @@ rad_bind_to3"> +libusb_get_max_iso_packet_size3"> + boot.config5"> From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 20:19:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B0DC6FC; Sat, 1 Jun 2013 20:19:17 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id BD090DC3; Sat, 1 Jun 2013 20:19:16 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1Uirz9-0007EX-NO; Sat, 01 Jun 2013 13:01:08 -0700 Message-ID: <51AA52FD.9090303@FreeBSD.org> Date: Sat, 01 Jun 2013 13:01:01 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn: stable/9: . usr.bin/xinstall References: <201303151519.r2FFJYjS060493@svn.freebsd.org> In-Reply-To: <201303151519.r2FFJYjS060493@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 20:19:17 -0000 Hmm, I believe this breaks build for me. Any ideas why? ===> usr.bin/xinstall (all) cc -O2 -pipe -I/usr/src/usr.bin/xinstall/../../contrib/mtree -I/usr/src/usr.bin/xinstall/../../lib/libnetbsd -I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/usr.bin/xinstall/xinstall.c cc1: warnings being treated as errors /usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log': /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration of function 'strsvis' /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern declaration of 'strsvis' *** [xinstall.o] Error code 1 Stop in /usr/src/usr.bin/xinstall. *** [all] Error code 1 uname -a FreeBSD dal09 9.1-RELEASE FreeBSD 9.1-RELEASE #2: Thu Dec 27 09:39:03 UTC 2012 root@pioneer:/usr/obj/usr/src91/sys/SSP-PRODUCTION9_X64 amd64 On 3/15/2013 8:19 AM, Brooks Davis wrote: > Author: brooks > Date: Fri Mar 15 15:19:33 2013 > New Revision: 248331 > URL: http://svnweb.freebsd.org/changeset/base/248331 > > Log: > MFC all changes to install(1) through r246784. Notable functional > changes are: > > r245617: > Introduce six new options from NetBSD: > * -M Log metadata in mtree format. > * -D Log paths relative to . > * -h Log digest of type . > * -T Specify which mtree tags to log. > * -l Create hard or symbolic links (allows logging). > * -U Install without root privileges (owner, group, mode, > and flags can be logged via -M > > NOTE: In the interest of compatibility with NetBSD and because it is the > obvious letter, the nearly useless -M option (disable mmap) has been > repurposed. > > Sponsored by: DARPA, AFRL > Obtained from: NetBSD > Reviewed by: bz > > r245312: > Implement the -N option which allows an alternate passwd and > group file to be used. This is useful for installing on systems where > a user or group does not currently exist. > > Sponsored by: DARPA, AFRL > Obtained from: NetBSD > > Modified: > stable/9/UPDATING (contents, props changed) > stable/9/usr.bin/xinstall/Makefile > stable/9/usr.bin/xinstall/install.1 > stable/9/usr.bin/xinstall/xinstall.c > Directory Properties: > stable/9/usr.bin/xinstall/ (props changed) > > Modified: stable/9/UPDATING > ============================================================================== > --- stable/9/UPDATING Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/UPDATING Fri Mar 15 15:19:33 2013 (r248331) > @@ -11,6 +11,15 @@ handbook: > Items affecting the ports and packages system can be found in > /usr/ports/UPDATING. Please read that file before running portupgrade. > > +20130315: > + The install(1) option -M has changed meaning and now takes an > + argument that is a file or path to append logs to. In the > + unlikely event that -M was the last option on the command line > + and the command line contained at least two files and a target > + directory the first file will have logs appended to it. The -M > + option served little practical purpose in the last decade so it's > + used expected to be extremely rare. > + > 20130225: > A new compression method (lz4) has been merged to. Please refer to > zpool-features(7) for more information. > > Modified: stable/9/usr.bin/xinstall/Makefile > ============================================================================== > --- stable/9/usr.bin/xinstall/Makefile Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/Makefile Fri Mar 15 15:19:33 2013 (r248331) > @@ -3,6 +3,16 @@ > > PROG= xinstall > PROGNAME= install > +SRCS= xinstall.c getid.c > MAN= install.1 > > +.PATH: ${.CURDIR}/../../contrib/mtree > +.PATH: ${.CURDIR}/../../lib/libmd > +CFLAGS+= -I${.CURDIR}/../../contrib/mtree > +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd > +CFLAGS+= -I${.CURDIR}/../../lib/libmd > + > +DPADD+= ${LIBMD} > +LDADD+= -lmd > + > .include > > Modified: stable/9/usr.bin/xinstall/install.1 > ============================================================================== > --- stable/9/usr.bin/xinstall/install.1 Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/install.1 Fri Mar 15 15:19:33 2013 (r248331) > @@ -28,7 +28,7 @@ > .\" From: @(#)install.1 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd March 6, 2006 > +.Dd January 18, 2013 > .Dt INSTALL 1 > .Os > .Sh NAME > @@ -36,31 +36,50 @@ > .Nd install binaries > .Sh SYNOPSIS > .Nm > -.Op Fl bCcMpSsv > +.Op Fl bCcpSsUv > .Op Fl B Ar suffix > +.Op Fl D Ar destdir > .Op Fl f Ar flags > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl l Ar linkflags > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar file1 file2 > .Nm > -.Op Fl bCcMpSsv > +.Op Fl bCcpSsUv > .Op Fl B Ar suffix > +.Op Fl D Ar destdir > .Op Fl f Ar flags > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl l Ar linkflags > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar file1 ... fileN directory > .Nm > .Fl d > -.Op Fl v > +.Op Fl Uv > +.Op Fl D Ar destdir > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar directory ... > .Sh DESCRIPTION > The file(s) are copied > -to the target file or directory. > +(or linked if the > +.Fl l > +option is specified) to the target file or directory. > If the destination is a directory, then the > .Ar file > is copied into > @@ -105,6 +124,17 @@ This is actually the default. > The > .Fl c > option is only included for backwards compatibility. > +.It Fl D Ar destdir > +Specify the > +.Ev DESTDIR > +(top of the file hierarchy) that the items are installed in to. > +If > +.Fl M Ar metalog > +is in use, a leading string of > +.Dq Ar destdir > +will be removed from the file names logged to the > +.Ar metalog . > +This option does not affect where the actual files are installed. > .It Fl d > Create directories. > Missing parent directories are created as required. > @@ -115,15 +145,82 @@ for a list of possible flags and their m > .It Fl g > Specify a group. > A numeric GID is allowed. > -.It Fl M > -Disable all use of > -.Xr mmap 2 . > +.It Fl h Ar hash > +When copying, calculate the digest of the files with > +.Ar hash > +to store in the > +.Fl M Ar metalog . > +When > +.Fl d > +is given no hash is emitted. > +Supported digests: > +.Bl -tag -width rmd160 -offset indent > +.It Sy none > +No hash. > +This is the default. > +.It Sy md5 > +The MD5 cryptographic message digest. > +.It Sy rmd160 > +The RMD-160 cryptographic message digest. > +.It Sy sha1 > +The SHA-1 cryptographic message digest. > +.It Sy sha256 > +The 256-bits > +.Tn SHA-2 > +cryptographic message digest of the file. > +.It Sy sha512 > +The 512-bits > +.Tn SHA-2 > +cryptographic message digest of the file. > +.El > +.It Fl l Ar linkflags > +Instead of copying the file make a link to the source. > +The type of the link is determined by the > +.Ar linkflags > +argument. > +Valid > +.Ar linkflags > +are: > +.Ar a > +(absolute), > +.Ar r > +(relative), > +.Ar h > +(hard), > +.Ar s > +(symbolic), > +.Ar m > +(mixed). > +Absolute and relative have effect only for symbolic links. > +Mixed links > +are hard links for files on the same filesystem, symbolic otherwise. > +.It Fl M Ar metalog > +Write the metadata associated with each item installed to > +.Ar metalog > +in an > +.Xr mtree 8 > +.Dq full path > +specification line. > +The metadata includes: the file name and file type, and depending upon > +other options, the owner, group, file flags, modification time, and tags. > .It Fl m > Specify an alternate mode. > The default mode is set to rwxr-xr-x (0755). > The specified mode may be either an octal or symbolic value; see > .Xr chmod 1 > for a description of possible mode values. > +.It Fl N > +Use the user database text file > +.Pa master.passwd > +and group database text file > +.Pa group > +from > +.Ar dbdir , > +rather than using the results from the system's > +.Xr getpwnam 3 > +and > +.Xr getgrnam 3 > +(and related) library calls. > .It Fl o > Specify an owner. > A numeric UID is allowed. > @@ -156,6 +253,17 @@ number of systems and binary types. > See below for how > .Nm > can be instructed to use another program to strip binaries. > +.It Fl T Ar tags > +Specify the > +.Xr mtree 8 > +tags to write out for the file when using > +.Fl M Ar metalog . > +.It Fl U > +Indicate that install is running unprivileged, and that it should not > +try to change the owner, the group, or the file flags of the destination. > +The information that would have been updated can be stored in a log > +file with > +.Fl M Ar metalog . > .It Fl v > Cause > .Nm > @@ -231,6 +339,8 @@ The default was changed to copy in > .Xr mv 1 , > .Xr strip 1 , > .Xr mmap 2 , > +.Xr getgrnam 3 , > +.Xr getpwnam 3 , > .Xr chown 8 > .Sh HISTORY > The > @@ -238,6 +348,16 @@ The > utility appeared in > .Bx 4.2 . > .Sh BUGS > +The meaning of the > +.Fl M > +option has changed as of > +.Fx 10 > +and it now takes an argument. > +Command lines that used the old > +.Fl M > +will get an error or in rare cases will append logs to the first of > +multiple source files rather than installing it. > +.Pp > Temporary files may be left in the target directory if > .Nm > exits abnormally. > > Modified: stable/9/usr.bin/xinstall/xinstall.c > ============================================================================== > --- stable/9/usr.bin/xinstall/xinstall.c Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/xinstall.c Fri Mar 15 15:19:33 2013 (r248331) > @@ -1,4 +1,5 @@ > /* > + * Copyright (c) 2012, 2013 SRI International > * Copyright (c) 1987, 1993 > * The Regents of the University of California. All rights reserved. > * > @@ -53,14 +54,23 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #include > +#include > +#include > +#include > +#include > #include > #include > #include > #include > #include > #include > +#include > + > +#include "mtree.h" > > /* Bootstrap aid - this doesn't exist in most older releases */ > #ifndef MAP_FAILED > @@ -69,26 +79,63 @@ __FBSDID("$FreeBSD$"); > > #define MAX_CMP_SIZE (16 * 1024 * 1024) > > +#define LN_ABSOLUTE 0x01 > +#define LN_RELATIVE 0x02 > +#define LN_HARD 0x04 > +#define LN_SYMBOLIC 0x08 > +#define LN_MIXED 0x10 > + > #define DIRECTORY 0x01 /* Tell install it's a directory. */ > #define SETFLAGS 0x02 /* Tell install to set flags. */ > #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) > #define BACKUP_SUFFIX ".old" > > -struct passwd *pp; > -struct group *gp; > -gid_t gid; > -uid_t uid; > -int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose; > -mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > -const char *suffix = BACKUP_SUFFIX; > - > -static int compare(int, const char *, size_t, int, const char *, size_t); > -static void copy(int, const char *, int, const char *, off_t); > +typedef union { > + MD5_CTX MD5; > + RIPEMD160_CTX RIPEMD160; > + SHA1_CTX SHA1; > + SHA256_CTX SHA256; > + SHA512_CTX SHA512; > +} DIGEST_CTX; > + > +static enum { > + DIGEST_NONE = 0, > + DIGEST_MD5, > + DIGEST_RIPEMD160, > + DIGEST_SHA1, > + DIGEST_SHA256, > + DIGEST_SHA512, > +} digesttype = DIGEST_NONE; > + > +static gid_t gid; > +static uid_t uid; > +static int dobackup, docompare, dodir, dolink, dopreserve, dostrip, dounpriv, > + safecopy, verbose; > +static int haveopt_f, haveopt_g, haveopt_m, haveopt_o; > +static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > +static FILE *metafp; > +static const char *group, *owner; > +static const char *suffix = BACKUP_SUFFIX; > +static char *destdir, *digest, *fflags, *metafile, *tags; > + > +static int compare(int, const char *, size_t, int, const char *, size_t, > + char **); > +static char *copy(int, const char *, int, const char *, off_t); > static int create_newfile(const char *, int, struct stat *); > static int create_tempfile(const char *, char *, size_t); > +static char *quiet_mktemp(char *template); > +static char *digest_file(const char *); > +static void digest_init(DIGEST_CTX *); > +static void digest_update(DIGEST_CTX *, const unsigned char *, size_t); > +static char *digest_end(DIGEST_CTX *, char *); > +static int do_link(const char *, const char *, const struct stat *); > +static void do_symlink(const char *, const char *, const struct stat *); > +static void makelink(const char *, const char *, const struct stat *); > static void install(const char *, const char *, u_long, u_int); > static void install_dir(char *); > -static u_long numeric_id(const char *, const char *); > +static void metadata_log(const char *, const char *, struct timeval *, > + const char *, const char *, off_t); > +static int parseid(const char *, id_t *); > static void strip(const char *); > static int trymmap(int); > static void usage(void); > @@ -101,12 +148,13 @@ main(int argc, char *argv[]) > u_long fset; > int ch, no_target; > u_int iflags; > - char *flags; > - const char *group, *owner, *to_name; > + char *p; > + const char *to_name; > > iflags = 0; > group = owner = NULL; > - while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:o:pSsv")) != -1) > + while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != > + -1) > switch((char)ch) { > case 'B': > suffix = optarg; > @@ -120,29 +168,69 @@ main(int argc, char *argv[]) > case 'c': > /* For backwards compatibility. */ > break; > + case 'D': > + destdir = optarg; > + break; > case 'd': > dodir = 1; > break; > case 'f': > - flags = optarg; > - if (strtofflags(&flags, &fset, NULL)) > - errx(EX_USAGE, "%s: invalid flag", flags); > - iflags |= SETFLAGS; > + haveopt_f = 1; > + fflags = optarg; > break; > case 'g': > + haveopt_g = 1; > group = optarg; > break; > + case 'h': > + digest = optarg; > + break; > + case 'l': > + for (p = optarg; *p != '\0'; p++) > + switch (*p) { > + case 's': > + dolink &= ~(LN_HARD|LN_MIXED); > + dolink |= LN_SYMBOLIC; > + break; > + case 'h': > + dolink &= ~(LN_SYMBOLIC|LN_MIXED); > + dolink |= LN_HARD; > + break; > + case 'm': > + dolink &= ~(LN_SYMBOLIC|LN_HARD); > + dolink |= LN_MIXED; > + break; > + case 'a': > + dolink &= ~LN_RELATIVE; > + dolink |= LN_ABSOLUTE; > + break; > + case 'r': > + dolink &= ~LN_ABSOLUTE; > + dolink |= LN_RELATIVE; > + break; > + default: > + errx(1, "%c: invalid link type", *p); > + /* NOTREACHED */ > + } > + break; > case 'M': > - nommap = 1; > + metafile = optarg; > break; > case 'm': > + haveopt_m = 1; > if (!(set = setmode(optarg))) > errx(EX_USAGE, "invalid file mode: %s", > optarg); > mode = getmode(set, 0); > free(set); > break; > + case 'N': > + if (!setup_getid(optarg)) > + err(EX_OSERR, "Unable to use user and group " > + "databases in `%s'", optarg); > + break; > case 'o': > + haveopt_o = 1; > owner = optarg; > break; > case 'p': > @@ -154,6 +242,12 @@ main(int argc, char *argv[]) > case 's': > dostrip = 1; > break; > + case 'T': > + tags = optarg; > + break; > + case 'U': > + dounpriv = 1; > + break; > case 'v': > verbose = 1; > break; > @@ -179,27 +273,62 @@ main(int argc, char *argv[]) > if (argc == 0 || (argc == 1 && !dodir)) > usage(); > > + if (digest != NULL) { > + if (strcmp(digest, "none") == 0) { > + digesttype = DIGEST_NONE; > + } else if (strcmp(digest, "md5") == 0) { > + digesttype = DIGEST_MD5; > + } else if (strcmp(digest, "rmd160") == 0) { > + digesttype = DIGEST_RIPEMD160; > + } else if (strcmp(digest, "sha1") == 0) { > + digesttype = DIGEST_SHA1; > + } else if (strcmp(digest, "sha256") == 0) { > + digesttype = DIGEST_SHA256; > + } else if (strcmp(digest, "sha512") == 0) { > + digesttype = DIGEST_SHA512; > + } else { > + warnx("unknown digest `%s'", digest); > + usage(); > + } > + } > + > /* need to make a temp copy so we can compare stripped version */ > if (docompare && dostrip) > safecopy = 1; > > /* get group and owner id's */ > - if (group != NULL) { > - if ((gp = getgrnam(group)) != NULL) > - gid = gp->gr_gid; > - else > - gid = (gid_t)numeric_id(group, "group"); > + if (group != NULL && !dounpriv) { > + if (gid_from_group(group, &gid) == -1) { > + id_t id; > + if (!parseid(group, &id)) > + errx(1, "unknown group %s", group); > + gid = id; > + } > } else > gid = (gid_t)-1; > > - if (owner != NULL) { > - if ((pp = getpwnam(owner)) != NULL) > - uid = pp->pw_uid; > - else > - uid = (uid_t)numeric_id(owner, "user"); > + if (owner != NULL && !dounpriv) { > + if (uid_from_user(owner, &uid) == -1) { > + id_t id; > + if (!parseid(owner, &id)) > + errx(1, "unknown user %s", owner); > + uid = id; > + } > } else > uid = (uid_t)-1; > > + if (fflags != NULL && !dounpriv) { > + if (strtofflags(&fflags, &fset, NULL)) > + errx(EX_USAGE, "%s: invalid flag", fflags); > + iflags |= SETFLAGS; > + } > + > + if (metafile != NULL) { > + if ((metafp = fopen(metafile, "a")) == NULL) > + warn("open %s", metafile); > + } else > + digesttype = DIGEST_NONE; > + > if (dodir) { > for (; *argv != NULL; ++argv) > install_dir(*argv); > @@ -207,8 +336,21 @@ main(int argc, char *argv[]) > /* NOTREACHED */ > } > > - no_target = stat(to_name = argv[argc - 1], &to_sb); > + to_name = argv[argc - 1]; > + no_target = stat(to_name, &to_sb); > if (!no_target && S_ISDIR(to_sb.st_mode)) { > + if (dolink & LN_SYMBOLIC) { > + if (lstat(to_name, &to_sb) != 0) > + err(EX_OSERR, "%s vanished", to_name); > + if (S_ISLNK(to_sb.st_mode)) { > + if (argc != 2) { > + errno = ENOTDIR; > + err(EX_USAGE, "%s", to_name); > + } > + install(*argv, to_name, fset, iflags); > + exit(EX_OK); > + } > + } > for (; *argv != to_name; ++argv) > install(*argv, to_name, fset, iflags | DIRECTORY); > exit(EX_OK); > @@ -226,7 +368,7 @@ main(int argc, char *argv[]) > usage(); > } > > - if (!no_target) { > + if (!no_target && !dolink) { > if (stat(*argv, &from_sb)) > err(EX_OSERR, "%s", *argv); > if (!S_ISREG(to_sb.st_mode)) { > @@ -243,23 +385,327 @@ main(int argc, char *argv[]) > /* NOTREACHED */ > } > > -static u_long > -numeric_id(const char *name, const char *type) > +static char * > +digest_file(const char *name) > +{ > + > + switch (digesttype) { > + case DIGEST_MD5: > + return (MD5File(name, NULL)); > + case DIGEST_RIPEMD160: > + return (RIPEMD160_File(name, NULL)); > + case DIGEST_SHA1: > + return (SHA1_File(name, NULL)); > + case DIGEST_SHA256: > + return (SHA256_File(name, NULL)); > + case DIGEST_SHA512: > + return (SHA512_File(name, NULL)); > + default: > + return (NULL); > + } > +} > + > +static void > +digest_init(DIGEST_CTX *c) > +{ > + > + switch (digesttype) { > + case DIGEST_NONE: > + break; > + case DIGEST_MD5: > + MD5Init(&(c->MD5)); > + break; > + case DIGEST_RIPEMD160: > + RIPEMD160_Init(&(c->RIPEMD160)); > + break; > + case DIGEST_SHA1: > + SHA1_Init(&(c->SHA1)); > + break; > + case DIGEST_SHA256: > + SHA256_Init(&(c->SHA256)); > + break; > + case DIGEST_SHA512: > + SHA512_Init(&(c->SHA512)); > + break; > + } > +} > + > +static void > +digest_update(DIGEST_CTX *c, const unsigned char *data, size_t len) > +{ > + > + switch (digesttype) { > + case DIGEST_NONE: > + break; > + case DIGEST_MD5: > + MD5Update(&(c->MD5), data, len); > + break; > + case DIGEST_RIPEMD160: > + RIPEMD160_Update(&(c->RIPEMD160), data, len); > + break; > + case DIGEST_SHA1: > + SHA1_Update(&(c->SHA1), data, len); > + break; > + case DIGEST_SHA256: > + SHA256_Update(&(c->SHA256), data, len); > + break; > + case DIGEST_SHA512: > + SHA512_Update(&(c->SHA512), data, len); > + break; > + } > +} > + > +static char * > +digest_end(DIGEST_CTX *c, char *buf) > +{ > + > + switch (digesttype) { > + case DIGEST_MD5: > + return (MD5End(&(c->MD5), buf)); > + case DIGEST_RIPEMD160: > + return (RIPEMD160_End(&(c->RIPEMD160), buf)); > + case DIGEST_SHA1: > + return (SHA1_End(&(c->SHA1), buf)); > + case DIGEST_SHA256: > + return (SHA256_End(&(c->SHA256), buf)); > + case DIGEST_SHA512: > + return (SHA512_End(&(c->SHA512), buf)); > + default: > + return (NULL); > + } > +} > + > +/* > + * parseid -- > + * parse uid or gid from arg into id, returning non-zero if successful > + */ > +static int > +parseid(const char *name, id_t *id) > +{ > + char *ep; > + errno = 0; > + *id = (id_t)strtoul(name, &ep, 10); > + if (errno || *ep != '\0') > + return (0); > + return (1); > +} > + > +/* > + * quiet_mktemp -- > + * mktemp implementation used mkstemp to avoid mktemp warnings. We > + * really do need mktemp semantics here as we will be creating a link. > + */ > +static char * > +quiet_mktemp(char *template) > +{ > + int fd; > + > + if ((fd = mkstemp(template)) == -1) > + return (NULL); > + close (fd); > + if (unlink(template) == -1) > + err(EX_OSERR, "unlink %s", template); > + return (template); > +} > + > +/* > + * do_link -- > + * make a hard link, obeying dorename if set > + * return -1 on failure > + */ > +static int > +do_link(const char *from_name, const char *to_name, > + const struct stat *target_sb) > +{ > + char tmpl[MAXPATHLEN]; > + int ret; > + > + if (safecopy && target_sb != NULL) { > + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); > + /* This usage is safe. */ > + if (quiet_mktemp(tmpl) == NULL) > + err(EX_OSERR, "%s: mktemp", tmpl); > + ret = link(from_name, tmpl); > + if (ret == 0) { > + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == > + -1) { > + unlink(tmpl); > + err(EX_OSERR, "%s", to_name); > + } > + if (target_sb->st_flags & NOCHANGEBITS) > + (void)chflags(to_name, target_sb->st_flags & > + ~NOCHANGEBITS); > + unlink(to_name); > + ret = rename(tmpl, to_name); > + /* > + * If rename has posix semantics, then the temporary > + * file may still exist when from_name and to_name point > + * to the same file, so unlink it unconditionally. > + */ > + (void)unlink(tmpl); > + } > + return (ret); > + } else > + return (link(from_name, to_name)); > +} > + > +/* > + * do_symlink -- > + * Make a symbolic link, obeying dorename if set. Exit on failure. > + */ > +static void > +do_symlink(const char *from_name, const char *to_name, > + const struct stat *target_sb) > +{ > + char tmpl[MAXPATHLEN]; > + > + if (safecopy && target_sb != NULL) { > + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); > + /* This usage is safe. */ > + if (quiet_mktemp(tmpl) == NULL) > + err(EX_OSERR, "%s: mktemp", tmpl); > + > + if (symlink(from_name, tmpl) == -1) > + err(EX_OSERR, "symlink %s -> %s", from_name, tmpl); > + > + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == -1) { > + (void)unlink(tmpl); > + err(EX_OSERR, "%s", to_name); > + } > + if (target_sb->st_flags & NOCHANGEBITS) > + (void)chflags(to_name, target_sb->st_flags & > + ~NOCHANGEBITS); > + unlink(to_name); > + > + if (rename(tmpl, to_name) == -1) { > + /* Remove temporary link before exiting. */ > + (void)unlink(tmpl); > + err(EX_OSERR, "%s: rename", to_name); > + } > + } else { > + if (symlink(from_name, to_name) == -1) > + err(EX_OSERR, "symlink %s -> %s", from_name, to_name); > + } > +} > + > +/* > + * makelink -- > + * make a link from source to destination > + */ > +static void > +makelink(const char *from_name, const char *to_name, > + const struct stat *target_sb) > { > - u_long val; > - char *ep; > + char src[MAXPATHLEN], dst[MAXPATHLEN], lnk[MAXPATHLEN]; > + struct stat to_sb; > + > + /* Try hard links first. */ > + if (dolink & (LN_HARD|LN_MIXED)) { > + if (do_link(from_name, to_name, target_sb) == -1) { > + if ((dolink & LN_HARD) || errno != EXDEV) > + err(EX_OSERR, "link %s -> %s", from_name, to_name); > + } else { > + if (stat(to_name, &to_sb)) > + err(EX_OSERR, "%s: stat", to_name); > + if (S_ISREG(to_sb.st_mode)) { > + /* > + * XXX: hard links to anything other than > + * plain files are not metalogged > + */ > + int omode; > + const char *oowner, *ogroup; > + char *offlags; > + char *dres; > + > + /* > + * XXX: use underlying perms, unless > + * overridden on command line. > + */ > + omode = mode; > + if (!haveopt_m) > + mode = (to_sb.st_mode & 0777); > + oowner = owner; > + if (!haveopt_o) > + owner = NULL; > + ogroup = group; > + if (!haveopt_g) > + group = NULL; > + offlags = fflags; > + if (!haveopt_f) > + fflags = NULL; > + dres = digest_file(from_name); > + metadata_log(to_name, "file", NULL, NULL, > + dres, to_sb.st_size); > + free(dres); > + mode = omode; > + owner = oowner; > + group = ogroup; > + fflags = offlags; > + } > + return; > + } > + } > + > + /* Symbolic links. */ > + if (dolink & LN_ABSOLUTE) { > + /* Convert source path to absolute. */ > + if (realpath(from_name, src) == NULL) > + err(EX_OSERR, "%s: realpath", from_name); > + do_symlink(src, to_name, target_sb); > + /* XXX: src may point outside of destdir */ > + metadata_log(to_name, "link", NULL, src, NULL, 0); > + return; > + } > + > + if (dolink & LN_RELATIVE) { > + char *cp, *d, *s; > + > + /* Resolve pathnames. */ > + if (realpath(from_name, src) == NULL) > + err(EX_OSERR, "%s: realpath", from_name); > + > + /* > + * The last component of to_name may be a symlink, > + * so use realpath to resolve only the directory. > + */ > + cp = dirname(to_name); > + if (realpath(cp, dst) == NULL) > + err(EX_OSERR, "%s: realpath", cp); > + /* .. and add the last component. */ > + if (strcmp(dst, "/") != 0) { > + if (strlcat(dst, "/", sizeof(dst)) > sizeof(dst)) > + errx(1, "resolved pathname too long"); > + } > + cp = basename(to_name); > + if (strlcat(dst, cp, sizeof(dst)) > sizeof(dst)) > + errx(1, "resolved pathname too long"); > + > + /* Trim common path components. */ > + for (s = src, d = dst; *s == *d; s++, d++) > + continue; > + while (*s != '/') > + s--, d--; > + > + /* Count the number of directories we need to backtrack. */ > + for (++d, lnk[0] = '\0'; *d; d++) > + if (*d == '/') > + (void)strlcat(lnk, "../", sizeof(lnk)); > + > + (void)strlcat(lnk, ++s, sizeof(lnk)); > + > + do_symlink(lnk, to_name, target_sb); > + /* XXX: Link may point outside of destdir. */ > + metadata_log(to_name, "link", NULL, lnk, NULL, 0); > + return; > + } > > /* > - * XXX > - * We know that uid_t's and gid_t's are unsigned longs. > + * If absolute or relative was not specified, try the names the > + * user provided. > */ > - errno = 0; > - val = strtoul(name, &ep, 10); > - if (errno) > - err(EX_NOUSER, "%s", name); > - if (*ep != '\0') > - errx(EX_NOUSER, "unknown %s %s", type, name); > - return (val); > + do_symlink(from_name, to_name, target_sb); > + /* XXX: from_name may point outside of destdir. */ > + metadata_log(to_name, "link", NULL, from_name, NULL, 0); > } > > /* > @@ -274,6 +720,7 @@ install(const char *from_name, const cha > int devnull, files_match, from_fd, serrno, target; > int tempcopy, temp_fd, to_fd; > char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; > + char *digestresult; > > files_match = 0; > from_fd = -1; > @@ -281,11 +728,13 @@ install(const char *from_name, const cha > > /* If try to install NULL file to a directory, fails. */ > if (flags & DIRECTORY || strcmp(from_name, _PATH_DEVNULL)) { > - if (stat(from_name, &from_sb)) > - err(EX_OSERR, "%s", from_name); > - if (!S_ISREG(from_sb.st_mode)) { > - errno = EFTYPE; > - err(EX_OSERR, "%s", from_name); > + if (!dolink) { > + if (stat(from_name, &from_sb)) > + err(EX_OSERR, "%s", from_name); > + if (!S_ISREG(from_sb.st_mode)) { > + errno = EFTYPE; > + err(EX_OSERR, "%s", from_name); > + } > } > /* Build the target path. */ > if (flags & DIRECTORY) { > @@ -299,7 +748,23 @@ install(const char *from_name, const cha > devnull = 1; > } > > - target = stat(to_name, &to_sb) == 0; > + if (!dolink) > + target = (stat(to_name, &to_sb) == 0); > + else > + target = (lstat(to_name, &to_sb) == 0); > + > + if (dolink) { > + if (target && !safecopy) { > + if (to_sb.st_mode & S_IFDIR && rmdir(to_name) == -1) > + err(EX_OSERR, "%s", to_name); > + if (to_sb.st_flags & NOCHANGEBITS) > + (void)chflags(to_name, > + to_sb.st_flags & ~NOCHANGEBITS); > + unlink(to_name); > + } > + makelink(from_name, to_name, target ? &to_sb : NULL); > + return; > + } > > /* Only install to regular files. */ > if (target && !S_ISREG(to_sb.st_mode)) { > @@ -323,7 +788,7 @@ install(const char *from_name, const cha > else > files_match = !(compare(from_fd, from_name, > (size_t)from_sb.st_size, to_fd, > - to_name, (size_t)to_sb.st_size)); > + to_name, (size_t)to_sb.st_size, &digestresult)); > > /* Close "to" file unless we match. */ > if (!files_match) > @@ -345,8 +810,10 @@ install(const char *from_name, const cha > from_name, to_name); > } > if (!devnull) > - copy(from_fd, from_name, to_fd, > + digestresult = copy(from_fd, from_name, to_fd, > tempcopy ? tempfile : to_name, from_sb.st_size); > + else > + digestresult = NULL; > } > > if (dostrip) { > @@ -380,7 +847,8 @@ install(const char *from_name, const cha > } > > if (compare(temp_fd, tempfile, (size_t)temp_sb.st_size, to_fd, > - to_name, (size_t)to_sb.st_size) == 0) { > + to_name, (size_t)to_sb.st_size, &digestresult) > + == 0) { > /* > * If target has more than one link we need to > * replace it in order to snap the extra links. > @@ -400,6 +868,9 @@ install(const char *from_name, const cha > } > } > > + if (dostrip && (!docompare || !target)) > + digestresult = digest_file(tempfile); > + > /* > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 20:32:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08F71CE3; Sat, 1 Jun 2013 20:32:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F01B4E32; Sat, 1 Jun 2013 20:32:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51KWY8q000709; Sat, 1 Jun 2013 20:32:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51KWYY9000708; Sat, 1 Jun 2013 20:32:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201306012032.r51KWYY9000708@svn.freebsd.org> From: Alan Cox Date: Sat, 1 Jun 2013 20:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251229 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 20:32:35 -0000 Author: alc Date: Sat Jun 1 20:32:34 2013 New Revision: 251229 URL: http://svnweb.freebsd.org/changeset/base/251229 Log: Now that access to the page's "act_count" field is synchronized by the page lock instead of the object lock, there is no reason for vm_page_activate() to assert that the object is locked for either read or write access. (The "VPO_UNMANAGED" flag never changes after page allocation.) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jun 1 19:07:03 2013 (r251228) +++ head/sys/vm/vm_page.c Sat Jun 1 20:32:34 2013 (r251229) @@ -1837,7 +1837,6 @@ vm_page_activate(vm_page_t m) int queue; vm_page_lock_assert(m, MA_OWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); if ((queue = m->queue) != PQ_ACTIVE) { if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { if (m->act_count < ACT_INIT) From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 21:02:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0763E28B; Sat, 1 Jun 2013 21:02:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDC6DEE8; Sat, 1 Jun 2013 21:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51L2QCg010981; Sat, 1 Jun 2013 21:02:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51L2QOq010979; Sat, 1 Jun 2013 21:02:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306012102.r51L2QOq010979@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Jun 2013 21:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251230 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 21:02:27 -0000 Author: ed Date: Sat Jun 1 21:02:26 2013 New Revision: 251230 URL: http://svnweb.freebsd.org/changeset/base/251230 Log: Move into sys/sys/. This will allow us to use C11 atomics in kernelspace, although it will need to be included as . Added: head/sys/sys/stdatomic.h - copied unchanged from r251216, head/include/stdatomic.h Deleted: head/include/stdatomic.h Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Jun 1 20:32:34 2013 (r251229) +++ head/include/Makefile Sat Jun 1 21:02:26 2013 (r251230) @@ -19,7 +19,7 @@ INCS= a.out.h ar.h assert.h bitstring.h printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \ res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \ - signal.h spawn.h stab.h stdalign.h stdatomic.h stdbool.h stddef.h \ + signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \ stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ @@ -33,8 +33,8 @@ MHDRS= float.h floatingpoint.h stdarg.h PHDRS= sched.h _semaphore.h -LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ - ucontext.h +LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ + syslog.h ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ netipsec ${_netipx} netnatm \ Copied: head/sys/sys/stdatomic.h (from r251216, head/include/stdatomic.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/stdatomic.h Sat Jun 1 21:02:26 2013 (r251230, copy of r251216, head/include/stdatomic.h) @@ -0,0 +1,325 @@ +/*- + * Copyright (c) 2011 Ed Schouten + * David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _STDATOMIC_H_ +#define _STDATOMIC_H_ + +#include +#include + +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) +#define __CLANG_ATOMICS +#elif __GNUC_PREREQ__(4, 7) +#define __GNUC_ATOMICS +#elif !defined(__GNUC__) +#error "stdatomic.h does not support your compiler" +#endif + +#if !defined(__CLANG_ATOMICS) +#define _Atomic(T) struct { volatile T __val; } +#endif + +/* + * 7.17.2 Initialization. + */ + +#if defined(__CLANG_ATOMICS) +#define ATOMIC_VAR_INIT(value) (value) +#define atomic_init(obj, value) __c11_atomic_init(obj, value) +#else +#define ATOMIC_VAR_INIT(value) { .__val = (value) } +#define atomic_init(obj, value) ((void)((obj)->__val = (value))) +#endif + +/* + * Clang and recent GCC both provide predefined macros for the memory + * orderings. If we are using a compiler that doesn't define them, use the + * clang values - these will be ignored in the fallback path. + */ + +#ifndef __ATOMIC_RELAXED +#define __ATOMIC_RELAXED 0 +#endif +#ifndef __ATOMIC_CONSUME +#define __ATOMIC_CONSUME 1 +#endif +#ifndef __ATOMIC_ACQUIRE +#define __ATOMIC_ACQUIRE 2 +#endif +#ifndef __ATOMIC_RELEASE +#define __ATOMIC_RELEASE 3 +#endif +#ifndef __ATOMIC_ACQ_REL +#define __ATOMIC_ACQ_REL 4 +#endif +#ifndef __ATOMIC_SEQ_CST +#define __ATOMIC_SEQ_CST 5 +#endif + +/* + * 7.17.3 Order and consistency. + * + * The memory_order_* constants that denote the barrier behaviour of the + * atomic operations. + */ + +enum memory_order { + memory_order_relaxed = __ATOMIC_RELAXED, + memory_order_consume = __ATOMIC_CONSUME, + memory_order_acquire = __ATOMIC_ACQUIRE, + memory_order_release = __ATOMIC_RELEASE, + memory_order_acq_rel = __ATOMIC_ACQ_REL, + memory_order_seq_cst = __ATOMIC_SEQ_CST +}; + +/* + * 7.17.4 Fences. + */ + +#ifdef __CLANG_ATOMICS +#define atomic_thread_fence(order) __c11_atomic_thread_fence(order) +#define atomic_signal_fence(order) __c11_atomic_signal_fence(order) +#elif defined(__GNUC_ATOMICS) +#define atomic_thread_fence(order) __atomic_thread_fence(order) +#define atomic_signal_fence(order) __atomic_signal_fence(order) +#else +#define atomic_thread_fence(order) ((void)(order), __sync_synchronize()) +#define atomic_signal_fence(order) __extension__ ({ \ + (void)(order); \ + __asm volatile ("" ::: "memory"); \ + (void)0; \ +}) +#endif + +/* + * 7.17.5 Lock-free property. + */ + +#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) +#define atomic_is_lock_free(obj) \ + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) +#else +#define atomic_is_lock_free(obj) \ + ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) +#endif + +/* + * 7.17.6 Atomic integer types. + */ + +typedef _Atomic(_Bool) atomic_bool; +typedef _Atomic(char) atomic_char; +typedef _Atomic(signed char) atomic_schar; +typedef _Atomic(unsigned char) atomic_uchar; +typedef _Atomic(short) atomic_short; +typedef _Atomic(unsigned short) atomic_ushort; +typedef _Atomic(int) atomic_int; +typedef _Atomic(unsigned int) atomic_uint; +typedef _Atomic(long) atomic_long; +typedef _Atomic(unsigned long) atomic_ulong; +typedef _Atomic(long long) atomic_llong; +typedef _Atomic(unsigned long long) atomic_ullong; +typedef _Atomic(__char16_t) atomic_char16_t; +typedef _Atomic(__char32_t) atomic_char32_t; +typedef _Atomic(__wchar_t) atomic_wchar_t; +typedef _Atomic(__int_least8_t) atomic_int_least8_t; +typedef _Atomic(__uint_least8_t) atomic_uint_least8_t; +typedef _Atomic(__int_least16_t) atomic_int_least16_t; +typedef _Atomic(__uint_least16_t) atomic_uint_least16_t; +typedef _Atomic(__int_least32_t) atomic_int_least32_t; +typedef _Atomic(__uint_least32_t) atomic_uint_least32_t; +typedef _Atomic(__int_least64_t) atomic_int_least64_t; +typedef _Atomic(__uint_least64_t) atomic_uint_least64_t; +typedef _Atomic(__int_fast8_t) atomic_int_fast8_t; +typedef _Atomic(__uint_fast8_t) atomic_uint_fast8_t; +typedef _Atomic(__int_fast16_t) atomic_int_fast16_t; +typedef _Atomic(__uint_fast16_t) atomic_uint_fast16_t; +typedef _Atomic(__int_fast32_t) atomic_int_fast32_t; +typedef _Atomic(__uint_fast32_t) atomic_uint_fast32_t; +typedef _Atomic(__int_fast64_t) atomic_int_fast64_t; +typedef _Atomic(__uint_fast64_t) atomic_uint_fast64_t; +typedef _Atomic(__intptr_t) atomic_intptr_t; +typedef _Atomic(__uintptr_t) atomic_uintptr_t; +typedef _Atomic(__size_t) atomic_size_t; +typedef _Atomic(__ptrdiff_t) atomic_ptrdiff_t; +typedef _Atomic(__intmax_t) atomic_intmax_t; +typedef _Atomic(__uintmax_t) atomic_uintmax_t; + +/* + * 7.17.7 Operations on atomic types. + */ + +/* + * Compiler-specific operations. + */ + +#if defined(__CLANG_ATOMICS) +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) \ + __c11_atomic_compare_exchange_strong(object, expected, desired, \ + success, failure) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + __c11_atomic_compare_exchange_weak(object, expected, desired, \ + success, failure) +#define atomic_exchange_explicit(object, desired, order) \ + __c11_atomic_exchange(object, desired, order) +#define atomic_fetch_add_explicit(object, operand, order) \ + __c11_atomic_fetch_add(object, operand, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __c11_atomic_fetch_and(object, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __c11_atomic_fetch_or(object, operand, order) +#define atomic_fetch_sub_explicit(object, operand, order) \ + __c11_atomic_fetch_sub(object, operand, order) +#define atomic_fetch_xor_explicit(object, operand, order) \ + __c11_atomic_fetch_xor(object, operand, order) +#define atomic_load_explicit(object, order) \ + __c11_atomic_load(object, order) +#define atomic_store_explicit(object, desired, order) \ + __c11_atomic_store(object, desired, order) +#elif defined(__GNUC_ATOMICS) +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) \ + __atomic_compare_exchange_n(&(object)->__val, expected, \ + desired, 0, success, failure) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + __atomic_compare_exchange_n(&(object)->__val, expected, \ + desired, 1, success, failure) +#define atomic_exchange_explicit(object, desired, order) \ + __atomic_exchange_n(&(object)->__val, desired, order) +#define atomic_fetch_add_explicit(object, operand, order) \ + __atomic_fetch_add(&(object)->__val, operand, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __atomic_fetch_and(&(object)->__val, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __atomic_fetch_or(&(object)->__val, operand, order) +#define atomic_fetch_sub_explicit(object, operand, order) \ + __atomic_fetch_sub(&(object)->__val, operand, order) +#define atomic_fetch_xor_explicit(object, operand, order) \ + __atomic_fetch_xor(&(object)->__val, operand, order) +#define atomic_load_explicit(object, order) \ + __atomic_load_n(&(object)->__val, order) +#define atomic_store_explicit(object, desired, order) \ + __atomic_store_n(&(object)->__val, desired, order) +#else +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) __extension__ ({ \ + __typeof__(expected) __ep = (expected); \ + __typeof__(*__ep) __e = *__ep; \ + (void)(success); (void)(failure); \ + (*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e; \ +}) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) +#if __has_builtin(__sync_swap) +/* Clang provides a full-barrier atomic exchange - use it if available. */ +#define atomic_exchange_explicit(object, desired, order) \ + ((void)(order), __sync_swap(&(object)->__val, desired)) +#else +/* + * __sync_lock_test_and_set() is only an acquire barrier in theory (although in + * practice it is usually a full barrier) so we need an explicit barrier before + * it. + */ +#define atomic_exchange_explicit(object, desired, order) \ +__extension__ ({ \ + __typeof__(object) __o = (object); \ + __typeof__(desired) __d = (desired); \ + (void)(order); \ + __sync_synchronize(); \ + __sync_lock_test_and_set(&(__o)->__val, __d); \ +}) +#endif +#define atomic_fetch_add_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_add(&(object)->__val, operand)) +#define atomic_fetch_and_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) +#define atomic_fetch_or_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) +#define atomic_fetch_sub_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_sub(&(object)->__val, operand)) +#define atomic_fetch_xor_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) +#define atomic_load_explicit(object, order) \ + ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) +#define atomic_store_explicit(object, desired, order) \ + ((void)atomic_exchange_explicit(object, desired, order)) +#endif + +/* + * Convenience functions. + */ + +#define atomic_compare_exchange_strong(object, expected, desired) \ + atomic_compare_exchange_strong_explicit(object, expected, \ + desired, memory_order_seq_cst, memory_order_seq_cst) +#define atomic_compare_exchange_weak(object, expected, desired) \ + atomic_compare_exchange_weak_explicit(object, expected, \ + desired, memory_order_seq_cst, memory_order_seq_cst) +#define atomic_exchange(object, desired) \ + atomic_exchange_explicit(object, desired, memory_order_seq_cst) +#define atomic_fetch_add(object, operand) \ + atomic_fetch_add_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_and(object, operand) \ + atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_or(object, operand) \ + atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_sub(object, operand) \ + atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_xor(object, operand) \ + atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst) +#define atomic_load(object) \ + atomic_load_explicit(object, memory_order_seq_cst) +#define atomic_store(object, desired) \ + atomic_store_explicit(object, desired, memory_order_seq_cst) + +/* + * 7.17.8 Atomic flag type and operations. + */ + +typedef atomic_bool atomic_flag; + +#define ATOMIC_FLAG_INIT ATOMIC_VAR_INIT(0) + +#define atomic_flag_clear_explicit(object, order) \ + atomic_store_explicit(object, 0, order) +#define atomic_flag_test_and_set_explicit(object, order) \ + atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) + +#define atomic_flag_clear(object) \ + atomic_flag_clear_explicit(object, memory_order_seq_cst) +#define atomic_flag_test_and_set(object) \ + atomic_flag_test_and_set_explicit(object, memory_order_seq_cst) + +#endif /* !_STDATOMIC_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 21:28:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82D5D2CF; Sat, 1 Jun 2013 21:28:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64C12F94; Sat, 1 Jun 2013 21:28:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51LSiTc020327; Sat, 1 Jun 2013 21:28:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51LSiJs020325; Sat, 1 Jun 2013 21:28:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306012128.r51LSiJs020325@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 21:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251231 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 21:28:44 -0000 Author: hrs Date: Sat Jun 1 21:28:43 2013 New Revision: 251231 URL: http://svnweb.freebsd.org/changeset/base/251231 Log: Update relnotes item: shm_map(9) and shm_unmap(9) added, sparc64 loader heap command, sparc64 zfsboot and zfsloader, amd64 extended FPU states and AVX, pcf8563(4) added, puc(4) Sun 1040 PCI Quad Serial support, snd_hda(4) updated, bce(4) IPMI fix, bge(4) bugfix, mxge(4) updated to 1.4.55, ral(4) RT2800/3000 support, if_bridge(4) duplicate ID issue fixed, linkstate and carp(4) support, net.link.bridge.* as loader tunables, IPv6 refcount fixes, if_lagg(4) lagghash option added, amr(4) bugfix, kern.cam.pmp.hide_special sysctl added, isci(4) bugfix, NFS over ZFS memory leak fixed, inetd(8) time handling fixed, procstat(1) and fstat(1) pathname for shared memory object support, ps(1) cow keyword added, zfs(8) send displays transmitted data size, and ISC BIND updated to 9.6-ESV-R7-P1. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 21:02:26 2013 (r251230) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 21:28:43 2013 (r251231) @@ -266,14 +266,19 @@ GENERIC kernel to support break-to-debugger capability. + The &man.shm.map.9; and + &man.shm.unmap.9; functions have been added to allow in-kernel + code to map portions of shared memory objects created by + &man.shm.open.2; into the kernel's address space. + A new &man.sysctl.8; variable kern.stop_scheduler_on_panic has been added. When set to 1, only one thread runs uninterruptedly after a system panic and the other CPUs are stopped. The default value is 0. - A bug that changes to a mapped - file with the &man.mmap.2; system call were not flushed + A bug that changes to a + mapped file with the &man.mmap.2; system call were not flushed properly under certain circumstances has been fixed. If a process has an NFS-backed file and adds changes to it, normally the changes are written into the backing store @@ -294,6 +299,10 @@ prevents a UFS1 filesystem on big endian platforms from booting. + &os; &man.loader.8; now + supports heap to show the heap + usage. + The gptboot boot block now reads the backup GPT header from the last LBA only when the primary GPT header and tables are invalid. @@ -301,6 +310,11 @@ &man.geom.4; providers like MIRROR which use the last LBA for the metadata. + &os;/&arch.sparc64; now + supports booting from ZFS via the + zfsboot boot block and + zfsloader. + A bug in the zfsboot boot block which could prevent option from working has been @@ -318,6 +332,10 @@ near-call instructions, or a long series of pop and/or near-return instructions. + The extended FPU states + for native 64-bit and 32-bit ABIs have been supported. AVX + instructions are also enabled on capable CPUs. + The &man.atkbdc.4; driver now supports a keyboard controller which has PnP ID PNP0320. This can be @@ -332,12 +350,18 @@ could cause a deadlock in &man.pmcstat.8; utility has been fixed. + The &man.pcf8563.4; driver for the NXP + (Philips) PCF8563 RTC has been added. + The &man.pci.4; driver now supports mapping between MSI (Message Signaled Interrupt) and HyperTransport interrupt messages on HyperTransport to PCI bus briges. This change improves handling of MSIs on AMD CPUs. + The &man.puc.4; driver now supports + Sun 1040 PCI Quad Serial. + The &man.uart.4; driver now supports Intel AMT Serial Port for Remote Keyboard and Text (KT) Redirection (Serial Over LAN) on @@ -360,7 +384,13 @@ Multimedia Support - + The &man.snd.hda.4; driver + has been updated. It now supports and provides HDMI, new + volume control, automatic recording source selection, + runtime reconfiguration, more then 4 PCM devices on a + controller, multichannel recording, additional + playback/record streams, higher bandwidth, and more + informative device names. @@ -376,6 +406,11 @@ driver has been fixed. It could prevent jumbo frame configuration from working. + A bug in &man.bce.4; which could + prevent IPMI (Intelligent Platform Management Interface) + from working when the interface is down has been + fixed. + The &man.bce.4; network driver now supports remote PHYs, which allow the controller to perform MDIO type accesses to a remote transceiver by using message @@ -394,6 +429,9 @@ controller has been fixed. It reported only the number of discarded packets. + A bug in &man.bge.4; which could + make the device stop working has been fixed. + &man.cas.4;, &man.gem.4;, and &man.hme.4; drivers have been added to GENERIC kernel. @@ -415,11 +453,17 @@ chipsets, and Intel Centrino Wireless-N 100/130 devices. + The &man.mxge.4; driver has been + updated to firmware version 1.4.55 from Myricom. + A bug in &man.ixgbe.4; network driver has been fixed. It could cause a packet loss in TCP communication when TSO (TCP Segmentation Offload) is enabled. + The &man.ral.4; network driver now + supports Ralink RT2800 and RT3000 chipsets. + A bug in the &man.re.4; and &man.rl.4; network drivers which could cause a problem on RTL8139 family has been fixed. @@ -457,6 +501,19 @@ Network Protocols + The &man.if.bridge.4; pseudo network + interface driver now supports multiple bridges in the same + STP domain. It used the same MAC address as the bridge ID + for all bridges on the system. + + The &man.if.bridge.4; now supports + link state change notification and works with &man.carp.4; + protocol. + + The net.link.bridge + &man.sysctl.8; variables can be set in &man.loader.8; and/or + &man.loader.conf.5; now. + The default number of the bridge forwarding cache entries of the &man.if.bridge.4; pseudo network interface driver has been increased from @@ -484,11 +541,22 @@ FIBs. One can use &man.setfib.1; to select a different routing table for IPv6. + A bug in reference + counting of IPv6 interface routes has been fixed. + A bug which could cause a system panic in multicast routing in kernel with kernel option has been fixed. This option is disabled in GENERIC kernel. + The &man.lagg.4; pseudo network + driver now allows to set which layers are used for the load + balance hash calculation. It can be set in + ifconfig lagghash option in a + comma-separated list. The default value is . For more detail, see &man.ifconfig.8; + manual page. + A bug in the &man.ng.patch.4; &man.netgraph.4; node which could cause a system panic has been fixed. @@ -527,6 +595,9 @@ Disks and Storage + A bug in the &man.amr.4; driver which + could cause data corruption has been fixed. + The &man.ata.4; driver now creates symbolic links for backward compatibility when kernel option is enabled. In a @@ -547,7 +618,14 @@ is enabled or not. This option is disabled in GENERIC kernel. - The &man.cam.4; driver now uses + A new &man.sysctl.8; variable + kern.cam.pmp.hide_special has been added. + This controls whether special PMP ports such as PMP (Port + MultiPlier) configuration or SEMB (SATA Enclosure Management + Bridge) will be exposed or hidden. The default value is + 1 (hidden). + + The &man.cam.4; driver now uses READ CAPACITY(16) SCSI command to get device information by default when possible. This enables to detect whether Logical Block Provisioning (also known as @@ -560,9 +638,9 @@ BIO_DELETE requests handled as a single TRIM request. - The &man.da.4; now supports Olympus - FE-210 camera, LG UP3S MP3 player, and Laser MP3-2GA13 - MP3. + The &man.umass.4; driver now + supports Olympus FE-210 camera, LG UP3S MP3 player, Laser + MP3-2GA13 MP3, and Garmin GPS devices. The &man.isci.4; driver now supports Intel C600 Serial Attached SCSI controllers with chip IDs from @@ -573,6 +651,11 @@ CAPACITY(16) SCSI command for an SATA device has been fixed. + A bug in &man.isci.4; driver which + could prevent smartctl + (sysutils/smartmontools in the Ports + Collection) from working. + The &man.mfi.4; driver now supports LSI MegaRAID SAS cards named "Drake Skinny" and "ThunderBolt". This includes Dell PERC H810/H800/H710/H700 @@ -621,6 +704,12 @@ fixed. They could cause stale name cache entries on an NFS client. + A memory leak when a ZFS volume is + exported via the &os; NFS (newnfs) + server has been fixed. Note that + oldnfs is used as the default NFS + implementation in GENERIC kernel. + &os; NFS subsystem now supports a timeout parameter on positive name cache entries on the NFS client side. nametimeo mount option has @@ -705,6 +794,10 @@ profiling data for the &man.gprof.1; utility with a filename including the process ID. + A bug in the &man.inetd.8; daemon which + could cause wrong accounting for elapsed time has been + fixed. + The &man.lastcomm.1; utility now supports option to specify &man.strftime.3; format for process start @@ -746,6 +839,14 @@ displays osreldate in binary information for a process. + The &man.procstat.1; and &man.fstat.1; + utilities now shows pathname associated with a shared memory + object. + + The &man.ps.1; utility now supports + keyword to show the number of + copy-on-write faults in a process. + A bug in the &man.remquo.3; functions where the quotient did not always have the correct sign when the remainder was 0, and another bug that the remainder and @@ -782,12 +883,17 @@ allows to not request current values from the device, but only receive changes. - zfs list -t snapshot - command has been improved dramatically in performance. - - zfs get command now - supports option. + The &man.zfs.8; list -t + snapshot command has been improved dramatically in + performance. + + The &man.zfs.8; get + command now supports option. + + The &man.zfs.8; send + command now reports transmitted data size in bytes when + flag is specified. <filename>/etc/rc.d</filename> Scripts @@ -810,8 +916,8 @@ Contributed Software - ISC BIND has - been updated to 9.6-ESV-R6. + ISC BIND has + been updated to 9.6-ESV-R7-P1. TENEX C shell (&man.tcsh.1;) has been updated to version 6.18.01. Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 21:02:26 2013 (r251230) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 21:28:43 2013 (r251231) @@ -1,6 +1,14 @@ +shm_open2"> + rad_bind_to3"> libusb_get_max_iso_packet_size3"> +pcf85634"> + boot.config5"> + +shm_map9"> +shm_unmap9"> + From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 21:29:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7354F43E; Sat, 1 Jun 2013 21:29:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64E35FA1; Sat, 1 Jun 2013 21:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51LTsHh020551; Sat, 1 Jun 2013 21:29:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51LTsN7020550; Sat, 1 Jun 2013 21:29:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012129.r51LTsN7020550@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 21:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251232 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 21:29:54 -0000 Author: dteske Date: Sat Jun 1 21:29:53 2013 New Revision: 251232 URL: http://svnweb.freebsd.org/changeset/base/251232 Log: Fix a regression in the packages module introduced by recent r251190. I somehow neglected this module in merging that API change. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 21:28:43 2013 (r251231) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 21:29:53 2013 (r251232) @@ -297,13 +297,13 @@ f_package_menu_categories() $category_list " # End-Quote - local size dialog_menu - size=$( eval f_dialog_menu_with_help_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows dialog_menu + eval f_dialog_menu_with_help_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ @@ -312,7 +312,8 @@ f_package_menu_categories() --default-item \"\$defaultitem\" \ --ok-label \"$msg_select\" \ --cancel-label \"$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -455,17 +456,15 @@ f_package_menu_select() "$page" "$npages" )" local hline="$hline_arrows_tab_punc_enter" - local size isize dialog_menu item - size=$( eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) - isize=$( f_dialog_infobox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$msg_processing_selection" ) + local mheight mwidth mrows + f_dialog_menu${SHOW_DESC:+_with_help}_size mheight mwidth mrows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \"\$hline\" $menu_list + local iheight iwidth + f_dialog_infobox_size iheight iwidth \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" \ + "$msg_processing_selection" + local dialog_menu item dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ @@ -475,11 +474,13 @@ f_package_menu_select() --cancel-label \"$msg_back\" \ ${SHOW_DESC:+--item-help} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $mheight $mwidth $mrows \ $menu_list \ --and-widget \ ${USE_XDIALOG:+--no-buttons} \ - --infobox \"\$msg_processing_selection\" $isize \ + --infobox \"\$msg_processing_selection\" \ + $iheight $iwidth \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? @@ -504,7 +505,7 @@ f_package_menu_select() # f_package_menu_deselect() { - local package="$1" prompt menu_list size dialog_menu + local package="$1" prompt menu_list dialog_menu prompt=$( printf "$msg_what_would_you_like_to_do_with" "$package" ) local hline="$hline_alnum_arrows_punc_tab_enter" menu_list=" @@ -512,19 +513,23 @@ f_package_menu_deselect() 'R $msg_reinstall' '$msg_reinstall_desc' 'U $msg_uninstall' '$msg_uninstall_desc' " # End-Quote - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"$msg_select\" \ --cancel-label \"$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -542,7 +547,7 @@ f_package_menu_deselect() # f_package_review() { - local prompt size dialog_menu package varpkg mark menu_list= + local prompt dialog_menu package varpkg mark menu_list= prompt=$( printf "$msg_reviewing_selected_packages" \ "$_All_nselected" ) local hline="$hline_alnum_arrows_punc_tab_enter" @@ -562,19 +567,23 @@ f_package_review() return $FAILURE # They might have selected this by accident fi menu_list=$( echo "$menu_list" | sort ) - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_proceed\" \ --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 22:12:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82DAEF63; Sat, 1 Jun 2013 22:12:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73DE8E7; Sat, 1 Jun 2013 22:12:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51MCsRo037049; Sat, 1 Jun 2013 22:12:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51MCsMm037048; Sat, 1 Jun 2013 22:12:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012212.r51MCsMm037048@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 22:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251233 - head/usr.sbin/bsdconfig/timezone X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 22:12:54 -0000 Author: dteske Date: Sat Jun 1 22:12:53 2013 New Revision: 251233 URL: http://svnweb.freebsd.org/changeset/base/251233 Log: Fix a typo introduced by r251190. Modified: head/usr.sbin/bsdconfig/timezone/timezone Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Sat Jun 1 21:29:53 2013 (r251232) +++ head/usr.sbin/bsdconfig/timezone/timezone Sat Jun 1 22:12:53 2013 (r251233) @@ -89,7 +89,7 @@ dialog_menu_main() \"\$title\" \ \"\$btitle\" \ \"\$prompt\" \ - \"\$\" \ + \"\" \ $continent_menu_list local dialog_menu From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 22:16:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E62B31C1; Sat, 1 Jun 2013 22:16:43 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C8604F9; Sat, 1 Jun 2013 22:16:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51MGh13037832; Sat, 1 Jun 2013 22:16:43 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51MGhqN037831; Sat, 1 Jun 2013 22:16:43 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306012216.r51MGhqN037831@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 22:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251234 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 22:16:44 -0000 Author: hrs Date: Sat Jun 1 22:16:43 2013 New Revision: 251234 URL: http://svnweb.freebsd.org/changeset/base/251234 Log: Update relnotes item: zfsboot and zfsloader filesystem support in zpool, acpi(4) Processor object listing now uses MADT, uftdi(4) BeagleBone and egnite Turtelizer support, tap(4) VIMAGE support, ahci(4) Marvell 88SE9220/9230/9235 support, mps(4) updated to 14.00.00.01-fbsd, kdump(1) -p option, libedit updated to snapshot as of 2009/12/28, pciconf(8) -e option, sockstat(1) -j option, zfs(8) canmount property handling, netcat updated to OpenBSD 5.1, and OpenSSL updated to version 0.9.8x. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 22:12:53 2013 (r251233) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 22:16:43 2013 (r251234) @@ -319,11 +319,37 @@ zfsboot boot block which could prevent option from working has been fixed. + + The zfsboot boot + block and zfsloader support filesystems + within a ZFS storage pool. In + zfsloader, the ZFS device name format + is now zfs:pool/fs and the fully + qualified file path format is + zfs:pool/fs:/path/to/file. The + zfsboot boot block accepts the + kernel/loader name in the format + pool:fs:path/to/file or, as before, + pool:path/to/file. In the latter case + a default filesystem is used (the pool root or a filesystem + with the bootfs property). The zfsboot + boot block passes the GUIDs of the selected storage pool and + dataset to zfsloader to be used as its + defaults. Hardware Support + &os; &man.acpi.4; subsystem now uses + MADT to match ACPI Processor objects to CPUs and ignores + disabled cores while it is possible that MADT and DSDT/SSDTs + may list CPUs in different orders. A new loader tunable + debug.acpi.cpu_unordered has been added + for buggy systems that do not have unique ACPI IDs for MADT + and Processor objects. Setting it to 1 + restores the old behavior. + A workaround for Erratum 721 for AMD Processor Family 10h and 12h has been implemented. Under a highly specific and detailed set of @@ -367,6 +393,10 @@ Keyboard and Text (KT) Redirection (Serial Over LAN) on Intel 4 Series Chipset family. + The &man.uftdi.4; driver now + supports BeagleBone and FT2232-based egnite Turtelizer 2 + JTAG/RS232 Adapter. + The &man.usb.4; driver now handles suspend events synchronously. This fixed problems of suspend and resume. @@ -491,6 +521,9 @@ been improved. A system load fluctuation under high network load has been fixed. + The &man.tap.4; pseudo network + interface driver now supports VIMAGE &man.jail.8;. + The &man.u3g.4; driver now supports Qualcomm Vertex Wireless 110L modem, Qualcomm 3G modem, Qualcomm Vertex VW110L modem, and SIMCom @@ -595,6 +628,10 @@ Disks and Storage + The &man.ahci.4; driver now supports + Marvell 88SE9220/9230/9235 PCIe 2.0 x2 6Gbps SATA + controllers. + A bug in the &man.amr.4; driver which could cause data corruption has been fixed. @@ -665,6 +702,17 @@ driver attach LSI MegaRAID cards which should be handled by the &man.mfi.4; driver has been fixed. + The &man.mps.4; driver has been + updated to version 14.00.00.01-fbsd. This now supports + Integrated RAID, WarpDrive controllers, + WRITE12 and READ12 for + direct I/O, SCSI protection information (EEDP), Transport + Level Retries (TLR) for tape drives, and LSI's userland + utility. + + The &man.mps.4; driver + has been added to GENERIC kernel. + The MULTIPATH &man.geom.4; class has been updated. It now supports Active/Active mode, Active/Read mode as hybrid of @@ -798,11 +846,19 @@ could cause wrong accounting for elapsed time has been fixed. + The &man.kdump.1; utility now supports a + option to + accept either a process ID or a thread ID. + The &man.lastcomm.1; utility now supports option to specify &man.strftime.3; format for process start and exit times. + The libedit + library has been updated to a NetBSD snapshot as of 28 + December, 2009. + The libpmc library has been updated to support more PMCs (Performance Monitoring Counters) in Intel Core i7 and Xeon 5500 family @@ -835,6 +891,14 @@ been fixed. It could prevent passwordtime login capability in &man.login.conf.5; from working. + The &man.pciconf.8; utility now supports + a flag to display PCI error details in + listing mode. When this is specified, the status of any error + bits in the PCI status register and PCI-express device status + register will be displayed. It also lists any errors indicated + by version 1 of PCI-express Advanced Error Reporting + (AER). + The &man.procstat.1; utility now displays osreldate in binary information for a process. @@ -867,6 +931,11 @@ The &man.sh.1; program now allows underscore characters in the arithmetic expansion. + The &man.sockstat.1; utility now + supports a + option to specify the socket list to be limited to a specific + &man.jail.8; ID. + A bug in &man.traceroute.8; utility which could result in not accepting any incoming packets has been fixed. @@ -895,6 +964,11 @@ command now reports transmitted data size in bytes when flag is specified. + Changing &man.zfs.8; + canmount property to on + when dataset is already mounted does not cause remount of the + ZFS dataset now. + <filename>/etc/rc.d</filename> Scripts @@ -922,6 +996,12 @@ TENEX C shell (&man.tcsh.1;) has been updated to version 6.18.01. + netcat has + been updated to a version as of OpenBSD 5.1. + + OpenSSL has + been updated to version 0.9.8x. + The timezone database has been updated to tzdata2012a release. From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 22:53:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D965CD1; Sat, 1 Jun 2013 22:53:12 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F36611FE; Sat, 1 Jun 2013 22:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51MrBjq050932; Sat, 1 Jun 2013 22:53:11 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51MrBTR050930; Sat, 1 Jun 2013 22:53:11 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306012253.r51MrBTR050930@svn.freebsd.org> From: Hiroki Sato Date: Sat, 1 Jun 2013 22:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r251235 - releng/8.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 22:53:12 -0000 Author: hrs Date: Sat Jun 1 22:53:11 2013 New Revision: 251235 URL: http://svnweb.freebsd.org/changeset/base/251235 Log: Update relnotes item: puc(4) Moxa PCIe multiport serial boards support, snd_emu10kx(4) on PAE kernel fixed, IPv6 atomic fragment handling, if_lagg(4) interface renaming issue fixed, ng_netflow(4) NetFlow version 9 support, mps(4) in GENERIC on sparc64 and powerpc, and procstat(1) superpage flag support. Approved by: re (implicitly) Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 22:16:43 2013 (r251234) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 1 22:53:11 2013 (r251235) @@ -385,8 +385,10 @@ bus briges. This change improves handling of MSIs on AMD CPUs. - The &man.puc.4; driver now supports - Sun 1040 PCI Quad Serial. + The &man.puc.4; driver now + supports Sun 1040 PCI Quad Serial and Moxa PCIe + CP102E/CP102EL/CP104EL-A/CP104JU/CP114EL/CP118EL-A/CP168EL-A + multiport serial boards. The &man.uart.4; driver now supports Intel AMT Serial Port for Remote @@ -414,6 +416,11 @@ Multimedia Support + A bug in the + &man.snd.emu10kx.4; driver which could prevent it from + working with kernel option has been + fixed. + The &man.snd.hda.4; driver has been updated. It now supports and provides HDMI, new volume control, automatic recording source selection, @@ -577,6 +584,14 @@ A bug in reference counting of IPv6 interface routes has been fixed. + &os; IPv6 stack now handles fragment + packets which are not actually fragments but have Fragment + Header with both the Fragment Offset and + the M bit set to 0 as + a regular (non-fragment) packet. For more detail, see + Internet Draft + draft-gont-6man-ipv6-atomic-fragments. + A bug which could cause a system panic in multicast routing in kernel with kernel option has been fixed. This option is disabled in @@ -590,6 +605,17 @@ l2,l3,l4. For more detail, see &man.ifconfig.8; manual page. + A bug in the &man.lagg.4; pseudo + network interface driver which could cause an unexpected + removal of a member interface upon interface renaming has been + fixed. + + The &man.ng.netflow.4; + &man.netgraph.4; node and &man.flowctl.8; utility now + supports NetFlow version 9. A new export9 hook has been + added for NetFlow v9 data. Note that data export can be + done simultaneously in both version 5 and version 9. + A bug in the &man.ng.patch.4; &man.netgraph.4; node which could cause a system panic has been fixed. @@ -710,8 +736,9 @@ Level Retries (TLR) for tape drives, and LSI's userland utility. - The &man.mps.4; driver - has been added to GENERIC kernel. + The + &man.mps.4; driver has been added to + GENERIC kernel. The MULTIPATH &man.geom.4; class has been updated. It now supports @@ -903,6 +930,10 @@ displays osreldate in binary information for a process. + The &man.procstat.1; utility now + displays superpage mapping flag in the process virtual memory + mappings. + The &man.procstat.1; and &man.fstat.1; utilities now shows pathname associated with a shared memory object. Modified: releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 22:16:43 2013 (r251234) +++ releng/8.4/release/doc/en_US.ISO8859-1/relnotes/man-refs.ent Sat Jun 1 22:53:11 2013 (r251235) @@ -9,6 +9,8 @@ boot.config5"> +flowctl8"> + shm_map9"> shm_unmap9"> From owner-svn-src-all@FreeBSD.ORG Sat Jun 1 23:58:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF5AF5DA; Sat, 1 Jun 2013 23:58:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFAE25E6; Sat, 1 Jun 2013 23:58:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51Nwnoo006528; Sat, 1 Jun 2013 23:58:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51NwiFI006489; Sat, 1 Jun 2013 23:58:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012358.r51NwiFI006489@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 23:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251236 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share security share share/media share/packages startup startup/share timezone usermgmt usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 23:58:49 -0000 Author: dteske Date: Sat Jun 1 23:58:44 2013 New Revision: 251236 URL: http://svnweb.freebsd.org/changeset/base/251236 Log: Improve portion of the dialog(1) API in dialog.subr responsible for retrieving stored data (for the --menu, --calendar, --timebox, --checklist, and --radiolist widgets). When we (Ron McDowell and I) developed the first version of bsdconfig, it used temporary files to store responses from dialog(1). That hasn't been true for some very long time, so the need to always store the return status of dialog(1) and then call some function to clean-up is long-deprecated. The function that used to do the clean-up was f_dialog_menutag(). We really don't need f_dialog_menutag() for its originally designed purpose, as all dialog invocations (even when in a sub-shell) do not use temporary files anymore. However, we do need to keep f_dialog_menutag() around because it still fills the need of being able to abstract the procedure for fetching stored data provided by functions that display the aforementioned widgets. In re-designing f_dialog_menutag(), four important changes are made: 1. Rename f_dialog_menutag() to f_dialog_menutag_fetch() 2. Introduce the new first-argument of $var_to_set to reduce number of forks 3. Create a corresponding f_dialog_menutag_store() to abstract the storage 4. Offload the sanitization to a new function, f_dialog_data_sanitize() NOTE: That last one is important. Not all functions need to store their data for later fetching, meanwhile every invocation of dialog should be sanitized (as we learned early-on in the i18n-effort -- underlying libraries will spit warnings to stderr for bad values of $LANG and since dialog outputs its responses to stderr, we need to sanitize every response of these warnings). These changes greatly improve readbaility and also improve performance by reducing unnecessary forking. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/bsdconfig Sat Jun 1 23:58:44 2013 (r251236) @@ -187,8 +187,8 @@ dialog_menu_main() \"\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --clear \ --title \"\$title\" \ --backtitle \"\$btitle\" \ @@ -205,10 +205,11 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -298,7 +299,7 @@ fi while :; do dialog_menu_main retval=$? - mtag=$( f_dialog_menutag ) + f_dialog_menutag_fetch mtag f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/console Sat Jun 1 23:58:44 2013 (r251236) @@ -70,8 +70,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,8 +84,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -115,11 +116,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/font Sat Jun 1 23:58:44 2013 (r251236) @@ -95,8 +95,8 @@ dialog_menu_main() swiss-8x8) defaultitem="e $msg_swiss";; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -109,7 +109,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -139,11 +139,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_none") # Use hardware default font Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/keymap Sat Jun 1 23:58:44 2013 (r251236) @@ -193,8 +193,8 @@ dialog_menu_main() ) && defaultitem=" $defaultitem" fi - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -207,7 +207,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -237,11 +237,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag # # Reverse the users choice into the variable name Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/repeat Sat Jun 1 23:58:44 2013 (r251236) @@ -75,8 +75,8 @@ dialog_menu_main() [Nn][Oo]|'') defaultitem="$msg_default";; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -89,7 +89,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -119,11 +119,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "$msg_slow") # Slow keyboard repeat rate Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/saver Sat Jun 1 23:58:44 2013 (r251236) @@ -94,8 +94,8 @@ dialog_menu_main() [Nn][Oo]|'') defaultitem="d $msg_none" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -108,7 +108,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -138,11 +138,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_blank") # Simply blank the screen Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/screenmap Sat Jun 1 23:58:44 2013 (r251236) @@ -79,8 +79,8 @@ dialog_menu_main() koi8-u2cp866u) defaultitem="6 $msg_koi8_u_to_ibm866u" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -93,7 +93,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -123,11 +123,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_none") # No screenmap, don't touch font Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/ttys Sat Jun 1 23:58:44 2013 (r251236) @@ -83,8 +83,8 @@ dialog_menu_main() \"\$hline\" \ $TTY_MENU_LIST - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -96,7 +96,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -182,11 +182,9 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag - [ $retval -eq 0 ] || f_die [ "$mtag" = "1 $msg_none" ] && break consterm=$( eval f_dialog_menutag2item \"\$mtag\" $TTY_MENU_LIST ) Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/mouse Sat Jun 1 23:58:44 2013 (r251236) @@ -69,8 +69,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -83,8 +83,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -114,11 +115,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/port Sat Jun 1 23:58:44 2013 (r251236) @@ -79,8 +79,8 @@ dialog_menu_main() /dev/mse0) defaultitem="6 $msg_busmouse" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -93,7 +93,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -123,11 +123,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_ps2") # PS/2 style mouse (/dev/psm0) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/type Sat Jun 1 23:58:44 2013 (r251236) @@ -87,8 +87,8 @@ dialog_menu_main() thinkingmouse) defaultitem="A $msg_thinkingmouse" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -101,7 +101,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -131,11 +131,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_auto") # Bus mouse, PS/2 style mouse or PnP serial mouse Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/devices Sat Jun 1 23:58:44 2013 (r251236) @@ -73,13 +73,10 @@ f_mustberoot_init # defaultitem="" while :; do - f_dialog_menu_netdev "$defaultitem" - retval=$? - interface=$( f_dialog_menutag ) + f_dialog_menu_netdev "$defaultitem" || break + f_dialog_menutag_fetch interface defaultitem="$interface" - [ $retval -eq 0 ] || break - # # dialog_menu_netdev adds an asterisk (*) to the right of the # device name if the interface is active. Remove the asterisk Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/networking Sat Jun 1 23:58:44 2013 (r251236) @@ -67,8 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -81,8 +81,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -112,11 +113,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in X) # Exit Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -151,8 +151,8 @@ f_dialog_menu_netdev() \"\$prompt\" \ \"\$hline\" \ $interfaces - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -165,7 +165,7 @@ f_dialog_menu_netdev() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -224,8 +224,8 @@ f_dialog_menu_netdev_edit() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -240,10 +240,8 @@ f_dialog_menu_netdev_edit() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" + f_dialog_data_sanitize tag if [ $retval -eq 2 ]; then # The Help button was pressed Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -205,8 +205,8 @@ f_dialog_menu_media_options() local hline="$hline_arrows_tab_enter" - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -216,11 +216,10 @@ f_dialog_menu_media_options() $supported_media \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize tag + if [ $retval -eq $SUCCESS ]; then - local tag="$( f_dialog_menutag )" options=$( eval f_dialog_menutag2item \"\$tag\" \ $supported_media ) [ "$options" = "$opt_none" ] && options= Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -435,8 +435,8 @@ f_dialog_menu_nameservers() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -448,10 +448,8 @@ f_dialog_menu_nameservers() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" ns="" + f_dialog_data_sanitize tag # Return if "Cancel" was chosen (-1) or ESC was pressed (255) if [ $retval -ne $SUCCESS ]; then @@ -467,6 +465,7 @@ f_dialog_menu_nameservers() f_dialog_input_nameserver ;; *) + local n ns n=$( eval f_dialog_menutag2index \"\$tag\" $menu_list ) ns=$( eval f_dialog_menutag2item \"\$tag\" $menu_list ) f_dialog_input_nameserver $(( $n - 2 )) "$ns" Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Sat Jun 1 23:58:44 2013 (r251236) @@ -81,8 +81,8 @@ dialog_menu_main() defaultitem="$msg_disabled" esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -98,7 +98,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -130,7 +130,7 @@ f_mustberoot_init while :; do dialog_menu_main retval=$? - mtag=$( f_dialog_menutag ) + f_dialog_menutag_fetch mtag if [ $retval -eq 2 ]; then # The Help button was pressed Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/security/security Sat Jun 1 23:58:44 2013 (r251236) @@ -105,8 +105,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -119,10 +119,11 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -153,11 +154,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X <<< $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/device.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -619,6 +619,7 @@ f_device_menu() case $- in *e*) errexit=1; esac set +e + local mtag while :; do mtag=$( eval $DIALOG \ --title \"\$title\" \ @@ -648,8 +649,7 @@ f_device_menu() if [ $retval -eq 0 ]; then # Clean up the output of [X]dialog(1) and return it - setvar DIALOG_MENU_$$ "$mtag" - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag echo "$mtag" >&2 fi Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -107,6 +107,45 @@ DIALOG_TIMEBOX_HEIGHT=6 ############################################################ GENERIC FUNCTIONS +# f_dialog_data_sanitize $var_to_edit ... +# +# When using dialog(1) or Xdialog(1) sometimes unintended warnings or errors +# are generated from underlying libraries. For example, if $LANG is set to an +# invalid or unknown locale, the warnings from the Xdialog(1) libraries will +# clutter the output. This function helps by providing a centralied function +# that removes spurious warnings from the dialog(1) (or Xdialog(1)) response. +# +# Simply pass the name of one or more variables that need to be sanitized. +# After execution, the variables will hold their newly-sanitized data. +# +f_dialog_data_sanitize() +{ + if [ "$#" -eq 0 ]; then + f_dprintf "%s: called with zero arguments" \ + f_dialog_response_sanitize + return $FAILURE + fi + + local __var_to_edit + for __var_to_edit in $*; do + # Skip warnings and trim leading/trailing whitespace + setvar $__var_to_edit "$( f_getvar $__var_to_edit | awk ' + BEGIN { data = 0 } + { + if ( ! data ) + { + if ( $0 ~ /^$/ ) next + if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next + data = 1 + } + print + } + ' )" + done +} + +############################################################ TITLE FUNCTIONS + # f_dialog_title [$new_title] # # Set the title of future dialog(1) ($DIALOG_TITLE) or backtitle of Xdialog(1) @@ -1622,29 +1661,41 @@ f_dialog_input() ############################################################ MENU FUNCTIONS -# f_dialog_menutag +# f_dialog_menutag_store [-s] $text +# +# Store some text from a dialog(1) menu to be retrieved later by +# f_dialog_menutag_fetch(). If the first argument is `-s', the text is +# sanitized before being stored. +# +f_dialog_menutag_store() +{ + local sanitize= + [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s + local text="$1" + + # Sanitize the menutag before storing it if desired + [ "$sanitize" ] && f_dialog_data_sanitize text + + setvar DIALOG_MENU_$$ "$text" +} + +# f_dialog_menutag_fetch [$var_to_set] # # Obtain the menutag chosen by the user from the most recently displayed -# dialog(1) menu and clean up any temporary files/variables. +# dialog(1) menu (previously stored with f_dialog_menutag_store() above). If +# $var_to_set is NULL or missing, output is printed to stdout (which is less +# recommended due to performance degradation; in a loop for example). # -f_dialog_menutag() +f_dialog_menutag_fetch() { - # Skip warnings - eval echo \"\$DIALOG_MENU_$$\" | awk ' - BEGIN { found = 0 } - { - if ( found ) # ... just spew - { - print - next - } - if ( $0 ~ /^$/ ) next - if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next - found = 1 - print - } - ' + local __var_to_set="$1" __cp + + debug= f_getvar DIALOG_MENU_$$ "${__var_to_set:-__cp}" # get the data setvar DIALOG_MENU_$$ "" # scrub memory in case data was sensitive + + # Return the data on standard-out if desired + [ "$__var_to_set" ] || echo "$__cp" + return $SUCCESS } Modified: head/usr.sbin/bsdconfig/share/media/any.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/any.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/any.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -94,10 +94,9 @@ f_media_get_type() \"\$hline\" \ $menu_list - local dialog_menu - + local mtag while :; do - dialog_menu=$( eval $DIALOG \ + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -112,10 +111,7 @@ f_media_get_type() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - - local mtag - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -237,8 +237,8 @@ f_dialog_menu_media_ftp() \"\$hline\" \ $menu_list - local dialog_menu retval mtag value - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -248,16 +248,13 @@ f_dialog_menu_media_ftp() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) - retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || return $FAILURE + ) || return $FAILURE + f_dialog_data_sanitize mtag case "$mtag" in URL) setvar $VAR_FTP_PATH "other" ;; *) + local value value=$( eval f_dialog_menutag2item \"\$mtag\" $menu_list ) setvar $VAR_FTP_PATH "ftp://$value" esac Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/options.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -208,9 +208,8 @@ f_media_options_menu() \"\$hline\" \ $menu_list - local dialog_menu - - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -227,11 +226,8 @@ f_media_options_menu() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - defaultitem="$dialog_menu" - - local mtag - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag + defaultitem="$mtag" f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -1399,8 +1399,7 @@ f_device_dialog_tcp() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$cp" - cp=$( f_dialog_menutag ) + f_dialog_data_sanitize cp f_dprintf "retval=%u mtag=[%s]" $retval "$cp" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -105,8 +105,8 @@ f_become_root_via_sudo() \"\$hline\" \ $menu_list - local dialog_menu mtag retval - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -116,12 +116,8 @@ f_become_root_via_sudo() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) - retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + ) || f_die + f_dialog_data_sanitize mtag case "$mtag" in X) # Cancel/Exit Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -272,8 +272,8 @@ f_package_calculate_rundeps() # Dislay the menu of package categories, complete with package counts for each # category, accents, and other miscellany. If $defaultitem is non-NULL and # matches one of the existing menu-items, it will be pre-highlighted in the -# menu dialog (HINT: Use f_dialog_menutag() to populate a local variable that -# is passed as $defaultitem to highlight the user's last selection by default). +# menu dialog (HINT: Use f_dialog_menutag_fetch() to populate a local variable +# that is passed as $defaultitem to highlight the user's last selection). # f_package_menu_categories() { @@ -297,14 +297,15 @@ f_package_menu_categories() $category_list " # End-Quote - local height width rows dialog_menu + local height width rows eval f_dialog_menu_with_help_size height width rows \ \"\$DIALOG_TITLE\" \ \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \ \"\$hline\" \ $menu_list - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -318,7 +319,7 @@ f_package_menu_categories() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -360,7 +361,7 @@ f_package_index_get_page() # # On success, if the user doesn't press ESC or choose Cancel, the environment # variable $DIALOG_MENUITEM_$$ will hold the item associated with the chosen -# tag (accessible through f_dialog_menutag()). +# tag (accessible through f_dialog_menutag_fetch()). # f_package_menu_select() { @@ -464,8 +465,9 @@ f_package_menu_select() f_dialog_infobox_size iheight iwidth \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" \ "$msg_processing_selection" - local dialog_menu item - dialog_menu=$( eval $DIALOG \ + + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -484,11 +486,13 @@ f_package_menu_select() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" if [ $retval -eq $SUCCESS ]; then + local item item=$( eval f_dialog_menutag2item${SHOW_DESC:+_with_help} \ - \"\$dialog_menu\" $menu_list ) + \"\$menu_choice\" $menu_list ) setvar DIALOG_MENUITEM_$$ "$item" fi @@ -501,11 +505,11 @@ f_package_menu_select() # with regard to "deselecting" an already installed package. Choices include # uninstall, re-install, or cancel (leave $package marked as installed). # Returns success if the user does not press ESC or choose Cnacel. Use the -# f_dialog_menutag() function upon success to retrieve the user's choice. +# f_dialog_menutag_fetch() function upon success to retrieve the user's choice. # f_package_menu_deselect() { - local package="$1" prompt menu_list dialog_menu + local package="$1" prompt menu_list prompt=$( printf "$msg_what_would_you_like_to_do_with" "$package" ) local hline="$hline_alnum_arrows_punc_tab_enter" menu_list=" @@ -521,8 +525,8 @@ f_package_menu_deselect() \"\$prompt\" \ \"\$hline\" \ $menu_list - - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -534,7 +538,7 @@ f_package_menu_deselect() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***