From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 00:41:16 2013 Return-Path: Delivered-To: svn-src-head@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 B2CD41A7; Sun, 21 Apr 2013 00:41:16 +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 A3F85151E; Sun, 21 Apr 2013 00:41: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 r3L0fGmW057354; Sun, 21 Apr 2013 00:41:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3L0fGMW057353; Sun, 21 Apr 2013 00:41:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304210041.r3L0fGMW057353@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Apr 2013 00:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249715 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 00:41:16 -0000 Author: adrian Date: Sun Apr 21 00:41:15 2013 New Revision: 249715 URL: http://svnweb.freebsd.org/changeset/base/249715 Log: When doing BAW tracking, don't dereference a NULL pointer if the BAW slot is actually NULL. 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 Sat Apr 20 23:33:51 2013 (r249714) +++ head/sys/dev/ath/if_ath_tx.c Sun Apr 21 00:41:15 2013 (r249715) @@ -2590,7 +2590,8 @@ ath_tx_update_baw(struct ath_softc *sc, __func__, bf, SEQNO(bf->bf_state.bfs_seqno), tid->tx_buf[cindex], - SEQNO(tid->tx_buf[cindex]->bf_state.bfs_seqno)); + (tid->tx_buf[cindex] != NULL) ? + SEQNO(tid->tx_buf[cindex]->bf_state.bfs_seqno) : -1); } tid->tx_buf[cindex] = NULL; From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 03:32:59 2013 Return-Path: Delivered-To: svn-src-head@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 92BDBB29; Sun, 21 Apr 2013 03:32:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8B2131; Sun, 21 Apr 2013 03:32:59 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id k5so5965656iea.18 for ; Sat, 20 Apr 2013 20:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=wEhXl0icaix14s280E8WbeqwCbs4wPtP7Gh4Ti3OqlU=; b=F3ps25CSGT46Eq5psUziwdZOAtUX+cDgKUNREagW6elyJnW9aTTyEFc0DhcUqxudgN SDD9ZPLyfGiME5a4Bd25zKPjQRIrn6IZVNkjjNWhTbO8Tb3bOXAjAltE6UxOgBTvWRpp f74+BB4dcruDK0vnGFJLD6mYcFDblyZdi9VtupduNwy4er1w85aEhOOUG8MMG1OSn5Pb w7ENCZBqccyc55HoAUmiZ2mt/AayFlLm2lStVDABQs6HghC7oM7KxTRAhQuxhJxbvKXD DjsXkV9VTCzL6UTTfd6aaxckl3qmqIzhIAyMVyocjlTrTNO347OShF9rLRmrbnMBblCn +48Q== X-Received: by 10.50.36.97 with SMTP id p1mr5327886igj.64.1366513706221; Sat, 20 Apr 2013 20:08:26 -0700 (PDT) Received: from gloom ([66.11.160.35]) by mx.google.com with ESMTPSA id ua6sm10056980igb.0.2013.04.20.20.08.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 20:08:25 -0700 (PDT) Sender: Mark Johnston Date: Sat, 20 Apr 2013 23:08:18 -0400 From: Mark Johnston To: Andriy Gapon Subject: Re: svn commit: r248644 - head/cddl/contrib/opensolaris/lib/libdtrace/common Message-ID: <20130421030818.GA23819@gloom> References: <201303230857.r2N8vsHL058716@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303230857.r2N8vsHL058716@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 03:32:59 -0000 On Sat, Mar 23, 2013 at 08:57:54AM +0000, Andriy Gapon wrote: > Author: avg > Date: Sat Mar 23 08:57:54 2013 > New Revision: 248644 > URL: http://svnweb.freebsd.org/changeset/base/248644 > > Log: > dtrace: ensure that we can always catch a process (e.g. when -c is used) > > It is not guaranteed that a program has a symbol table entry for main > and thus that it would be possible to set a breakpoint on it. > > Reviewed by: rpaulo > Discussed with: rpaulo > MFC after: 13 days Hi Andriy, This commit seems to break USDT for me. When I for instance try to run the toy example at https://wiki.freebsd.org/DTrace/userland (the database provider), I get markj@gloom: ~/tmp/dtrace/db $ sudo dtrace -s db.d -c ./db dtrace: failed to compile script db.d: line 2: probe description database23147:::query-start does not match any probes When I revert this commit and recompile the example program and libdtrace, it works as expected. Thanks, -Mark From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 06:04:34 2013 Return-Path: Delivered-To: svn-src-head@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 502E7A59; Sun, 21 Apr 2013 06:04:34 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3967D0; Sun, 21 Apr 2013 06:04:33 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id l13so2939807wie.5 for ; Sat, 20 Apr 2013 23:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=zhoY/qKUW7GABKCnATSRlav6b1SQAVfSQZnjmwPt3e0=; b=MoABs3lwTkg7JnaP/wqMJxe7T1AJR0+N9ZxMICV/+5dDdIDO7rGryPY1tHMIAC0mvo M0XaMxKEk7kaqZodbiqWeQ+/vSRciFAwCqMU1/i7j3I+qQjzjiQK3Z35TkMfmWtIvE9j hr2Ri3fv7PJZn51A+9/4X6PbEqcjBlAlKmA0c4psXOssNEt9DOua1m66MkiIVJq6IW8c jHpbchu/WmlyKsza9+DDWLvAeGv/y4sGGMoH3RoFo4GP/35SGEa+ljknj/ZKD4CdlAN0 o9yezFFTi3iP2NjT1jWoWPknDyTzorzcbXEYfBiFosZH6aoBsBQMpsWB0+MqHcgKVsNS Y55w== X-Received: by 10.180.92.229 with SMTP id cp5mr17454978wib.20.1366524271659; Sat, 20 Apr 2013 23:04:31 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPS id n48sm32872407eeg.12.2013.04.20.23.04.29 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:04:30 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 21 Apr 2013 09:04:27 +0300 From: Mikolaj Golub To: Joel Dahl Subject: Re: svn commit: r249711 - head/lib/libprocstat Message-ID: <20130421060424.GB7136@gmail.com> References: <201304202216.r3KMGntw060973@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304202216.r3KMGntw060973@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 06:04:34 -0000 On Sat, Apr 20, 2013 at 10:16:49PM +0000, Joel Dahl wrote: > Author: joel (doc committer) > Date: Sat Apr 20 22:16:49 2013 > New Revision: 249711 > URL: http://svnweb.freebsd.org/changeset/base/249711 > > Log: > mdoc: end function context properly. > > Modified: > head/lib/libprocstat/libprocstat.3 Thanks! -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 06:46:42 2013 Return-Path: Delivered-To: svn-src-head@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 E6865F03; Sun, 21 Apr 2013 06:46:42 +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 C78F488E; Sun, 21 Apr 2013 06:46: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 r3L6kg7v079716; Sun, 21 Apr 2013 06:46:42 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3L6kg0S079709; Sun, 21 Apr 2013 06:46:42 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304210646.r3L6kg0S079709@svn.freebsd.org> From: Joel Dahl Date: Sun, 21 Apr 2013 06:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249716 - in head: lib/libc/sys share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 06:46:43 -0000 Author: joel (doc committer) Date: Sun Apr 21 06:46:41 2013 New Revision: 249716 URL: http://svnweb.freebsd.org/changeset/base/249716 Log: Remove cross-references to nonexistent CPU_SET(3) manpage. Also fix cpu_getaffinity(2) document title. PR: 176317 Submitted by: brucec Modified: head/lib/libc/sys/cpuset.2 head/lib/libc/sys/cpuset_getaffinity.2 head/share/man/man3/pthread_affinity_np.3 head/share/man/man3/pthread_attr_affinity_np.3 Modified: head/lib/libc/sys/cpuset.2 ============================================================================== --- head/lib/libc/sys/cpuset.2 Sun Apr 21 00:41:15 2013 (r249715) +++ head/lib/libc/sys/cpuset.2 Sun Apr 21 06:46:41 2013 (r249716) @@ -216,7 +216,6 @@ for allocation. .Xr cpuset 1 , .Xr cpuset_getaffinity 2 , .Xr cpuset_setaffinity 2 , -.Xr CPU_SET 3 , .Xr pthread_affinity_np 3 , .Xr pthread_attr_affinity_np 3 .Sh HISTORY Modified: head/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- head/lib/libc/sys/cpuset_getaffinity.2 Sun Apr 21 00:41:15 2013 (r249715) +++ head/lib/libc/sys/cpuset_getaffinity.2 Sun Apr 21 06:46:41 2013 (r249716) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .Dd September 10, 2010 -.Dt CPUSET 2 +.Dt CPUSET_GETAFFINITY 2 .Os .Sh NAME .Nm cpuset_getaffinity , @@ -69,7 +69,7 @@ All resources, however, have a mask whic Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 2 +.Dv CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. @@ -152,7 +152,6 @@ operation. .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr CPU_SET 3 , .Xr pthread_affinity_np 3 , .Xr pthread_attr_affinity_np 3 .Sh HISTORY Modified: head/share/man/man3/pthread_affinity_np.3 ============================================================================== --- head/share/man/man3/pthread_affinity_np.3 Sun Apr 21 00:41:15 2013 (r249715) +++ head/share/man/man3/pthread_affinity_np.3 Sun Apr 21 06:46:41 2013 (r249716) @@ -49,7 +49,7 @@ allow the manipulation of sets of CPUs a Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 3 +.Dv CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. @@ -123,7 +123,6 @@ operation. .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr CPU_SET 3 , .Xr pthread 3 , .Xr pthread_attr_getaffinity_np 3 , .Xr pthread_attr_setaffinity_np 3 Modified: head/share/man/man3/pthread_attr_affinity_np.3 ============================================================================== --- head/share/man/man3/pthread_attr_affinity_np.3 Sun Apr 21 00:41:15 2013 (r249715) +++ head/share/man/man3/pthread_attr_affinity_np.3 Sun Apr 21 06:46:41 2013 (r249716) @@ -50,7 +50,7 @@ functions allow the manipulation of sets Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 3 +.Dv CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. @@ -132,7 +132,6 @@ Insufficient memory exists to store the .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr CPU_SET 3 , .Xr pthread_get_affinity_np 3 , .Xr pthread_set_affinity_np 3 .Sh STANDARDS From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 08:35:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0047131F; Sun, 21 Apr 2013 08:35:38 +0000 (UTC) (envelope-from rpaulo@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 E6099B54; Sun, 21 Apr 2013 08:35: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 r3L8ZcGD014047; Sun, 21 Apr 2013 08:35:38 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3L8ZchM014046; Sun, 21 Apr 2013 08:35:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304210835.r3L8ZchM014046@svn.freebsd.org> From: Rui Paulo Date: Sun, 21 Apr 2013 08:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249718 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 08:35:39 -0000 Author: rpaulo Date: Sun Apr 21 08:35:38 2013 New Revision: 249718 URL: http://svnweb.freebsd.org/changeset/base/249718 Log: Fix an off by one calculation in wiipic_dispatch(). Modified: head/sys/powerpc/wii/wii_pic.c Modified: head/sys/powerpc/wii/wii_pic.c ============================================================================== --- head/sys/powerpc/wii/wii_pic.c Sun Apr 21 07:48:38 2013 (r249717) +++ head/sys/powerpc/wii/wii_pic.c Sun Apr 21 08:35:38 2013 (r249718) @@ -156,7 +156,10 @@ wiipic_dispatch(device_t dev, struct tra uint32_t irq; sc = device_get_softc(dev); - irq = ffs(wiipic_icr_read(sc) & wiipic_imr_read(sc)); + irq = wiipic_icr_read(sc) & wiipic_imr_read(sc); + if (irq == 0) + return; + irq = ffs(irq) - 1; KASSERT(irq < WIIPIC_NIRQ, ("bogus irq %d", irq)); powerpc_dispatch_intr(sc->sc_vector[irq], tf); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 09:10:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE52180E; Sun, 21 Apr 2013 09:10:36 +0000 (UTC) (envelope-from ae@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 9FDDFCDD; Sun, 21 Apr 2013 09:10: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 r3L9AaLi024234; Sun, 21 Apr 2013 09:10:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3L9AaHr024233; Sun, 21 Apr 2013 09:10:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304210910.r3L9AaHr024233@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 21 Apr 2013 09:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249719 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 09:10:36 -0000 Author: ae Date: Sun Apr 21 09:10:35 2013 New Revision: 249719 URL: http://svnweb.freebsd.org/changeset/base/249719 Log: Since we didn't break the loop, we should set i to -1 to start from the beginning. Submitted by: Steven Hartland MFC after: 1 week Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sun Apr 21 08:35:38 2013 (r249718) +++ head/sys/boot/common/module.c Sun Apr 21 09:10:35 2013 (r249719) @@ -289,7 +289,8 @@ file_load(char *filename, vm_offset_t de break; } else if (last_file_format == i && i != 0) { /* Restart from the beginning */ - last_file_format = i = 0; + i = -1; + last_file_format = 0; fp = NULL; continue; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 10:08:34 2013 Return-Path: Delivered-To: svn-src-head@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 007D91D4; Sun, 21 Apr 2013 10:08:33 +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 E7320E07; Sun, 21 Apr 2013 10:08: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 r3LA8XJN042322; Sun, 21 Apr 2013 10:08:33 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LA8XKL042321; Sun, 21 Apr 2013 10:08:33 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304211008.r3LA8XKL042321@svn.freebsd.org> From: Joel Dahl Date: Sun, 21 Apr 2013 10:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249720 - head/sbin/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 10:08:34 -0000 Author: joel (doc committer) Date: Sun Apr 21 10:08:33 2013 New Revision: 249720 URL: http://svnweb.freebsd.org/changeset/base/249720 Log: Move EXAMPLES descriptions to before the actual command. PR: 177870 Submitted by: Bjorn Heidotting Modified: head/sbin/devfs/devfs.8 Modified: head/sbin/devfs/devfs.8 ============================================================================== --- head/sbin/devfs/devfs.8 Sun Apr 21 09:10:35 2013 (r249719) +++ head/sbin/devfs/devfs.8 Sun Apr 21 10:08:33 2013 (r249720) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2010 +.Dd April 21, 2013 .Dt DEVFS 8 .Os .Sh NAME @@ -269,13 +269,11 @@ the operations are performed on .Pa /dev (this only matters for things that might change the properties of nodes). .Pp -.Dl "devfs ruleset 10" -.Pp Specify that ruleset 10 should be the current ruleset for .Pa /dev -(if it does not already exist, it is created). +(if it does not already exist, it is created): .Pp -.Dl "devfs rule add path speaker mode 666" +.Dl "devfs ruleset 10" .Pp Add a rule that causes all nodes that have a path that matches .Dq Li speaker @@ -291,22 +289,19 @@ be changed if the node is created the rule is added (e.g., the .Pa atspeaker -module is loaded after the above rule is added). +module is loaded after the above rule is added): .Pp -.Dl "devfs rule applyset" +.Dl "devfs rule add path speaker mode 666" .Pp Apply all the rules in the current ruleset to all the existing nodes. -E.g., if the above rule was added after +E.g., if the below rule was added after .Pa /dev/speaker was created, this command will cause its file mode to be changed to 666 -as prescribed by the rule. +as prescribed by the rule: .Pp -.Dl devfs rule add path "snp*" mode 660 group snoopers +.Dl "devfs rule applyset" .Pp -(Quoting the argument to -.Cm path -is often necessary to disable the shell's globbing features.) For all devices with a path that matches .Dq Li snp* , set the file mode to 660 and the GID to @@ -315,53 +310,57 @@ This permits users in the .Dq Li snoopers group to use the .Xr snp 4 -devices. +devices +(quoting the argument to +.Cm path +is often necessary to disable the shell's globbing features): .Pp -.Dl "devfs rule -s 20 add type disk group wheel" +.Dl devfs rule add path "snp*" mode 660 group snoopers .Pp Add a rule to ruleset number 20. Since this ruleset is not the current ruleset for any mount-points, this rule is never applied automatically (unless ruleset 20 becomes -a current ruleset for some mount-point at a later time). -However, it can be applied explicitly, as such: +a current ruleset for some mount-point at a later time): .Pp -.Dl "devfs -m /my/jail/dev rule -s 20 applyset" +.Dl "devfs rule -s 20 add type disk group wheel" .Pp -This will apply all rules in ruleset number 20 to the DEVFS mount on +Explicitly apply all rules in ruleset number 20 to the DEVFS mount on .Pa /my/jail/dev . It does not matter that ruleset 20 is not the current ruleset for that -mount-point; the rules are still applied. +mount-point; the rules are still applied: .Pp -.Dl "devfs rule apply hide" +.Dl "devfs -m /my/jail/dev rule -s 20 applyset" .Pp -Since this rule has no conditions, the action +Since the following rule has no conditions, the action .Pq Cm hide -will be applied to all nodes. -Since hiding all nodes is not very useful, we can undo it: +will be applied to all nodes: .Pp -.Dl "devfs rule apply unhide" +.Dl "devfs rule apply hide" .Pp -which applies +Since hiding all nodes is not very useful, we can undo it. +The following applies .Cm unhide to all the nodes, -causing them to reappear. +causing them to reappear: .Pp -.Dl "devfs rule -s 10 add - < my_rules" +.Dl "devfs rule apply unhide" .Pp Add all the rules from the file .Pa my_rules -to ruleset 10. +to ruleset 10: .Pp -.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" +.Dl "devfs rule -s 10 add - < my_rules" .Pp -Since -.Cm show -outputs valid rules, -this feature can be used to copy rulesets. -The above copies all the rules from ruleset 20 into ruleset 10. +The below copies all the rules from ruleset 20 into ruleset 10. The rule numbers are preserved, but ruleset 10 may already have rules with non-conflicting numbers (these will be preserved). +Since +.Cm show +outputs valid rules, +this feature can be used to copy rulesets: +.Pp +.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" .Sh SEE ALSO .Xr chmod 1 , .Xr jail 2 , From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 10:30:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 363968F0; Sun, 21 Apr 2013 10:30:20 +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 BB208E98; Sun, 21 Apr 2013 10:30: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 r3LAUJUO050433; Sun, 21 Apr 2013 10:30:19 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LAUJrO050431; Sun, 21 Apr 2013 10:30:19 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304211030.r3LAUJrO050431@svn.freebsd.org> From: Joel Dahl Date: Sun, 21 Apr 2013 10:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249721 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 10:30:20 -0000 Author: joel (doc committer) Date: Sun Apr 21 10:30:19 2013 New Revision: 249721 URL: http://svnweb.freebsd.org/changeset/base/249721 Log: Add example. PR: 177025 Submitted by: Fernando Reviewed by: theraven Modified: head/lib/libc/stdlib/lsearch.3 Modified: head/lib/libc/stdlib/lsearch.3 ============================================================================== --- head/lib/libc/stdlib/lsearch.3 Sun Apr 21 10:08:33 2013 (r249720) +++ head/lib/libc/stdlib/lsearch.3 Sun Apr 21 10:30:19 2013 (r249721) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2002 +.Dd April 21, 2013 .Dt LSEARCH 3 .Os .Sh NAME @@ -81,6 +81,47 @@ returns Both functions return .Dv NULL if an error occurs. +.Sh EXAMPLES +.Bd -literal +#include +#include +#include + +static int +element_compare(const void *p1, const void *p2) +{ + int left = *(const int *)p1; + int right = *(const int *)p2; + + return (left - right); +} + +int +main(int argc, char **argv) +{ + const int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + size_t element_size = sizeof(array[0]); + size_t array_size = sizeof(array) / element_size; + int key; + void *element; + + printf("Enter a number: "); + if (scanf("%d", &key) != 1) { + printf("Bad input\n"); + return (EXIT_FAILURE); + } + + element = lfind(&key, array, &array_size, element_size, + element_compare); + + if (element != NULL) + printf("Element found: %d\n", *(int *)element); + else + printf("Element not found\n"); + + return (EXIT_SUCCESS); +} +.Ed .Sh SEE ALSO .Xr bsearch 3 , .Xr hsearch 3 , From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 11:12:45 2013 Return-Path: Delivered-To: svn-src-head@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 1838BA6; Sun, 21 Apr 2013 11:12:45 +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 0AF3DF8F; Sun, 21 Apr 2013 11:12: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 r3LBCiFx063407; Sun, 21 Apr 2013 11:12:44 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LBCiQP063406; Sun, 21 Apr 2013 11:12:44 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201304211112.r3LBCiQP063406@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 21 Apr 2013 11:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249722 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 11:12:45 -0000 Author: tijl Date: Sun Apr 21 11:12:44 2013 New Revision: 249722 URL: http://svnweb.freebsd.org/changeset/base/249722 Log: Remove redundant definitions of _ALIGN and _ALIGNBYTES. Modified: head/sys/i386/include/param.h Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Sun Apr 21 10:30:19 2013 (r249721) +++ head/sys/i386/include/param.h Sun Apr 21 11:12:44 2013 (r249722) @@ -33,26 +33,15 @@ * $FreeBSD$ */ -#include #ifndef _I386_INCLUDE_PARAM_H_ #define _I386_INCLUDE_PARAM_H_ -/* - * Machine dependent constants for Intel 386. - */ +#include /* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. + * Machine dependent constants for Intel 386. */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(int) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif #define __HAVE_ACPI From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 13:31:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BAAB9DD; Sun, 21 Apr 2013 13:31:56 +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 F13E91379; Sun, 21 Apr 2013 13:31: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 r3LDVt5X006266; Sun, 21 Apr 2013 13:31:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LDVt6c006264; Sun, 21 Apr 2013 13:31:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304211331.r3LDVt6c006264@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Apr 2013 13:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249724 - in head/lib/msun: . amd64 i387 x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 13:31:56 -0000 Author: kib Date: Sun Apr 21 13:31:55 2013 New Revision: 249724 URL: http://svnweb.freebsd.org/changeset/base/249724 Log: Merge the 386 and amd64 versions of the fenv.h, to make cc -m32 compilations which use fenv.h work. Reviewed by: tjil Sponsored by: The FreeBSD Foundation Added: head/lib/msun/x86/ head/lib/msun/x86/fenv.h - copied, changed from r249723, head/lib/msun/i387/fenv.h Deleted: head/lib/msun/amd64/fenv.h head/lib/msun/i387/fenv.h Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sun Apr 21 12:16:59 2013 (r249723) +++ head/lib/msun/Makefile Sun Apr 21 13:31:55 2013 (r249724) @@ -35,6 +35,10 @@ CFLAGS+= -I${.CURDIR}/ld128 .PATH: ${.CURDIR}/src .PATH: ${.CURDIR}/man +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${.CURDIR}/x86 +.endif + LIB= m SHLIBDIR?= /lib SHLIB_MAJOR= 5 Copied and modified: head/lib/msun/x86/fenv.h (from r249723, head/lib/msun/i387/fenv.h) ============================================================================== --- head/lib/msun/i387/fenv.h Sun Apr 21 12:16:59 2013 (r249723, copy source) +++ head/lib/msun/x86/fenv.h Sun Apr 21 13:31:55 2013 (r249724) @@ -36,26 +36,6 @@ #define __fenv_static static #endif -/* - * To preserve binary compatibility with FreeBSD 5.3, we pack the - * mxcsr into some reserved fields, rather than changing sizeof(fenv_t). - */ -typedef struct { - __uint16_t __control; - __uint16_t __mxcsr_hi; - __uint16_t __status; - __uint16_t __mxcsr_lo; - __uint32_t __tag; - char __other[16]; -} fenv_t; - -#define __get_mxcsr(env) (((env).__mxcsr_hi << 16) | \ - ((env).__mxcsr_lo)) -#define __set_mxcsr(env, x) do { \ - (env).__mxcsr_hi = (__uint32_t)(x) >> 16; \ - (env).__mxcsr_lo = (__uint16_t)(x); \ -} while (0) - typedef __uint16_t fexcept_t; /* Exception flags */ @@ -84,18 +64,32 @@ typedef __uint16_t fexcept_t; #define _SSE_ROUND_SHIFT 3 #define _SSE_EMASK_SHIFT 7 -__BEGIN_DECLS +#ifdef __i386__ +/* + * To preserve binary compatibility with FreeBSD 5.3, we pack the + * mxcsr into some reserved fields, rather than changing sizeof(fenv_t). + */ +typedef struct { + __uint16_t __control; + __uint16_t __mxcsr_hi; + __uint16_t __status; + __uint16_t __mxcsr_lo; + __uint32_t __tag; + char __other[16]; +} fenv_t; +#else /* __amd64__ */ +typedef struct { + struct { + __uint32_t __control; + __uint32_t __status; + __uint32_t __tag; + char __other[16]; + } __x87; + __uint32_t __mxcsr; +} fenv_t; +#endif /* __i386__ */ -/* After testing for SSE support once, we cache the result in __has_sse. */ -enum __sse_support { __SSE_YES, __SSE_NO, __SSE_UNK }; -extern enum __sse_support __has_sse; -int __test_sse(void); -#ifdef __SSE__ -#define __HAS_SSE() 1 -#else -#define __HAS_SSE() (__has_sse == __SSE_YES || \ - (__has_sse == __SSE_UNK && __test_sse())) -#endif +__BEGIN_DECLS /* Default floating-point environment */ extern const fenv_t __fe_dfl_env; @@ -114,6 +108,68 @@ extern const fenv_t __fe_dfl_env; #define __ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr)) #define __stmxcsr(__csr) __asm __volatile("stmxcsr %0" : "=m" (*(__csr))) +int fegetenv(fenv_t *__envp); +int feholdexcept(fenv_t *__envp); +int fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int feraiseexcept(int __excepts); +int feupdateenv(const fenv_t *__envp); + +__fenv_static inline int +fegetround(void) +{ + __uint16_t __control; + + /* + * We assume that the x87 and the SSE unit agree on the + * rounding mode. Reading the control word on the x87 turns + * out to be about 5 times faster than reading it on the SSE + * unit on an Opteron 244. + */ + __fnstcw(&__control); + return (__control & _ROUND_MASK); +} + +#if __BSD_VISIBLE + +int feenableexcept(int __mask); +int fedisableexcept(int __mask); + +/* We currently provide no external definition of fegetexcept(). */ +static inline int +fegetexcept(void) +{ + __uint16_t __control; + + /* + * We assume that the masks for the x87 and the SSE unit are + * the same. + */ + __fnstcw(&__control); + return (~__control & FE_ALL_EXCEPT); +} + +#endif /* __BSD_VISIBLE */ + +#ifdef __i386__ + +/* After testing for SSE support once, we cache the result in __has_sse. */ +enum __sse_support { __SSE_YES, __SSE_NO, __SSE_UNK }; +extern enum __sse_support __has_sse; +int __test_sse(void); +#ifdef __SSE__ +#define __HAS_SSE() 1 +#else +#define __HAS_SSE() (__has_sse == __SSE_YES || \ + (__has_sse == __SSE_UNK && __test_sse())) +#endif + +#define __get_mxcsr(env) (((env).__mxcsr_hi << 16) | \ + ((env).__mxcsr_lo)) +#define __set_mxcsr(env, x) do { \ + (env).__mxcsr_hi = (__uint32_t)(x) >> 16; \ + (env).__mxcsr_lo = (__uint16_t)(x); \ +} while (0) + __fenv_static inline int feclearexcept(int __excepts) { @@ -150,9 +206,6 @@ fegetexceptflag(fexcept_t *__flagp, int return (0); } -int fesetexceptflag(const fexcept_t *__flagp, int __excepts); -int feraiseexcept(int __excepts); - __fenv_static inline int fetestexcept(int __excepts) { @@ -168,21 +221,6 @@ fetestexcept(int __excepts) } __fenv_static inline int -fegetround(void) -{ - __uint16_t __control; - - /* - * We assume that the x87 and the SSE unit agree on the - * rounding mode. Reading the control word on the x87 turns - * out to be about 5 times faster than reading it on the SSE - * unit on an Opteron 244. - */ - __fnstcw(&__control); - return (__control & _ROUND_MASK); -} - -__fenv_static inline int fesetround(int __round) { __uint32_t __mxcsr; @@ -206,9 +244,6 @@ fesetround(int __round) return (0); } -int fegetenv(fenv_t *__envp); -int feholdexcept(fenv_t *__envp); - __fenv_static inline int fesetenv(const fenv_t *__envp) { @@ -231,28 +266,89 @@ fesetenv(const fenv_t *__envp) return (0); } -int feupdateenv(const fenv_t *__envp); +#else /* __amd64__ */ -#if __BSD_VISIBLE +__fenv_static inline int +feclearexcept(int __excepts) +{ + fenv_t __env; -int feenableexcept(int __mask); -int fedisableexcept(int __mask); + if (__excepts == FE_ALL_EXCEPT) { + __fnclex(); + } else { + __fnstenv(&__env.__x87); + __env.__x87.__status &= ~__excepts; + __fldenv(__env.__x87); + } + __stmxcsr(&__env.__mxcsr); + __env.__mxcsr &= ~__excepts; + __ldmxcsr(__env.__mxcsr); + return (0); +} -/* We currently provide no external definition of fegetexcept(). */ -static inline int -fegetexcept(void) +__fenv_static inline int +fegetexceptflag(fexcept_t *__flagp, int __excepts) +{ + __uint32_t __mxcsr; + __uint16_t __status; + + __stmxcsr(&__mxcsr); + __fnstsw(&__status); + *__flagp = (__mxcsr | __status) & __excepts; + return (0); +} + +__fenv_static inline int +fetestexcept(int __excepts) { + __uint32_t __mxcsr; + __uint16_t __status; + + __stmxcsr(&__mxcsr); + __fnstsw(&__status); + return ((__status | __mxcsr) & __excepts); +} + +__fenv_static inline int +fesetround(int __round) +{ + __uint32_t __mxcsr; __uint16_t __control; + if (__round & ~_ROUND_MASK) + return (-1); + + __fnstcw(&__control); + __control &= ~_ROUND_MASK; + __control |= __round; + __fldcw(__control); + + __stmxcsr(&__mxcsr); + __mxcsr &= ~(_ROUND_MASK << _SSE_ROUND_SHIFT); + __mxcsr |= __round << _SSE_ROUND_SHIFT; + __ldmxcsr(__mxcsr); + + return (0); +} + +__fenv_static inline int +fesetenv(const fenv_t *__envp) +{ + /* - * We assume that the masks for the x87 and the SSE unit are - * the same. + * XXX Using fldenvx() instead of fldenv() tells the compiler that this + * instruction clobbers the i387 register stack. This happens because + * we restore the tag word from the saved environment. Normally, this + * would happen anyway and we wouldn't care, because the ABI allows + * function calls to clobber the i387 regs. However, fesetenv() is + * inlined, so we need to be more careful. */ - __fnstcw(&__control); - return (~__control & FE_ALL_EXCEPT); + __fldenvx(__envp->__x87); + __ldmxcsr(__envp->__mxcsr); + return (0); } -#endif /* __BSD_VISIBLE */ +#endif /* __i386__ */ __END_DECLS From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 16:02:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F18A62F4; Sun, 21 Apr 2013 16:02:51 +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 E37EE172F; Sun, 21 Apr 2013 16:02: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 r3LG2pQA052890; Sun, 21 Apr 2013 16:02:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LG2pWp052889; Sun, 21 Apr 2013 16:02:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304211602.r3LG2pWp052889@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 21 Apr 2013 16:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249725 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 16:02:52 -0000 Author: hselasky Date: Sun Apr 21 16:02:50 2013 New Revision: 249725 URL: http://svnweb.freebsd.org/changeset/base/249725 Log: Add OHCI controller ID. MFC after: 2 weeks Submitted by: Dmitry Luhtionov Modified: head/sys/dev/usb/controller/ohci_pci.c Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Sun Apr 21 13:31:55 2013 (r249724) +++ head/sys/dev/usb/controller/ohci_pci.c Sun Apr 21 16:02:50 2013 (r249725) @@ -134,6 +134,8 @@ ohci_pci_match(device_t self) return "ATI SB400 USB Controller"; case 0x43971002: return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); + case 0x43981002: + return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); case 0x43991002: return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 16:09:35 2013 Return-Path: Delivered-To: svn-src-head@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 BE7224A0; Sun, 21 Apr 2013 16:09:35 +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 B1498174F; Sun, 21 Apr 2013 16:09: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 r3LG9Z8v054055; Sun, 21 Apr 2013 16:09:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LG9Z8B054053; Sun, 21 Apr 2013 16:09:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304211609.r3LG9Z8B054053@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 21 Apr 2013 16:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249726 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 16:09:35 -0000 Author: hselasky Date: Sun Apr 21 16:09:35 2013 New Revision: 249726 URL: http://svnweb.freebsd.org/changeset/base/249726 Log: Fix manual page. PR: usb/177896 Submitted by: Leif Velcro Modified: head/share/man/man4/usb_quirk.4 Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Sun Apr 21 16:02:50 2013 (r249725) +++ head/share/man/man4/usb_quirk.4 Sun Apr 21 16:09:35 2013 (r249726) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd April 21, 2013 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -27,7 +27,7 @@ To compile this module into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device usb_quirk" +.Cd "device usb" .Ed .Pp Alternatively, to load the module at boot From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:08:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F08A3844; Sun, 21 Apr 2013 17:08:47 +0000 (UTC) (envelope-from gshapiro@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 E14A41A5C; Sun, 21 Apr 2013 17:08: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 r3LH8lME072823; Sun, 21 Apr 2013 17:08:47 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LH8iBd072800; Sun, 21 Apr 2013 17:08:44 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201304211708.r3LH8iBd072800@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sun, 21 Apr 2013 17:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249729 - in head/contrib/sendmail: . cf/cf cf/m4 contrib doc/op include/sm libmilter libsm mailstats makemap praliases rmail src test vacation X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:08:48 -0000 Author: gshapiro Date: Sun Apr 21 17:08:44 2013 New Revision: 249729 URL: http://svnweb.freebsd.org/changeset/base/249729 Log: Merge sendmail 8.14.7 to HEAD MFC after: 4 days Added: head/contrib/sendmail/libsm/t-fget.c - copied unchanged from r249728, vendor/sendmail/dist/libsm/t-fget.c Modified: head/contrib/sendmail/CACerts head/contrib/sendmail/PGPKEYS head/contrib/sendmail/RELEASE_NOTES head/contrib/sendmail/cf/cf/submit.cf head/contrib/sendmail/cf/m4/version.m4 head/contrib/sendmail/contrib/etrn.pl head/contrib/sendmail/doc/op/op.me head/contrib/sendmail/include/sm/config.h head/contrib/sendmail/include/sm/io.h head/contrib/sendmail/libmilter/Makefile.m4 head/contrib/sendmail/libmilter/sm_gethost.c head/contrib/sendmail/libsm/Makefile.m4 head/contrib/sendmail/libsm/cf.c head/contrib/sendmail/libsm/fget.c head/contrib/sendmail/mailstats/mailstats.c head/contrib/sendmail/makemap/makemap.c head/contrib/sendmail/praliases/praliases.c head/contrib/sendmail/rmail/rmail.c head/contrib/sendmail/src/Makefile.m4 head/contrib/sendmail/src/alias.c head/contrib/sendmail/src/collect.c head/contrib/sendmail/src/conf.c head/contrib/sendmail/src/control.c head/contrib/sendmail/src/deliver.c head/contrib/sendmail/src/main.c head/contrib/sendmail/src/map.c head/contrib/sendmail/src/mci.c head/contrib/sendmail/src/milter.c head/contrib/sendmail/src/mime.c head/contrib/sendmail/src/parseaddr.c head/contrib/sendmail/src/queue.c head/contrib/sendmail/src/readcf.c head/contrib/sendmail/src/recipient.c head/contrib/sendmail/src/savemail.c head/contrib/sendmail/src/sendmail.h head/contrib/sendmail/src/sfsasl.c head/contrib/sendmail/src/srvrsmtp.c head/contrib/sendmail/src/tls.c head/contrib/sendmail/src/usersmtp.c head/contrib/sendmail/src/util.c head/contrib/sendmail/src/version.c head/contrib/sendmail/test/Makefile.m4 head/contrib/sendmail/vacation/vacation.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/CACerts ============================================================================== --- head/contrib/sendmail/CACerts Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/CACerts Sun Apr 21 17:08:44 2013 (r249729) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $ +# $Id: CACerts,v 8.6 2013/01/18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -10,93 +10,93 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - c2:3c:61:67:3b:0a:cc:5e - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org + f1:41:b3:3d:ba:bd:33:49 + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org Validity - Not Before: May 14 04:42:18 2009 GMT - Not After : May 13 04:42:18 2012 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org + Not Before: Mar 10 02:47:46 2012 GMT + Not After : Mar 10 02:47:46 2015 GMT + Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d5:f8:d3:48:38:75:df:2e:6b:8b:c4:8d:1d:41: - 5e:ad:4b:96:3d:48:c2:dc:e5:ff:61:98:95:32:03: - e9:b6:71:5a:68:31:bc:e1:5c:aa:0e:70:a7:bc:51: - b7:13:6a:78:54:ae:a6:d0:44:49:1b:5e:37:5b:59: - 20:01:47:a7:ec:41:4c:11:79:8c:25:c1:1b:c0:ed: - 85:b2:de:0f:10:9f:e7:b2:a3:c4:f1:fc:85:51:aa: - d6:68:49:51:3e:04:e1:eb:e9:cd:87:1b:d0:9d:97: - 7b:4c:e1:1e:b1:6a:be:01:0a:a9:97:9a:50:89:e3: - 66:06:4c:07:cb:7e:99:70:13:e8:b4:9c:e7:e6:52: - 38:c0:64:90:42:d0:f5:cf:22:46:22:60:e9:34:70: - 1d:e3:d1:13:33:3a:31:ba:13:06:a8:c2:34:90:47: - c5:a1:bd:2d:7d:98:21:70:de:22:d0:13:11:e5:08: - dd:a0:77:0b:df:34:a7:07:55:de:5a:71:f6:6c:9e: - ec:f7:45:75:1f:22:a9:84:06:c6:4f:84:3d:4e:05: - d7:e4:e5:98:41:61:7b:8e:c9:3b:a6:ed:31:80:7d: - fd:fa:f0:dc:b7:07:82:b8:ec:27:20:39:5f:78:95: - f1:0d:93:8d:f9:4d:21:08:fd:72:89:01:ff:2c:a0: - 71:9d + Public-Key: (2048 bit) + Modulus: + 00:a2:80:fc:c6:ce:7f:60:38:65:f4:38:f9:7a:d9: + 87:fd:47:eb:3f:2c:4a:c9:38:77:6a:77:94:92:7f: + 83:3d:99:57:2c:5f:37:bb:ba:12:10:17:56:fa:eb: + 43:a6:4b:4c:1e:30:32:07:94:2f:5a:d8:65:49:29: + fa:24:d1:f0:0b:45:2d:e5:d5:cb:7d:60:dc:a6:ce: + a4:47:35:30:ee:5e:8d:c2:30:e7:a7:63:32:b0:59: + 80:cc:8c:99:64:77:8f:50:8e:88:51:47:36:ea:9a: + f3:b4:c0:8c:a6:ab:c6:42:57:88:b9:5f:9f:61:15: + bb:79:65:93:ca:a9:fd:17:eb:87:26:8b:eb:b7:2b: + 7e:33:05:2b:ba:c0:46:f7:08:fd:da:c1:50:9b:3d: + 26:83:5c:53:97:89:2c:cc:5f:f2:7b:a8:b7:3d:fb: + f2:b4:89:0d:43:ef:18:5c:21:75:71:cc:f0:c2:a3: + 84:69:c0:a7:f3:9b:de:c1:c7:5a:5c:7e:68:da:49: + 71:af:58:a8:51:9f:bd:f9:3d:bb:a5:92:fa:7b:1d: + 52:f5:fe:90:59:95:27:65:a4:af:97:9a:4f:01:39: + 59:7d:08:6f:a1:8f:42:47:49:bf:12:52:53:39:74: + 8d:62:3b:bd:4c:4f:05:0f:c4:b9:3e:da:a8:0e:96: + 05:2d Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - A7:61:FA:31:AF:A8:E2:5E:93:B6:84:9E:74:08:A2:76:50:87:69:7C + 08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB X509v3 Authority Key Identifier: - keyid:A7:61:FA:31:AF:A8:E2:5E:93:B6:84:9E:74:08:A2:76:50:87:69:7C - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org - serial:C2:3C:61:67:3B:0A:CC:5E + keyid:08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB + DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org + serial:F1:41:B3:3D:BA:BD:33:49 X509v3 Basic Constraints: - CA:TRUE + CA:TRUE X509v3 Subject Alternative Name: - email:ca+ca-rsa2009@esmtp.org + email:ca+ca-rsa2012@esmtp.org X509v3 Issuer Alternative Name: - email:ca+ca-rsa2009@esmtp.org - Signature Algorithm: md5WithRSAEncryption - b3:38:e0:da:a8:07:d8:cc:b8:4d:8c:20:a6:06:2c:f8:27:db: - 8e:28:0f:39:bd:d9:24:c7:9f:e0:4d:d6:b6:63:42:36:0f:d8: - 70:41:e7:9e:a2:24:64:05:ea:85:97:ac:f2:cc:c2:a6:71:bb: - 30:21:c1:c7:c4:54:34:1d:30:09:f0:9b:74:27:93:59:12:4c: - 53:0b:8c:3e:d0:39:ed:4a:d0:d9:66:24:d8:e7:e5:9c:a8:6d: - 5f:56:5d:9a:91:fe:1b:7d:b9:7c:79:9e:1c:b9:71:74:14:f8: - 0c:30:50:f9:b1:22:56:a8:4d:6f:4b:9b:e5:8a:81:33:1b:77: - 75:f6:d8:ce:d4:90:34:86:34:d1:86:75:a9:e1:23:e6:af:c1: - 8e:28:97:47:20:4d:1b:57:09:39:f4:56:01:d2:87:43:3e:29: - f6:c4:5b:7d:8f:9e:bd:ad:36:79:cf:09:70:43:30:21:98:23: - 31:c8:0d:39:ee:77:e1:4a:44:1a:5c:79:2f:6c:ec:8a:3c:db: - 99:a0:11:bc:1a:46:24:51:e7:75:d6:9a:db:ad:dd:55:d4:dd: - ca:81:a0:10:77:96:91:9c:76:30:38:18:f0:82:43:b3:7c:41: - 64:4c:4e:da:66:22:67:cf:b7:d7:10:ba:ed:f4:6d:43:59:00: - d0:82:1e:07 + email:ca+ca-rsa2012@esmtp.org + Signature Algorithm: sha1WithRSAEncryption + 9a:8f:4d:23:5b:30:80:e1:94:e4:66:9c:3a:17:8b:79:49:5b: + ec:5d:e5:a1:22:2d:71:37:a1:51:e7:1d:b1:0d:a9:9b:aa:a9: + 0d:c7:cd:d6:24:f9:e0:f0:57:be:4f:74:0c:4b:7a:42:4c:70: + 19:2e:8e:eb:cb:1b:00:26:27:eb:1c:42:33:d5:ec:32:b4:6c: + 7d:a3:04:a1:5c:00:49:c9:0d:4c:4d:28:37:06:22:77:ec:40: + 15:25:3a:23:84:ae:1f:da:90:dd:c9:dc:27:ee:7c:ec:e5:df: + b8:ba:1e:3f:ee:c2:91:a2:3f:22:92:1e:f3:06:7e:aa:e9:c3: + 11:2d:3d:2f:85:f7:fc:d7:e2:f8:6d:70:a6:40:62:69:e7:52: + ed:1b:19:38:72:86:08:a1:3d:47:c8:68:82:41:db:db:2a:52: + 25:d7:49:aa:9e:c5:83:22:7d:2f:0b:df:8c:90:2d:b5:aa:33: + c7:9b:e8:39:8f:bb:79:5b:13:2d:4e:a9:69:59:c7:09:26:e2: + b5:53:80:86:72:bb:7c:be:e9:46:5b:d8:b2:78:42:d6:5d:c3: + bb:3a:3b:5f:0f:e8:c3:60:fb:88:9f:3a:2b:9f:d3:7d:9f:c7: + 32:aa:4d:34:a7:66:a1:25:16:95:a6:69:e7:86:a3:5c:b9:b9: + df:58:05:e3 -----BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAMI8YWc7CsxeMA0GCSqGSIb3DQEBBAUAMIGlMQswCQYD +MIIFJzCCBA+gAwIBAgIJAPFBsz26vTNJMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMDkxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMDlAZXNtdHAub3JnMB4XDTA5MDUxNDA0NDIxOFoXDTEyMDUxMzA0NDIxOFow +YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTIxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz +YTIwMTJAZXNtdHAub3JnMB4XDTEyMDMxMDAyNDc0NloXDTE1MDMxMDAyNDc0Nlow gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG -A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwOTEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAwOUBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDV+NNIOHXfLmuLxI0dQV6tS5Y9SMLc5f9hmJUyA+m2cVpoMbzhXKoO -cKe8UbcTanhUrqbQREkbXjdbWSABR6fsQUwReYwlwRvA7YWy3g8Qn+eyo8Tx/IVR -qtZoSVE+BOHr6c2HG9Cdl3tM4R6xar4BCqmXmlCJ42YGTAfLfplwE+i0nOfmUjjA -ZJBC0PXPIkYiYOk0cB3j0RMzOjG6EwaowjSQR8WhvS19mCFw3iLQExHlCN2gdwvf -NKcHVd5acfZsnuz3RXUfIqmEBsZPhD1OBdfk5ZhBYXuOyTum7TGAff368Ny3B4K4 -7CcgOV94lfENk435TSEI/XKJAf8soHGdAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -p2H6Ma+o4l6TtoSedAiidlCHaXwwgdoGA1UdIwSB0jCBz4AUp2H6Ma+o4l6TtoSe -dAiidlCHaXyhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y +A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEmMCQGCSqGSIb3DQEJARYX +Y2ErY2EtcnNhMjAxMkBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCigPzGzn9gOGX0OPl62Yf9R+s/LErJOHdqd5SSf4M9mVcsXze7uhIQ +F1b660OmS0weMDIHlC9a2GVJKfok0fALRS3l1ct9YNymzqRHNTDuXo3CMOenYzKw +WYDMjJlkd49QjohRRzbqmvO0wIymq8ZCV4i5X59hFbt5ZZPKqf0X64cmi+u3K34z +BSu6wEb3CP3awVCbPSaDXFOXiSzMX/J7qLc9+/K0iQ1D7xhcIXVxzPDCo4RpwKfz +m97Bx1pcfmjaSXGvWKhRn735Pbulkvp7HVL1/pBZlSdlpK+Xmk8BOVl9CG+hj0JH +Sb8SUlM5dI1iO71MTwUPxLk+2qgOlgUtAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU +CDjjiJJTbvFWaSdEtUygGMoGl+swgdoGA1UdIwSB0jCBz4AUCDjjiJJTbvFWaSdE +tUygGMoGl+uhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK -BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwOTEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAwOUBlc210cC5vcmeCCQDCPGFnOwrM -XjAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMDlAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMDlAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBAUAA4IBAQCzOODaqAfYzLhNjCCmBiz4J9uOKA85vdkkx5/gTda2Y0I2D9hw -QeeeoiRkBeqFl6zyzMKmcbswIcHHxFQ0HTAJ8Jt0J5NZEkxTC4w+0DntStDZZiTY -5+WcqG1fVl2akf4bfbl8eZ4cuXF0FPgMMFD5sSJWqE1vS5vlioEzG3d19tjO1JA0 -hjTRhnWp4SPmr8GOKJdHIE0bVwk59FYB0odDPin2xFt9j569rTZ5zwlwQzAhmCMx -yA057nfhSkQaXHkvbOyKPNuZoBG8GkYkUed11prbrd1V1N3KgaAQd5aRnHYwOBjw -gkOzfEFkTE7aZiJnz7fXELrt9G1DWQDQgh4H +BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEm +MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxMkBlc210cC5vcmeCCQDxQbM9ur0z +STAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAu +b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAub3JnMA0GCSqGSIb3 +DQEBBQUAA4IBAQCaj00jWzCA4ZTkZpw6F4t5SVvsXeWhIi1xN6FR5x2xDambqqkN +x83WJPng8Fe+T3QMS3pCTHAZLo7ryxsAJifrHEIz1ewytGx9owShXABJyQ1MTSg3 +BiJ37EAVJTojhK4f2pDdydwn7nzs5d+4uh4/7sKRoj8ikh7zBn6q6cMRLT0vhff8 +1+L4bXCmQGJp51LtGxk4coYIoT1HyGiCQdvbKlIl10mqnsWDIn0vC9+MkC21qjPH +m+g5j7t5WxMtTqlpWccJJuK1U4CGcrt8vulGW9iyeELWXcO7OjtfD+jDYPuInzor +n9N9n8cyqk00p2ahJRaVpmnnhqNcubnfWAXj -----END CERTIFICATE----- Modified: head/contrib/sendmail/PGPKEYS ============================================================================== --- head/contrib/sendmail/PGPKEYS Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/PGPKEYS Sun Apr 21 17:08:44 2013 (r249729) @@ -142,6 +142,143 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 2048 5207CAD3 2013-01-02 ------- RSA Sign & Encrypt +fingerprint: B87D 4569 86F1 9484 07E5 CCB4 3D68 B25D 5207 CAD3 +uid Sendmail Signing Key/2013 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.13 (Darwin) + +mQENBFDkiE4BCAC7jVxyAGrnqq7bW4lAe83CxIUT4YHb+Ai49cecSCeOGqPSdlcg +NYdNzi7KKpF9r4ShSctw2mHqWkwE7AimgJL3w5Iw026YtFrGfB5KHnBIC3dWKiJu +ZM20qKx0Y5KqLjZStlajHL/gfhzhHEZXMcgFbYMGQ57Yuug8eEdmBb9ihgQgosdT +RmdNH5zqch4G3Yf246JqeyESBCi8NHbOHzdfEWze3H2mGRmGeKfcnKRPlZV9OEdG +E6ZEN6FBMghthZRa0f0AWw34YGxtvIAXOm/as64qpzJ2ebbH4HWvNRAaWetARG/I +4OwCkvcpqFROXXFOALlFJiAiXkK1RRPcPWyJABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTMgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAlDk +iE4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA9aLJdUgfK02WeB/9r +tNy5h/ouE9ixuzIDd7q5/n5ApIu0dnjLrieoOIgKPKLUwQMO18cjueKtRcAk1NP/ +BTYodw1rPOuZrtlgIltoAz4EN14SDGqiVVhgNkJVazOQ/4V0/zVAg+AZAngC3IFY +MXI99/HOnhTTZ+lHwDbvZdNu/yY0LDOl0VO41atRD9A/ujbRbjQL+QCkabi+M0Vr +Boz/4JKxbidsG41JFGQMTJxXuglZOWagB/T30/pYR5kxlTT5w7Y++JTGpOsvfAoP +B5wp1rTtsA5d7+oxmmwHBBIlDFidWTt2y8Hk1E+Fx+zHLvqdG6qZuxgtdA1g+DSx +MBbgmUztfAJsRKAJw91RiQEcBBABAgAGBQJQ5Ij4AAoJEI5a6fvO7vQ7IVwH/2U+ +K1L0/wP+Qgbb6Ge+Q6Px0x5YltJE56AoDgjAQof0jVgXXXJXb7uy+KIZnvBRdDeU +4z25qLFCAAoI1Coeu+DStv3q1MauQ6i05EG4qnK0h/VHRKsaGpgBpU6Q0HUzCeUj ++jedYsBxUjKlIQgbNbKh8rc/q38q8zGP5gswH+gbiO4gfLE5vUD+c/j3Bk7vTwjH +wcS82QznXDxFu92M9pe9cjz4OlMhT3KqA9ek/3X0FgkxX8LdIajWXUXrVbxeYEbv +0mrctI0SDMpy7TU8m1fc+87tbUsAC6lZx39dB+6CgYWcegLZGkwBYNhI5FtGSfml +Z7QloikEjxhADUqtHL+JARwEEAECAAYFAlDkiRMACgkQOaTHfal4hLBIyQf+JsMO +NKuvzLXB9jVrvVZE9Eyngomj4j4wVEK2ugFcf4lryi800rUaqO8R7mgR4iIqK9NU +EEwazvyBU+57Qcn5CfxrRTrVWz3GUET3qjsUPOihmSnIg7V9nremQzQG7wWcraJe +Abm1mG0cwXA1Gasak5Z4wD4Q5FmoKTWBYvP8l8lnHmnG12cbDiKCwn1qW6parkW/ +HlAaItO5N7Or58gpKSDrbaLBV0l2jxlOk9eeWkeYdnrF5PAmOf2/32AGRrGC+YI9 +vgqK34Hslxf00v5yjw7wYiYNu4Yq9eCKCXw7cIWzHRAoE951tpQ0AciNS15TWNc4 +MMiK4mUMY/9+YKwllokBHAQQAQIABgUCUOSJGAAKCRBgTfvyhUEKvuC0B/4iqq2K +hZiA5RWoxfXrwJwfaOtAHNgUpuDC51JX48vZB0Ie5lgARjqyCLbVPTIj/A+oRpll +z0FHQuCpYDTzSJs2X3Ol04COrsuWNRanNm2/Jh10m9vubyX1Ge0pGvhm3yFClFKS +O/LoioYWZ370PdQrVkccp5cfEHjiiCqVh3PLzbhPDj9Js9HKRNi0aQ34uJlZc+VK +1lAihymzO23fklJg3heL5HXH+btuJxkyi8aQ1p4meHVFYFqcjO/S7PyNJeMd0gwu +6ykWuL0N7Hq2WDfSYorDKf6fZMm/jQwkAJo26/Nmq0SSkMkviy0aowgjsR0zTudO +Tnpun4pNcYKSkbK9iJwEEAECAAYFAlDkiRsACgkQEolum6d/JCmgvQP7BjbE1xC9 +EFequc5ixwcrKbyvel8JZR4QaMfjZ/YltFJEAtNpiUmyI1s5CVqPnPoMqGJSxbkH +eTiIinsj/lxgImE8sDAdzxfIQc9sUFwm/SZmYnLPBxd0FtziaNPxVY1zHbpBiC4R +vYTBGrYwKDxkMIkI26mQ3C+6jpQHZjCq+ZiInAQQAQIABgUCUOSJHwAKCRDYqvDK +9rMHKT9CBACU3RGc9MLTbgXuA4F/jjbQ98I4Ei61y5i0jAt4Wk9qi3WLCpIEorVA +9LzyqClIioS4HoLLIH944Dr6Q7nC+SwifBGgxWVogEPl8vcMUfmUIkUa/KD9N9Wn +t8nSyaYNYYDefjzBy4veyrZF/zTl9RUjD3Y5h6VRSpVqox3pb3g0QoicBBABAgAG +BQJQ5IkjAAoJEJdDARhwk7hB9oUD/19C8pRVgzlM4aCjbh1DhmF23C6eegE7Z82f +9ZByKKKZscahOXp0vdWHuKvQ/j09rfROcb08k+6EofVg/lyT5yj3+SFy7Md+6RKB +oJVfX4Q3d1kWjawwYoTinMAbiANgEbiERZt9OUvxFq1zB3XjfD/DtsTDXO0Jb9nL +an8Eu9KPiJwEEAECAAYFAlDkiSYACgkQHnuzyK+VliVdngP+IhF8I7YICl7LYK8t +eYHHSQuR0HGRJAY2Sm6AgDvS8d2d6BWHovzhcXWmZt5t4qtO9JoO3arEJPFLi+sM +4zltrZ0G2w2iLuK8puGh4PM2V2PjRVWlhmwVdY4yERdqCwD9+TpgPudxDaOpCpD5 +pry2zkHzgtRVnKaB5wUxQSX/9+2InAQQAQIABgUCUOSJKQAKCRBwoCRNHvmSUT5j +A/0RNa+Q73G4STet1vUxJWyufNOOag82ziISGFX5qZ5HnvVheJuUYlplfx3pLGZs +VyxNPJ86vgdobNXG2dJYn/y/3C/9jIp0NiKJYEMVNlOrDvqoh3/7LdDCQC4dPKj/ +T4nSKgK/ny3Bvz8RHf874fnZZt6xjo+DFTzvktChYBSBh4icBBABAgAGBQJQ5Iks +AAoJEMjV7SmV9hdxzAYEAJ6iOI1YzJlNzZptUsCcBR+40sAL43UaaDXCjhEtRgpy ++EQSpGVEzCvN5sxF4z8QXo82x9zQJWZmYV974KXqIq8jFEuSLZAuVuPs2RlfRyAl +P5lATnXdGzrTXgoNLoXEt/vQqYuqFwqXkVvZcLkGHPwTOysyFH/vy8xLXmRI58RZ +iJwEEAECAAYFAlDkiaAACgkQIYPhsTlvB4lMRgP/b5lffwl6KwYI2d/ZoQVaMN+r +aun6ziVCLqMQRiUR03H06fFo31RmGdPRuQ97jxS8EZPNabygjAfKq3F74DPoSlvL +/8AXhj3UXoERf2XIj03o8we5SG0Tg6zLSNB65NoGR1whRgxwAxCgIRaRfudREYQR +6Vd7WpTHeRWttXLyiIiImwQQAQIABgUCUOSJvAAKCRCJaWK4Z4wKA+BYA/jBXOD2 +4pBFFELiCyFW+iTlzsJt5vwyTLolm8Ez77DkepkYOr6ZGiDb1cp3AL1e2ynwbSxq +NeAvwVfIm5TOO8w+xEYplciupd12QfXVa9MiQwDJm4FOP+Nb6X9MSqlHL8E8XoJv +NPjJoY3zFEYn2OGZrD8UpVdU5Y+pKZtCYxc0iJwEEAECAAYFAlDkicMACgkQOCLb +R8w3Ty3mvQP/e97V+BsqxV9HeqJHnmi4NJYaKpP2HBuXntLSDxyqO8YGa3qKkYjj +/LAXp2QfBpwCWn8D0pQSoUF5jayoeNviKs1cfcuq4dyfdoiVBcWOgJQeUHSO8w/r +hevqzclCuWz1TqW7HKlljUbpvP9LDR9De9T6izc3eR9WuLcqBwV73ZyInAQQAQIA +BgUCUOSJxwAKCRCcHL3i41xWNXa+A/9GD14quBksQf6iWg2CbHufCyUqquvN4IbI +YlskEHvjTtaZ20SC0cGMMPe/X2VbfWOR4UjEdlSGQdLWZ8FjKj0hjSSUf28OcbSd +xXryuFFt0skY2dBW1LHgVDUnHTlK1m9p9k887tL31YUGmA7apZVSILhSnd1jI+G7 +NN3ni31Wo4icBBABAgAGBQJQ5InKAAoJEG9Sk9ijm6ZVMLQD/3BWsllRiwFCsiiL +KBJqnjRCdFTuHOl75g86IniLMXu11r+K4LR9mXbi2bduAzkwP7c9HSAFWli3bhfV +fgf68sogGcHAtQgjgjTg3NvjOPkeMT24PVJzgIUkbgFBmOoe30L7/YyKl7B53FrX +dIcuI0d47bXoUOvjzNueBKzLkA3WiJwEEAECAAYFAlDkic0ACgkQ71iWZNQy4Z18 +0AP/cNp30lU/1dMF4bXbmbYG/dwxzFa8K1RsxJJD/HGFTsPs30o5tp7IpHAA3wiP +QI13HhDA9hfRsuWHyNztL6uHDD4HRiab1j1hNgorzXMYp+EmFSX+LYfd/GPBHX6B +xzGy6HuhurF1cPcvEbdlmcdr50YLaO4WJbHfU+p/9eEMZKOInAQQAQIABgUCUOSJ +0AAKCRDBnB0lEtNGHeMQBACWhsL8KCmh+2XwIweQOboaGA6ShwDHx8CfPxcqv9ZJ +4jsRoHSjiSRK+Gbqh0/5aOppeO6Pg8CppuDJ7jN/l212ZfhR0JUWfC3ySb71BIr/ +NpKw3PqbdPK6ugcfVHd2JkHSqZvDXUgMHftzVZEeD+OSfCMo/ED0QcC+3M3eO4fX +a4icBBABAgAGBQJQ5InUAAoJEMApykAW9MzpXkwD/AgrFlIVjYGNSelqRgl+eaxK +ujeRUwcZOjKvleOa4U5QekaI1pTsbk7whbzABa4i+TS3AWwlhVOuKanJJqWmVLrW +dJY6PgVGhUGdSk+FwXji8MA2aqdfcTCT3L2V6QyqXMEP8K3KAOKdBDIFAd31pap4 +ICuaj09nuybr2UNyOh9KiEYEEBECAAYFAlDki9QACgkQGPUDgCTCeAJMiACfbkQT +VU4gsRwDHBMRB1de9s7cS94An2ObpRui9RhHBRE+FONdzwV7LT+oiJwEEAECAAYF +AlDki+MACgkQfEtnbaAOFWM1RQQAwzWY32cZMx6MYBB40elalCqcwS0sGPG+BLOd ++7qmRPFUk7r/IC56mPgvRMAB3Hk4EF2m8YDfYIT/3u0r9M85tvKfzaB9svbn9xIg +s43a5m6EZRs8O/oeEpGJA5B+ypSMMXj67HrS6UzShGiNVJHD1FQABEYLEIPXOpML +99ko0KKInAQQAQIABgUCUOSL6QAKCRDW4KH+T74q3eJ/A/kBmDLoDkOJqZaIUCgm +DEebLXmh72vglflntChfOZFoJgIRJt+1gH8GTfWL4fecpxv7l3VD32eo14mUIvIl +9EIGinr0iE5jz2sJNLEk+9TQL4oWA2khr1AOsw0+Pq6ju8BYKG9ImM/pUpCX0g+s +YUwkB0pwWpldcrEiWgVg8NfuQ4hGBBARAgAGBQJQ5IvuAAoJECH5xbz3apv1JV0A +nR1zsfcDOhe0eA6LzDCUvkj+GTZmAJ9OdU37HRmxpokcL1YT2vU8fYItmYicBBAB +AgAGBQJQ5Zm8AAoJEM8etQMiMnoB1VUD/2Ee+hUtbUiVsrCTtgyxMh3GYHxSRlsR +DmZ3Ic49V3fPmadCRDpw1I6iKLgeg3qCB/Fg+1pvZ4E09a2knr02wVybe1hvRVsN +6QZnDa5Sp7SYoMj+PGAj1Jv2JcTggBxBpFeHFOElZi0Sc0J8TjzsLWph/SYbiwSr +GGz3QCya5dP/iEYEEBECAAYFAlDl9uwACgkQCaeiStHlggfR0wCeORnxx6UraAW0 +VEphoedU+22CyVcAn1QWbw6Bgktk3+UIN4vzW6YQbGpHiJwEEAECAAYFAlDl+9EA +CgkQXx7Ib4gMnlUD3QP/fan4d5+L3LVrOkAtmQovwZqpB6+fOy671RO3SaE1+lr4 +/twHmKGC1h8jVZzkqRVRQ3tBPvG9lPlweUN9wA2+jpoe8LaqJ2hClDw1gP3EPz0U +lIfJAoeZQOpbTY4DWUFy/vxnHcpQh5H+aJDlhKzSB4E/C/le9ViOzzqPRh4K29yI +RgQQEQIABgUCUOcGZAAKCRDEsQeYhXlqI/CyAJ9WHdCZwVdeFcgjVqv42sy+7d14 +XgCfd2c4qU9ZacQmoZDSU7P5kIrf8xuJASIEEwECAAwFAlDnimMFgweGH4AACgkQ +dZbk85mBCRgEyAf+LgY3QOdXa/9YDdbZXvBQ4myyJH6LD8OnFglI/u1gz/yP5ngm +SeWsODQAm4UzYQxc4fDHDnmVjpTyqyoY70gO9zsMg3eociDtaEi4/J7ZQRlvI5cu +PFreqLe9CivEzSFsuBYsNRmkxsQHAUg59wqhaefjul94RtWLhUXu20Er3CfE4B7I +AXK4ncWgySyCtWxtK2SygOaxKY/enGqtVC2a/ZecB7o1KJ3ghx1w9CzXxRyEtmtT +qaQpoGs40sshQgY9EDUApFU/cXIZmMlmcFEtL8e9R9pptY7FdoeuINwB8nS7epxy +kavIjSW30ALAshGpXrTHWxnOipzey8pbtOrL4okCHAQQAQIABgUCUOlleQAKCRBQ +g+yIQOhvcYDlD/4v2PjuxnM53WVDOABTkxax2dPQ94ErEf01cAr4SZ4UE0j8pH03 +WKKCDGnE+xkX0N9NworDEpkyGAjbTxbpidOWC4r1P526Nhhr+B/4yiybyXg5oR5F +rAQaxdj5dvk3HUSfUoqAaag9P6w/wBEIQcRvZ5L+2eTBYwrsHaRfDoP6ce6fmJic +veYhYDQ3qxx6l3qeRwchTKLEdy0jLdbZl1AFNLRQGU4XOFM3UxKTk4XofEdEK8B0 +L83NjsE1S9IJleQiNM41fNte0SXTJ8J//SGRnKAyMtlclanX2KazTPKGu69pZQRY +om9xH7vJZIRv0pCjQbEc9Caw/mvSNlQWJ5589cLVfaWrQpSmzf6oAoVyzhC4tiWw +s2FmfzUYvvSKX1dpVMWIkYyCLyS7E+px6zFy1e77Pc+uhmAsNDgfTTfwJbBoLAFQ +42f/5mqKhQktiplM6ZzMNB49zwjsFK9Vt1OA9ggHtvo/LzAIoMnQUvijObnE3/+a +PUNKAaqggVJUQgK2htPjyAkUIq1HQ35WzvpaTUn7ADBezTo6Zhl9UbKW9+IuCmwN +w4ZFhhKC5VsWSVZGFVMwRNilSXpyPVYAWkkrEiNreLW7R/OwXUqA3fvK4lFRWpVV +AEcmL5Cygmrv+0SMUgJrymf/HSl6/JVNP0GMZ5l8WvKZ4usxsc0Yt+gjTrkBDQRQ +5IhOAQgAxmVBSjFMrpl+oMm7SG97BeBG/ApRkWyzHoYLXSWoq/lpYWZUyfRxPyvV +kMEnVSerTMfiq80yX/8niFm7SezXBzCFwxjt5d6v1BIs0p1qnEmN6ze9i1wz26fT +Eix+qtFewBbE31+bxCOxFQoIaCGWrR7gq7clNfkLKRjBbJcb/vkPc0S6l5+xaM/j +Zt19a4uBDzy6DfFOjJ/ZWzKCioqPeswJrElszGqB3Wvwip1iOA4Ec379s8mSCzqq +PoQ98jIhqW/vD6eHDdzkEdQJZKwzSVgClHcLehQMCtsGChf+cxCgFQSf+7ZOyu+Y +YbIK06IC/lJG7LGBWOd28+LqKAXamQARAQABiQEfBBgBAgAJBQJQ5IhOAhsMAAoJ +ED1osl1SB8rT698H/Ap1PMyHWdDZxIP7PkJKAGuXjSE3JAw+dNh3vaxF24NFBUvj +J6F5UwZiegCAIatKVF15SycuIDT6TG1NBQPD8Udp5w0lK+sZH0ViZGs5hNggBdiR +uv6yMpaPf6IbO6Of0OInrcni9UQVt1G6o7MseZBnxejuPX0E6CMbB578XfSrdliI +jwcHNo5TEc0IjPw4qpUYRd/cWlo8Cprqu7I6LTDUdXOl01peaGqkGhyUgoY83JyS +xIhNOUZG9qZ7p7MTpngmXX8brCg4ivylPLveAsbhgLLlRQO1ME/j4zyBvM5vWEPB +x4XQOkQ96TXgQoe/dvARKuUcAQl7RvZOIZcBTPs= +=kpXE +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use pub 2048 CEEEF43B 2011-12-14 ------- RSA Sign & Encrypt fingerprint: CA7A 8F39 A241 9FFF B0A9 AB27 8E5A E9FB CEEE F43B uid Sendmail Signing Key/2012 @@ -2298,4 +2435,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.40 $, Last updated $Date: 2012/01/09 04:44:59 $ +$Revision: 8.43 $, Last updated $Date: 2013/01/18 17:40:21 $ Modified: head/contrib/sendmail/RELEASE_NOTES ============================================================================== --- head/contrib/sendmail/RELEASE_NOTES Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/RELEASE_NOTES Sun Apr 21 17:08:44 2013 (r249729) @@ -1,11 +1,40 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.2011 2012/12/21 18:42:16 ca Exp $ + $Id: RELEASE_NOTES,v 8.2024 2013/04/19 15:01:58 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.7/8.14.7 2013/04/21 + Drop support for IPv4-mapped IPv6 addresses to prevent the MTA + from using a mapped address over a legitimate IPv6 address + and to enforce the proper semantics over the IPv6 + connection. Problem noted by Ulrich Sporlein. + Fix a regression introduced in 8.14.6: the wrong list of + macros was sent to a milter in the EHLO stage. + Problem found by Fabrice Bellet, reported via RedHat + (Jaroslav Skarvada). + Fix handling of ORCPT parameter for DSNs: xtext decoding + was not performed and a wrong syntax check was applied + to the "addr-type" field. Problem noted by Dan Lukes + of Obludarium. + Fix handling of NUL characters in the MIME conversion functions + so that message bodies containing them will be sent + on properly. Note: this usually also affects mails + that are not converted as those functions are used + for other purposes too. Problem noted by Elchonon + Edelson of Lockheed Martin. + Do not perform "duplicate" elimination of recipients if they + resolve to the error mailer using a temporary failure + (4xy) via ruleset 0. Problem noted by Akira Takahashi + of IIJ. + CONTRIB: Updated version of etrn.pl script from John Beck + of Oracle. + Portability: + Unlike gcc, clang doesn't apply full prototypes to K&R + definitions. + 8.14.6/8.14.6 2012/12/23 Fix a regression introduced in 8.14.5: if a server offers two AUTH lines, the MTA would not read them after Modified: head/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- head/contrib/sendmail/cf/cf/submit.cf Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/cf/cf/submit.cf Sun Apr 21 17:08:44 2013 (r249729) @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Fri Dec 21 10:45:15 PST 2012 -##### in /extra/home/ca/sm-8.14.6/OpenSource/sendmail-8.14.6/cf/cf +##### built by ca@wiz.smi.sendmail.com on Fri Apr 19 08:04:44 PDT 2013 +##### in /extra/home/ca/sm-8.14.7/OpenSource/sendmail-8.14.7/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.6/Submit +DZ8.14.7/Submit ############### Modified: head/contrib/sendmail/cf/m4/version.m4 ============================================================================== --- head/contrib/sendmail/cf/m4/version.m4 Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/cf/m4/version.m4 Sun Apr 21 17:08:44 2013 (r249729) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2012 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2013 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Id: version.m4,v 8.222 2012/12/19 05:11:43 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.230 2013/04/18 15:07:16 ca Exp $') # divert(0) # Configuration version number -DZ8.14.6`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.7`'ifdef(`confCF_VERSION', `/confCF_VERSION') Modified: head/contrib/sendmail/contrib/etrn.pl ============================================================================== --- head/contrib/sendmail/contrib/etrn.pl Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/contrib/etrn.pl Sun Apr 21 17:08:44 2013 (r249729) @@ -1,22 +1,40 @@ -#!/usr/local/bin/perl -w +#!/usr/perl5/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# # # Copyright (c) 1996-2000 by John T. Beck # All rights reserved. # -# Copyright (c) 2000 by Sun Microsystems, Inc. -# All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. # -#ident "@(#)etrn.pl 1.1 00/09/06 SMI" -require 5.005; # minimal Perl version required +require 5.8.4; # minimal Perl version required use strict; +use warnings; use English; -# hardcoded constants, should work fine for BSD-based systems use Socket; use Getopt::Std; -use vars qw($opt_v); -my $sockaddr = 'S n a4 x8'; +our ($opt_v, $opt_b); # system requirements: # must have 'hostname' program. @@ -26,11 +44,12 @@ select(STDERR); chop(my $name = `hostname || uname -n`); -(my $hostname, my $aliases, my $type, my $len, undef) = gethostbyname($name); +my ($hostname) = (gethostbyname($name))[0]; -my $usage = "Usage: $PROGRAM_NAME [-v] host [args]"; -getopts('v'); +my $usage = "Usage: $PROGRAM_NAME [-bv] host [args]"; +getopts('bv'); my $verbose = $opt_v; +my $boot_check = $opt_b; my $server = shift(@ARGV); my @hosts = @ARGV; die $usage unless $server; @@ -86,24 +105,60 @@ if (!@hosts) { die "open $cwfile: $ERRNO"; } } + # Do this automatically if no client hosts are specified. + $boot_check = "yes"; } -($name, $aliases, my $proto) = getprotobyname('tcp'); -($name, $aliases, $port) = getservbyname($port, 'tcp') +my ($proto) = (getprotobyname('tcp'))[2]; +($port) = (getservbyname($port, 'tcp'))[2] unless $port =~ /^\d+/; +if ($boot_check) { + # first connect to localhost to verify that we can accept connections + print "verifying that localhost is accepting SMTP connections\n" + if ($verbose); + my $localhost_ok = 0; + ($name, my $laddr) = (gethostbyname('localhost'))[0, 4]; + (!defined($name)) && die "gethostbyname failed, unknown host localhost"; + + # get a connection + my $sinl = sockaddr_in($port, $laddr); + my $save_errno = 0; + for (my $num_tries = 1; $num_tries < 5; $num_tries++) { + socket(S, &PF_INET, &SOCK_STREAM, $proto) + || die "socket: $ERRNO"; + if (connect(S, $sinl)) { + &alarm("sending 'quit' to $server"); + print S "quit\n"; + alarm(0); + $localhost_ok = 1; + close(S); + alarm(0); + last; + } + print STDERR "localhost connect failed ($num_tries)\n"; + $save_errno = $ERRNO; + sleep(1 << $num_tries); + close(S); + alarm(0); + } + if (! $localhost_ok) { + die "could not connect to localhost: $save_errno\n"; + } +} + # look it up -($name, $aliases, $type, $len, my $thataddr) = gethostbyname($server); +($name, my $thataddr) = (gethostbyname($server))[0, 4]; (!defined($name)) && die "gethostbyname failed, unknown host $server"; - + # get a connection -my $that = pack($sockaddr, &AF_INET, $port, $thataddr); -socket(S, &AF_INET, &SOCK_STREAM, $proto) +my $sinr = sockaddr_in($port, $thataddr); +socket(S, &PF_INET, &SOCK_STREAM, $proto) || die "socket: $ERRNO"; print "server = $server\n" if (defined($verbose)); &alarm("connect to $server"); -if (! connect(S, $that)) { +if (! connect(S, $sinr)) { die "cannot connect to $server: $ERRNO\n"; } alarm(0); Modified: head/contrib/sendmail/doc/op/op.me ============================================================================== --- head/contrib/sendmail/doc/op/op.me Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/doc/op/op.me Sun Apr 21 17:08:44 2013 (r249729) @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: op.me,v 8.749 2012/03/02 22:37:11 ca Exp $ +.\" $Id: op.me,v 8.751 2013/04/08 21:41:25 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 8.749 $ +.Ve $Revision: 8.751 $ .rm Ve .sp For Sendmail Version 8.14 @@ -5547,9 +5547,6 @@ It can have primary types or full types (such as .q text/plain ). -The class is initialized to have -.q text/plain -only. .ip $=s contains the set of subtypes of message that can be treated recursively. By default it contains only @@ -6609,8 +6606,13 @@ Modifier Options (flags) for the client .)b The .i Addr ess -mask may be a numeric address in dot notation +mask may be a numeric address in IPv4 dot notation or IPv6 colon notation or a network name. +Note that if a network name is specified, +only the first IP address returned for it will be used. +This may cause indeterminate behavior for network names +that resolve to multiple addresses. +Therefore, use of an address is recommended. .i Modifier can be the following character: .(b @@ -6778,8 +6780,13 @@ The key is used for error messages and logging. The .i Addr ess -mask may be a numeric address in dot notation +mask may be a numeric address in IPv4 dot notation or IPv6 colon notation or a network name. +Note that if a network name is specified, +only the first IP address returned for it will be used. +This may cause indeterminate behavior for network names +that resolve to multiple addresses. +Therefore, use of an address is recommended. The .i Family key defaults to INET (IPv4). @@ -11471,7 +11478,7 @@ replace it with a blank sheet for double .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 8.749 $ +.\"Version $Revision: 8.751 $ .\".ce 0 .bp 3 .ce Modified: head/contrib/sendmail/include/sm/config.h ============================================================================== --- head/contrib/sendmail/include/sm/config.h Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/include/sm/config.h Sun Apr 21 17:08:44 2013 (r249729) @@ -6,7 +6,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: config.h,v 1.47 2004/10/26 21:41:07 gshapiro Exp $ + * $Id: config.h,v 1.48 2013/03/22 22:48:57 gshapiro Exp $ */ /* @@ -24,14 +24,16 @@ /* ** SM_CONF_STDBOOL_H is 1 if exists +** +** Note, unlike gcc, clang doesn't apply full prototypes to K&R definitions. */ # ifndef SM_CONF_STDBOOL_H -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# if !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define SM_CONF_STDBOOL_H 1 -# else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ +# else /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # define SM_CONF_STDBOOL_H 0 -# endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ +# endif /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # endif /* ! SM_CONF_STDBOOL_H */ /* Modified: head/contrib/sendmail/include/sm/io.h ============================================================================== --- head/contrib/sendmail/include/sm/io.h Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/include/sm/io.h Sun Apr 21 17:08:44 2013 (r249729) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002, 2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2002, 2004, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990 * The Regents of the University of California. All rights reserved. @@ -11,7 +11,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: io.h,v 1.24 2004/03/03 19:14:49 ca Exp $ + * $Id: io.h,v 1.25 2013/03/12 15:24:49 ca Exp $ */ /*- @@ -269,7 +269,7 @@ int sm_io_close __P((SM_FILE_T *, int S SM_FILE_T *sm_io_dup __P((SM_FILE_T *)); int sm_io_eof __P((SM_FILE_T *)); int sm_io_error __P((SM_FILE_T *)); -char *sm_io_fgets __P((SM_FILE_T *, int, char *, int)); +int sm_io_fgets __P((SM_FILE_T *, int, char *, int)); int sm_io_flush __P((SM_FILE_T *, int SM_NONVOLATILE)); int PRINTFLIKE(3, 4) Modified: head/contrib/sendmail/libmilter/Makefile.m4 ============================================================================== --- head/contrib/sendmail/libmilter/Makefile.m4 Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/libmilter/Makefile.m4 Sun Apr 21 17:08:44 2013 (r249729) @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 8.88 2012/09/25 17:40:32 ca Exp $ +dnl $Id: Makefile.m4,v 8.92 2013/04/16 20:19:54 ca Exp $ include(confBUILDTOOLSDIR`/M4/switch.m4') dnl only required for compilation of EXTRAS Modified: head/contrib/sendmail/libmilter/sm_gethost.c ============================================================================== --- head/contrib/sendmail/libmilter/sm_gethost.c Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/libmilter/sm_gethost.c Sun Apr 21 17:08:44 2013 (r249729) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2001, 2004, 2010 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2001, 2004, 2010, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: sm_gethost.c,v 8.29 2010/07/27 01:09:31 ca Exp $") +SM_RCSID("@(#)$Id: sm_gethost.c,v 8.30 2013/02/22 22:43:33 gshapiro Exp $") #include #if NETINET || NETINET6 @@ -101,7 +101,12 @@ mi_gethostbyname(name, family) # endif /* SOLARIS == 20300 || SOLARIS == 203 */ #else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */ # if NETINET6 - int flags = AI_DEFAULT|AI_ALL; +# ifndef SM_IPNODEBYNAME_FLAGS + /* For IPv4-mapped addresses, use: AI_DEFAULT|AI_ALL */ +# define SM_IPNODEBYNAME_FLAGS AI_ADDRCONFIG +# endif /* SM_IPNODEBYNAME_FLAGS */ + + int flags = SM_IPNODEBYNAME_FLAGS; int err; # endif /* NETINET6 */ Modified: head/contrib/sendmail/libsm/Makefile.m4 ============================================================================== --- head/contrib/sendmail/libsm/Makefile.m4 Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/libsm/Makefile.m4 Sun Apr 21 17:08:44 2013 (r249729) @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 1.72 2006/08/16 21:06:31 ca Exp $ +dnl $Id: Makefile.m4,v 1.73 2013/03/12 15:24:50 ca Exp $ define(`confREQUIRE_LIBUNIX') include(confBUILDTOOLSDIR`/M4/switch.m4') @@ -18,6 +18,7 @@ smcheck(`t-exc', `compile-run') smcheck(`t-rpool', `compile-run') smcheck(`t-string', `compile-run') smcheck(`t-smstdio', `compile-run') +smcheck(`t-fget', `compile-run') smcheck(`t-match', `compile-run') smcheck(`t-strio', `compile-run') smcheck(`t-heap', `compile-run') Modified: head/contrib/sendmail/libsm/cf.c ============================================================================== --- head/contrib/sendmail/libsm/cf.c Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/libsm/cf.c Sun Apr 21 17:08:44 2013 (r249729) @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: cf.c,v 1.6 2001/09/11 04:04:47 gshapiro Exp $") +SM_RCSID("@(#)$Id: cf.c,v 1.7 2013/03/12 15:24:50 ca Exp $") #include #include @@ -54,7 +54,7 @@ sm_cf_getopt(path, optc, optv) if (cfp == NULL) return errno; - while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) + while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) >= 0) { p = strchr(buf, '\n'); if (p != NULL) Modified: head/contrib/sendmail/libsm/fget.c ============================================================================== --- head/contrib/sendmail/libsm/fget.c Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/libsm/fget.c Sun Apr 21 17:08:44 2013 (r249729) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include -SM_RCSID("@(#)$Id: fget.c,v 1.24 2001/09/11 04:04:48 gshapiro Exp $") +SM_RCSID("@(#)$Id: fget.c,v 1.25 2013/03/12 15:24:50 ca Exp $") #include #include #include @@ -33,31 +33,32 @@ SM_RCSID("@(#)$Id: fget.c,v 1.24 2001/09 ** n -- size of 'buf' ** ** Returns: -** success: returns value of 'buf' -** failure: NULL (no characters were read) -** timeout: NULL and errno set to EAGAIN +** success: number of characters +** failure: -1 +** timeout: -1 and errno set to EAGAIN ** ** Side Effects: ** may move the file pointer */ -char * +int sm_io_fgets(fp, timeout, buf, n) register SM_FILE_T *fp; int timeout; char *buf; register int n; { - register int len; - register char *s; - register unsigned char *p, *t; + int len, r; + char *s; + unsigned char *p, *t; SM_REQUIRE_ISA(fp, SmFileMagic); if (n <= 0) /* sanity check */ - return NULL; + return -1; s = buf; n--; /* leave space for NUL */ + r = 0; while (n > 0) { /* If the buffer is empty, refill it. */ @@ -73,7 +74,7 @@ sm_io_fgets(fp, timeout, buf, n) { /* EOF/error: stop with partial or no line */ if (s == buf) - return NULL; + return -1; break; } len = fp->f_r; @@ -93,18 +94,20 @@ sm_io_fgets(fp, timeout, buf, n) if (t != NULL) { len = ++t - p; + r += len; fp->f_r -= len; fp->f_p = t; (void) memcpy((void *) s, (void *) p, len); s[len] = 0; - return buf; + return r; } fp->f_r -= len; fp->f_p += len; (void) memcpy((void *) s, (void *) p, len); s += len; + r += len; n -= len; } *s = 0; - return buf; + return r; } Copied: head/contrib/sendmail/libsm/t-fget.c (from r249728, vendor/sendmail/dist/libsm/t-fget.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/sendmail/libsm/t-fget.c Sun Apr 21 17:08:44 2013 (r249729, copy of r249728, vendor/sendmail/dist/libsm/t-fget.c) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2013 Sendmail, Inc. and its suppliers. + * All rights reserved. + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the sendmail distribution. + */ + +#include +SM_IDSTR(id, "@(#)$Id: t-fget.c,v 1.1 2013/03/12 15:24:50 ca Exp $") + +#include +#include +#include +#include + +void +check(char *msg, int l) +{ + SM_FILE_T *wfp, *rfp; + char buf[256]; + size_t n; + int r, i; + static char fn[] = "tfget"; + + wfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, fn, + SM_IO_WRONLY_B, NULL); + SM_TEST(wfp != NULL); + for (i = 0; i < l; i++) + { + r = sm_io_putc(wfp, SM_TIME_DEFAULT, msg[i]); + SM_TEST(r >= 0); + } + r = sm_io_close(wfp, SM_TIME_DEFAULT); + SM_TEST(r == 0); + + rfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, fn, + SM_IO_RDONLY_B, NULL); + SM_TEST(rfp != NULL); + n = sizeof(buf); + r = sm_io_fgets(rfp, SM_TIME_DEFAULT, buf, n); + if (l == 0) + { + SM_TEST(r == -1); + SM_TEST(errno == 0); + } + else + { + SM_TEST(r == l); + if (r != l) + fprintf(stderr, "buf='%s', in='%s', r=%d, l=%d\n", + buf, msg, r, l); + } + SM_TEST(memcmp(buf, msg, l) == 0); + r = sm_io_close(rfp, SM_TIME_DEFAULT); + SM_TEST(r == 0); +} + + +int +main(argc, argv) + int argc; + char **argv; +{ + char res[256]; + int l; + + sm_test_begin(argc, argv, "test fget"); + + check("", strlen("")); + check("\n", strlen("\n")); + check("test\n", strlen("test\n")); + + l = snprintf(res, sizeof(res), "%c%s\n", '\0', "test ing"); + check(res, l); + + l = snprintf(res, sizeof(res), "%c%s%c\n", '\0', "test ing", '\0'); + check(res, l); + + l = snprintf(res, sizeof(res), "%c%s%c%s\n", + '\0', "test ing", '\0', "eol"); + check(res, l); + + return sm_test_end(); +} Modified: head/contrib/sendmail/mailstats/mailstats.c ============================================================================== --- head/contrib/sendmail/mailstats/mailstats.c Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/mailstats/mailstats.c Sun Apr 21 17:08:44 2013 (r249729) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.100 2002/06/27 23:24:06 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.102 2013/03/12 15:24:50 ca Exp $") #include #include @@ -68,13 +68,14 @@ main(argc, argv) extern char *ctime(); extern char *optarg; extern int optind; +# define MSOPTS "cC:f:opP" cfile = getcfname(0, 0, SM_GET_SENDMAIL_CF, NULL); sfile = NULL; mnames = true; progmode = false; trunc = false; - while ((ch = getopt(argc, argv, "cC:f:opP")) != -1) + while ((ch = getopt(argc, argv, MSOPTS)) != -1) { switch (ch) { @@ -90,6 +91,7 @@ main(argc, argv) sfile = optarg; break; + case 'o': mnames = false; break; @@ -102,6 +104,7 @@ main(argc, argv) progmode = true; break; + case '?': default: usage: @@ -131,7 +134,7 @@ main(argc, argv) (void) sm_strlcpy(mtable[mno++], "*file*", MNAMELEN + 1); (void) sm_strlcpy(mtable[mno++], "*include*", MNAMELEN + 1); - while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) + while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) >= 0) { register char *b; char *s; @@ -270,6 +273,7 @@ main(argc, argv) } } + if (progmode) { (void) time(&now); Modified: head/contrib/sendmail/makemap/makemap.c ============================================================================== --- head/contrib/sendmail/makemap/makemap.c Sun Apr 21 16:37:17 2013 (r249728) +++ head/contrib/sendmail/makemap/makemap.c Sun Apr 21 17:08:44 2013 (r249729) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:09:52 2013 Return-Path: Delivered-To: svn-src-head@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 2B93D9FD; Sun, 21 Apr 2013 17:09:52 +0000 (UTC) (envelope-from gshapiro@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 1DFBE1A73; Sun, 21 Apr 2013 17:09: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 r3LH9pN9073057; Sun, 21 Apr 2013 17:09:52 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LH9pLS073056; Sun, 21 Apr 2013 17:09:51 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201304211709.r3LH9pLS073056@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sun, 21 Apr 2013 17:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249730 - head/contrib/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:09:52 -0000 Author: gshapiro Date: Sun Apr 21 17:09:51 2013 New Revision: 249730 URL: http://svnweb.freebsd.org/changeset/base/249730 Log: Update for sendmail 8.14.7 MFC after: 4 days Modified: head/contrib/sendmail/FREEBSD-upgrade Modified: head/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- head/contrib/sendmail/FREEBSD-upgrade Sun Apr 21 17:08:44 2013 (r249729) +++ head/contrib/sendmail/FREEBSD-upgrade Sun Apr 21 17:09:51 2013 (r249730) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.6 +sendmail 8.14.7 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -97,4 +97,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -29-December-2012 +21-April-2013 From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:10:10 2013 Return-Path: Delivered-To: svn-src-head@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 C6D67B70; Sun, 21 Apr 2013 17:10:10 +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 B9D271A79; Sun, 21 Apr 2013 17:10: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 r3LHAAMw073356; Sun, 21 Apr 2013 17:10:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LHAAKT073355; Sun, 21 Apr 2013 17:10:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304211710.r3LHAAKT073355@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 21 Apr 2013 17:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249731 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:10:10 -0000 Author: trociny Date: Sun Apr 21 17:10:10 2013 New Revision: 249731 URL: http://svnweb.freebsd.org/changeset/base/249731 Log: Embed revision id in the library. MFC after: 29 days Modified: head/lib/libprocstat/core.c Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sun Apr 21 17:09:51 2013 (r249730) +++ head/lib/libprocstat/core.c Sun Apr 21 17:10:10 2013 (r249731) @@ -22,10 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:11:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29ADFCED; Sun, 21 Apr 2013 17:11:46 +0000 (UTC) (envelope-from gshapiro@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 1CA2D1A83; Sun, 21 Apr 2013 17:11: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 r3LHBjLN075128; Sun, 21 Apr 2013 17:11:45 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LHBjiW075126; Sun, 21 Apr 2013 17:11:45 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201304211711.r3LHBjiW075126@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sun, 21 Apr 2013 17:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249732 - head/etc/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:11:46 -0000 Author: gshapiro Date: Sun Apr 21 17:11:45 2013 New Revision: 249732 URL: http://svnweb.freebsd.org/changeset/base/249732 Log: Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.14.6/cf tree. MFC after: 4 days Modified: head/etc/sendmail/freebsd.mc head/etc/sendmail/freebsd.submit.mc Modified: head/etc/sendmail/freebsd.mc ============================================================================== --- head/etc/sendmail/freebsd.mc Sun Apr 21 17:10:10 2013 (r249731) +++ head/etc/sendmail/freebsd.mc Sun Apr 21 17:11:45 2013 (r249732) @@ -41,7 +41,7 @@ divert(-1) # The best documentation for this .mc file is: # /usr/share/sendmail/cf/README or # /usr/src/contrib/sendmail/cf/README -# +# divert(0) VERSIONID(`$FreeBSD$') Modified: head/etc/sendmail/freebsd.submit.mc ============================================================================== --- head/etc/sendmail/freebsd.submit.mc Sun Apr 21 17:10:10 2013 (r249731) +++ head/etc/sendmail/freebsd.submit.mc Sun Apr 21 17:11:45 2013 (r249732) @@ -9,7 +9,6 @@ divert(-1) # # - # # This is the FreeBSD configuration for a set-group-ID sm-msp sendmail # that acts as a initial mail submission program. From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:13:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1ADEEE6F; Sun, 21 Apr 2013 17:13:59 +0000 (UTC) (envelope-from gshapiro@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 0D7421A95; Sun, 21 Apr 2013 17:13: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 r3LHDwdM075527; Sun, 21 Apr 2013 17:13:58 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LHDwmd075526; Sun, 21 Apr 2013 17:13:58 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201304211713.r3LHDwmd075526@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sun, 21 Apr 2013 17:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249733 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:13:59 -0000 Author: gshapiro Date: Sun Apr 21 17:13:58 2013 New Revision: 249733 URL: http://svnweb.freebsd.org/changeset/base/249733 Log: Note merge to head for sendmail 8.14.7. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 21 17:11:45 2013 (r249732) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 21 17:13:58 2013 (r249733) @@ -488,7 +488,7 @@ Figwort release to the Hydrangea release. sendmail has been updated from - 8.14.1 to 8.14.5. + 8.14.1 to 8.14.7. The timezone database has been updated from the tzdata2008h release to From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 17:23:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B712279; Sun, 21 Apr 2013 17:23:28 +0000 (UTC) (envelope-from imp@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 1E7361AE7; Sun, 21 Apr 2013 17:23: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 r3LHNRQc078580; Sun, 21 Apr 2013 17:23:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LHNRhV078579; Sun, 21 Apr 2013 17:23:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304211723.r3LHNRhV078579@svn.freebsd.org> From: Warner Losh Date: Sun, 21 Apr 2013 17:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249735 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:23:28 -0000 Author: imp Date: Sun Apr 21 17:23:27 2013 New Revision: 249735 URL: http://svnweb.freebsd.org/changeset/base/249735 Log: Fix typos in my last commit. Submitted by: Niclas Zeising and Benjamin Kaduk Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Apr 21 17:14:50 2013 (r249734) +++ head/UPDATING Sun Apr 21 17:23:27 2013 (r249735) @@ -12,7 +12,7 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping -from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to tip of +from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. @@ -1612,7 +1612,7 @@ COMMON ITEMS: path, and has the highest probability of being successful. Please try this approach before reporting problems with a major version upgrade. - When upgrading a life system, having a root shell around before + When upgrading a live system, having a root shell around before installing anything can help undo problems. Not having a root shell around can lead to problems if pam has changed too much from your starting point to allow continued authentication after the upgrade. From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 19:42:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD33F244; Sun, 21 Apr 2013 19:42: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 BE9621090; Sun, 21 Apr 2013 19:42: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 r3LJg4jF023094; Sun, 21 Apr 2013 19:42:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LJg4Ok023093; Sun, 21 Apr 2013 19:42:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304211942.r3LJg4Ok023093@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Apr 2013 19:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249739 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 19:42:04 -0000 Author: jilles Date: Sun Apr 21 19:42:04 2013 New Revision: 249739 URL: http://svnweb.freebsd.org/changeset/base/249739 Log: dup(2): Remove incorrect sentence about getdtablesize(). There are no getdtablesize() bounds on the file descriptor to be duplicated; it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after opening the file descriptor, it may be greater than or equal to getdtablesize() but still valid. MFC after: 1 week Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Sun Apr 21 19:33:55 2013 (r249738) +++ head/lib/libc/sys/dup.2 Sun Apr 21 19:42:04 2013 (r249739) @@ -28,7 +28,7 @@ .\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 14, 2011 +.Dd April 21, 2013 .Dt DUP 2 .Os .Sh NAME @@ -56,9 +56,6 @@ The argument .Fa oldd is a small non-negative integer index in the per-process descriptor table. -The value must be less -than the size of the table, which is returned by -.Xr getdtablesize 2 . The new descriptor returned by the call is the lowest numbered descriptor currently not in use by the process. From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 19:55:38 2013 Return-Path: Delivered-To: svn-src-head@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 E3248641; Sun, 21 Apr 2013 19:55:38 +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 D58A910DC; Sun, 21 Apr 2013 19:55: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 r3LJtc6c026740; Sun, 21 Apr 2013 19:55:38 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LJtcqq026739; Sun, 21 Apr 2013 19:55:38 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304211955.r3LJtcqq026739@svn.freebsd.org> From: Joel Dahl Date: Sun, 21 Apr 2013 19:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249740 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 19:55:39 -0000 Author: joel (doc committer) Date: Sun Apr 21 19:55:38 2013 New Revision: 249740 URL: http://svnweb.freebsd.org/changeset/base/249740 Log: Document a few expansions for the $PS1 and $PS2 environmental variables. PR: 173410 Submitted by: Derek Wood Reviewed by: jilles Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Apr 21 19:42:04 2013 (r249739) +++ head/bin/sh/sh.1 Sun Apr 21 19:55:38 2013 (r249740) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd March 24, 2013 +.Dd April 21, 2013 .Dt SH 1 .Os .Sh NAME @@ -1340,9 +1340,33 @@ The primary prompt string, which default .Dq Li "$ " , unless you are the superuser, in which case it defaults to .Dq Li "# " . +.Va PS1 +may include any of the following formatting sequences, +which are replaced by the given information: +.Bl -tag -width indent +.It Li \eH +The local hostname. +.It Li \eh +The fully-qualified hostname. +.It Li \eW +The final component of the current working directory. +.It Li \ew +The entire path of the current working directory. +.It Li \e$ +Superuser status. +.Dq Li "$ " +for normal users and +.Dq Li "# " +for superusers. +.It Li \e\e +A literal backslash. +.El .It Va PS2 The secondary prompt string, which defaults to .Dq Li "> " . +.Va PS2 +may include any of the formatting sequences from +.Va PS1 . .It Va PS4 The prefix for the trace output (if .Fl x From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 20:51:54 2013 Return-Path: Delivered-To: svn-src-head@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 41E631FC; Sun, 21 Apr 2013 20:51:54 +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 328CC120B; Sun, 21 Apr 2013 20:51: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 r3LKpsAq045273; Sun, 21 Apr 2013 20:51:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LKpshn045272; Sun, 21 Apr 2013 20:51:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304212051.r3LKpshn045272@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 21 Apr 2013 20:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249741 - head/sbin/hastctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 20:51:54 -0000 Author: trociny Date: Sun Apr 21 20:51:53 2013 New Revision: 249741 URL: http://svnweb.freebsd.org/changeset/base/249741 Log: Remove code duplication. Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Sun Apr 21 19:55:38 2013 (r249740) +++ head/sbin/hastctl/hastctl.c Sun Apr 21 20:51:53 2013 (r249741) @@ -504,18 +504,8 @@ main(int argc, char *argv[]) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; case CMD_LIST: - /* Obtain verbose status of the given resources. */ - nv = nv_alloc(); - nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); - if (argc == 0) - nv_add_string(nv, "all", "resource%d", 0); - else { - for (ii = 0; ii < argc; ii++) - nv_add_string(nv, argv[ii], "resource%d", ii); - } - break; case CMD_STATUS: - /* Obtain brief status of the given resources. */ + /* Obtain status of the given resources. */ nv = nv_alloc(); nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); if (argc == 0) From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 21:28:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40B1C5DA; Sun, 21 Apr 2013 21:28:40 +0000 (UTC) (envelope-from oleg@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 1932312BD; Sun, 21 Apr 2013 21:28: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 r3LLSdUo055744; Sun, 21 Apr 2013 21:28:39 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LLSdXg055742; Sun, 21 Apr 2013 21:28:39 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201304212128.r3LLSdXg055742@svn.freebsd.org> From: Oleg Bulyzhin Date: Sun, 21 Apr 2013 21:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249742 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 21:28:40 -0000 Author: oleg Date: Sun Apr 21 21:28:38 2013 New Revision: 249742 URL: http://svnweb.freebsd.org/changeset/base/249742 Log: Plug static llentry leak (ipv4 & ipv6 were affected). PR: kern/172985 MFC after: 1 month Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Apr 21 20:51:53 2013 (r249741) +++ head/sys/netinet/in.c Sun Apr 21 21:28:38 2013 (r249742) @@ -1467,10 +1467,14 @@ in_lltable_lookup(struct lltable *llt, u LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); - LLE_WUNLOCK(lle); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif + if ((lle->la_flags & + (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); + else + LLE_WUNLOCK(lle); } lle = (void *)-1; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Apr 21 20:51:53 2013 (r249741) +++ head/sys/netinet6/in6.c Sun Apr 21 21:28:38 2013 (r249742) @@ -195,10 +195,10 @@ in6_ifremloop(struct ifaddr *ifa) ia = ifa2ia6(ifa); ifp = ifa->ifa_ifp; - IF_AFDATA_LOCK(ifp); - lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), - (struct sockaddr *)&ia->ia_addr); - IF_AFDATA_UNLOCK(ifp); + memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); + memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); + lltable_prefix_free(AF_INET6, (struct sockaddr *)&addr, + (struct sockaddr *)&mask, LLE_STATIC); /* * initialize for rtmsg generation @@ -210,8 +210,6 @@ in6_ifremloop(struct ifaddr *ifa) gateway.sdl_alen = ifp->if_addrlen; bzero(&rt0, sizeof(rt0)); rt0.rt_gateway = (struct sockaddr *)&gateway; - memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); rt_mask(&rt0) = (struct sockaddr *)&mask; rt_key(&rt0) = (struct sockaddr *)&addr; rt0.rt_flags = RTF_HOST | RTF_STATIC; @@ -2604,10 +2602,14 @@ in6_lltable_lookup(struct lltable *llt, if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; - LLE_WUNLOCK(lle); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif + if ((lle->la_flags & + (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); + else + LLE_WUNLOCK(lle); } lle = (void *)-1; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 21:36:02 2013 Return-Path: Delivered-To: svn-src-head@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 3378A8A4; Sun, 21 Apr 2013 21:36:02 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id B3F3512FD; Sun, 21 Apr 2013 21:36:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r3LLa0YY039237; Mon, 22 Apr 2013 01:36:00 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 22 Apr 2013 01:36:00 +0400 (MSK) From: Dmitry Morozovsky To: Mikolaj Golub Subject: Re: svn commit: r249741 - head/sbin/hastctl In-Reply-To: <201304212051.r3LKpshn045272@svn.freebsd.org> Message-ID: References: <201304212051.r3LKpshn045272@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Mon, 22 Apr 2013 01:36:00 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 21:36:02 -0000 On Sun, 21 Apr 2013, Mikolaj Golub wrote: > Author: trociny > Date: Sun Apr 21 20:51:53 2013 > New Revision: 249741 > URL: http://svnweb.freebsd.org/changeset/base/249741 > > Log: > Remove code duplication. ah yes thanks, I overlooked this when producing initial patch. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 22:36:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4402B1CF; Sun, 21 Apr 2013 22:36:15 +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 1C93614CD; Sun, 21 Apr 2013 22:36: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 r3LMaE5U078008; Sun, 21 Apr 2013 22:36:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LMaEMb078007; Sun, 21 Apr 2013 22:36:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304212236.r3LMaEMb078007@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Apr 2013 22:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249743 - head/sbin/newfs_nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 22:36:15 -0000 Author: ed Date: Sun Apr 21 22:36:14 2013 New Revision: 249743 URL: http://svnweb.freebsd.org/changeset/base/249743 Log: Unbreak the build of newfs_nandfs. Mark global variables static. While there, make some small style(9) cleanups and remove a variable that is unused. Modified: head/sbin/newfs_nandfs/newfs_nandfs.c Modified: head/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.c Sun Apr 21 21:28:38 2013 (r249742) +++ head/sbin/newfs_nandfs/newfs_nandfs.c Sun Apr 21 22:36:14 2013 (r249743) @@ -80,15 +80,18 @@ struct file_info { struct nandfs_inode *inode; }; -struct file_info user_files[] = -{ - {NANDFS_ROOT_INO, NULL, S_IFDIR | 0755, 0, 1, NULL, NULL}, +static struct file_info user_files[] = { + { NANDFS_ROOT_INO, NULL, S_IFDIR | 0755, 0, 1, NULL, NULL }, }; -struct file_info ifile = {NANDFS_IFILE_INO, NULL, 0, 0, -1, NULL, NULL}; -struct file_info sufile = {NANDFS_SUFILE_INO, NULL, 0, 0, -1, NULL, NULL}; -struct file_info cpfile = {NANDFS_CPFILE_INO, NULL, 0, 0, -1, NULL, NULL}; -struct file_info datfile = {NANDFS_DAT_INO, NULL, 0, 0, -1, NULL, NULL}; +static struct file_info ifile = + { NANDFS_IFILE_INO, NULL, 0, 0, -1, NULL, NULL }; +static struct file_info sufile = + { NANDFS_SUFILE_INO, NULL, 0, 0, -1, NULL, NULL }; +static struct file_info cpfile = + { NANDFS_CPFILE_INO, NULL, 0, 0, -1, NULL, NULL }; +static struct file_info datfile = + { NANDFS_DAT_INO, NULL, 0, 0, -1, NULL, NULL }; struct nandfs_block { LIST_ENTRY(nandfs_block) block_link; @@ -97,7 +100,8 @@ struct nandfs_block { void *data; }; -static LIST_HEAD(, nandfs_block) block_head = LIST_HEAD_INITIALIZER(&block_head); +static LIST_HEAD(, nandfs_block) block_head = + LIST_HEAD_INITIALIZER(&block_head); /* Storage geometry */ static off_t mediasize; @@ -106,8 +110,8 @@ static uint64_t nsegments; static uint64_t erasesize; static uint64_t segsize; -struct nandfs_fsdata fsdata; -struct nandfs_super_block super_block; +static struct nandfs_fsdata fsdata; +static struct nandfs_super_block super_block; static int is_nand; @@ -120,14 +124,13 @@ static uint32_t bad_segments_count = 0; static uint32_t *bad_segments = NULL; static uint8_t fsdata_blocks_state[NANDFS_NFSAREAS]; -u_char *volumelabel = NULL; +static u_char *volumelabel = NULL; -struct nandfs_super_root *sr; +static struct nandfs_super_root *sr; -uint32_t nuserfiles; -uint32_t seg_segsum_size; -uint32_t seg_nblocks; -uint32_t seg_endblock; +static uint32_t nuserfiles; +static uint32_t seg_nblocks; +static uint32_t seg_endblock; #define SIZE_TO_BLOCK(size) (((size) + (blocksize - 1)) / blocksize) From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 22:47:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2E283A8; Sun, 21 Apr 2013 22:47: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 D43F1150A; Sun, 21 Apr 2013 22:47: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 r3LMlOI2081145; Sun, 21 Apr 2013 22:47:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LMlOfk081144; Sun, 21 Apr 2013 22:47:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304212247.r3LMlOfk081144@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Apr 2013 22:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249744 - head/usr.sbin/nandsim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 22:47:25 -0000 Author: ed Date: Sun Apr 21 22:47:24 2013 New Revision: 249744 URL: http://svnweb.freebsd.org/changeset/base/249744 Log: Add missing static keyword, to make the code build with WARNS=6. Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c ============================================================================== --- head/usr.sbin/nandsim/nandsim_cfgparse.c Sun Apr 21 22:36:14 2013 (r249743) +++ head/usr.sbin/nandsim/nandsim_cfgparse.c Sun Apr 21 22:47:24 2013 (r249744) @@ -130,7 +130,7 @@ static struct nandsim_key nandsim_chip_k {NULL, 0, 0, NULL, 0}, }; -struct nandsim_section sections[] = { +static struct nandsim_section sections[] = { {"ctrl", (struct nandsim_key *)&nandsim_ctrl_keys}, {"chip", (struct nandsim_key *)&nandsim_chip_keys}, {NULL, NULL}, From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 01:26:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8B28B1D2; Mon, 22 Apr 2013 01:26:14 +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 7E1DE190B; Mon, 22 Apr 2013 01:26: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 r3M1QDum030926; Mon, 22 Apr 2013 01:26:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M1QDf3030925; Mon, 22 Apr 2013 01:26:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304220126.r3M1QDf3030925@svn.freebsd.org> From: Alan Cox Date: Mon, 22 Apr 2013 01:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249745 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 01:26:14 -0000 Author: alc Date: Mon Apr 22 01:26:13 2013 New Revision: 249745 URL: http://svnweb.freebsd.org/changeset/base/249745 Log: Simplify vm_radix_{add,dec}lev(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sun Apr 21 22:47:24 2013 (r249744) +++ head/sys/vm/vm_radix.c Mon Apr 22 01:26:13 2013 (r249745) @@ -265,16 +265,19 @@ vm_radix_keybarr(struct vm_radix_node *r static __inline int vm_radix_addlev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) { - vm_pindex_t wrapidx; for (; levels[ilev] == FALSE || vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1); ilev--) if (ilev == 0) return (1); - wrapidx = *idx; + + /* + * The following computation cannot overflow because *idx's slot at + * ilev is less than VM_RADIX_COUNT - 1. + */ *idx = vm_radix_trimkey(*idx, ilev); *idx += VM_RADIX_UNITLEVEL(ilev); - return (*idx < wrapidx); + return (0); } /* @@ -286,17 +289,19 @@ vm_radix_addlev(vm_pindex_t *idx, boolea static __inline int vm_radix_declev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) { - vm_pindex_t wrapidx; for (; levels[ilev] == FALSE || vm_radix_slot(*idx, ilev) == 0; ilev--) if (ilev == 0) return (1); - wrapidx = *idx; + + /* + * The following computation cannot overflow because *idx's slot at + * ilev is greater than 0. + */ *idx = vm_radix_trimkey(*idx, ilev); - *idx |= VM_RADIX_UNITLEVEL(ilev) - 1; - *idx -= VM_RADIX_UNITLEVEL(ilev); - return (*idx > wrapidx); + *idx -= 1; + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:02:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FB73B23; Mon, 22 Apr 2013 05:02:45 +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 3127F1044; Mon, 22 Apr 2013 05:02: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 r3M52iFq099534; Mon, 22 Apr 2013 05:02:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M52Zf1099464; Mon, 22 Apr 2013 05:02:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220502.r3M52Zf1099464@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 05:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249746 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot mouse networking password security share startup timezone ttys usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:02:45 -0000 Author: dteske Date: Mon Apr 22 05:02:34 2013 New Revision: 249746 URL: http://svnweb.freebsd.org/changeset/base/249746 Log: Add new flags `-d' (sets debug=1) and `-D file' (sets debugFile) and improve debugging initialization. Also fixup USAGE statements while we're here. Also, change initialization of main program to _not_ change working directory, allowing the debugFile to be relative without confusion. Modified: head/usr.sbin/bsdconfig/USAGE head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/USAGE 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/diskmgmt/USAGE head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/USAGE head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/USAGE head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/mouse/USAGE head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/USAGE head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/password/USAGE head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/USAGE head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/USAGE 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/rcedit head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/USAGE head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/USAGE head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/USAGE head/usr.sbin/bsdconfig/usermgmt/groupadd head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/useradd head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -31,10 +31,14 @@ Usage: @PROGRAM_NAME@ [OPTIONS] [command [OPTIONS]] OPTIONS: + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). -f file Load file as script and then exit. If multiple occurrences, program will only exit after last occurrence. If file is a single dash (`-'), @PROGRAM_NAME@ reads from standard input. - -h Print usage statement and exit. + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/bsdconfig Mon Apr 22 05:02:34 2013 (r249746) @@ -53,6 +53,7 @@ usage() local index="INDEX" cmd_list="" cd $BSDCFG_LIBE + # No need to preserve CWD (headed toward exit) # Test for language-specific indices f_quietly ls */"$index.${LANG:-$LC_ALL}" && @@ -131,6 +132,8 @@ usage() f_usage $BSDCFG_LIBE/USAGE \ "PROGRAM_NAME" "$pgm" \ "COMMAND_LIST" "$cmd_list" + + # Never reached } # dialog_menu_main @@ -152,14 +155,14 @@ dialog_menu_main() local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }" local menuitem menu_title menu_help menu_selection index=2 - for menuitem in $( ls -d [0-9][0-9][0-9].* ); do + for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do [ $index -lt ${#DIALOG_MENU_TAGS} ] || break tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) menu_program= menu_title= menu_help= - f_include_lang $menuitem/INDEX + f_include_lang $BSDCFG_LIBE/$menuitem/INDEX [ "$menu_program" ] || continue case "$menu_program" in @@ -231,7 +234,7 @@ fi # Process command-line arguments # scripts_loaded=0 -while getopts f:hSX flag; do +while getopts dD:f:hSX flag; do case "$flag" in f) [ $scripts_loaded -eq 0 ] && f_include $BSDCFG_SHARE/script.subr f_script_load "$OPTARG" @@ -254,8 +257,6 @@ f_dialog_title "$msg_main_menu" # Incorporate rc-file if it exists [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" -cd $BSDCFG_LIBE || f_die 1 "$msg_directory_not_found" "$BSDCFG_LIBE" - # # If a non-option argument was passed, process it as a menuitem selection... # Modified: head/usr.sbin/bsdconfig/console/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/console/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/console Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/font Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -101,7 +101,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/keymap Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -141,7 +141,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/repeat Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -91,7 +91,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/saver Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -101,7 +101,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/screenmap Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/console/ttys Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -163,7 +163,7 @@ ttys_set_type() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/diskmgmt/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/diskmgmt/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ X11TERM_OPTS= # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/docsinstall/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/docsinstall/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ X11TERM_OPTS= # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/dot/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/dot/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/dot/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -h Print this usage statement and exit. -c Don't show command-line shortcut relationships. -d Don't show the date in the graph label. -i Don't show include relationships. Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/dot/dot Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,6 +28,11 @@ # ############################################################ INCLUDES +# Prevent common.subr from auto initializing debugging (this is not an inter- +# active utility that requires debugging; also `-d' has been repurposed). +# +DEBUG_SELF_INITIALIZE=NO + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" Modified: head/usr.sbin/bsdconfig/mouse/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/mouse/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/disable Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/enable Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/flags Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/mouse Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/port Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/mouse/type Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/networking/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/networking/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 05:02:34 2013 (r249746) @@ -54,7 +54,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # # Process command-line options # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/hostname Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/nameservers Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/networking/networking Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/password/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/password/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/password/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/password/password Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ USER_ROOT=root # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/security/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/security/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/security/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/security/security Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -111,7 +111,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 05:02:34 2013 (r249746) @@ -62,6 +62,11 @@ export UNAME_S="$(uname -s)" # Operating export UNAME_P="$(uname -p)" # Processor Architecture (i.e. i386) export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) +# +# Default behavior is to call f_debug_init() automatically when loaded. +# +: ${DEBUG_SELF_INITIALIZE=1} + ############################################################ FUNCTIONS # f_dprintf $fmt [ $opts ... ] @@ -86,6 +91,59 @@ f_dprintf() return $SUCCESS } +# f_debug_init +# +# Initialize debugging. Truncates $debugFile to zero bytes if set. +# +f_debug_init() +{ + # + # Process stored command-line arguments + # + ( set -- "$ARGV" + while getopts d flag > /dev/null; do + case "$flag" in + d) true; exit;; + \?) continue;; + esac + done + false + ) && debug=1 + debugFile=$( set -- "$ARGV" + while getopts D flag > /dev/null; do + case "$flag" in + D) echo "$OPTARG";; + \?) continue;; + esac + done + ) + + # + # Make debugging persistant if set + # + [ "$debug" ] && export debug + + # + # Truncate the debug file upon. Note that we will trim a leading plus + # (`+') from the value of debugFile to support persistant meaning that + # f_dprintf() should print both to standard output and $debugFile + # (minus the leading plus, of course). + # + local _debug_file="${debugFile#+}" + if [ "$_debug_file" ]; then + if ( umask 022 && :> "$_debug_file" ); then + f_dprintf "Successfully initialized debugFile \`%s'" \ + "$_debug_file" + [ "${debug+set}" ] || + debug=1 # turn debugging on if not set + else + unset debugFile + f_dprintf "Unable to initialize debugFile \`%s'" \ + "$_debug_file" + fi + fi +} + # f_err $fmt [ $opts ... ] # # Print a message to stderr (fd=2). @@ -615,28 +673,14 @@ eval exec $TERMINAL_STDOUT_PASSTHRU\>\&1 eval exec $TERMINAL_STDERR_PASSTHRU\>\&2 # -# Make debugging persistant if set -# -[ "$debug" ] && export debug - -# -# Truncate the debug file upon initialization (now). Note that we will trim a -# leading plus (`+') from the value of debugFile to support persistant meaning -# that f_dprintf() should print both to standard output and $debugFile (minus -# the leading plus, of course). +# Self-initialize unless requested otherwise # -_debug_file="${debugFile#+}" -if [ "$_debug_file" ]; then - if ( umask 022 && :> "$_debug_file" ); then - f_dprintf "Successfully initialized debugFile \`%s'" \ - "$_debug_file" - else - unset debugFile - f_dprintf "Unable to initialize debugFile \`%s'" \ - "$_debug_file" - fi -fi -unset _debug_file +f_dprintf "%s: DEBUG_SELF_INITIALIZE=[%s]" \ + dialog.subr "$DEBUG_SELF_INITIALIZE" +case "$DEBUG_SELF_INITIALIZE" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_debug_init +esac # # Log our operating environment for debugging purposes Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -250,6 +250,7 @@ f_become_root_via_sudo() fi # Re-execute ourselves with sudo(8) + f_dprintf "%s: Becoming root via sudo(8)..." mustberoot.subr if [ $ARGC -gt 0 ]; then exec sudo "$0" $ARGV else Modified: head/usr.sbin/bsdconfig/startup/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/startup/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/misc Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -276,7 +276,7 @@ dialog_input_value() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/rcadd Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/rcconf Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -196,7 +196,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/rcdelete Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -269,7 +269,7 @@ dialog_menu_delete() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/rcedit ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcedit Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/rcedit Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/rcvar Mon Apr 22 05:02:34 2013 (r249746) @@ -158,7 +158,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/startup/startup ============================================================================== --- head/usr.sbin/bsdconfig/startup/startup Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/startup/startup Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac Modified: head/usr.sbin/bsdconfig/timezone/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/timezone/USAGE Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/timezone/USAGE Mon Apr 22 05:02:34 2013 (r249746) @@ -1,4 +1,4 @@ -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,11 +26,15 @@ Usage: bsdconfig @PROGRAM_NAME@ [-ehnrSsvX] [-C chroot_dir] [zinfo_file | zinfo_name] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). -e Only return success on exit if user selects a timezone AND the selected timezone was successfully installed. By default (without this flag), success is always returned unless an error has occurred. + -h Print this usage statement and exit. -n Do not create or copy files. -r Reinstall the zoneinfo file installed last time. The name is obtained from /var/db/zoneinfo. Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Mon Apr 22 01:26:13 2013 (r249745) +++ head/usr.sbin/bsdconfig/timezone/timezone Mon Apr 22 05:02:34 2013 (r249746) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -115,7 +115,7 @@ dialog_menu_main() # # Process command-line arguments # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:27:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 63034EFA; Mon, 22 Apr 2013 05:27: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 54F4C10D9; Mon, 22 Apr 2013 05:27: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 r3M5REXa006641; Mon, 22 Apr 2013 05:27:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M5REAb006640; Mon, 22 Apr 2013 05:27:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304220527.r3M5REAb006640@svn.freebsd.org> From: Adrian Chadd Date: Mon, 22 Apr 2013 05:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249747 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:27:14 -0000 Author: adrian Date: Mon Apr 22 05:27:13 2013 New Revision: 249747 URL: http://svnweb.freebsd.org/changeset/base/249747 Log: Initialise this to zero before using it to configure the vlangroup information. PR: kern/177871 Submitted by: Luiz Otavio O Souza Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:02:34 2013 (r249746) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:27:13 2013 (r249747) @@ -139,6 +139,7 @@ set_port_vlangroup(struct cfg *cfg, char v = strtol(argv[1], NULL, 0); if (v < 0 || v >= cfg->info.es_nvlangroups) errx(EX_USAGE, "vlangroup must be between 0 and %d", cfg->info.es_nvlangroups-1); + bzero(&p, sizeof(p)); p.es_port = cfg->unit; if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:30:20 2013 Return-Path: Delivered-To: svn-src-head@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 C831C13D; Mon, 22 Apr 2013 05:30:20 +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 BBC4310F0; Mon, 22 Apr 2013 05:30: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 r3M5UKIC008704; Mon, 22 Apr 2013 05:30:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M5UKNu008703; Mon, 22 Apr 2013 05:30:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304220530.r3M5UKNu008703@svn.freebsd.org> From: Adrian Chadd Date: Mon, 22 Apr 2013 05:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249748 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:30:20 -0000 Author: adrian Date: Mon Apr 22 05:30:20 2013 New Revision: 249748 URL: http://svnweb.freebsd.org/changeset/base/249748 Log: etherswitchcfg(8) crashes when you don't set vlangroup members. Fix this to require an argument. PR: kern/177872 Submitted by: Luiz Otavio O Souza Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:27:13 2013 (r249747) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:30:20 2013 (r249748) @@ -467,8 +467,11 @@ main(int argc, char *argv[]) case MODE_PORT: case MODE_VLANGROUP: for(i=0; cmds[i].name != NULL; i++) { - if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0 - && argc >= cmds[i].args) { + if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0) { + if (argc < (cmds[i].args + 1)) { + printf("%s needs an argument\n", cmds[i].name); + break; + } (cmds[i].f)(&cfg, argv); argc -= cmds[i].args; argv += cmds[i].args; From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:32:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E156D2D1; Mon, 22 Apr 2013 05:32:27 +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 D34741104; Mon, 22 Apr 2013 05:32: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 r3M5WRbi009051; Mon, 22 Apr 2013 05:32:27 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M5WRwv009050; Mon, 22 Apr 2013 05:32:27 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220532.r3M5WRwv009050@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 05:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249749 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:32:28 -0000 Author: dteske Date: Mon Apr 22 05:32:27 2013 New Revision: 249749 URL: http://svnweb.freebsd.org/changeset/base/249749 Log: Use new f_getvar for clarity and general code follow-up to r249746. Modified: head/usr.sbin/bsdconfig/bsdconfig Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Mon Apr 22 05:30:20 2013 (r249748) +++ head/usr.sbin/bsdconfig/bsdconfig Mon Apr 22 05:32:27 2013 (r249749) @@ -312,10 +312,13 @@ while :; do ;; *) # Dynamically loaded menuitem - cmd=$( eval echo \"\$menu_program$mtag\" ) + f_getvar menu_program$mtag menu_program + case "$menu_program" in + /*) cmd="$menu_program";; + *) cmd="$BSDCFG_LIBE/$menu_program" + esac f_dprintf "cmd=[%s]" "$cmd" $cmd ${USE_XDIALOG:+-X} - ;; esac done From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:52:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0905E6AE; Mon, 22 Apr 2013 05:52:12 +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 EC875118F; Mon, 22 Apr 2013 05:52: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 r3M5qBtL015086; Mon, 22 Apr 2013 05:52:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M5q7p4015051; Mon, 22 Apr 2013 05:52:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220552.r3M5q7p4015051@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 05:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249751 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/include password/share security share share/media startup startup/share timezone usermgmt user... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:52:12 -0000 Author: dteske Date: Mon Apr 22 05:52:06 2013 New Revision: 249751 URL: http://svnweb.freebsd.org/changeset/base/249751 Log: UI improvements. First, implement --default-item whenever and wherever possible to save keystrokes. Second, overhaul startup/rcdelete for much improved performance. Last, but not least, kill-off useage of --clear and implement --keep-tite in harmony to minimize jarring transitions. Also, fix local variable names where necessary while we're here with other minor comment-enhancements/typo-corrections. 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/hostname 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/password/include/messages.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/media/options.subr head/usr.sbin/bsdconfig/share/strings.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/share/rcvar.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/include/messages.subr 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 Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/bsdconfig Mon Apr 22 05:52:06 2013 (r249751) @@ -197,11 +197,16 @@ dialog_menu_main() --help-button \ --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ + --default-item \"\$DEFAULTITEM_$$\" \ --menu \"\$prompt\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? setvar DIALOG_MENU_$$ "$dialog_menu" + + # Only update default-item on success + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + return $retval } Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/console Mon Apr 22 05:52:06 2013 (r249751) @@ -71,16 +71,18 @@ dialog_menu_main() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ - $menu_list \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$DEFAULTITEM_$$\" \ + --menu \"\$prompt\" $size \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? + setvar DEFAULTITEM_$$ "$dialog_menu" setvar DIALOG_MENU_$$ "$dialog_menu" return $retval } Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/font Mon Apr 22 05:52:06 2013 (r249751) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_choose_a_font" local prompt="$msg_font_menu_text" @@ -77,13 +77,31 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get font8x8 )" in + [Nn][Oo]|'') defaultitem="1 $msg_none";; + cp437-8x8) defaultitem="2 $msg_ibm_437";; + cp850-8x8) defaultitem="3 $msg_ibm_850";; + cp865-8x8) defaultitem="4 $msg_ibm_865";; + cp866-8x8) defaultitem="5 $msg_ibm_866";; + cp866u-8x8) defaultitem="6 $msg_ibm_866u";; + cp1251-8x8) defaultitem="7 $msg_ibm_1251";; + iso-8x8) defaultitem="8 $msg_iso_8859_1";; + iso02-8x8) defaultitem="9 $msg_iso_8859_2";; + iso04-8x8) defaultitem="a $msg_iso_8859_4";; + iso07-8x8) defaultitem="b $msg_iso_8859_7";; + iso08-8x8) defaultitem="c $msg_iso_8859_8";; + iso15-8x8) defaultitem="d $msg_iso_8859_15";; + swiss-8x8) defaultitem="e $msg_swiss";; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/keymap Mon Apr 22 05:52:06 2013 (r249751) @@ -77,7 +77,7 @@ KEYMAP_NAMES=" # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_choose_a_keyboard_map" local prompt="$msg_keymap_menu_text" @@ -117,13 +117,89 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get keymap )" in + be.iso) defaultitem="$msg_belgian";; + br275.cp850) defaultitem="$msg_brazil_cp850";; + br275.iso) defaultitem="$msg_brazil_iso";; + br275.iso.acc) defaultitem="$msg_brazil_iso_accent";; + bg.bds.ctrlcaps) defaultitem="$msg_bulgarian_bds";; + bg.phonetic.ctrlcaps) defaultitem="$msg_bulgarian_phonetic";; + ce.iso2) defaultitem="$msg_central_european_iso";; + hr.iso) defaultitem="$msg_croatian_iso";; + cs.latin2.qwertz) defaultitem="$msg_czech_iso_accent";; + danish.cp865) defaultitem="$msg_danish_cp865";; + danish.iso) defaultitem="$msg_danish_iso";; + estonian.cp850) defaultitem="$msg_estonian_cp850";; + estonian.iso) defaultitem="$msg_estonian_iso";; + estonian.iso15) defaultitem="$msg_estonian_iso_15";; + finnish.cp850) defaultitem="$msg_finnish_cp850";; + finnish.iso) defaultitem="$msg_finnish_iso";; + fr.iso) defaultitem="$msg_french_iso";; + fr.iso.acc) defaultitem="$msg_french_iso_accent";; + fr.macbook.acc) defaultitem="$msg_french_iso_macbook";; + german.cp850) defaultitem="$msg_german_cp850";; + german.iso) defaultitem="$msg_german_iso";; + gr.us101.acc) defaultitem="$msg_greek_101";; + el.iso07) defaultitem="$msg_greek_104";; + gr.elot.acc) defaultitem="$msg_greek_elot";; + hu.iso2.101keys) defaultitem="$msg_hungarian_101";; + hu.iso2.102keys) defaultitem="$msg_hungarian_102";; + icelandic.iso) defaultitem="$msg_icelandic";; + icelandic.iso.acc) defaultitem="$msg_icelandic_accent";; + it.iso) defaultitem="$msg_italian";; + jp.106) defaultitem="$msg_japanese_106";; + latinamerican) defaultitem="$msg_latin_american";; + latinamerican.iso.acc) defaultitem="$msg_latin_american_accent";; + norwegian.iso) defaultitem="$msg_norway_iso";; + pl_PL.ISO8859-2) defaultitem="$msg_polish_iso";; + pt.iso) defaultitem="$msg_portuguese";; + pt.iso.acc) defaultitem="$msg_portuguese_accent";; + ru.koi8-r) defaultitem="$msg_russia_koi8_r";; + sk.iso2) defaultitem="$msg_slovak";; + si.iso) defaultitem="$msg_slovenian";; + spanish.iso) defaultitem="$msg_spanish";; + spanish.iso.acc) defaultitem="$msg_spanish_accent";; + swedish.cp850) defaultitem="$msg_swedish_cp850";; + swedish.iso) defaultitem="$msg_swedish_iso";; + swissfrench.cp850) defaultitem="$msg_swiss_french_cp850";; + swissfrench.iso) defaultitem="$msg_swiss_french_iso";; + swissfrench.iso.acc) defaultitem="$msg_swiss_french_iso_accent";; + swissgerman.cp850) defaultitem="$msg_swiss_german_cp850";; + swissgerman.iso) defaultitem="$msg_swiss_german_iso";; + swissgerman.iso.acc) defaultitem="$msg_swiss_german_iso_accent";; + uk.cp850) defaultitem="$msg_uk_cp850";; + uk.iso) defaultitem="$msg_uk_iso";; + ua.koi8-u) defaultitem="$msg_ukrainian_koi8_u";; + ua.koi8-u.shift.alt) defaultitem="$msg_ukrainian_koi8_u_koi8_r";; + us.pc-ctrl) defaultitem="$msg_usa_capslock_ctrl";; + us.dvorak) defaultitem="$msg_usa_dvorak";; + us.dvorakl) defaultitem="$msg_usa_dvorak_left";; + us.dvorakr) defaultitem="$msg_usa_dvorak_right";; + us.emacs) defaultitem="$msg_usa_emacs";; + us.iso) defaultitem="$msg_usa_iso";; + us.unix) defaultitem="$msg_usa_unix";; + esac + + # The defaultitem may have to be indented to match the menu_list + if [ "$defaultitem" ]; then + ( eval set -- $menu_list + while [ $# -gt 0 ]; do + [ "$defaultitem" = "$1" ] && break + [ " $defaultitem" = "$1" ] && exit 0 + shift 2 # tag/item + done + exit 1 # No modification needed + ) && defaultitem=" $defaultitem" + fi + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/repeat Mon Apr 22 05:52:06 2013 (r249751) @@ -49,15 +49,15 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_choose_a_keyboard_repeat_rate" local prompt="$msg_repeat_menu_text" menu_list=" + '$msg_default' '$msg_default_desc' '$msg_slow' '$msg_slow_desc' '$msg_normal' '$msg_normal_desc' '$msg_fast' '$msg_fast_desc' - '$msg_default' '$msg_default_desc' " # END-QUOTE size=$( eval f_dialog_menu_size \ @@ -67,13 +67,21 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get keyrate )" in + slow) defaultitem="$msg_slow";; + normal) defaultitem="$msg_normal";; + fast) defaultitem="$msg_fast";; + [Nn][Oo]|'') defaultitem="$msg_default";; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/saver Mon Apr 22 05:52:06 2013 (r249751) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_choose_a_screen_saver" local prompt="$msg_saver_menu_text" @@ -77,13 +77,30 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get saver )" in + blank) defaultitem="1 $msg_blank" ;; + beastie) defaultitem="2 $msg_beastie";; + daemon) defaultitem="3 $msg_daemon" ;; + dragon) defaultitem="4 $msg_dragon" ;; + fade) defaultitem="5 $msg_fade" ;; + fire) defaultitem="6 $msg_fire" ;; + green) defaultitem="7 $msg_green" ;; + logo) defaultitem="8 $msg_logo" ;; + rain) defaultitem="9 $msg_rain" ;; + snake) defaultitem="a $msg_snake" ;; + star) defaultitem="b $msg_star" ;; + warp) defaultitem="c $msg_warp" ;; + [Nn][Oo]|'') defaultitem="d $msg_none" ;; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/screenmap Mon Apr 22 05:52:06 2013 (r249751) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_choose_a_screen_map" local prompt="$msg_screenmap_menu_text" @@ -69,13 +69,23 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get scrnmap )" in + [Nn][Oo]|'') defaultitem="1 $msg_none" ;; + iso-8859-1_to_cp437) defaultitem="2 $msg_iso_8859_1_to_ibm437" ;; + iso-8859-7_to_cp437) defaultitem="3 $msg_iso_8859_7_to_ibm437" ;; + us-ascii_to_cp437) defaultitem="4 $msg_us_ascii_to_ibm327" ;; + koi8-r2cp866) defaultitem="5 $msg_koi8_r_to_ibm866" ;; + koi8-u2cp866u) defaultitem="6 $msg_koi8_u_to_ibm866u" ;; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/console/ttys Mon Apr 22 05:52:06 2013 (r249751) @@ -85,7 +85,7 @@ dialog_menu_main() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/mouse/mouse Mon Apr 22 05:52:06 2013 (r249751) @@ -70,16 +70,18 @@ dialog_menu_main() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ - $menu_list \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$DEFAULTITEM_$$\" \ + --menu \"\$prompt\" $size \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? + setvar DEFAULTITEM_$$ "$dialog_menu" setvar DIALOG_MENU_$$ "$dialog_menu" return $retval } Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/mouse/port Mon Apr 22 05:52:06 2013 (r249751) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="" local prompt="$msg_port_menu_text" @@ -69,13 +69,23 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get moused_port )" in + /dev/psm0) defaultitem="1 $msg_ps2" ;; + /dev/cuau0) defaultitem="2 $msg_com1" ;; + /dev/cuau1) defaultitem="3 $msg_com2" ;; + /dev/cuau2) defaultitem="4 $msg_com3" ;; + /dev/cuau3) defaultitem="5 $msg_com4" ;; + /dev/mse0) defaultitem="6 $msg_busmouse" ;; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/mouse/type Mon Apr 22 05:52:06 2013 (r249751) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="" local prompt="$msg_protocol_menu_text" @@ -73,13 +73,27 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get moused_type )" in + auto) defaultitem="1 $msg_auto" ;; + glidepoint) defaultitem="2 $msg_glidepoint" ;; + mmhittab) defaultitem="3 $msg_hitachi" ;; + intellimouse) defaultitem="4 $msg_intellimouse" ;; + logitech) defaultitem="5 $msg_logitech" ;; + microsoft) defaultitem="6 $msg_microsoft" ;; + mmseries) defaultitem="7 $msg_mm_series" ;; + mouseman) defaultitem="8 $msg_mouseman" ;; + mousesystems) defaultitem="9 $msg_mousesystems" ;; + thinkingmouse) defaultitem="A $msg_thinkingmouse" ;; + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 05:52:06 2013 (r249751) @@ -71,10 +71,12 @@ f_mustberoot_init # # Launch application main menu # +defaultitem="" while :; do - f_dialog_menu_netdev + f_dialog_menu_netdev "$defaultitem" retval=$? interface=$( f_dialog_menutag ) + defaultitem="$interface" [ $retval -eq 0 ] || break Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/hostname Mon Apr 22 05:52:06 2013 (r249751) @@ -28,6 +28,9 @@ # ############################################################ INCLUDES +# Prevent device.subr (included indirectly) from auto scanning on load +DEVICE_SELF_SCAN_ALL=NO + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/networking Mon Apr 22 05:52:06 2013 (r249751) @@ -68,15 +68,17 @@ dialog_menu_main() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --menu \"\" $size $menu_list \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$DEFAULTITEM_$$\" \ + --menu \"\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? + setvar DEFAULTITEM_$$ "$dialog_menu" setvar DIALOG_MENU_$$ "$dialog_menu" return $retval } Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -55,12 +55,15 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc ############################################################ FUNCTIONS -# f_dialog_menu_netdev +# f_dialog_menu_netdev [$default] # -# Display a list of network devices with descriptions. +# Display a list of network devices with descriptions. Optionally, if present +# and non-NULL, initially highlight $default interface. # f_dialog_menu_netdev() { + local defaultitem="${1%\*}" # Tim trailing asterisk if present + # # Display a message to let the user know we're working... # (message will remain until we throw up the next dialog) @@ -125,6 +128,15 @@ f_dialog_menu_netdev() return $FAILURE fi + # + # Maybe the default item was marked as active + # + if [ "$defaultitem" ]; then + ifconfig "$defaultitem" 2> /dev/null | awk \ + '( $1 == "status:" && $2 != "active" ) { exit 0 }' || + defaultitem="$defaultitem*" + fi + local hline="$hline_arrows_tab_enter" # @@ -140,11 +152,12 @@ f_dialog_menu_netdev() $interfaces ) local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $interfaces \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD @@ -188,6 +201,7 @@ f_dialog_menu_netdev_edit() # changes effective because all three options must be specified at-once # to ifconfig(8). # + local defaultitem= while :; do local dhcp_status="$msg_disabled" [ "$dhcp" ] && dhcp_status="$msg_enabled" @@ -210,7 +224,7 @@ f_dialog_menu_netdev_edit() $menu_list ) local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ @@ -218,6 +232,7 @@ f_dialog_menu_netdev_edit() --help-button \ --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD @@ -234,6 +249,9 @@ f_dialog_menu_netdev_edit() elif [ $retval -ne $SUCCESS ]; then # "Cancel" was chosen (-1) or ESC was pressed (255) return $retval + else + # Only update default-item on success + defaultitem="$tag" fi # Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then _NETWORKING_MEDIA_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -207,7 +207,7 @@ f_dialog_menu_media_options() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -396,7 +396,7 @@ f_dialog_menu_nameservers() local opt_exit="$msg_return_to_previous_menu" local opt_add="$msg_add_nameserver" local hline="$hline_arrows_tab_enter" - local prompt size + local prompt size defaultitem= # # Loop forever until the user has finished configuring nameservers @@ -435,11 +435,12 @@ f_dialog_menu_nameservers() $menu_list ) local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD @@ -450,7 +451,12 @@ f_dialog_menu_nameservers() local tag="$( f_dialog_menutag )" ns="" # Return if "Cancel" was chosen (-1) or ESC was pressed (255) - [ $retval -eq $SUCCESS ] || return $retval + if [ $retval -ne $SUCCESS ]; then + return $retval + else + # Only update default-item on success + defaultitem="$tag" + fi case "$tag" in "X $msg_exit") break;; Modified: head/usr.sbin/bsdconfig/password/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/include/messages.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/password/include/messages.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,8 +26,8 @@ hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" msg_cancel="Cancel" +msg_enter_new_password="Enter New Password" msg_ok="OK" -msg_password="Password" msg_password_changed="Password successfully changed." msg_password_is_empty="Password is empty." msg_passwords_do_not_match="Passwords do not match." Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/password/share/password.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -1,6 +1,6 @@ if [ ! "$_PASSWORD_PASSWORD_SUBR" ]; then _PASSWORD_PASSWORD_SUBR=1 # -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ f_dialog_input_password() local hline="$hline_alnum_punc_tab_enter" local msg size rmsg rsize - msg=$( printf "$msg_password" ) + msg=$( printf "$msg_enter_new_password" ) size=$( f_dialog_inputbox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Mon Apr 22 05:52:06 2013 (r249751) @@ -51,12 +51,11 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size defaultitem= local hline="$hline_select_securelevel_to_operate_at" local prompt="$msg_securelevels_menu_text" menu_list=" - 'X $msg_exit' '$msg_exit_this_menu' '$msg_disabled' '$msg_disable_securelevels' '$msg_secure' '$msg_secure_mode' '$msg_highly_secure' '$msg_highly_secure_mode' @@ -70,9 +69,20 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) + case "$( f_sysrc_get kern_securelevel_enable )" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + case "$( f_sysrc_get kern_securelevel )" in + 1) defaultitem="$msg_secure" ;; + 2) defaultitem="$msg_highly_secure" ;; + 3) defaultitem="$msg_network_secure" ;; + esac ;; + *) + defaultitem="$msg_disabled" + esac + local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ @@ -80,6 +90,7 @@ dialog_menu_main() --help-button \ --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/security/security Mon Apr 22 05:52:06 2013 (r249751) @@ -49,36 +49,53 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list size mark=" " defaultitem= local hline="$hline_arrows_tab_enter" local prompt="$msg_menu_text" + # Obtain default-item (adjusted below for dynamic tags) + f_getvar DEFAULTITEM_$$ defaultitem + local ditem="${defaultitem%%[$IFS]*}" + menu_list=" 'X <<< $msg_exit' '$msg_exit_this_menu' " # END-QUOTE + # + # Add dynamically tagged entry for kern_securelevels + # case "$( f_sysrc_get kern_securelevel_enable )" in [Yy][Ee][Ss]) local kern_securelevel="$( f_sysrc_get kern_securelevel )" if [ ${#kern_securelevel} -eq 1 ] && - f_isinteger "$kern_securelevel" - then menu_list="$menu_list - '2 [$kern_securelevel] $msg_securelevel'" - else menu_list="$menu_list - '2 [X] $msg_securelevel'" - fi - menu_list="$menu_list '$msg_securelevel_desc'" - ;; - *) menu_list="$menu_list - '2 [ ] $msg_securelevel' '$msg_securelevel_desc'" + f_isinteger "$kern_securelevel" && + [ $kern_securelevel -lt 9 ] + then + mark="$kern_securelevel" + else + mark="X" + fi ;; + *) + mark=" " esac + menu_list="$menu_list + '2 [$mark] $msg_securelevel' '$msg_securelevel_desc'" + + # Update default-item if appropriate + [ "$ditem" = 2 ] && defaultitem="2 [$mark] $msg_securelevel" + # + # Add dynamically tagged entry for nfs_reserved_port_only + # case "$( f_sysrc_get nfs_reserved_port_only )" in - [Yy][Ee][Ss]) menu_list="$menu_list - '3 [X] $msg_nfs_port' '$msg_nfs_port_desc'";; - *) menu_list="$menu_list - '3 [ ] $msg_nfs_port' '$msg_nfs_port_desc'";; + [Yy][Ee][Ss]) mark="X" ;; + *) mark=" " ;; esac + menu_list="$menu_list + '3 [$mark] $msg_nfs_port' '$msg_nfs_port_desc'" + + # Update default-item if appropriate + [ "$ditem" = 3 ] && defaultitem="3 [$mark] $msg_nfs_port" size=$( eval f_dialog_menu_size \ \"\$DIALOG_TITLE\" \ @@ -89,17 +106,22 @@ dialog_menu_main() local dialog_menu dialog_menu=$( eval $DIALOG \ - --clear --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ --menu \"\$prompt\" $size \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? setvar DIALOG_MENU_$$ "$dialog_menu" + + # Only update default-item on success + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + return $retval } Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -66,6 +66,7 @@ f_media_options_menu() unset $VAR_NONINTERACTIVE fi + local defaultitem= while :; do menu_list="" @@ -203,12 +204,14 @@ f_media_options_menu() --cancel-label \"\$msg_done\" \ --help-button \ --help-label \"\$msg_help\" \ + --default-item \"\$defaultitem\" \ ${USE_XDIALOG:+--help \"\"} \ --menu \"\$prompt\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? setvar DIALOG_MENU_$$ "$dialog_menu" + defaultitem="$dialog_menu" local mtag mtag=$( f_dialog_menutag ) Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/share/strings.subr Mon Apr 22 05:52:06 2013 (r249751) @@ -25,6 +25,21 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ GLOBALS + +# +# Valid characters that can appear in an sh(1) variable name +# +# Please note that the character ranges A-Z and a-z should be avoided because +# these can include accent characters (which are not valid in a variable name). +# For example, A-Z matches any character that sorts after A but before Z, +# including A and Z. Although ASCII order would make more sense, that is not +# how it works. +# +VALID_VARNAME_CHARS="0-9ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_" + +############################################################ FUNCTIONS # f_substr "$string" $start [ $length ] # @@ -167,6 +182,90 @@ f_uridecode() fi } +# f_replaceall $string $find $replace [$var_to_set] +# +# Replace all occurrences of $find in $sting with $replace. If $var_to_set is +# either missing or NULL, the variable name is produced on standard out for +# capturing in a sub-shell (which is less recommended due to performance +# degradation). +# +f_replaceall() +{ + local __left="" __right="$1" + local __find="$2" __replace="$3" __var_to_set="$4" + while :; do + case "$__right" in *$__find*) + __left="$__left${__right%%$__find*}$__replace" + __right="${__right#*$__find}" + continue + esac + break + done + __left="$__left${__right#*$__find}" + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__left" + else + echo "$__left" + fi +} + +# f_str2varname $string [$var_to_set] +# +# Convert a string into a suitable value to be used as a variable name +# by converting unsuitable characters into the underscrore [_]. If $var_to_set +# is either missing or NULL, the variable name is produced on standard out for +# capturing in a sub-shell (which is less recommended due to performance +# degradation). +# +f_str2varname() +{ + local __string="$1" __var_to_set="$2" + f_replaceall "$__string" "[!$VALID_VARNAME_CHARS]" "_" "$__var_to_set" +} + +# f_shell_escape $string [$var_to_set] +# +# Escape $string for shell eval statement(s) by replacing all single-quotes +# with a special sequence that creates a compound string when interpolated +# by eval with surrounding single-quotes. +# +# For example: +# +# foo="abc'123" +# f_shell_escape "$foo" bar # bar=[abc'\''123] +# eval echo \'$foo\' # produces abc'123 +# +# This is helpful when processing an argument list that has to retain its +# escaped structure for later evaluations. +# +# WARNING: Surrounding single-quotes are not added; this is the responsibility +# of the code passing the escaped values to eval (which also aids readability). +# +f_shell_escape() +{ + local __string="$1" __var_to_set="$2" + f_replaceall "$__string" "'" "'\\''" "$__var_to_set" +} + +# f_shell_unescape $string [$var_to_set] +# +# The antithesis of f_shell_escape(), this function takes an escaped $string +# and expands it. +# +# For example: +# +# foo="abc'123" +# f_shell_escape "$foo" bar # bar=[abc'\''123] +# f_shell_unescape "$bar" # produces abc'123 +# +f_shell_unescape() +{ + local __string="$1" __var_to_set="$2" + f_replaceall "$__string" "'\\''" "'" "$__var_to_set" +} + +############################################################ MAIN + f_dprintf "%s: Successfully loaded." strings.subr fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Mon Apr 22 05:48:18 2013 (r249750) +++ head/usr.sbin/bsdconfig/startup/misc Mon Apr 22 05:52:06 2013 (r249751) @@ -56,10 +56,14 @@ UNAME_P=$( uname -p ) # Processor Archit # dialog_menu_main() { - local menu_list var_list size + local menu_list var_list size defaultitem= local hline="$hline_arrows_tab_enter" local prompt="$msg_miscellaneous_menu_text" + # Obtain default-item (adjusted below for dynamic tags) + f_getvar DEFAULTITEM_$$ defaultitem + local ditem="${defaultitem%%[$IFS]*}" + menu_list=" 'X <<< $msg_exit' '$msg_exit_this_menu' " # END-QUOTE @@ -84,7 +88,7 @@ dialog_menu_main() " # END-QUOTE fi - menu_list="$menu_list $( + eval "$( . "$RC_DEFAULTS" source_rc_confs export $var_list @@ -100,104 +104,132 @@ dialog_menu_main() export msg_sco msg_sco_desc export msg_svr4 msg_svr4_desc :| awk \ - -v uname_p="$UNAME_P" \ - -v menu_tags="$DIALOG_MENU_TAGS" \ - -v menu_fmt="'%c [%c] %s' '%s'\n" \ - -v sep_fmt="' ' ' -- '\n" \ - 'END { + -v uname_p="$UNAME_P" \ + -v menu_tags="$DIALOG_MENU_TAGS" \ + -v menu_fmt="'%s' '%s'\n" \ + -v mtag_fmt="%c [%c] %s" \ + -v separator="' ' ' -- '\n" \ + -v ditem="$ditem" \ + ' + function mprint(tag,item) + { + printf menu_fmt, tag, item + } + END { i = 1 + defaultitem = "" + + printf "menu_list=\"$menu_list\n" + if ( uname_p == "i386" ) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 05:52:20 2013 Return-Path: Delivered-To: svn-src-head@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 8493071B; Mon, 22 Apr 2013 05:52:19 +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 466131192; Mon, 22 Apr 2013 05:52: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 r3M5qJh5015135; Mon, 22 Apr 2013 05:52:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M5qIEk015131; Mon, 22 Apr 2013 05:52:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304220552.r3M5qIEk015131@svn.freebsd.org> From: Adrian Chadd Date: Mon, 22 Apr 2013 05:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249752 - in head: sbin/etherswitchcfg sys/dev/etherswitch sys/dev/etherswitch/rtl8366 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 05:52:20 -0000 Author: adrian Date: Mon Apr 22 05:52:18 2013 New Revision: 249752 URL: http://svnweb.freebsd.org/changeset/base/249752 Log: Convert over the etherswitch framework to use VLAN IDs per port, rather than VLAN groups. Some chips (eg this rtl8366rb) has a VLAN group per port - you first define a set of VLANs in a vlan group, then you assign a VLAN group to a port. Other chips (eg the AR8xxx switch chips) have a VLAN ID array per port - there's no group per se, just a list of vlans that can be configured. So for now, the switch API will use the latter and rely on drivers doing the heavy lifting if one wishes to use the VLAN group method. Maybe later on both can be supported. PR: kern/177878 PR: kern/177873 Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 head/sbin/etherswitchcfg/etherswitchcfg.c head/sys/dev/etherswitch/etherswitch.h head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Mon Apr 22 05:52:06 2013 (r249751) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Mon Apr 22 05:52:18 2013 (r249752) @@ -62,9 +62,9 @@ To set the register value, use the form .Ss port The port command selects one of the ports of the switch. It supports the following commands: -.Bl -tag -width ".Ar vlangroup number" -compact -.It Ar vlangroup number -Sets the VLAN group number that is used to process incoming frames that are not tagged. +.Bl -tag -width ".Ar pvid number" -compact +.It Ar pvid number +Sets the default port VID that is used to process incoming frames that are not tagged. .It Ar media mediaspec Specifies the physical media configuration to be configured for a port. .It Ar mediaopt mediaoption @@ -104,7 +104,7 @@ Configure VLAN group 1 with a VID of 2 a while excluding all other ports. Port 5 will send and receive tagged frames, while port 0 will be untagged. Incoming untagged frames on port 0 are assigned to vlangroup1. -.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 vlangroup 1 +.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2 .Sh SEE ALSO .Xr etherswitch 4 .Sh HISTORY Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:52:06 2013 (r249751) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:52:18 2013 (r249752) @@ -131,19 +131,20 @@ write_phyregister(struct cfg *cfg, int p } static void -set_port_vlangroup(struct cfg *cfg, char *argv[]) +set_port_vid(struct cfg *cfg, char *argv[]) { int v; etherswitch_port_t p; v = strtol(argv[1], NULL, 0); - if (v < 0 || v >= cfg->info.es_nvlangroups) - errx(EX_USAGE, "vlangroup must be between 0 and %d", cfg->info.es_nvlangroups-1); + if (v < 0 || v > IEEE802DOT1Q_VID_MAX) + errx(EX_USAGE, "pvid must be between 0 and %d", + IEEE802DOT1Q_VID_MAX); bzero(&p, sizeof(p)); p.es_port = cfg->unit; if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); - p.es_vlangroup = v; + p.es_pvid = v; if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHSETPORT)"); } @@ -302,7 +303,7 @@ print_port(struct cfg *cfg, int port) if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); printf("port%d:\n", port); - printf("\tvlangroup: %d\n", p.es_vlangroup); + printf("\tpvid: %d\n", p.es_pvid); printf("\tmedia: "); print_media_word(p.es_ifmr.ifm_current, 1); if (p.es_ifmr.ifm_active != p.es_ifmr.ifm_current) { @@ -506,7 +507,7 @@ main(int argc, char *argv[]) } static struct cmds cmds[] = { - { MODE_PORT, "vlangroup", 1, set_port_vlangroup }, + { MODE_PORT, "pvid", 1, set_port_vid }, { MODE_PORT, "media", 1, set_port_media }, { MODE_PORT, "mediaopt", 1, set_port_mediaopt }, { MODE_VLANGROUP, "vlan", 1, set_vlangroup_vid }, Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Mon Apr 22 05:52:06 2013 (r249751) +++ head/sys/dev/etherswitch/etherswitch.h Mon Apr 22 05:52:18 2013 (r249752) @@ -36,7 +36,7 @@ typedef struct etherswitch_info etherswi struct etherswitch_port { int es_port; - int es_vlangroup; + int es_pvid; union { struct ifreq es_uifr; struct ifmediareq es_uifmr; Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Mon Apr 22 05:52:06 2013 (r249751) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Mon Apr 22 05:52:18 2013 (r249752) @@ -63,6 +63,7 @@ struct rtl8366rb_softc { int smi_acquired; /* serialize access to SMI/I2C bus */ struct mtx callout_mtx; /* serialize callout */ device_t dev; + int vid[RTL8366RB_NUM_VLANS]; char *ifname[RTL8366RB_NUM_PHYS]; device_t miibus[RTL8366RB_NUM_PHYS]; struct ifnet *ifp[RTL8366RB_NUM_PHYS]; @@ -70,8 +71,8 @@ struct rtl8366rb_softc { }; static etherswitch_info_t etherswitch_info = { - .es_nports = 6, - .es_nvlangroups = 16, + .es_nports = RTL8366RB_NUM_PORTS, + .es_nvlangroups = RTL8366RB_NUM_VLANS, .es_name = "Realtek RTL8366RB" }; @@ -550,15 +551,16 @@ rtl_getport(device_t dev, etherswitch_po struct mii_data *mii; struct ifmediareq *ifmr = &p->es_ifmr; uint16_t v; - int err; + int err, vlangroup; if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PORTS) return (ENXIO); - p->es_vlangroup = RTL8366RB_PVCR_GET(p->es_port, + sc = device_get_softc(dev); + vlangroup = RTL8366RB_PVCR_GET(p->es_port, rtl_readreg(dev, RTL8366RB_PVCR_REG(p->es_port))); + p->es_pvid = sc->vid[vlangroup]; if (p->es_port < RTL8366RB_NUM_PHYS) { - sc = device_get_softc(dev); mii = device_get_softc(sc->miibus[p->es_port]); ifm = &mii->mii_media; err = ifmedia_ioctl(sc->ifp[p->es_port], &p->es_ifr, ifm, SIOCGIFMEDIA); @@ -580,19 +582,28 @@ rtl_getport(device_t dev, etherswitch_po static int rtl_setport(device_t dev, etherswitch_port_t *p) { - int err; + int i, err, vlangroup; struct rtl8366rb_softc *sc; struct ifmedia *ifm; struct mii_data *mii; if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PHYS) return (ENXIO); + sc = device_get_softc(dev); + vlangroup = -1; + for (i = 0; i < RTL8366RB_NUM_VLANS; i++) { + if (sc->vid[i] == p->es_pvid) { + vlangroup = i; + break; + } + } + if (vlangroup == -1) + return (ENXIO); err = smi_rmw(dev, RTL8366RB_PVCR_REG(p->es_port), RTL8366RB_PVCR_VAL(p->es_port, RTL8366RB_PVCR_PORT_MASK), - RTL8366RB_PVCR_VAL(p->es_port, p->es_vlangroup), RTL_WAITOK); + RTL8366RB_PVCR_VAL(p->es_port, vlangroup), RTL_WAITOK); if (err) return (err); - sc = device_get_softc(dev); mii = device_get_softc(sc->miibus[p->es_port]); ifm = &mii->mii_media; err = ifmedia_ioctl(sc->ifp[p->es_port], &p->es_ifr, ifm, SIOCSIFMEDIA); @@ -618,8 +629,11 @@ rtl_getvgroup(device_t dev, etherswitch_ static int rtl_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) { + struct rtl8366rb_softc *sc; int g = vg->es_vlangroup; + sc = device_get_softc(dev); + sc->vid[g] = vg->es_vid; rtl_writereg(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_DOT1Q_REG, g), (vg->es_vid << RTL8366RB_VMCR_DOT1Q_VID_SHIFT) & RTL8366RB_VMCR_DOT1Q_VID_MASK); rtl_writereg(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_MU_REG, g), From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:10:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB7C2C8A; Mon, 22 Apr 2013 06:10:28 +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 9EDEB1225; Mon, 22 Apr 2013 06:10: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 r3M6ASEw021468; Mon, 22 Apr 2013 06:10:28 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6AS1H021467; Mon, 22 Apr 2013 06:10:28 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220610.r3M6AS1H021467@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249753 - head/usr.sbin/bsdconfig/networking X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:10:28 -0000 Author: dteske Date: Mon Apr 22 06:10:27 2013 New Revision: 249753 URL: http://svnweb.freebsd.org/changeset/base/249753 Log: Fix two bugs when setting up a plip interface. First, dhcp status was not being properly cleared each iteration of the loop. Second, values weren't properly quoted when sent to the editor function. Modified: head/usr.sbin/bsdconfig/networking/devices Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 05:52:18 2013 (r249752) +++ head/usr.sbin/bsdconfig/networking/devices Mon Apr 22 06:10:27 2013 (r249753) @@ -99,6 +99,7 @@ while :; do # fallback to reading the active configuration if not configured in # the rc.conf(5) file(s). # + dhcp= _ipaddr= _netmask= _ifconfig=$( f_sysrc_get ifconfig_$interface ) @@ -147,7 +148,7 @@ while :; do # Block on user-configuration of the probed settings f_dialog_menu_netdev_edit \ - $interface $_ipaddr $_netmask "$_options" $dhcp + "$interface" "$_ipaddr" "$_netmask" "$_options" $dhcp # Return to root menu if above returns success [ $? -eq $SUCCESS ] && break From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:12:22 2013 Return-Path: Delivered-To: svn-src-head@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 A5728E1F; Mon, 22 Apr 2013 06:12:22 +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 985D61235; Mon, 22 Apr 2013 06:12: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 r3M6CMQS021832; Mon, 22 Apr 2013 06:12:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6CMvC021831; Mon, 22 Apr 2013 06:12:22 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220612.r3M6CMvC021831@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249754 - head/usr.sbin/bsdconfig/share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:12:22 -0000 Author: dteske Date: Mon Apr 22 06:12:22 2013 New Revision: 249754 URL: http://svnweb.freebsd.org/changeset/base/249754 Log: Style nit (to be consistent across project). Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Apr 22 06:10:27 2013 (r249753) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Apr 22 06:12:22 2013 (r249754) @@ -619,7 +619,7 @@ f_media_init_ftp() local host="$ftp_host" port="${ftp_port:+:$ftp_port}" case "$host" in *:*) host="[$host]"; esac - local user pass use_anon="" + local user pass use_anon= f_getvar $VAR_FTP_USER user if [ ! "$user" ]; then user="anonymous" @@ -833,7 +833,7 @@ f_media_get_ftp() return $FAILURE fi - local user pass use_anon="" + local user pass use_anon= f_getvar $VAR_FTP_USER user if [ ! "$user" ]; then user="anonymous" From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:13:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F879F9E; Mon, 22 Apr 2013 06:13:31 +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 1259A1243; Mon, 22 Apr 2013 06:13: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 r3M6DUBZ022026; Mon, 22 Apr 2013 06:13:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6DUjP022025; Mon, 22 Apr 2013 06:13:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220613.r3M6DUjP022025@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249755 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:13:31 -0000 Author: dteske Date: Mon Apr 22 06:13:30 2013 New Revision: 249755 URL: http://svnweb.freebsd.org/changeset/base/249755 Log: Update comment for accuracy. Modified: head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Mon Apr 22 06:12:22 2013 (r249754) +++ head/usr.sbin/bsdconfig/share/device.subr Mon Apr 22 06:13:30 2013 (r249755) @@ -393,9 +393,9 @@ f_device_name_get() # f_device_name_set $type $name $desc [$max] # # Store a description (desc) and [optionally] maximum number of devices to scan -# for (max) in-association with device $type and $name. Returns success. Use -# the f_device_name_get() routine with the same $name and [optionally] $type to -# retrieve one of type, desc, or max properties. +# for (max) in-association with device $type and $name. Returns success unless +# $name is NULL or missing. Use the f_device_name_get() routine with the same +# $name and optionally $type to retrieve one of type, desc, or max properties. # f_device_name_set() { From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:20:35 2013 Return-Path: Delivered-To: svn-src-head@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 7927B290; Mon, 22 Apr 2013 06:20:35 +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 6C75E1287; Mon, 22 Apr 2013 06:20: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 r3M6KZlD024460; Mon, 22 Apr 2013 06:20:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6KZnV024459; Mon, 22 Apr 2013 06:20:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220620.r3M6KZnV024459@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249756 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:20:35 -0000 Author: dteske Date: Mon Apr 22 06:20:34 2013 New Revision: 249756 URL: http://svnweb.freebsd.org/changeset/base/249756 Log: Fix a copy/paste error. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:13:30 2013 (r249755) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:20:34 2013 (r249756) @@ -738,8 +738,8 @@ f_dialog_radiolist_size() # local longest_tag=0 longest_item=0 while [ $# -ge 2 ]; do - local tag="$1" item="$2" help="$3" - shift 3 # tag/item/status + local tag="$1" item="$2" + shift 2 # tag/item [ ${#tag} -gt $longest_tag ] && longest_tag=${#tag} [ ${#item} -gt $longest_item ] && longest_item=${#item} From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:27:15 2013 Return-Path: Delivered-To: svn-src-head@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 805C25F3; Mon, 22 Apr 2013 06:27:15 +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 7217912DD; Mon, 22 Apr 2013 06:27: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 r3M6RFX6025568; Mon, 22 Apr 2013 06:27:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6RF5Y025567; Mon, 22 Apr 2013 06:27:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220627.r3M6RF5Y025567@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249757 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:27:15 -0000 Author: dteske Date: Mon Apr 22 06:27:14 2013 New Revision: 249757 URL: http://svnweb.freebsd.org/changeset/base/249757 Log: Proper fix for copy/paste error (first attempt r249756). Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:20:34 2013 (r249756) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:27:14 2013 (r249757) @@ -737,9 +737,9 @@ f_dialog_radiolist_size() # Also, calculate the number of rows (not to exceed terminal height). # local longest_tag=0 longest_item=0 - while [ $# -ge 2 ]; do + while [ $# -ge 3 ]; do local tag="$1" item="$2" - shift 2 # tag/item + shift 3 # tag/item/status [ ${#tag} -gt $longest_tag ] && longest_tag=${#tag} [ ${#item} -gt $longest_item ] && longest_item=${#item} From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:28:46 2013 Return-Path: Delivered-To: svn-src-head@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 7B875774; Mon, 22 Apr 2013 06:28:46 +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 5E30612E9; Mon, 22 Apr 2013 06:28: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 r3M6SkpB025798; Mon, 22 Apr 2013 06:28:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6SkV2025797; Mon, 22 Apr 2013 06:28:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220628.r3M6SkV2025797@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249758 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:28:46 -0000 Author: dteske Date: Mon Apr 22 06:28:45 2013 New Revision: 249758 URL: http://svnweb.freebsd.org/changeset/base/249758 Log: New helper functions for common widgets. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:27:14 2013 (r249757) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Apr 22 06:28:45 2013 (r249758) @@ -770,6 +770,142 @@ f_dialog_radiolist_size() echo "$height $width $rows" } +# f_dialog_checklist_size $title $backtitle $prompt $hline \ +# $tag1 $item1 $status1 $tag2 $item2 $status2 ... +# +# Not all versions of dialog(1) perform auto-sizing of the width and height of +# `--checklist' boxes sensibly. +# +# This function helps solve this issue by taking as arguments (in order of +# appearance) the title, backtitle, prompt, hline and list of tag/item/status +# triplets, returning the optimal width and height for the checklist (not +# exceeding the actual terminal width or height). +# +# Output is in the format of "height width rows". +# +f_dialog_checklist_size() +{ + f_dialog_radiolist_size "$@" +} + +# f_dialog_radiolist_with_help_size $title $backtitle $prompt $hline \ +# $tag1 $item1 $status1 $help1 \ +# $tag2 $item2 $status2 $help2 ... +# +# Not all versions of dialog(1) perform auto-sizing of the width and height of +# `--radiolist' boxes sensibly. +# +# This function helps solve this issue by taking as arguments (in order of +# appearance) the title, backtitle, prompt, hline and list of +# tag/item/status/help quads, returning the optimal width and height for the +# radiolist (not exceeding the actual terminal width or height). +# +# Output is in the format of "height width rows". +# +f_dialog_radiolist_with_help_size() +{ + local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 + local min_width min_rows max_size + + if [ "$USE_XDIALOG" ]; then + min_width=35 + min_rows=1 + max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION + else + min_width=24 + min_rows=0 + max_size=$( stty size 2> /dev/null ) # usually "24 80" + : ${max_size:=$DEFAULT_TERMINAL_SIZE} + fi + + local max_width="${max_size##*[$IFS]}" + local max_height="${max_size%%[$IFS]*}" + local box_size="$( f_dialog_infobox_size \ + "$title" "$btitle" "$prompt" "$hline" )" + local box_height="${box_size%%[$IFS]*}" + local box_width="${box_size##*[$IFS]}" + local max_rows=$(( $max_height - 8 )) + local height width=$box_width rows=$min_rows + + shift 4 # title/btitle/prompt/hline + + # + # The sum total between the longest tag-length, longest item-length, + # and radio-button width should be used for the menu width (not to + # exceed terminal width). + # + # Also, calculate the number of rows (not to exceed terminal height). + # + # Also, calculate the longest help while we're here. This will be used + # to influence the width of the menu if (and only-if) using Xdialog(1). + # + local longest_tag=0 longest_item=0 longest_help=0 + while [ $# -ge 4 ]; do + local tag="$1" item="$2" status="$3" help="$4" + shift 4 # tag/item/status/help + + [ ${#tag} -gt $longest_tag ] && longest_tag=${#tag} + [ ${#item} -gt $longest_item ] && longest_item=${#item} + [ ${#help} -gt $longest_help ] && longest_help=${#help} + [ $rows -lt $max_rows ] && rows=$(( $rows + 1 )) + done + + # Update width + n=$(( $longest_tag + $longest_item + 13 )) + [ "$USE_XDIALOG" ] && n=$(( $n + $n / 6 )) # Add 16.6% for Xdialog(1) + if [ $n -gt $width -a $n -gt $min_width ]; then + if [ $n -lt $max_width ]; then + width=$n + else + width=$max_width + fi + fi + + # Update width for help text if using Xdialog(1) + if [ "$USE_XDIALOG" ]; then + n=$(( $longest_help + 10 )) + n=$(( $n + $n / 6 )) # +16.6% + if [ $n -gt $width -a $n -gt $min_width ]; then + if [ $n -lt $max_width ]; then + width=$n + else + width=$max_width + fi + fi + fi + + # Fix rows and set height + [ $rows -gt 0 ] || rows=1 + if [ "$USE_XDIALOG" ]; then + height=$(( $rows + $box_height + 7 )) + else + height=$(( $rows + $box_height + 4 )) + fi + [ $height -le $max_height ] || height=$max_height + + # Return all three + echo "$height $width $rows" +} + +# f_dialog_checklist_with_help_size $title $backtitle $prompt $hline \ +# $tag1 $item1 $status1 $help1 \ +# $tag2 $item2 $status2 $help2 ... +# +# Not all versions of dialog(1) perform auto-sizing of the width and height of +# `--checklist' boxes sensibly. +# +# This function helps solve this issue by taking as arguments (in order of +# appearance) the title, backtitle, prompt, hline and list of +# tag/item/status/help quads, returning the optimal width and height for the +# checklist (not exceeding the actual terminal width or height). +# +# Output is in the format of "height width rows". +# +f_dialog_checklist_with_help_size() +{ + f_dialog_radiolist_with_help_size "$@" +} + # f_dialog_calendar_size $title $backtitle $prompt [$hline] # # Not all versions of dialog(1) perform auto-sizing of the width and height of From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 06:30:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D116697C; Mon, 22 Apr 2013 06:30:29 +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 C423D1306; Mon, 22 Apr 2013 06:30: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 r3M6UTo1026133; Mon, 22 Apr 2013 06:30:29 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M6UTOr026132; Mon, 22 Apr 2013 06:30:29 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304220630.r3M6UTOr026132@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 06:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249759 - head/usr.sbin/bsdconfig/startup/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 06:30:29 -0000 Author: dteske Date: Mon Apr 22 06:30:29 2013 New Revision: 249759 URL: http://svnweb.freebsd.org/changeset/base/249759 Log: Clarify to the user the amount of time required to load the menus for each view in the details dialog. Modified: head/usr.sbin/bsdconfig/startup/include/messages.subr Modified: head/usr.sbin/bsdconfig/startup/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/include/messages.subr Mon Apr 22 06:28:45 2013 (r249758) +++ head/usr.sbin/bsdconfig/startup/include/messages.subr Mon Apr 22 06:30:29 2013 (r249759) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -94,11 +94,11 @@ msg_reset_desc="Reset to default view se msg_sco="SCO" msg_sco_desc="This host wants to be able to run IBCS2 binaries." msg_show_configured="Show Configured" -msg_show_configured_desc="Calculate rc.conf(5) locations (slow)" +msg_show_configured_desc="Calculate rc.conf(5) locations (slowest)" msg_show_default_value="Show Default/Value" -msg_show_default_value_desc="Show default/configured values" +msg_show_default_value_desc="Show default/configured values (slow)" msg_show_value="Show Value" -msg_show_value_desc="Show configured startup value" +msg_show_value_desc="Show configured startup value (fast)" msg_startup="Startup" msg_startup_dirs="Startup dirs" msg_startup_dirs_desc="Set the list of dirs to look for startup scripts" From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 08:28:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34FDBC92; Mon, 22 Apr 2013 08:28:54 +0000 (UTC) (envelope-from dmarion@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 2757B172F; Mon, 22 Apr 2013 08:28: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 r3M8SrZp063331; Mon, 22 Apr 2013 08:28:53 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M8SrUc063330; Mon, 22 Apr 2013 08:28:53 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201304220828.r3M8SrUc063330@svn.freebsd.org> From: Damjan Marion Date: Mon, 22 Apr 2013 08:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249762 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 08:28:54 -0000 Author: dmarion Date: Mon Apr 22 08:28:53 2013 New Revision: 249762 URL: http://svnweb.freebsd.org/changeset/base/249762 Log: Initialize GIC_PMRR register on ARM GIC. Provided by: Thomas Skibo Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Mon Apr 22 06:47:27 2013 (r249761) +++ head/sys/arm/arm/gic.c Mon Apr 22 08:28:53 2013 (r249762) @@ -134,6 +134,9 @@ gic_init_secondary(void) /* Enable CPU interface */ gic_c_write_4(GICC_CTLR, 1); + /* Set priority mask register. */ + gic_c_write_4(GICC_PMR, 0xff); + /* Enable interrupt distribution */ gic_d_write_4(GICD_CTLR, 0x01); @@ -199,6 +202,9 @@ arm_gic_attach(device_t dev) /* Enable CPU interface */ gic_c_write_4(GICC_CTLR, 1); + /* Set priority mask register. */ + gic_c_write_4(GICC_PMR, 0xff); + /* Enable interrupt distribution */ gic_d_write_4(GICD_CTLR, 0x01); From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 09:02:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB0EB6ED; Mon, 22 Apr 2013 09:02:23 +0000 (UTC) (envelope-from glebius@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 ADA59190A; Mon, 22 Apr 2013 09:02: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 r3M92NoG074633; Mon, 22 Apr 2013 09:02:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M92NB9074631; Mon, 22 Apr 2013 09:02:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304220902.r3M92NB9074631@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 22 Apr 2013 09:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249763 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 09:02:23 -0000 Author: glebius Date: Mon Apr 22 09:02:23 2013 New Revision: 249763 URL: http://svnweb.freebsd.org/changeset/base/249763 Log: Panic if UMA_ZONE_PCPU is created at early stages of boot, when mp_ncpus isn't yet initialized. Otherwise we will panic at first allocation later. Sponsored by: Nginx, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Apr 22 08:28:53 2013 (r249762) +++ head/sys/vm/uma_core.c Mon Apr 22 09:02:23 2013 (r249763) @@ -1139,6 +1139,7 @@ keg_small_init(uma_keg_t keg) u_int shsize; if (keg->uk_flags & UMA_ZONE_PCPU) { + KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus)); keg->uk_slabsize = sizeof(struct pcpu); keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), PAGE_SIZE); From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 09:18:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 637A2AA7; Mon, 22 Apr 2013 09:18:51 +0000 (UTC) (envelope-from pluknet@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 561011A8E; Mon, 22 Apr 2013 09:18: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 r3M9Ip8L078925; Mon, 22 Apr 2013 09:18:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3M9Ipd3078924; Mon, 22 Apr 2013 09:18:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304220918.r3M9Ipd3078924@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Apr 2013 09:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249764 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 09:18:51 -0000 Author: pluknet Date: Mon Apr 22 09:18:50 2013 New Revision: 249764 URL: http://svnweb.freebsd.org/changeset/base/249764 Log: Keep up with negative addrlen check removal in r249649. Modified: head/lib/libc/sys/accept.2 Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Mon Apr 22 09:02:23 2013 (r249763) +++ head/lib/libc/sys/accept.2 Mon Apr 22 09:18:50 2013 (r249764) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 26, 2013 +.Dd April 22, 2013 .Dt ACCEPT 2 .Os .Sh NAME @@ -164,10 +164,6 @@ The descriptor references a file, not a .It Bq Er EINVAL .Xr listen 2 has not been called on the socket descriptor. -.It Bq Er EINVAL -The -.Fa addrlen -argument is negative. .It Bq Er EFAULT The .Fa addr From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 13:02:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3F19987; Mon, 22 Apr 2013 13:02:41 +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 E4BF01931; Mon, 22 Apr 2013 13:02: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 r3MD2fX4049016; Mon, 22 Apr 2013 13:02:41 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MD2fad049013; Mon, 22 Apr 2013 13:02:41 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201304221302.r3MD2fad049013@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 22 Apr 2013 13:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249765 - in head/sys: dev/uart modules/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 13:02:42 -0000 Author: nyan Date: Mon Apr 22 13:02:41 2013 New Revision: 249765 URL: http://svnweb.freebsd.org/changeset/base/249765 Log: Build uart_dev_lpc.c on arm only. This fixes pc98 build. Modified: head/sys/dev/uart/uart_subr.c head/sys/modules/uart/Makefile Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Mon Apr 22 09:18:50 2013 (r249764) +++ head/sys/dev/uart/uart_subr.c Mon Apr 22 13:02:41 2013 (r249765) @@ -52,7 +52,9 @@ static struct uart_class *uart_classes[] &uart_ns8250_class, &uart_sab82532_class, &uart_z8530_class, +#if defined(__arm__) &uart_lpc_class, +#endif }; static size_t uart_nclasses = sizeof(uart_classes) / sizeof(uart_classes[0]); Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Mon Apr 22 09:18:50 2013 (r249764) +++ head/sys/modules/uart/Makefile Mon Apr 22 13:02:41 2013 (r249765) @@ -6,6 +6,10 @@ uart_bus_ebus= uart_bus_ebus.c .endif +.if ${MACHINE_CPUARCH} == "arm" +uart_dev_lpc= uart_dev_lpc.c +.endif + .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "sparc64" ofw_bus_if= ofw_bus_if.h .endif @@ -23,7 +27,7 @@ KMOD= uart SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ - uart_dev_lpc.c uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ + ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ uart_dev_z8530.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 14:25:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40F30C1D; Mon, 22 Apr 2013 14:25:32 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-bk0-x22c.google.com (mail-bk0-x22c.google.com [IPv6:2a00:1450:4008:c01::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3171E4C; Mon, 22 Apr 2013 14:25:31 +0000 (UTC) Received: by mail-bk0-f44.google.com with SMTP id jk13so2619475bkc.3 for ; Mon, 22 Apr 2013 07:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xnw3NMXKY7NqW/b8CAm9fzKF+iWyKI8jD27LW1W+wxg=; b=FBjJ1XAEPqPcx7BeowlVP9CObPJuuCWukbqMZ0VO1REUjR1PwH+f+N840bjnRSGW3w gs2vFgRJNKY53lbt4BC7dSEHyhj7hhWg0V717kwz+9f1pPG8zk3PBaTiLv+ZijaOMmz2 IxCDftMv1eAvLq5bMrFrXDKK9umgCiCe00pPbQQu4UntlfBlo7V5Js1GEGdxZcZ3SFuJ a5RP1bbzAFo/yC0MLS9O6hexhl2SA5JMvTAriQGkrRfwUuwbPbMwBX6R8IHsWVWjpOxw nvaxuQtSUzK1vLCsJMtMXGfGYG0fu58kfURXKE56feFFADlLZ3ogBpqBAbnuhdUkeLvx ryUg== MIME-Version: 1.0 X-Received: by 10.204.238.200 with SMTP id kt8mr11149397bkb.50.1366640729503; Mon, 22 Apr 2013 07:25:29 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.204.239.132 with HTTP; Mon, 22 Apr 2013 07:25:29 -0700 (PDT) Received: by 10.204.239.132 with HTTP; Mon, 22 Apr 2013 07:25:29 -0700 (PDT) In-Reply-To: <201304221302.r3MD2fad049013@svn.freebsd.org> References: <201304221302.r3MD2fad049013@svn.freebsd.org> Date: Mon, 22 Apr 2013 07:25:29 -0700 X-Google-Sender-Auth: DbiDv0L03Ell29JG9fEs0bKsEiM Message-ID: Subject: Re: svn commit: r249765 - in head/sys: dev/uart modules/uart From: Justin Hibbits To: Takahashi Yoshihiro 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 14:25:32 -0000 Sorry! I should've read the tinderbox failures. Pointy hat to: jhibbits On Apr 22, 2013 6:02 AM, "Takahashi Yoshihiro" wrote: > Author: nyan > Date: Mon Apr 22 13:02:41 2013 > New Revision: 249765 > URL: http://svnweb.freebsd.org/changeset/base/249765 > > Log: > Build uart_dev_lpc.c on arm only. This fixes pc98 build. > > Modified: > head/sys/dev/uart/uart_subr.c > head/sys/modules/uart/Makefile > > Modified: head/sys/dev/uart/uart_subr.c > > ============================================================================== > --- head/sys/dev/uart/uart_subr.c Mon Apr 22 09:18:50 2013 > (r249764) > +++ head/sys/dev/uart/uart_subr.c Mon Apr 22 13:02:41 2013 > (r249765) > @@ -52,7 +52,9 @@ static struct uart_class *uart_classes[] > &uart_ns8250_class, > &uart_sab82532_class, > &uart_z8530_class, > +#if defined(__arm__) > &uart_lpc_class, > +#endif > }; > static size_t uart_nclasses = sizeof(uart_classes) / > sizeof(uart_classes[0]); > > > Modified: head/sys/modules/uart/Makefile > > ============================================================================== > --- head/sys/modules/uart/Makefile Mon Apr 22 09:18:50 2013 > (r249764) > +++ head/sys/modules/uart/Makefile Mon Apr 22 13:02:41 2013 > (r249765) > @@ -6,6 +6,10 @@ > uart_bus_ebus= uart_bus_ebus.c > .endif > > +.if ${MACHINE_CPUARCH} == "arm" > +uart_dev_lpc= uart_dev_lpc.c > +.endif > + > .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "sparc64" > ofw_bus_if= ofw_bus_if.h > .endif > @@ -23,7 +27,7 @@ KMOD= uart > SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ > uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ > uart_core.c ${uart_cpu_machine} uart_dbg.c \ > - uart_dev_lpc.c uart_dev_ns8250.c uart_dev_quicc.c > uart_dev_sab82532.c \ > + ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c > uart_dev_sab82532.c \ > uart_dev_z8530.c \ > uart_if.c uart_if.h uart_subr.c uart_tty.c > > From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 15:02:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E5DE727; Mon, 22 Apr 2013 15:02:33 +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 40E651078; Mon, 22 Apr 2013 15:02: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 r3MF2XtD086910; Mon, 22 Apr 2013 15:02:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MF2X74086909; Mon, 22 Apr 2013 15:02:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201304221502.r3MF2X74086909@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Apr 2013 15:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249766 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 15:02:33 -0000 Author: jhb Date: Mon Apr 22 15:02:32 2013 New Revision: 249766 URL: http://svnweb.freebsd.org/changeset/base/249766 Log: Use a higher TTL (128) for DHCP packets. This matches the ISC DHCP client. PR: bin/170279 MFC after: 1 week Modified: head/sbin/dhclient/packet.c Modified: head/sbin/dhclient/packet.c ============================================================================== --- head/sbin/dhclient/packet.c Mon Apr 22 13:02:41 2013 (r249765) +++ head/sbin/dhclient/packet.c Mon Apr 22 15:02:32 2013 (r249766) @@ -128,7 +128,7 @@ assemble_udp_ip_header(unsigned char *bu ip.ip_len = htons(sizeof(ip) + sizeof(udp) + len); ip.ip_id = 0; ip.ip_off = 0; - ip.ip_ttl = 16; + ip.ip_ttl = 128; ip.ip_p = IPPROTO_UDP; ip.ip_sum = 0; ip.ip_src.s_addr = from; From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 15:51:07 2013 Return-Path: Delivered-To: svn-src-head@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 79BE9AF5; Mon, 22 Apr 2013 15:51:07 +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 525311295; Mon, 22 Apr 2013 15:51: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 r3MFp7jA003050; Mon, 22 Apr 2013 15:51:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MFp62p003048; Mon, 22 Apr 2013 15:51:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201304221551.r3MFp62p003048@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Apr 2013 15:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249767 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 15:51:07 -0000 Author: jhb Date: Mon Apr 22 15:51:06 2013 New Revision: 249767 URL: http://svnweb.freebsd.org/changeset/base/249767 Log: - Some BIOSes use an Extended IRQ resource descriptor in _PRS for a link that uses non-ISA IRQs but use a plain IRQ resource in _CRS. However, a non-ISA IRQ can't fit into a plain IRQ resource. If we encounter a link like this, build the resource buffer from _PRS instead of _CRS. - Set the correct size of the end tag in a resource buffer. Tested by: Benjamin Lee MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci_link.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Apr 22 15:02:32 2013 (r249766) +++ head/sys/dev/acpica/acpi.c Mon Apr 22 15:51:06 2013 (r249767) @@ -2334,7 +2334,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *b return (AE_NO_MEMORY); rp = (ACPI_RESOURCE *)buf->Pointer; rp->Type = ACPI_RESOURCE_TYPE_END_TAG; - rp->Length = 0; + rp->Length = ACPI_RS_SIZE_MIN; } if (res == NULL) return (AE_OK); @@ -2384,7 +2384,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *b /* And add the terminator. */ rp = ACPI_NEXT_RESOURCE(rp); rp->Type = ACPI_RESOURCE_TYPE_END_TAG; - rp->Length = 0; + rp->Length = ACPI_RS_SIZE_MIN; return (AE_OK); } Modified: head/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- head/sys/dev/acpica/acpi_pci_link.c Mon Apr 22 15:02:32 2013 (r249766) +++ head/sys/dev/acpica/acpi_pci_link.c Mon Apr 22 15:51:06 2013 (r249767) @@ -99,6 +99,7 @@ struct link { uint8_t l_bios_irq; uint8_t l_irq; uint8_t l_initial_irq; + UINT32 l_crs_type; int l_res_index; int l_num_irqs; int *l_irqs; @@ -236,6 +237,7 @@ link_add_crs(ACPI_RESOURCE *res, void *c ("%s: array boundary violation", __func__)); link = &req->sc->pl_links[req->link_index]; link->l_res_index = req->res_index; + link->l_crs_type = res->Type; req->link_index++; req->res_index++; @@ -364,6 +366,14 @@ link_add_prs(ACPI_RESOURCE *res, void *c link->l_isa_irq = FALSE; } } + + /* + * If this is not an ISA IRQ but _CRS used a non-extended + * IRQ descriptor, don't use _CRS as a template for _SRS. + */ + if (!req->sc->pl_crs_bad && !link->l_isa_irq && + link->l_crs_type == ACPI_RESOURCE_TYPE_IRQ) + req->sc->pl_crs_bad = TRUE; break; default: if (req->in_dpf == DPF_IGNORE) From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 17:38:26 2013 Return-Path: Delivered-To: svn-src-head@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 E8D4CF2D; Mon, 22 Apr 2013 17:38:26 +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 DB3D81889; Mon, 22 Apr 2013 17:38: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 r3MHcQkn035491; Mon, 22 Apr 2013 17:38:26 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MHcQUi035490; Mon, 22 Apr 2013 17:38:26 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304221738.r3MHcQUi035490@svn.freebsd.org> From: Joel Dahl Date: Mon, 22 Apr 2013 17:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249768 - head/sbin/geom/class/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 17:38:27 -0000 Author: joel (doc committer) Date: Mon Apr 22 17:38:26 2013 New Revision: 249768 URL: http://svnweb.freebsd.org/changeset/base/249768 Log: Minor clarificiation. PR: 177455 Modified: head/sbin/geom/class/label/glabel.8 Modified: head/sbin/geom/class/label/glabel.8 ============================================================================== --- head/sbin/geom/class/label/glabel.8 Mon Apr 22 15:51:06 2013 (r249767) +++ head/sbin/geom/class/label/glabel.8 Mon Apr 22 17:38:26 2013 (r249768) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2009 +.Dd April 22, 2013 .Dt GLABEL 8 .Os .Sh NAME @@ -81,7 +81,7 @@ The method uses on-disk metadata to store the label and detect it automatically in the future. .Pp -This class also provides volume label detection for file systems. +This GEOM class also provides volume label detection for file systems. Those labels cannot be set with .Nm , but must be set with the appropriate file system utility, e.g.\& for UFS From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 17:55:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 175522B7; Mon, 22 Apr 2013 17:55:13 +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 09FBB1A73; Mon, 22 Apr 2013 17:55: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 r3MHtCdJ041083; Mon, 22 Apr 2013 17:55:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MHtCSg041082; Mon, 22 Apr 2013 17:55:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304221755.r3MHtCSg041082@svn.freebsd.org> From: Joel Dahl Date: Mon, 22 Apr 2013 17:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249769 - head/bin/domainname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 17:55:13 -0000 Author: joel (doc committer) Date: Mon Apr 22 17:55:12 2013 New Revision: 249769 URL: http://svnweb.freebsd.org/changeset/base/249769 Log: Point users towards nisdomainname and rc.conf. PR: 144630 Submitted by: Stefan Krueger , Fel Modified: head/bin/domainname/domainname.1 Modified: head/bin/domainname/domainname.1 ============================================================================== --- head/bin/domainname/domainname.1 Mon Apr 22 17:38:26 2013 (r249768) +++ head/bin/domainname/domainname.1 Mon Apr 22 17:55:12 2013 (r249769) @@ -29,7 +29,7 @@ .\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd September 18, 1994 +.Dd April 22, 2013 .Dt DOMAINNAME 1 .Os .Sh NAME @@ -43,10 +43,11 @@ The .Nm utility prints the name of the current YP/NIS domain. The super-user can -set the domain name by supplying an argument; this is usually done in the -network initialization script -.Pa /etc/rc.network , -normally run at boot +set the domain name by supplying an argument; this is usually done with the +.Va nisdomainname +variable in the +.Pa /etc/rc.conf +file, normally run at boot time. .Sh NOTES The YP/NIS (formerly ``Yellow Pages'' but renamed for legal reasons) @@ -54,7 +55,8 @@ domain name does not necessarily have an Name System domain name, although they are often set equal for administrative convenience. .Sh SEE ALSO -.Xr getdomainname 3 +.Xr getdomainname 3 , +.Xr rc.conf 5 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 18:11:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB256A9B; Mon, 22 Apr 2013 18:11:29 +0000 (UTC) (envelope-from sjg@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 AC4391B79; Mon, 22 Apr 2013 18:11: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 r3MIBTT4047643; Mon, 22 Apr 2013 18:11:29 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MIBT0I047642; Mon, 22 Apr 2013 18:11:29 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201304221811.r3MIBT0I047642@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 22 Apr 2013 18:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249770 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 18:11:29 -0000 Author: sjg Date: Mon Apr 22 18:11:29 2013 New Revision: 249770 URL: http://svnweb.freebsd.org/changeset/base/249770 Log: Pass more variables to bsd.prog.mk and only append to already defined variables. Submitted by: Garrett Cooper Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Mon Apr 22 17:55:12 2013 (r249769) +++ head/share/mk/bsd.progs.mk Mon Apr 22 18:11:29 2013 (r249770) @@ -36,9 +36,11 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS .for v in ${PROG_VARS:O:u} +.if defined(${v}.${PROG}) $v += ${${v}_${PROG}:U${${v}.${PROG}}} +.endif .endfor # for meta mode, there can be only one! @@ -64,7 +66,8 @@ UPDATE_DEPENDFILE = NO .include <${.PARSEFILE:S,progs,prog,}> .ifndef PROG -PROGS_TARGETS += clean +# tell progs.mk we might want to install things +PROGS_TARGETS+= cleandepend cleandir cleanobj depend install .for p in ${PROGS} .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 18:31:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7C995C3; Mon, 22 Apr 2013 18:31:39 +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 AA01F1CAC; Mon, 22 Apr 2013 18:31: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 r3MIVdJ2054047; Mon, 22 Apr 2013 18:31:39 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MIVdON054046; Mon, 22 Apr 2013 18:31:39 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304221831.r3MIVdON054046@svn.freebsd.org> From: Joel Dahl Date: Mon, 22 Apr 2013 18:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249771 - head/usr.sbin/timed/timed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 18:31:39 -0000 Author: joel (doc committer) Date: Mon Apr 22 18:31:39 2013 New Revision: 249771 URL: http://svnweb.freebsd.org/changeset/base/249771 Log: Minor update about rc.conf. Modified: head/usr.sbin/timed/timed/timed.8 Modified: head/usr.sbin/timed/timed/timed.8 ============================================================================== --- head/usr.sbin/timed/timed/timed.8 Mon Apr 22 18:11:29 2013 (r249770) +++ head/usr.sbin/timed/timed/timed.8 Mon Apr 22 18:31:39 2013 (r249771) @@ -44,7 +44,7 @@ The .Nm utility is a time server daemon which is normally invoked at boot time from the -.Xr rc.network 8 +.Xr rc.conf 5 file. It synchronizes the host's time with the time of other machines, which are also running From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 18:41:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EDDBC46; Mon, 22 Apr 2013 18:41:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx1.freebsd.org (Postfix) with ESMTP id 59D7A1D58; Mon, 22 Apr 2013 18:41:24 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id 10so276296pdc.14 for ; Mon, 22 Apr 2013 11:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=mQ43TX8yxWnqo4T99smnENu6Lck/MFON2xD4FFxrxlc=; b=sgdQx42yOSjsQn3uYebJytIXf7u3fSnDbIl9nfI9IY6mbUXhpCtjqN0mi5gj3DhUpa 5kwLoA0esDmj9jsKG07djz5d9atQfFq/6m7x00sVCXUzUHzzuZy19Un10jt8eUuszH99 XMBLTzHy78ZWrlb44Pq5rHU0mp2tFnbGJ7gVAcM870RH5DYwzgvIvspDiLhefqDdJpuB /7Fizz3mSBFqBhaDPtkBllOqeqf/B8ZI1Je9KFE5WMWRYOX1QTkIvhOX69jIGQ/3kU8f zAQNAtfKFPJZ68Ps33ZIg+L8VDmp0siTSrgs5JUlW7tMvzevT1bZzKV0hs+SyeWzNlUG VcVw== X-Received: by 10.66.52.76 with SMTP id r12mr13997770pao.217.1366656078523; Mon, 22 Apr 2013 11:41:18 -0700 (PDT) Received: from [10.43.238.124] (mobile-166-147-080-091.mycingular.net. [166.147.80.91]) by mx.google.com with ESMTPS id jw10sm26154053pbb.3.2013.04.22.11.41.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 11:41:17 -0700 (PDT) References: <201304221831.r3MIVdON054046@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201304221831.r3MIVdON054046@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r249771 - head/usr.sbin/timed/timed Date: Mon, 22 Apr 2013 11:41:11 -0700 To: Joel Dahl Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 18:41:24 -0000 On Apr 22, 2013, at 11:31 AM, Joel Dahl wrote: > Author: joel (doc committer) > Date: Mon Apr 22 18:31:39 2013 > New Revision: 249771 > URL: http://svnweb.freebsd.org/changeset/base/249771 >=20 > Log: > Minor update about rc.conf. >=20 > Modified: > head/usr.sbin/timed/timed/timed.8 >=20 > Modified: head/usr.sbin/timed/timed/timed.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/usr.sbin/timed/timed/timed.8 Mon Apr 22 18:11:29 2013 (r249= 770) > +++ head/usr.sbin/timed/timed/timed.8 Mon Apr 22 18:31:39 2013 (r249= 771) > @@ -44,7 +44,7 @@ The > .Nm > utility is a time server daemon > which is normally invoked at boot time from the > -.Xr rc.network 8 > +.Xr rc.conf 5 > file. Neither of these is correct; ntpd/ntpdate are executed via their respective r= c scripts, which is executed by rc.subr. I would just delete this portion of= the sentence TBH as it's unfortunately misleading :/.. Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 18:53:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 037866B0; Mon, 22 Apr 2013 18:53:37 +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 D9FB91E46; Mon, 22 Apr 2013 18:53: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 r3MIraTg060891; Mon, 22 Apr 2013 18:53:36 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MIram6060889; Mon, 22 Apr 2013 18:53:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201304221853.r3MIram6060889@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 22 Apr 2013 18:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249774 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 18:53:37 -0000 Author: gonzo Date: Mon Apr 22 18:53:36 2013 New Revision: 249774 URL: http://svnweb.freebsd.org/changeset/base/249774 Log: Split BeagleBone DTS to generic AM335x part and Beagle-bone specific Added: head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/beaglebone.dts Added: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon Apr 22 18:53:36 2013 (r249774) @@ -0,0 +1,225 @@ +/*- + * 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$ + */ + +/ { + compatible = "ti,am335x"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&AINTC>; + + SOC: am335x { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + AINTC: interrupt-controller@48200000 { + compatible = "ti,aintc"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = < 0x48200000 0x1000 >; + }; + + scm@44e10000 { + compatible = "ti,scm"; + reg = < 0x44e10000 0x2000 >; + /* 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 */ + "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", + "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", + "GPMC_CLK", "gpio2_1", "input_pulldown", + "LCD_DATA0", "gpio2_6", "input_pulldown", + "LCD_DATA1", "gpio2_7", "input_pulldown", + "LCD_DATA2", "gpio2_8", "input_pulldown", + "LCD_DATA3", "gpio2_9", "input_pulldown", + "LCD_DATA4", "gpio2_10", "input_pulldown", + "LCD_DATA5", "gpio2_11", "input_pulldown", + "LCD_DATA6", "gpio2_12", "input_pulldown", + "LCD_DATA7", "gpio2_13", "input_pulldown", + "LCD_VSYNC", "gpio2_22", "input_pulldown", + "LCD_HSYNC", "gpio2_23", "input_pulldown", + "LCD_PCLK", "gpio2_24", "input_pulldown", + "LCD_AC_BIAS_EN", "gpio2_25", "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", + /* PWM */ + "GPMC_A2", "ehrpwm1A", "output", + "GPMC_A3", "ehrpwm1B", "output", + "GPMC_AD8", "ehrpwm2A", "output", + "GPMC_AD9", "ehrpwm2B", "output"; + }; + + prcm@44E00000 { + compatible = "am335x,prcm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x44E00000 0x1300 >; + }; + + dmtimers@44E05000 { + compatible = "ti,am335x-dmtimer"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x44E05000 0x1000 + 0x44E31000 0x1000 + 0x48040000 0x1000 + 0x48042000 0x1000 + 0x48044000 0x1000 + 0x48046000 0x1000 + 0x48048000 0x1000 + 0x4804A000 0x1000 >; + interrupts = < 66 67 68 69 92 93 94 95 >; + interrupt-parent = <&AINTC>; + }; + + GPIO: gpio { + #gpio-cells = <3>; + compatible = "ti,gpio"; + gpio-controller; + reg =< 0x44E07000 0x1000 + 0x4804C000 0x1000 + 0x481AC000 0x1000 + 0x481AE000 0x1000 >; + interrupts = < 96 97 98 99 32 33 62 63 >; + interrupt-parent = <&AINTC>; + }; + + uart0: serial@44E09000 { + compatible = "ns16550"; + reg = <0x44E09000 0x1000>; + reg-shift = <2>; + interrupts = < 72 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; /* FIXME */ + }; + + edma3@49000000 { + compatible = "ti,edma3"; + reg =< 0x49000000 0x100000 /* Channel Controller Regs */ + 0x49800000 0x100000 /* Transfer Controller 0 Regs */ + 0x49900000 0x100000 /* Transfer Controller 1 Regs */ + 0x49a00000 0x100000 >; /* Transfer Controller 2 Regs */ + interrupts = <12 13 14>; + interrupt-parent = <&AINTC>; + }; + + mmchs0@4809C000 { + compatible = "ti,mmchs"; + reg =<0x48060000 0x1000 >; + interrupts = <64>; + interrupt-parent = <&AINTC>; + mmchs-device-id = <0>; + }; + + enet0: ethernet@4A100000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ti,cpsw"; + reg = <0x4A100000 0x4000>; + interrupts = <40 41 42 43>; + interrupt-parent = <&AINTC>; + phy-handle = <&phy0>; + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,cpsw-mdio"; + phy0: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + + i2c0: i2c@44e0b000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,i2c"; + reg =< 0x44e0b000 0x1000 >; + interrupts = <70>; + interrupt-parent = <&AINTC>; + i2c-device-id = <0>; + }; + }; +}; Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Mon Apr 22 18:38:29 2013 (r249773) +++ head/sys/boot/fdt/dts/beaglebone.dts Mon Apr 22 18:53:36 2013 (r249774) @@ -28,13 +28,10 @@ /dts-v1/; +/include/ "am335x.dtsi" + / { model = "beaglebone"; - compatible = "beaglebone", "ti,am335x"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&AINTC>; aliases { soc = &SOC; @@ -46,199 +43,13 @@ reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ }; - SOC: am335x { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - AINTC: interrupt-controller@48200000 { - compatible = "ti,aintc"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x48200000 0x1000 >; - }; - - scm@44e10000 { - compatible = "ti,scm"; - reg = < 0x44e10000 0x2000 >; - /* 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 */ - "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", - "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", - "GPMC_CLK", "gpio2_1", "input_pulldown", - "LCD_DATA0", "gpio2_6", "input_pulldown", - "LCD_DATA1", "gpio2_7", "input_pulldown", - "LCD_DATA2", "gpio2_8", "input_pulldown", - "LCD_DATA3", "gpio2_9", "input_pulldown", - "LCD_DATA4", "gpio2_10", "input_pulldown", - "LCD_DATA5", "gpio2_11", "input_pulldown", - "LCD_DATA6", "gpio2_12", "input_pulldown", - "LCD_DATA7", "gpio2_13", "input_pulldown", - "LCD_VSYNC", "gpio2_22", "input_pulldown", - "LCD_HSYNC", "gpio2_23", "input_pulldown", - "LCD_PCLK", "gpio2_24", "input_pulldown", - "LCD_AC_BIAS_EN", "gpio2_25", "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", - /* PWM */ - "GPMC_A2", "ehrpwm1A", "output", - "GPMC_A3", "ehrpwm1B", "output", - "GPMC_AD8", "ehrpwm2A", "output", - "GPMC_AD9", "ehrpwm2B", "output"; - }; - - prcm@44E00000 { - compatible = "am335x,prcm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x44E00000 0x1300 >; - }; - - dmtimers@44E05000 { - compatible = "ti,am335x-dmtimer"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x44E05000 0x1000 - 0x44E31000 0x1000 - 0x48040000 0x1000 - 0x48042000 0x1000 - 0x48044000 0x1000 - 0x48046000 0x1000 - 0x48048000 0x1000 - 0x4804A000 0x1000 >; - interrupts = < 66 67 68 69 92 93 94 95 >; - interrupt-parent = <&AINTC>; - }; - - GPIO: gpio { - #gpio-cells = <3>; - compatible = "ti,gpio"; - gpio-controller; - reg =< 0x44E07000 0x1000 - 0x4804C000 0x1000 - 0x481AC000 0x1000 - 0x481AE000 0x1000 >; - interrupts = < 96 97 98 99 32 33 62 63 >; - interrupt-parent = <&AINTC>; - }; - - - uart0: serial@44E09000 { - compatible = "ns16550"; - reg = <0x44E09000 0x1000>; - reg-shift = <2>; - interrupts = < 72 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; /* FIXME */ - }; - - edma3@49000000 { - compatible = "ti,edma3"; - reg =< 0x49000000 0x100000 /* Channel Controller Regs */ - 0x49800000 0x100000 /* Transfer Controller 0 Regs */ - 0x49900000 0x100000 /* Transfer Controller 1 Regs */ - 0x49a00000 0x100000 >; /* Transfer Controller 2 Regs */ - interrupts = <12 13 14>; - interrupt-parent = <&AINTC>; - }; - - mmchs0@4809C000 { - compatible = "ti,mmchs"; - reg =<0x48060000 0x1000 >; - interrupts = <64>; - interrupt-parent = <&AINTC>; - mmchs-device-id = <0>; - }; - - enet0: ethernet@4A100000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ti,cpsw"; - reg = <0x4A100000 0x4000>; - interrupts = <40 41 42 43>; - interrupt-parent = <&AINTC>; - phy-handle = <&phy0>; - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,cpsw-mdio"; - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - - i2c0: i2c@44e0b000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,i2c"; - reg =< 0x44e0b000 0x1000 >; - interrupts = <70>; - interrupt-parent = <&AINTC>; - i2c-device-id = <0>; + am335x { + i2c@44e0b000 { pmic@24 { compatible = "ti,am335x-pmic"; reg = <0x24>; }; - }; + } }; chosen { From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 18:58:12 2013 Return-Path: Delivered-To: svn-src-head@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 BE78CB4C; Mon, 22 Apr 2013 18:58:12 +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 B0EF81E7D; Mon, 22 Apr 2013 18:58: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 r3MIwCKI061845; Mon, 22 Apr 2013 18:58:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MIwCa9061843; Mon, 22 Apr 2013 18:58:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304221858.r3MIwCa9061843@svn.freebsd.org> From: Adrian Chadd Date: Mon, 22 Apr 2013 18:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249775 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 18:58:12 -0000 Author: adrian Date: Mon Apr 22 18:58:12 2013 New Revision: 249775 URL: http://svnweb.freebsd.org/changeset/base/249775 Log: Update arswitch to the new API. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Apr 22 18:53:36 2013 (r249774) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Apr 22 18:58:12 2013 (r249775) @@ -435,7 +435,7 @@ arswitch_getport(device_t dev, etherswit if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PORTS) return (ENXIO); - p->es_vlangroup = 0; + p->es_pvid = 0; mii = arswitch_miiforport(sc, p->es_port); if (p->es_port == 0) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 19:02:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D9A8DAA; Mon, 22 Apr 2013 19:02:38 +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 F37EE1EBE; Mon, 22 Apr 2013 19:02: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 r3MJ2b0j064348; Mon, 22 Apr 2013 19:02:37 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MJ2bSM064346; Mon, 22 Apr 2013 19:02:37 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304221902.r3MJ2bSM064346@svn.freebsd.org> From: Brooks Davis Date: Mon, 22 Apr 2013 19:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249776 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 19:02:38 -0000 Author: brooks Date: Mon Apr 22 19:02:37 2013 New Revision: 249776 URL: http://svnweb.freebsd.org/changeset/base/249776 Log: MFP4 223084, 227821: Partially implement generic_bs_*_8() for MIPS platforms. This is known to work with TARGET_ARCH=mips64 with FreeBSD/BERI. Assuming that other definitions in cpufunc.h are correct it will work on non-o64 ABI systems except sibyte. On sibyte and o32 systems generic_bs_*_8() will remain panic() implementations. Sponsored by: DARPA, AFRL Reviewed by: imp, jmallett (older versions) Modified: head/sys/mips/include/cpufunc.h head/sys/mips/mips/bus_space_generic.c Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Mon Apr 22 18:58:12 2013 (r249775) +++ head/sys/mips/include/cpufunc.h Mon Apr 22 19:02:37 2013 (r249776) @@ -354,9 +354,15 @@ void mips3_sd(volatile uint64_t *, uint6 #define readb(va) (*(volatile uint8_t *) (va)) #define readw(va) (*(volatile uint16_t *) (va)) #define readl(va) (*(volatile uint32_t *) (va)) +#if defined(__GNUC__) && !defined(__mips_o32) +#define readq(a) (*(volatile uint64_t *)(a)) +#endif #define writeb(va, d) (*(volatile uint8_t *) (va) = (d)) #define writew(va, d) (*(volatile uint16_t *) (va) = (d)) #define writel(va, d) (*(volatile uint32_t *) (va) = (d)) +#if defined(__GNUC__) && !defined(__mips_o32) +#define writeq(va, d) (*(volatile uint64_t *) (va) = (d)) +#endif #endif /* !_MACHINE_CPUFUNC_H_ */ Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Mon Apr 22 18:58:12 2013 (r249775) +++ head/sys/mips/mips/bus_space_generic.c Mon Apr 22 19:02:37 2013 (r249776) @@ -202,9 +202,11 @@ static struct bus_space generic_space = #define rd8(a) cvmx_read64_uint8(a) #define rd16(a) cvmx_read64_uint16(a) #define rd32(a) cvmx_read64_uint32(a) +#define rd64(a) cvmx_read64_uint64(a) #define wr8(a, v) cvmx_write64_uint8(a, v) #define wr16(a, v) cvmx_write64_uint16(a, v) #define wr32(a, v) cvmx_write64_uint32(a, v) +#define wr64(a, v) cvmx_write64_uint64(a, v) #elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN #include #define rd8(a) sb_big_endian_read8(a) @@ -217,9 +219,15 @@ static struct bus_space generic_space = #define rd8(a) readb(a) #define rd16(a) readw(a) #define rd32(a) readl(a) +#ifdef readq +#define rd64(a) readq((a)) +#endif #define wr8(a, v) writeb(a, v) #define wr16(a, v) writew(a, v) #define wr32(a, v) writel(a, v) +#ifdef writeq +#define wr64(a, v) writeq(a, v) +#endif #endif /* generic bus_space tag */ @@ -297,7 +305,11 @@ uint64_t generic_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) { +#ifdef rd64 + return(rd64(handle + offset)); +#else panic("%s: not implemented", __func__); +#endif } void @@ -333,8 +345,14 @@ void generic_bs_rm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t *addr, size_t count) { +#ifdef rd64 + bus_addr_t baddr = bsh + offset; + while (count--) + *addr++ = rd64(baddr); +#else panic("%s: not implemented", __func__); +#endif } /* @@ -382,8 +400,16 @@ void generic_bs_rr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t *addr, size_t count) { +#ifdef rd64 + bus_addr_t baddr = bsh + offset; + while (count--) { + *addr++ = rd64(baddr); + baddr += 8; + } +#else panic("%s: not implemented", __func__); +#endif } /* @@ -419,7 +445,11 @@ generic_bs_w_8(void *t, bus_space_handle uint64_t value) { +#ifdef wr64 + wr64(bsh + offset, value); +#else panic("%s: not implemented", __func__); +#endif } /* @@ -460,8 +490,14 @@ void generic_bs_wm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, const uint64_t *addr, size_t count) { +#ifdef wr64 + bus_addr_t baddr = bsh + offset; + while (count--) + wr64(baddr, *addr++); +#else panic("%s: not implemented", __func__); +#endif } /* @@ -508,8 +544,16 @@ void generic_bs_wr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, const uint64_t *addr, size_t count) { +#ifdef wr64 + bus_addr_t baddr = bsh + offset; + while (count--) { + wr64(baddr, *addr++); + baddr += 8; + } +#else panic("%s: not implemented", __func__); +#endif } /* @@ -550,8 +594,14 @@ void generic_bs_sm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value, size_t count) { +#ifdef wr64 + bus_addr_t addr = bsh + offset; + while (count--) + wr64(addr, value); +#else panic("%s: not implemented", __func__); +#endif } /* @@ -592,8 +642,14 @@ void generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value, size_t count) { +#ifdef wr64 + bus_addr_t addr = bsh + offset; + for (; count != 0; count--, addr += 8) + wr64(addr, value); +#else panic("%s: not implemented", __func__); +#endif } /* @@ -664,8 +720,23 @@ void generic_bs_c_8(void *t, bus_space_handle_t bsh1, bus_size_t off1, bus_space_handle_t bsh2, bus_size_t off2, size_t count) { +#if defined(rd64) && defined(wr64) + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1 += 8, addr2 += 8) + wr64(addr2, rd64(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += 8 * (count - 1), addr2 += 8 * (count - 1); + count != 0; count--, addr1 -= 8, addr2 -= 8) + wr64(addr2, rd64(addr1)); + } +#else panic("%s: not implemented", __func__); +#endif } void From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 20:14:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 233D9BC4; Mon, 22 Apr 2013 20:14:58 +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 15B17125E; Mon, 22 Apr 2013 20:14: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 r3MKEvBX087586; Mon, 22 Apr 2013 20:14:57 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MKEvlQ087585; Mon, 22 Apr 2013 20:14:57 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304222014.r3MKEvlQ087585@svn.freebsd.org> From: Joel Dahl Date: Mon, 22 Apr 2013 20:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249778 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 20:14:58 -0000 Author: joel (doc committer) Date: Mon Apr 22 20:14:57 2013 New Revision: 249778 URL: http://svnweb.freebsd.org/changeset/base/249778 Log: Update description of process status output. PR: 143850 Submitted by: Slaven Rezic Modified: head/share/man/man5/procfs.5 Modified: head/share/man/man5/procfs.5 ============================================================================== --- head/share/man/man5/procfs.5 Mon Apr 22 19:38:56 2013 (r249777) +++ head/share/man/man5/procfs.5 Mon Apr 22 20:14:57 2013 (r249778) @@ -2,7 +2,7 @@ .\" Written by Garrett Wollman .\" This file is in the public domain. .\" -.Dd September 22, 2009 +.Dd April 22, 2013 .Dt PROCFS 5 .Os .Sh NAME @@ -155,9 +155,10 @@ process group id .It session id .It -.Ar major , Ns Ar minor +device name of the controlling terminal, or -.Dv -1,-1 +a minus sign +.Pq Dq - if there is no controlling terminal. .It a list of process flags: From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 21:03:45 2013 Return-Path: Delivered-To: svn-src-head@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 ED76C9D2; Mon, 22 Apr 2013 21:03:45 +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 DF73D1531; Mon, 22 Apr 2013 21:03: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 r3ML3j5j004329; Mon, 22 Apr 2013 21:03:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ML3j4e004322; Mon, 22 Apr 2013 21:03:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304222103.r3ML3j4e004322@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 21:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249779 - in head/usr.sbin/bsdconfig/share: . media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 21:03:46 -0000 Author: dteske Date: Mon Apr 22 21:03:44 2013 New Revision: 249779 URL: http://svnweb.freebsd.org/changeset/base/249779 Log: Fix "-D file" to automagically enable debugging if not explicitly disabled. Modified: head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 20:14:57 2013 (r249778) +++ head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 21:03:44 2013 (r249779) @@ -100,23 +100,21 @@ f_debug_init() # # Process stored command-line arguments # - ( set -- "$ARGV" - while getopts d flag > /dev/null; do - case "$flag" in - d) true; exit;; - \?) continue;; - esac - done - false - ) && debug=1 - debugFile=$( set -- "$ARGV" - while getopts D flag > /dev/null; do - case "$flag" in - D) echo "$OPTARG";; - \?) continue;; - esac - done - ) + set -- $ARGV + local OPTIND + while getopts dD: flag > /dev/null; do + case "$flag" in + d) debug=1;; + D) debugFile="$OPTARG";; + \?) continue;; + esac + done + shift $(( $OPTIND - 1 )) + + # + # Automagically enable debugging if debugFile is set (and non-NULL) + # + [ "$debugFile" ] && { [ "${debug+set}" ] || debug=1; } # # Make debugging persistant if set Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 20:14:57 2013 (r249778) +++ head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 21:03:44 2013 (r249779) @@ -111,6 +111,15 @@ f_media_options_menu() '$msg_emit_extra_debugging_output'" fi + f_getvar $VAR_NO_CONFIRM cp + if [ "$cp" ]; then menu_list="$menu_list + ' $msg_yes_to_all' 'YES' + '$msg_assume_yes_to_all_non_critical_dialogs'" + else menu_list="$menu_list + ' $msg_yes_to_all' 'NO' + '$msg_assume_yes_to_all_non_critical_dialogs'" + fi + f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then menu_list="$menu_list ' $msg_dhcp' 'YES' @@ -179,6 +188,11 @@ f_media_options_menu() ' $msg_media_timeout' '$cp' '$msg_timeout_value_in_seconds_for_slow_media'" + f_getvar $VAR_PKG_TMPDIR cp + menu_list="$menu_list + ' $msg_package_temp' '$cp' + '$msg_directory_where_package_temporary_files_go'" + menu_list="$menu_list ' $msg_rescan_devices' '<*>' '$msg_rerun_bsdconfig_initial_device_probe' @@ -260,6 +274,12 @@ f_media_options_menu() else export $VAR_DEBUG=1 fi ;; + " $msg_yes_to_all") + if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then + unset $VAR_NO_CONFIRM + else + export $VAR_NO_CONFIRM=1 + fi ;; " $msg_dhcp") f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then @@ -290,6 +310,10 @@ f_media_options_menu() f_variable_get_value $VAR_MEDIA_TIMEOUT \ "$msg_please_specify_the_number_of_seconds_to_wait" ;; + " $msg_package_temp") + f_variable_get_value $VAR_PKG_TMPDIR \ + "$msg_please_specify_a_temporary_directory" + ;; " $msg_rescan_devices") f_device_rescan ;; " $msg_use_defaults") Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Mon Apr 22 20:14:57 2013 (r249778) +++ head/usr.sbin/bsdconfig/share/script.subr Mon Apr 22 21:03:44 2013 (r249779) @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." script.subr f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/packages.subr f_include $BSDCFG_SHARE/variable.subr f_include $BSDCFG_SHARE/media/any.subr f_include $BSDCFG_SHARE/media/tcpip.subr @@ -151,26 +152,38 @@ f_script_load() # # Reserved words meant for scripting # -f_resword_new deviceRescan f_device_rescan + +f_resword_new loadConfig f_script_load # this file +f_resword_new deviceRescan f_device_rescan # device.subr + +# variable.subr +f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables -f_resword_new loadConfig f_script_load -f_resword_new mediaClose f_media_close -f_resword_new mediaGetType f_media_get_type + +# media/common.subr f_resword_new mediaOpen f_media_open -f_resword_new mediaSetCDROM f_media_set_cdrom -f_resword_new mediaSetDOS f_media_set_dos +f_resword_new mediaClose f_media_close + +f_resword_new mediaGetType f_media_get_type # media/any.subr +f_resword_new mediaSetCDROM f_media_set_cdrom # media/cdrom.subr +f_resword_new mediaSetDOS f_media_set_dos # media/dos.subr +f_resword_new mediaSetFloppy f_media_set_floppy # media/floppy.subr +f_resword_new mediaSetNFS f_media_set_nfs # media/nfs.subr + +# media/ftp.subr f_resword_new mediaSetFTP f_media_set_ftp f_resword_new mediaSetFTPActive f_media_set_ftp_active f_resword_new mediaSetFTPPassive f_media_set_ftp_passive f_resword_new mediaSetFTPUserPass f_media_set_ftp_userpass -f_resword_new mediaSetFloppy f_media_set_floppy + +# media/httpproxy.subr f_resword_new mediaSetHTTP f_media_set_http_proxy f_resword_new mediaSetHTTPProxy f_media_set_http_proxy -f_resword_new mediaSetNFS f_media_set_nfs -f_resword_new mediaSetUFS f_media_set_ufs -f_resword_new mediaSetUSB f_media_set_usb -f_resword_new optionsEditor f_media_options_menu -f_resword_new tcpMenuSelect f_dialog_menu_select_tcp + +f_resword_new mediaSetUFS f_media_set_ufs # media/ufs.subr +f_resword_new mediaSetUSB f_media_set_usb # media/usb.subr +f_resword_new optionsEditor f_media_options_menu # media/options.subr +f_resword_new tcpMenuSelect f_dialog_menu_select_tcp # media/tcp.subr f_dprintf "%s: Successfully loaded." script.subr Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Mon Apr 22 20:14:57 2013 (r249778) +++ head/usr.sbin/bsdconfig/share/variable.subr Mon Apr 22 21:03:44 2013 (r249779) @@ -117,6 +117,7 @@ f_variable_set_defaults() setvar $VAR_NFS_SECURE "NO" setvar $VAR_NFS_TCP "NO" setvar $VAR_NFS_V3 "YES" + setvar $VAR_PKG_TMPDIR "/var/tmp" setvar $VAR_RELNAME "$UNAME_R" f_dprintf "f_variable_set_defaults: Defaults initialized." @@ -224,8 +225,12 @@ f_variable_new VAR_NFS_SECURE nfs_reser f_variable_new VAR_NFS_TCP nfs_use_tcp f_variable_new VAR_NFS_V3 nfs_use_v3 f_variable_new VAR_NONINTERACTIVE nonInteractive +f_variable_new VAR_NO_CONFIRM noConfirm f_variable_new VAR_NO_ERROR noError f_variable_new VAR_NO_INET6 noInet6 +f_variable_new VAR_PACKAGE package +f_variable_new VAR_PKG_TMPDIR PKG_TMPDIR +f_variable_new VAR_PORTS_PATH ports f_variable_new VAR_RELNAME releaseName f_variable_new VAR_SLOW_ETHER slowEthernetCard f_variable_new VAR_TRY_DHCP tryDHCP From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 21:11:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 309C9C16; Mon, 22 Apr 2013 21:11:28 +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 12B0B15AC; Mon, 22 Apr 2013 21: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 r3MLBRg8007375; Mon, 22 Apr 2013 21:11:27 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MLBRJY007371; Mon, 22 Apr 2013 21:11:27 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304222111.r3MLBRJY007371@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249780 - in head/usr.sbin/bsdconfig/share: . media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 21:11:28 -0000 Author: dteske Date: Mon Apr 22 21:11:27 2013 New Revision: 249780 URL: http://svnweb.freebsd.org/changeset/base/249780 Log: Partially uncommit r249779. The changes to share/common.subr were good while the remaining changes were part of a much larger ``secret sauce'' involved in an up-coming commit that I'm still laboring on. Modified: head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 21:03:44 2013 (r249779) +++ head/usr.sbin/bsdconfig/share/media/options.subr Mon Apr 22 21:11:27 2013 (r249780) @@ -111,15 +111,6 @@ f_media_options_menu() '$msg_emit_extra_debugging_output'" fi - f_getvar $VAR_NO_CONFIRM cp - if [ "$cp" ]; then menu_list="$menu_list - ' $msg_yes_to_all' 'YES' - '$msg_assume_yes_to_all_non_critical_dialogs'" - else menu_list="$menu_list - ' $msg_yes_to_all' 'NO' - '$msg_assume_yes_to_all_non_critical_dialogs'" - fi - f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then menu_list="$menu_list ' $msg_dhcp' 'YES' @@ -188,11 +179,6 @@ f_media_options_menu() ' $msg_media_timeout' '$cp' '$msg_timeout_value_in_seconds_for_slow_media'" - f_getvar $VAR_PKG_TMPDIR cp - menu_list="$menu_list - ' $msg_package_temp' '$cp' - '$msg_directory_where_package_temporary_files_go'" - menu_list="$menu_list ' $msg_rescan_devices' '<*>' '$msg_rerun_bsdconfig_initial_device_probe' @@ -274,12 +260,6 @@ f_media_options_menu() else export $VAR_DEBUG=1 fi ;; - " $msg_yes_to_all") - if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then - unset $VAR_NO_CONFIRM - else - export $VAR_NO_CONFIRM=1 - fi ;; " $msg_dhcp") f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then @@ -310,10 +290,6 @@ f_media_options_menu() f_variable_get_value $VAR_MEDIA_TIMEOUT \ "$msg_please_specify_the_number_of_seconds_to_wait" ;; - " $msg_package_temp") - f_variable_get_value $VAR_PKG_TMPDIR \ - "$msg_please_specify_a_temporary_directory" - ;; " $msg_rescan_devices") f_device_rescan ;; " $msg_use_defaults") Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Mon Apr 22 21:03:44 2013 (r249779) +++ head/usr.sbin/bsdconfig/share/script.subr Mon Apr 22 21:11:27 2013 (r249780) @@ -32,7 +32,6 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." script.subr f_include $BSDCFG_SHARE/device.subr -f_include $BSDCFG_SHARE/packages.subr f_include $BSDCFG_SHARE/variable.subr f_include $BSDCFG_SHARE/media/any.subr f_include $BSDCFG_SHARE/media/tcpip.subr @@ -152,38 +151,26 @@ f_script_load() # # Reserved words meant for scripting # - -f_resword_new loadConfig f_script_load # this file -f_resword_new deviceRescan f_device_rescan # device.subr - -# variable.subr -f_resword_new installVarDefaults f_variable_set_defaults +f_resword_new deviceRescan f_device_rescan f_resword_new dumpVariables f_dump_variables - -# media/common.subr -f_resword_new mediaOpen f_media_open +f_resword_new loadConfig f_script_load f_resword_new mediaClose f_media_close - -f_resword_new mediaGetType f_media_get_type # media/any.subr -f_resword_new mediaSetCDROM f_media_set_cdrom # media/cdrom.subr -f_resword_new mediaSetDOS f_media_set_dos # media/dos.subr -f_resword_new mediaSetFloppy f_media_set_floppy # media/floppy.subr -f_resword_new mediaSetNFS f_media_set_nfs # media/nfs.subr - -# media/ftp.subr +f_resword_new mediaGetType f_media_get_type +f_resword_new mediaOpen f_media_open +f_resword_new mediaSetCDROM f_media_set_cdrom +f_resword_new mediaSetDOS f_media_set_dos f_resword_new mediaSetFTP f_media_set_ftp f_resword_new mediaSetFTPActive f_media_set_ftp_active f_resword_new mediaSetFTPPassive f_media_set_ftp_passive f_resword_new mediaSetFTPUserPass f_media_set_ftp_userpass - -# media/httpproxy.subr +f_resword_new mediaSetFloppy f_media_set_floppy f_resword_new mediaSetHTTP f_media_set_http_proxy f_resword_new mediaSetHTTPProxy f_media_set_http_proxy - -f_resword_new mediaSetUFS f_media_set_ufs # media/ufs.subr -f_resword_new mediaSetUSB f_media_set_usb # media/usb.subr -f_resword_new optionsEditor f_media_options_menu # media/options.subr -f_resword_new tcpMenuSelect f_dialog_menu_select_tcp # media/tcp.subr +f_resword_new mediaSetNFS f_media_set_nfs +f_resword_new mediaSetUFS f_media_set_ufs +f_resword_new mediaSetUSB f_media_set_usb +f_resword_new optionsEditor f_media_options_menu +f_resword_new tcpMenuSelect f_dialog_menu_select_tcp f_dprintf "%s: Successfully loaded." script.subr Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Mon Apr 22 21:03:44 2013 (r249779) +++ head/usr.sbin/bsdconfig/share/variable.subr Mon Apr 22 21:11:27 2013 (r249780) @@ -117,7 +117,6 @@ f_variable_set_defaults() setvar $VAR_NFS_SECURE "NO" setvar $VAR_NFS_TCP "NO" setvar $VAR_NFS_V3 "YES" - setvar $VAR_PKG_TMPDIR "/var/tmp" setvar $VAR_RELNAME "$UNAME_R" f_dprintf "f_variable_set_defaults: Defaults initialized." @@ -225,12 +224,8 @@ f_variable_new VAR_NFS_SECURE nfs_reser f_variable_new VAR_NFS_TCP nfs_use_tcp f_variable_new VAR_NFS_V3 nfs_use_v3 f_variable_new VAR_NONINTERACTIVE nonInteractive -f_variable_new VAR_NO_CONFIRM noConfirm f_variable_new VAR_NO_ERROR noError f_variable_new VAR_NO_INET6 noInet6 -f_variable_new VAR_PACKAGE package -f_variable_new VAR_PKG_TMPDIR PKG_TMPDIR -f_variable_new VAR_PORTS_PATH ports f_variable_new VAR_RELNAME releaseName f_variable_new VAR_SLOW_ETHER slowEthernetCard f_variable_new VAR_TRY_DHCP tryDHCP From owner-svn-src-head@FreeBSD.ORG Mon Apr 22 21:19:45 2013 Return-Path: Delivered-To: svn-src-head@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 42075F30; Mon, 22 Apr 2013 21:19:45 +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 34D8D1605; Mon, 22 Apr 2013 21:19: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 r3MLJjOm008836; Mon, 22 Apr 2013 21:19:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3MLJjcb008835; Mon, 22 Apr 2013 21:19:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304222119.r3MLJjcb008835@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Apr 2013 21:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249781 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 21:19:45 -0000 Author: dteske Date: Mon Apr 22 21:19:44 2013 New Revision: 249781 URL: http://svnweb.freebsd.org/changeset/base/249781 Log: Preserve debugFile preference across the exec boundary. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 21:11:27 2013 (r249780) +++ head/usr.sbin/bsdconfig/share/common.subr Mon Apr 22 21:19:44 2013 (r249781) @@ -120,6 +120,7 @@ f_debug_init() # Make debugging persistant if set # [ "$debug" ] && export debug + [ "$debugFile" ] && export debugFile # # Truncate the debug file upon. Note that we will trim a leading plus From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 00:10:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8578CC99; Tue, 23 Apr 2013 00:10:34 +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 7881E1EEE; Tue, 23 Apr 2013 00:10: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 r3N0AYZi064958; Tue, 23 Apr 2013 00:10:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N0AYEn064957; Tue, 23 Apr 2013 00:10:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304230010.r3N0AYEn064957@svn.freebsd.org> From: Devin Teske Date: Tue, 23 Apr 2013 00:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249783 - head/usr.sbin/bsdconfig/networking X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 00:10:34 -0000 Author: dteske Date: Tue Apr 23 00:10:33 2013 New Revision: 249783 URL: http://svnweb.freebsd.org/changeset/base/249783 Log: Prevent device.subr from auto-loading in the nameservers module. This module doesn't need device support (but device.subr is loaded indirectly through media/tcpip.subr which contains resolv stuff). Modified: head/usr.sbin/bsdconfig/networking/nameservers Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Mon Apr 22 23:59:00 2013 (r249782) +++ head/usr.sbin/bsdconfig/networking/nameservers Tue Apr 23 00:10:33 2013 (r249783) @@ -28,6 +28,9 @@ # ############################################################ INCLUDES +# Prevent device.subr (included indirectly) from auto scanning on load +DEVICE_SELF_SCAN_ALL=NO + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 06:26:54 2013 Return-Path: Delivered-To: svn-src-head@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 95E4787B; Tue, 23 Apr 2013 06:26:54 +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 870F51ADB; Tue, 23 Apr 2013 06:26: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 r3N6QssF084264; Tue, 23 Apr 2013 06:26:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N6QsWp084263; Tue, 23 Apr 2013 06:26:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304230626.r3N6QsWp084263@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 23 Apr 2013 06:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249786 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 06:26:54 -0000 Author: hselasky Date: Tue Apr 23 06:26:54 2013 New Revision: 249786 URL: http://svnweb.freebsd.org/changeset/base/249786 Log: Add descriptive comment. Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Apr 23 01:09:22 2013 (r249785) +++ head/sys/dev/usb/controller/xhci.c Tue Apr 23 06:26:54 2013 (r249786) @@ -554,6 +554,12 @@ xhci_init(struct xhci_softc *sc, device_ void xhci_uninit(struct xhci_softc *sc) { + /* + * NOTE: At this point the control transfer process is gone + * and "xhci_configure_msg" is no longer called. Consequently + * waiting for the configuration messages to complete is not + * needed. + */ usb_bus_mem_free_all(&sc->sc_bus, &xhci_iterate_hw_softc); cv_destroy(&sc->sc_cmd_cv); From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 06:28:36 2013 Return-Path: Delivered-To: svn-src-head@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 0E9FEA0E; Tue, 23 Apr 2013 06:28:36 +0000 (UTC) (envelope-from mm@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 F3B541AE7; Tue, 23 Apr 2013 06:28: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 r3N6SZaS084555; Tue, 23 Apr 2013 06:28:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N6SZcZ084553; Tue, 23 Apr 2013 06:28:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304230628.r3N6SZcZ084553@svn.freebsd.org> From: Martin Matuska Date: Tue, 23 Apr 2013 06:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249787 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 06:28:36 -0000 Author: mm Date: Tue Apr 23 06:28:35 2013 New Revision: 249787 URL: http://svnweb.freebsd.org/changeset/base/249787 Log: The zfs synctask code restructuring introduced a new bug that makes it impossible to set quota and reservation on pools lower than version 22. Problem has been reported and a solution discussed with vendor. Illumos ZFS issues: 3739 cannot set zfs quota or reservation on pool version < 22 Reviewed by: Matthew Ahrens Reported by: Steve Wills MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Apr 23 06:26:54 2013 (r249786) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Apr 23 06:28:35 2013 (r249787) @@ -972,12 +972,18 @@ dsl_dir_set_quota_sync(void *arg, dmu_tx VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds)); - dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA), - ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, - &ddsqra->ddsqra_value, tx); + if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) { + dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA), + ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, + &ddsqra->ddsqra_value, tx); - VERIFY0(dsl_prop_get_int_ds(ds, - zfs_prop_to_name(ZFS_PROP_QUOTA), &newval)); + VERIFY0(dsl_prop_get_int_ds(ds, + zfs_prop_to_name(ZFS_PROP_QUOTA), &newval)); + } else { + newval = ddsqra->ddsqra_value; + spa_history_log_internal_ds(ds, "set", tx, "%s=%lld", + zfs_prop_to_name(ZFS_PROP_QUOTA), (longlong_t)newval); + } dmu_buf_will_dirty(ds->ds_dir->dd_dbuf, tx); mutex_enter(&ds->ds_dir->dd_lock); @@ -1087,12 +1093,20 @@ dsl_dir_set_reservation_sync(void *arg, VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds)); - dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_RESERVATION), - ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, - &ddsqra->ddsqra_value, tx); + if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) { + dsl_prop_set_sync_impl(ds, + zfs_prop_to_name(ZFS_PROP_RESERVATION), + ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, + &ddsqra->ddsqra_value, tx); - VERIFY0(dsl_prop_get_int_ds(ds, - zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval)); + VERIFY0(dsl_prop_get_int_ds(ds, + zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval)); + } else { + newval = ddsqra->ddsqra_value; + spa_history_log_internal_ds(ds, "set", tx, "%s=%lld", + zfs_prop_to_name(ZFS_PROP_RESERVATION), + (longlong_t)newval); + } dsl_dir_set_reservation_sync_impl(ds->ds_dir, newval, tx); dsl_dataset_rele(ds, FTAG); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Tue Apr 23 06:26:54 2013 (r249786) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Tue Apr 23 06:28:35 2013 (r249787) @@ -557,10 +557,6 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds } if (version < SPA_VERSION_RECVD_PROPS) { - zfs_prop_t prop = zfs_name_to_prop(propname); - if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION) - return; - if (source & ZPROP_SRC_NONE) source = ZPROP_SRC_NONE; else if (source & ZPROP_SRC_RECEIVED) From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 06:37:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7684180; Tue, 23 Apr 2013 06:37:51 +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 693701B26; Tue, 23 Apr 2013 06:37: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 r3N6bpSD087867; Tue, 23 Apr 2013 06:37:51 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N6bp47087866; Tue, 23 Apr 2013 06:37:51 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304230637.r3N6bp47087866@svn.freebsd.org> From: Kirk McKusick Date: Tue, 23 Apr 2013 06:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249789 - head/sbin/tunefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 06:37:51 -0000 Author: mckusick Date: Tue Apr 23 06:37:50 2013 New Revision: 249789 URL: http://svnweb.freebsd.org/changeset/base/249789 Log: Fix error check. Submitted by: Andrey Chernov (ache@) MFC after: 3 days Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Tue Apr 23 06:28:49 2013 (r249788) +++ head/sbin/tunefs/tunefs.c Tue Apr 23 06:37:50 2013 (r249789) @@ -174,7 +174,7 @@ main(int argc, char *argv[]) found_arg = 1; name = "space to hold for metadata blocks"; kvalue = atoi(optarg); - if (mvalue < 0) + if (kvalue < 0) errx(10, "bad %s (%s)", name, optarg); kflag = 1; break; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 09:38:19 2013 Return-Path: Delivered-To: svn-src-head@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 C1D6B124; Tue, 23 Apr 2013 09:38:19 +0000 (UTC) (envelope-from imp@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 B309B12B2; Tue, 23 Apr 2013 09:38: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 r3N9cJ2s047966; Tue, 23 Apr 2013 09:38:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N9cIV0047961; Tue, 23 Apr 2013 09:38:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304230938.r3N9cIV0047961@svn.freebsd.org> From: Warner Losh Date: Tue, 23 Apr 2013 09:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249790 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 09:38:19 -0000 Author: imp Date: Tue Apr 23 09:38:18 2013 New Revision: 249790 URL: http://svnweb.freebsd.org/changeset/base/249790 Log: Update trapframe to be consistent with the changes made to regnum.h. This should fix the booting problems people have been seeing. Modified: head/sys/mips/include/frame.h head/sys/mips/include/regnum.h head/sys/mips/mips/db_interface.c head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/frame.h ============================================================================== --- head/sys/mips/include/frame.h Tue Apr 23 06:37:50 2013 (r249789) +++ head/sys/mips/include/frame.h Tue Apr 23 09:38:18 2013 (r249790) @@ -37,6 +37,8 @@ #ifndef _MACHINE_FRAME_H_ #define _MACHINE_FRAME_H_ +/* Note: This must also match regnum.h and regdef.h */ + struct trapframe { register_t zero; register_t ast; @@ -46,6 +48,16 @@ struct trapframe { register_t a1; register_t a2; register_t a3; +#if defined(__mips_n32) || defined(__mips_n64) + register_t a4; + register_t a5; + register_t a6; + register_t a7; + register_t t0; + register_t t1; + register_t t2; + register_t t3; +#else register_t t0; register_t t1; register_t t2; @@ -54,6 +66,7 @@ struct trapframe { register_t t5; register_t t6; register_t t7; +#endif register_t s0; register_t s1; register_t s2; Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Tue Apr 23 06:37:50 2013 (r249789) +++ head/sys/mips/include/regnum.h Tue Apr 23 09:38:18 2013 (r249790) @@ -87,10 +87,10 @@ #define T1 9 #define T2 10 #define T3 11 -#define TA0 12 -#define TA1 13 -#define TA2 14 -#define TA3 15 +#define T4 12 +#define T5 13 +#define T6 14 +#define T7 15 #endif #define S0 16 #define S1 17 Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Tue Apr 23 06:37:50 2013 (r249789) +++ head/sys/mips/mips/db_interface.c Tue Apr 23 09:38:18 2013 (r249790) @@ -77,6 +77,16 @@ struct db_variable db_regs[] = { { "a1", DB_OFFSET(a1), db_frame }, { "a2", DB_OFFSET(a2), db_frame }, { "a3", DB_OFFSET(a3), db_frame }, +#if defined(__mips_n32) || defined(__mips_n64) + { "a4", DB_OFFSET(a4), db_frame }, + { "a5", DB_OFFSET(a5), db_frame }, + { "a6", DB_OFFSET(a6), db_frame }, + { "a7", DB_OFFSET(a7), db_frame }, + { "t0", DB_OFFSET(t0), db_frame }, + { "t1", DB_OFFSET(t1), db_frame }, + { "t2", DB_OFFSET(t2), db_frame }, + { "t3", DB_OFFSET(t3), db_frame }, +#else { "t0", DB_OFFSET(t0), db_frame }, { "t1", DB_OFFSET(t1), db_frame }, { "t2", DB_OFFSET(t2), db_frame }, @@ -85,6 +95,7 @@ struct db_variable db_regs[] = { { "t5", DB_OFFSET(t5), db_frame }, { "t6", DB_OFFSET(t6), db_frame }, { "t7", DB_OFFSET(t7), db_frame }, +#endif { "s0", DB_OFFSET(s0), db_frame }, { "s1", DB_OFFSET(s1), db_frame }, { "s2", DB_OFFSET(s2), db_frame }, Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 23 06:37:50 2013 (r249789) +++ head/sys/mips/mips/trap.c Tue Apr 23 09:38:18 2013 (r249790) @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[3] = locr0->t4; - sa->args[4] = locr0->t5; - sa->args[5] = locr0->t6; - sa->args[6] = locr0->t7; + sa->args[3] = locr0->t0; + sa->args[4] = locr0->t1; + sa->args[5] = locr0->t2; + sa->args[6] = locr0->t3; nsaved += 4; #ifdef COMPAT_FREEBSD32 } @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[4] = locr0->t4; - sa->args[5] = locr0->t5; - sa->args[6] = locr0->t6; - sa->args[7] = locr0->t7; + sa->args[4] = locr0->t0; + sa->args[5] = locr0->t1; + sa->args[6] = locr0->t2; + sa->args[7] = locr0->t3; nsaved += 4; #ifdef COMPAT_FREEBSD32 } @@ -1294,12 +1294,19 @@ log_frame_dump(struct trapframe *frame) log(LOG_ERR, "\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2, (intmax_t)frame->a3); +#if defined(__mips_n32) || defined(__mips_n64) + log(LOG_ERR, "\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta6: %#jx\n", + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6, (intmax_t)frame->a7); + + log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); +#else log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); log(LOG_ERR, "\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6, (intmax_t)frame->t7); - +#endif log(LOG_ERR, "\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0, (intmax_t)frame->s1); @@ -1334,13 +1341,19 @@ trap_frame_dump(struct trapframe *frame) printf("\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2, (intmax_t)frame->a3); +#if defined(__mips_n32) || defined(__mips_n64) + printf("\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta7: %#jx\n", + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6, (intmax_t)frame->a7); printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); +#else + printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); printf("\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6, (intmax_t)frame->t7); - +#endif printf("\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0, (intmax_t)frame->s1); Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Apr 23 06:37:50 2013 (r249789) +++ head/sys/mips/mips/vm_machdep.c Tue Apr 23 09:38:18 2013 (r249790) @@ -613,6 +613,16 @@ dump_trapframe(struct trapframe *trapfra DB_PRINT_REG(trapframe, a1); DB_PRINT_REG(trapframe, a2); DB_PRINT_REG(trapframe, a3); +#if defined(__mips_n32) || defined(__mips_n64) + DB_PRINT_REG(trapframe, a4); + DB_PRINT_REG(trapframe, a5); + DB_PRINT_REG(trapframe, a6); + DB_PRINT_REG(trapframe, a7); + DB_PRINT_REG(trapframe, t0); + DB_PRINT_REG(trapframe, t1); + DB_PRINT_REG(trapframe, t2); + DB_PRINT_REG(trapframe, t3); +#else DB_PRINT_REG(trapframe, t0); DB_PRINT_REG(trapframe, t1); DB_PRINT_REG(trapframe, t2); @@ -621,6 +631,7 @@ dump_trapframe(struct trapframe *trapfra DB_PRINT_REG(trapframe, t5); DB_PRINT_REG(trapframe, t6); DB_PRINT_REG(trapframe, t7); +#endif DB_PRINT_REG(trapframe, s0); DB_PRINT_REG(trapframe, s1); DB_PRINT_REG(trapframe, s2); From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 09:40:42 2013 Return-Path: Delivered-To: svn-src-head@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 A56DD328; Tue, 23 Apr 2013 09:40:42 +0000 (UTC) (envelope-from imp@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 9963F12D0; Tue, 23 Apr 2013 09:40: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 r3N9egYm049772; Tue, 23 Apr 2013 09:40:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3N9egVR049771; Tue, 23 Apr 2013 09:40:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304230940.r3N9egVR049771@svn.freebsd.org> From: Warner Losh Date: Tue, 23 Apr 2013 09:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249791 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 09:40:42 -0000 Author: imp Date: Tue Apr 23 09:40:42 2013 New Revision: 249791 URL: http://svnweb.freebsd.org/changeset/base/249791 Log: Add an option for the GE FES based packet engines. Its board IDs overlap with the standard ones, so kernels for this family of boards need the option OCTEON_VENDOR_GEFES. Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Tue Apr 23 09:38:18 2013 (r249790) +++ head/sys/conf/options.mips Tue Apr 23 09:40:42 2013 (r249791) @@ -75,6 +75,7 @@ OCTEON_MODEL opt_cvmx.h OCTEON_VENDOR_LANNER opt_cvmx.h OCTEON_VENDOR_UBIQUITI opt_cvmx.h OCTEON_VENDOR_RADISYS opt_cvmx.h +OCTEON_VENDOR_GEFES opt_cvmx.h OCTEON_BOARD_CAPK_0100ND opt_cvmx.h # From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 10:42:16 2013 Return-Path: Delivered-To: svn-src-head@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 7F975EE8; Tue, 23 Apr 2013 10:42:16 +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 582421638; Tue, 23 Apr 2013 10:42: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 r3NAgGko071521; Tue, 23 Apr 2013 10:42:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NAgGnT071516; Tue, 23 Apr 2013 10:42:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304231042.r3NAgGnT071516@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 23 Apr 2013 10:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249795 - in 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 10:42:16 -0000 Author: hselasky Date: Tue Apr 23 10:42:15 2013 New Revision: 249795 URL: http://svnweb.freebsd.org/changeset/base/249795 Log: Add convenience wrapper functions to run callbacks in the context of the USB explore thread. Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_process.h Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Tue Apr 23 10:30:47 2013 (r249794) +++ head/sys/dev/usb/controller/usb_controller.c Tue Apr 23 10:42:15 2013 (r249795) @@ -901,3 +901,28 @@ usb_bus_mem_free_all(struct usb_bus *bus mtx_destroy(&bus->bus_mtx); } + +/* convenience wrappers */ +void +usb_proc_explore_mwait(struct usb_device *udev, void *pm1, void *pm2) +{ + usb_proc_mwait(USB_BUS_EXPLORE_PROC(udev->bus), pm1, pm2); +} + +void * +usb_proc_explore_msignal(struct usb_device *udev, void *pm1, void *pm2) +{ + return (usb_proc_msignal(USB_BUS_EXPLORE_PROC(udev->bus), pm1, pm2)); +} + +void +usb_proc_explore_lock(struct usb_device *udev) +{ + USB_BUS_LOCK(udev->bus); +} + +void +usb_proc_explore_unlock(struct usb_device *udev) +{ + USB_BUS_UNLOCK(udev->bus); +} Modified: head/sys/dev/usb/usb_process.h ============================================================================== --- head/sys/dev/usb/usb_process.h Tue Apr 23 10:30:47 2013 (r249794) +++ head/sys/dev/usb/usb_process.h Tue Apr 23 10:42:15 2013 (r249795) @@ -44,6 +44,7 @@ /* structure prototypes */ struct usb_proc_msg; +struct usb_device; /* * The following structure defines the USB process. @@ -81,4 +82,9 @@ void usb_proc_free(struct usb_process *u void *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1); void usb_proc_rewakeup(struct usb_process *up); +void usb_proc_explore_mwait(struct usb_device *, void *, void *); +void *usb_proc_explore_msignal(struct usb_device *, void *, void *); +void usb_proc_explore_lock(struct usb_device *); +void usb_proc_explore_unlock(struct usb_device *); + #endif /* _USB_PROCESS_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 10:48:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22CBF294; Tue, 23 Apr 2013 10:48:15 +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 058011670; Tue, 23 Apr 2013 10:48: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 r3NAmFVc073546; Tue, 23 Apr 2013 10:48:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NAmEBx073545; Tue, 23 Apr 2013 10:48:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304231048.r3NAmEBx073545@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 23 Apr 2013 10:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249796 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 10:48:15 -0000 Author: hselasky Date: Tue Apr 23 10:48:14 2013 New Revision: 249796 URL: http://svnweb.freebsd.org/changeset/base/249796 Log: Add support for runtime switching of sample rate for USB audio devices. Previously the highest sample rate was unconditionally selected. Requested by: Craig Leres Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Apr 23 10:42:15 2013 (r249795) +++ head/sys/dev/sound/usb/uaudio.c Tue Apr 23 10:48:14 2013 (r249796) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uaudio_debug #include @@ -176,19 +177,34 @@ struct uaudio_mixer_node { struct uaudio_mixer_node *next; }; +struct uaudio_configure_msg { + struct usb_proc_msg hdr; + struct uaudio_softc *sc; +}; + +#define CHAN_MAX_ALT 20 + +struct uaudio_chan_alt { + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; + const usb_endpoint_descriptor_audio_t *p_ed1; + const struct uaudio_format *p_fmt; + const struct usb_config *usb_cfg; + uint32_t sample_rate; /* in Hz */ + uint16_t sample_size; + uint8_t iface_index; + uint8_t iface_alt_index; + uint8_t channels; +}; + struct uaudio_chan { struct pcmchan_caps pcm_cap; /* capabilities */ - + struct uaudio_chan_alt usb_alt[CHAN_MAX_ALT]; struct snd_dbuf *pcm_buf; - const struct usb_config *usb_cfg; struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; - union uaudio_asf1d p_asf1d; - union uaudio_sed p_sed; - const usb_endpoint_descriptor_audio_t *p_ed1; - const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ uint8_t *start; /* upper layer buffer start */ @@ -196,24 +212,24 @@ struct uaudio_chan { uint8_t *cur; /* current position in upper layer * buffer */ - uint32_t intr_size; /* in bytes */ uint32_t intr_frames; /* in units */ - uint32_t sample_rate; uint32_t frames_per_second; uint32_t sample_rem; uint32_t sample_curr; + uint32_t max_buf; - uint32_t format; uint32_t pcm_format[2]; uint16_t bytes_per_frame[2]; - uint16_t sample_size; - - uint8_t valid; - uint8_t iface_index; - uint8_t iface_alt_index; - uint8_t channels; + uint8_t num_alt; + uint8_t cur_alt; + uint8_t set_alt; + uint8_t operation; +#define CHAN_OP_NONE 0 +#define CHAN_OP_START 1 +#define CHAN_OP_STOP 2 +#define CHAN_OP_DRAIN 3 uint8_t last_sync_time; uint8_t last_sync_state; @@ -309,6 +325,7 @@ struct uaudio_softc { struct uaudio_hid sc_hid; struct uaudio_search_result sc_mixer_clocks; struct uaudio_mixer_node sc_mixer_node; + struct uaudio_configure_msg sc_config_msg[2]; struct mtx *sc_mixer_lock; struct snd_mixer *sc_mixer_dev; @@ -434,6 +451,8 @@ static usb_callback_t umidi_bulk_read_ca static usb_callback_t umidi_bulk_write_callback; static usb_callback_t uaudio_hid_rx_callback; +static usb_proc_callback_t uaudio_configure_msg; + /* ==== USB mixer ==== */ static int uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS); @@ -856,6 +875,10 @@ uaudio_attach(device_t dev) sc->sc_udev = uaa->device; sc->sc_mixer_iface_index = uaa->info.bIfaceIndex; sc->sc_mixer_iface_no = uaa->info.bIfaceNum; + sc->sc_config_msg[0].hdr.pm_callback = &uaudio_configure_msg; + sc->sc_config_msg[0].sc = sc; + sc->sc_config_msg[1].hdr.pm_callback = &uaudio_configure_msg; + sc->sc_config_msg[1].sc = sc; if (usb_test_quirk(uaa, UQ_AUDIO_SWAP_LR)) sc->sc_uq_audio_swap_lr = 1; @@ -900,22 +923,28 @@ uaudio_attach(device_t dev) DPRINTF("%d mixer controls\n", sc->sc_mixer_count); - if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format, " - "2x8ms buffer.\n", - sc->sc_play_chan.sample_rate, - sc->sc_play_chan.channels, - sc->sc_play_chan.p_fmt->description); + if (sc->sc_play_chan.num_alt > 0) { + uint8_t x; + for (x = 0; x != sc->sc_play_chan.num_alt; x++) { + device_printf(dev, "Play: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", + sc->sc_play_chan.usb_alt[x].sample_rate, + sc->sc_play_chan.usb_alt[x].channels, + sc->sc_play_chan.usb_alt[x].p_fmt->description); + } } else { device_printf(dev, "No playback.\n"); } - if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format, " - "2x8ms buffer.\n", - sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.channels, - sc->sc_rec_chan.p_fmt->description); + if (sc->sc_rec_chan.num_alt > 0) { + uint8_t x; + for (x = 0; x != sc->sc_rec_chan.num_alt; x++) { + device_printf(dev, "Record: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", + sc->sc_rec_chan.usb_alt[x].sample_rate, + sc->sc_rec_chan.usb_alt[x].channels, + sc->sc_rec_chan.usb_alt[x].p_fmt->description); + } } else { device_printf(dev, "No recording.\n"); } @@ -950,8 +979,8 @@ uaudio_attach(device_t dev) * Only attach a PCM device if we have a playback, recording * or mixer device present: */ - if (sc->sc_play_chan.valid || - sc->sc_rec_chan.valid || + if (sc->sc_play_chan.num_alt > 0 || + sc->sc_rec_chan.num_alt > 0 || sc->sc_mix_info) { child = device_add_child(dev, "pcm", -1); @@ -1020,18 +1049,18 @@ uaudio_attach_sub(device_t dev, kobj_cla snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); if (pcm_register(dev, sc, - sc->sc_play_chan.valid ? 1 : 0, - sc->sc_rec_chan.valid ? 1 : 0)) { + (sc->sc_play_chan.num_alt > 0) ? 1 : 0, + (sc->sc_rec_chan.num_alt > 0) ? 1 : 0)) { goto detach; } uaudio_pcm_setflags(dev, SD_F_MPSAFE); sc->sc_pcm_registered = 1; - if (sc->sc_play_chan.valid) { + if (sc->sc_play_chan.num_alt > 0) { pcm_addchan(dev, PCMDIR_PLAY, chan_class, sc); } - if (sc->sc_rec_chan.valid) { + if (sc->sc_rec_chan.num_alt > 0) { pcm_addchan(dev, PCMDIR_REC, chan_class, sc); } pcm_setstatus(dev, status); @@ -1078,10 +1107,15 @@ uaudio_detach(device_t dev) * will time out and close opened /dev/dspX.Y device(s), if * any. */ - if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); - if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); + usb_proc_explore_lock(sc->sc_udev); + sc->sc_play_chan.operation = CHAN_OP_DRAIN; + sc->sc_rec_chan.operation = CHAN_OP_DRAIN; + usb_proc_explore_mwait(sc->sc_udev, + &sc->sc_config_msg[0], &sc->sc_config_msg[1]); + usb_proc_explore_unlock(sc->sc_udev); + + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); uaudio_hid_detach(sc); @@ -1100,6 +1134,201 @@ uaudio_detach(device_t dev) return (0); } +static uint32_t +uaudio_get_buffer_size(struct uaudio_chan *ch, uint8_t alt) +{ + struct uaudio_chan_alt *chan_alt = &ch->usb_alt[alt]; + /* We use 2 times 8ms of buffer */ + uint32_t buf_size = (((chan_alt->sample_rate * (UAUDIO_NFRAMES / 8)) + + 1000 - 1) / 1000) * chan_alt->sample_size; + return (buf_size); +} + +static void +uaudio_configure_msg_sub(struct uaudio_softc *sc, + struct uaudio_chan *chan, int dir) +{ + struct uaudio_chan_alt *chan_alt; + uint32_t frames; + uint32_t buf_size; + uint16_t fps; + uint8_t set_alt; + uint8_t fps_shift; + uint8_t operation; + usb_error_t err; + + if (chan->num_alt <= 0) + return; + + DPRINTF("\n"); + + usb_proc_explore_lock(sc->sc_udev); + operation = chan->operation; + chan->operation = CHAN_OP_NONE; + usb_proc_explore_unlock(sc->sc_udev); + + mtx_lock(chan->pcm_mtx); + if (chan->cur_alt != chan->set_alt) + set_alt = chan->set_alt; + else + set_alt = CHAN_MAX_ALT; + mtx_unlock(chan->pcm_mtx); + + if (set_alt >= chan->num_alt) + goto done; + + chan_alt = chan->usb_alt + set_alt; + + usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); + + err = usbd_set_alt_interface_index(sc->sc_udev, + chan_alt->iface_index, chan_alt->iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + goto error; + } + + /* + * Only set the sample rate if the channel reports that it + * supports the frequency control. + */ + + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + unsigned int x; + + for (x = 0; x != 256; x++) { + if (dir == PCMDIR_PLAY) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + if (uaudio20_set_speed(sc->sc_udev, + sc->sc_mixer_iface_no, x, chan_alt->sample_rate)) { + /* + * If the endpoint is adaptive setting + * the speed may fail. + */ + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); + } + } + } else if (chan_alt->p_sed.v1->bmAttributes & UA_SED_FREQ_CONTROL) { + if (uaudio_set_speed(sc->sc_udev, + chan_alt->p_ed1->bEndpointAddress, chan_alt->sample_rate)) { + /* + * If the endpoint is adaptive setting the + * speed may fail. + */ + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); + } + } + if (usbd_transfer_setup(sc->sc_udev, &chan_alt->iface_index, chan->xfer, + chan_alt->usb_cfg, UAUDIO_NCHANBUFS + 1, chan, chan->pcm_mtx)) { + DPRINTF("could not allocate USB transfers!\n"); + goto error; + } + + fps = usbd_get_isoc_fps(sc->sc_udev); + + if (fps < 8000) { + /* FULL speed USB */ + frames = 8; + } else { + /* HIGH speed USB */ + frames = UAUDIO_NFRAMES; + } + + fps_shift = usbd_xfer_get_fps_shift(chan->xfer[0]); + + /* down shift number of frames per second, if any */ + fps >>= fps_shift; + frames >>= fps_shift; + + /* bytes per frame should not be zero */ + chan->bytes_per_frame[0] = + ((chan_alt->sample_rate / fps) * chan_alt->sample_size); + chan->bytes_per_frame[1] = + (((chan_alt->sample_rate + fps - 1) / fps) * chan_alt->sample_size); + + /* setup data rate dithering, if any */ + chan->frames_per_second = fps; + chan->sample_rem = chan_alt->sample_rate % fps; + chan->sample_curr = 0; + chan->frames_per_second = fps; + + /* compute required buffer size */ + buf_size = (chan->bytes_per_frame[1] * frames); + + if (buf_size > (chan->end - chan->start)) { + DPRINTF("buffer size is too big\n"); + goto error; + } + + chan->intr_frames = frames; + + DPRINTF("fps=%d sample_rem=%d\n", (int)fps, (int)chan->sample_rem); + + if (chan->intr_frames == 0) { + DPRINTF("frame shift is too high!\n"); + goto error; + } + + mtx_lock(chan->pcm_mtx); + chan->cur_alt = set_alt; + mtx_unlock(chan->pcm_mtx); + +done: +#if (UAUDIO_NCHANBUFS != 2) +#error "please update code" +#endif + switch (operation) { + case CHAN_OP_START: + mtx_lock(chan->pcm_mtx); + usbd_transfer_start(chan->xfer[0]); + usbd_transfer_start(chan->xfer[1]); + mtx_unlock(chan->pcm_mtx); + break; + case CHAN_OP_STOP: + mtx_lock(chan->pcm_mtx); + usbd_transfer_stop(chan->xfer[0]); + usbd_transfer_stop(chan->xfer[1]); + mtx_unlock(chan->pcm_mtx); + break; + default: + break; + } + return; + +error: + usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); + + mtx_lock(chan->pcm_mtx); + chan->cur_alt = CHAN_MAX_ALT; + mtx_unlock(chan->pcm_mtx); +} + +static void +uaudio_configure_msg(struct usb_proc_msg *pm) +{ + struct uaudio_softc *sc = ((struct uaudio_configure_msg *)pm)->sc; + + usb_proc_explore_unlock(sc->sc_udev); + uaudio_configure_msg_sub(sc, &sc->sc_play_chan, PCMDIR_PLAY); + uaudio_configure_msg_sub(sc, &sc->sc_rec_chan, PCMDIR_REC); + usb_proc_explore_lock(sc->sc_udev); +} + /*========================================================================* * AS - Audio Stream - routines *========================================================================*/ @@ -1237,6 +1466,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ struct usb_interface_descriptor *id; const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; + struct uaudio_chan_alt *chan_alt; + uint32_t format; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; @@ -1508,14 +1739,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan = (ep_dir == UE_DIR_IN) ? &sc->sc_rec_chan : &sc->sc_play_chan; - if (chan->valid != 0 || - usbd_get_iface(udev, curidx) == NULL) { - DPRINTF("Channel already exists or " - "interface is not valid\n"); + if (usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Interface is not valid\n"); + goto next_ep; + } + if (chan->num_alt == CHAN_MAX_ALT) { + DPRINTF("Too many alternate settings\n"); goto next_ep; } + chan->set_alt = 0; + chan->cur_alt = CHAN_MAX_ALT; + + chan_alt = &chan->usb_alt[chan->num_alt++]; - chan->valid = 1; #ifdef USB_DEBUG uaudio_chan_dump_ep_desc(ed1); #endif @@ -1523,29 +1759,73 @@ uaudio_chan_fill_info_sub(struct uaudio_ "bits = %d, format = %s\n", rate, channels, bit_resolution, p_fmt->description); - chan->sample_rate = rate; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; + chan_alt->sample_rate = rate; + chan_alt->p_asf1d = asf1d; + chan_alt->p_ed1 = ed1; + chan_alt->p_fmt = p_fmt; + chan_alt->p_sed = sed; + chan_alt->iface_index = curidx; + chan_alt->iface_alt_index = alt_index; + + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); if (ep_dir == UE_DIR_IN) - chan->usb_cfg = uaudio_cfg_record; + chan_alt->usb_cfg = uaudio_cfg_record; else - chan->usb_cfg = uaudio_cfg_play; + chan_alt->usb_cfg = uaudio_cfg_play; - chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + chan_alt->sample_size = (UAUDIO_MAX_CHAN(channels) * p_fmt->bPrecision) / 8; - chan->channels = channels; + chan_alt->channels = channels; if (ep_dir == UE_DIR_IN && usbd_get_speed(udev) == USB_SPEED_FULL) { uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); + chan_alt->sample_size * (rate / 1000), + chan_alt->sample_size * (rate / 4000)); + } + + /* setup play/record format */ + + format = chan_alt->p_fmt->freebsd_fmt; + + switch (chan_alt->channels) { + case 2: + /* stereo */ + format = SND_FORMAT(format, 2, 0); + break; + case 1: + /* mono */ + format = SND_FORMAT(format, 1, 0); + break; + default: + /* surround and more */ + format = feeder_matrix_default_format( + SND_FORMAT(format, chan_alt->channels, 0)); + break; + } + + /* check if format is not supported */ + if (format == 0) { + DPRINTF("The selected audio format is not supported\n"); + chan->num_alt--; + goto next_ep; } + /* we only accumulate one format at different sample rates */ + if (chan->num_alt > 1 && chan->pcm_format[0] != format) { + DPRINTF("Multiple formats is not supported\n"); + chan->num_alt--; + goto next_ep; + } + + chan->pcm_cap.fmtlist = chan->pcm_format; + chan->pcm_cap.fmtlist[0] = format; + + if (rate < chan->pcm_cap.minspeed || chan->pcm_cap.minspeed == 0) + chan->pcm_cap.minspeed = rate; + if (rate > chan->pcm_cap.maxspeed || chan->pcm_cap.maxspeed == 0) + chan->pcm_cap.maxspeed = rate; if (sc->sc_sndstat_valid != 0) { sbuf_printf(&sc->sc_sndstat, "\n\t" @@ -1564,8 +1844,9 @@ uaudio_chan_fill_info_sub(struct uaudio_ /* This structure defines all the supported rates. */ -static const uint32_t uaudio_rate_list[] = { +static const uint32_t uaudio_rate_list[CHAN_MAX_ALT] = { 96000, + 88200, 88000, 80000, 72000, @@ -1630,21 +1911,12 @@ uaudio_chan_fill_info(struct uaudio_soft uaudio_chan_fill_info_sub(sc, udev, rate, x, y); /* try find a matching rate, if any */ - for (z = 0; uaudio_rate_list[z]; z++) { + for (z = 0; uaudio_rate_list[z]; z++) uaudio_chan_fill_info_sub(sc, udev, uaudio_rate_list[z], x, y); - - if (sc->sc_rec_chan.valid && - sc->sc_play_chan.valid) { - goto done; - } - } } } - -done: - if (sc->sc_sndstat_valid) { + if (sc->sc_sndstat_valid) sbuf_finish(&sc->sc_sndstat); - } } static void @@ -1652,6 +1924,7 @@ uaudio_chan_play_sync_callback(struct us { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; + uint64_t sample_rate = ch->usb_alt[ch->cur_alt].sample_rate; uint8_t buf[4]; uint64_t temp; int len; @@ -1698,24 +1971,24 @@ uaudio_chan_play_sync_callback(struct us /* auto adjust */ - while (temp < (ch->sample_rate - (ch->sample_rate / 4))) + while (temp < (sample_rate - (sample_rate / 4))) temp *= 2; - while (temp > (ch->sample_rate + (ch->sample_rate / 2))) + while (temp > (sample_rate + (sample_rate / 2))) temp /= 2; /* bias */ - temp += (ch->sample_rate + 1999) / 2000; + temp += (sample_rate + 1999) / 2000; /* compare */ DPRINTF("Comparing %d < %d\n", - (int)temp, (int)ch->sample_rate); + (int)temp, (int)sample_rate); - if (temp == ch->sample_rate) + if (temp == sample_rate) ch->last_sync_state = UAUDIO_SYNC_NONE; - else if (temp > ch->sample_rate) + else if (temp > sample_rate) ch->last_sync_state = UAUDIO_SYNC_MORE; else ch->last_sync_state = UAUDIO_SYNC_LESS; @@ -1737,6 +2010,7 @@ uaudio_chan_play_callback(struct usb_xfe { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; + uint32_t sample_size = ch->usb_alt[ch->cur_alt].sample_size; uint32_t mfl; uint32_t total; uint32_t blockcount; @@ -1800,14 +2074,14 @@ tr_transferred: switch (ch->last_sync_state) { case UAUDIO_SYNC_MORE: DPRINTFN(6, "sending one sample more\n"); - if ((frame_len + ch->sample_size) <= mfl) - frame_len += ch->sample_size; + if ((frame_len + sample_size) <= mfl) + frame_len += sample_size; ch->last_sync_state = UAUDIO_SYNC_NONE; break; case UAUDIO_SYNC_LESS: DPRINTFN(6, "sending one sample less\n"); - if (frame_len >= ch->sample_size) - frame_len -= ch->sample_size; + if (frame_len >= sample_size) + frame_len -= sample_size; ch->last_sync_state = UAUDIO_SYNC_NONE; break; default: @@ -1944,187 +2218,43 @@ uaudio_chan_init(struct uaudio_softc *sc struct uaudio_chan *ch = ((dir == PCMDIR_PLAY) ? &sc->sc_play_chan : &sc->sc_rec_chan); uint32_t buf_size; - uint32_t frames; - uint32_t format; - uint16_t fps; - uint8_t endpoint; - uint8_t blocks; - uint8_t iface_index; - uint8_t alt_index; - uint8_t fps_shift; - usb_error_t err; - - fps = usbd_get_isoc_fps(sc->sc_udev); - - if (fps < 8000) { - /* FULL speed USB */ - frames = 8; - } else { - /* HIGH speed USB */ - frames = UAUDIO_NFRAMES; - } - - /* setup play/record format */ - - ch->pcm_cap.fmtlist = ch->pcm_format; - - ch->pcm_format[0] = 0; - ch->pcm_format[1] = 0; - - ch->pcm_cap.minspeed = ch->sample_rate; - ch->pcm_cap.maxspeed = ch->sample_rate; + uint8_t x; - /* setup mutex and PCM channel */ + /* store mutex and PCM channel */ ch->pcm_ch = c; ch->pcm_mtx = c->lock; - format = ch->p_fmt->freebsd_fmt; - - switch (ch->channels) { - case 2: - /* stereo */ - format = SND_FORMAT(format, 2, 0); - break; - case 1: - /* mono */ - format = SND_FORMAT(format, 1, 0); - break; - default: - /* surround and more */ - format = feeder_matrix_default_format( - SND_FORMAT(format, ch->channels, 0)); - break; - } - - ch->pcm_cap.fmtlist[0] = format; - ch->pcm_cap.fmtlist[1] = 0; - - /* check if format is not supported */ - - if (format == 0) { - DPRINTF("The selected audio format is not supported\n"); - goto error; - } - - /* set alternate interface corresponding to the mode */ - - endpoint = ch->p_ed1->bEndpointAddress; - iface_index = ch->iface_index; - alt_index = ch->iface_alt_index; - - DPRINTF("endpoint=0x%02x, speed=%d, iface=%d alt=%d\n", - endpoint, ch->sample_rate, iface_index, alt_index); - - err = usbd_set_alt_interface_index(sc->sc_udev, iface_index, alt_index); - if (err) { - DPRINTF("setting of alternate index failed: %s!\n", - usbd_errstr(err)); - goto error; - } - usbd_set_parent_iface(sc->sc_udev, iface_index, - sc->sc_mixer_iface_index); - - /* - * Only set the sample rate if the channel reports that it - * supports the frequency control. - */ - - if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { - /* FALLTHROUGH */ - } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { - unsigned int x; - - for (x = 0; x != 256; x++) { - if (dir == PCMDIR_PLAY) { - if (!(sc->sc_mixer_clocks.bit_output[x / 8] & - (1 << (x % 8)))) { - continue; - } - } else { - if (!(sc->sc_mixer_clocks.bit_input[x / 8] & - (1 << (x % 8)))) { - continue; - } - } - - if (uaudio20_set_speed(sc->sc_udev, - sc->sc_mixer_iface_no, x, ch->sample_rate)) { - /* - * If the endpoint is adaptive setting - * the speed may fail. - */ - DPRINTF("setting of sample rate failed! " - "(continuing anyway)\n"); - } - } - } else if (ch->p_sed.v1->bmAttributes & UA_SED_FREQ_CONTROL) { - if (uaudio_set_speed(sc->sc_udev, endpoint, ch->sample_rate)) { - /* - * If the endpoint is adaptive setting the - * speed may fail. - */ - DPRINTF("setting of sample rate failed! " - "(continuing anyway)\n"); - } - } - if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, - ch->usb_cfg, UAUDIO_NCHANBUFS + 1, ch, ch->pcm_mtx)) { - DPRINTF("could not allocate USB transfers!\n"); - goto error; - } - - fps_shift = usbd_xfer_get_fps_shift(ch->xfer[0]); - - /* down shift number of frames per second, if any */ - fps >>= fps_shift; - frames >>= fps_shift; - - /* bytes per frame should not be zero */ - ch->bytes_per_frame[0] = ((ch->sample_rate / fps) * ch->sample_size); - ch->bytes_per_frame[1] = (((ch->sample_rate + fps - 1) / fps) * ch->sample_size); - - /* setup data rate dithering, if any */ - ch->frames_per_second = fps; - ch->sample_rem = ch->sample_rate % fps; - ch->sample_curr = 0; - ch->frames_per_second = fps; - - /* compute required buffer size */ - buf_size = (ch->bytes_per_frame[1] * frames); - - ch->intr_size = buf_size; - ch->intr_frames = frames; + /* compute worst case buffer */ - DPRINTF("fps=%d sample_rem=%d\n", fps, ch->sample_rem); - - if (ch->intr_frames == 0) { - DPRINTF("frame shift is too high!\n"); - goto error; + buf_size = 0; + for (x = 0; x != ch->num_alt; x++) { + uint32_t temp = uaudio_get_buffer_size(ch, x); + if (temp > buf_size) + buf_size = temp; } - /* setup double buffering */ + /* allow double buffering */ buf_size *= 2; - blocks = 2; + + DPRINTF("Worst case buffer is %d bytes\n", (int)buf_size); ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); if (ch->buf == NULL) goto error; if (sndbuf_setup(b, ch->buf, buf_size) != 0) goto error; - if (sndbuf_resize(b, blocks, ch->intr_size)) - goto error; ch->start = ch->buf; ch->end = ch->buf + buf_size; ch->cur = ch->buf; ch->pcm_buf = b; + ch->max_buf = buf_size; if (ch->pcm_mtx == NULL) { DPRINTF("ERROR: PCM channels does not have a mutex!\n"); goto error; } - return (ch); error: @@ -2141,7 +2271,7 @@ uaudio_chan_free(struct uaudio_chan *ch) } usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS + 1); - ch->valid = 0; + ch->num_alt = 0; return (0); } @@ -2149,7 +2279,15 @@ uaudio_chan_free(struct uaudio_chan *ch) int uaudio_chan_set_param_blocksize(struct uaudio_chan *ch, uint32_t blocksize) { - return (ch->intr_size); + uint32_t temp = 2 * uaudio_get_buffer_size(ch, ch->set_alt); + + sndbuf_setup(ch->pcm_buf, ch->buf, temp); + + ch->start = ch->buf; + ch->end = ch->buf + temp; + ch->cur = ch->buf; + + return (temp / 2); } int @@ -2162,10 +2300,23 @@ uaudio_chan_set_param_fragments(struct u int uaudio_chan_set_param_speed(struct uaudio_chan *ch, uint32_t speed) { - if (speed != ch->sample_rate) { - DPRINTF("rate conversion required\n"); + uint8_t x; + + for (x = 0; x < ch->num_alt; x++) { + if (ch->usb_alt[x].sample_rate < speed) { + /* sample rate is too low */ + break; + } } - return (ch->sample_rate); + + if (x != 0) + x--; + + ch->set_alt = x; + + DPRINTF("Selecting alt %d\n", (int)x); + + return (ch->usb_alt[x].sample_rate); } int @@ -2228,31 +2379,61 @@ uaudio_chan_getmatrix(struct uaudio_chan int uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format) { - ch->format = format; + DPRINTF("Selecting format 0x%08x\n", (unsigned int)format); return (0); } int uaudio_chan_start(struct uaudio_chan *ch) { - ch->cur = ch->start; + struct uaudio_softc *sc = ch->priv_sc; + int do_start = 0; -#if (UAUDIO_NCHANBUFS != 2) -#error "please update code" -#endif - usbd_transfer_start(ch->xfer[0]); - usbd_transfer_start(ch->xfer[1]); + usb_proc_explore_lock(sc->sc_udev); + if (ch->operation != CHAN_OP_DRAIN) { + if (ch->cur_alt == ch->set_alt && + ch->operation == CHAN_OP_NONE) { + /* save doing the explore task */ + do_start = 1; + } else { + ch->operation = CHAN_OP_START; + (void)usb_proc_explore_msignal(sc->sc_udev, + &sc->sc_config_msg[0], &sc->sc_config_msg[1]); + } + } + usb_proc_explore_unlock(sc->sc_udev); + + if (do_start) { + usbd_transfer_start(ch->xfer[0]); + usbd_transfer_start(ch->xfer[1]); + } return (0); } int uaudio_chan_stop(struct uaudio_chan *ch) { -#if (UAUDIO_NCHANBUFS != 2) -#error "please update code" -#endif - usbd_transfer_stop(ch->xfer[0]); - usbd_transfer_stop(ch->xfer[1]); + struct uaudio_softc *sc = ch->priv_sc; + int do_stop = 0; + + usb_proc_explore_lock(sc->sc_udev); + if (ch->operation != CHAN_OP_DRAIN) { + if (ch->cur_alt == ch->set_alt && + ch->operation == CHAN_OP_NONE) { + /* save doing the explore task */ + do_stop = 1; + } else { + ch->operation = CHAN_OP_STOP; + (void)usb_proc_explore_msignal(sc->sc_udev, + &sc->sc_config_msg[0], &sc->sc_config_msg[1]); + } + } + usb_proc_explore_unlock(sc->sc_udev); + + if (do_stop) { + usbd_transfer_stop(ch->xfer[0]); + usbd_transfer_stop(ch->xfer[1]); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:02:48 2013 Return-Path: Delivered-To: svn-src-head@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 A79954C7; Tue, 23 Apr 2013 13:02:48 +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 99B621049; Tue, 23 Apr 2013 13:02: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 r3ND2mhi024855; Tue, 23 Apr 2013 13:02:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND2mQV024854; Tue, 23 Apr 2013 13:02:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231302.r3ND2mQV024854@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249797 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:02:48 -0000 Author: eadler Date: Tue Apr 23 13:02:48 2013 New Revision: 249797 URL: http://svnweb.freebsd.org/changeset/base/249797 Log: Remove tautological compare. PR: kern/176712 Submitted by: Hiren Panchasara Approved by: cperciva (mentor) Modified: head/sys/dev/acpi_support/acpi_toshiba.c Modified: head/sys/dev/acpi_support/acpi_toshiba.c ============================================================================== --- head/sys/dev/acpi_support/acpi_toshiba.c Tue Apr 23 10:48:14 2013 (r249796) +++ head/sys/dev/acpi_support/acpi_toshiba.c Tue Apr 23 13:02:48 2013 (r249797) @@ -324,7 +324,7 @@ hci_force_fan(ACPI_HANDLE h, int op, UIN ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*state < 0 || *state > 1) + if (*state > 1) return (EINVAL); *state <<= HCI_FAN_SHIFT; } @@ -368,7 +368,7 @@ hci_lcd_brightness(ACPI_HANDLE h, int op ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*brightness < 0 || *brightness > HCI_LCD_BRIGHTNESS_MAX) + if (*brightness > HCI_LCD_BRIGHTNESS_MAX) return (EINVAL); *brightness <<= HCI_LCD_BRIGHTNESS_SHIFT; } @@ -384,7 +384,7 @@ hci_lcd_backlight(ACPI_HANDLE h, int op, ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*backlight < 0 || *backlight > 1) + if (*backlight > 1) return (EINVAL); } return (hci_call(h, op, HCI_REG_LCD_BACKLIGHT, backlight)); @@ -397,7 +397,7 @@ hci_cpu_speed(ACPI_HANDLE h, int op, UIN ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*speed < 0 || *speed > HCI_CPU_SPEED_MAX) + if (*speed > HCI_CPU_SPEED_MAX) return (EINVAL); *speed <<= HCI_CPU_SPEED_SHIFT; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:02:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08AA04CB; Tue, 23 Apr 2013 13:02:52 +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 EF39B104C; Tue, 23 Apr 2013 13:02: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 r3ND2pjv024897; Tue, 23 Apr 2013 13:02:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND2pA6024896; Tue, 23 Apr 2013 13:02:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231302.r3ND2pA6024896@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249798 - head/sys/dev/bktr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:02:52 -0000 Author: eadler Date: Tue Apr 23 13:02:51 2013 New Revision: 249798 URL: http://svnweb.freebsd.org/changeset/base/249798 Log: Make temp, temp1 the same type that they will later be used for. PR: kern/176712 Submitted by: Hiren Panchasara Reviewed by: jmg (earlier version) Approved by: cperciva (mentor) Modified: head/sys/dev/bktr/bktr_core.c Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Tue Apr 23 13:02:48 2013 (r249797) +++ head/sys/dev/bktr/bktr_core.c Tue Apr 23 13:02:51 2013 (r249798) @@ -1936,7 +1936,7 @@ int tuner_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct thread* td ) { int tmp_int; - unsigned int temp, temp1; + int temp, temp1; int offset; int count; u_char *buf; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:02:55 2013 Return-Path: Delivered-To: svn-src-head@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 DD3875E8; Tue, 23 Apr 2013 13:02:55 +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 D0905104D; Tue, 23 Apr 2013 13:02: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 r3ND2ti9024944; Tue, 23 Apr 2013 13:02:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND2tUl024943; Tue, 23 Apr 2013 13:02:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231302.r3ND2tUl024943@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249799 - head/sys/dev/drm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:02:55 -0000 Author: eadler Date: Tue Apr 23 13:02:55 2013 New Revision: 249799 URL: http://svnweb.freebsd.org/changeset/base/249799 Log: Remove always-true conditions from if statement. PR: kern/176712 Submitted by: Hiren Panchasara Approved by: cperciva (mentor) Modified: head/sys/dev/drm/mach64_dma.c Modified: head/sys/dev/drm/mach64_dma.c ============================================================================== --- head/sys/dev/drm/mach64_dma.c Tue Apr 23 13:02:51 2013 (r249798) +++ head/sys/dev/drm/mach64_dma.c Tue Apr 23 13:02:55 2013 (r249799) @@ -512,7 +512,7 @@ void mach64_dump_ring_info(drm_mach64_pr DRM_INFO("\n"); - if (ring->head >= 0 && ring->head < ring->size / sizeof(u32)) { + if (ring->head < ring->size / sizeof(u32)) { struct list_head *ptr; u32 addr = le32_to_cpu(((u32 *) ring->start)[ring->head + 1]); @@ -1276,7 +1276,7 @@ int mach64_do_dispatch_pseudo_dma(drm_ma entry = list_entry(ptr, drm_mach64_freelist_t, list); buf = entry->buf; offset = buf_addr - GETBUFADDR(buf); - if (offset >= 0 && offset < MACH64_BUFFER_SIZE) { + if (offset < MACH64_BUFFER_SIZE) { found = 1; break; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:02:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E7035EB; Tue, 23 Apr 2013 13:02:58 +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 4184E104F; Tue, 23 Apr 2013 13:02: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 r3ND2wuG024982; Tue, 23 Apr 2013 13:02:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND2w5V024981; Tue, 23 Apr 2013 13:02:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231302.r3ND2w5V024981@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249800 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:02:58 -0000 Author: eadler Date: Tue Apr 23 13:02:57 2013 New Revision: 249800 URL: http://svnweb.freebsd.org/changeset/base/249800 Log: Avoid warning about uninitalized variable PR: kern/176712 Submitted by: Hiren Panchasara (earlier vesion) Approved by: cperciva (mentor) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Apr 23 13:02:55 2013 (r249799) +++ head/sys/dev/bwn/if_bwn.c Tue Apr 23 13:02:57 2013 (r249800) @@ -9183,6 +9183,7 @@ bwn_dma_newbuf(struct bwn_dma_ring *dr, struct mbuf *m; int error; + paddr = 0; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB7D373D; Tue, 23 Apr 2013 13:03:01 +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 AEF681052; Tue, 23 Apr 2013 13:03: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 r3ND31F9025037; Tue, 23 Apr 2013 13:03:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND31JA025036; Tue, 23 Apr 2013 13:03:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND31JA025036@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249801 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:01 -0000 Author: eadler Date: Tue Apr 23 13:03:01 2013 New Revision: 249801 URL: http://svnweb.freebsd.org/changeset/base/249801 Log: Switch from K&R prototypes to modern C Reviewed by: jilles Approved by: cperciva (mentor) MFC After: 3 days Modified: head/lib/libc/gen/stringlist.c Modified: head/lib/libc/gen/stringlist.c ============================================================================== --- head/lib/libc/gen/stringlist.c Tue Apr 23 13:02:57 2013 (r249800) +++ head/lib/libc/gen/stringlist.c Tue Apr 23 13:03:01 2013 (r249801) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); * sl_init(): Initialize a string list */ StringList * -sl_init() +sl_init(void) { StringList *sl; @@ -67,9 +67,7 @@ sl_init() * sl_add(): Add an item to the string list */ int -sl_add(sl, name) - StringList *sl; - char *name; +sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { sl->sl_max += _SL_CHUNKSIZE; @@ -86,9 +84,7 @@ sl_add(sl, name) * sl_free(): Free a stringlist */ void -sl_free(sl, all) - StringList *sl; - int all; +sl_free(StringList *sl, int all) { size_t i; @@ -108,9 +104,7 @@ sl_free(sl, all) * sl_find(): Find a name in the string list */ char * -sl_find(sl, name) - StringList *sl; - char *name; +sl_find(StringList *sl, char *name) { size_t i; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9CEE744; Tue, 23 Apr 2013 13:03:04 +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 ACD2B1057; Tue, 23 Apr 2013 13:03: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 r3ND34sp025080; Tue, 23 Apr 2013 13:03:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND342a025077; Tue, 23 Apr 2013 13:03:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND342a025077@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249802 - in head: include lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:04 -0000 Author: eadler Date: Tue Apr 23 13:03:03 2013 New Revision: 249802 URL: http://svnweb.freebsd.org/changeset/base/249802 Log: - sl_find does not modify 'name' - make the prototype of sl_find match NetBSD Reviewed by: jilles Approved by: cperciva (mentor) MFC After: 3 days Modified: head/include/stringlist.h head/lib/libc/gen/stringlist.3 head/lib/libc/gen/stringlist.c Modified: head/include/stringlist.h ============================================================================== --- head/include/stringlist.h Tue Apr 23 13:03:01 2013 (r249801) +++ head/include/stringlist.h Tue Apr 23 13:03:03 2013 (r249802) @@ -51,7 +51,7 @@ __BEGIN_DECLS StringList *sl_init(void); int sl_add(StringList *, char *); void sl_free(StringList *, int); -char *sl_find(StringList *, char *); +char *sl_find(StringList *, const char *); __END_DECLS #endif /* _STRINGLIST_H */ Modified: head/lib/libc/gen/stringlist.3 ============================================================================== --- head/lib/libc/gen/stringlist.3 Tue Apr 23 13:03:01 2013 (r249801) +++ head/lib/libc/gen/stringlist.3 Tue Apr 23 13:03:03 2013 (r249802) @@ -49,7 +49,7 @@ .Ft void .Fn sl_free "StringList *sl" "int freeall" .Ft char * -.Fn sl_find "StringList *sl" "char *item" +.Fn sl_find "StringList *sl" "const char *item" .Sh DESCRIPTION The .Nm Modified: head/lib/libc/gen/stringlist.c ============================================================================== --- head/lib/libc/gen/stringlist.c Tue Apr 23 13:03:01 2013 (r249801) +++ head/lib/libc/gen/stringlist.c Tue Apr 23 13:03:03 2013 (r249802) @@ -104,7 +104,7 @@ sl_free(StringList *sl, int all) * sl_find(): Find a name in the string list */ char * -sl_find(StringList *sl, char *name) +sl_find(StringList *sl, const char *name) { size_t i; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11568872; Tue, 23 Apr 2013 13:03:09 +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 047341059; Tue, 23 Apr 2013 13:03: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 r3ND38jF025129; Tue, 23 Apr 2013 13:03:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND38LU025128; Tue, 23 Apr 2013 13:03:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND38LU025128@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249803 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:09 -0000 Author: eadler Date: Tue Apr 23 13:03:08 2013 New Revision: 249803 URL: http://svnweb.freebsd.org/changeset/base/249803 Log: Add support for Intel C600/X79 Series Chipset KT Controller. PR: kern/177072 Submitted by: Kurt Lidl Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue Apr 23 13:03:03 2013 (r249802) +++ head/sys/dev/uart/uart_bus_pci.c Tue Apr 23 13:03:08 2013 (r249803) @@ -114,6 +114,7 @@ static const struct pci_id pci_ns8250_id { 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x1d3d, 0xffff, 0, "Intel C600/X79 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", 0x10 }, From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:13 2013 Return-Path: Delivered-To: svn-src-head@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 7F17697A; Tue, 23 Apr 2013 13:03:11 +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 D9CC3105B; Tue, 23 Apr 2013 13:03: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 r3ND3Bco025173; Tue, 23 Apr 2013 13:03:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND3B0A025171; Tue, 23 Apr 2013 13:03:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND3B0A025171@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249804 - head/bin/cat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:13 -0000 Author: eadler Date: Tue Apr 23 13:03:11 2013 New Revision: 249804 URL: http://svnweb.freebsd.org/changeset/base/249804 Log: - Add the __dead2 attribute since it is a function that never returns - Add an empty line in usage() according to style(9) PR: bin/177076 Submitted by: Fernando Approved by: cperciva (mentor) Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Tue Apr 23 13:03:08 2013 (r249803) +++ head/bin/cat/cat.c Tue Apr 23 13:03:11 2013 (r249804) @@ -68,7 +68,7 @@ static int bflag, eflag, lflag, nflag, s static int rval; static const char *filename; -static void usage(void); +static void usage(void) __dead2; static void scanfiles(char *argv[], int cooked); static void cook_cat(FILE *); static void raw_cat(int); @@ -153,6 +153,7 @@ main(int argc, char *argv[]) static void usage(void) { + fprintf(stderr, "usage: cat [-belnstuv] [file ...]\n"); exit(1); /* NOTREACHED */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 28EA79DF; Tue, 23 Apr 2013 13:03:15 +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 1B3A6105E; Tue, 23 Apr 2013 13:03: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 r3ND3EFN025217; Tue, 23 Apr 2013 13:03:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND3EiX025216; Tue, 23 Apr 2013 13:03:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND3EiX025216@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249805 - head/usr.bin/touch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:15 -0000 Author: eadler Date: Tue Apr 23 13:03:14 2013 New Revision: 249805 URL: http://svnweb.freebsd.org/changeset/base/249805 Log: Cleanups to touch.c - use const where appropriate - use static where appropriate - use explicit checks checks for error conditions Reviewed by: sbruno Approved by: cperciva (mentor) Obtained by: DragonFlyBSD Modified: head/usr.bin/touch/touch.c Modified: head/usr.bin/touch/touch.c ============================================================================== --- head/usr.bin/touch/touch.c Tue Apr 23 13:03:11 2013 (r249804) +++ head/usr.bin/touch/touch.c Tue Apr 23 13:03:14 2013 (r249805) @@ -56,12 +56,12 @@ static const char sccsid[] = "@(#)touch. #include #include -void stime_arg1(char *, struct timeval *); -void stime_arg2(char *, int, struct timeval *); -void stime_darg(char *, struct timeval *); -void stime_file(char *, struct timeval *); -int timeoffset(char *); -void usage(char *); +static void stime_arg1(const char *, struct timeval *); +static void stime_arg2(const char *, int, struct timeval *); +static void stime_darg(const char *, struct timeval *); +static void stime_file(const char *, struct timeval *); +static int timeoffset(const char *); +static void usage(char *); int main(int argc, char *argv[]) @@ -78,7 +78,7 @@ main(int argc, char *argv[]) Aflag = aflag = cflag = mflag = timeset = 0; stat_f = stat; utimes_f = utimes; - if (gettimeofday(&tv[0], NULL)) + if (gettimeofday(&tv[0], NULL) == -1) err(1, "gettimeofday"); while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) @@ -115,7 +115,6 @@ main(int argc, char *argv[]) timeset = 1; stime_arg1(optarg, tv); break; - case '?': default: usage(myname); } @@ -235,8 +234,8 @@ main(int argc, char *argv[]) #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; -void -stime_arg1(char *arg, struct timeval *tvp) +static void +stime_arg1(const char *arg, struct timeval *tvp) { time_t now; struct tm *t; @@ -290,14 +289,17 @@ stime_arg1(char *arg, struct timeval *tv t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); if (tvp[0].tv_sec == -1) -terr: errx(1, - "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); + goto terr; tvp[0].tv_usec = tvp[1].tv_usec = 0; + return; + +terr: + errx(1, "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); } -void -stime_arg2(char *arg, int year, struct timeval *tvp) +static void +stime_arg2(const char *arg, int year, struct timeval *tvp) { time_t now; struct tm *t; @@ -326,8 +328,8 @@ stime_arg2(char *arg, int year, struct t tvp[0].tv_usec = tvp[1].tv_usec = 0; } -void -stime_darg(char *arg, struct timeval *tvp) +static void +stime_darg(const char *arg, struct timeval *tvp) { struct tm t = { .tm_sec = 0 }; const char *fmt, *colon; @@ -372,7 +374,7 @@ bad: /* Calculate a time offset in seconds, given an arg of the format [-]HHMMSS. */ int -timeoffset(char *arg) +timeoffset(const char *arg) { int offset; int isneg; @@ -400,8 +402,8 @@ timeoffset(char *arg) return (offset); } -void -stime_file(char *fname, struct timeval *tvp) +static void +stime_file(const char *fname, struct timeval *tvp) { struct stat sb; @@ -411,7 +413,7 @@ stime_file(char *fname, struct timeval * TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); } -void +static void usage(char *myname) { fprintf(stderr, "usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] " From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:03:18 2013 Return-Path: Delivered-To: svn-src-head@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 D0BADAE0; Tue, 23 Apr 2013 13:03:18 +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 01A9D1060; Tue, 23 Apr 2013 13:03: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 r3ND3HmK025258; Tue, 23 Apr 2013 13:03:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND3HDb025257; Tue, 23 Apr 2013 13:03:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231303.r3ND3HDb025257@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 13:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249806 - head/usr.bin/touch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:03:18 -0000 Author: eadler Date: Tue Apr 23 13:03:17 2013 New Revision: 249806 URL: http://svnweb.freebsd.org/changeset/base/249806 Log: Constify where appropriate. Reported by: emaste Approved by: cperciva (mentor) MFC After: 3 days Modified: head/usr.bin/touch/touch.c Modified: head/usr.bin/touch/touch.c ============================================================================== --- head/usr.bin/touch/touch.c Tue Apr 23 13:03:14 2013 (r249805) +++ head/usr.bin/touch/touch.c Tue Apr 23 13:03:17 2013 (r249806) @@ -61,7 +61,7 @@ static void stime_arg2(const char *, int static void stime_darg(const char *, struct timeval *); static void stime_file(const char *, struct timeval *); static int timeoffset(const char *); -static void usage(char *); +static void usage(const char *); int main(int argc, char *argv[]) @@ -414,7 +414,7 @@ stime_file(const char *fname, struct tim } static void -usage(char *myname) +usage(const char *myname) { fprintf(stderr, "usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] " "[-t [[CC]YY]MMDDhhmm[.SS]]\n" From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:07:58 2013 Return-Path: Delivered-To: svn-src-head@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 84D5B540; Tue, 23 Apr 2013 13:07:58 +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 76AF510AE; Tue, 23 Apr 2013 13:07: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 r3ND7w0x026178; Tue, 23 Apr 2013 13:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ND7wk8026177; Tue, 23 Apr 2013 13:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304231307.r3ND7wk8026177@svn.freebsd.org> From: Bryan Drewery Date: Tue, 23 Apr 2013 13:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249807 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:07:58 -0000 Author: bdrewery (ports committer) Date: Tue Apr 23 13:07:58 2013 New Revision: 249807 URL: http://svnweb.freebsd.org/changeset/base/249807 Log: Fix installkernel requiring users/groups defined in CHECK_UIDS and CHECK_GIDS to exist since r152680. This is only needed for installworld. The documented procedure of running mergemaster -p to check for missing users is only needed for installworld, not for installkernel. This fixes auditdistd incorrectly being required for installkernel. PR: misc/174405 Approved by: bapt Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Apr 23 13:03:17 2013 (r249806) +++ head/Makefile.inc1 Tue Apr 23 13:07:58 2013 (r249807) @@ -647,7 +647,6 @@ CHECK_GIDS+= smmsp CHECK_UIDS+= proxy CHECK_GIDS+= proxy authpf .endif -installcheck: installcheck_UGID installcheck_UGID: .for uid in ${CHECK_UIDS} @if ! `id -u ${uid} >/dev/null 2>&1`; then \ @@ -703,7 +702,7 @@ EXTRA_DISTRIBUTIONS+= lib32 MTREE_MAGIC?= mtree 2.0 -distributeworld installworld: installcheck +distributeworld installworld: installcheck installcheck_UGID mkdir -p ${INSTALLTMP} progs=$$(for prog in ${ITOOLS}; do \ if progpath=`which $$prog`; then \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 13:33:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9AAB142; Tue, 23 Apr 2013 13:33:28 +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 AAA4C12B4; Tue, 23 Apr 2013 13:33: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 r3NDXSuX034912; Tue, 23 Apr 2013 13:33:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NDXEAM034815; Tue, 23 Apr 2013 13:33:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201304231333.r3NDXEAM034815@svn.freebsd.org> From: Ed Maste Date: Tue, 23 Apr 2013 13:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249808 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 13:33:28 -0000 Author: emaste Date: Tue Apr 23 13:33:13 2013 New Revision: 249808 URL: http://svnweb.freebsd.org/changeset/base/249808 Log: Renumber clauses to reduce diffs to other versions NetBSD, OpenBSD, and Android's Bionic all number the clauses 1 through 3, so follow suit to make comparison easier. Acked-by: imp@ Modified: head/lib/libc/stdio/asprintf.c head/lib/libc/stdio/clrerr.c head/lib/libc/stdio/fclose.c head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/feof.c head/lib/libc/stdio/ferror.c head/lib/libc/stdio/fflush.c head/lib/libc/stdio/fgetc.c head/lib/libc/stdio/fgetln.c head/lib/libc/stdio/fgetpos.c head/lib/libc/stdio/fgets.c head/lib/libc/stdio/fileno.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/flags.c head/lib/libc/stdio/fopen.c head/lib/libc/stdio/fprintf.c head/lib/libc/stdio/fpurge.c head/lib/libc/stdio/fputc.c head/lib/libc/stdio/fputs.c head/lib/libc/stdio/fread.c head/lib/libc/stdio/freopen.c head/lib/libc/stdio/fscanf.c head/lib/libc/stdio/fseek.c head/lib/libc/stdio/fsetpos.c head/lib/libc/stdio/ftell.c head/lib/libc/stdio/funopen.c head/lib/libc/stdio/fvwrite.c head/lib/libc/stdio/fwalk.c head/lib/libc/stdio/fwrite.c head/lib/libc/stdio/getc.c head/lib/libc/stdio/getchar.c head/lib/libc/stdio/gets.c head/lib/libc/stdio/getw.c head/lib/libc/stdio/makebuf.c head/lib/libc/stdio/mktemp.c head/lib/libc/stdio/perror.c head/lib/libc/stdio/printf-pos.c head/lib/libc/stdio/printf.c head/lib/libc/stdio/putc.c head/lib/libc/stdio/putchar.c head/lib/libc/stdio/puts.c head/lib/libc/stdio/putw.c head/lib/libc/stdio/refill.c head/lib/libc/stdio/remove.c head/lib/libc/stdio/rewind.c head/lib/libc/stdio/rget.c head/lib/libc/stdio/scanf.c head/lib/libc/stdio/setbuf.c head/lib/libc/stdio/setbuffer.c head/lib/libc/stdio/setvbuf.c head/lib/libc/stdio/snprintf.c head/lib/libc/stdio/sprintf.c head/lib/libc/stdio/sscanf.c head/lib/libc/stdio/stdio.c head/lib/libc/stdio/tempnam.c head/lib/libc/stdio/tmpfile.c head/lib/libc/stdio/tmpnam.c head/lib/libc/stdio/ungetc.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfscanf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/vfwscanf.c head/lib/libc/stdio/vprintf.c head/lib/libc/stdio/vscanf.c head/lib/libc/stdio/vsnprintf.c head/lib/libc/stdio/vsprintf.c head/lib/libc/stdio/vsscanf.c head/lib/libc/stdio/vswscanf.c head/lib/libc/stdio/wbuf.c head/lib/libc/stdio/wsetup.c Modified: head/lib/libc/stdio/asprintf.c ============================================================================== --- head/lib/libc/stdio/asprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/asprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/clrerr.c ============================================================================== --- head/lib/libc/stdio/clrerr.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/clrerr.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fclose.c ============================================================================== --- head/lib/libc/stdio/fclose.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fclose.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fdopen.c ============================================================================== --- head/lib/libc/stdio/fdopen.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fdopen.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/feof.c ============================================================================== --- head/lib/libc/stdio/feof.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/feof.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/ferror.c ============================================================================== --- head/lib/libc/stdio/ferror.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/ferror.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fflush.c ============================================================================== --- head/lib/libc/stdio/fflush.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fflush.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fgetc.c ============================================================================== --- head/lib/libc/stdio/fgetc.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fgetc.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fgetln.c ============================================================================== --- head/lib/libc/stdio/fgetln.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fgetln.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fgetpos.c ============================================================================== --- head/lib/libc/stdio/fgetpos.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fgetpos.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fgets.c ============================================================================== --- head/lib/libc/stdio/fgets.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fgets.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fileno.c ============================================================================== --- head/lib/libc/stdio/fileno.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fileno.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/findfp.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/flags.c ============================================================================== --- head/lib/libc/stdio/flags.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/flags.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fopen.c ============================================================================== --- head/lib/libc/stdio/fopen.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fopen.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fprintf.c ============================================================================== --- head/lib/libc/stdio/fprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fpurge.c ============================================================================== --- head/lib/libc/stdio/fpurge.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fpurge.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fputc.c ============================================================================== --- head/lib/libc/stdio/fputc.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fputc.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fputs.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fread.c ============================================================================== --- head/lib/libc/stdio/fread.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fread.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/freopen.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fscanf.c ============================================================================== --- head/lib/libc/stdio/fscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fseek.c ============================================================================== --- head/lib/libc/stdio/fseek.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fseek.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fsetpos.c ============================================================================== --- head/lib/libc/stdio/fsetpos.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fsetpos.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/ftell.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/funopen.c ============================================================================== --- head/lib/libc/stdio/funopen.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/funopen.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fvwrite.c ============================================================================== --- head/lib/libc/stdio/fvwrite.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fvwrite.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fwalk.c ============================================================================== --- head/lib/libc/stdio/fwalk.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fwalk.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/fwrite.c ============================================================================== --- head/lib/libc/stdio/fwrite.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/fwrite.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/getc.c ============================================================================== --- head/lib/libc/stdio/getc.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/getc.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/getchar.c ============================================================================== --- head/lib/libc/stdio/getchar.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/getchar.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/gets.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/getw.c ============================================================================== --- head/lib/libc/stdio/getw.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/getw.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/makebuf.c ============================================================================== --- head/lib/libc/stdio/makebuf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/makebuf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/mktemp.c ============================================================================== --- head/lib/libc/stdio/mktemp.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/mktemp.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/perror.c ============================================================================== --- head/lib/libc/stdio/perror.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/perror.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/printf-pos.c ============================================================================== --- head/lib/libc/stdio/printf-pos.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/printf-pos.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/printf.c ============================================================================== --- head/lib/libc/stdio/printf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/printf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/putc.c ============================================================================== --- head/lib/libc/stdio/putc.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/putc.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/putchar.c ============================================================================== --- head/lib/libc/stdio/putchar.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/putchar.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/puts.c ============================================================================== --- head/lib/libc/stdio/puts.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/puts.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/putw.c ============================================================================== --- head/lib/libc/stdio/putw.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/putw.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/refill.c ============================================================================== --- head/lib/libc/stdio/refill.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/refill.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/remove.c ============================================================================== --- head/lib/libc/stdio/remove.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/remove.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/rewind.c ============================================================================== --- head/lib/libc/stdio/rewind.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/rewind.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/rget.c ============================================================================== --- head/lib/libc/stdio/rget.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/rget.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/scanf.c ============================================================================== --- head/lib/libc/stdio/scanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/scanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/setbuf.c ============================================================================== --- head/lib/libc/stdio/setbuf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/setbuf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/setbuffer.c ============================================================================== --- head/lib/libc/stdio/setbuffer.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/setbuffer.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/setvbuf.c ============================================================================== --- head/lib/libc/stdio/setvbuf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/setvbuf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/snprintf.c ============================================================================== --- head/lib/libc/stdio/snprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/snprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/sprintf.c ============================================================================== --- head/lib/libc/stdio/sprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/sprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/sscanf.c ============================================================================== --- head/lib/libc/stdio/sscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/sscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/stdio.c ============================================================================== --- head/lib/libc/stdio/stdio.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/stdio.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/tempnam.c ============================================================================== --- head/lib/libc/stdio/tempnam.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/tempnam.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/tmpfile.c ============================================================================== --- head/lib/libc/stdio/tmpfile.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/tmpfile.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/tmpnam.c ============================================================================== --- head/lib/libc/stdio/tmpnam.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/tmpnam.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/ungetc.c ============================================================================== --- head/lib/libc/stdio/ungetc.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/ungetc.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vfprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vfscanf.c ============================================================================== --- head/lib/libc/stdio/vfscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vfscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vfwprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vfwscanf.c ============================================================================== --- head/lib/libc/stdio/vfwscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vfwscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vprintf.c ============================================================================== --- head/lib/libc/stdio/vprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vscanf.c ============================================================================== --- head/lib/libc/stdio/vscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vsnprintf.c ============================================================================== --- head/lib/libc/stdio/vsnprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vsnprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vsprintf.c ============================================================================== --- head/lib/libc/stdio/vsprintf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vsprintf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vsscanf.c ============================================================================== --- head/lib/libc/stdio/vsscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vsscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/vswscanf.c ============================================================================== --- head/lib/libc/stdio/vswscanf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/vswscanf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/wbuf.c ============================================================================== --- head/lib/libc/stdio/wbuf.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/wbuf.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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/stdio/wsetup.c ============================================================================== --- head/lib/libc/stdio/wsetup.c Tue Apr 23 13:07:58 2013 (r249807) +++ head/lib/libc/stdio/wsetup.c Tue Apr 23 13:33:13 2013 (r249808) @@ -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. * From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 14:06:33 2013 Return-Path: Delivered-To: svn-src-head@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 9D2F6D2B; Tue, 23 Apr 2013 14:06:33 +0000 (UTC) (envelope-from andre@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 8F77B152E; Tue, 23 Apr 2013 14:06: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 r3NE6X1a044739; Tue, 23 Apr 2013 14:06:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NE6X6u044738; Tue, 23 Apr 2013 14:06:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201304231406.r3NE6X6u044738@svn.freebsd.org> From: Andre Oppermann Date: Tue, 23 Apr 2013 14:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249809 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 14:06:33 -0000 Author: andre Date: Tue Apr 23 14:06:32 2013 New Revision: 249809 URL: http://svnweb.freebsd.org/changeset/base/249809 Log: When doing RFC3042 limited transmit on the first on second duplicate ACK make sure we actually have new data to send. This prevents us from sending unneccessary pure ACKs. Reported by: Matt Miller Tested by: Matt Miller MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Apr 23 13:33:13 2013 (r249808) +++ head/sys/netinet/tcp_input.c Tue Apr 23 14:06:32 2013 (r249809) @@ -2564,6 +2564,7 @@ tcp_do_segment(struct mbuf *m, struct tc u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; + int avail; KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, @@ -2585,7 +2586,17 @@ tcp_do_segment(struct mbuf *m, struct tc */ break; } - (void) tcp_output(tp); + /* + * Only call tcp_output when there + * is new data available to be sent. + * Otherwise we would send pure ACKs. + */ + SOCKBUF_LOCK(&so->so_snd); + avail = so->so_snd.sb_cc - + (tp->snd_nxt - tp->snd_una); + SOCKBUF_UNLOCK(&so->so_snd); + if (avail > 0) + (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { KASSERT((tp->t_dupacks == 2 && From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 14:36:51 2013 Return-Path: Delivered-To: svn-src-head@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 73CA6991; Tue, 23 Apr 2013 14:36:51 +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 56F0716F9; Tue, 23 Apr 2013 14:36: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 r3NEapZB059152; Tue, 23 Apr 2013 14:36:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NEaivP059102; Tue, 23 Apr 2013 14:36:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201304231436.r3NEaivP059102@svn.freebsd.org> From: Ed Maste Date: Tue, 23 Apr 2013 14:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249810 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 14:36:51 -0000 Author: emaste Date: Tue Apr 23 14:36:44 2013 New Revision: 249810 URL: http://svnweb.freebsd.org/changeset/base/249810 Log: Convert libc/stdio from K&R to ANSI C And add '__restrict' where it appeared in the header prototypes Modified: head/lib/libc/stdio/clrerr.c head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/fgetc.c head/lib/libc/stdio/fgets.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/flags.c head/lib/libc/stdio/fopen.c head/lib/libc/stdio/fpurge.c head/lib/libc/stdio/fputc.c head/lib/libc/stdio/fputs.c head/lib/libc/stdio/freopen.c head/lib/libc/stdio/fseek.c head/lib/libc/stdio/fsetpos.c head/lib/libc/stdio/ftell.c head/lib/libc/stdio/fvwrite.c head/lib/libc/stdio/fwalk.c head/lib/libc/stdio/fwrite.c head/lib/libc/stdio/gets.c head/lib/libc/stdio/getw.c head/lib/libc/stdio/makebuf.c head/lib/libc/stdio/mktemp.c head/lib/libc/stdio/perror.c head/lib/libc/stdio/putc.c head/lib/libc/stdio/putchar.c head/lib/libc/stdio/puts.c head/lib/libc/stdio/putw.c head/lib/libc/stdio/remove.c head/lib/libc/stdio/setbuffer.c head/lib/libc/stdio/stdio.c head/lib/libc/stdio/tempnam.c head/lib/libc/stdio/tmpnam.c head/lib/libc/stdio/vscanf.c head/lib/libc/stdio/wbuf.c head/lib/libc/stdio/wsetup.c Modified: head/lib/libc/stdio/clrerr.c ============================================================================== --- head/lib/libc/stdio/clrerr.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/clrerr.c Tue Apr 23 14:36:44 2013 (r249810) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); #undef clearerr_unlocked void -clearerr(fp) - FILE *fp; +clearerr(FILE *fp) { FLOCKFILE(fp); __sclearerr(fp); Modified: head/lib/libc/stdio/fdopen.c ============================================================================== --- head/lib/libc/stdio/fdopen.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fdopen.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); #include "local.h" FILE * -fdopen(fd, mode) - int fd; - const char *mode; +fdopen(int fd, const char *mode) { FILE *fp; int flags, oflags, fdflags, tmp; Modified: head/lib/libc/stdio/fgetc.c ============================================================================== --- head/lib/libc/stdio/fgetc.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fgetc.c Tue Apr 23 14:36:44 2013 (r249810) @@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$"); #include "local.h" int -fgetc(fp) - FILE *fp; +fgetc(FILE *fp) { int retval; FLOCKFILE(fp); Modified: head/lib/libc/stdio/fgets.c ============================================================================== --- head/lib/libc/stdio/fgets.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fgets.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,10 +49,7 @@ __FBSDID("$FreeBSD$"); * Return first argument, or NULL if no characters were read. */ char * -fgets(buf, n, fp) - char *buf; - int n; - FILE *fp; +fgets(char * __restrict buf, int n, FILE * __restrict fp) { size_t len; char *s; Modified: head/lib/libc/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/findfp.c Tue Apr 23 14:36:44 2013 (r249810) @@ -91,8 +91,7 @@ spinlock_t __stdio_thread_lock = _SPINLO #endif static struct glue * -moreglue(n) - int n; +moreglue(int n) { struct glue *g; static FILE empty = { ._fl_mutex = PTHREAD_MUTEX_INITIALIZER }; Modified: head/lib/libc/stdio/flags.c ============================================================================== --- head/lib/libc/stdio/flags.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/flags.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); * Return 0 on error. */ int -__sflags(mode, optr) - const char *mode; - int *optr; +__sflags(const char *mode, int *optr) { int ret, m, o; Modified: head/lib/libc/stdio/fopen.c ============================================================================== --- head/lib/libc/stdio/fopen.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fopen.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include "local.h" FILE * -fopen(file, mode) - const char * __restrict file; - const char * __restrict mode; +fopen(const char * __restrict file, const char * __restrict mode) { FILE *fp; int f; Modified: head/lib/libc/stdio/fpurge.c ============================================================================== --- head/lib/libc/stdio/fpurge.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fpurge.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * given FILE's buffer empty. */ int -fpurge(fp) - FILE *fp; +fpurge(FILE *fp) { int retval; FLOCKFILE(fp); Modified: head/lib/libc/stdio/fputc.c ============================================================================== --- head/lib/libc/stdio/fputc.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fputc.c Tue Apr 23 14:36:44 2013 (r249810) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" int -fputc(c, fp) - int c; - FILE *fp; +fputc(int c, FILE *fp) { int retval; FLOCKFILE(fp); Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fputs.c Tue Apr 23 14:36:44 2013 (r249810) @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); * Write the given string to the given file. */ int -fputs(s, fp) - const char * __restrict s; - FILE * __restrict fp; +fputs(const char * __restrict s, FILE * __restrict fp) { int retval; struct __suio uio; Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/freopen.c Tue Apr 23 14:36:44 2013 (r249810) @@ -55,10 +55,8 @@ __FBSDID("$FreeBSD$"); * all possible, no matter what. */ FILE * -freopen(file, mode, fp) - const char * __restrict file; - const char * __restrict mode; - FILE *fp; +freopen(const char * __restrict file, const char * __restrict mode, + FILE * __restrict fp) { int f; int dflags, flags, isopen, oflags, sverrno, wantfd; Modified: head/lib/libc/stdio/fseek.c ============================================================================== --- head/lib/libc/stdio/fseek.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fseek.c Tue Apr 23 14:36:44 2013 (r249810) @@ -51,10 +51,7 @@ __FBSDID("$FreeBSD$"); #define POS_ERR (-(fpos_t)1) int -fseek(fp, offset, whence) - FILE *fp; - long offset; - int whence; +fseek(FILE *fp, long offset, int whence) { int ret; int serrno = errno; @@ -72,10 +69,7 @@ fseek(fp, offset, whence) } int -fseeko(fp, offset, whence) - FILE *fp; - off_t offset; - int whence; +fseeko(FILE *fp, off_t offset, int whence) { int ret; int serrno = errno; @@ -97,11 +91,7 @@ fseeko(fp, offset, whence) * `Whence' must be one of the three SEEK_* macros. */ int -_fseeko(fp, offset, whence, ltest) - FILE *fp; - off_t offset; - int whence; - int ltest; +_fseeko(FILE *fp, off_t offset, int whence, int ltest) { fpos_t (*seekfn)(void *, fpos_t, int); fpos_t target, curoff, ret; Modified: head/lib/libc/stdio/fsetpos.c ============================================================================== --- head/lib/libc/stdio/fsetpos.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fsetpos.c Tue Apr 23 14:36:44 2013 (r249810) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); * fsetpos: like fseek. */ int -fsetpos(iop, pos) - FILE *iop; - const fpos_t *pos; +fsetpos(FILE *iop, const fpos_t *pos) { return (fseeko(iop, (off_t)*pos, SEEK_SET)); } Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/ftell.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * standard ftell function. */ long -ftell(fp) - FILE *fp; +ftell(FILE *fp) { off_t rv; @@ -66,8 +65,7 @@ ftell(fp) * ftello: return current offset. */ off_t -ftello(fp) - FILE *fp; +ftello(FILE *fp) { fpos_t rv; int ret; @@ -85,9 +83,7 @@ ftello(fp) } int -_ftello(fp, offset) - FILE *fp; - fpos_t *offset; +_ftello(FILE *fp, fpos_t *offset) { fpos_t pos; size_t n; Modified: head/lib/libc/stdio/fvwrite.c ============================================================================== --- head/lib/libc/stdio/fvwrite.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fvwrite.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); * to the three different kinds of output buffering is handled here. */ int -__sfvwrite(fp, uio) - FILE *fp; - struct __suio *uio; +__sfvwrite(FILE *fp, struct __suio *uio) { size_t len; char *p; Modified: head/lib/libc/stdio/fwalk.c ============================================================================== --- head/lib/libc/stdio/fwalk.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fwalk.c Tue Apr 23 14:36:44 2013 (r249810) @@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" int -_fwalk(function) - int (*function)(FILE *); +_fwalk(int (*function)(FILE *)) { FILE *fp; int n, ret; Modified: head/lib/libc/stdio/fwrite.c ============================================================================== --- head/lib/libc/stdio/fwrite.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/fwrite.c Tue Apr 23 14:36:44 2013 (r249810) @@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$"); * Return the number of whole objects written. */ size_t -fwrite(buf, size, count, fp) - const void * __restrict buf; - size_t size, count; - FILE * __restrict fp; +fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) { size_t n; struct __suio uio; Modified: head/lib/libc/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/gets.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); __warn_references(gets, "warning: this program uses gets(), which is unsafe."); char * -gets(buf) - char *buf; +gets(char *buf) { int c; char *s; Modified: head/lib/libc/stdio/getw.c ============================================================================== --- head/lib/libc/stdio/getw.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/getw.c Tue Apr 23 14:36:44 2013 (r249810) @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); #include int -getw(fp) - FILE *fp; +getw(FILE *fp) { int x; Modified: head/lib/libc/stdio/makebuf.c ============================================================================== --- head/lib/libc/stdio/makebuf.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/makebuf.c Tue Apr 23 14:36:44 2013 (r249810) @@ -55,8 +55,7 @@ __FBSDID("$FreeBSD$"); * optimisation) right after the _fstat() that finds the buffer size. */ void -__smakebuf(fp) - FILE *fp; +__smakebuf(FILE *fp) { void *p; int flags; @@ -88,10 +87,7 @@ __smakebuf(fp) * Internal routine to determine `proper' buffering for a file. */ int -__swhatbuf(fp, bufsize, couldbetty) - FILE *fp; - size_t *bufsize; - int *couldbetty; +__swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) { struct stat st; Modified: head/lib/libc/stdio/mktemp.c ============================================================================== --- head/lib/libc/stdio/mktemp.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/mktemp.c Tue Apr 23 14:36:44 2013 (r249810) @@ -53,9 +53,7 @@ static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; int -mkstemps(path, slen) - char *path; - int slen; +mkstemps(char *path, int slen) { int fd; @@ -63,8 +61,7 @@ mkstemps(path, slen) } int -mkstemp(path) - char *path; +mkstemp(char *path) { int fd; @@ -72,15 +69,13 @@ mkstemp(path) } char * -mkdtemp(path) - char *path; +mkdtemp(char *path) { return (_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL); } char * -_mktemp(path) - char *path; +_mktemp(char *path) { return (_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL); } @@ -89,18 +84,13 @@ __warn_references(mktemp, "warning: mktemp() possibly used unsafely; consider using mkstemp()"); char * -mktemp(path) - char *path; +mktemp(char *path) { return (_mktemp(path)); } static int -_gettemp(path, doopen, domkdir, slen) - char *path; - int *doopen; - int domkdir; - int slen; +_gettemp(char *path, int *doopen, int domkdir, int slen) { char *start, *trv, *suffp, *carryp; char *pad; Modified: head/lib/libc/stdio/perror.c ============================================================================== --- head/lib/libc/stdio/perror.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/perror.c Tue Apr 23 14:36:44 2013 (r249810) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); #include "local.h" void -perror(s) - const char *s; +perror(const char *s) { char msgbuf[NL_TEXTMAX]; struct iovec *v; Modified: head/lib/libc/stdio/putc.c ============================================================================== --- head/lib/libc/stdio/putc.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/putc.c Tue Apr 23 14:36:44 2013 (r249810) @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); #undef putc_unlocked int -putc(c, fp) - int c; - FILE *fp; +putc(int c, FILE *fp) { int retval; FLOCKFILE(fp); Modified: head/lib/libc/stdio/putchar.c ============================================================================== --- head/lib/libc/stdio/putchar.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/putchar.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * A subroutine version of the macro putchar */ int -putchar(c) - int c; +putchar(int c) { int retval; FILE *so = stdout; Modified: head/lib/libc/stdio/puts.c ============================================================================== --- head/lib/libc/stdio/puts.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/puts.c Tue Apr 23 14:36:44 2013 (r249810) @@ -48,8 +48,7 @@ __FBSDID("$FreeBSD$"); * Write the given string to stdout, appending a newline. */ int -puts(s) - char const *s; +puts(char const *s) { int retval; size_t c = strlen(s); Modified: head/lib/libc/stdio/putw.c ============================================================================== --- head/lib/libc/stdio/putw.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/putw.c Tue Apr 23 14:36:44 2013 (r249810) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" int -putw(w, fp) - int w; - FILE *fp; +putw(int w, FILE *fp) { int retval; struct __suio uio; Modified: head/lib/libc/stdio/remove.c ============================================================================== --- head/lib/libc/stdio/remove.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/remove.c Tue Apr 23 14:36:44 2013 (r249810) @@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$"); #include int -remove(file) - const char *file; +remove(const char *file) { struct stat sb; Modified: head/lib/libc/stdio/setbuffer.c ============================================================================== --- head/lib/libc/stdio/setbuffer.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/setbuffer.c Tue Apr 23 14:36:44 2013 (r249810) @@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$"); #include void -setbuffer(fp, buf, size) - FILE *fp; - char *buf; - int size; +setbuffer(FILE *fp, char *buf, int size) { (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, (size_t)size); @@ -52,8 +49,7 @@ setbuffer(fp, buf, size) * set line buffering */ int -setlinebuf(fp) - FILE *fp; +setlinebuf(FILE *fp) { return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0)); Modified: head/lib/libc/stdio/stdio.c ============================================================================== --- head/lib/libc/stdio/stdio.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/stdio.c Tue Apr 23 14:36:44 2013 (r249810) @@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$"); * Small standard I/O/seek/close functions. */ int -__sread(cookie, buf, n) - void *cookie; - char *buf; - int n; +__sread(void *cookie, char *buf, int n) { FILE *fp = cookie; @@ -61,10 +58,7 @@ __sread(cookie, buf, n) } int -__swrite(cookie, buf, n) - void *cookie; - char const *buf; - int n; +__swrite(void *cookie, char const *buf, int n) { FILE *fp = cookie; @@ -72,10 +66,7 @@ __swrite(cookie, buf, n) } fpos_t -__sseek(cookie, offset, whence) - void *cookie; - fpos_t offset; - int whence; +__sseek(void *cookie, fpos_t offset, int whence) { FILE *fp = cookie; @@ -83,8 +74,7 @@ __sseek(cookie, offset, whence) } int -__sclose(cookie) - void *cookie; +__sclose(void *cookie) { return (_close(((FILE *)cookie)->_file)); @@ -94,10 +84,7 @@ __sclose(cookie) * Higher level wrappers. */ int -_sread(fp, buf, n) - FILE *fp; - char *buf; - int n; +_sread(FILE *fp, char *buf, int n) { int ret; @@ -115,10 +102,7 @@ _sread(fp, buf, n) } int -_swrite(fp, buf, n) - FILE *fp; - char const *buf; - int n; +_swrite(FILE *fp, char const *buf, int n) { int ret; int serrno; @@ -145,10 +129,7 @@ _swrite(fp, buf, n) } fpos_t -_sseek(fp, offset, whence) - FILE *fp; - fpos_t offset; - int whence; +_sseek(FILE *fp, fpos_t offset, int whence) { fpos_t ret; int serrno, errret; Modified: head/lib/libc/stdio/tempnam.c ============================================================================== --- head/lib/libc/stdio/tempnam.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/tempnam.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,8 +47,7 @@ __warn_references(tempnam, extern char *_mktemp(char *); char * -tempnam(dir, pfx) - const char *dir, *pfx; +tempnam(const char *dir, const char *pfx) { int sverrno; char *f, *name; Modified: head/lib/libc/stdio/tmpnam.c ============================================================================== --- head/lib/libc/stdio/tmpnam.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/tmpnam.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,8 +47,7 @@ __warn_references(tmpnam, extern char *_mktemp(char *); char * -tmpnam(s) - char *s; +tmpnam(char *s) { static u_long tmpcount; static char buf[L_tmpnam]; Modified: head/lib/libc/stdio/vscanf.c ============================================================================== --- head/lib/libc/stdio/vscanf.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/vscanf.c Tue Apr 23 14:36:44 2013 (r249810) @@ -49,10 +49,7 @@ __FBSDID("$FreeBSD$"); #include "xlocale_private.h" int -vscanf_l(locale, fmt, ap) - locale_t locale; - const char * __restrict fmt; - __va_list ap; +vscanf_l(locale_t locale, const char * __restrict fmt, __va_list ap) { int retval; FIX_LOCALE(locale); @@ -63,9 +60,7 @@ vscanf_l(locale, fmt, ap) return (retval); } int -vscanf(fmt, ap) - const char * __restrict fmt; - __va_list ap; +vscanf(const char * __restrict fmt, __va_list ap) { return vscanf_l(__get_locale(), fmt, ap); } Modified: head/lib/libc/stdio/wbuf.c ============================================================================== --- head/lib/libc/stdio/wbuf.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/wbuf.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); * Non-MT-safe */ int -__swbuf(c, fp) - int c; - FILE *fp; +__swbuf(int c, FILE *fp) { int n; Modified: head/lib/libc/stdio/wsetup.c ============================================================================== --- head/lib/libc/stdio/wsetup.c Tue Apr 23 14:06:32 2013 (r249809) +++ head/lib/libc/stdio/wsetup.c Tue Apr 23 14:36:44 2013 (r249810) @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); * _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno. */ int -__swsetup(fp) - FILE *fp; +__swsetup(FILE *fp) { /* make sure stdio is set up */ if (!__sdidinit) From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 15:46:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05164F60; Tue, 23 Apr 2013 15:46:42 +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 D5C2A1C8C; Tue, 23 Apr 2013 15:46:41 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 30300B96B; Tue, 23 Apr 2013 11:46:41 -0400 (EDT) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r249800 - head/sys/dev/bwn Date: Tue, 23 Apr 2013 11:46:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304231302.r3ND2w5V024981@svn.freebsd.org> In-Reply-To: <201304231302.r3ND2w5V024981@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304231146.11509.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Apr 2013 11:46:41 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 15:46:42 -0000 On Tuesday, April 23, 2013 9:02:58 am Eitan Adler wrote: > Author: eadler > Date: Tue Apr 23 13:02:57 2013 > New Revision: 249800 > URL: http://svnweb.freebsd.org/changeset/base/249800 > > Log: > Avoid warning about uninitalized variable > > PR: kern/176712 > Submitted by: Hiren Panchasara (earlier vesion) > Approved by: cperciva (mentor) I don't think this is correct. In the 'back' case you want to reuse the previous mbuf. It doesn't have a physical address of 0. Instead, the dr->setdesc() at the bottom of this routine should use the previous physical address. I think you can fix this by reverting this and changing dr->setdesc() to use meta->mt_paddr instead of paddr. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:08:25 2013 Return-Path: Delivered-To: svn-src-head@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 67891756; Tue, 23 Apr 2013 16:08:25 +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 584931E03; Tue, 23 Apr 2013 16:08: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 r3NG8ODw090563; Tue, 23 Apr 2013 16:08:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NG8OQC090562; Tue, 23 Apr 2013 16:08:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304231608.r3NG8OQC090562@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Apr 2013 16:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249811 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:08:25 -0000 Author: kib Date: Tue Apr 23 16:08:24 2013 New Revision: 249811 URL: http://svnweb.freebsd.org/changeset/base/249811 Log: Literally follow POSIX: If the bs= expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block. In particular, when both bs=size and conv=sparce were specified, the resulted file was fully filled, instead of sparce. PR: standards/177742 Submitted by: Matthew Rezny MFC after: 2 weeks Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Tue Apr 23 14:36:44 2013 (r249810) +++ head/bin/dd/dd.c Tue Apr 23 16:08:24 2013 (r249811) @@ -358,7 +358,7 @@ dd_in(void) * than noerror, notrunc or sync are specified, the block * is output without buffering as it is read. */ - if (ddflags & C_BS) { + if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) { out.dbcnt = in.dbcnt; dd_out(1); in.dbcnt = 0; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:19:43 2013 Return-Path: Delivered-To: svn-src-head@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 90A0EC09; Tue, 23 Apr 2013 16:19:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) by mx1.freebsd.org (Postfix) with ESMTP id AB8921EB9; Tue, 23 Apr 2013 16:19:42 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hj19so1016824wib.4 for ; Tue, 23 Apr 2013 09:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=d0oxV3Ow40gn/Yh5vMw0Uu8dPXlWyo05nQrkXht4itY=; b=KEa53WIDnv3KwqgSG058Gq9hxdJy+NhthCkY8ILtAn9F2VO/w610w7gvCTKhyLINs1 f+9RjDWCwIBOHPyCnka+Ou4MUBPy58lPVTuiWmiHdXewzddsBxq1JDsDg1c4t2/0OAVq 6/Apx1X0zz+YWNHDDW0x7v9VMwjN91Vaudzgx91wWyomm+AbxnUcbzptm9IyS3OGOr4T i8CqE+rGsJ8XU2xaqkmCP/nbHVe3i5fNVOAigPryqMpd+qEYPxQidunKKme90WNQs8Mc p8uXSnZpAkkIlfaJckusc4MfBa8bnCnbp5fxSLEB+4U943GTqwYZWMPygZvqZ0DGad+M 30Eg== MIME-Version: 1.0 X-Received: by 10.180.94.196 with SMTP id de4mr14564149wib.23.1366733981769; Tue, 23 Apr 2013 09:19:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.88.129 with HTTP; Tue, 23 Apr 2013 09:19:41 -0700 (PDT) In-Reply-To: <201304231302.r3ND2w5V024981@svn.freebsd.org> References: <201304231302.r3ND2w5V024981@svn.freebsd.org> Date: Tue, 23 Apr 2013 09:19:41 -0700 X-Google-Sender-Auth: 5xzvqZLfJd1I_05W4MqENHjcRcs Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: Adrian Chadd To: Eitan Adler 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:19:43 -0000 ... you know, even though it doesn't have an active maintainer, do you have test hardware, and why didn't you just bounce a patch to -wireless for review? We don't bite you know! adrian (Who yes, does have lots of bwn hardware. if you have a cardbus or expresscard slot you can have one.) On 23 April 2013 06:02, Eitan Adler wrote: > Author: eadler > Date: Tue Apr 23 13:02:57 2013 > New Revision: 249800 > URL: http://svnweb.freebsd.org/changeset/base/249800 > > Log: > Avoid warning about uninitalized variable > > PR: kern/176712 > Submitted by: Hiren Panchasara (earlier vesion) > Approved by: cperciva (mentor) > > Modified: > head/sys/dev/bwn/if_bwn.c > > Modified: head/sys/dev/bwn/if_bwn.c > ============================================================================== > --- head/sys/dev/bwn/if_bwn.c Tue Apr 23 13:02:55 2013 (r249799) > +++ head/sys/dev/bwn/if_bwn.c Tue Apr 23 13:02:57 2013 (r249800) > @@ -9183,6 +9183,7 @@ bwn_dma_newbuf(struct bwn_dma_ring *dr, > struct mbuf *m; > int error; > > + paddr = 0; > m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); > if (m == NULL) { > error = ENOBUFS; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:33:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DCA7BBD; Tue, 23 Apr 2013 16:33:25 +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 CE4ED1F64; Tue, 23 Apr 2013 16:33: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 r3NGXPw7000234; Tue, 23 Apr 2013 16:33:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NGXP1e000233; Tue, 23 Apr 2013 16:33:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304231633.r3NGXP1e000233@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 16:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249812 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:33:25 -0000 Author: eadler Date: Tue Apr 23 16:33:25 2013 New Revision: 249812 URL: http://svnweb.freebsd.org/changeset/base/249812 Log: Revert r249800 as - it is incorrect: In the 'back' case you want to reuse the previous mbuf. - it was not reviewed by wireless@ Requested by: jhb, adrian Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Apr 23 16:08:24 2013 (r249811) +++ head/sys/dev/bwn/if_bwn.c Tue Apr 23 16:33:25 2013 (r249812) @@ -9183,7 +9183,6 @@ bwn_dma_newbuf(struct bwn_dma_ring *dr, struct mbuf *m; int error; - paddr = 0; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:34:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A872035B for ; Tue, 23 Apr 2013 16:34:42 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [IPv6:2607:f8b0:400e:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 817111F96 for ; Tue, 23 Apr 2013 16:34:42 +0000 (UTC) Received: by mail-pb0-f41.google.com with SMTP id ma3so205381pbc.14 for ; Tue, 23 Apr 2013 09:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=nj3CrhGaDN+B2YpM5sQC3WJIph+nJ2TbK4p0Q9BoAXU=; b=U02t15X6IzkTA4Gneb6G+TfPjz9QVOFnjkVeWGpffQfqo0xHtWwyZryJgfX8otpsGF Y6YToNWCvyb5/XsThgfFyQBrbl3weNHLnxrVVFeYXOPmaqYNdCcWnqWgs4P5tEcOIAYG 7aYESmbxgkY/Bv1RhmI426ACFdXpWTY97554c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received: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=nj3CrhGaDN+B2YpM5sQC3WJIph+nJ2TbK4p0Q9BoAXU=; b=BzZvYR0poqqYteS5htnn5cs7+2r6dgv2BiHR6abSbCmIAc6HXzgwN2fiBH5J6nxdYM ch7lD2qPnOqv2LKV/QebJ/9fNRSPzgD6etw6DM+RNAkIcxE+12iuKLchd9SkWEpKaxu+ nyXxv2pgM3pz/JQ6sG9vbRRb3HXE31+67ltzur7SY2PdqmSQ3jJWUNReROvY7vWdWbBr n7QqMWe6kChHc6zWU7f35SazxscRuk/bfkmWmcnTIYyFth/Bei4uJX1SK8q2w6OUzhGS TP7sazsTACmUZZXE83mNYFY8puOXG1IB4Q98SJPH+svnESEWv5KOBaxUW3EYAiZ61gtw 8Q6g== X-Received: by 10.68.253.232 with SMTP id ad8mr41565757pbd.164.1366734882185; Tue, 23 Apr 2013 09:34:42 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Tue, 23 Apr 2013 09:34:11 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> From: Eitan Adler Date: Tue, 23 Apr 2013 12:34:11 -0400 X-Google-Sender-Auth: 8d7pgNuzwTWt2xe7cifV9PQdtl4 Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnVBF9CxKT6mITX/CtFLzjdkXfcMRCAGv/coNMQXwoVepnWT299cRCeQ+4jclAkvDbU0OTl Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:34:42 -0000 On 23 April 2013 12:19, Adrian Chadd wrote: > ... you know, even though it doesn't have an active maintainer, do you > have test hardware, and why didn't you just bounce a patch to > -wireless for review? > > We don't bite you know! that you need to emphasize this does not comfort me. ;) reverted in 249812. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:40:40 2013 Return-Path: Delivered-To: svn-src-head@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 D5BFD6B1; Tue, 23 Apr 2013 16:40:40 +0000 (UTC) (envelope-from neel@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 B6B171FF8; Tue, 23 Apr 2013 16:40: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 r3NGeePO001678; Tue, 23 Apr 2013 16:40:40 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NGeejp001677; Tue, 23 Apr 2013 16:40:40 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304231640.r3NGeejp001677@svn.freebsd.org> From: Neel Natu Date: Tue, 23 Apr 2013 16:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249813 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:40:40 -0000 Author: neel Date: Tue Apr 23 16:40:39 2013 New Revision: 249813 URL: http://svnweb.freebsd.org/changeset/base/249813 Log: Teach the virtio block device to deal with direct as well as indirect descriptors. Prior to this change the device would only work with guests that chose to use indirect descriptors. Modify the device reset callback to actually reset the device state. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Apr 23 16:33:25 2013 (r249812) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Apr 23 16:40:39 2013 (r249813) @@ -187,6 +187,13 @@ pci_vtblk_update_status(struct pci_vtblk { if (value == 0) { DPRINTF(("vtblk: device reset requested !\n")); + sc->vbsc_isr = 0; + sc->msix_table_idx_req = VIRTIO_MSI_NO_VECTOR; + sc->msix_table_idx_cfg = VIRTIO_MSI_NO_VECTOR; + sc->vbsc_features = 0; + sc->vbsc_pfn = 0; + sc->vbsc_lastq = 0; + memset(&sc->vbsc_q, 0, sizeof(struct vring_hqueue)); } sc->vbsc_status = value; @@ -203,9 +210,8 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int i; int err; int iolen; - int nsegs; int uidx, aidx, didx; - int writeop, type; + int indirect, writeop, type; off_t offset; uidx = *hq->hq_used_idx; @@ -215,30 +221,21 @@ pci_vtblk_proc(struct pci_vtblk_softc *s vd = &hq->hq_dtable[didx]; - /* - * Verify that the descriptor is indirect, and obtain - * the pointer to the indirect descriptor. - * There has to be space for at least 3 descriptors - * in the indirect descriptor array: the block header, - * 1 or more data descriptors, and a status byte. - */ - assert(vd->vd_flags & VRING_DESC_F_INDIRECT); - - nsegs = vd->vd_len / sizeof(struct virtio_desc); - assert(nsegs >= 3); - assert(nsegs < VTBLK_MAXSEGS + 2); + indirect = ((vd->vd_flags & VRING_DESC_F_INDIRECT) != 0); - vid = paddr_guest2host(vtblk_ctx(sc), vd->vd_addr, vd->vd_len); - assert((vid->vd_flags & VRING_DESC_F_INDIRECT) == 0); + if (indirect) { + vid = paddr_guest2host(vtblk_ctx(sc), vd->vd_addr, vd->vd_len); + vd = &vid[0]; + } /* * The first descriptor will be the read-only fixed header */ - vbh = paddr_guest2host(vtblk_ctx(sc), vid[0].vd_addr, + vbh = paddr_guest2host(vtblk_ctx(sc), vd->vd_addr, sizeof(struct virtio_blk_hdr)); - assert(vid[0].vd_len == sizeof(struct virtio_blk_hdr)); - assert(vid[0].vd_flags & VRING_DESC_F_NEXT); - assert((vid[0].vd_flags & VRING_DESC_F_WRITE) == 0); + assert(vd->vd_len == sizeof(struct virtio_blk_hdr)); + assert(vd->vd_flags & VRING_DESC_F_NEXT); + assert((vd->vd_flags & VRING_DESC_F_WRITE) == 0); /* * XXX @@ -253,14 +250,18 @@ pci_vtblk_proc(struct pci_vtblk_softc *s /* * Build up the iovec based on the guest's data descriptors */ - for (i = 1, iolen = 0; i < nsegs - 1; i++) { - iov[i-1].iov_base = paddr_guest2host(vtblk_ctx(sc), - vid[i].vd_addr, vid[i].vd_len); - iov[i-1].iov_len = vid[i].vd_len; - iolen += vid[i].vd_len; + i = iolen = 0; + while (1) { + if (indirect) + vd = &vid[i + 1]; /* skip first indirect desc */ + else + vd = &hq->hq_dtable[vd->vd_next]; + + if ((vd->vd_flags & VRING_DESC_F_NEXT) == 0) + break; - assert(vid[i].vd_flags & VRING_DESC_F_NEXT); - assert((vid[i].vd_flags & VRING_DESC_F_INDIRECT) == 0); + if (i == VTBLK_MAXSEGS) + break; /* * - write op implies read-only descriptor, @@ -268,58 +269,41 @@ pci_vtblk_proc(struct pci_vtblk_softc *s * therefore test the inverse of the descriptor bit * to the op. */ - assert(((vid[i].vd_flags & VRING_DESC_F_WRITE) == 0) == + assert(((vd->vd_flags & VRING_DESC_F_WRITE) == 0) == writeop); + + iov[i].iov_base = paddr_guest2host(vtblk_ctx(sc), + vd->vd_addr, + vd->vd_len); + iov[i].iov_len = vd->vd_len; + iolen += vd->vd_len; + i++; } /* Lastly, get the address of the status byte */ - status = paddr_guest2host(vtblk_ctx(sc), vid[nsegs - 1].vd_addr, 1); - assert(vid[nsegs - 1].vd_len == 1); - assert((vid[nsegs - 1].vd_flags & VRING_DESC_F_NEXT) == 0); - assert(vid[nsegs - 1].vd_flags & VRING_DESC_F_WRITE); + status = paddr_guest2host(vtblk_ctx(sc), vd->vd_addr, 1); + assert(vd->vd_len == 1); + assert((vd->vd_flags & VRING_DESC_F_NEXT) == 0); + assert(vd->vd_flags & VRING_DESC_F_WRITE); DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", - writeop ? "write" : "read", iolen, nsegs - 2, offset)); + writeop ? "write" : "read", iolen, i, offset)); - if (writeop){ - err = pwritev(sc->vbsc_fd, iov, nsegs - 2, offset); - } else { - err = preadv(sc->vbsc_fd, iov, nsegs - 2, offset); - } + if (writeop) + err = pwritev(sc->vbsc_fd, iov, i, offset); + else + err = preadv(sc->vbsc_fd, iov, i, offset); *status = err < 0 ? VTBLK_S_IOERR : VTBLK_S_OK; /* - * Return the single indirect descriptor back to the host + * Return the single descriptor back to the host */ vu = &hq->hq_used_ring[uidx % hq->hq_size]; vu->vu_idx = didx; vu->vu_tlen = 1; hq->hq_cur_aidx++; *hq->hq_used_idx += 1; -} - -static void -pci_vtblk_qnotify(struct pci_vtblk_softc *sc) -{ - struct vring_hqueue *hq = &sc->vbsc_q; - int i; - int ndescs; - - /* - * Calculate number of ring entries to process - */ - ndescs = hq_num_avail(hq); - - if (ndescs == 0) - return; - - /* - * Run through all the entries, placing them into iovecs and - * sending when an end-of-packet is found - */ - for (i = 0; i < ndescs; i++) - pci_vtblk_proc(sc, hq); /* * Generate an interrupt if able @@ -332,7 +316,21 @@ pci_vtblk_qnotify(struct pci_vtblk_softc pci_generate_msi(sc->vbsc_pi, 0); } } - +} + +static void +pci_vtblk_qnotify(struct pci_vtblk_softc *sc) +{ + struct vring_hqueue *hq = &sc->vbsc_q; + int ndescs; + + while ((ndescs = hq_num_avail(hq)) != 0) { + /* + * Run through all the entries, placing them into iovecs and + * sending when an end-of-packet is found + */ + pci_vtblk_proc(sc, hq); + } } static void From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 16:46:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1A8C8B87; Tue, 23 Apr 2013 16:46:40 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by mx1.freebsd.org (Postfix) with ESMTP id B7B9D1045; Tue, 23 Apr 2013 16:46:38 +0000 (UTC) Received: by mail-ee0-f53.google.com with SMTP id d17so355638eek.26 for ; Tue, 23 Apr 2013 09:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Zq/srzwLbX2RpuOav/gaR6md4Smc2KwYBdZZzrQT/kM=; b=xzVZjgGZquddpus4zd2NCKEXP2rXtrsu0+NKb8qRHx/TVdnbMV8PIccqf5V3M0l7hR tp6lcljQf313Udf1oFySdXeKJ9vHHKi0S0j6QqLFU5zXiu/7x/PywfnaId6ZH4PEx3LV xYB+8LR9m+5Gb7F9EGMC3jeLxUsjuEe2lxt+QCsrH9CCe80+omKVYK6jOezchNuo74vj OAmKap5Z+B4gQLFAldbd5FBLWPRNM4C3I6fKi0D3CfIuMKq3YjnaOJOYScpd/zirj2+z unO8W8OyOGWh1BRtz/33bIVNbQRglJWWQhfxdFNNhZ2KmI8ieDOgijYeGOZMl6DXgKKC x2+A== MIME-Version: 1.0 X-Received: by 10.14.104.6 with SMTP id h6mr8531189eeg.5.1366735597618; Tue, 23 Apr 2013 09:46:37 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.15.91.72 with HTTP; Tue, 23 Apr 2013 09:46:37 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> Date: Tue, 23 Apr 2013 09:46:37 -0700 X-Google-Sender-Auth: KONK6Kdb2UAbheL6VzLFAbooo-w Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , Adrian Chadd , src-committers , svn-src-all X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 16:46:40 -0000 On Tue, Apr 23, 2013 at 9:34 AM, Eitan Adler wrote: > On 23 April 2013 12:19, Adrian Chadd wrote: >> ... you know, even though it doesn't have an active maintainer, do you >> have test hardware, and why didn't you just bounce a patch to >> -wireless for review? My bad. I proposed this change initially. >> >> We don't bite you know! > > that you need to emphasize this does not comfort me. ;) > > reverted in 249812. Will look at john's suggestions and fix it correctly. Hiren > > -- > Eitan Adler > Source, Ports, Doc committer > Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 18:29:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 060F6383; Tue, 23 Apr 2013 18:29:52 +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 EC94F163A; Tue, 23 Apr 2013 18:29: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 r3NITpKR040867; Tue, 23 Apr 2013 18:29:51 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NITp30040864; Tue, 23 Apr 2013 18:29:51 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304231829.r3NITp30040864@svn.freebsd.org> From: Sean Bruno Date: Tue, 23 Apr 2013 18:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249815 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 18:29:52 -0000 Author: sbruno Date: Tue Apr 23 18:29:51 2013 New Revision: 249815 URL: http://svnweb.freebsd.org/changeset/base/249815 Log: Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS command on a disk device. This quieseces some noise on the console that recently appeared. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Tue Apr 23 17:03:10 2013 (r249814) +++ head/sys/dev/ciss/ciss.c Tue Apr 23 18:29:51 2013 (r249815) @@ -3202,6 +3202,19 @@ ciss_cam_emulate(struct ciss_softc *sc, } } + /* + * A CISS target can only ever have one lun per target. REPORT_LUNS requires + * at least one LUN field to be pre created for us, so snag it and fill in + * the least significant byte indicating 1 LUN here. Emulate the command + * return to shut up warning on console of a CDB error. swb + */ + if (opcode == REPORT_LUNS && csio->dxfer_len > 0) { + csio->data_ptr[3] = 8; + csio->ccb_h.status |= CAM_REQ_CMP; + xpt_done((union ccb *)csio); + return(1); + } + return(0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 18:30:34 2013 Return-Path: Delivered-To: svn-src-head@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 311A8500; Tue, 23 Apr 2013 18:30:34 +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 091A01646; Tue, 23 Apr 2013 18:30: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 r3NIUXfP042527; Tue, 23 Apr 2013 18:30:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NIUXqx042524; Tue, 23 Apr 2013 18:30:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304231830.r3NIUXqx042524@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Apr 2013 18:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249816 - in head/sys/dev: acpi_support bktr drm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 18:30:34 -0000 Author: jkim Date: Tue Apr 23 18:30:33 2013 New Revision: 249816 URL: http://svnweb.freebsd.org/changeset/base/249816 Log: Fix white spaces. Modified: head/sys/dev/acpi_support/acpi_toshiba.c head/sys/dev/bktr/bktr_core.c head/sys/dev/drm/mach64_dma.c Modified: head/sys/dev/acpi_support/acpi_toshiba.c ============================================================================== --- head/sys/dev/acpi_support/acpi_toshiba.c Tue Apr 23 18:29:51 2013 (r249815) +++ head/sys/dev/acpi_support/acpi_toshiba.c Tue Apr 23 18:30:33 2013 (r249816) @@ -324,7 +324,7 @@ hci_force_fan(ACPI_HANDLE h, int op, UIN ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*state > 1) + if (*state > 1) return (EINVAL); *state <<= HCI_FAN_SHIFT; } @@ -368,7 +368,7 @@ hci_lcd_brightness(ACPI_HANDLE h, int op ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*brightness > HCI_LCD_BRIGHTNESS_MAX) + if (*brightness > HCI_LCD_BRIGHTNESS_MAX) return (EINVAL); *brightness <<= HCI_LCD_BRIGHTNESS_SHIFT; } @@ -384,7 +384,7 @@ hci_lcd_backlight(ACPI_HANDLE h, int op, ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*backlight > 1) + if (*backlight > 1) return (EINVAL); } return (hci_call(h, op, HCI_REG_LCD_BACKLIGHT, backlight)); @@ -397,7 +397,7 @@ hci_cpu_speed(ACPI_HANDLE h, int op, UIN ACPI_SERIAL_ASSERT(toshiba); if (op == HCI_SET) { - if (*speed > HCI_CPU_SPEED_MAX) + if (*speed > HCI_CPU_SPEED_MAX) return (EINVAL); *speed <<= HCI_CPU_SPEED_SHIFT; } Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Tue Apr 23 18:29:51 2013 (r249815) +++ head/sys/dev/bktr/bktr_core.c Tue Apr 23 18:30:33 2013 (r249816) @@ -1936,7 +1936,7 @@ int tuner_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct thread* td ) { int tmp_int; - int temp, temp1; + int temp, temp1; int offset; int count; u_char *buf; Modified: head/sys/dev/drm/mach64_dma.c ============================================================================== --- head/sys/dev/drm/mach64_dma.c Tue Apr 23 18:29:51 2013 (r249815) +++ head/sys/dev/drm/mach64_dma.c Tue Apr 23 18:30:33 2013 (r249816) @@ -512,7 +512,7 @@ void mach64_dump_ring_info(drm_mach64_pr DRM_INFO("\n"); - if (ring->head < ring->size / sizeof(u32)) { + if (ring->head < ring->size / sizeof(u32)) { struct list_head *ptr; u32 addr = le32_to_cpu(((u32 *) ring->start)[ring->head + 1]); @@ -1276,7 +1276,7 @@ int mach64_do_dispatch_pseudo_dma(drm_ma entry = list_entry(ptr, drm_mach64_freelist_t, list); buf = entry->buf; offset = buf_addr - GETBUFADDR(buf); - if (offset < MACH64_BUFFER_SIZE) { + if (offset < MACH64_BUFFER_SIZE) { found = 1; break; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 18:58:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EADDB9D; Tue, 23 Apr 2013 18:58:40 +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 F3A6617CB; Tue, 23 Apr 2013 18:58: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 r3NIwd3w050758; Tue, 23 Apr 2013 18:58:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NIwdTM050757; Tue, 23 Apr 2013 18:58:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304231858.r3NIwdTM050757@svn.freebsd.org> From: Dimitry Andric Date: Tue, 23 Apr 2013 18:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249817 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 18:58:40 -0000 Author: dim Date: Tue Apr 23 18:58:39 2013 New Revision: 249817 URL: http://svnweb.freebsd.org/changeset/base/249817 Log: Pull in r180121 from upstream llvm trunk: LoopVectorizer: Fix 15830. When scalarizing and unrolling stores make sure that the order in which the elements are scalarized is the same as the original order. This fixes a miscompilation in FreeBSD's regex library. This should fix lib/libc/regex/regcomp.c at -O3 with clang 3.3 r178860 on CPUs with SSE. Before this change, the vectorizer could incorrectly rearrange the second loop in computejumps(), leading to possibly invalid entries in the re_gets::charjump table. The net result was that for example "sed s/@CC@/foo/" failed to work correctly, leading to trouble with many configure scripts. 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 Tue Apr 23 18:30:33 2013 (r249816) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Apr 23 18:58:39 2013 (r249817) @@ -1040,10 +1040,10 @@ void InnerLoopVectorizer::scalarizeInstr // Create a new entry in the WidenMap and initialize it to Undef or Null. VectorParts &VecResults = WidenMap.splat(Instr, UndefVec); - // For each scalar that we create: - for (unsigned Width = 0; Width < VF; ++Width) { - // For each vector unroll 'part': - for (unsigned Part = 0; Part < UF; ++Part) { + // For each vector unroll 'part': + for (unsigned Part = 0; Part < UF; ++Part) { + // For each scalar that we create: + for (unsigned Width = 0; Width < VF; ++Width) { Instruction *Cloned = Instr->clone(); if (!IsVoidRetTy) Cloned->setName(Instr->getName() + ".cloned"); From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 19:29:50 2013 Return-Path: Delivered-To: svn-src-head@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 55AB58A6; Tue, 23 Apr 2013 19:29:50 +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 455C01A6D; Tue, 23 Apr 2013 19:29: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 r3NJToHq062128; Tue, 23 Apr 2013 19:29:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NJToQj062127; Tue, 23 Apr 2013 19:29:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304231929.r3NJToQj062127@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Apr 2013 19:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249818 - head/usr.sbin/acpi/iasl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 19:29:50 -0000 Author: jkim Date: Tue Apr 23 19:29:49 2013 New Revision: 249818 URL: http://svnweb.freebsd.org/changeset/base/249818 Log: Clean up generated files added in r233250. Modified: head/usr.sbin/acpi/iasl/Makefile Modified: head/usr.sbin/acpi/iasl/Makefile ============================================================================== --- head/usr.sbin/acpi/iasl/Makefile Tue Apr 23 18:58:39 2013 (r249817) +++ head/usr.sbin/acpi/iasl/Makefile Tue Apr 23 19:29:49 2013 (r249818) @@ -74,7 +74,8 @@ YFLAGS= -d CLEANFILES= aslcompiler.y.h aslcompilerlex.c aslcompilerparse.c \ aslcompilerparse.h dtparser.y.h dtparserlex.c \ - dtparserparse.c dtparserparse.h + dtparserparse.c dtparserparse.h prparser.y.h \ + prparserlex.c prparserparse.c prparserparse.h aslcompilerlex.c: aslcompiler.l aslsupport.l ${LEX} ${LFLAGS} -PAslCompiler -o${.TARGET} \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 19:42:46 2013 Return-Path: Delivered-To: svn-src-head@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 1BA74F7B; Tue, 23 Apr 2013 19:42:46 +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 E86591AEE; Tue, 23 Apr 2013 19:42: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 r3NJgj1p067744; Tue, 23 Apr 2013 19:42:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NJgjad067742; Tue, 23 Apr 2013 19:42:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304231942.r3NJgjad067742@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Apr 2013 19:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249821 - head/usr.sbin/acpi/acpidb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 19:42:46 -0000 Author: jkim Date: Tue Apr 23 19:42:45 2013 New Revision: 249821 URL: http://svnweb.freebsd.org/changeset/base/249821 Log: Fix declarations to slightly increase WARNS level. Modified: head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/acpidb/acpidb.c Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Tue Apr 23 19:40:20 2013 (r249820) +++ head/usr.sbin/acpi/acpidb/Makefile Tue Apr 23 19:42:45 2013 (r249821) @@ -67,7 +67,7 @@ SRCS+= utaddress.c utalloc.c utcache.c u utxfinit.c MAN= acpidb.8 -WARNS?= 2 +WARNS?= 3 CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing DPADD= ${LIBPTHREAD} Modified: head/usr.sbin/acpi/acpidb/acpidb.c ============================================================================== --- head/usr.sbin/acpi/acpidb/acpidb.c Tue Apr 23 19:40:20 2013 (r249820) +++ head/usr.sbin/acpi/acpidb/acpidb.c Tue Apr 23 19:42:45 2013 (r249821) @@ -50,7 +50,7 @@ * Dummy DSDT Table Header */ -ACPI_TABLE_HEADER dummy_dsdt_table = { +static ACPI_TABLE_HEADER dummy_dsdt_table = { "DSDT", 123, 1, 123, "OEMID", "OEMTBLID", 1, "CRID", 1 }; @@ -58,7 +58,7 @@ ACPI_TABLE_HEADER dummy_dsdt_table = { * Region space I/O routines on virtual machine */ -int aml_debug_prompt = 1; +static int aml_debug_prompt = 1; struct ACPIRegionContent { TAILQ_ENTRY(ACPIRegionContent) links; @@ -68,10 +68,13 @@ struct ACPIRegionContent { }; TAILQ_HEAD(ACPIRegionContentList, ACPIRegionContent); -struct ACPIRegionContentList RegionContentList; +static struct ACPIRegionContentList RegionContentList; static int aml_simulation_initialized = 0; +ACPI_PHYSICAL_ADDRESS AeLocalGetRootPointer(void); +void AeTableOverride(ACPI_TABLE_HEADER *, ACPI_TABLE_HEADER **); + static void aml_simulation_init(void); static int aml_simulate_regcontent_add(int regtype, ACPI_PHYSICAL_ADDRESS addr, @@ -87,11 +90,11 @@ static void aml_simulation_regload(con static void aml_simulation_regdump(const char *dumpfile); /* Stubs to simplify linkage to the ACPI CA core subsystem. */ -ACPI_STATUS +ACPI_PHYSICAL_ADDRESS AeLocalGetRootPointer(void) { - return (AE_ERROR); + return (0); } void From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 21:25:42 2013 Return-Path: Delivered-To: svn-src-head@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 AE18C1D4 for ; Tue, 23 Apr 2013 21:25:42 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id 38D561015 for ; Tue, 23 Apr 2013 21:25:42 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id ei20so971073lab.22 for ; Tue, 23 Apr 2013 14:25:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received: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=g2ekoiY5Tn5zRDt6AHVZ38xs78pGt8LM6PQsBFMMXy8=; b=bcHOpKR3pJJKu9rxIlPsECCGIRKTpdIoIXvhH+7iLKhwgSC5e29d7wCBAYK8IIc4C8 WAPPw10AtyodeqiTPtW5ymWiDMxJy+ZMGh+lHjuIWPuZ5Qzby8nwmRIH17ES0sWRG7MQ 0ViuNhV8RFcdlcljZXMcSkyjgcseHbG9TlIdnyojSBABT559RMl77YjV6nw9YzqP0SWC OTmHccHfx7TBf/WPTgtIQ3Pz62LWF9bCMj9QwoM2IzhB9LZMfrJiagI4Mfv0S5dzGiRw kPxZtkc/M3C3LdWykDE7UtwyAR2vSSn8DqsBCK3qBrTYSdVlYXIU0bMHv478H2nKfwqe 44wg== X-Received: by 10.112.164.97 with SMTP id yp1mr4644893lbb.6.1366752341031; Tue, 23 Apr 2013 14:25:41 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 23 Apr 2013 14:25:19 -0700 (PDT) In-Reply-To: <201304230938.r3N9cIV0047961@svn.freebsd.org> References: <201304230938.r3N9cIV0047961@svn.freebsd.org> From: Juli Mallett Date: Tue, 23 Apr 2013 14:25:19 -0700 X-Google-Sender-Auth: M5OWc_FpwAhfS7FfmuDpvr6zrSc Message-ID: Subject: Re: svn commit: r249790 - in head/sys/mips: include mips To: Warner Losh Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl+2E/ELbzyh4D5ecL72G+KXsDZLGfftyamsjdlulCILasaadIzlb0sW8cLbcKTchbsMvbY Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 21:25:42 -0000 On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh wrote: > Modified: head/sys/mips/include/frame.h > ============================================================================== > --- head/sys/mips/include/frame.h Tue Apr 23 06:37:50 2013 (r249789) > +++ head/sys/mips/include/frame.h Tue Apr 23 09:38:18 2013 (r249790) > @@ -37,6 +37,8 @@ > #ifndef _MACHINE_FRAME_H_ > #define _MACHINE_FRAME_H_ > > +/* Note: This must also match regnum.h and regdef.h */ > + > struct trapframe { > register_t zero; > register_t ast; > @@ -46,6 +48,16 @@ struct trapframe { > register_t a1; > register_t a2; > register_t a3; > +#if defined(__mips_n32) || defined(__mips_n64) > + register_t a4; > + register_t a5; > + register_t a6; > + register_t a7; > + register_t t0; > + register_t t1; > + register_t t2; > + register_t t3; > +#else > register_t t0; > register_t t1; > register_t t2; > @@ -54,6 +66,7 @@ struct trapframe { > register_t t5; > register_t t6; > register_t t7; > +#endif > register_t s0; > register_t s1; > register_t s2; > > Modified: head/sys/mips/mips/trap.c > ============================================================================== > --- head/sys/mips/mips/trap.c Tue Apr 23 06:37:50 2013 (r249789) > +++ head/sys/mips/mips/trap.c Tue Apr 23 09:38:18 2013 (r249790) > @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registers. > */ > - sa->args[3] = locr0->t4; > - sa->args[4] = locr0->t5; > - sa->args[5] = locr0->t6; > - sa->args[6] = locr0->t7; > + sa->args[3] = locr0->t0; > + sa->args[4] = locr0->t1; > + sa->args[5] = locr0->t2; > + sa->args[6] = locr0->t3; > nsaved += 4; > #ifdef COMPAT_FREEBSD32 > } > @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registers. > */ > - sa->args[4] = locr0->t4; > - sa->args[5] = locr0->t5; > - sa->args[6] = locr0->t6; > - sa->args[7] = locr0->t7; > + sa->args[4] = locr0->t0; > + sa->args[5] = locr0->t1; > + sa->args[6] = locr0->t2; > + sa->args[7] = locr0->t3; > nsaved += 4; > #ifdef COMPAT_FREEBSD32 > } These should use a4, a5, a6, a7 now, not t0, t1, t2, t3. From owner-svn-src-head@FreeBSD.ORG Tue Apr 23 22:55:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9B8FA46; Tue, 23 Apr 2013 22:55:59 +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 DB8C8138C; Tue, 23 Apr 2013 22:55: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 r3NMtxBN034910; Tue, 23 Apr 2013 22:55:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3NMtxec034909; Tue, 23 Apr 2013 22:55:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304232255.r3NMtxec034909@svn.freebsd.org> From: Devin Teske Date: Tue, 23 Apr 2013 22:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249823 - head/usr.sbin/bsdconfig/share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 22:56:00 -0000 Author: dteske Date: Tue Apr 23 22:55:59 2013 New Revision: 249823 URL: http://svnweb.freebsd.org/changeset/base/249823 Log: Add missing include. Modified: head/usr.sbin/bsdconfig/share/media/common.subr Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Tue Apr 23 22:45:03 2013 (r249822) +++ head/usr.sbin/bsdconfig/share/media/common.subr Tue Apr 23 22:55:59 2013 (r249823) @@ -33,6 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." media/common.subr f_include $BSDCFG_SHARE/struct.subr f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/media/any.subr ############################################################ GLOBALS From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 00:41:37 2013 Return-Path: Delivered-To: svn-src-head@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 55F7AD78; Wed, 24 Apr 2013 00:41:37 +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 47CD916E7; Wed, 24 Apr 2013 00: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 r3O0fbqj072406; Wed, 24 Apr 2013 00:41:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3O0fbcr072405; Wed, 24 Apr 2013 00:41:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304240041.r3O0fbcr072405@svn.freebsd.org> From: Eitan Adler Date: Wed, 24 Apr 2013 00:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249824 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 00:41:37 -0000 Author: eadler Date: Wed Apr 24 00:41:36 2013 New Revision: 249824 URL: http://svnweb.freebsd.org/changeset/base/249824 Log: iso639: Add Standard Moroccan Tamazight. See http://www.loc.gov/standards/iso639-2/php/code_changes.php Obtained from: DragonflyBSD (commit 2d64ea1d0ec1beacc8f4e22353b7eb84c6f2b3f0) Modified: head/share/misc/iso639 Modified: head/share/misc/iso639 ============================================================================== --- head/share/misc/iso639 Tue Apr 23 22:55:59 2013 (r249823) +++ head/share/misc/iso639 Wed Apr 24 00:41:36 2013 (r249824) @@ -517,6 +517,7 @@ yo yor yor Yoruba zap zap Zapotec zbl zbl Blissymbols; Blissymbolics; Bliss zen zen Zenaga + zgh zgh Standard Moroccan Tamazight za zha zha Zhuang; Chuang znd znd Zande languages zu zul zul Zulu From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 01:20:11 2013 Return-Path: Delivered-To: svn-src-head@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 1A12A2A4; Wed, 24 Apr 2013 01:20:11 +0000 (UTC) (envelope-from rpaulo@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 0CC741800; Wed, 24 Apr 2013 01:20: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 r3O1KAnP084924; Wed, 24 Apr 2013 01:20:10 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3O1KAkW084923; Wed, 24 Apr 2013 01:20:10 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304240120.r3O1KAkW084923@svn.freebsd.org> From: Rui Paulo Date: Wed, 24 Apr 2013 01:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249825 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 01:20:11 -0000 Author: rpaulo Date: Wed Apr 24 01:20:10 2013 New Revision: 249825 URL: http://svnweb.freebsd.org/changeset/base/249825 Log: wiigpio depends on options WII. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Apr 24 00:41:36 2013 (r249824) +++ head/sys/conf/files.powerpc Wed Apr 24 01:20:10 2013 (r249825) @@ -233,5 +233,5 @@ powerpc/wii/platform_wii.c optional wii powerpc/wii/wii_bus.c optional wii powerpc/wii/wii_pic.c optional wii powerpc/wii/wii_fb.c optional wii -powerpc/wii/wii_gpio.c optional wiigpio +powerpc/wii/wii_gpio.c optional wii wiigpio powerpc/wii/wii_ipc.c optional wii From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 01:36:36 2013 Return-Path: Delivered-To: svn-src-head@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 30DB84B3; Wed, 24 Apr 2013 01:36:36 +0000 (UTC) (envelope-from rpaulo@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 131A1183E; Wed, 24 Apr 2013 01:36: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 r3O1aZDJ091115; Wed, 24 Apr 2013 01:36:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3O1aZ0U091112; Wed, 24 Apr 2013 01:36:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304240136.r3O1aZ0U091112@svn.freebsd.org> From: Rui Paulo Date: Wed, 24 Apr 2013 01:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249826 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 01:36:36 -0000 Author: rpaulo Date: Wed Apr 24 01:36:35 2013 New Revision: 249826 URL: http://svnweb.freebsd.org/changeset/base/249826 Log: Handle the IRQ for the reset button. Modified: head/sys/powerpc/wii/wii_bus.c head/sys/powerpc/wii/wii_pic.c head/sys/powerpc/wii/wii_picreg.h Modified: head/sys/powerpc/wii/wii_bus.c ============================================================================== --- head/sys/powerpc/wii/wii_bus.c Wed Apr 24 01:20:10 2013 (r249825) +++ head/sys/powerpc/wii/wii_bus.c Wed Apr 24 01:36:35 2013 (r249826) @@ -157,7 +157,7 @@ wiibus_attach(device_t self) /* Nintendo PIC */ dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIPIC_REG_ADDR, - WIIPIC_REG_LEN, 0); + WIIPIC_REG_LEN, 1); cdev = BUS_ADD_CHILD(self, 0, "wiipic", 0); device_set_ivars(cdev, dinfo); Modified: head/sys/powerpc/wii/wii_pic.c ============================================================================== --- head/sys/powerpc/wii/wii_pic.c Wed Apr 24 01:20:10 2013 (r249825) +++ head/sys/powerpc/wii/wii_pic.c Wed Apr 24 01:36:35 2013 (r249826) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,6 +52,7 @@ static void wiipic_enable(device_t, unsi static void wiipic_eoi(device_t, unsigned int); static void wiipic_mask(device_t, unsigned int); static void wiipic_unmask(device_t, unsigned int); +static void wiipic_intr(void *); struct wiipic_softc { device_t sc_dev; @@ -58,6 +60,9 @@ struct wiipic_softc { bus_space_tag_t sc_bt; bus_space_handle_t sc_bh; int sc_rrid; + int sc_irqid; + struct resource *sc_irq; + void *sc_irqctx; int sc_vector[WIIPIC_NIRQ]; }; @@ -146,6 +151,19 @@ wiipic_attach(device_t dev) powerpc_register_pic(dev, 0, WIIPIC_NIRQ, 0, FALSE); + /* + * Setup the interrupt handler. + */ + sc->sc_irqid = 0; + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid, + RF_ACTIVE); + if (sc->sc_irq == NULL) { + device_printf(dev, "could not alloc IRQ resource\n"); + return (ENXIO); + } + bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, wiipic_intr, sc, &sc->sc_irqctx); + return (0); } @@ -210,3 +228,17 @@ wiipic_unmask(device_t dev, unsigned int imr |= (1 << irq); wiipic_imr_write(sc, imr); } + +/* + * Reset button interrupt. + */ +static void +wiipic_intr(void *xsc) +{ + struct wiipic_softc *sc; + + sc = (struct wiipic_softc *)xsc; + if (wiipic_icr_read(sc) & WIIPIC_RBS) + shutdown_nice(RB_AUTOBOOT); +} + Modified: head/sys/powerpc/wii/wii_picreg.h ============================================================================== --- head/sys/powerpc/wii/wii_picreg.h Wed Apr 24 01:20:10 2013 (r249825) +++ head/sys/powerpc/wii/wii_picreg.h Wed Apr 24 01:36:35 2013 (r249826) @@ -30,9 +30,10 @@ #define _POWERPC_WII_WII_PICREG_H #define WIIPIC_REG_ADDR 0x0c003000 -#define WIIPIC_REG_LEN 0x08 +#define WIIPIC_REG_LEN 0x28 #define WIIPIC_ICR 0x00 +#define WIIPIC_RBS 0x10000 #define WIIPIC_IMR 0x04 #define WIIPIC_RESET 0x24 From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 02:41:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D8149FB for ; Wed, 24 Apr 2013 02:41:07 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id CFEE91A95 for ; Wed, 24 Apr 2013 02:41:06 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id em20so15715lab.32 for ; Tue, 23 Apr 2013 19:41:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=2gFaKOsRKHpKCRG3D6EnuZ1DbL/dLoInKSvoh05Qg2s=; b=UwyolPYzjrM/gfADYVPjfl/l0+rpFL9pOEGEwApRmISdCInlbe/MtK/NoMGIpBU0El YSWshzZpksKcqGlUHz6kZEd3KFbXR4hTa1YqYf9pt+xLbSxHXQoUud6iBMXUxDPB14Fp R/lOcgdx4TaYcDqXHXUOmxEZ92ZchAgHB09ZpDy/Cg8ceJJHRJRTIY3M7fy4Y5fguHcS uHlHNkhCICqFO05MRJF1oKM8x6a409Rl9CE/c0r8ZCU+NUayCQ3JHfy/BTDu9500s1Qt dw1LU2+Wis/OgPIxBhjJK0Bzs3b3gDtJ4DmiejXffn2/ZcESaqeS1c/Kd9hg+0/gv+4B 1KeA== X-Received: by 10.152.6.162 with SMTP id c2mr16675568laa.20.1366771264798; Tue, 23 Apr 2013 19:41:04 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 23 Apr 2013 19:40:44 -0700 (PDT) In-Reply-To: <201304230938.r3N9cIV0047961@svn.freebsd.org> References: <201304230938.r3N9cIV0047961@svn.freebsd.org> From: Juli Mallett Date: Tue, 23 Apr 2013 19:40:44 -0700 X-Google-Sender-Auth: qpMlfApFY2H2AjHjnjLbROo-7Ws Message-ID: Subject: Re: svn commit: r249790 - in head/sys/mips: include mips To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQm9SV31vilpkkotRsIaSLRq5i/K1yws8VNbm65AOfwYwfRB3qH3fAcv7Fjwjom9ZafzWyBv Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 02:41:07 -0000 Also: the comment says that the trapframe layout must match regnum.h =E2=80= =94 I don't think that's really true. Why can't we just store things in the trapframe in whatever order we want? Why do they need to match the register numbers. More worrying, however, is that looking at regnum.h brought to my attention the fact that Juniper filed the original license off of the file, and placed a copyright without a license. The same file seems to have been published by SGI under a proprietary/unpublished copyright and under the GPL for Linux, but it's not clear to me that there's a public domain copy that it would have been acceptable for Juniper to assert sole copyright over. It's also definitely unacceptable that Juniper didn't provide a license for that file. I don't see why we shouldn't just replace regnum.h with the NetBSD version, and merge that to all active branches. Since you're trying to update these headers, Warner, it would be great if you could do that. I wish the project had never accepted any code for the MIPS port from Juniper, given their penchant (like OpenBSD's MIPS port =E2=80=94 what is i= t about MIPS ports?) for filing licenses off and placing on their own (or in Juniper's case, none at all.) That's just not acceptable for an open-source project. Juli. On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh wrote: > Author: imp > Date: Tue Apr 23 09:38:18 2013 > New Revision: 249790 > URL: http://svnweb.freebsd.org/changeset/base/249790 > > Log: > Update trapframe to be consistent with the changes made to regnum.h. Th= is > should fix the booting problems people have been seeing. > > Modified: > head/sys/mips/include/frame.h > head/sys/mips/include/regnum.h > head/sys/mips/mips/db_interface.c > head/sys/mips/mips/trap.c > head/sys/mips/mips/vm_machdep.c > > Modified: head/sys/mips/include/frame.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/frame.h Tue Apr 23 06:37:50 2013 (= r249789) > +++ head/sys/mips/include/frame.h Tue Apr 23 09:38:18 2013 (= r249790) > @@ -37,6 +37,8 @@ > #ifndef _MACHINE_FRAME_H_ > #define _MACHINE_FRAME_H_ > > +/* Note: This must also match regnum.h and regdef.h */ > + > struct trapframe { > register_t zero; > register_t ast; > @@ -46,6 +48,16 @@ struct trapframe { > register_t a1; > register_t a2; > register_t a3; > +#if defined(__mips_n32) || defined(__mips_n64) > + register_t a4; > + register_t a5; > + register_t a6; > + register_t a7; > + register_t t0; > + register_t t1; > + register_t t2; > + register_t t3; > +#else > register_t t0; > register_t t1; > register_t t2; > @@ -54,6 +66,7 @@ struct trapframe { > register_t t5; > register_t t6; > register_t t7; > +#endif > register_t s0; > register_t s1; > register_t s2; > > Modified: head/sys/mips/include/regnum.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/regnum.h Tue Apr 23 06:37:50 2013 (= r249789) > +++ head/sys/mips/include/regnum.h Tue Apr 23 09:38:18 2013 (= r249790) > @@ -87,10 +87,10 @@ > #define T1 9 > #define T2 10 > #define T3 11 > -#define TA0 12 > -#define TA1 13 > -#define TA2 14 > -#define TA3 15 > +#define T4 12 > +#define T5 13 > +#define T6 14 > +#define T7 15 > #endif > #define S0 16 > #define S1 17 > > Modified: head/sys/mips/mips/db_interface.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/mips/db_interface.c Tue Apr 23 06:37:50 2013 (= r249789) > +++ head/sys/mips/mips/db_interface.c Tue Apr 23 09:38:18 2013 (= r249790) > @@ -77,6 +77,16 @@ struct db_variable db_regs[] =3D { > { "a1", DB_OFFSET(a1), db_frame }, > { "a2", DB_OFFSET(a2), db_frame }, > { "a3", DB_OFFSET(a3), db_frame }, > +#if defined(__mips_n32) || defined(__mips_n64) > + { "a4", DB_OFFSET(a4), db_frame }, > + { "a5", DB_OFFSET(a5), db_frame }, > + { "a6", DB_OFFSET(a6), db_frame }, > + { "a7", DB_OFFSET(a7), db_frame }, > + { "t0", DB_OFFSET(t0), db_frame }, > + { "t1", DB_OFFSET(t1), db_frame }, > + { "t2", DB_OFFSET(t2), db_frame }, > + { "t3", DB_OFFSET(t3), db_frame }, > +#else > { "t0", DB_OFFSET(t0), db_frame }, > { "t1", DB_OFFSET(t1), db_frame }, > { "t2", DB_OFFSET(t2), db_frame }, > @@ -85,6 +95,7 @@ struct db_variable db_regs[] =3D { > { "t5", DB_OFFSET(t5), db_frame }, > { "t6", DB_OFFSET(t6), db_frame }, > { "t7", DB_OFFSET(t7), db_frame }, > +#endif > { "s0", DB_OFFSET(s0), db_frame }, > { "s1", DB_OFFSET(s1), db_frame }, > { "s2", DB_OFFSET(s2), db_frame }, > > Modified: head/sys/mips/mips/trap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/mips/trap.c Tue Apr 23 06:37:50 2013 (r249789) > +++ head/sys/mips/mips/trap.c Tue Apr 23 09:38:18 2013 (r249790) > @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registe= rs. > */ > - sa->args[3] =3D locr0->t4; > - sa->args[4] =3D locr0->t5; > - sa->args[5] =3D locr0->t6; > - sa->args[6] =3D locr0->t7; > + sa->args[3] =3D locr0->t0; > + sa->args[4] =3D locr0->t1; > + sa->args[5] =3D locr0->t2; > + sa->args[6] =3D locr0->t3; > nsaved +=3D 4; > #ifdef COMPAT_FREEBSD32 > } > @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registe= rs. > */ > - sa->args[4] =3D locr0->t4; > - sa->args[5] =3D locr0->t5; > - sa->args[6] =3D locr0->t6; > - sa->args[7] =3D locr0->t7; > + sa->args[4] =3D locr0->t0; > + sa->args[5] =3D locr0->t1; > + sa->args[6] =3D locr0->t2; > + sa->args[7] =3D locr0->t3; > nsaved +=3D 4; > #ifdef COMPAT_FREEBSD32 > } > @@ -1294,12 +1294,19 @@ log_frame_dump(struct trapframe *frame) > log(LOG_ERR, "\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", > (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2= , (intmax_t)frame->a3); > > +#if defined(__mips_n32) || defined(__mips_n64) > + log(LOG_ERR, "\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta6: %#jx\n", > + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6= , (intmax_t)frame->a7); > + > + log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", > + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2= , (intmax_t)frame->t3); > +#else > log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", > (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2= , (intmax_t)frame->t3); > > log(LOG_ERR, "\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", > (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6= , (intmax_t)frame->t7); > - > +#endif > log(LOG_ERR, "\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", > (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0= , (intmax_t)frame->s1); > > @@ -1334,13 +1341,19 @@ trap_frame_dump(struct trapframe *frame) > > printf("\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", > (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2= , (intmax_t)frame->a3); > +#if defined(__mips_n32) || defined(__mips_n64) > + printf("\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta7: %#jx\n", > + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6= , (intmax_t)frame->a7); > > printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", > (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2= , (intmax_t)frame->t3); > +#else > + printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", > + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2= , (intmax_t)frame->t3); > > printf("\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", > (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6= , (intmax_t)frame->t7); > - > +#endif > printf("\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", > (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0= , (intmax_t)frame->s1); > > > Modified: head/sys/mips/mips/vm_machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/mips/vm_machdep.c Tue Apr 23 06:37:50 2013 (= r249789) > +++ head/sys/mips/mips/vm_machdep.c Tue Apr 23 09:38:18 2013 (= r249790) > @@ -613,6 +613,16 @@ dump_trapframe(struct trapframe *trapfra > DB_PRINT_REG(trapframe, a1); > DB_PRINT_REG(trapframe, a2); > DB_PRINT_REG(trapframe, a3); > +#if defined(__mips_n32) || defined(__mips_n64) > + DB_PRINT_REG(trapframe, a4); > + DB_PRINT_REG(trapframe, a5); > + DB_PRINT_REG(trapframe, a6); > + DB_PRINT_REG(trapframe, a7); > + DB_PRINT_REG(trapframe, t0); > + DB_PRINT_REG(trapframe, t1); > + DB_PRINT_REG(trapframe, t2); > + DB_PRINT_REG(trapframe, t3); > +#else > DB_PRINT_REG(trapframe, t0); > DB_PRINT_REG(trapframe, t1); > DB_PRINT_REG(trapframe, t2); > @@ -621,6 +631,7 @@ dump_trapframe(struct trapframe *trapfra > DB_PRINT_REG(trapframe, t5); > DB_PRINT_REG(trapframe, t6); > DB_PRINT_REG(trapframe, t7); > +#endif > DB_PRINT_REG(trapframe, s0); > DB_PRINT_REG(trapframe, s1); > DB_PRINT_REG(trapframe, s2); From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 03:15:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6D0EEB7; Wed, 24 Apr 2013 03:15:55 +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 9886A1C2B; Wed, 24 Apr 2013 03:15: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 r3O3Ft2a027199; Wed, 24 Apr 2013 03:15:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3O3FtmX027198; Wed, 24 Apr 2013 03:15:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304240315.r3O3FtmX027198@svn.freebsd.org> From: Devin Teske Date: Wed, 24 Apr 2013 03:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249827 - head/usr.sbin/bsdconfig/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 03:15:55 -0000 Author: dteske Date: Wed Apr 24 03:15:55 2013 New Revision: 249827 URL: http://svnweb.freebsd.org/changeset/base/249827 Log: Fix copy/paste error. Modified: head/usr.sbin/bsdconfig/include/messages.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Wed Apr 24 01:36:35 2013 (r249826) +++ head/usr.sbin/bsdconfig/include/messages.subr Wed Apr 24 03:15:55 2013 (r249827) @@ -56,7 +56,7 @@ msg_choose_a_cd_dvd_type="Choose a CD/DV msg_choose_a_dos_partition="Choose a DOS partition" msg_choose_a_floppy_drive="Choose a Floppy drive" msg_choose_a_ufs_partition="Choose a UFS partition" -msg_choose_a_usb_partition="Choose a USB drive" +msg_choose_a_usb_drive="Choose a USB drive" msg_choose_installation_media="Choose Installation Media" msg_choose_installation_media_description="FreeBSD can be installed from a variety of different installation\nmedia, ranging from floppies to an Internet FTP server. If you're\ninstalling FreeBSD from a supported CD/DVD drive then this is generally\nthe best media to use if you have no overriding reason for using other\nmedia." msg_client_error="Client error, you could try an other server" From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 06:05:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B8CEC602; Wed, 24 Apr 2013 06:05:35 +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 AB5CE1096; Wed, 24 Apr 2013 06:05: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 r3O65YNm086525; Wed, 24 Apr 2013 06:05:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3O65Y1I086523; Wed, 24 Apr 2013 06:05:34 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304240605.r3O65Y1I086523@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 24 Apr 2013 06:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249830 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 06:05:35 -0000 Author: hselasky Date: Wed Apr 24 06:05:33 2013 New Revision: 249830 URL: http://svnweb.freebsd.org/changeset/base/249830 Log: Fix playback for Focusrite Scarlett 2i2 USB recording interface. Submitted by: Ed Maste, emaste @ Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Apr 24 04:21:23 2013 (r249829) +++ head/sys/dev/sound/usb/uaudio.c Wed Apr 24 06:05:33 2013 (r249830) @@ -1645,6 +1645,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ bBitResolution = asf1d.v2->bBitResolution; bSubslotSize = asf1d.v2->bSubslotSize; + /* Map 4-byte aligned 24-bit samples into 32-bit */ + if (bBitResolution == 24 && bSubslotSize == 4) + bBitResolution = 32; + if (bBitResolution != (bSubslotSize * 8)) { DPRINTF("Invalid bSubslotSize\n"); goto next_ep; From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 07:49:56 2013 Return-Path: Delivered-To: svn-src-head@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 EB313A4B; Wed, 24 Apr 2013 07:49:56 +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 BF2CE13F0; Wed, 24 Apr 2013 07:49:56 +0000 (UTC) Received: from [192.168.0.2] (cpc10-cmbg15-2-0-cust123.5-4.cable.virginmedia.com [86.30.246.124]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r3O7nm2N047504 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 24 Apr 2013 07:49:49 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r249790 - in head/sys/mips: include mips From: David Chisnall In-Reply-To: Date: Wed, 24 Apr 2013 08:49:43 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201304230938.r3N9cIV0047961@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 07:49:57 -0000 On 24 Apr 2013, at 03:40, Juli Mallett wrote: > I don't see why we shouldn't just replace regnum.h with the NetBSD > version, and merge that to all active branches. Since you're trying > to update these headers, Warner, it would be great if you could do > that. That would probably be sensible. The original problem that motivated = these changes was that ptrace returns the registers in the wrong order, = which is visible in gdb, which displays the registers in the wrong = order. The comment in our gdb indicates that we have the same trap = frame layout as NetBSD, but it turns out that we don't... David From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 10:24:02 2013 Return-Path: Delivered-To: svn-src-head@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 5D575F6E; Wed, 24 Apr 2013 10:24:02 +0000 (UTC) (envelope-from ae@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 507971C90; Wed, 24 Apr 2013 10:24: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 r3OAO2M7081308; Wed, 24 Apr 2013 10:24:02 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OAO2Qx081306; Wed, 24 Apr 2013 10:24:02 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304241024.r3OAO2Qx081306@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 24 Apr 2013 10:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249837 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 10:24:02 -0000 Author: ae Date: Wed Apr 24 10:24:01 2013 New Revision: 249837 URL: http://svnweb.freebsd.org/changeset/base/249837 Log: Remove unused variable. MFC after: 1 week Modified: head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Apr 24 10:20:21 2013 (r249836) +++ head/sys/netinet6/in6_pcb.c Wed Apr 24 10:24:01 2013 (r249837) @@ -106,8 +106,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct in6_addr zeroin6_addr; - int in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Wed Apr 24 10:20:21 2013 (r249836) +++ head/sys/netinet6/in6_var.h Wed Apr 24 10:24:01 2013 (r249837) @@ -542,7 +542,6 @@ do { \ ((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->in6_ifstat->tag++; \ } while (/*CONSTCOND*/ 0) -extern struct in6_addr zeroin6_addr; extern u_char inet6ctlerrmap[]; VNET_DECLARE(unsigned long, in6_maxmtu); #define V_in6_maxmtu VNET(in6_maxmtu) From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 12:36:38 2013 Return-Path: Delivered-To: svn-src-head@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 C6588272; Wed, 24 Apr 2013 12:36: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 B82231261; Wed, 24 Apr 2013 12:36: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 r3OCacfb027164; Wed, 24 Apr 2013 12:36:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OCab5v027157; Wed, 24 Apr 2013 12:36:37 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304241236.r3OCab5v027157@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 24 Apr 2013 12:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249839 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 12:36:38 -0000 Author: des Date: Wed Apr 24 12:36:37 2013 New Revision: 249839 URL: http://svnweb.freebsd.org/changeset/base/249839 Log: Merge updated "no such identity file" patch. PR: bin/178060 Modified: head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/ssh.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Wed Apr 24 11:53:46 2013 (r249838) +++ head/crypto/openssh/readconf.c Wed Apr 24 12:36:37 2013 (r249839) @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.195 2013/02/17 23:16:57 dtucker Exp $ */ +/* $OpenBSD: readconf.c,v 1.196 2013/02/22 04:45:08 dtucker Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -403,7 +403,7 @@ parse_token(const char *cp, const char * int process_config_line(Options *options, const char *host, char *line, const char *filename, int linenum, - int *activep) + int *activep, int userconfig) { char *s, **charptr, *endofnumber, *keyword, *arg, *arg2; char **cpptr, fwdarg[256]; @@ -636,7 +636,7 @@ parse_yesnoask: if (*intptr >= SSH_MAX_IDENTITY_FILES) fatal("%.200s line %d: Too many identity files specified (max %d).", filename, linenum, SSH_MAX_IDENTITY_FILES); - add_identity_file(options, NULL, arg, 1); + add_identity_file(options, NULL, arg, userconfig); } break; @@ -1180,7 +1180,7 @@ parse_int: int read_config_file(const char *filename, const char *host, Options *options, - int checkperm) + int flags) { FILE *f; char line[1024]; @@ -1190,7 +1190,7 @@ read_config_file(const char *filename, c if ((f = fopen(filename, "r")) == NULL) return 0; - if (checkperm) { + if (flags & SSHCONF_CHECKPERM) { struct stat sb; if (fstat(fileno(f), &sb) == -1) @@ -1211,7 +1211,8 @@ read_config_file(const char *filename, c while (fgets(line, sizeof(line), f)) { /* Update line number counter. */ linenum++; - if (process_config_line(options, host, line, filename, linenum, &active) != 0) + if (process_config_line(options, host, line, filename, linenum, + &active, flags & SSHCONF_USERCONF) != 0) bad_options++; } fclose(f); @@ -1394,30 +1395,17 @@ fill_default_options(Options * options) options->protocol = SSH_PROTO_2; if (options->num_identity_files == 0) { if (options->protocol & SSH_PROTO_1) { - len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1; - options->identity_files[options->num_identity_files] = - xmalloc(len); - snprintf(options->identity_files[options->num_identity_files++], - len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY); + add_identity_file(options, "~/", + _PATH_SSH_CLIENT_IDENTITY, 0); } if (options->protocol & SSH_PROTO_2) { - len = 2 + strlen(_PATH_SSH_CLIENT_ID_RSA) + 1; - options->identity_files[options->num_identity_files] = - xmalloc(len); - snprintf(options->identity_files[options->num_identity_files++], - len, "~/%.100s", _PATH_SSH_CLIENT_ID_RSA); - - len = 2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1; - options->identity_files[options->num_identity_files] = - xmalloc(len); - snprintf(options->identity_files[options->num_identity_files++], - len, "~/%.100s", _PATH_SSH_CLIENT_ID_DSA); + add_identity_file(options, "~/", + _PATH_SSH_CLIENT_ID_RSA, 0); + add_identity_file(options, "~/", + _PATH_SSH_CLIENT_ID_DSA, 0); #ifdef OPENSSL_HAS_ECC - len = 2 + strlen(_PATH_SSH_CLIENT_ID_ECDSA) + 1; - options->identity_files[options->num_identity_files] = - xmalloc(len); - snprintf(options->identity_files[options->num_identity_files++], - len, "~/%.100s", _PATH_SSH_CLIENT_ID_ECDSA); + add_identity_file(options, "~/", + _PATH_SSH_CLIENT_ID_ECDSA, 0); #endif } } Modified: head/crypto/openssh/readconf.h ============================================================================== --- head/crypto/openssh/readconf.h Wed Apr 24 11:53:46 2013 (r249838) +++ head/crypto/openssh/readconf.h Wed Apr 24 12:36:37 2013 (r249839) @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.h,v 1.92 2013/02/17 23:16:57 dtucker Exp $ */ +/* $OpenBSD: readconf.h,v 1.93 2013/02/22 04:45:09 dtucker Exp $ */ /* $FreeBSD$ */ /* @@ -163,13 +163,17 @@ typedef struct { #define REQUEST_TTY_YES 2 #define REQUEST_TTY_FORCE 3 +#define SSHCONF_CHECKPERM 1 /* check permissions on config file */ +#define SSHCONF_USERCONF 2 /* user provided config file not system */ + void initialize_options(Options *); void fill_default_options(Options *); int read_config_file(const char *, const char *, Options *, int); int parse_forward(Forward *, const char *, int, int); int -process_config_line(Options *, const char *, char *, const char *, int, int *); +process_config_line(Options *, const char *, char *, const char *, int, int *, + int); void add_local_forward(Options *, const Forward *); void add_remote_forward(Options *, const Forward *); Modified: head/crypto/openssh/ssh.c ============================================================================== --- head/crypto/openssh/ssh.c Wed Apr 24 11:53:46 2013 (r249838) +++ head/crypto/openssh/ssh.c Wed Apr 24 12:36:37 2013 (r249839) @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.371 2013/02/17 23:16:57 dtucker Exp $ */ +/* $OpenBSD: ssh.c,v 1.373 2013/02/22 22:09:01 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -598,7 +598,8 @@ main(int ac, char **av) dummy = 1; line = xstrdup(optarg); if (process_config_line(&options, host ? host : "", - line, "command-line", 0, &dummy) != 0) + line, "command-line", 0, &dummy, SSHCONF_USERCONF) + != 0) exit(255); xfree(line); break; @@ -692,14 +693,15 @@ main(int ac, char **av) * file if the user specifies a config file on the command line. */ if (config != NULL) { - if (!read_config_file(config, host, &options, 0)) + if (!read_config_file(config, host, &options, SSHCONF_USERCONF)) fatal("Can't open user config file %.100s: " "%.100s", config, strerror(errno)); } else { r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, _PATH_SSH_USER_CONFFILE); if (r > 0 && (size_t)r < sizeof(buf)) - (void)read_config_file(buf, host, &options, 1); + (void)read_config_file(buf, host, &options, + SSHCONF_CHECKPERM|SSHCONF_USERCONF); /* Read systemwide configuration file after user config. */ (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, @@ -1611,7 +1613,8 @@ load_public_identity_files(void) fatal("load_public_identity_files: gethostname: %s", strerror(errno)); for (i = 0; i < options.num_identity_files; i++) { - if (n_ids >= SSH_MAX_IDENTITY_FILES) { + if (n_ids >= SSH_MAX_IDENTITY_FILES || + strcasecmp(options.identity_files[i], "none") == 0) { xfree(options.identity_files[i]); continue; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 13:54:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2FC1C582; Wed, 24 Apr 2013 13:54:56 +0000 (UTC) (envelope-from andre@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 221851691; Wed, 24 Apr 2013 13:54: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 r3ODsuEt056910; Wed, 24 Apr 2013 13:54:56 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ODsu9P056909; Wed, 24 Apr 2013 13:54:56 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201304241354.r3ODsu9P056909@svn.freebsd.org> From: Andre Oppermann Date: Wed, 24 Apr 2013 13:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249843 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 13:54:56 -0000 Author: andre Date: Wed Apr 24 13:54:55 2013 New Revision: 249843 URL: http://svnweb.freebsd.org/changeset/base/249843 Log: Base the calculation of maxmbufmem in part on kmem_map size instead of kernel_map size to prevent kernel memory exhaustion by mbufs and a subsequent panic on physical page allocation failure. On architectures without a direct map all mbuf memory (except for jumbo mbufs larger than PAGE_SIZE) comes from kmem_map. It is the limiting factor hence. For architectures with a direct map using the size of kmem_map is a good proxy of available kernel memory as well. If it is much smaller the mbuf limit may be sub-optimal but remains reasonable, while avoiding panics under exhaustion. The overall mbuf memory limit calculation may be reconsidered again later, however due to the many different mbuf sizes and different backing KVM maps it is a tricky subject. Found by: pho's new network stress test Pointed out by: alc (kmem_map instead of kernel_map) Tested by: pho Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Apr 24 13:19:48 2013 (r249842) +++ head/sys/kern/kern_mbuf.c Wed Apr 24 13:54:55 2013 (r249843) @@ -118,7 +118,7 @@ tunable_mbinit(void *dummy) * At most it can be 3/4 of available kernel memory. */ realmem = qmin((quad_t)physmem * PAGE_SIZE, - vm_map_max(kernel_map) - vm_map_min(kernel_map)); + vm_map_max(kmem_map) - vm_map_min(kmem_map)); maxmbufmem = realmem / 2; TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > realmem / 4 * 3) From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 16:13:38 2013 Return-Path: Delivered-To: svn-src-head@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 9BB37342 for ; Wed, 24 Apr 2013 16:13:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pb0-x233.google.com (mail-pb0-x233.google.com [IPv6:2607:f8b0:400e:c01::233]) by mx1.freebsd.org (Postfix) with ESMTP id 755D81E03 for ; Wed, 24 Apr 2013 16:13:38 +0000 (UTC) Received: by mail-pb0-f51.google.com with SMTP id rr4so499755pbb.38 for ; Wed, 24 Apr 2013 09:13:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=NJ9CEtp3qgi2UHXAO/Lxrr9aaiVlcdK8/xo2+ROV63g=; b=fExYdQ7FW1EVxILltTePgNDfSKjfVQtD0UtRReSc+Yc/KHfXCp+CFTWQCff245XEUq Vv6exzHgm+HeYV4gCF33VEZlLmP6n/1dq7IYgKBYeyIk/4d2Y7ZHmz6KLef+ILIdYXeE /247ntNfP5pi4/tM0hyTBXR4ZINlkarFVGT6o3pFYgStPzZxSxecyBBtQKLJoOjMVOMk 0l+l12cL1Qu3V6QUA5OYEeXRs7MRoHAtNxnOAmy6so8qWM8usQ5zSI6GLStba02DxMuh vzTdE52ByDrl95YksdiHRQTSb64ryrdTm2/cfdLN2FOOxN8oiUgr8C2s8qtVLnW67GBR I/8Q== X-Received: by 10.68.244.5 with SMTP id xc5mr48920626pbc.66.1366820017496; Wed, 24 Apr 2013 09:13:37 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id mm9sm3548981pbc.43.2013.04.24.09.13.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 09:13:36 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r249790 - in head/sys/mips: include mips Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 24 Apr 2013 10:13:36 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <6CE3FE8F-25EB-4B13-967B-7C3E6EC3E986@bsdimp.com> References: <201304230938.r3N9cIV0047961@svn.freebsd.org> To: David Chisnall X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQk0TysihOR+M8UXldfWE52DQ/Nm+1MneDXPWYN9scu6SDQO+yu7ojTWjJklsObeNnDLLtc2 Cc: Juli Mallett , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 16:13:38 -0000 On Apr 24, 2013, at 1:49 AM, David Chisnall wrote: > On 24 Apr 2013, at 03:40, Juli Mallett wrote: >=20 >> I don't see why we shouldn't just replace regnum.h with the NetBSD >> version, and merge that to all active branches. Since you're trying >> to update these headers, Warner, it would be great if you could do >> that. >=20 > That would probably be sensible. The original problem that motivated = these changes was that ptrace returns the registers in the wrong order, = which is visible in gdb, which displays the registers in the wrong = order. The comment in our gdb indicates that we have the same trap = frame layout as NetBSD, but it turns out that we don't... We will shortly. I'll be reworking this... Warner From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 16:22:54 2013 Return-Path: Delivered-To: svn-src-head@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 291B2B9D; Wed, 24 Apr 2013 16:22:54 +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 1BD971EA1; Wed, 24 Apr 2013 16:22: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 r3OGMrEx009989; Wed, 24 Apr 2013 16:22:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OGMr04009988; Wed, 24 Apr 2013 16:22:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304241622.r3OGMr04009988@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 24 Apr 2013 16:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249844 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 16:22:54 -0000 Author: hselasky Date: Wed Apr 24 16:22:53 2013 New Revision: 249844 URL: http://svnweb.freebsd.org/changeset/base/249844 Log: Fix the USB audio feedback endpoint algorithm. There should not be any need to bias the returned value. Reported by: Craig Leres Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Apr 24 13:54:55 2013 (r249843) +++ head/sys/dev/sound/usb/uaudio.c Wed Apr 24 16:22:53 2013 (r249844) @@ -1981,10 +1981,6 @@ uaudio_chan_play_sync_callback(struct us while (temp > (sample_rate + (sample_rate / 2))) temp /= 2; - /* bias */ - - temp += (sample_rate + 1999) / 2000; - /* compare */ DPRINTF("Comparing %d < %d\n", From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 16:52:04 2013 Return-Path: Delivered-To: svn-src-head@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 5AF7868C; Wed, 24 Apr 2013 16:52:04 +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 4DE30102B; Wed, 24 Apr 2013 16:52: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 r3OGq4du022000; Wed, 24 Apr 2013 16:52:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OGq4g5021999; Wed, 24 Apr 2013 16:52:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304241652.r3OGq4g5021999@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 24 Apr 2013 16:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249845 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 16:52:04 -0000 Author: hselasky Date: Wed Apr 24 16:52:03 2013 New Revision: 249845 URL: http://svnweb.freebsd.org/changeset/base/249845 Log: Fix for duplicate sample rate detection after recent patches. Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Apr 24 16:22:53 2013 (r249844) +++ head/sys/dev/sound/usb/uaudio.c Wed Apr 24 16:52:03 2013 (r249845) @@ -1816,13 +1816,20 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan->num_alt--; goto next_ep; } - /* we only accumulate one format at different sample rates */ - if (chan->num_alt > 1 && chan->pcm_format[0] != format) { - DPRINTF("Multiple formats is not supported\n"); - chan->num_alt--; - goto next_ep; + if (chan->num_alt > 1) { + /* we only accumulate one format at different sample rates */ + if (chan->pcm_format[0] != format) { + DPRINTF("Multiple formats is not supported\n"); + chan->num_alt--; + goto next_ep; + } + /* ignore if duplicate sample rate entry */ + if (rate == chan->usb_alt[chan->num_alt - 2].sample_rate) { + DPRINTF("Duplicate sample rate detected\n"); + chan->num_alt--; + goto next_ep; + } } - chan->pcm_cap.fmtlist = chan->pcm_format; chan->pcm_cap.fmtlist[0] = format; From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 17:20:46 2013 Return-Path: Delivered-To: svn-src-head@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 3C8AE4AC; Wed, 24 Apr 2013 17:20:46 +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 2EE5E11B8; Wed, 24 Apr 2013 17:20: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 r3OHKkk8033280; Wed, 24 Apr 2013 17:20:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OHKjxb033277; Wed, 24 Apr 2013 17:20:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304241720.r3OHKjxb033277@svn.freebsd.org> From: Dimitry Andric Date: Wed, 24 Apr 2013 17:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249846 - in head/sys/boot: i386/btx/btx pc98/btx/btx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 17:20:46 -0000 Author: dim Date: Wed Apr 24 17:20:45 2013 New Revision: 249846 URL: http://svnweb.freebsd.org/changeset/base/249846 Log: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) MFC after: 1 week Modified: head/sys/boot/i386/btx/btx/btx.S head/sys/boot/pc98/btx/btx/btx.S Modified: head/sys/boot/i386/btx/btx/btx.S ============================================================================== --- head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: head/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 18:00:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89B8D785; Wed, 24 Apr 2013 18:00:29 +0000 (UTC) (envelope-from imp@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 7CEBA136F; Wed, 24 Apr 2013 18:00: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 r3OI0Tnc048301; Wed, 24 Apr 2013 18:00:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OI0TVA048300; Wed, 24 Apr 2013 18:00:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304241800.r3OI0TVA048300@svn.freebsd.org> From: Warner Losh Date: Wed, 24 Apr 2013 18:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249847 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 18:00:29 -0000 Author: imp Date: Wed Apr 24 18:00:28 2013 New Revision: 249847 URL: http://svnweb.freebsd.org/changeset/base/249847 Log: Fix N32/N64 ABIs to use proper registers after recent changes. Pointy Hat to: imp Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Apr 24 17:20:45 2013 (r249846) +++ head/sys/mips/mips/trap.c Wed Apr 24 18:00:28 2013 (r249847) @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[3] = locr0->t0; - sa->args[4] = locr0->t1; - sa->args[5] = locr0->t2; - sa->args[6] = locr0->t3; + sa->args[3] = locr0->a4; + sa->args[4] = locr0->a5; + sa->args[5] = locr0->a6; + sa->args[6] = locr0->a7; nsaved += 4; #ifdef COMPAT_FREEBSD32 } @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[4] = locr0->t0; - sa->args[5] = locr0->t1; - sa->args[6] = locr0->t2; - sa->args[7] = locr0->t3; + sa->args[4] = locr0->a4; + sa->args[5] = locr0->a5; + sa->args[6] = locr0->a6; + sa->args[7] = locr0->a7; nsaved += 4; #ifdef COMPAT_FREEBSD32 } From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 18:30:32 2013 Return-Path: Delivered-To: svn-src-head@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 D1FF7911; Wed, 24 Apr 2013 18:30:32 +0000 (UTC) (envelope-from rrs@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 C50341593; Wed, 24 Apr 2013 18:30: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 r3OIUWnh073003; Wed, 24 Apr 2013 18:30:32 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OIUWiZ073002; Wed, 24 Apr 2013 18:30:32 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201304241830.r3OIUWiZ073002@svn.freebsd.org> From: Randall Stewart Date: Wed, 24 Apr 2013 18:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249848 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 18:30:32 -0000 Author: rrs Date: Wed Apr 24 18:30:32 2013 New Revision: 249848 URL: http://svnweb.freebsd.org/changeset/base/249848 Log: This fixes the issue with the "randomly changing" default route. What it was is there are two places in ip_output.c where we do a goto again. One place was fine, it copies out the new address and then resets dst = ro->rt_dst; But the other place does *not* do that, which means earlier when we found the gateway, we have dst pointing there aka dst = ro->rt_gateway is done.. then we do a goto again.. bam now we clobber the default route. The fix is just to move the again so we are always doing dst = &ro->rt_dst; in the again loop. PR: 174749,157796 MFC after: 1 week Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Apr 24 18:00:28 2013 (r249847) +++ head/sys/netinet/ip_output.c Wed Apr 24 18:30:32 2013 (r249848) @@ -196,8 +196,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } - dst = (struct sockaddr_in *)&ro->ro_dst; again: + dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 19:00:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26FA0554; Wed, 24 Apr 2013 19:00:46 +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 1A22B1713; Wed, 24 Apr 2013 19:00: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 r3OJ0jnx083320; Wed, 24 Apr 2013 19:00:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OJ0jHL083318; Wed, 24 Apr 2013 19:00:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304241900.r3OJ0jHL083318@svn.freebsd.org> From: Alexander Motin Date: Wed, 24 Apr 2013 19:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249849 - in head/sys/dev: hptmv mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 19:00:46 -0000 Author: mav Date: Wed Apr 24 19:00:45 2013 New Revision: 249849 URL: http://svnweb.freebsd.org/changeset/base/249849 Log: Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LAST stage of shutdown_post_sync. That should allow CAM to do final cache flush at the SHUTDOWN_PRI_DEFAULT without using polling magic. MFC after: 3 days Modified: head/sys/dev/hptmv/entry.c head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Wed Apr 24 18:30:32 2013 (r249848) +++ head/sys/dev/hptmv/entry.c Wed Apr 24 19:00:45 2013 (r249849) @@ -2605,9 +2605,11 @@ launch_worker_thread(void) * hpt_worker_thread needs to be suspended after shutdown sync, when fs sync finished. */ #if (__FreeBSD_version < 500043) - EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, hptdaemonproc, SHUTDOWN_PRI_FIRST); + EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, hptdaemonproc, + SHUTDOWN_PRI_LAST); #else - EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, hptdaemonproc, SHUTDOWN_PRI_FIRST); + EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, hptdaemonproc, + SHUTDOWN_PRI_LAST); #endif } /* Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Wed Apr 24 18:30:32 2013 (r249848) +++ head/sys/dev/mpt/mpt_pci.c Wed Apr 24 19:00:45 2013 (r249849) @@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev) } mpt->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, mpt_pci_shutdown, - dev, SHUTDOWN_PRI_DEFAULT); + dev, SHUTDOWN_PRI_LAST); if (mpt->eh == NULL) { mpt_prt(mpt, "shutdown event registration failed\n"); From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 19:03:28 2013 Return-Path: Delivered-To: svn-src-head@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 17DCD7F3; Wed, 24 Apr 2013 19:03:28 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id D492F173E; Wed, 24 Apr 2013 19:03:27 +0000 (UTC) Received: from dhcp170-36-red.yandex.net ([95.108.170.36]) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1UV51n-0009dm-HD; Wed, 24 Apr 2013 23:06:51 +0400 Message-ID: <51782C4A.7050303@FreeBSD.org> Date: Wed, 24 Apr 2013 23:02:34 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130418 Thunderbird/17.0.5 MIME-Version: 1.0 To: Randall Stewart Subject: Re: svn commit: r249848 - head/sys/netinet References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> In-Reply-To: <201304241830.r3OIUWiZ073002@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 19:03:28 -0000 On 24.04.2013 22:30, Randall Stewart wrote: > Author: rrs > Date: Wed Apr 24 18:30:32 2013 > New Revision: 249848 > URL: http://svnweb.freebsd.org/changeset/base/249848 > > Log: > This fixes the issue with the "randomly changing" default > route. What it was is there are two places in ip_output.c > where we do a goto again. One place was fine, it > copies out the new address and then resets dst = ro->rt_dst; > But the other place does *not* do that, which means earlier > when we found the gateway, we have dst pointing there > aka dst = ro->rt_gateway is done.. then we do a > goto again.. bam now we clobber the default route. > > The fix is just to move the again so we are always > doing dst = &ro->rt_dst; in the again loop. Wow. Great job! Thanks! > > PR: 174749,157796 > MFC after: 1 week > > Modified: > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Wed Apr 24 18:00:28 2013 (r249847) > +++ head/sys/netinet/ip_output.c Wed Apr 24 18:30:32 2013 (r249848) > @@ -196,8 +196,8 @@ ip_output(struct mbuf *m, struct mbuf *o > hlen = ip->ip_hl << 2; > } > > - dst = (struct sockaddr_in *)&ro->ro_dst; > again: > + dst = (struct sockaddr_in *)&ro->ro_dst; > ia = NULL; > /* > * If there is a cached route, > From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 21:21:04 2013 Return-Path: Delivered-To: svn-src-head@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 CEC5D4F0; Wed, 24 Apr 2013 21:21:04 +0000 (UTC) (envelope-from mm@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 C0B891EED; Wed, 24 Apr 2013 21:21: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 r3OLL4i1034138; Wed, 24 Apr 2013 21:21:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OLL36w034129; Wed, 24 Apr 2013 21:21:03 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304242121.r3OLL36w034129@svn.freebsd.org> From: Martin Matuska Date: Wed, 24 Apr 2013 21:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249858 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 21:21:04 -0000 Author: mm Date: Wed Apr 24 21:21:03 2013 New Revision: 249858 URL: http://svnweb.freebsd.org/changeset/base/249858 Log: MFV r249857: Merge vendor bugfix for a possible deadlock related to async destroy and improve write performance by introducing a new lock protecting tx_open_txg. Illumos ZFS issues: 3642 dsl_scan_active() should not issue I/O to determine if async destroying is active 3643 txg_delay should not hold the tc_lock MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Apr 24 21:00:52 2013 (r249857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Apr 24 21:21:03 2013 (r249858) @@ -753,12 +753,16 @@ dsl_destroy_head_sync_impl(dsl_dataset_t zil_destroy_sync(dmu_objset_zil(os), tx); if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + dsl_scan_t *scn = dp->dp_scan; + spa_feature_incr(dp->dp_spa, async_destroy, tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj, tx)); + ASSERT(!scn->scn_async_destroying); + scn->scn_async_destroying = B_TRUE; } used = ds->ds_dir->dd_phys->dd_used_bytes; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Apr 24 21:00:52 2013 (r249857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Apr 24 21:21:03 2013 (r249858) @@ -125,6 +125,15 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t t scn = dp->dp_scan = kmem_zalloc(sizeof (dsl_scan_t), KM_SLEEP); scn->scn_dp = dp; + /* + * It's possible that we're resuming a scan after a reboot so + * make sure that the scan_async_destroying flag is initialized + * appropriately. + */ + ASSERT(!scn->scn_async_destroying); + scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, "scrub_func", sizeof (uint64_t), 1, &f); if (err == 0) { @@ -1375,13 +1384,10 @@ dsl_scan_active(dsl_scan_t *scn) if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING) + if (scn->scn_phys.scn_state == DSS_SCANNING || + scn->scn_async_destroying) return (B_TRUE); - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { - return (B_TRUE); - } if (spa_version(scn->scn_dp->dp_spa) >= SPA_VERSION_DEADLISTS) { (void) bpobj_space(&scn->scn_dp->dp_free_bpobj, &used, &comp, &uncomp); @@ -1437,6 +1443,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (err == 0 && spa_feature_is_active(spa, &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + ASSERT(scn->scn_async_destroying); scn->scn_is_bptree = B_TRUE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); @@ -1457,6 +1464,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY0(bptree_free(dp->dp_meta_objset, dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; + scn->scn_async_destroying = B_FALSE; } } if (scn->scn_visited_this_txg) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Wed Apr 24 21:00:52 2013 (r249857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Wed Apr 24 21:21:03 2013 (r249858) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DSL_SCAN_H @@ -82,6 +82,7 @@ typedef struct dsl_scan { /* for freeing blocks */ boolean_t scn_is_bptree; + boolean_t scn_async_destroying; /* for debugging / information */ uint64_t scn_visited_this_txg; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h Wed Apr 24 21:00:52 2013 (r249857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h Wed Apr 24 21:21:03 2013 (r249858) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + #ifndef _SYS_TXG_IMPL_H #define _SYS_TXG_IMPL_H @@ -33,14 +37,55 @@ extern "C" { #endif +/* + * The tx_cpu structure is a per-cpu structure that is used to track + * the number of active transaction holds (tc_count). As transactions + * are assigned into a transaction group the appropriate tc_count is + * incremented to indicate that there are pending changes that have yet + * to quiesce. Consumers evenutally call txg_rele_to_sync() to decrement + * the tc_count. A transaction group is not considered quiesced until all + * tx_cpu structures have reached a tc_count of zero. + * + * This structure is a per-cpu structure by design. Updates to this structure + * are frequent and concurrent. Having a single structure would result in + * heavy lock contention so a per-cpu design was implemented. With the fanned + * out mutex design, consumers only need to lock the mutex associated with + * thread's cpu. + * + * The tx_cpu contains two locks, the tc_lock and tc_open_lock. + * The tc_lock is used to protect all members of the tx_cpu structure with + * the exception of the tc_open_lock. This lock should only be held for a + * short period of time, typically when updating the value of tc_count. + * + * The tc_open_lock protects the tx_open_txg member of the tx_state structure. + * This lock is used to ensure that transactions are only assigned into + * the current open transaction group. In order to move the current open + * transaction group to the quiesce phase, the txg_quiesce thread must + * grab all tc_open_locks, increment the tx_open_txg, and drop the locks. + * The tc_open_lock is held until the transaction is assigned into the + * transaction group. Typically, this is a short operation but if throttling + * is occuring it may be held for longer periods of time. + */ struct tx_cpu { - kmutex_t tc_lock; + kmutex_t tc_open_lock; /* protects tx_open_txg */ + kmutex_t tc_lock; /* protects the rest of this struct */ kcondvar_t tc_cv[TXG_SIZE]; uint64_t tc_count[TXG_SIZE]; list_t tc_callbacks[TXG_SIZE]; /* commit cb list */ - char tc_pad[16]; + char tc_pad[8]; /* pad to fill 3 cache lines */ }; +/* + * The tx_state structure maintains the state information about the different + * stages of the pool's transcation groups. A per pool tx_state structure + * is used to track this information. The tx_state structure also points to + * an array of tx_cpu structures (described above). Although the tx_sync_lock + * is used to protect the members of this structure, it is not used to + * protect the tx_open_txg. Instead a special lock in the tx_cpu structure + * is used. Readers of tx_open_txg must grab the per-cpu tc_open_lock. + * Any thread wishing to update tx_open_txg must grab the tc_open_lock on + * every cpu (see txg_quiesce()). + */ typedef struct tx_state { tx_cpu_t *tx_cpu; /* protects right to enter txg */ kmutex_t tx_sync_lock; /* protects tx_state_t */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Wed Apr 24 21:00:52 2013 (r249857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Wed Apr 24 21:21:03 2013 (r249858) @@ -132,6 +132,8 @@ txg_init(dsl_pool_t *dp, uint64_t txg) int i; mutex_init(&tx->tx_cpu[c].tc_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&tx->tx_cpu[c].tc_open_lock, NULL, MUTEX_DEFAULT, + NULL); for (i = 0; i < TXG_SIZE; i++) { cv_init(&tx->tx_cpu[c].tc_cv[i], NULL, CV_DEFAULT, NULL); @@ -174,6 +176,7 @@ txg_fini(dsl_pool_t *dp) for (c = 0; c < max_ncpus; c++) { int i; + mutex_destroy(&tx->tx_cpu[c].tc_open_lock); mutex_destroy(&tx->tx_cpu[c].tc_lock); for (i = 0; i < TXG_SIZE; i++) { cv_destroy(&tx->tx_cpu[c].tc_cv[i]); @@ -297,10 +300,12 @@ txg_hold_open(dsl_pool_t *dp, txg_handle tx_cpu_t *tc = &tx->tx_cpu[CPU_SEQID]; uint64_t txg; - mutex_enter(&tc->tc_lock); - + mutex_enter(&tc->tc_open_lock); txg = tx->tx_open_txg; + + mutex_enter(&tc->tc_lock); tc->tc_count[txg & TXG_MASK]++; + mutex_exit(&tc->tc_lock); th->th_cpu = tc; th->th_txg = txg; @@ -313,7 +318,8 @@ txg_rele_to_quiesce(txg_handle_t *th) { tx_cpu_t *tc = th->th_cpu; - mutex_exit(&tc->tc_lock); + ASSERT(!MUTEX_HELD(&tc->tc_lock)); + mutex_exit(&tc->tc_open_lock); } void @@ -350,10 +356,10 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg int c; /* - * Grab all tx_cpu locks so nobody else can get into this txg. + * Grab all tc_open_locks so nobody else can get into this txg. */ for (c = 0; c < max_ncpus; c++) - mutex_enter(&tx->tx_cpu[c].tc_lock); + mutex_enter(&tx->tx_cpu[c].tc_open_lock); ASSERT(txg == tx->tx_open_txg); tx->tx_open_txg++; @@ -363,7 +369,7 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg * enter the next transaction group. */ for (c = 0; c < max_ncpus; c++) - mutex_exit(&tx->tx_cpu[c].tc_lock); + mutex_exit(&tx->tx_cpu[c].tc_open_lock); /* * Quiesce the transaction group by waiting for everyone to txg_exit(). From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 21:24:36 2013 Return-Path: Delivered-To: svn-src-head@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 F35AF846; Wed, 24 Apr 2013 21:24:35 +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 E56181F0D; Wed, 24 Apr 2013 21:24: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 r3OLOZub034819; Wed, 24 Apr 2013 21:24:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OLOZW5034818; Wed, 24 Apr 2013 21:24:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304242124.r3OLOZW5034818@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 24 Apr 2013 21:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249859 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 21:24:36 -0000 Author: jilles Date: Wed Apr 24 21:24:35 2013 New Revision: 249859 URL: http://svnweb.freebsd.org/changeset/base/249859 Log: getdtablesize(2): Describe what this function actually does. getdtablesize() returns the limit on new file descriptors; this says nothing about existing descriptors. MFC after: 1 week Modified: head/lib/libc/sys/getdtablesize.2 Modified: head/lib/libc/sys/getdtablesize.2 ============================================================================== --- head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:21:03 2013 (r249858) +++ head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:24:35 2013 (r249859) @@ -28,12 +28,12 @@ .\" @(#)getdtablesize.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 24, 2013 .Dt GETDTABLESIZE 2 .Os .Sh NAME .Nm getdtablesize -.Nd get descriptor table size +.Nd get file descriptor limit .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -41,18 +41,20 @@ .Ft int .Fn getdtablesize void .Sh DESCRIPTION -Each process has a fixed size descriptor table, -which is guaranteed to have at least 20 slots. -The entries in -the descriptor table are numbered with small integers starting at 0. The .Fn getdtablesize -system call returns the size of this table. +system call returns the maximum number of file descriptors +that the current process may open. +The maximum file descriptor number that the system may assign +is the return value minus one. +Existing file descriptor numbers may be higher +if the limit was lowered after they were opened. .Sh SEE ALSO .Xr close 2 , +.Xr closefrom 2 , .Xr dup 2 , -.Xr open 2 , -.Xr select 2 +.Xr getrlimit 2 , +.Xr sysconf 2 .Sh HISTORY The .Fn getdtablesize From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 21:41:25 2013 Return-Path: Delivered-To: svn-src-head@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 29766F84; Wed, 24 Apr 2013 21:41:25 +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 1CBB01FD8; Wed, 24 Apr 2013 21:41: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 r3OLfO7W041054; Wed, 24 Apr 2013 21:41:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OLfOFY041053; Wed, 24 Apr 2013 21:41:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304242141.r3OLfOFY041053@svn.freebsd.org> From: Eitan Adler Date: Wed, 24 Apr 2013 21:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249860 - head/share/syscons/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 21:41:25 -0000 Author: eadler Date: Wed Apr 24 21:41:24 2013 New Revision: 249860 URL: http://svnweb.freebsd.org/changeset/base/249860 Log: Fix the Dvorak Programmer Keymap PR: conf/177572 Submitted by: Sean DuBois Modified: head/share/syscons/keymaps/us.dvorakp.kbd Modified: head/share/syscons/keymaps/us.dvorakp.kbd ============================================================================== --- head/share/syscons/keymaps/us.dvorakp.kbd Wed Apr 24 21:24:35 2013 (r249859) +++ head/share/syscons/keymaps/us.dvorakp.kbd Wed Apr 24 21:41:24 2013 (r249860) @@ -113,5 +113,4 @@ 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O - 108 nop nop nop nop nop nop nop nop - + 108 nop nop nop nop nop nop nop nop O From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 23:32:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 122EFCD3; Wed, 24 Apr 2013 23:32:48 +0000 (UTC) (envelope-from ken@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 04DF913CD; Wed, 24 Apr 2013 23:32: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 r3ONWlrf079632; Wed, 24 Apr 2013 23:32:47 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ONWltn079631; Wed, 24 Apr 2013 23:32:47 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304242332.r3ONWltn079631@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 24 Apr 2013 23:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249862 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 23:32:48 -0000 Author: ken Date: Wed Apr 24 23:32:47 2013 New Revision: 249862 URL: http://svnweb.freebsd.org/changeset/base/249862 Log: Add myself to the committers list. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Apr 24 22:48:21 2013 (r249861) +++ head/share/misc/committers-src.dot Wed Apr 24 23:32:47 2013 (r249862) @@ -194,6 +194,7 @@ jwd [label="John De Boskey\njwd@FreeBSD. kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17"] +ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 23:38:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3338F3E; Wed, 24 Apr 2013 23:38:04 +0000 (UTC) (envelope-from asomers@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 95C8F142A; Wed, 24 Apr 2013 23:38: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 r3ONc4WX080664; Wed, 24 Apr 2013 23:38:04 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ONc4o6080662; Wed, 24 Apr 2013 23:38:04 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201304242338.r3ONc4o6080662@svn.freebsd.org> From: Alan Somers Date: Wed, 24 Apr 2013 23:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249863 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 23:38:04 -0000 Author: asomers Date: Wed Apr 24 23:38:04 2013 New Revision: 249863 URL: http://svnweb.freebsd.org/changeset/base/249863 Log: Add myself as a src committer Approved by: ken (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Apr 24 23:32:47 2013 (r249862) +++ head/share/misc/committers-src.dot Wed Apr 24 23:38:04 2013 (r249863) @@ -111,6 +111,7 @@ andrew [label="Andrew Turner\nandrew@Fre antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] art [label="Artem Belevich\nart@FreeBSD.org\n2011/03/29"] +asomers [label="Alan Somers\nasomers@FreeBSD.org\n2013/04/24"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] @@ -503,6 +504,8 @@ julian -> zec kan -> kib +ken -> asomers + kib -> ae kib -> dchagin kib -> jlh From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 00:17:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE76579C; Thu, 25 Apr 2013 00:17:32 +0000 (UTC) (envelope-from smh@freebsd.org) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 678611584; Thu, 25 Apr 2013 00:17:32 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 431EA20E7088A; Thu, 25 Apr 2013 00:17:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (46-65-172-4.zone16.bethere.co.uk [46.65.172.4]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id 984D320E70885; Thu, 25 Apr 2013 00:17:23 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Martin Matuska" , , , References: <201304110749.r3B7nGxR071588@svn.freebsd.org> Subject: Re: svn commit: r249357 - head/cddl/contrib/opensolaris/lib/libzfs/common Date: Thu, 25 Apr 2013 01:17:53 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 00:17:32 -0000 I believe this needs a little tweak so you don't get issues with zfs send which makes use of holds to ensure snapshots being sent don't get deleted while processing. In essence it should honor the enoent_ok flag and not report such an error to stdout. @@ -4207,6 +4238,9 @@ if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { fnvlist_free(ha.nvl); ret = ENOENT; + if (enoent_ok) + return (ret); + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), zhp->zfs_name, snapname); ----- Original Message ----- From: "Martin Matuska" To: ; ; Sent: Thursday, April 11, 2013 8:49 AM Subject: svn commit: r249357 - head/cddl/contrib/opensolaris/lib/libzfs/common > Author: mm > Date: Thu Apr 11 07:49:16 2013 > New Revision: 249357 > URL: http://svnweb.freebsd.org/changeset/base/249357 > > Log: > Fix libzfs to report error instead of returning zero if trying to hold or > release a non-existing snapshot of a existing dataset. In recursive case > error is reported if no snapshots with the requested name have been found. > > Problem and proposed solution reported to illumos: > 3699 zfs hold or release of a non-existent snapshot does not output error > > MFC after: 8 days > > Modified: > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > > Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 11 07:40:30 2013 (r249356) > +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 11 07:49:16 2013 (r249357) > @@ -4203,6 +4203,17 @@ zfs_hold(zfs_handle_t *zhp, const char * > ha.tag = tag; > ha.recursive = recursive; > (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); > + > + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { > + fnvlist_free(ha.nvl); > + ret = ENOENT; > + (void) snprintf(errbuf, sizeof (errbuf), > + dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), > + zhp->zfs_name, snapname); > + (void) zfs_standard_error(hdl, ret, errbuf); > + return (ret); > + } > + > ret = lzc_hold(ha.nvl, cleanup_fd, &errors); > fnvlist_free(ha.nvl); > > @@ -4304,12 +4315,25 @@ zfs_release(zfs_handle_t *zhp, const cha > nvlist_t *errors; > nvpair_t *elem; > libzfs_handle_t *hdl = zhp->zfs_hdl; > + char errbuf[1024]; > > ha.nvl = fnvlist_alloc(); > ha.snapname = snapname; > ha.tag = tag; > ha.recursive = recursive; > (void) zfs_release_one(zfs_handle_dup(zhp), &ha); > + > + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { > + fnvlist_free(ha.nvl); > + ret = ENOENT; > + (void) snprintf(errbuf, sizeof (errbuf), > + dgettext(TEXT_DOMAIN, > + "cannot release hold from snapshot '%s@%s'"), > + zhp->zfs_name, snapname); > + (void) zfs_standard_error(hdl, ret, errbuf); > + return (ret); > + } > + > ret = lzc_release(ha.nvl, &errors); > fnvlist_free(ha.nvl); > > @@ -4318,8 +4342,6 @@ zfs_release(zfs_handle_t *zhp, const cha > > if (nvlist_next_nvpair(errors, NULL) == NULL) { > /* no hold-specific errors */ > - char errbuf[1024]; > - > (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, > "cannot release")); > switch (errno) { > @@ -4336,8 +4358,6 @@ zfs_release(zfs_handle_t *zhp, const cha > for (elem = nvlist_next_nvpair(errors, NULL); > elem != NULL; > elem = nvlist_next_nvpair(errors, elem)) { > - char errbuf[1024]; > - > (void) snprintf(errbuf, sizeof (errbuf), > dgettext(TEXT_DOMAIN, > "cannot release hold from snapshot '%s'"), > From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 00:39:43 2013 Return-Path: Delivered-To: svn-src-head@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 98BBEFD2; Thu, 25 Apr 2013 00:39:43 +0000 (UTC) (envelope-from jhibbits@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 89043163E; Thu, 25 Apr 2013 00:39: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 r3P0dhg3001898; Thu, 25 Apr 2013 00:39:43 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P0dhG1001897; Thu, 25 Apr 2013 00:39:43 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201304250039.r3P0dhG1001897@svn.freebsd.org> From: Justin Hibbits Date: Thu, 25 Apr 2013 00:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249864 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 00:39:43 -0000 Author: jhibbits Date: Thu Apr 25 00:39:43 2013 New Revision: 249864 URL: http://svnweb.freebsd.org/changeset/base/249864 Log: Introduce kernel coredumps to ppc32 AIM. Leeched from the booke code. MFC after: 2 weeks Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Apr 24 23:38:04 2013 (r249863) +++ head/sys/powerpc/aim/mmu_oea.c Thu Apr 25 00:39:43 2013 (r249864) @@ -167,6 +167,11 @@ struct ofw_map { u_int om_mode; }; +extern unsigned char _etext[]; +extern unsigned char _end[]; + +extern int dumpsys_minidump; + /* * Map of physical memory regions. */ @@ -316,6 +321,9 @@ void moea_kenter(mmu_t, vm_offset_t, vm_ void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma); boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); +vm_offset_t moea_dumpsys_map(mmu_t mmu, struct pmap_md *md, vm_size_t ofs, + vm_size_t *sz); +struct pmap_md * moea_scan_md(mmu_t mmu, struct pmap_md *prev); static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_change_wiring, moea_change_wiring), @@ -363,6 +371,8 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_kenter, moea_kenter), MMUMETHOD(mmu_kenter_attr, moea_kenter_attr), MMUMETHOD(mmu_dev_direct_mapped,moea_dev_direct_mapped), + MMUMETHOD(mmu_scan_md, moea_scan_md), + MMUMETHOD(mmu_dumpsys_map, moea_dumpsys_map), { 0, 0 } }; @@ -2567,3 +2577,104 @@ moea_sync_icache(mmu_t mmu, pmap_t pm, v } PMAP_UNLOCK(pm); } + +vm_offset_t +moea_dumpsys_map(mmu_t mmu, struct pmap_md *md, vm_size_t ofs, + vm_size_t *sz) +{ + if (md->md_vaddr == ~0UL) + return (md->md_paddr + ofs); + else + return (md->md_vaddr + ofs); +} + +/* TODO: Run this on minbar, single calls, to check addresses, offsets, and + * sizes. It should be doing more than just single pages. + */ +struct pmap_md * +moea_scan_md(mmu_t mmu, struct pmap_md *prev) +{ + static struct pmap_md md; + struct pvo_entry *pvo; + vm_offset_t va; + + if (dumpsys_minidump) { + md.md_paddr = ~0UL; /* Minidumps use virtual addresses. */ + if (prev == NULL) { + /* 1st: kernel .data and .bss. */ + md.md_index = 1; + md.md_vaddr = trunc_page((uintptr_t)_etext); + md.md_size = round_page((uintptr_t)_end) - md.md_vaddr; + return (&md); + } + switch (prev->md_index) { + case 1: + /* 2nd: msgbuf and tables (see pmap_bootstrap()). */ + md.md_index = 2; + md.md_vaddr = (vm_offset_t)msgbufp->msg_ptr; + md.md_size = round_page(msgbufp->msg_size); + break; + case 2: + /* 3rd: kernel VM. */ + va = prev->md_vaddr + prev->md_size; + /* Find start of next chunk (from va). */ + while (va < virtual_end) { + /* Don't dump the buffer cache. */ + if (va >= kmi.buffer_sva && + va < kmi.buffer_eva) { + va = kmi.buffer_eva; + continue; + } + pvo = moea_pvo_find_va(kernel_pmap, + va & ~ADDR_POFF, NULL); + if (pvo != NULL && + (pvo->pvo_pte.pte.pte_hi & PTE_VALID)) + break; + va += PAGE_SIZE; + } + if (va < virtual_end) { + md.md_vaddr = va; + va += PAGE_SIZE; + /* Find last page in chunk. */ + while (va < virtual_end) { + /* Don't run into the buffer cache. */ + if (va == kmi.buffer_sva) + break; + pvo = moea_pvo_find_va(kernel_pmap, + va & ~ADDR_POFF, NULL); + if (pvo == NULL || + !(pvo->pvo_pte.pte.pte_hi & PTE_VALID)) + break; + va += PAGE_SIZE; + } + md.md_size = va - md.md_vaddr; + break; + } + md.md_index = 3; + /* FALLTHROUGH */ + default: + return (NULL); + } + } else { /* minidumps */ + mem_regions(&pregions, &pregions_sz, + ®ions, ®ions_sz); + + if (prev == NULL) { + /* first physical chunk. */ + md.md_paddr = pregions[0].mr_start; + md.md_size = pregions[0].mr_size; + md.md_vaddr = ~0UL; + md.md_index = 1; + } else if (md.md_index < pregions_sz) { + md.md_paddr = pregions[md.md_index].mr_start; + md.md_size = pregions[md.md_index].mr_size; + md.md_vaddr = ~0UL; + md.md_index++; + } else { + /* There's no next physical chunk. */ + return (NULL); + } + } + + return (&md); +} From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 04:21:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 694676C9; Thu, 25 Apr 2013 04:21:39 +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 221071E36; Thu, 25 Apr 2013 04:21:39 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id bn7so3081954ieb.41 for ; Wed, 24 Apr 2013 21:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=VEN8a7s5nOpRGEyaeoaG9IggzYurFNrNEBL5VqhQkF0=; b=j+IhorklmnIXd92VZXU9frgQVYBxfEPbkgiyBY2E5eSGxvacaicDvRqCrUraFBR7Hy XRYekvnQGMyH+u72awZif41TmdgzpyqK6qoKN39borDx+fib5CVG4NSWMJV0rNOsscm0 Jjj1YWKA/6SdlQSI2KKXR4LC1jMIH25KOkx4/vyElCLqhBX4W18wJ8tqlN66Hpgqqei/ kh9qL+OAYx1QaAAbDCnDDaRuahqUspgUkxm/+ucx9Ni5tFDb/7lE8jwJPxP1XX1rmXfc g08tRk5HvdXDDGswgrUf0/nzB34Lq834VHHOjzRNCGZfcIuGxs6BKc+WZb5/C3VbM0KU zQaA== X-Received: by 10.42.82.67 with SMTP id c3mr20476453icl.25.1366863698897; Wed, 24 Apr 2013 21:21:38 -0700 (PDT) Received: from gloom ([66.11.160.35]) by mx.google.com with ESMTPSA id xd4sm10457003igb.3.2013.04.24.21.21.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 21:21:37 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Apr 2013 00:21:31 -0400 From: Mark Johnston To: Randall Stewart Subject: Re: svn commit: r249848 - head/sys/netinet Message-ID: <20130425042131.GA3545@gloom> References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304241830.r3OIUWiZ073002@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 04:21:39 -0000 On Wed, Apr 24, 2013 at 06:30:32PM +0000, Randall Stewart wrote: > Author: rrs > Date: Wed Apr 24 18:30:32 2013 > New Revision: 249848 > URL: http://svnweb.freebsd.org/changeset/base/249848 > > Log: > This fixes the issue with the "randomly changing" default > route. What it was is there are two places in ip_output.c > where we do a goto again. One place was fine, it > copies out the new address and then resets dst = ro->rt_dst; > But the other place does *not* do that, which means earlier > when we found the gateway, we have dst pointing there > aka dst = ro->rt_gateway is done.. then we do a > goto again.. bam now we clobber the default route. > > The fix is just to move the again so we are always > doing dst = &ro->rt_dst; in the again loop. Hi Randall, >From my reading of ip6_output() it seems as though a similar bug exists in the IPv6 case. It's not as bad though: the clobbering write to *dst only happens if the route lookup of the rewritten destination address doesn't return anything. So we'd need to have an IPv6 packet match a gateway route and then be diverted by a pfil hook to a destination for which selectroute() returns a NULL route. In this case we'll see the same problem as in the IPv4 case - the original gateway route will be clobbered. Would you (or anyone familiar with the code in question) be able to take a look and confirm whether this is the case? The fix would be the same I think (patch below). Thanks! -Mark Index: ip6_output.c =================================================================== --- ip6_output.c (revision 249866) +++ ip6_output.c (working copy) @@ -519,7 +519,6 @@ ro_pmtu = ro; if (opt && opt->ip6po_rthdr) ro = &opt->ip6po_route; - dst = (struct sockaddr_in6 *)&ro->ro_dst; #ifdef FLOWTABLE if (ro->ro_rt == NULL) { struct flentry *fle; @@ -536,6 +535,8 @@ } #endif again: + dst = (struct sockaddr_in6 *)&ro->ro_dst; + /* * if specified, try to fill in the traffic class field. * do not override if a non-zero value is already set. From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 04:53:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76DE8CD0; Thu, 25 Apr 2013 04:53:02 +0000 (UTC) (envelope-from imp@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 69A141EF8; Thu, 25 Apr 2013 04:53: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 r3P4r2mX093910; Thu, 25 Apr 2013 04:53:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P4r28N093909; Thu, 25 Apr 2013 04:53:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304250453.r3P4r28N093909@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Apr 2013 04:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249878 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 04:53:02 -0000 Author: imp Date: Thu Apr 25 04:53:01 2013 New Revision: 249878 URL: http://svnweb.freebsd.org/changeset/base/249878 Log: Fix mips64 and mipsn32 bilds by using proper register names. Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Thu Apr 25 02:27:13 2013 (r249877) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Thu Apr 25 04:53:01 2013 (r249878) @@ -115,6 +115,16 @@ static int kgdb_trgt_frame_offset[] = { offsetof(struct trapframe, a1), offsetof(struct trapframe, a2), offsetof(struct trapframe, a3), +#if defined(__mips_n32) || defined(__mips_n64) + offsetof(struct trapframe, a4), + offsetof(struct trapframe, a5), + offsetof(struct trapframe, a6), + offsetof(struct trapframe, a7), + offsetof(struct trapframe, t0), + offsetof(struct trapframe, t1), + offsetof(struct trapframe, t2), + offsetof(struct trapframe, t3), +#else offsetof(struct trapframe, t0), offsetof(struct trapframe, t1), offsetof(struct trapframe, t2), @@ -123,6 +133,7 @@ static int kgdb_trgt_frame_offset[] = { offsetof(struct trapframe, t5), offsetof(struct trapframe, t6), offsetof(struct trapframe, t7), +#endif offsetof(struct trapframe, s0), offsetof(struct trapframe, s1), offsetof(struct trapframe, s2), From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 04:56:45 2013 Return-Path: Delivered-To: svn-src-head@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 4920EE77; Thu, 25 Apr 2013 04:56:45 +0000 (UTC) (envelope-from grehan@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 2A8571F13; Thu, 25 Apr 2013 04:56: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 r3P4ujXD094658; Thu, 25 Apr 2013 04:56:45 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P4uivU094650; Thu, 25 Apr 2013 04:56:44 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201304250456.r3P4uivU094650@svn.freebsd.org> From: Peter Grehan Date: Thu, 25 Apr 2013 04:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249879 - in head/sys/amd64: include vmm vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 04:56:45 -0000 Author: grehan Date: Thu Apr 25 04:56:43 2013 New Revision: 249879 URL: http://svnweb.freebsd.org/changeset/base/249879 Log: Add RIP-relative addressing to the instruction decoder. Rework the guest register fetch code to allow the RIP to be extracted from the VMCS while the kernel decoder is functioning. Hit by the OpenBSD local-apic code. Submitted by: neel Reviewed by: grehan Obtained from: NetApp Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/include/vmm.h Thu Apr 25 04:56:43 2013 (r249879) @@ -135,12 +135,12 @@ enum vcpu_state { }; int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); -enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu); +enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu, int *hostcpu); static int __inline -vcpu_is_running(struct vm *vm, int vcpu) +vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu) { - return (vcpu_get_state(vm, vcpu) == VCPU_RUNNING); + return (vcpu_get_state(vm, vcpu, hostcpu) == VCPU_RUNNING); } void *vcpu_stats(struct vm *vm, int vcpu); Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/vmm/intel/vmcs.c Thu Apr 25 04:56:43 2013 (r249879) @@ -174,7 +174,7 @@ vmcs_seg_desc_encoding(int seg, uint32_t } int -vmcs_getreg(struct vmcs *vmcs, int ident, uint64_t *retval) +vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *retval) { int error; uint32_t encoding; @@ -194,14 +194,19 @@ vmcs_getreg(struct vmcs *vmcs, int ident if (encoding == (uint32_t)-1) return (EINVAL); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); + error = vmread(encoding, retval); - VMCLEAR(vmcs); + + if (!running) + VMCLEAR(vmcs); + return (error); } int -vmcs_setreg(struct vmcs *vmcs, int ident, uint64_t val) +vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val) { int error; uint32_t encoding; @@ -216,9 +221,14 @@ vmcs_setreg(struct vmcs *vmcs, int ident val = vmcs_fix_regval(encoding, val); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); + error = vmwrite(encoding, val); - VMCLEAR(vmcs); + + if (!running) + VMCLEAR(vmcs); + return (error); } Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/vmm/intel/vmcs.h Thu Apr 25 04:56:43 2013 (r249879) @@ -52,8 +52,8 @@ int vmcs_set_defaults(struct vmcs *vmcs, uint32_t procbased_ctls2, uint32_t exit_ctls, uint32_t entry_ctls, u_long msr_bitmap, uint16_t vpid); -int vmcs_getreg(struct vmcs *vmcs, int ident, uint64_t *retval); -int vmcs_setreg(struct vmcs *vmcs, int ident, uint64_t val); +int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); +int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); int vmcs_getdesc(struct vmcs *vmcs, int ident, struct seg_desc *desc); int vmcs_setdesc(struct vmcs *vmcs, int ident, Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/vmm/intel/vmx.c Thu Apr 25 04:56:43 2013 (r249879) @@ -667,11 +667,11 @@ vmx_setup_cr_shadow(int which, struct vm shadow_value = cr4_ones_mask; } - error = vmcs_setreg(vmcs, VMCS_IDENT(mask_ident), mask_value); + error = vmcs_setreg(vmcs, 0, VMCS_IDENT(mask_ident), mask_value); if (error) return (error); - error = vmcs_setreg(vmcs, VMCS_IDENT(shadow_ident), shadow_value); + error = vmcs_setreg(vmcs, 0, VMCS_IDENT(shadow_ident), shadow_value); if (error) return (error); @@ -1617,49 +1617,34 @@ vmxctx_setreg(struct vmxctx *vmxctx, int static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval) { + int running, hostcpu; struct vmx *vmx = arg; + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_getreg: %s%d is running", vm_name(vmx->vm), vcpu); + if (vmxctx_getreg(&vmx->ctx[vcpu], reg, retval) == 0) return (0); - /* - * If the vcpu is running then don't mess with the VMCS. - * - * vmcs_getreg will VMCLEAR the vmcs when it is done which will cause - * the subsequent vmlaunch/vmresume to fail. - */ - if (vcpu_is_running(vmx->vm, vcpu)) - panic("vmx_getreg: %s%d is running", vm_name(vmx->vm), vcpu); - - return (vmcs_getreg(&vmx->vmcs[vcpu], reg, retval)); + return (vmcs_getreg(&vmx->vmcs[vcpu], running, reg, retval)); } static int vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) { - int error; + int error, hostcpu, running; uint64_t ctls; struct vmx *vmx = arg; - /* - * XXX Allow caller to set contents of the guest registers saved in - * the 'vmxctx' even though the vcpu might be running. We need this - * specifically to support the rdmsr emulation that will set the - * %eax and %edx registers during vm exit processing. - */ + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_setreg: %s%d is running", vm_name(vmx->vm), vcpu); + if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); - /* - * If the vcpu is running then don't mess with the VMCS. - * - * vmcs_setreg will VMCLEAR the vmcs when it is done which will cause - * the subsequent vmlaunch/vmresume to fail. - */ - if (vcpu_is_running(vmx->vm, vcpu)) - panic("vmx_setreg: %s%d is running", vm_name(vmx->vm), vcpu); - - error = vmcs_setreg(&vmx->vmcs[vcpu], reg, val); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { /* @@ -1669,13 +1654,13 @@ vmx_setreg(void *arg, int vcpu, int reg, */ if ((entry_ctls & VM_ENTRY_LOAD_EFER) != 0 && (reg == VM_REG_GUEST_EFER)) { - vmcs_getreg(&vmx->vmcs[vcpu], + vmcs_getreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_ENTRY_CTLS), &ctls); if (val & EFER_LMA) ctls |= VM_ENTRY_GUEST_LMA; else ctls &= ~VM_ENTRY_GUEST_LMA; - vmcs_setreg(&vmx->vmcs[vcpu], + vmcs_setreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_ENTRY_CTLS), ctls); } } @@ -1722,7 +1707,7 @@ vmx_inject(void *arg, int vcpu, int type * If there is already an exception pending to be delivered to the * vcpu then just return. */ - error = vmcs_getreg(vmcs, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), &info); + error = vmcs_getreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), &info); if (error) return (error); @@ -1731,12 +1716,12 @@ vmx_inject(void *arg, int vcpu, int type info = vector | (type_map[type] << 8) | (code_valid ? 1 << 11 : 0); info |= VMCS_INTERRUPTION_INFO_VALID; - error = vmcs_setreg(vmcs, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), info); + error = vmcs_setreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), info); if (error != 0) return (error); if (code_valid) { - error = vmcs_setreg(vmcs, + error = vmcs_setreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_EXCEPTION_ERROR), code); } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/vmm/vmm.c Thu Apr 25 04:56:43 2013 (r249879) @@ -894,7 +894,7 @@ vcpu_set_state(struct vm *vm, int vcpuid } enum vcpu_state -vcpu_get_state(struct vm *vm, int vcpuid) +vcpu_get_state(struct vm *vm, int vcpuid, int *hostcpu) { struct vcpu *vcpu; enum vcpu_state state; @@ -906,6 +906,8 @@ vcpu_get_state(struct vm *vm, int vcpuid vcpu_lock(vcpu); state = vcpu->state; + if (hostcpu != NULL) + *hostcpu = vcpu->hostcpu; vcpu_unlock(vcpu); return (state); Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu Apr 25 04:53:01 2013 (r249878) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu Apr 25 04:56:43 2013 (r249879) @@ -50,7 +50,10 @@ __FBSDID("$FreeBSD$"); #include #endif /* _KERNEL */ - +enum cpu_mode { + CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ + CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ +}; /* struct vie_op.op_type */ enum { @@ -133,32 +136,10 @@ static uint64_t size2mask[] = { }; static int -vie_valid_register(enum vm_reg_name reg) -{ -#ifdef _KERNEL - /* - * XXX - * The operand register in which we store the result of the - * read must be a GPR that we can modify even if the vcpu - * is "running". All the GPRs qualify except for %rsp. - * - * This is a limitation of the vm_set_register() API - * and can be fixed if necessary. - */ - if (reg == VM_REG_GUEST_RSP) - return (0); -#endif - return (1); -} - -static int vie_read_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t *rval) { int error; - if (!vie_valid_register(reg)) - return (EINVAL); - error = vm_get_register(vm, vcpuid, reg, rval); return (error); @@ -196,9 +177,6 @@ vie_read_bytereg(void *vm, int vcpuid, s } } - if (!vie_valid_register(reg)) - return (EINVAL); - error = vm_get_register(vm, vcpuid, reg, &val); *rval = val >> rshift; return (error); @@ -211,9 +189,6 @@ vie_update_register(void *vm, int vcpuid int error; uint64_t origval; - if (!vie_valid_register(reg)) - return (EINVAL); - switch (size) { case 1: case 2: @@ -583,13 +558,16 @@ decode_opcode(struct vie *vie) return (0); } -/* - * XXX assuming 32-bit or 64-bit guest - */ static int decode_modrm(struct vie *vie) { uint8_t x; + enum cpu_mode cpu_mode; + + /* + * XXX assuming that guest is in IA-32E 64-bit mode + */ + cpu_mode = CPU_MODE_64BIT; if (vie_peek(vie, &x)) return (-1); @@ -642,7 +620,18 @@ decode_modrm(struct vie *vie) case VIE_MOD_INDIRECT: if (vie->rm == VIE_RM_DISP32) { vie->disp_bytes = 4; - vie->base_register = VM_REG_LAST; /* no base */ + /* + * Table 2-7. RIP-Relative Addressing + * + * In 64-bit mode mod=00 r/m=101 implies [rip] + disp32 + * whereas in compatibility mode it just implies disp32. + */ + + if (cpu_mode == CPU_MODE_64BIT) + vie->base_register = VM_REG_GUEST_RIP; + else + vie->base_register = VM_REG_LAST; + } break; } @@ -812,6 +801,13 @@ verify_gla(struct vm *vm, int cpuid, uin error, vie->base_register); return (-1); } + + /* + * RIP-relative addressing starts from the following + * instruction + */ + if (vie->base_register == VM_REG_GUEST_RIP) + base += vie->num_valid; } idx = 0; From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:05:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40975A89; Thu, 25 Apr 2013 06:05:44 +0000 (UTC) (envelope-from rpaulo@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 1A16E10C0; Thu, 25 Apr 2013 06:05: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 r3P65hv5019207; Thu, 25 Apr 2013 06:05:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P65hN8019206; Thu, 25 Apr 2013 06:05:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304250605.r3P65hN8019206@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Apr 2013 06:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249880 - in head/gnu/usr.bin/cc: f77 f771 f77doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:05:44 -0000 Author: rpaulo Date: Thu Apr 25 06:05:43 2013 New Revision: 249880 URL: http://svnweb.freebsd.org/changeset/base/249880 Log: Remove the Fortran directories. Deleted: head/gnu/usr.bin/cc/f77/ head/gnu/usr.bin/cc/f771/ head/gnu/usr.bin/cc/f77doc/ From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:28:19 2013 Return-Path: Delivered-To: svn-src-head@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 A6EC8157; Thu, 25 Apr 2013 06:28:19 +0000 (UTC) (envelope-from imp@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 988461152; Thu, 25 Apr 2013 06:28: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 r3P6SJOK026785; Thu, 25 Apr 2013 06:28:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P6SJvJ026784; Thu, 25 Apr 2013 06:28:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304250628.r3P6SJvJ026784@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Apr 2013 06:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249881 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:28:19 -0000 Author: imp Date: Thu Apr 25 06:28:19 2013 New Revision: 249881 URL: http://svnweb.freebsd.org/changeset/base/249881 Log: Use the defines from pcb.h over the ones from regnum.h for this 'C' code. In theory, the ones from regnum.h should be used only for assembler code. Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Thu Apr 25 06:05:43 2013 (r249880) +++ head/sys/mips/mips/db_trace.c Thu Apr 25 06:28:19 2013 (r249881) @@ -423,9 +423,9 @@ db_trace_thread(struct thread *thr, int } else { ctx = kdb_thr_ctx(thr); - sp = (register_t)ctx->pcb_context[PREG_SP]; - pc = (register_t)ctx->pcb_context[PREG_PC]; - ra = (register_t)ctx->pcb_context[PREG_RA]; + sp = (register_t)ctx->pcb_context[PCB_REG_SP]; + pc = (register_t)ctx->pcb_context[PCB_REG_PC]; + ra = (register_t)ctx->pcb_context[PCB_REG_RA]; } stacktrace_subr(pc, sp, ra, From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:29:23 2013 Return-Path: Delivered-To: svn-src-head@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 EA2F62D5; Thu, 25 Apr 2013 06:29:23 +0000 (UTC) (envelope-from imp@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 DC01A115A; Thu, 25 Apr 2013 06:29: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 r3P6TNMv027001; Thu, 25 Apr 2013 06:29:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P6TNuI027000; Thu, 25 Apr 2013 06:29:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304250629.r3P6TNuI027000@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Apr 2013 06:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249882 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:29:24 -0000 Author: imp Date: Thu Apr 25 06:29:23 2013 New Revision: 249882 URL: http://svnweb.freebsd.org/changeset/base/249882 Log: Make it possible to include this file in assembler .S sources. Modified: head/sys/mips/include/pcb.h Modified: head/sys/mips/include/pcb.h ============================================================================== --- head/sys/mips/include/pcb.h Thu Apr 25 06:28:19 2013 (r249881) +++ head/sys/mips/include/pcb.h Thu Apr 25 06:29:23 2013 (r249882) @@ -42,20 +42,7 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ -#include - /* - * MIPS process control block - */ -struct pcb -{ - struct trapframe pcb_regs; /* saved CPU and registers */ - __register_t pcb_context[14]; /* kernel context for resume */ - void *pcb_onfault; /* for copyin/copyout faults */ - register_t pcb_tpc; -}; - -/* these match the regnum's in regnum.h * used by switch.S */ #define PCB_REG_S0 0 @@ -73,6 +60,19 @@ struct pcb #define PCB_REG_GP 12 #define PCB_REG_PC 13 +#ifndef LOCORE +#include + +/* + * MIPS process control block + */ +struct pcb +{ + struct trapframe pcb_regs; /* saved CPU and registers */ + __register_t pcb_context[14]; /* kernel context for resume */ + void *pcb_onfault; /* for copyin/copyout faults */ + register_t pcb_tpc; +}; #ifdef _KERNEL extern struct pcb *curpcb; /* the current running pcb */ @@ -80,5 +80,6 @@ extern struct pcb *curpcb; /* the curre void makectx(struct trapframe *, struct pcb *); int savectx(struct pcb *) __returns_twice; #endif +#endif #endif /* !_MACHINE_PCB_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:45:27 2013 Return-Path: Delivered-To: svn-src-head@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 9ACBB76F; Thu, 25 Apr 2013 06:45:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1176811D2; Thu, 25 Apr 2013 06:45:25 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA11867; Thu, 25 Apr 2013 09:45:17 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UVFvg-0000QO-Il; Thu, 25 Apr 2013 09:45:16 +0300 Message-ID: <5178D0F9.9000801@FreeBSD.org> Date: Thu, 25 Apr 2013 09:45:13 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Mark Johnston Subject: Re: svn commit: r248644 - head/cddl/contrib/opensolaris/lib/libdtrace/common References: <201303230857.r2N8vsHL058716@svn.freebsd.org> <20130421030818.GA23819@gloom> In-Reply-To: <20130421030818.GA23819@gloom> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:45:27 -0000 on 21/04/2013 06:08 Mark Johnston said the following: > On Sat, Mar 23, 2013 at 08:57:54AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 23 08:57:54 2013 >> New Revision: 248644 >> URL: http://svnweb.freebsd.org/changeset/base/248644 >> >> Log: >> dtrace: ensure that we can always catch a process (e.g. when -c is used) >> >> It is not guaranteed that a program has a symbol table entry for main >> and thus that it would be possible to set a breakpoint on it. >> >> Reviewed by: rpaulo >> Discussed with: rpaulo >> MFC after: 13 days > > Hi Andriy, > > This commit seems to break USDT for me. When I for instance try to run > the toy example at https://wiki.freebsd.org/DTrace/userland (the > database provider), I get > > markj@gloom: ~/tmp/dtrace/db $ sudo dtrace -s db.d -c ./db > dtrace: failed to compile script db.d: line 2: probe description database23147:::query-start does not match any probes > > When I revert this commit and recompile the example program and > libdtrace, it works as expected. Mark, thank you very much for the report. It seems that I didn't fully understand consequences of the change when I made it. I am still looking into the details of the relevant differences between Solaris/Illumos and FreeBSD. Because I am going on a vacation I've decided to revert this commit for now. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:55:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42C2FB7E; Thu, 25 Apr 2013 06:55:58 +0000 (UTC) (envelope-from mm@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 34938121C; Thu, 25 Apr 2013 06:55: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 r3P6twUC036631; Thu, 25 Apr 2013 06:55:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P6tw1T036630; Thu, 25 Apr 2013 06:55:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304250655.r3P6tw1T036630@svn.freebsd.org> From: Martin Matuska Date: Thu, 25 Apr 2013 06:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249883 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:55:58 -0000 Author: mm Date: Thu Apr 25 06:55:57 2013 New Revision: 249883 URL: http://svnweb.freebsd.org/changeset/base/249883 Log: Respect the enoent_ok flag if reporting error for holding an non-existing snapshot. Related illumos ZFS issue: 3699 zfs hold or release of a non-existent snapshot does not output error Reported by: Steven Hartland MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 25 06:29:23 2013 (r249882) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 25 06:55:57 2013 (r249883) @@ -4207,10 +4207,13 @@ zfs_hold(zfs_handle_t *zhp, const char * if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { fnvlist_free(ha.nvl); ret = ENOENT; - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (!enoent_ok) { + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 07:04:57 2013 Return-Path: Delivered-To: svn-src-head@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 675B9E87; Thu, 25 Apr 2013 07:04:57 +0000 (UTC) (envelope-from avg@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 59948126E; Thu, 25 Apr 2013 07:04: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 r3P74vCK040090; Thu, 25 Apr 2013 07:04:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P74v3N040089; Thu, 25 Apr 2013 07:04:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201304250704.r3P74v3N040089@svn.freebsd.org> From: Andriy Gapon Date: Thu, 25 Apr 2013 07:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249884 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 07:04:57 -0000 Author: avg Date: Thu Apr 25 07:04:56 2013 New Revision: 249884 URL: http://svnweb.freebsd.org/changeset/base/249884 Log: revert r248644 because of the regression for usdt probes USDT probes are advertised to kernel by initialization code with atrribute((constructor))). It seems that on Solaris the .init-ish code of the main object is executed before RD_PREINIT point is hit. On FreeBSD that is not the case. And because on FreeBSD there is no other well-defined point between RD_PREINIT and main() we have to parse a DTrace script when main is hit, for time being. A footnote: currently we actually post RD_POSTINIT event, but that's a bug because the event is triggered by hitting r_debug_state which happens before any init code is executed. Reported by: markj Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Thu Apr 25 06:55:57 2013 (r249883) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Thu Apr 25 07:04:56 2013 (r249884) @@ -1130,7 +1130,7 @@ alloc: #if defined(sun) dtp->dt_prcmode = DT_PROC_STOP_PREINIT; #else - dtp->dt_prcmode = DT_PROC_STOP_POSTINIT; + dtp->dt_prcmode = DT_PROC_STOP_MAIN; #endif dtp->dt_linkmode = DT_LINK_KERNEL; dtp->dt_linktype = DT_LTYP_ELF; From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 08:25:01 2013 Return-Path: Delivered-To: svn-src-head@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 79B1C990; Thu, 25 Apr 2013 08:25:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id EB8D8153D; Thu, 25 Apr 2013 08:24:59 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r3P8Owu1068878; Thu, 25 Apr 2013 12:24:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r3P8Owfw068877; Thu, 25 Apr 2013 12:24:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 25 Apr 2013 12:24:58 +0400 From: Gleb Smirnoff To: Randall Stewart Subject: Re: svn commit: r249848 - head/sys/netinet Message-ID: <20130425082458.GG76816@glebius.int.ru> References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b//ZgE2eAae+kIBt" Content-Disposition: inline In-Reply-To: <201304241830.r3OIUWiZ073002@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 08:25:01 -0000 --b//ZgE2eAae+kIBt Content-Type: text/plain; charset=koi8-r Content-Disposition: inline On Wed, Apr 24, 2013 at 06:30:32PM +0000, Randall Stewart wrote: R> Author: rrs R> Date: Wed Apr 24 18:30:32 2013 R> New Revision: 249848 R> URL: http://svnweb.freebsd.org/changeset/base/249848 R> R> Log: R> This fixes the issue with the "randomly changing" default R> route. What it was is there are two places in ip_output.c R> where we do a goto again. One place was fine, it R> copies out the new address and then resets dst = ro->rt_dst; R> But the other place does *not* do that, which means earlier R> when we found the gateway, we have dst pointing there R> aka dst = ro->rt_gateway is done.. then we do a R> goto again.. bam now we clobber the default route. R> R> The fix is just to move the again so we are always R> doing dst = &ro->rt_dst; in the again loop. R> R> PR: 174749,157796 R> MFC after: 1 week This dst pointing either on stack or into routing table is dangerous. We already have several places where the problem is carefully handled, and now you fixed another one. Nevertheless this is subtle and leaves a place for future bugs. I think we should introduce a pointer to const struct sockaddr_in, which either matches dst or rte->rt_gateway. Patch attached. -- Totus tuus, Glebius. --b//ZgE2eAae+kIBt Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="ip_output.c.diff" Index: ip_output.c =================================================================== --- ip_output.c (revision 249884) +++ ip_output.c (working copy) @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct int n; /* scratchpad */ int error = 0; struct sockaddr_in *dst; + const struct sockaddr_in *gw; struct in_ifaddr *ia; int isbroadcast; uint16_t ip_len, ip_off; @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct hlen = ip->ip_hl << 2; } + gw = dst = (struct sockaddr_in *)&ro->ro_dst; again: - dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, @@ -297,11 +298,11 @@ again: ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rte->rt_gateway; + gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_broadcast(gw->sin_addr, ifp); } /* * Calculate MTU. If we have a route that is up, use that, @@ -327,12 +328,6 @@ again: if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; /* - * IP destination address is multicast. Make sure "dst" - * still points to the address in "ro". (It may have been - * changed to point to a gateway address, above.) - */ - dst = (struct sockaddr_in *)&ro->ro_dst; - /* * See if the caller provided any multicast options */ if (imo != NULL) { @@ -559,7 +554,6 @@ sendit: /* Or forward to some other address? */ if ((m->m_flags & M_IP_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { - dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; @@ -628,8 +622,7 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro); goto done; } @@ -663,7 +656,7 @@ passout: m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + (struct sockaddr *)gw, ro); } else m_freem(m); } --b//ZgE2eAae+kIBt-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 08:43:45 2013 Return-Path: Delivered-To: svn-src-head@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 4F2E0636; Thu, 25 Apr 2013 08:43:45 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id DA8571638; Thu, 25 Apr 2013 08:43:44 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1UVHW1-0008R7-Dz; Thu, 25 Apr 2013 10:26:53 +0200 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UVHVz-0003Nf-RC; Thu, 25 Apr 2013 10:26:51 +0200 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Alexander Motin" Subject: Re: svn commit: r249849 - in head/sys/dev: hptmv mpt References: <201304241900.r3OJ0jHL083318@svn.freebsd.org> Date: Thu, 25 Apr 2013 10:26:50 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201304241900.r3OJ0jHL083318@svn.freebsd.org> User-Agent: Opera Mail/12.15 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.5 X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.1 X-Scan-Signature: 2c269fdec788119c0964d98755c55204 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 08:43:45 -0000 Hi, Maybe I need more coffee, but I don't see a difference between the if and the else statements in the hptmv file. Regards, Ronald. On Wed, 24 Apr 2013 21:00:45 +0200, Alexander Motin wrote: > Author: mav > Date: Wed Apr 24 19:00:45 2013 > New Revision: 249849 > URL: http://svnweb.freebsd.org/changeset/base/249849 > > Log: > Move hptmv and mpt drivers shutdown a bit later to the > SHUTDOWN_PRI_LAST > stage of shutdown_post_sync. That should allow CAM to do final cache > flush > at the SHUTDOWN_PRI_DEFAULT without using polling magic. > MFC after: 3 days > > Modified: > head/sys/dev/hptmv/entry.c > head/sys/dev/mpt/mpt_pci.c > > Modified: head/sys/dev/hptmv/entry.c > ============================================================================== > --- head/sys/dev/hptmv/entry.c Wed Apr 24 18:30:32 2013 (r249848) > +++ head/sys/dev/hptmv/entry.c Wed Apr 24 19:00:45 2013 (r249849) > @@ -2605,9 +2605,11 @@ launch_worker_thread(void) > * hpt_worker_thread needs to be suspended after shutdown sync, when > fs sync finished. > */ > #if (__FreeBSD_version < 500043) > - EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, > hptdaemonproc, SHUTDOWN_PRI_FIRST); > + EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, > hptdaemonproc, > + SHUTDOWN_PRI_LAST); > #else > - EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, > hptdaemonproc, SHUTDOWN_PRI_FIRST); > + EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, > hptdaemonproc, > + SHUTDOWN_PRI_LAST); > #endif > } > /* > > Modified: head/sys/dev/mpt/mpt_pci.c > ============================================================================== > --- head/sys/dev/mpt/mpt_pci.c Wed Apr 24 18:30:32 2013 (r249848) > +++ head/sys/dev/mpt/mpt_pci.c Wed Apr 24 19:00:45 2013 (r249849) > @@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev) > } > mpt->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, mpt_pci_shutdown, > - dev, SHUTDOWN_PRI_DEFAULT); > + dev, SHUTDOWN_PRI_LAST); > if (mpt->eh == NULL) { > mpt_prt(mpt, "shutdown event registration failed\n"); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 08:59:02 2013 Return-Path: Delivered-To: svn-src-head@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 D1C0DDB5 for ; Thu, 25 Apr 2013 08:59:01 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx1.freebsd.org (Postfix) with ESMTP id E1E5D16B1 for ; Thu, 25 Apr 2013 08:59:00 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id w10so2540627lbi.37 for ; Thu, 25 Apr 2013 01:58:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=sMaARMMwqZ4LOCOXy85m54polADApK1bDzOBAtXC0AU=; b=Buqi5tXpbbaJ54ezy+GY0ZxNMxKoQ2E2IpPXfjBwzTuFR7Z2CsOx4O7s8Wjrs7g2pU +AKX3liHpfwLFDlqnubFdy8OW49dfeUlLNioHUy3UiC2nBb80njUqhsrrGJ9PO6SXcus davba40bNNQ2yuOFQvGj/8YyVOL4BFI5ItlgBPqW6dSwaqqQInydl3f1gQVhprYgmg1K UnWJ0F3sVaKoZcA4ev0Ryb/Riw3f0IZFot3Yi8mWSM7bUZD782azG2oK8K2XIW0DR1fZ Oxx0ebgGbIYxBCiFE6EKIgBO2HHnquRCBwjIiTWaqNVIKaXmuMvQjKVYHfvqH4fgnvUw cJhg== X-Received: by 10.112.133.72 with SMTP id pa8mr19718022lbb.114.1366880333894; Thu, 25 Apr 2013 01:58:53 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id jl5sm2525053lbc.17.2013.04.25.01.58.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 01:58:53 -0700 (PDT) Message-ID: <5178F047.8080104@freebsd.org> Date: Thu, 25 Apr 2013 12:58:47 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ronald Klop Subject: Re: svn commit: r249849 - in head/sys/dev: hptmv mpt References: <201304241900.r3OJ0jHL083318@svn.freebsd.org> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnnsudJh7+QMPHE19W5i7Sf0KXHk2iFau61b4AfSO3XAy0HO21lStSSFK/61EQvsen3N2rT Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Motin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 08:59:03 -0000 On 25.04.2013 12:26, Ronald Klop wrote: > Hi, > > Maybe I need more coffee, but I don't see a difference between the if > and the else statements in the hptmv file. shutdown_kproc vs. kproc_shutdown > > Regards, > Ronald. > > On Wed, 24 Apr 2013 21:00:45 +0200, Alexander Motin > wrote: > >> Author: mav >> Date: Wed Apr 24 19:00:45 2013 >> New Revision: 249849 >> URL: http://svnweb.freebsd.org/changeset/base/249849 >> >> Log: >> Move hptmv and mpt drivers shutdown a bit later to the >> SHUTDOWN_PRI_LAST >> stage of shutdown_post_sync. That should allow CAM to do final >> cache flush >> at the SHUTDOWN_PRI_DEFAULT without using polling magic. >> MFC after: 3 days >> >> Modified: >> head/sys/dev/hptmv/entry.c >> head/sys/dev/mpt/mpt_pci.c >> >> Modified: head/sys/dev/hptmv/entry.c >> ============================================================================== >> >> --- head/sys/dev/hptmv/entry.c Wed Apr 24 18:30:32 2013 (r249848) >> +++ head/sys/dev/hptmv/entry.c Wed Apr 24 19:00:45 2013 (r249849) >> @@ -2605,9 +2605,11 @@ launch_worker_thread(void) >> * hpt_worker_thread needs to be suspended after shutdown sync, >> when fs sync finished. >> */ >> #if (__FreeBSD_version < 500043) >> - EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, >> hptdaemonproc, SHUTDOWN_PRI_FIRST); >> + EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, >> hptdaemonproc, >> + SHUTDOWN_PRI_LAST); >> #else >> - EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, >> hptdaemonproc, SHUTDOWN_PRI_FIRST); >> + EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, >> hptdaemonproc, >> + SHUTDOWN_PRI_LAST); >> #endif >> } >> /* >> >> Modified: head/sys/dev/mpt/mpt_pci.c >> ============================================================================== >> >> --- head/sys/dev/mpt/mpt_pci.c Wed Apr 24 18:30:32 2013 (r249848) >> +++ head/sys/dev/mpt/mpt_pci.c Wed Apr 24 19:00:45 2013 (r249849) >> @@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev) >> } >> mpt->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, mpt_pci_shutdown, >> - dev, SHUTDOWN_PRI_DEFAULT); >> + dev, SHUTDOWN_PRI_LAST); >> if (mpt->eh == NULL) { >> mpt_prt(mpt, "shutdown event registration failed\n"); >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 09:40:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55C455E3; Thu, 25 Apr 2013 09:40:07 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (lakerest.net [70.155.160.98]) by mx1.freebsd.org (Postfix) with ESMTP id E17DE190C; Thu, 25 Apr 2013 09:40:06 +0000 (UTC) Received: from [10.1.1.213] ([10.1.1.213]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id r3P9e4W4027534 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 25 Apr 2013 05:40:04 -0400 (EDT) (envelope-from rrs@lakerest.net) Subject: Re: svn commit: r249848 - head/sys/netinet Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=koi8-r From: Randall Stewart In-Reply-To: <20130425082458.GG76816@glebius.int.ru> Date: Thu, 25 Apr 2013 05:40:04 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> <20130425082458.GG76816@glebius.int.ru> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 09:40:07 -0000 I like the idea Gleb.. I myself had been thinking that it was rather strange that we used dst for both the gateway and destination.. this is a much cleaner (and safer) solution. R On Apr 25, 2013, at 4:24 AM, Gleb Smirnoff wrote: > ------------------------------ Randall Stewart 803-317-4952 (cell) From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 12:03:58 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3BAB434; Thu, 25 Apr 2013 12:03:58 +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 27BC21075; Thu, 25 Apr 2013 12:03:57 +0000 (UTC) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r3PBuCNb006860; Thu, 25 Apr 2013 21:56:12 +1000 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r3PBu1gA025314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Apr 2013 21:56:03 +1000 Date: Thu, 25 Apr 2013 21:56:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r249859 - head/lib/libc/sys In-Reply-To: <201304242124.r3OLOZW5034818@svn.freebsd.org> Message-ID: <20130425204458.F1034@besplex.bde.org> References: <201304242124.r3OLOZW5034818@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=A8I0pNqG c=1 sm=1 a=P_x8KVnH094A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=uiiGxAOqq18A:10 a=ppjzmsSWu8qfP4cRltEA:9 a=CjuIK1q_8ugA:10 a=I_1LoNp5KbIVb1Mo:21 a=YFT-1n5FI_Fbnx_q:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 12:03:58 -0000 On Wed, 24 Apr 2013, Jilles Tjoelker wrote: > Log: > getdtablesize(2): Describe what this function actually does. > > getdtablesize() returns the limit on new file descriptors; this says nothing > about existing descriptors. It's still quite broken. > Modified: head/lib/libc/sys/getdtablesize.2 > ============================================================================== > --- head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:21:03 2013 (r249858) > +++ head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:24:35 2013 (r249859) > @@ -28,12 +28,12 @@ > .\" @(#)getdtablesize.2 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd June 4, 1993 > +.Dd April 24, 2013 > .Dt GETDTABLESIZE 2 > .Os > .Sh NAME > .Nm getdtablesize > -.Nd get descriptor table size > +.Nd get file descriptor limit Now its name doesn't match its description, and the reason for this is not documented. This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. I prepared to remove the broken definition of OPEN_MAX, but never committed the final step. /usr/src has very few misuses of OPEN_MAX now, so removing the definition wouldn't be too hard. Most uses are in compatibility cruft. E.g., the following from crypto/openssh/openbsd-compat/bsd-closefrom.c which is confused about related things: @ /* @ * Fall back on sysconf() or getdtablesize(). We avoid checking @ * resource limits since it is possible to open a file descriptor @ * and then drop the rlimit such that it is below the open fd. @ */ This is a fallback for when some other compatibility cruft doesn't work. The part about resource limits is mostly wrong:... @ #ifdef HAVE_SYSCONF @ maxfd = sysconf(_SC_OPEN_MAX); @ #else @ maxfd = getdtablesize(); @ #endif /* HAVE_SYSCONF */ ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for the resource limit (sysconf() is a libc wrapper and getdtablesize() is a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the rlmint -- it is the min() of the rlimit and the global sysctl integer maxfilesperproc. Here the bug is in the rlimit. For the rlimit, maxfilesperproc is only used when the rlimit is set and when it is used in the kernel. But when the rlimit is returned to userland, via getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if maxfileperproc was lowered after setting the rlimit. @ if (maxfd < 0) @ maxfd = OPEN_MAX; This should be ifdefed. All POSIX systems have sysconf(), and that is ifdefed, but most don't have a constant OPEN_MAX. @ @ for (fd = lowfd; fd < maxfd; fd++) @ (void) close((int) fd); @ } Old code that ends up using {OPEN_MAX} under any correct spelling in loops like this works poorly. On freefall now, {OPEN_MAX} for users is 707112. Syscalls are slow, so a loop like this will take a significant fraction of a second on freefall. So getdtablesize() should never be used for its original purpose of setting an upper limit for loops like this. Better hope that this compatibility cruft is not used. (It is for closefrom(int lowfd), which FreeBSD has in libc. closefrom() is described weirdly as "deleting" file descriptors.) > .Sh LIBRARY > .Lb libc > .Sh SYNOPSIS > @@ -41,18 +41,20 @@ > .Ft int > .Fn getdtablesize void > .Sh DESCRIPTION > -Each process has a fixed size descriptor table, Actually, each process has a variable size descriptor table, and getdtablesize() doesn't give the size of this table. > -which is guaranteed to have at least 20 slots. Actually, {OPEN_MAX} is guaranteed by POSIX to be at least {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these guarantees and similar ones for stdio's FOPEN_MAX have always been broken in FreeBSD, since anyone can reduce the rlimit below 20. Privileged users can break the gurantee even more easily by setting maxfilesperproc below 20. When POSIX standardized rlimits, it didn't properly specify the behaviour for the interaction of the rlimit with {OPEN_MAX}, at least initially. The 2001 version breaks its own guarantee by just saying that if the rlimit is reduced to less than {_POSIX_OPEN_MAX}, then "unexpected behaviour may occur". Reductions from 707112 to less than 20 won't occur often in practice. Ones from 707112 to less than the largest currently open fd (+1) are more common in practice and cause similarly unexpected behaviours, but the 2001 version of POSIX is even more underspecified for them. > -The entries in > -the descriptor table are numbered with small integers starting at 0. Still correct, though not very interesting. > The > .Fn getdtablesize > -system call returns the size of this table. > +system call returns the maximum number of file descriptors > +that the current process may open. Actually, the process may open more than this number, after raising its (soft) rlimit, if this is possible. > +The maximum file descriptor number that the system may assign > +is the return value minus one. > +Existing file descriptor numbers may be higher > +if the limit was lowered after they were opened. > .Sh SEE ALSO > .Xr close 2 , > +.Xr closefrom 2 , > .Xr dup 2 , > -.Xr open 2 , > -.Xr select 2 > +.Xr getrlimit 2 , > +.Xr sysconf 2 > .Sh HISTORY > The > .Fn getdtablesize > open(2) is probably still relevant. It seems to be the natuaral place to document {OPEN_MAX}, but it says nothing about any spelling of OPEN_MAX. (The closest that it gets is saying that [EMFILE] means that the process has reached its limit for open file descriptors. apropos(1) gives nothing appropriate for OPEN_MAX. In fact, even OPEN_MAX is not mentioned in any man page. Only _SC_OPEN_MAX is mentioned (in sysconf(3)), and it is misdescribed as being the maximum number of open files per user id.) Some limits are better descrtibed than {OPEN_MAX}, in intro(2). I was a little surprised to not find much about the file descriptor limits there. In fact, there is a very incomplete description of them for [EMFILE]. This says that the limit is the release one of 64 (that was for the 4.4BSD-Lite* release) and that getdtablesize(2) will obtain the current limit. Similar historical limits have been changed to POSIX ones mainly for pathnames. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 12:05:18 2013 Return-Path: Delivered-To: svn-src-head@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 90E215B8; Thu, 25 Apr 2013 12:05:18 +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 83AF81082; Thu, 25 Apr 2013 12:05: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 r3PC5Iaa044932; Thu, 25 Apr 2013 12:05:18 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PC5IFX044930; Thu, 25 Apr 2013 12:05:18 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304251205.r3PC5IFX044930@svn.freebsd.org> From: Bryan Drewery Date: Thu, 25 Apr 2013 12:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249893 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 12:05:18 -0000 Author: bdrewery (ports committer) Date: Thu Apr 25 12:05:17 2013 New Revision: 249893 URL: http://svnweb.freebsd.org/changeset/base/249893 Log: Fix installworld with DB_FROM_SRC after r249807 Approved by: bapt Reported by: Tom Everett Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 25 11:25:24 2013 (r249892) +++ head/Makefile.inc1 Thu Apr 25 12:05:17 2013 (r249893) @@ -616,6 +616,7 @@ kernel-toolchain: ${TOOLCHAIN_TGTS:N_inc # Checks to be sure system is ready for installworld/installkernel. # installcheck: +installcheck_UGID: # # Require DESTDIR to be set if installing for a different architecture or From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 12:36:27 2013 Return-Path: Delivered-To: svn-src-head@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 B8112CC4; Thu, 25 Apr 2013 12:36:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 4063E11BE; Thu, 25 Apr 2013 12:36:26 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r3PCaPqA070285; Thu, 25 Apr 2013 16:36:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r3PCaO7r070284; Thu, 25 Apr 2013 16:36:24 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 25 Apr 2013 16:36:24 +0400 From: Gleb Smirnoff To: Randall Stewart Subject: Re: svn commit: r249848 - head/sys/netinet Message-ID: <20130425123624.GK76816@FreeBSD.org> References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> <20130425082458.GG76816@glebius.int.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 12:36:27 -0000 On Thu, Apr 25, 2013 at 05:40:04AM -0400, Randall Stewart wrote: R> I like the idea Gleb.. R> R> I myself had been thinking that it was rather strange that R> we used dst for both the gateway and destination.. R> R> this is a much cleaner (and safer) solution. I'll commit it to head then. I've seen you merged your patch to 8 and 9, that's right, let's have the less disrupting patch merged and a cleaner solution in head. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 12:42:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA4ABE94; Thu, 25 Apr 2013 12:42:09 +0000 (UTC) (envelope-from glebius@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 8266711EC; Thu, 25 Apr 2013 12:42: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 r3PCg92x058087; Thu, 25 Apr 2013 12:42:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PCg9K9058086; Thu, 25 Apr 2013 12:42:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304251242.r3PCg9K9058086@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 25 Apr 2013 12:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249894 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 12:42:09 -0000 Author: glebius Date: Thu Apr 25 12:42:09 2013 New Revision: 249894 URL: http://svnweb.freebsd.org/changeset/base/249894 Log: Introduce a pointer to const variable gw, which points either at the same place as dst, or to the sockaddr in the routing table. The const constraint of gw makes us safe from modifing routing table accidentially. And "onstantness" of dst allows us to remove several bandaids, when we switched it back at &ro->ro_dst, now it always points there. Reviewed by: rrs Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Apr 25 12:05:17 2013 (r249893) +++ head/sys/netinet/ip_output.c Thu Apr 25 12:42:09 2013 (r249894) @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *o int n; /* scratchpad */ int error = 0; struct sockaddr_in *dst; + const struct sockaddr_in *gw; struct in_ifaddr *ia; int isbroadcast; uint16_t ip_len, ip_off; @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } + gw = dst = (struct sockaddr_in *)&ro->ro_dst; again: - dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, @@ -297,11 +298,11 @@ again: ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rte->rt_gateway; + gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_broadcast(gw->sin_addr, ifp); } /* * Calculate MTU. If we have a route that is up, use that, @@ -327,12 +328,6 @@ again: if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; /* - * IP destination address is multicast. Make sure "dst" - * still points to the address in "ro". (It may have been - * changed to point to a gateway address, above.) - */ - dst = (struct sockaddr_in *)&ro->ro_dst; - /* * See if the caller provided any multicast options */ if (imo != NULL) { @@ -559,7 +554,6 @@ sendit: /* Or forward to some other address? */ if ((m->m_flags & M_IP_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { - dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; @@ -628,8 +622,7 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro); goto done; } @@ -663,7 +656,7 @@ passout: m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + (struct sockaddr *)gw, ro); } else m_freem(m); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 14:11:39 2013 Return-Path: Delivered-To: svn-src-head@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 21FAD675; Thu, 25 Apr 2013 14:11:39 +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 037C9171F; Thu, 25 Apr 2013 14:11: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 r3PEBd19089574; Thu, 25 Apr 2013 14:11:39 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PEBcvE089571; Thu, 25 Apr 2013 14:11:38 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304251411.r3PEBcvE089571@svn.freebsd.org> From: Steven Hartland Date: Thu, 25 Apr 2013 14:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249895 - in head: sbin/camcontrol 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 14:11:39 -0000 Author: smh Date: Thu Apr 25 14:11:38 2013 New Revision: 249895 URL: http://svnweb.freebsd.org/changeset/base/249895 Log: Adds Host Protected Area (HPA) support for ATA disks to camcontrol Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Apr 25 12:42:09 2013 (r249894) +++ head/sbin/camcontrol/camcontrol.8 Thu Apr 25 14:11:38 2013 (r249895) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd April 24, 2013 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -243,6 +243,18 @@ .Op Fl U Ar user|master .Op Fl y .Nm +.Ic hpa +.Op device id +.Op generic args +.Op Fl f +.Op Fl l +.Op Fl P +.Op Fl p Ar pwd +.Op Fl q +.Op Fl s Ar max_sectors +.Op Fl U Ar pwd +.Op Fl y +.Nm .Ic help .Sh DESCRIPTION The @@ -1205,6 +1217,73 @@ password for the specified user the comm .Pp The password in all cases is limited to 32 characters, longer passwords will fail. +.It Ic hpa +Update or report Host Protected Area details. +By default +.Nm +will print out the HPA support and associated settings of the device. +The +.Ic hpa +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the HPA configuration of the specified device. +.Pp +After command completion any other commands that update the HPA configuration +shall be command aborted. +Frozen mode is disabled by power-off or hardware reset. +.It Fl l +.Pp +Lock the HPA configuration of the device until a successful call to unlock or +the next power-on reset occurs. +.It Fl P +.Pp +Make the HPA max sectors persist across power-on reset or a hardware reset. +This must be used in combination with +.Fl s Ar max_sectors +. +.It Fl p Ar pwd +.Pp +Set the HPA configuration password required for unlock calls. +.It Fl q +.Pp +Be quiet, do not print any status messages. +This option will not disable the questions. +To disable questions, use the +.Fl y +argument, below. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value inaccessible. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset or a hardware reset of the device. +.It Fl U Ar pwd +.Pp +Unlock the HPA configuration of the specified device using the given password. +If the password specified doesn't match the password configured via +.Fl p Ar pwd +the command will fail. +.Pp +After 5 failed unlock calls, due to password miss-match, the device will refuse +additional unlock calls until after a power-on reset. +.It Fl y +.Pp +Confirm yes to dangerous options such as +.Fl e +without prompting for confirmation +.Pp +.El +The password for all HPA commands is limited to 32 characters, longer passwords +will fail. .It Ic fwdownload Program firmware of the named SCSI device using the image file provided. .Pp @@ -1397,6 +1476,30 @@ data from the device, so backup your dat .Pp This command can be used used against an SSD drive to restoring it to factory default write performance. +.Pp +.Bd -literal -offset indent +camcontrol hpa ada0 +.Ed +.Pp +Report HPA support and settings for ada0 (also reported via +identify). +.Pp +.Bd -literal -offset indent +camcontrol hpa ada0 -s 10240 +.Ed +.Pp +Enables HPA on ada0 setting the maximum reported sectors to 10240. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +This will +.Em PREVENT ACCESS +to all data on the device beyond this limit until HPA is disabled by setting +HPA to native max sectors of the device, which can only be done after a +power-on or hardware reset! +.Pp +.Em DO NOT +use this on a device which has an active filesystem! .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Apr 25 12:42:09 2013 (r249894) +++ head/sbin/camcontrol/camcontrol.c Thu Apr 25 14:11:38 2013 (r249895) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef MINIMALISTIC +#include +#include +#endif #include #include @@ -88,7 +92,8 @@ typedef enum { CAM_CMD_SMP_PHYLIST = 0x0000001a, CAM_CMD_SMP_MANINFO = 0x0000001b, CAM_CMD_DOWNLOAD_FW = 0x0000001c, - CAM_CMD_SECURITY = 0x0000001d + CAM_CMD_SECURITY = 0x0000001d, + CAM_CMD_HPA = 0x0000001e } cam_cmdmask; typedef enum { @@ -135,6 +140,29 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC +struct ata_res_pass16 { + u_int16_t reserved[5]; + u_int8_t flags; + u_int8_t error; + u_int8_t sector_count_exp; + u_int8_t sector_count; + u_int8_t lba_low_exp; + u_int8_t lba_low; + u_int8_t lba_mid_exp; + u_int8_t lba_mid; + u_int8_t lba_high_exp; + u_int8_t lba_high; + u_int8_t device; + u_int8_t status; +}; + +struct ata_set_max_pwd +{ + u_int16_t reserved1; + u_int8_t password[32]; + u_int16_t reserved2[239]; +}; + static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; @@ -186,6 +214,7 @@ static struct camcontrol_opts option_tab {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, + {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -280,6 +309,8 @@ static int atapm(struct cam_device *devi char *combinedopt, int retry_count, int timeout); static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int atahpa(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); #endif /* MINIMALISTIC */ #ifndef min @@ -1128,6 +1159,38 @@ xferrate_bailout: } static void +atahpa_print(struct ata_params *parm, u_int64_t hpasize, int header) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + if (header) { + printf("\nFeature " + "Support Enabled Value\n"); + } + + printf("Host Protected Area (HPA) "); + if (parm->support.command1 & ATA_SUPPORT_PROTECTED) { + u_int64_t lba = lbasize48 ? lbasize48 : lbasize; + printf("yes %s %ju/%ju\n", (hpasize > lba) ? "yes" : "no ", + lba, hpasize); + + printf("HPA - Security "); + if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) + printf("yes\n"); + else + printf("no\n"); + } else { + printf("no\n"); + } +} + +static void atacapprint(struct ata_params *parm) { u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | @@ -1554,6 +1617,83 @@ ata_do_28bit_cmd(struct cam_device *devi return ata_cam_send(device, ccb, quiet); } +static int +ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries, + u_int32_t flags, u_int8_t protocol, u_int8_t ata_flags, + u_int8_t tag_action, u_int8_t command, u_int8_t features, + u_int64_t lba, u_int8_t sector_count, u_int8_t *data_ptr, + u_int16_t dxfer_len, int timeout, int force48bit) +{ + int retval; + + retval = ata_try_pass_16(device); + if (retval == -1) + return (1); + + if (retval == 1) { + int error; + + /* Try using SCSI Passthrough */ + error = ata_do_pass_16(device, ccb, retries, flags, protocol, + ata_flags, tag_action, command, features, + lba, sector_count, data_ptr, dxfer_len, + timeout, 0); + + if (ata_flags & AP_FLAG_CHK_COND) { + /* Decode ata_res from sense data */ + struct ata_res_pass16 *res_pass16; + struct ata_res *res; + u_int i; + u_int16_t *ptr; + + /* sense_data is 4 byte aligned */ + ptr = (uint16_t*)(uintptr_t)&ccb->csio.sense_data; + for (i = 0; i < sizeof(*res_pass16) / 2; i++) + ptr[i] = le16toh(ptr[i]); + + /* sense_data is 4 byte aligned */ + res_pass16 = (struct ata_res_pass16 *)(uintptr_t) + &ccb->csio.sense_data; + res = &ccb->ataio.res; + res->flags = res_pass16->flags; + res->status = res_pass16->status; + res->error = res_pass16->error; + res->lba_low = res_pass16->lba_low; + res->lba_mid = res_pass16->lba_mid; + res->lba_high = res_pass16->lba_high; + res->device = res_pass16->device; + res->lba_low_exp = res_pass16->lba_low_exp; + res->lba_mid_exp = res_pass16->lba_mid_exp; + res->lba_high_exp = res_pass16->lba_high_exp; + res->sector_count = res_pass16->sector_count; + res->sector_count_exp = res_pass16->sector_count_exp; + } + + return (error); + } + + bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - + sizeof(struct ccb_hdr)); + cam_fill_ataio(&ccb->ataio, + retries, + NULL, + flags, + tag_action, + data_ptr, + dxfer_len, + timeout); + + if (force48bit || lba > ATA_MAX_28BIT_LBA) + ata_48bit_cmd(&ccb->ataio, command, features, lba, sector_count); + else + ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); + + if (ata_flags & AP_FLAG_CHK_COND) + ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; + + return ata_cam_send(device, ccb, 0); +} + static void dump_data(uint16_t *ptr, uint32_t len) { @@ -1571,6 +1711,278 @@ dump_data(uint16_t *ptr, uint32_t len) } static int +atahpa_proc_resp(struct cam_device *device, union ccb *ccb, + int is48bit, u_int64_t *hpasize) +{ + struct ata_res *res; + + res = &ccb->ataio.res; + if (res->status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + printf("error = 0x%02x, sector_count = 0x%04x, " + "device = 0x%02x, status = 0x%02x\n", + res->error, res->sector_count, + res->device, res->status); + } + + if (res->error & ATA_ERROR_ID_NOT_FOUND) { + warnx("Max address has already been set since " + "last power-on or hardware reset"); + } + + return (1); + } + + if (arglist & CAM_ARG_VERBOSE) { + fprintf(stdout, "%s%d: Raw native max data:\n", + device->device_name, device->dev_unit_num); + /* res is 4 byte aligned */ + dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + + printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " + "status = 0x%02x\n", res->error, res->sector_count, + res->device, res->status); + } + + if (hpasize != NULL) { + if (is48bit) { + *hpasize = (((u_int64_t)((res->lba_high_exp << 16) | + (res->lba_mid_exp << 8) | res->lba_low_exp) << 24) | + ((res->lba_high << 16) | (res->lba_mid << 8) | + res->lba_low)) + 1; + } else { + *hpasize = (((res->device & 0x0f) << 24) | + (res->lba_high << 16) | (res->lba_mid << 8) | + res->lba_low) + 1; + } + } + + return (0); +} + +static int +ata_read_native_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + struct ata_params *parm, u_int64_t *hpasize) +{ + int error; + u_int cmd, is48bit; + u_int8_t protocol; + + is48bit = parm->support.command2 & ATA_SUPPORT_ADDRESS48; + protocol = AP_PROTO_NON_DATA; + + if (is48bit) { + cmd = ATA_READ_NATIVE_MAX_ADDRESS48; + protocol |= AP_EXTEND; + } else { + cmd = ATA_READ_NATIVE_MAX_ADDRESS; + } + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_IN, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/0, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, hpasize); +} + +static int +atahpa_set_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, u_int64_t maxsize, int persist) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + + if (is48bit) { + cmd = ATA_SET_MAX_ADDRESS48; + protocol |= AP_EXTEND; + } else { + cmd = ATA_SET_MAX_ADDRESS; + } + + /* lba's are zero indexed so the max lba is requested max - 1 */ + if (maxsize) + maxsize--; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_MAX_ADDR, + /*lba*/maxsize, + /*sector_count*/persist, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_password(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, struct ata_set_max_pwd *pwd) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_PIO_OUT; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_SET_PWD, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t*)pwd, + /*dxfer_len*/sizeof(struct ata_set_max_pwd), + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_lock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, int is48bit) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_LOCK, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_unlock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + int is48bit, struct ata_set_max_pwd *pwd) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_PIO_OUT; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_UNLOCK, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/(u_int8_t*)pwd, + /*dxfer_len*/sizeof(struct ata_set_max_pwd), + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + +static int +atahpa_freeze_lock(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, int is48bit) +{ + int error; + u_int cmd; + u_int8_t protocol; + + protocol = AP_PROTO_NON_DATA; + cmd = (is48bit) ? ATA_SET_MAX_ADDRESS48 : ATA_SET_MAX_ADDRESS; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_OUT, + /*protocol*/protocol, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/cmd, + /*features*/ATA_HPA_FEAT_FREEZE, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 1000, + is48bit); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, is48bit, NULL); +} + + +static int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) { @@ -1701,6 +2113,7 @@ ataidentify(struct cam_device *device, i { union ccb *ccb; struct ata_params *ident_buf; + u_int64_t hpasize; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -1712,10 +2125,21 @@ ataidentify(struct cam_device *device, i return (1); } + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { + if (ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize) != 0) { + cam_freeccb(ccb); + return (1); + } + } else { + hpasize = 0; + } + printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); + atahpa_print(ident_buf, hpasize, 0); free(ident_buf); cam_freeccb(ccb); @@ -2044,6 +2468,245 @@ ata_getpwd(u_int8_t *passwd, int max, ch return (0); } +enum { + ATA_HPA_ACTION_PRINT, + ATA_HPA_ACTION_SET_MAX, + ATA_HPA_ACTION_SET_PWD, + ATA_HPA_ACTION_LOCK, + ATA_HPA_ACTION_UNLOCK, + ATA_HPA_ACTION_FREEZE_LOCK +}; + +static int +atahpa_set_confirm(struct cam_device *device, struct ata_params* ident_buf, + u_int64_t maxsize, int persist) +{ + printf("\nYou are about to configure HPA to limit the user accessible\n" + "sectors to %ju %s on the device:\n%s%d,%s%d: ", maxsize, + persist ? "persistently" : "temporarily", + device->device_name, device->dev_unit_num, + device->given_dev_name, device->given_unit_number); + ata_print_ident(ident_buf); + + for(;;) { + char str[50]; + printf("\nAre you SURE you want to configure HPA? (yes/no) "); + + if (NULL != fgets(str, sizeof(str), stdin)) { + if (0 == strncasecmp(str, "yes", 3)) { + return (1); + } else if (0 == strncasecmp(str, "no", 2)) { + return (0); + } else { + printf("Please answer \"yes\" or " + "\"no\"\n"); + } + } + } + + /* NOTREACHED */ + return (0); +} + +static int +atahpa(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + struct ccb_getdev cgd; + struct ata_set_max_pwd pwd; + int error, confirm, quiet, c, action, actions, setpwd, persist; + int security, is48bit, pwdsize; + u_int64_t hpasize, maxsize; + + actions = 0; + setpwd = 0; + confirm = 0; + quiet = 0; + maxsize = 0; + persist = 0; + security = 0; + + memset(&pwd, 0, sizeof(pwd)); + + /* default action is to print hpa information */ + action = ATA_HPA_ACTION_PRINT; + pwdsize = sizeof(pwd.password); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch(c){ + case 's': + action = ATA_HPA_ACTION_SET_MAX; + maxsize = strtoumax(optarg, NULL, 0); + actions++; + break; + + case 'p': + if (ata_getpwd(pwd.password, pwdsize, c) != 0) + return (1); + action = ATA_HPA_ACTION_SET_PWD; + security = 1; + actions++; + break; + + case 'l': + action = ATA_HPA_ACTION_LOCK; + security = 1; + actions++; + break; + + case 'U': + if (ata_getpwd(pwd.password, pwdsize, c) != 0) + return (1); + action = ATA_HPA_ACTION_UNLOCK; + security = 1; + actions++; + break; + + case 'f': + action = ATA_HPA_ACTION_FREEZE_LOCK; + security = 1; + actions++; + break; + + case 'P': + persist = 1; + break; + + case 'y': + confirm++; + break; + + case 'q': + quiet++; + break; + } + } + + if (actions > 1) { + warnx("too many hpa actions specified"); + return (1); + } + + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (1); + } + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); + if (error != 0) { + cam_freeccb(ccb); + return (1); + } + + if (quiet == 0) { + printf("%s%d: ", device->device_name, device->dev_unit_num); + ata_print_ident(ident_buf); + camxferrate(device); + } + + if (action == ATA_HPA_ACTION_PRINT) { + error = ata_read_native_max(device, retry_count, timeout, ccb, + ident_buf, &hpasize); + if (error == 0) + atahpa_print(ident_buf, hpasize, 1); + + cam_freeccb(ccb); + free(ident_buf); + return (error); + } + + if (!(ident_buf->support.command1 & ATA_SUPPORT_PROTECTED)) { + warnx("HPA is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + if (security && !(ident_buf->support.command1 & ATA_SUPPORT_MAXSECURITY)) { + warnx("HPA Security is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + is48bit = ident_buf->support.command2 & ATA_SUPPORT_ADDRESS48; + + /* + * The ATA spec requires: + * 1. Read native max addr is called directly before set max addr + * 2. Read native max addr is NOT called before any other set max call + */ + switch(action) { + case ATA_HPA_ACTION_SET_MAX: + if (confirm == 0 && + atahpa_set_confirm(device, ident_buf, maxsize, + persist) == 0) { + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + error = ata_read_native_max(device, retry_count, timeout, + ccb, ident_buf, &hpasize); + if (error == 0) { + error = atahpa_set_max(device, retry_count, timeout, + ccb, is48bit, maxsize, persist); + if (error == 0) { + /* redo identify to get new lba values */ + error = ata_do_identify(device, retry_count, + timeout, ccb, + &ident_buf); + atahpa_print(ident_buf, hpasize, 1); + } + } + break; + + case ATA_HPA_ACTION_SET_PWD: + error = atahpa_password(device, retry_count, timeout, + ccb, is48bit, &pwd); + if (error == 0) + printf("HPA password has been set\n"); + break; + + case ATA_HPA_ACTION_LOCK: + error = atahpa_lock(device, retry_count, timeout, + ccb, is48bit); + if (error == 0) + printf("HPA has been locked\n"); + break; + + case ATA_HPA_ACTION_UNLOCK: + error = atahpa_unlock(device, retry_count, timeout, + ccb, is48bit, &pwd); + if (error == 0) + printf("HPA has been unlocked\n"); + break; + + case ATA_HPA_ACTION_FREEZE_LOCK: + error = atahpa_freeze_lock(device, retry_count, timeout, + ccb, is48bit); + if (error == 0) + printf("HPA has been frozen\n"); + break; + + default: + errx(1, "Option currently not supported"); + } + + cam_freeccb(ccb); + free(ident_buf); + + return (error); +} + static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt) @@ -6702,6 +7365,8 @@ usage(int printlong) " <-d pwd | -e pwd | -f | -h pwd | -k pwd>\n" " [-l ] [-q] [-s pwd] [-T timeout]\n" " [-U ] [-y]\n" +" camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" +" [-q] [-s max_sectors] [-U pwd] [-y]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -6852,6 +7517,17 @@ usage(int printlong) "-T timeout overrides the timeout (seconds) used for erase operation\n" "-U specifies which user to set: user or master\n" "-y don't ask any questions\n" +"hpa arguments:\n" +"-f freeze the HPA configuration of the device\n" +"-l lock the HPA configuration of the device\n" +"-P make the HPA max sectors persist\n" +"-p pwd Set the HPA configuration password required for unlock\n" +" calls\n" +"-q be quiet, do not print any status messages\n" +"-s sectors configures the maximum user accessible sectors of the\n" +" device\n" +"-U pwd unlock the HPA configuration of the device\n" +"-y don't ask any questions\n" ); #endif /* MINIMALISTIC */ } @@ -7076,6 +7752,10 @@ main(int argc, char **argv) case CAM_CMD_DEVLIST: error = getdevlist(cam_dev); break; + case CAM_CMD_HPA: + error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; #endif /* MINIMALISTIC */ case CAM_CMD_DEVTREE: error = getdevtree(); Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Apr 25 12:42:09 2013 (r249894) +++ head/sys/sys/ata.h Thu Apr 25 14:11:38 2013 (r249895) @@ -283,6 +283,23 @@ struct ata_params { #define ATA_DEV_SLAVE 0x10 #define ATA_DEV_LBA 0x40 +/* ATA limits */ +#define ATA_MAX_28BIT_LBA 268435455UL + +/* ATA Status Register */ +#define ATA_STATUS_ERROR 0x01 +#define ATA_STATUS_DEVICE_FAULT 0x20 + +/* ATA Error Register */ +#define ATA_ERROR_ABORT 0x04 +#define ATA_ERROR_ID_NOT_FOUND 0x10 + +/* ATA HPA Features */ +#define ATA_HPA_FEAT_MAX_ADDR 0x00 +#define ATA_HPA_FEAT_SET_PWD 0x01 +#define ATA_HPA_FEAT_LOCK 0x02 +#define ATA_HPA_FEAT_UNLOCK 0x03 +#define ATA_HPA_FEAT_FREEZE 0x04 /* ATA transfer modes */ #define ATA_MODE_MASK 0x0f From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 16:23:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87771263; Thu, 25 Apr 2013 16:23:23 +0000 (UTC) (envelope-from glebius@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 5F3281DC8; Thu, 25 Apr 2013 16:23: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 r3PGNNSM035073; Thu, 25 Apr 2013 16:23:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PGNNgA035072; Thu, 25 Apr 2013 16:23:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304251623.r3PGNNgA035072@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 25 Apr 2013 16:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249896 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 16:23:23 -0000 Author: glebius Date: Thu Apr 25 16:23:22 2013 New Revision: 249896 URL: http://svnweb.freebsd.org/changeset/base/249896 Log: Restore the ipNetToMedia MIB, that was broken with new ARP commit in the r186119. Submitted by: Konstantin Kukushkin Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Thu Apr 25 14:11:38 2013 (r249895) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Thu Apr 25 16:23:22 2013 (r249896) @@ -934,6 +934,34 @@ mib_find_ifa(struct in_addr addr) } /* + * Process a new ARP entry + */ +static void +process_arp(const struct rt_msghdr *rtm, const struct sockaddr_dl *sdl, + const struct sockaddr_in *sa) +{ + struct mibif *ifp; + struct mibarp *at; + + /* IP arp table entry */ + if (sdl->sdl_alen == 0) + return; + if ((ifp = mib_find_if_sys(sdl->sdl_index)) == NULL) + return; + /* have a valid entry */ + if ((at = mib_find_arp(ifp, sa->sin_addr)) == NULL && + (at = mib_arp_create(ifp, sa->sin_addr, + sdl->sdl_data + sdl->sdl_nlen, sdl->sdl_alen)) == NULL) + return; + + if (rtm->rtm_rmx.rmx_expire == 0) + at->flags |= MIBARP_PERM; + else + at->flags &= ~MIBARP_PERM; + at->flags |= MIBARP_FOUND; +} + +/* * Handle a routing socket message. */ static void @@ -1075,6 +1103,23 @@ handle_rtmsg(struct rt_msghdr *rtm) #endif case RTM_GET: case RTM_ADD: + mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); + if (rtm->rtm_flags & RTF_LLINFO) { + if (addrs[RTAX_DST] == NULL || + addrs[RTAX_GATEWAY] == NULL || + addrs[RTAX_DST]->sa_family != AF_INET || + addrs[RTAX_GATEWAY]->sa_family != AF_LINK) + break; + process_arp(rtm, + (struct sockaddr_dl *)(void *)addrs[RTAX_GATEWAY], + (struct sockaddr_in *)(void *)addrs[RTAX_DST]); + } else { + if (rtm->rtm_errno == 0 && (rtm->rtm_flags & RTF_UP)) + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], + addrs[RTAX_DST], addrs[RTAX_NETMASK]); + } + break; + case RTM_DELETE: mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 16:34:04 2013 Return-Path: Delivered-To: svn-src-head@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 C24C4498; Thu, 25 Apr 2013 16:34:04 +0000 (UTC) (envelope-from glebius@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 B432A1E23; Thu, 25 Apr 2013 16:34: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 r3PGY4RG038544; Thu, 25 Apr 2013 16:34:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PGY4iI038543; Thu, 25 Apr 2013 16:34:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304251634.r3PGY4iI038543@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 25 Apr 2013 16:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249897 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 16:34:04 -0000 Author: glebius Date: Thu Apr 25 16:34:04 2013 New Revision: 249897 URL: http://svnweb.freebsd.org/changeset/base/249897 Log: Don't free memory that is going to be used as error string. PR: bin/178121 Submitted by: Garrett Cooper Modified: head/sbin/ifconfig/iflagg.c Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Apr 25 16:23:22 2013 (r249896) +++ head/sbin/ifconfig/iflagg.c Thu Apr 25 16:34:04 2013 (r249897) @@ -98,10 +98,8 @@ setlagghash(const char *val, int d, int rf.rf_flags |= LAGG_F_HASHL3; else if (strcmp(tok, "l4") == 0) rf.rf_flags |= LAGG_F_HASHL4; - else { - free(str); + else errx(1, "Invalid lagghash option: %s", tok); - } } free(str); if (rf.rf_flags == 0) From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 17:23:55 2013 Return-Path: Delivered-To: svn-src-head@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 8995A19F; Thu, 25 Apr 2013 17:23:55 +0000 (UTC) (envelope-from imp@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 6AE1D1009; Thu, 25 Apr 2013 17:23: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 r3PHNs3I056103; Thu, 25 Apr 2013 17:23:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PHNsV2056100; Thu, 25 Apr 2013 17:23:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304251723.r3PHNsV2056100@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Apr 2013 17:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249901 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 17:23:55 -0000 Author: imp Date: Thu Apr 25 17:23:54 2013 New Revision: 249901 URL: http://svnweb.freebsd.org/changeset/base/249901 Log: Use the offsets from pcb.h rather than regnum.h to store the registers in the pcb. setjmp/longjmp in the kernel also used these values, so continue to use them although their use isn't technically the pcb register array (matching is all that's important for setjmp/longjmp in the kernel). Finally, eliminate the old register names from regnum.h. This is a lexical change only. The non-debug .o files have the same md5. Modified: head/sys/mips/include/regnum.h head/sys/mips/mips/support.S head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Thu Apr 25 17:06:07 2013 (r249900) +++ head/sys/mips/include/regnum.h Thu Apr 25 17:23:54 2013 (r249901) @@ -43,24 +43,6 @@ #define _MACHINE_REGNUM_H_ /* - * This must match the numbers in pcb.h and is used by swtch.S - */ -#define PREG_S0 0 -#define PREG_S1 1 -#define PREG_S2 2 -#define PREG_S3 3 -#define PREG_S4 4 -#define PREG_S5 5 -#define PREG_S6 6 -#define PREG_S7 7 -#define PREG_SP 8 -#define PREG_S8 9 -#define PREG_RA 10 -#define PREG_SR 11 -#define PREG_GP 12 -#define PREG_PC 13 - -/* * Location of the saved registers relative to ZERO. * This must match struct trapframe defined in frame.h exactly. * This must also match regdef.h. Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Thu Apr 25 17:06:07 2013 (r249900) +++ head/sys/mips/mips/support.S Thu Apr 25 17:23:54 2013 (r249901) @@ -92,6 +92,7 @@ #include #include #include +#include #include "assym.s" @@ -1079,35 +1080,35 @@ END(breakpoint) LEAF(setjmp) mfc0 v0, MIPS_COP_0_STATUS # Later the "real" spl value! - REG_S s0, (SZREG * PREG_S0)(a0) - REG_S s1, (SZREG * PREG_S1)(a0) - REG_S s2, (SZREG * PREG_S2)(a0) - REG_S s3, (SZREG * PREG_S3)(a0) - REG_S s4, (SZREG * PREG_S4)(a0) - REG_S s5, (SZREG * PREG_S5)(a0) - REG_S s6, (SZREG * PREG_S6)(a0) - REG_S s7, (SZREG * PREG_S7)(a0) - REG_S s8, (SZREG * PREG_S8)(a0) - REG_S sp, (SZREG * PREG_SP)(a0) - REG_S ra, (SZREG * PREG_RA)(a0) - REG_S v0, (SZREG * PREG_SR)(a0) + REG_S s0, (SZREG * PCB_REG_S0)(a0) + REG_S s1, (SZREG * PCB_REG_S1)(a0) + REG_S s2, (SZREG * PCB_REG_S2)(a0) + REG_S s3, (SZREG * PCB_REG_S3)(a0) + REG_S s4, (SZREG * PCB_REG_S4)(a0) + REG_S s5, (SZREG * PCB_REG_S5)(a0) + REG_S s6, (SZREG * PCB_REG_S6)(a0) + REG_S s7, (SZREG * PCB_REG_S7)(a0) + REG_S s8, (SZREG * PCB_REG_S8)(a0) + REG_S sp, (SZREG * PCB_REG_SP)(a0) + REG_S ra, (SZREG * PCB_REG_RA)(a0) + REG_S v0, (SZREG * PCB_REG_SR)(a0) jr ra li v0, 0 # setjmp return END(setjmp) LEAF(longjmp) - REG_L v0, (SZREG * PREG_SR)(a0) - REG_L ra, (SZREG * PREG_RA)(a0) - REG_L s0, (SZREG * PREG_S0)(a0) - REG_L s1, (SZREG * PREG_S1)(a0) - REG_L s2, (SZREG * PREG_S2)(a0) - REG_L s3, (SZREG * PREG_S3)(a0) - REG_L s4, (SZREG * PREG_S4)(a0) - REG_L s5, (SZREG * PREG_S5)(a0) - REG_L s6, (SZREG * PREG_S6)(a0) - REG_L s7, (SZREG * PREG_S7)(a0) - REG_L s8, (SZREG * PREG_S8)(a0) - REG_L sp, (SZREG * PREG_SP)(a0) + REG_L v0, (SZREG * PCB_REG_SR)(a0) + REG_L ra, (SZREG * PCB_REG_RA)(a0) + REG_L s0, (SZREG * PCB_REG_S0)(a0) + REG_L s1, (SZREG * PCB_REG_S1)(a0) + REG_L s2, (SZREG * PCB_REG_S2)(a0) + REG_L s3, (SZREG * PCB_REG_S3)(a0) + REG_L s4, (SZREG * PCB_REG_S4)(a0) + REG_L s5, (SZREG * PCB_REG_S5)(a0) + REG_L s6, (SZREG * PCB_REG_S6)(a0) + REG_L s7, (SZREG * PCB_REG_S7)(a0) + REG_L s8, (SZREG * PCB_REG_S8)(a0) + REG_L sp, (SZREG * PCB_REG_SP)(a0) mtc0 v0, MIPS_COP_0_STATUS # Later the "real" spl value! ITLBNOPFIX jr ra Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Thu Apr 25 17:06:07 2013 (r249900) +++ head/sys/mips/mips/swtch.S Thu Apr 25 17:23:54 2013 (r249901) @@ -62,6 +62,7 @@ #include #include #include +#include #include "assym.s" @@ -173,26 +174,26 @@ END(fork_trampoline) * savectx(struct pcb *pcbp); */ LEAF(savectx) - SAVE_U_PCB_CONTEXT(s0, PREG_S0, a0) - SAVE_U_PCB_CONTEXT(s1, PREG_S1, a0) - SAVE_U_PCB_CONTEXT(s2, PREG_S2, a0) - SAVE_U_PCB_CONTEXT(s3, PREG_S3, a0) + SAVE_U_PCB_CONTEXT(s0, PCB_REG_S0, a0) + SAVE_U_PCB_CONTEXT(s1, PCB_REG_S1, a0) + SAVE_U_PCB_CONTEXT(s2, PCB_REG_S2, a0) + SAVE_U_PCB_CONTEXT(s3, PCB_REG_S3, a0) mfc0 v0, MIPS_COP_0_STATUS - SAVE_U_PCB_CONTEXT(s4, PREG_S4, a0) - SAVE_U_PCB_CONTEXT(s5, PREG_S5, a0) - SAVE_U_PCB_CONTEXT(s6, PREG_S6, a0) - SAVE_U_PCB_CONTEXT(s7, PREG_S7, a0) - SAVE_U_PCB_CONTEXT(sp, PREG_SP, a0) - SAVE_U_PCB_CONTEXT(s8, PREG_S8, a0) - SAVE_U_PCB_CONTEXT(ra, PREG_RA, a0) - SAVE_U_PCB_CONTEXT(v0, PREG_SR, a0) - SAVE_U_PCB_CONTEXT(gp, PREG_GP, a0) + SAVE_U_PCB_CONTEXT(s4, PCB_REG_S4, a0) + SAVE_U_PCB_CONTEXT(s5, PCB_REG_S5, a0) + SAVE_U_PCB_CONTEXT(s6, PCB_REG_S6, a0) + SAVE_U_PCB_CONTEXT(s7, PCB_REG_S7, a0) + SAVE_U_PCB_CONTEXT(sp, PCB_REG_SP, a0) + SAVE_U_PCB_CONTEXT(s8, PCB_REG_S8, a0) + SAVE_U_PCB_CONTEXT(ra, PCB_REG_RA, a0) + SAVE_U_PCB_CONTEXT(v0, PCB_REG_SR, a0) + SAVE_U_PCB_CONTEXT(gp, PCB_REG_GP, a0) move v0, ra /* save 'ra' before we trash it */ jal 1f nop 1: - SAVE_U_PCB_CONTEXT(ra, PREG_PC, a0) + SAVE_U_PCB_CONTEXT(ra, PCB_REG_PC, a0) move ra, v0 /* restore 'ra' before returning */ j ra @@ -229,26 +230,26 @@ NON_LEAF(cpu_switch, CALLFRAME_SIZ, ra) beqz a0, mips_sw1 move a3, a0 PTR_L a0, TD_PCB(a0) # load PCB addr of curproc - SAVE_U_PCB_CONTEXT(sp, PREG_SP, a0) # save old sp + SAVE_U_PCB_CONTEXT(sp, PCB_REG_SP, a0) # save old sp PTR_SUBU sp, sp, CALLFRAME_SIZ REG_S ra, CALLFRAME_RA(sp) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - SAVE_U_PCB_CONTEXT(s0, PREG_S0, a0) # do a 'savectx()' - SAVE_U_PCB_CONTEXT(s1, PREG_S1, a0) - SAVE_U_PCB_CONTEXT(s2, PREG_S2, a0) - SAVE_U_PCB_CONTEXT(s3, PREG_S3, a0) - SAVE_U_PCB_CONTEXT(s4, PREG_S4, a0) - SAVE_U_PCB_CONTEXT(s5, PREG_S5, a0) - SAVE_U_PCB_CONTEXT(s6, PREG_S6, a0) - SAVE_U_PCB_CONTEXT(s7, PREG_S7, a0) - SAVE_U_PCB_CONTEXT(s8, PREG_S8, a0) - SAVE_U_PCB_CONTEXT(ra, PREG_RA, a0) # save return address - SAVE_U_PCB_CONTEXT(t0, PREG_SR, a0) # save status register - SAVE_U_PCB_CONTEXT(gp, PREG_GP, a0) + SAVE_U_PCB_CONTEXT(s0, PCB_REG_S0, a0) # do a 'savectx()' + SAVE_U_PCB_CONTEXT(s1, PCB_REG_S1, a0) + SAVE_U_PCB_CONTEXT(s2, PCB_REG_S2, a0) + SAVE_U_PCB_CONTEXT(s3, PCB_REG_S3, a0) + SAVE_U_PCB_CONTEXT(s4, PCB_REG_S4, a0) + SAVE_U_PCB_CONTEXT(s5, PCB_REG_S5, a0) + SAVE_U_PCB_CONTEXT(s6, PCB_REG_S6, a0) + SAVE_U_PCB_CONTEXT(s7, PCB_REG_S7, a0) + SAVE_U_PCB_CONTEXT(s8, PCB_REG_S8, a0) + SAVE_U_PCB_CONTEXT(ra, PCB_REG_RA, a0) # save return address + SAVE_U_PCB_CONTEXT(t0, PCB_REG_SR, a0) # save status register + SAVE_U_PCB_CONTEXT(gp, PCB_REG_GP, a0) jal getpc nop getpc: - SAVE_U_PCB_CONTEXT(ra, PREG_PC, a0) # save return address + SAVE_U_PCB_CONTEXT(ra, PCB_REG_PC, a0) # save return address #ifdef CPU_CNMIPS @@ -262,7 +263,7 @@ getpc: sw t2, TD_MDFLAGS(a3) and t2, t0, ~MIPS_SR_COP_2_BIT # clear COP_2 enable bit - SAVE_U_PCB_CONTEXT(t2, PREG_SR, a0) # save status register + SAVE_U_PCB_CONTEXT(t2, PCB_REG_SR, a0) # save status register RESTORE_U_PCB_REG(t0, PS, a0) # get CPU status register and t2, t0, ~MIPS_SR_COP_2_BIT # clear COP_2 enable bit @@ -374,7 +375,7 @@ entry0set: */ sw2: PTR_L s0, TD_PCB(s7) - RESTORE_U_PCB_CONTEXT(sp, PREG_SP, s0) + RESTORE_U_PCB_CONTEXT(sp, PCB_REG_SP, s0) PTR_LA t1, _C_LABEL(pmap_activate) # s7 = new proc pointer jalr t1 # s7 = new proc pointer move a0, s7 # BDSLOT @@ -382,18 +383,18 @@ sw2: * Restore registers and return. */ move a0, s0 - RESTORE_U_PCB_CONTEXT(gp, PREG_GP, a0) - RESTORE_U_PCB_CONTEXT(v0, PREG_SR, a0) # restore kernel context - RESTORE_U_PCB_CONTEXT(ra, PREG_RA, a0) - RESTORE_U_PCB_CONTEXT(s0, PREG_S0, a0) - RESTORE_U_PCB_CONTEXT(s1, PREG_S1, a0) - RESTORE_U_PCB_CONTEXT(s2, PREG_S2, a0) - RESTORE_U_PCB_CONTEXT(s3, PREG_S3, a0) - RESTORE_U_PCB_CONTEXT(s4, PREG_S4, a0) - RESTORE_U_PCB_CONTEXT(s5, PREG_S5, a0) - RESTORE_U_PCB_CONTEXT(s6, PREG_S6, a0) - RESTORE_U_PCB_CONTEXT(s7, PREG_S7, a0) - RESTORE_U_PCB_CONTEXT(s8, PREG_S8, a0) + RESTORE_U_PCB_CONTEXT(gp, PCB_REG_GP, a0) + RESTORE_U_PCB_CONTEXT(v0, PCB_REG_SR, a0) # restore kernel context + RESTORE_U_PCB_CONTEXT(ra, PCB_REG_RA, a0) + RESTORE_U_PCB_CONTEXT(s0, PCB_REG_S0, a0) + RESTORE_U_PCB_CONTEXT(s1, PCB_REG_S1, a0) + RESTORE_U_PCB_CONTEXT(s2, PCB_REG_S2, a0) + RESTORE_U_PCB_CONTEXT(s3, PCB_REG_S3, a0) + RESTORE_U_PCB_CONTEXT(s4, PCB_REG_S4, a0) + RESTORE_U_PCB_CONTEXT(s5, PCB_REG_S5, a0) + RESTORE_U_PCB_CONTEXT(s6, PCB_REG_S6, a0) + RESTORE_U_PCB_CONTEXT(s7, PCB_REG_S7, a0) + RESTORE_U_PCB_CONTEXT(s8, PCB_REG_S8, a0) mfc0 t0, MIPS_COP_0_STATUS and t0, t0, MIPS_SR_INT_MASK From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 17:27:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1D04449; Thu, 25 Apr 2013 17:27:13 +0000 (UTC) (envelope-from imp@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 7B3A6103C; Thu, 25 Apr 2013 17:27: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 r3PHRDSe056797; Thu, 25 Apr 2013 17:27:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PHRDfb056796; Thu, 25 Apr 2013 17:27:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304251727.r3PHRDfb056796@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Apr 2013 17:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249902 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 17:27:13 -0000 Author: imp Date: Thu Apr 25 17:27:13 2013 New Revision: 249902 URL: http://svnweb.freebsd.org/changeset/base/249902 Log: Minor whitespace nit Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Apr 25 17:23:54 2013 (r249901) +++ head/sys/mips/mips/trap.c Thu Apr 25 17:27:13 2013 (r249902) @@ -447,7 +447,7 @@ cpu_fetch_syscall_args(struct thread *td (caddr_t)&arg, sizeof arg); if (error != 0) break; - sa->args[i] = arg; + sa->args[i] = arg; } } else #endif From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 17:38:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9ECC86CF; Thu, 25 Apr 2013 17:38:04 +0000 (UTC) (envelope-from glebius@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 9178C10D1; Thu, 25 Apr 2013 17:38: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 r3PHc49a060345; Thu, 25 Apr 2013 17:38:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PHc4aM060344; Thu, 25 Apr 2013 17:38:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304251738.r3PHc4aM060344@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 25 Apr 2013 17:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249903 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 17:38:04 -0000 Author: glebius Date: Thu Apr 25 17:38:04 2013 New Revision: 249903 URL: http://svnweb.freebsd.org/changeset/base/249903 Log: Fix couple of mbuf leaks in incoming ARP processing. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Apr 25 17:27:13 2013 (r249902) +++ head/sys/netinet/if_ether.c Thu Apr 25 17:38:04 2013 (r249903) @@ -558,13 +558,13 @@ in_arpinput(struct mbuf *m) if (ah->ar_pln != sizeof(struct in_addr)) { log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", sizeof(struct in_addr)); - return; + goto drop; } if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { log(LOG_NOTICE, "arp: %*D is multicast\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); - return; + goto drop; } op = ntohs(ah->ar_op); From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 18:33:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2AF2A52A; Thu, 25 Apr 2013 18:33:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 466FA1321; Thu, 25 Apr 2013 18:33:34 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id m1so2831782wea.12 for ; Thu, 25 Apr 2013 11:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=tOQZeZ/zM9Zdykprb1ceEyAsLvdYS4iSIK8ZAaxMGl4=; b=jV7NK0UxwlxXqdIuEd2+dzRFZupl6tXgddW583F7HpnG8Fupc8sVCRB6Xg2Hy0G6rb y7mVh8gdI10xnR8hJeZq1H4ThY2s9QsyC6CKxHzS2Pdos+aLxemxNU8GKaR7Nnnjp8Ul tnRctU+Z/XiNaNJVnDORoayQ25ju9+CEhMH7O3GMs0FoACwBVhMsX5q74oBJrkYIMG2c MBVtqkMsx8LGP1jXGG+3Y22QEqoC+6TQpveQ0jePMR74zsklYh+0Nd6IA16k/9DvHacO YDNwIRrqWe9Hsma3xc6moRGD/cXcbxqkp5e8o5Z0y1CFbg2XEKTSlBjAafANtJpmdrwb gNkg== MIME-Version: 1.0 X-Received: by 10.194.93.68 with SMTP id cs4mr30409731wjb.17.1366914813365; Thu, 25 Apr 2013 11:33:33 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Thu, 25 Apr 2013 11:33:33 -0700 (PDT) In-Reply-To: <201304251738.r3PHc4aM060344@svn.freebsd.org> References: <201304251738.r3PHc4aM060344@svn.freebsd.org> Date: Thu, 25 Apr 2013 11:33:33 -0700 X-Google-Sender-Auth: bUBe9gXr2LZSAQh3rebPRrIh9Gc Message-ID: Subject: Re: svn commit: r249903 - head/sys/netinet From: Adrian Chadd To: Gleb Smirnoff 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 18:33:35 -0000 .. is it possible to trigger a remote DoS through mbuf exhaustion somehow by exploiting this? Adrian On 25 April 2013 10:38, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Apr 25 17:38:04 2013 > New Revision: 249903 > URL: http://svnweb.freebsd.org/changeset/base/249903 > > Log: > Fix couple of mbuf leaks in incoming ARP processing. > > Modified: > head/sys/netinet/if_ether.c > > Modified: head/sys/netinet/if_ether.c > ============================================================================== > --- head/sys/netinet/if_ether.c Thu Apr 25 17:27:13 2013 (r249902) > +++ head/sys/netinet/if_ether.c Thu Apr 25 17:38:04 2013 (r249903) > @@ -558,13 +558,13 @@ in_arpinput(struct mbuf *m) > if (ah->ar_pln != sizeof(struct in_addr)) { > log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", > sizeof(struct in_addr)); > - return; > + goto drop; > } > > if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { > log(LOG_NOTICE, "arp: %*D is multicast\n", > ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); > - return; > + goto drop; > } > > op = ntohs(ah->ar_op); From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 20:23:22 2013 Return-Path: Delivered-To: svn-src-head@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 940B5CA; Thu, 25 Apr 2013 20:23:22 +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 85E8E1853; Thu, 25 Apr 2013 20:23: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 r3PKNMuO019922; Thu, 25 Apr 2013 20:23:22 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PKNM0x019921; Thu, 25 Apr 2013 20:23:22 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304252023.r3PKNM0x019921@svn.freebsd.org> From: Joel Dahl Date: Thu, 25 Apr 2013 20:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249904 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 20:23:22 -0000 Author: joel (doc committer) Date: Thu Apr 25 20:23:22 2013 New Revision: 249904 URL: http://svnweb.freebsd.org/changeset/base/249904 Log: mdoc: remove superfluous paragraph macro. Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Apr 25 17:38:04 2013 (r249903) +++ head/sbin/camcontrol/camcontrol.8 Thu Apr 25 20:23:22 2013 (r249904) @@ -1476,14 +1476,12 @@ data from the device, so backup your dat .Pp This command can be used used against an SSD drive to restoring it to factory default write performance. -.Pp .Bd -literal -offset indent camcontrol hpa ada0 .Ed .Pp Report HPA support and settings for ada0 (also reported via identify). -.Pp .Bd -literal -offset indent camcontrol hpa ada0 -s 10240 .Ed From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 20:42:22 2013 Return-Path: Delivered-To: svn-src-head@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 21FA6696; Thu, 25 Apr 2013 20:42:22 +0000 (UTC) (envelope-from neel@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 EDDB71A65; Thu, 25 Apr 2013 20:42: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 r3PKgLqF026414; Thu, 25 Apr 2013 20:42:21 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PKgLNU026411; Thu, 25 Apr 2013 20:42:21 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304252042.r3PKgLNU026411@svn.freebsd.org> From: Neel Natu Date: Thu, 25 Apr 2013 20:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249905 - head/lib/libvmmapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 20:42:22 -0000 Author: neel Date: Thu Apr 25 20:42:21 2013 New Revision: 249905 URL: http://svnweb.freebsd.org/changeset/base/249905 Log: Remove deprecated APIs to get the total and free memory available to vmm.ko. These APIs were relevant when memory for virtual machine allocation was hard partitioned away from the rest of the system but that is no longer the case. The sysctls that provided this information were garbage collected a while back. Obtained from: NetApp Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Thu Apr 25 20:23:22 2013 (r249904) +++ head/lib/libvmmapi/vmmapi.c Thu Apr 25 20:42:21 2013 (r249905) @@ -123,30 +123,6 @@ vm_destroy(struct vmctx *vm) free(vm); } -size_t -vmm_get_mem_total(void) -{ - size_t mem_total = 0; - size_t oldlen = sizeof(mem_total); - int error; - error = sysctlbyname("hw.vmm.mem_total", &mem_total, &oldlen, NULL, 0); - if (error) - return -1; - return mem_total; -} - -size_t -vmm_get_mem_free(void) -{ - size_t mem_free = 0; - size_t oldlen = sizeof(mem_free); - int error; - error = sysctlbyname("hw.vmm.mem_free", &mem_free, &oldlen, NULL, 0); - if (error) - return -1; - return mem_free; -} - int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len) { Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Thu Apr 25 20:23:22 2013 (r249904) +++ head/lib/libvmmapi/vmmapi.h Thu Apr 25 20:42:21 2013 (r249905) @@ -45,8 +45,6 @@ enum vm_mmap_style { int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); -size_t vmm_get_mem_total(void); -size_t vmm_get_mem_free(void); int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len); int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 21:19:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8060C8BD; Thu, 25 Apr 2013 21:19:51 +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 580AF1CE9; Thu, 25 Apr 2013 21:19: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 r3PLJpwh038481; Thu, 25 Apr 2013 21:19:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PLJpf1038479; Thu, 25 Apr 2013 21:19:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304252119.r3PLJpf1038479@svn.freebsd.org> From: Brooks Davis Date: Thu, 25 Apr 2013 21:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249906 - in head: . usr.sbin/mergemaster X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 21:19:51 -0000 Author: brooks Date: Thu Apr 25 21:19:50 2013 New Revision: 249906 URL: http://svnweb.freebsd.org/changeset/base/249906 Log: Use the system MAKEOBJDIRPREFIX when running make targets in mergemaster. This allows bootstrap verions of tools to be used. Add a note to UPDATING about this change. Discussed with: jhb Sponsored by: DARPA, AFRL MFC after: 5 days Modified: head/UPDATING head/usr.sbin/mergemaster/mergemaster.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Apr 25 20:42:21 2013 (r249905) +++ head/UPDATING Thu Apr 25 21:19:50 2013 (r249906) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130425: + The mergemaster command now uses the default MAKEOBJDIRPREFIX + rather than creating it's own in the temporary directory in + order allow access to bootstrapped versions of tools such as + install and mtree. When upgrading from version of FreeBSD where + the install command does not support -l, you will need to + install a new mergemaster command if mergemaster -p is required. + This can be accomplished with the command (cd src/usr.sbin/mergemaster + && make install). + 20130404: Legacy ATA stack, disabled and replaced by new CAM-based one since FreeBSD 9.0, completely removed from the sources. Kernel modules @@ -1757,7 +1767,7 @@ COMMON ITEMS: step. It never hurts to do it all the time. You may need to install a new mergemaster (cd src/usr.sbin/mergemaster && make install) after the buildworld before this step if you last updated - from current before 20020224 or from -stable before 20020408. + from current before 20130425 or from -stable before 20130430. [6] This only deletes old files and directories. Old libraries can be deleted by "make delete-old-libs", but you have to make Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu Apr 25 20:42:21 2013 (r249905) +++ head/usr.sbin/mergemaster/mergemaster.sh Thu Apr 25 21:19:50 2013 (r249906) @@ -629,11 +629,10 @@ case "${RERUN}" in ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs >/dev/null ;; esac - od=${TEMPROOT}/usr/obj ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || + ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || { echo ''; echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; echo " the temproot environment"; From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 23:10:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3AEB01D3; Thu, 25 Apr 2013 23:10:35 +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 2DAF510BF; Thu, 25 Apr 2013 23:10: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 r3PNAZPA078115; Thu, 25 Apr 2013 23:10:35 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3PNAZ1B078114; Thu, 25 Apr 2013 23:10:35 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304252310.r3PNAZ1B078114@svn.freebsd.org> From: Sean Bruno Date: Thu, 25 Apr 2013 23:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249908 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 23:10:35 -0000 Author: sbruno Date: Thu Apr 25 23:10:34 2013 New Revision: 249908 URL: http://svnweb.freebsd.org/changeset/base/249908 Log: In the case where the controller supports an sg_list LESS than our predefined and tuned value, we would advertise the unsupported value to CAM and it would merrily destroy the controller with way too many IO operations. This manifests itself in a Zero Memory RAID configuration for a P410 and possibly other controllers. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Apr 25 21:55:29 2013 (r249907) +++ head/sys/dev/ciss/ciss.c Thu Apr 25 23:10:34 2013 (r249908) @@ -3005,7 +3005,7 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; - cpi->maxio = (CISS_MAX_SG_ELEMENTS - 1) * PAGE_SIZE; + cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sc->ciss_cfg->max_sg_length) - 1) * PAGE_SIZE; ccb->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 02:24:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89CA657A; Fri, 26 Apr 2013 02:24:52 +0000 (UTC) (envelope-from neel@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 ADF881671; Fri, 26 Apr 2013 02:24: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 r3Q2OpdW045798; Fri, 26 Apr 2013 02:24:51 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3Q2Op0N045795; Fri, 26 Apr 2013 02:24:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304260224.r3Q2Op0N045795@svn.freebsd.org> From: Neel Natu Date: Fri, 26 Apr 2013 02:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249916 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 02:24:52 -0000 Author: neel Date: Fri Apr 26 02:24:50 2013 New Revision: 249916 URL: http://svnweb.freebsd.org/changeset/base/249916 Log: Gripe if some tuple is specified more than once instead of silently overwriting the previous assignment. Gripe if the emulation is not recognized instead of silently ignoring the emulated device. If an error is detected by pci_parse_slot() then exit from the command line parsing loop in main(). Submitted by (initial version): Chris Torek (chris.torek@gmail.com) Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Apr 26 01:56:58 2013 (r249915) +++ head/usr.sbin/bhyve/bhyverun.c Fri Apr 26 02:24:50 2013 (r249916) @@ -631,11 +631,15 @@ main(int argc, char *argv[]) guest_tslice = atoi(optarg); break; case 's': - pci_parse_slot(optarg, 0); - break; + if (pci_parse_slot(optarg, 0) != 0) + exit(1); + else + break; case 'S': - pci_parse_slot(optarg, 1); - break; + if (pci_parse_slot(optarg, 1) != 0) + exit(1); + else + break; case 'm': memsize = strtoul(optarg, NULL, 0) * MB; break; Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Apr 26 01:56:58 2013 (r249915) +++ head/usr.sbin/bhyve/pci_emul.c Fri Apr 26 02:24:50 2013 (r249916) @@ -100,6 +100,8 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_MEMBASE64 0xD000000000UL #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL +static struct pci_devemu *pci_emul_finddev(char *name); + static int pci_emul_devices; /* @@ -123,17 +125,18 @@ static int pci_emul_devices; static void pci_parse_slot_usage(char *aopt) { - printf("Invalid PCI slot info field \"%s\"\n", aopt); - free(aopt); + + fprintf(stderr, "Invalid PCI slot info field \"%s\"\n", aopt); } -void +int pci_parse_slot(char *opt, int legacy) { char *slot, *func, *emul, *config; char *str, *cpy; - int snum, fnum; + int error, snum, fnum; + error = -1; str = cpy = strdup(opt); config = NULL; @@ -152,19 +155,40 @@ pci_parse_slot(char *opt, int legacy) } if (emul == NULL) { - pci_parse_slot_usage(cpy); - return; + pci_parse_slot_usage(opt); + goto done; } snum = atoi(slot); fnum = func ? atoi(func) : 0; + if (snum < 0 || snum >= MAXSLOTS || fnum < 0 || fnum >= MAXFUNCS) { - pci_parse_slot_usage(cpy); - } else { - pci_slotinfo[snum][fnum].si_name = emul; - pci_slotinfo[snum][fnum].si_param = config; - pci_slotinfo[snum][fnum].si_legacy = legacy; + pci_parse_slot_usage(opt); + goto done; } + + if (pci_slotinfo[snum][fnum].si_name != NULL) { + fprintf(stderr, "pci slot %d:%d already occupied!\n", + snum, fnum); + goto done; + } + + if (pci_emul_finddev(emul) == NULL) { + fprintf(stderr, "pci slot %d:%d: unknown device \"%s\"\n", + snum, fnum, emul); + goto done; + } + + error = 0; + pci_slotinfo[snum][fnum].si_name = emul; + pci_slotinfo[snum][fnum].si_param = config; + pci_slotinfo[snum][fnum].si_legacy = legacy; + +done: + if (error) + free(cpy); + + return (error); } static int @@ -988,10 +1012,9 @@ init_pci(struct vmctx *ctx) si = &pci_slotinfo[slot][func]; if (si->si_name != NULL) { pde = pci_emul_finddev(si->si_name); - if (pde != NULL) { - pci_emul_init(ctx, pde, slot, func, - si->si_param); - } + assert(pde != NULL); + pci_emul_init(ctx, pde, slot, func, + si->si_param); } } } Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Fri Apr 26 01:56:58 2013 (r249915) +++ head/usr.sbin/bhyve/pci_emul.h Fri Apr 26 02:24:50 2013 (r249916) @@ -206,7 +206,7 @@ int pci_msix_enabled(struct pci_devinst int pci_msix_table_bar(struct pci_devinst *pi); int pci_msix_pba_bar(struct pci_devinst *pi); int pci_msi_msgnum(struct pci_devinst *pi); -void pci_parse_slot(char *opt, int legacy); +int pci_parse_slot(char *opt, int legacy); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 05:13:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D1A1F96; Fri, 26 Apr 2013 05:13:49 +0000 (UTC) (envelope-from grehan@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 5B0231CFE; Fri, 26 Apr 2013 05:13: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 r3Q5Dmjn007836; Fri, 26 Apr 2013 05:13:48 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3Q5Dmu3007835; Fri, 26 Apr 2013 05:13:48 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201304260513.r3Q5Dmu3007835@svn.freebsd.org> From: Peter Grehan Date: Fri, 26 Apr 2013 05:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249917 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 05:13:49 -0000 Author: grehan Date: Fri Apr 26 05:13:48 2013 New Revision: 249917 URL: http://svnweb.freebsd.org/changeset/base/249917 Log: Use a thread for the processing of virtio tx descriptors rather than blocking the vCPU thread. This improves bulk data performance by ~30-40% and doesn't harm req/resp time for stock netperf runs. Future work will use a thread pool rather than a thread per tx queue. Submitted by: Dinakar Medavaram Reviewed by: neel, grehan Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Fri Apr 26 02:24:50 2013 (r249916) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri Apr 26 05:13:48 2013 (r249917) @@ -46,13 +46,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" #include "mevent.h" #include "virtio.h" -#define VTNET_RINGSZ 256 +#define VTNET_RINGSZ 1024 #define VTNET_MAXSEGS 32 @@ -140,6 +141,8 @@ struct pci_vtnet_softc { int vsc_tapfd; int vsc_rx_ready; int vsc_rxpend; + int tx_in_progress; + int resetting; uint32_t vsc_features; uint8_t vsc_macaddr[6]; @@ -147,6 +150,9 @@ struct pci_vtnet_softc { uint64_t vsc_pfn[VTNET_MAXQ]; struct vring_hqueue vsc_hq[VTNET_MAXQ]; uint16_t vsc_msix_table_idx[VTNET_MAXQ]; + pthread_t tx_tid; + pthread_mutex_t tx_mtx; + pthread_cond_t tx_cond; }; #define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) @@ -174,7 +180,7 @@ hq_num_avail(struct vring_hqueue *hq) uint16_t ndesc; /* - * We're just computing (a-b) in GF(216). + * We're just computing (a-b) mod 2^16 * * The only glitch here is that in standard C, * uint16_t promotes to (signed) int when int has @@ -221,9 +227,23 @@ pci_vtnet_update_status(struct pci_vtnet if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); + + /* Wait for TX thread to complete pending desc processing */ + sc->resetting = 1; + pthread_mutex_lock(&sc->tx_mtx); + + while (sc->tx_in_progress) { + pthread_mutex_unlock(&sc->tx_mtx); + usleep(10000); + pthread_mutex_lock(&sc->tx_mtx); + } + + pthread_mutex_unlock(&sc->tx_mtx); + pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); sc->vsc_rx_ready = 0; + sc->resetting = 0; } sc->vsc_status = value; @@ -463,25 +483,12 @@ pci_vtnet_proctx(struct pci_vtnet_softc hq->hq_cur_aidx = aidx + 1; *hq->hq_used_idx = uidx + 1; - /* - * Generate an interrupt if able - */ - if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_TXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } } static void pci_vtnet_ping_txq(struct pci_vtnet_softc *sc) { struct vring_hqueue *hq = &sc->vsc_hq[VTNET_TXQ]; - int i; int ndescs; /* @@ -492,14 +499,82 @@ pci_vtnet_ping_txq(struct pci_vtnet_soft if (ndescs == 0) return; - /* - * Run through all the entries, placing them into iovecs and - * sending when an end-of-packet is found - */ - for (i = 0; i < ndescs; i++) - pci_vtnet_proctx(sc, hq); + /* Signal the tx thread for processing */ + pthread_mutex_lock(&sc->tx_mtx); + if (sc->tx_in_progress == 0) + pthread_cond_signal(&sc->tx_cond); + pthread_mutex_unlock(&sc->tx_mtx); } +/* + * Thread which will handle processing of TX desc + */ +static void * +pci_vtnet_tx_thread(void *param) +{ + struct pci_vtnet_softc *sc = (struct pci_vtnet_softc *) param; + struct vring_hqueue *hq; + int i, ndescs, needintr,error; + + needintr = 0; + hq = &sc->vsc_hq[VTNET_TXQ]; + + /* + * Let us wait till the tx queue pointers get initialised & + * first tx signaled + */ + pthread_mutex_lock(&sc->tx_mtx); + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + + for (;;) { + pthread_mutex_lock(&sc->tx_mtx); + for (;;) { + if (sc->resetting) { + ndescs = 0; + needintr = 0; + } else + ndescs = hq_num_avail(hq); + + if (ndescs != 0) + break; + + if (needintr) { + /* + * Generate an interrupt if able + */ + if ((*hq->hq_avail_flags & + VRING_AVAIL_F_NO_INTERRUPT) == 0) { + if (use_msix) { + pci_generate_msix(sc->vsc_pi, + sc->vsc_msix_table_idx[VTNET_TXQ]); + } else { + sc->vsc_isr |= 1; + pci_generate_msi(sc->vsc_pi, 0); + } + } + } + needintr = 0; + sc->tx_in_progress = 0; + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + } + sc->tx_in_progress = 1; + pthread_mutex_unlock(&sc->tx_mtx); + + while (ndescs > 0) { + /* + * Run through all the entries, placing them into + * iovecs and sending when an end-of-packet is found + */ + for (i = 0; i < ndescs; i++) + pci_vtnet_proctx(sc, hq); + needintr = 1; + ndescs = hq_num_avail(hq); + } + } +} + static void pci_vtnet_ping_ctlq(struct pci_vtnet_softc *sc) { @@ -546,6 +621,7 @@ pci_vtnet_init(struct vmctx *ctx, struct MD5_CTX mdctx; unsigned char digest[16]; char nstr[80]; + char tname[MAXCOMLEN + 1]; struct pci_vtnet_softc *sc; const char *env_msi; @@ -650,7 +726,21 @@ pci_vtnet_init(struct vmctx *ctx, struct } pci_emul_alloc_bar(pi, 0, PCIBAR_IO, VTNET_REGSZ); + + /* + * Initialize tx semaphore & spawn TX processing thread + * As of now, only one thread for TX desc processing is + * spawned. + */ + sc->tx_in_progress = 0; + sc->resetting = 0; + pthread_mutex_init(&sc->tx_mtx, NULL); + pthread_cond_init(&sc->tx_cond, NULL); + pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); + snprintf(tname, sizeof(tname), "%s vtnet%d tx", vmname, pi->pi_slot); + pthread_set_name_np(sc->tx_tid, tname); + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 05:18:18 2013 Return-Path: Delivered-To: svn-src-head@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 CD8F7727; Fri, 26 Apr 2013 05:18:18 +0000 (UTC) (envelope-from jhibbits@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 C09991D7E; Fri, 26 Apr 2013 05:18: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 r3Q5IIDQ008673; Fri, 26 Apr 2013 05:18:18 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3Q5IIAr008672; Fri, 26 Apr 2013 05:18:18 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201304260518.r3Q5IIAr008672@svn.freebsd.org> From: Justin Hibbits Date: Fri, 26 Apr 2013 05:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249918 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 05:18:18 -0000 Author: jhibbits Date: Fri Apr 26 05:18:18 2013 New Revision: 249918 URL: http://svnweb.freebsd.org/changeset/base/249918 Log: Remove a comment that shouldn't have gone in. X-MFC-with: r249864 Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Apr 26 05:13:48 2013 (r249917) +++ head/sys/powerpc/aim/mmu_oea.c Fri Apr 26 05:18:18 2013 (r249918) @@ -2588,9 +2588,6 @@ moea_dumpsys_map(mmu_t mmu, struct pmap_ return (md->md_vaddr + ofs); } -/* TODO: Run this on minbar, single calls, to check addresses, offsets, and - * sizes. It should be doing more than just single pages. - */ struct pmap_md * moea_scan_md(mmu_t mmu, struct pmap_md *prev) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 05:42:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D2FAE2B; Fri, 26 Apr 2013 05:42:35 +0000 (UTC) (envelope-from imp@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 800731E50; Fri, 26 Apr 2013 05:42: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 r3Q5gZOI017691; Fri, 26 Apr 2013 05:42:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3Q5gZvw017690; Fri, 26 Apr 2013 05:42:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304260542.r3Q5gZvw017690@svn.freebsd.org> From: Warner Losh Date: Fri, 26 Apr 2013 05:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249919 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 05:42:35 -0000 Author: imp Date: Fri Apr 26 05:42:35 2013 New Revision: 249919 URL: http://svnweb.freebsd.org/changeset/base/249919 Log: Octeon 2 (6xxx) and newer CPUs don't use the clock CPU speed for its I/O clock. Thankfully, the simple executive provies a way to querry the proper clock that works on all models. Move to asking for the SCLK via this interface. This gets the serial console working after we start init and open the console and set the divisor (which turned the output from good to bad). I can login on the console now. Modified: head/sys/mips/cavium/uart_dev_oct16550.c Modified: head/sys/mips/cavium/uart_dev_oct16550.c ============================================================================== --- head/sys/mips/cavium/uart_dev_oct16550.c Fri Apr 26 05:18:18 2013 (r249918) +++ head/sys/mips/cavium/uart_dev_oct16550.c Fri Apr 26 05:42:35 2013 (r249919) @@ -656,7 +656,7 @@ oct16550_bus_probe (struct uart_softc *s int error; bas = &sc->sc_bas; - bas->rclk = uart_oct16550_class.uc_rclk = cvmx_sysinfo_get()->cpu_clock_hz; + bas->rclk = uart_oct16550_class.uc_rclk = cvmx_clock_get_rate(CVMX_CLOCK_SCLK); error = oct16550_probe(bas); if (error) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 08:18:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 941C91A8; Fri, 26 Apr 2013 08:18:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0994D1566; Fri, 26 Apr 2013 08:18:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r3Q8HsTw075327; Fri, 26 Apr 2013 12:17:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r3Q8HsdY075326; Fri, 26 Apr 2013 12:17:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 26 Apr 2013 12:17:54 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r249903 - head/sys/netinet Message-ID: <20130426081754.GP76816@FreeBSD.org> References: <201304251738.r3PHc4aM060344@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 08:18:03 -0000 On Thu, Apr 25, 2013 at 11:33:33AM -0700, Adrian Chadd wrote: A> .. is it possible to trigger a remote DoS through mbuf exhaustion A> somehow by exploiting this? Yes, from a connected network. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 08:24:14 2013 Return-Path: Delivered-To: svn-src-head@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 8667E9D9; Fri, 26 Apr 2013 08:24:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 9B8061722; Fri, 26 Apr 2013 08:24:13 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id h11so306427wiv.8 for ; Fri, 26 Apr 2013 01:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AR7gEq4GP1K1iCwo2ArnSJqc1rZGwFuvAB/VPGOkuMw=; b=eYaMncNk6VWoVHD/X13/w/FfW90b8hylcX6NAXb/ls1Q9mkq6QSKVqyy8LN7AoE8fB 6V/Zeuclqr+rVdHBViPbaMWq7YvVY3uLSHH2F1lDjdoaZ9WxbZw/aehUJ16S/iswbC0Z oSlKQDJbIMjUF0e9eYe3X9GNQfQZUt4rjDIQtFA7fSNxC/MOx8V4ZmfM3REdEyT0iY9D avlPrzK+xV2biOoV7oPVqLdeNuwBWx5jx+IOpRCUYPm6k2DGMe82AL2pMpDAtPcsPcht 6mZ5YfvlgYSgYKllVUKiCwP46dbffo1a1g0oufTcxOnrYDk9BRHVkHxwKsZ9/Q84hP+f Y2Aw== MIME-Version: 1.0 X-Received: by 10.180.149.200 with SMTP id uc8mr2446712wib.3.1366964652748; Fri, 26 Apr 2013 01:24:12 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Fri, 26 Apr 2013 01:24:12 -0700 (PDT) In-Reply-To: <20130426081754.GP76816@FreeBSD.org> References: <201304251738.r3PHc4aM060344@svn.freebsd.org> <20130426081754.GP76816@FreeBSD.org> Date: Fri, 26 Apr 2013 01:24:12 -0700 X-Google-Sender-Auth: hwOvKXjCG1Cxc5zaiAF9ZBhik8c Message-ID: Subject: Re: svn commit: r249903 - head/sys/netinet From: Adrian Chadd To: Gleb Smirnoff 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 08:24:14 -0000 On 26 April 2013 01:17, Gleb Smirnoff wrote: > On Thu, Apr 25, 2013 at 11:33:33AM -0700, Adrian Chadd wrote: > A> .. is it possible to trigger a remote DoS through mbuf exhaustion > A> somehow by exploiting this? > > Yes, from a connected network. Think its worth a full security announcement? adrian From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 08:54:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 176BDD0F; Fri, 26 Apr 2013 08:54:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9852B1A44; Fri, 26 Apr 2013 08:54:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r3Q8sicH075627; Fri, 26 Apr 2013 12:54:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r3Q8siiT075626; Fri, 26 Apr 2013 12:54:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 26 Apr 2013 12:54:44 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r249903 - head/sys/netinet Message-ID: <20130426085444.GQ76816@FreeBSD.org> References: <201304251738.r3PHc4aM060344@svn.freebsd.org> <20130426081754.GP76816@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 08:54:46 -0000 On Fri, Apr 26, 2013 at 01:24:12AM -0700, Adrian Chadd wrote: A> On 26 April 2013 01:17, Gleb Smirnoff wrote: A> > On Thu, Apr 25, 2013 at 11:33:33AM -0700, Adrian Chadd wrote: A> > A> .. is it possible to trigger a remote DoS through mbuf exhaustion A> > A> somehow by exploiting this? A> > A> > Yes, from a connected network. A> A> Think its worth a full security announcement? Not me to decide. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 11:24:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1821CC4; Fri, 26 Apr 2013 11:24:21 +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 8299611FF; Fri, 26 Apr 2013 11:24: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 r3QBOLIr042926; Fri, 26 Apr 2013 11:24:21 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QBOKIO042913; Fri, 26 Apr 2013 11:24:20 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261124.r3QBOKIO042913@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 11:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249921 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 11:24:21 -0000 Author: smh Date: Fri Apr 26 11:24:20 2013 New Revision: 249921 URL: http://svnweb.freebsd.org/changeset/base/249921 Log: Changed ZFS TRIM sysctl from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled Enabled ZFS TRIM by default Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/UPDATING head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 26 07:00:49 2013 (r249920) +++ head/UPDATING Fri Apr 26 11:24:20 2013 (r249921) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130426: + The sysctl which controls TRIM support under ZFS has been renamed + from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been + enabled by default. + 20130425: The mergemaster command now uses the default MAKEOBJDIRPREFIX rather than creating it's own in the temporary directory in Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 07:00:49 2013 (r249920) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 11:24:20 2013 (r249921) @@ -46,7 +46,7 @@ typedef enum vdev_dtl_type { } vdev_dtl_type_t; extern boolean_t zfs_nocacheflush; -extern boolean_t zfs_notrim; +extern boolean_t zfs_trim_enabled; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 07:00:49 2013 (r249920) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 11:24:20 2013 (r249921) @@ -72,7 +72,7 @@ typedef struct trim_seg { hrtime_t ts_time; /* Segment creation time. */ } trim_seg_t; -extern boolean_t zfs_notrim; +extern boolean_t zfs_trim_enabled; static u_int trim_txg_delay = 32; static u_int trim_timeout = 30; @@ -157,7 +157,7 @@ trim_map_create(vdev_t *vd) ASSERT(vd->vdev_ops->vdev_op_leaf); - if (zfs_notrim) + if (!zfs_trim_enabled) return; tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); @@ -183,7 +183,7 @@ trim_map_destroy(vdev_t *vd) ASSERT(vd->vdev_ops->vdev_op_leaf); - if (zfs_notrim) + if (!zfs_trim_enabled) return; tm = vd->vdev_trimmap; @@ -340,7 +340,7 @@ trim_map_free(vdev_t *vd, uint64_t offse { trim_map_t *tm = vd->vdev_trimmap; - if (zfs_notrim || vd->vdev_notrim || tm == NULL) + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) return; mutex_enter(&tm->tm_lock); @@ -357,7 +357,7 @@ trim_map_write_start(zio_t *zio) boolean_t left_over, right_over; uint64_t start, end; - if (zfs_notrim || vd->vdev_notrim || tm == NULL) + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) return (B_TRUE); start = zio->io_offset; @@ -404,7 +404,7 @@ trim_map_write_done(zio_t *zio) * Don't check for vdev_notrim, since the write could have * started before vdev_notrim was set. */ - if (zfs_notrim || tm == NULL) + if (!zfs_trim_enabled || tm == NULL) return; mutex_enter(&tm->tm_lock); @@ -589,7 +589,7 @@ void trim_thread_create(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; mutex_init(&spa->spa_trim_lock, NULL, MUTEX_DEFAULT, NULL); @@ -604,7 +604,7 @@ void trim_thread_destroy(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; if (spa->spa_trim_thread == NULL) return; @@ -627,7 +627,7 @@ void trim_thread_wakeup(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; if (spa->spa_trim_thread == NULL) return; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 07:00:49 2013 (r249920) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 11:24:20 2013 (r249921) @@ -729,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. */ - if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || + if (zfs_trim_enabled && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 07:00:49 2013 (r249920) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 11:24:20 2013 (r249921) @@ -83,10 +83,11 @@ boolean_t zfs_nocacheflush = B_FALSE; TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, &zfs_nocacheflush, 0, "Disable cache flush"); -boolean_t zfs_notrim = B_TRUE; -TUNABLE_INT("vfs.zfs.trim_disable", &zfs_notrim); -SYSCTL_INT(_vfs_zfs, OID_AUTO, trim_disable, CTLFLAG_RDTUN, &zfs_notrim, 0, - "Disable trim"); +boolean_t zfs_trim_enabled = B_TRUE; +SYSCTL_DECL(_vfs_zfs_trim); +TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); +SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, + "Enable ZFS TRIM"); static kmem_cache_t *zil_lwb_cache; From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 11:50:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E8E2A2A; Fri, 26 Apr 2013 11:50:27 +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 0B6C01342; Fri, 26 Apr 2013 11:50:27 +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 F36A023F804; Fri, 26 Apr 2013 07:50:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.2 onyx.glenbarber.us F36A023F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 26 Apr 2013 07:50:21 -0400 From: Glen Barber To: Gleb Smirnoff Subject: Re: svn commit: r249894 - head/sys/netinet Message-ID: <20130426115021.GE1600@glenbarber.us> References: <201304251242.r3PCg9K9058086@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="u5E4XgoOPWr4PD9E" Content-Disposition: inline In-Reply-To: <201304251242.r3PCg9K9058086@svn.freebsd.org> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 11:50:27 -0000 --u5E4XgoOPWr4PD9E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 25, 2013 at 12:42:09PM +0000, Gleb Smirnoff wrote: > Modified: head/sys/netinet/ip_output.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/ip_output.c Thu Apr 25 12:05:17 2013 (r249893) > +++ head/sys/netinet/ip_output.c Thu Apr 25 12:42:09 2013 (r249894) > @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *o > int n; /* scratchpad */ > int error =3D 0; > struct sockaddr_in *dst; > + const struct sockaddr_in *gw; > struct in_ifaddr *ia; > int isbroadcast; > uint16_t ip_len, ip_off; > @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o > hlen =3D ip->ip_hl << 2; > } > =20 > + gw =3D dst =3D (struct sockaddr_in *)&ro->ro_dst; > again: > - dst =3D (struct sockaddr_in *)&ro->ro_dst; > ia =3D NULL; > /* > * If there is a cached route, > @@ -297,11 +298,11 @@ again: > ifp =3D rte->rt_ifp; > rte->rt_rmx.rmx_pksent++; > if (rte->rt_flags & RTF_GATEWAY) > - dst =3D (struct sockaddr_in *)rte->rt_gateway; > + gw =3D (struct sockaddr_in *)rte->rt_gateway; > if (rte->rt_flags & RTF_HOST) > isbroadcast =3D (rte->rt_flags & RTF_BROADCAST); > else > - isbroadcast =3D in_broadcast(dst->sin_addr, ifp); > + isbroadcast =3D in_broadcast(gw->sin_addr, ifp); > } > /* > * Calculate MTU. If we have a route that is up, use that, > @@ -327,12 +328,6 @@ again: > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { > m->m_flags |=3D M_MCAST; > /* > - * IP destination address is multicast. Make sure "dst" > - * still points to the address in "ro". (It may have been > - * changed to point to a gateway address, above.) > - */ > - dst =3D (struct sockaddr_in *)&ro->ro_dst; > - /* > * See if the caller provided any multicast options > */ > if (imo !=3D NULL) { > @@ -559,7 +554,6 @@ sendit: > /* Or forward to some other address? */ > if ((m->m_flags & M_IP_NEXTHOP) && > (fwd_tag =3D m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) !=3D NULL) { > - dst =3D (struct sockaddr_in *)&ro->ro_dst; > bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); > m->m_flags |=3D M_SKIP_FIREWALL; > m->m_flags &=3D ~M_IP_NEXTHOP; > @@ -628,8 +622,7 @@ passout: > * to avoid confusing lower layers. > */ > m->m_flags &=3D ~(M_PROTOFLAGS); > - error =3D (*ifp->if_output)(ifp, m, > - (struct sockaddr *)dst, ro); > + error =3D (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro); It looks like this change is causing tinderbox build failures on head/ : --------------------- begin quoted text --------------------- /src/sys/netinet/ip_output.c: In function 'ip_output': /src/sys/netinet/ip_output.c:625: warning: cast discards qualifiers from po= inter target type ---------------------- end quoted text ---------------------- Glen > goto done; > } > =20 > @@ -663,7 +656,7 @@ passout: > m->m_flags &=3D ~(M_PROTOFLAGS); > =20 > error =3D (*ifp->if_output)(ifp, m, > - (struct sockaddr *)dst, ro); > + (struct sockaddr *)gw, ro); > } else > m_freem(m); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --u5E4XgoOPWr4PD9E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRemn9AAoJEFJPDDeguUaj3KIH/i4+DO5lFDJJ4rIwBLBWqU0d nBq1H3Hsc7OuYeP/9j2Fle0FgcdspCneuBr1AxueKVrQT1/ykJMNXo/kOcFXHWfa /HQtGWmPEriKC5Vp88sV5KNMA/32twqSOEX61A528k6pf3lPu3B53lZdl1WW9Zd7 uP02IcvpGfyeNxqjcLkvFZKKNt7DcVPg3KN8NX/klhjjOxGpaKCQXxfyF4xSpbGb 4cGbJ/yLsBIuMz+dJFS2IZnU4teRa/lZG+gk8ifwhkPIy1DHxuwSuHMq8aJdq6qa aqbGNoObpuI4j775Spi/yDL7pAC728tp1VbLrCO7/Oab1JFA33LSEc3wsZRRgKw= =gzAQ -----END PGP SIGNATURE----- --u5E4XgoOPWr4PD9E-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 12:27:30 2013 Return-Path: Delivered-To: svn-src-head@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 C06B4C16; Fri, 26 Apr 2013 12:27:30 +0000 (UTC) (envelope-from uqs@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 B1DE3165E; Fri, 26 Apr 2013 12:27: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 r3QCRU3i064552; Fri, 26 Apr 2013 12:27:30 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QCRUSN064551; Fri, 26 Apr 2013 12:27:30 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201304261227.r3QCRUSN064551@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 26 Apr 2013 12:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249924 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 12:27:30 -0000 Author: uqs Date: Fri Apr 26 12:27:30 2013 New Revision: 249924 URL: http://svnweb.freebsd.org/changeset/base/249924 Log: Don't appease clang static analyzer after all and roll back the free(3) of mntbuf ... again. There's no point in doing useless extra work when we're about to exit. See also r240565. Not reading file history: uqs Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Apr 26 11:58:46 2013 (r249923) +++ head/bin/df/df.c Fri Apr 26 12:27:30 2013 (r249924) @@ -296,7 +296,6 @@ main(int argc, char *argv[]) prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); - free(mntbuf); return (rv); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 12:50:40 2013 Return-Path: Delivered-To: svn-src-head@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 D2DC55A7; Fri, 26 Apr 2013 12:50:40 +0000 (UTC) (envelope-from glebius@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 C330F176B; Fri, 26 Apr 2013 12:50: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 r3QCoec8072836; Fri, 26 Apr 2013 12:50:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QCoWPZ072780; Fri, 26 Apr 2013 12:50:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304261250.r3QCoWPZ072780@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 26 Apr 2013 12:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249925 - in head/sys: dev/iicbus dev/lmc dev/ppbus dev/usb/net net net80211 netatalk netgraph netinet netinet6 netpfil/ipfw netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 12:50:40 -0000 Author: glebius Date: Fri Apr 26 12:50:32 2013 New Revision: 249925 URL: http://svnweb.freebsd.org/changeset/base/249925 Log: Add const qualifier to the dst parameter of the ifnet if_output method. Modified: head/sys/dev/iicbus/if_ic.c head/sys/dev/lmc/if_lmc.c head/sys/dev/lmc/if_lmc.h head/sys/dev/ppbus/if_plip.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/net/ethernet.h head/sys/net/if.c head/sys/net/if_arc.h head/sys/net/if_arcsubr.c head/sys/net/if_atm.h head/sys/net/if_atmsubr.c head/sys/net/if_dead.c head/sys/net/if_disc.c head/sys/net/if_ef.c head/sys/net/if_enc.c head/sys/net/if_ethersubr.c head/sys/net/if_faith.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/net/if_gre.c head/sys/net/if_iso88025subr.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_loop.c head/sys/net/if_spppsubr.c head/sys/net/if_stf.c head/sys/net/if_tun.c head/sys/net/if_var.h head/sys/net/iso88025.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_var.h head/sys/netatalk/aarp.c head/sys/netatalk/aarp.h head/sys/netatalk/at_control.c head/sys/netatalk/at_extern.h head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_iface.c head/sys/netinet/if_atm.c head/sys/netinet/if_atm.h head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_carp.h head/sys/netinet/ip_output.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netpfil/ipfw/ip_fw_log.c head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/dev/iicbus/if_ic.c ============================================================================== --- head/sys/dev/iicbus/if_ic.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/iicbus/if_ic.c Fri Apr 26 12:50:32 2013 (r249925) @@ -99,7 +99,7 @@ static int icprobe(device_t); static int icattach(device_t); static int icioctl(struct ifnet *, u_long, caddr_t); -static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *, +static int icoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static int icintr(device_t, int, char *); @@ -351,7 +351,7 @@ icintr(device_t dev, int event, char *pt * icoutput() */ static int -icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +icoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { struct ic_softc *sc = ifp->if_softc; Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/lmc/if_lmc.c Fri Apr 26 12:50:32 2013 (r249925) @@ -4587,7 +4587,7 @@ lmc_ifnet_start(struct ifnet *ifp) /* Called from a syscall (user context; no spinlocks). */ static int lmc_raw_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { softc_t *sc = IFP2SC(ifp); int error = 0; Modified: head/sys/dev/lmc/if_lmc.h ============================================================================== --- head/sys/dev/lmc/if_lmc.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/lmc/if_lmc.h Fri Apr 26 12:50:32 2013 (r249925) @@ -1595,7 +1595,7 @@ static int lmc_raw_ioctl(struct ifnet *, static int lmc_ifnet_ioctl(struct ifnet *, u_long, caddr_t); static void lmc_ifnet_start(struct ifnet *); static int lmc_raw_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + const struct sockaddr *, struct route *); # ifdef __OpenBSD__ static int ifmedia_change(struct ifnet *); static void ifmedia_status(struct ifnet *, struct ifmediareq *); Modified: head/sys/dev/ppbus/if_plip.c ============================================================================== --- head/sys/dev/ppbus/if_plip.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/ppbus/if_plip.c Fri Apr 26 12:50:32 2013 (r249925) @@ -173,7 +173,7 @@ static u_char *ctxmith; /* Functions for the lp# interface */ static int lpinittables(void); static int lpioctl(struct ifnet *, u_long, caddr_t); -static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, +static int lpoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static void lpstop(struct lp_data *); static void lp_intr(void *); @@ -682,7 +682,7 @@ lpoutbyte(u_char byte, int spin, device_ } static int -lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +lpoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { struct lp_data *sc = ifp->if_softc; Modified: head/sys/dev/usb/net/if_usie.c ============================================================================== --- head/sys/dev/usb/net/if_usie.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/usb/net/if_usie.c Fri Apr 26 12:50:32 2013 (r249925) @@ -121,7 +121,8 @@ static void usie_if_sync_cb(void *, int) static void usie_if_status_cb(void *, int); static void usie_if_start(struct ifnet *); -static int usie_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); +static int usie_if_output(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); static void usie_if_init(void *); static void usie_if_stop(struct usie_softc *); static int usie_if_ioctl(struct ifnet *, u_long, caddr_t); @@ -1181,7 +1182,7 @@ usie_if_start(struct ifnet *ifp) } static int -usie_if_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +usie_if_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { int err; Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/dev/usb/net/uhso.c Fri Apr 26 12:50:32 2013 (r249925) @@ -467,8 +467,8 @@ static void uhso_if_init(void *); static void uhso_if_start(struct ifnet *); static void uhso_if_stop(struct uhso_softc *); static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t); -static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, - struct route *); +static int uhso_if_output(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); static void uhso_if_rxflush(void *); static device_probe_t uhso_probe; @@ -1881,7 +1881,7 @@ uhso_if_init(void *priv) } static int -uhso_if_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, +uhso_if_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, struct route *ro) { int error; Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/ethernet.h Fri Apr 26 12:50:32 2013 (r249925) @@ -375,8 +375,8 @@ extern void ether_demux(struct ifnet *, extern void ether_ifattach(struct ifnet *, const u_int8_t *); extern void ether_ifdetach(struct ifnet *); extern int ether_ioctl(struct ifnet *, u_long, caddr_t); -extern int ether_output(struct ifnet *, - struct mbuf *, struct sockaddr *, struct route *); +extern int ether_output(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); extern int ether_output_frame(struct ifnet *, struct mbuf *); extern char *ether_sprintf(const u_int8_t *); void ether_vlan_mtap(struct bpf_if *, struct mbuf *, Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if.c Fri Apr 26 12:50:32 2013 (r249925) @@ -134,7 +134,7 @@ int (*carp_master_p)(struct ifaddr *); #if defined(INET) || defined(INET6) int (*carp_forus_p)(struct ifnet *ifp, u_char *dhost); int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *sa); + const struct sockaddr *sa); int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *); int (*carp_attach_p)(struct ifaddr *, int); void (*carp_detach_p)(struct ifaddr *); Modified: head/sys/net/if_arc.h ============================================================================== --- head/sys/net/if_arc.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_arc.h Fri Apr 26 12:50:32 2013 (r249925) @@ -133,7 +133,7 @@ void arc_storelladdr(struct ifnet *, u_i int arc_isphds(u_int8_t); void arc_input(struct ifnet *, struct mbuf *); int arc_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + const struct sockaddr *, struct route *); int arc_ioctl(struct ifnet *, u_long, caddr_t); void arc_frag_init(struct ifnet *); Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_arcsubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -92,8 +92,8 @@ u_int8_t arcbroadcastaddr = 0; #define ARC_LLADDR(ifp) (*(u_int8_t *)IF_LLADDR(ifp)) #define senderr(e) { error = (e); goto bad;} -#define SIN(s) ((struct sockaddr_in *)s) -#define SIPX(s) ((struct sockaddr_ipx *)s) +#define SIN(s) ((const struct sockaddr_in *)(s)) +#define SIPX(s) ((const struct sockaddr_ipx *)(s)) /* * ARCnet output routine. @@ -101,7 +101,7 @@ u_int8_t arcbroadcastaddr = 0; * Assumes that ifp is actually pointer to arccom structure. */ int -arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { struct arc_header *ah; @@ -186,8 +186,11 @@ arc_output(struct ifnet *ifp, struct mbu #endif case AF_UNSPEC: + { + const struct arc_header *ah; + loop_copy = -1; - ah = (struct arc_header *)dst->sa_data; + ah = (const struct arc_header *)dst->sa_data; adst = ah->arc_dhost; atype = ah->arc_type; @@ -207,7 +210,7 @@ arc_output(struct ifnet *ifp, struct mbu #endif } break; - + } default: if_printf(ifp, "can't handle af%d\n", dst->sa_family); senderr(EAFNOSUPPORT); Modified: head/sys/net/if_atm.h ============================================================================== --- head/sys/net/if_atm.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_atm.h Fri Apr 26 12:50:32 2013 (r249925) @@ -292,7 +292,7 @@ void atm_ifattach(struct ifnet *); void atm_ifdetach(struct ifnet *); void atm_input(struct ifnet *, struct atm_pseudohdr *, struct mbuf *, void *); -int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *, +int atm_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int, struct mtx *, int); Modified: head/sys/net/if_atmsubr.c ============================================================================== --- head/sys/net/if_atmsubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_atmsubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -121,7 +121,7 @@ static MALLOC_DEFINE(M_IFATM, "ifatm", " * ro->ro_rt must also be NULL. */ int -atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, +atm_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, struct route *ro) { u_int16_t etype = 0; /* if using LLC/SNAP */ @@ -129,7 +129,7 @@ atm_output(struct ifnet *ifp, struct mbu struct atm_pseudohdr atmdst, *ad; struct mbuf *m = m0; struct atmllc *atmllc; - struct atmllc *llc_hdr = NULL; + const struct atmllc *llc_hdr = NULL; u_int32_t atm_flags; #ifdef MAC @@ -173,7 +173,7 @@ atm_output(struct ifnet *ifp, struct mbu * (atm pseudo header (4) + LLC/SNAP (8)) */ bcopy(dst->sa_data, &atmdst, sizeof(atmdst)); - llc_hdr = (struct atmllc *)(dst->sa_data + + llc_hdr = (const struct atmllc *)(dst->sa_data + sizeof(atmdst)); break; Modified: head/sys/net/if_dead.c ============================================================================== --- head/sys/net/if_dead.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_dead.c Fri Apr 26 12:50:32 2013 (r249925) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include static int -ifdead_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, +ifdead_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa, struct route *ro) { Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_disc.c Fri Apr 26 12:50:32 2013 (r249925) @@ -64,7 +64,7 @@ struct disc_softc { }; static int discoutput(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + const struct sockaddr *, struct route *); static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *); static int discioctl(struct ifnet *, u_long, caddr_t); static int disc_clone_create(struct if_clone *, int, caddr_t); @@ -155,7 +155,7 @@ static moduledata_t disc_mod = { DECLARE_MODULE(if_disc, disc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); static int -discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { u_int32_t af; @@ -163,15 +163,14 @@ discoutput(struct ifnet *ifp, struct mbu M_ASSERTPKTHDR(m); /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } + else + af = dst->sa_family; - if (bpf_peers_present(ifp->if_bpf)) { - u_int af = dst->sa_family; + if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); - } + m->m_pkthdr.rcvif = ifp; ifp->if_opackets++; Modified: head/sys/net/if_ef.c ============================================================================== --- head/sys/net/if_ef.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_ef.c Fri Apr 26 12:50:32 2013 (r249925) @@ -102,7 +102,7 @@ static int efcount; extern int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m); extern int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, - struct sockaddr *dst, short *tp, int *hlen); + const struct sockaddr *dst, short *tp, int *hlen); /* static void ef_reset (struct ifnet *); @@ -114,7 +114,7 @@ static int ef_ioctl(struct ifnet *, u_lo static void ef_start(struct ifnet *); static int ef_input(struct ifnet*, struct ether_header *, struct mbuf *); static int ef_output(struct ifnet *ifp, struct mbuf **mp, - struct sockaddr *dst, short *tp, int *hlen); + const struct sockaddr *dst, short *tp, int *hlen); static int ef_load(void); static int ef_unload(void); @@ -386,8 +386,8 @@ ef_input(struct ifnet *ifp, struct ether } static int -ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, - int *hlen) +ef_output(struct ifnet *ifp, struct mbuf **mp, const struct sockaddr *dst, + short *tp, int *hlen) { struct efnet *sc = (struct efnet*)ifp->if_softc; struct mbuf *m = *mp; Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_enc.c Fri Apr 26 12:50:32 2013 (r249925) @@ -88,7 +88,7 @@ struct enc_softc { static int enc_ioctl(struct ifnet *, u_long, caddr_t); static int enc_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro); + const struct sockaddr *dst, struct route *ro); static int enc_clone_create(struct if_clone *, int, caddr_t); static void enc_clone_destroy(struct ifnet *); static struct if_clone *enc_cloner; @@ -188,7 +188,7 @@ static moduledata_t enc_mod = { DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); static int -enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +enc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { m_freem(m); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_ethersubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -83,7 +83,7 @@ int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m); int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, - struct sockaddr *dst, short *tp, int *hlen); + const struct sockaddr *dst, short *tp, int *hlen); #ifdef NETATALK #include @@ -149,7 +149,7 @@ static MALLOC_DEFINE(M_ARPCOM, "arpcom", */ int ether_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { short type; int error = 0, hdrcmplt = 0; @@ -238,8 +238,8 @@ ether_output(struct ifnet *ifp, struct m goto bad; } else type = htons(ETHERTYPE_IPX); - bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host), - (caddr_t)edst, sizeof (edst)); + bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host, + edst, sizeof (edst)); break; #endif #ifdef NETATALK @@ -247,9 +247,9 @@ ether_output(struct ifnet *ifp, struct m { struct at_ifaddr *aa; - if ((aa = at_ifawithnet((struct sockaddr_at *)dst)) == NULL) + if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == NULL) senderr(EHOSTUNREACH); /* XXX */ - if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) { + if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) { ifa_free(&aa->aa_ifa); return (0); } @@ -279,18 +279,21 @@ ether_output(struct ifnet *ifp, struct m #endif /* NETATALK */ case pseudo_AF_HDRCMPLT: + { + const struct ether_header *eh; + hdrcmplt = 1; - eh = (struct ether_header *)dst->sa_data; + eh = (const struct ether_header *)dst->sa_data; (void)memcpy(esrc, eh->ether_shost, sizeof (esrc)); /* FALLTHROUGH */ case AF_UNSPEC: loop_copy = 0; /* if this is for us, don't do it */ - eh = (struct ether_header *)dst->sa_data; + eh = (const struct ether_header *)dst->sa_data; (void)memcpy(edst, eh->ether_dhost, sizeof (edst)); type = eh->ether_type; break; - + } default: if_printf(ifp, "can't handle af%d\n", dst->sa_family); senderr(EAFNOSUPPORT); Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_faith.c Fri Apr 26 12:50:32 2013 (r249925) @@ -84,7 +84,7 @@ struct faith_softc { }; static int faithioctl(struct ifnet *, u_long, caddr_t); -int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *, +static int faithoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *); #ifdef INET6 @@ -184,12 +184,9 @@ faith_clone_destroy(ifp) free(sc, M_FAITH); } -int -faithoutput(ifp, m, dst, ro) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr *dst; - struct route *ro; +static int +faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { int isr; u_int32_t af; @@ -200,15 +197,13 @@ faithoutput(ifp, m, dst, ro) if (ro != NULL) rt = ro->ro_rt; /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } - - if (bpf_peers_present(ifp->if_bpf)) { + else af = dst->sa_family; + + if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); - } if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { m_freem(m); @@ -217,7 +212,7 @@ faithoutput(ifp, m, dst, ro) } ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; - switch (dst->sa_family) { + switch (af) { #ifdef INET case AF_INET: isr = NETISR_IP; Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_fddisubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -96,7 +96,7 @@ static const u_char fddibroadcastaddr[FD static int fddi_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); -static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *, +static int fddi_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static void fddi_input(struct ifnet *ifp, struct mbuf *m); @@ -110,11 +110,8 @@ static void fddi_input(struct ifnet *ifp * Assumes that ifp is actually pointer to arpcom structure. */ static int -fddi_output(ifp, m, dst, ro) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr *dst; - struct route *ro; +fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { u_int16_t type; int loop_copy = 0, error = 0, hdrcmplt = 0; @@ -189,19 +186,19 @@ fddi_output(ifp, m, dst, ro) #ifdef IPX case AF_IPX: type = htons(ETHERTYPE_IPX); - bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host), - (caddr_t)edst, FDDI_ADDR_LEN); + bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host, + edst, FDDI_ADDR_LEN); break; #endif /* IPX */ #ifdef NETATALK case AF_APPLETALK: { struct at_ifaddr *aa; - if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) + if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) return (0); /* * ifaddr is the first thing in at_ifaddr */ - if ((aa = at_ifawithnet( (struct sockaddr_at *)dst)) == 0) + if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == 0) goto bad; /* @@ -229,19 +226,21 @@ fddi_output(ifp, m, dst, ro) case pseudo_AF_HDRCMPLT: { - struct ether_header *eh; + const struct ether_header *eh; + hdrcmplt = 1; - eh = (struct ether_header *)dst->sa_data; - bcopy((caddr_t)eh->ether_shost, (caddr_t)esrc, FDDI_ADDR_LEN); + eh = (const struct ether_header *)dst->sa_data; + bcopy(eh->ether_shost, esrc, FDDI_ADDR_LEN); /* FALLTHROUGH */ } case AF_UNSPEC: { - struct ether_header *eh; + const struct ether_header *eh; + loop_copy = -1; - eh = (struct ether_header *)dst->sa_data; - bcopy((caddr_t)eh->ether_dhost, (caddr_t)edst, FDDI_ADDR_LEN); + eh = (const struct ether_header *)dst->sa_data; + bcopy(eh->ether_dhost, edst, FDDI_ADDR_LEN); if (*edst & 1) m->m_flags |= (M_BCAST|M_MCAST); type = eh->ether_type; Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_fwsubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -75,7 +75,7 @@ struct fw_hwaddr firewire_broadcastaddr }; static int -firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { struct fw_com *fc = IFP2FWC(ifp); Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_gif.c Fri Apr 26 12:50:32 2013 (r249925) @@ -422,11 +422,8 @@ gif_start(struct ifnet *ifp) } int -gif_output(ifp, m, dst, ro) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr *dst; - struct route *ro; +gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { struct gif_softc *sc = ifp->if_softc; struct m_tag *mtag; @@ -482,11 +479,10 @@ gif_output(ifp, m, dst, ro) m->m_flags &= ~(M_BCAST|M_MCAST); /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } - af = dst->sa_family; + else + af = dst->sa_family; /* * Now save the af in the inbound pkt csum * data, this is a cheat since we are using Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_gif.h Fri Apr 26 12:50:32 2013 (r249925) @@ -112,7 +112,7 @@ struct etherip_header { /* Prototypes */ void gif_input(struct mbuf *, int, struct ifnet *); -int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *, +int gif_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); int gif_ioctl(struct ifnet *, u_long, caddr_t); int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *); Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_gre.c Fri Apr 26 12:50:32 2013 (r249925) @@ -113,8 +113,8 @@ static void gre_clone_destroy(struct ifn static struct if_clone *gre_cloner; static int gre_ioctl(struct ifnet *, u_long, caddr_t); -static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *, - struct route *ro); +static int gre_output(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); static int gre_compute_route(struct gre_softc *sc); @@ -241,7 +241,7 @@ gre_clone_destroy(ifp) * given by sc->g_proto. See also RFC 1701 and RFC 2004 */ static int -gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { int error = 0; @@ -333,20 +333,18 @@ gre_output(struct ifnet *ifp, struct mbu ip = NULL; /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } - - if (bpf_peers_present(ifp->if_bpf)) { + else af = dst->sa_family; + + if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); - } m->m_flags &= ~(M_BCAST|M_MCAST); if (sc->g_proto == IPPROTO_MOBILE) { - if (dst->sa_family == AF_INET) { + if (af == AF_INET) { struct mbuf *m0; int msiz; @@ -417,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbu goto end; } } else if (sc->g_proto == IPPROTO_GRE) { - switch (dst->sa_family) { + switch (af) { case AF_INET: ip = mtod(m, struct ip *); gre_ip_tos = ip->ip_tos; Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_iso88025subr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -231,11 +231,8 @@ iso88025_ioctl(struct ifnet *ifp, u_long * ISO88025 encapsulation */ int -iso88025_output(ifp, m, dst, ro) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr *dst; - struct route *ro; +iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { u_int16_t snap_type = 0; int loop_copy = 0, error = 0, rif_len = 0; @@ -351,7 +348,7 @@ iso88025_output(ifp, m, dst, ro) #endif /* IPX */ case AF_UNSPEC: { - struct iso88025_sockaddr_data *sd; + const struct iso88025_sockaddr_data *sd; /* * For AF_UNSPEC sockaddr.sa_data must contain all of the * mac information needed to send the packet. This allows @@ -361,13 +358,12 @@ iso88025_output(ifp, m, dst, ro) * should be an iso88025_sockaddr_data structure see iso88025.h */ loop_copy = -1; - sd = (struct iso88025_sockaddr_data *)dst->sa_data; + sd = (const struct iso88025_sockaddr_data *)dst->sa_data; gen_th.ac = sd->ac; gen_th.fc = sd->fc; - (void)memcpy((caddr_t)edst, (caddr_t)sd->ether_dhost, - ISO88025_ADDR_LEN); - (void)memcpy((caddr_t)gen_th.iso88025_shost, - (caddr_t)sd->ether_shost, ISO88025_ADDR_LEN); + (void)memcpy(edst, sd->ether_dhost, ISO88025_ADDR_LEN); + (void)memcpy(gen_th.iso88025_shost, sd->ether_shost, + ISO88025_ADDR_LEN); rif_len = 0; break; } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_lagg.c Fri Apr 26 12:50:32 2013 (r249925) @@ -99,7 +99,7 @@ static void lagg_linkstate(struct lagg_s static void lagg_port_state(struct ifnet *, int); static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); static int lagg_port_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + const struct sockaddr *, struct route *); static void lagg_port_ifdetach(void *arg __unused, struct ifnet *); #ifdef LAGG_PORT_STACKING static int lagg_port_checkstacking(struct lagg_softc *); @@ -787,7 +787,7 @@ fallback: */ static int lagg_port_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { struct lagg_port *lp = ifp->if_lagg; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_lagg.h Fri Apr 26 12:50:32 2013 (r249925) @@ -245,8 +245,8 @@ struct lagg_port { /* Redirected callbacks */ int (*lp_ioctl)(struct ifnet *, u_long, caddr_t); - int (*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *, - struct route *); + int (*lp_output)(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); SLIST_ENTRY(lagg_port) lp_entries; }; Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_loop.c Fri Apr 26 12:50:32 2013 (r249925) @@ -101,7 +101,7 @@ int loioctl(struct ifnet *, u_long, caddr_t); static void lortrequest(int, struct rtentry *, struct rt_addrinfo *); int looutput(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro); + const struct sockaddr *dst, struct route *ro); static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); @@ -210,7 +210,7 @@ static moduledata_t loop_mod = { DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); int -looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { u_int32_t af; @@ -241,13 +241,13 @@ looutput(struct ifnet *ifp, struct mbuf ifp->if_obytes += m->m_pkthdr.len; /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } + else + af = dst->sa_family; #if 1 /* XXX */ - switch (dst->sa_family) { + switch (af) { case AF_INET: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; @@ -276,12 +276,12 @@ looutput(struct ifnet *ifp, struct mbuf case AF_APPLETALK: break; default: - printf("looutput: af=%d unexpected\n", dst->sa_family); + printf("looutput: af=%d unexpected\n", af); m_freem(m); return (EAFNOSUPPORT); } #endif - return (if_simloop(ifp, m, dst->sa_family, 0)); + return (if_simloop(ifp, m, af, 0)); } /* Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_spppsubr.c Fri Apr 26 12:50:32 2013 (r249925) @@ -262,7 +262,7 @@ static const u_short interactive_ports[8 int debug = ifp->if_flags & IFF_DEBUG static int sppp_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro); + const struct sockaddr *dst, struct route *ro); static void sppp_cisco_send(struct sppp *sp, int type, long par1, long par2); static void sppp_cisco_input(struct sppp *sp, struct mbuf *m); @@ -785,8 +785,8 @@ sppp_ifstart(struct ifnet *ifp) * Enqueue transmit packet. */ static int -sppp_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) +sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { struct sppp *sp = IFP2SP(ifp); struct ppp_header *h; Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_stf.c Fri Apr 26 12:50:32 2013 (r249925) @@ -140,7 +140,7 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, perm * XXX: Return a pointer with 16-bit aligned. Don't cast it to * struct in_addr *; use bcopy() instead. */ -#define GET_V4(x) ((caddr_t)(&(x)->s6_addr16[1])) +#define GET_V4(x) (&(x)->s6_addr16[1]) struct stf_softc { struct ifnet *sc_ifp; @@ -181,7 +181,7 @@ static char *stfnames[] = {"stf0", "stf" static int stfmodevent(module_t, int, void *); static int stf_encapcheck(const struct mbuf *, int, int, void *); static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *); -static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *, +static int stf_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static int isrfc1918addr(struct in_addr *); static int stf_checkaddr4(struct stf_softc *, struct in_addr *, @@ -413,23 +413,19 @@ stf_getsrcifa6(ifp) } static int -stf_output(ifp, m, dst, ro) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr *dst; - struct route *ro; +stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) { struct stf_softc *sc; - struct sockaddr_in6 *dst6; + const struct sockaddr_in6 *dst6; struct route *cached_route; struct in_addr in4; - caddr_t ptr; + const void *ptr; struct sockaddr_in *dst4; u_int8_t tos; struct ip *ip; struct ip6_hdr *ip6; struct in6_ifaddr *ia6; - u_int32_t af; int error; #ifdef MAC @@ -441,7 +437,7 @@ stf_output(ifp, m, dst, ro) #endif sc = ifp->if_softc; - dst6 = (struct sockaddr_in6 *)dst; + dst6 = (const struct sockaddr_in6 *)dst; /* just in case */ if ((ifp->if_flags & IFF_UP) == 0) { @@ -474,15 +470,6 @@ stf_output(ifp, m, dst, ro) tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; /* - * BPF writes need to be handled specially. - * This is a null operation, nothing here checks dst->sa_family. - */ - if (dst->sa_family == AF_UNSPEC) { - bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } - - /* * Pickup the right outer dst addr from the list of candidates. * ip6_dst has priority as it may be able to give us shorter IPv4 hops. */ @@ -507,7 +494,7 @@ stf_output(ifp, m, dst, ro) * will only read from the mbuf (i.e., it won't * try to free it or keep a pointer a to it). */ - af = AF_INET6; + u_int af = AF_INET6; bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); } Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_tun.c Fri Apr 26 12:50:32 2013 (r249925) @@ -128,8 +128,8 @@ static void tuncreate(const char *name, static int tunifioctl(struct ifnet *, u_long, caddr_t); static void tuninit(struct ifnet *); static int tunmodevent(module_t, int, void *); -static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *, - struct route *ro); +static int tunoutput(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *ro); static void tunstart(struct ifnet *); static int tun_clone_create(struct if_clone *, int, caddr_t); @@ -575,7 +575,7 @@ tunifioctl(struct ifnet *ifp, u_long cmd * tunoutput - queue packets from higher level ready to put out. */ static int -tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, +tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, struct route *ro) { struct tun_softc *tp = ifp->if_softc; @@ -609,15 +609,13 @@ tunoutput(struct ifnet *ifp, struct mbuf } /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } - - if (bpf_peers_present(ifp->if_bpf)) { + else af = dst->sa_family; + + if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); - } /* prepend sockaddr? this may abort if the mbuf allocation fails */ if (cached_tun_flags & TUN_LMODE) { @@ -644,10 +642,10 @@ tunoutput(struct ifnet *ifp, struct mbuf ifp->if_oerrors++; return (ENOBUFS); } else - *(u_int32_t *)m0->m_data = htonl(dst->sa_family); + *(u_int32_t *)m0->m_data = htonl(af); } else { #ifdef INET - if (dst->sa_family != AF_INET) + if (af != AF_INET) #endif { m_freem(m0); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/if_var.h Fri Apr 26 12:50:32 2013 (r249925) @@ -158,7 +158,7 @@ struct ifnet { int if_amcount; /* number of all-multicast requests */ /* procedure handles */ int (*if_output) /* output routine (enqueue) */ - (struct ifnet *, struct mbuf *, struct sockaddr *, + (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); void (*if_input) /* input routine (from h/w driver) */ (struct ifnet *, struct mbuf *); Modified: head/sys/net/iso88025.h ============================================================================== --- head/sys/net/iso88025.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net/iso88025.h Fri Apr 26 12:50:32 2013 (r249925) @@ -165,8 +165,8 @@ struct iso88025_addr { void iso88025_ifattach (struct ifnet *, const u_int8_t *, int); void iso88025_ifdetach (struct ifnet *, int); int iso88025_ioctl (struct ifnet *, u_long, caddr_t ); -int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *, - struct route *); +int iso88025_output (struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); void iso88025_input (struct ifnet *, struct mbuf *); #endif Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net80211/ieee80211.c Fri Apr 26 12:50:32 2013 (r249925) @@ -243,7 +243,7 @@ null_transmit(struct ifnet *ifp, struct static int null_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { if_printf(ifp, "discard raw packet\n"); return null_transmit(ifp, m); Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net80211/ieee80211_output.c Fri Apr 26 12:50:32 2013 (r249925) @@ -450,7 +450,7 @@ ieee80211_raw_output(struct ieee80211vap */ int ieee80211_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { #define senderr(e) do { error = (e); goto bad;} while (0) struct ieee80211_node *ni = NULL; Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net80211/ieee80211_proto.h Fri Apr 26 12:50:32 2013 (r249925) @@ -97,7 +97,7 @@ int ieee80211_mgmt_output(struct ieee802 int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); int ieee80211_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *ro); + const struct sockaddr *, struct route *ro); int ieee80211_raw_output(struct ieee80211vap *, struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); void ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int, Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/net80211/ieee80211_var.h Fri Apr 26 12:50:32 2013 (r249925) @@ -497,7 +497,7 @@ struct ieee80211vap { enum ieee80211_state, int); /* 802.3 output method for raw frame xmit */ int (*iv_output)(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + const struct sockaddr *, struct route *); uint64_t iv_spare[6]; }; MALLOC_DECLARE(M_80211_VAP); Modified: head/sys/netatalk/aarp.c ============================================================================== --- head/sys/netatalk/aarp.c Fri Apr 26 12:27:30 2013 (r249924) +++ head/sys/netatalk/aarp.c Fri Apr 26 12:50:32 2013 (r249925) @@ -147,7 +147,7 @@ aarptimer(void *ignored) * unlocked variant returns a reference that the caller must dispose of. */ struct at_ifaddr * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 13:02:11 2013 Return-Path: Delivered-To: svn-src-head@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 D63B997E; Fri, 26 Apr 2013 13:02:11 +0000 (UTC) (envelope-from glebius@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 C772E17BF; Fri, 26 Apr 2013 13:02: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 r3QD2BCR078212; Fri, 26 Apr 2013 13:02:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QD2Bku078211; Fri, 26 Apr 2013 13:02:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304261302.r3QD2Bku078211@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 26 Apr 2013 13:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249926 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 13:02:11 -0000 Author: glebius Date: Fri Apr 26 13:02:11 2013 New Revision: 249926 URL: http://svnweb.freebsd.org/changeset/base/249926 Log: On those machines that use critical(9) for counter(9) we need to include systm.h. Modified: head/share/man/man9/counter.9 Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Fri Apr 26 12:50:32 2013 (r249925) +++ head/share/man/man9/counter.9 Fri Apr 26 13:02:11 2013 (r249926) @@ -33,6 +33,7 @@ .Nd "SMP-friendly kernel counter implementation" .Sh SYNOPSIS .In sys/types.h +.In sys/systm.h .In sys/counter.h .Ft counter_u64_t .Fn counter_u64_alloc "int wait" From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 13:03:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A53F4B24; Fri, 26 Apr 2013 13:03:22 +0000 (UTC) (envelope-from glebius@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 7CE8317CC; Fri, 26 Apr 2013 13:03: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 r3QD3M3D078488; Fri, 26 Apr 2013 13:03:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QD3MO7078487; Fri, 26 Apr 2013 13:03:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304261303.r3QD3MO7078487@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 26 Apr 2013 13:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249927 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 13:03:22 -0000 Author: glebius Date: Fri Apr 26 13:03:22 2013 New Revision: 249927 URL: http://svnweb.freebsd.org/changeset/base/249927 Log: Add usie to LINT. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Apr 26 13:02:11 2013 (r249926) +++ head/sys/conf/NOTES Fri Apr 26 13:03:22 2013 (r249927) @@ -2744,6 +2744,9 @@ device urtw # # ZyDas ZD1211/ZD1211B wireless driver device zyd +# +# Sierra USB wireless driver +device usie # # debugging options for the USB subsystem From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 13:18:07 2013 Return-Path: Delivered-To: svn-src-head@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 D5B5A80; Fri, 26 Apr 2013 13:18:07 +0000 (UTC) (envelope-from glebius@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 C8C2C185A; Fri, 26 Apr 2013 13:18: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 r3QDI7qm083268; Fri, 26 Apr 2013 13:18:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QDI7wi083267; Fri, 26 Apr 2013 13:18:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304261318.r3QDI7wi083267@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 26 Apr 2013 13:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249928 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 13:18:07 -0000 Author: glebius Date: Fri Apr 26 13:18:07 2013 New Revision: 249928 URL: http://svnweb.freebsd.org/changeset/base/249928 Log: Document constantness of dst argument to if_output. Submitted by: pluknet Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Apr 26 13:03:22 2013 (r249927) +++ head/share/man/man9/ifnet.9 Fri Apr 26 13:18:07 2013 (r249928) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2012 +.Dd April 26, 2013 .Dt IFNET 9 .Os .Sh NAME @@ -103,7 +103,7 @@ .Ft int .Fo \*(lp*if_output\*(rp .Fa "struct ifnet *ifp" "struct mbuf *m" -.Fa "struct sockaddr *dst" "struct route *ro" +.Fa "const struct sockaddr *dst" "struct route *ro" .Fc .Ft void .Fn \*(lp*if_start\*(rp "struct ifnet *ifp" From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:31:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50B02C69; Fri, 26 Apr 2013 15:31:53 +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 42E4D1F51; Fri, 26 Apr 2013 15:31: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 r3QFVrdm032407; Fri, 26 Apr 2013 15:31:53 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QFVqi7032406; Fri, 26 Apr 2013 15:31:52 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261531.r3QFVqi7032406@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 15:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249929 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:31:53 -0000 Author: smh Date: Fri Apr 26 15:31:52 2013 New Revision: 249929 URL: http://svnweb.freebsd.org/changeset/base/249929 Log: Removed unneeded tests in dadeletemethodset changing it to return void Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 26 13:18:07 2013 (r249928) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 26 15:31:52 2013 (r249929) @@ -868,7 +868,7 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); -static int dadeletemethodset(struct da_softc *softc, +static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); static periph_ctor_t daregister; static periph_dtor_t dacleanup; @@ -1568,12 +1568,10 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) return (0); } -static int +static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method) { - if (delete_method < 0 || delete_method > DA_DELETE_MAX) - return (EINVAL); softc->delete_method = delete_method; @@ -1581,8 +1579,6 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags |= DISKFLAG_CANDELETE; else softc->disk->d_flags &= ~DISKFLAG_CANDELETE; - - return (0); } static int @@ -1607,7 +1603,8 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) != 0) continue; - return dadeletemethodset(softc, i); + dadeletemethodset(softc, i); + return (0); } return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:43:24 2013 Return-Path: Delivered-To: svn-src-head@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 B2842E73; Fri, 26 Apr 2013 15:43:24 +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 951761FA2; Fri, 26 Apr 2013 15:43: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 r3QFhO9s036017; Fri, 26 Apr 2013 15:43:24 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QFhOxU036016; Fri, 26 Apr 2013 15:43:24 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261543.r3QFhOxU036016@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 15:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249930 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:43:24 -0000 Author: smh Date: Fri Apr 26 15:43:24 2013 New Revision: 249930 URL: http://svnweb.freebsd.org/changeset/base/249930 Log: Added a sysctl (kern.geom.dev.delete_max_sectors) to control the maximum size of a delete request sent to the providing device performed by g_dev_ioctl. This allows the kernel and apps via ioctl e.g. newfs -E to request large LBA deletes which siginificantly improves performance. Previously this was hard coded to 65536 sectors, the new default is 262144 which doubles the throughput of deletes on commonly available SSD's. In tests on a Intel 520 120GB FW: 400i disk it improved the delete throughput from 1.6GB/s to over 2.6GB/s on a full disk delete such as that done via newfs -E For some SSD's where delete time is pretty much constant, no matter what the request, setting this to 0 will provide significantly better throughput e.g. Samsung 840 240GB FW DXT07B0Q @ 262144 = 79G/s, @ 0 = 2259G/s Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Apr 26 15:31:52 2013 (r249929) +++ head/sys/geom/geom_dev.c Fri Apr 26 15:43:24 2013 (r249930) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -93,6 +94,19 @@ static struct g_class g_dev_class = { .attrchanged = g_dev_attrchanged }; +/* + * We target 262144 (8 x 32768) sectors by default as this significantly + * increases the throughput on commonly used SSD's with a marginal + * increase in non-interruptible request latency. + */ +static uint64_t g_dev_del_max_sectors = 262144; +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, dev, CTLFLAG_RW, 0, "GEOM_DEV stuff"); +SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, delete_max_sectors, CTLFLAG_RW, + &g_dev_del_max_sectors, 0, "Maximum number of sectors in a single " + "delete request sent to the provider. Larger requests are chunked " + "so they can be interrupted. (0 = disable chunking)"); + static void g_dev_destroy(void *arg, int flags __unused) { @@ -408,17 +422,20 @@ g_dev_ioctl(struct cdev *dev, u_long cmd } while (length > 0) { chunk = length; - if (chunk > 65536 * cp->provider->sectorsize) - chunk = 65536 * cp->provider->sectorsize; + if (g_dev_del_max_sectors != 0 && chunk > + g_dev_del_max_sectors * cp->provider->sectorsize) { + chunk = g_dev_del_max_sectors * + cp->provider->sectorsize; + } error = g_delete_data(cp, offset, chunk); length -= chunk; offset += chunk; if (error) break; /* - * Since the request size is unbounded, the service - * time is likewise. We make this ioctl interruptible - * by checking for signals for each bio. + * Since the request size can be large, the service + * time can be is likewise. We make this ioctl + * interruptible by checking for signals for each bio. */ if (SIGPENDING(td)) break; From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:46:10 2013 Return-Path: Delivered-To: svn-src-head@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 F34CA7E; Fri, 26 Apr 2013 15:46:09 +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 E52651FBA; Fri, 26 Apr 2013 15:46: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 r3QFk9FN036651; Fri, 26 Apr 2013 15:46:09 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QFk9qP036650; Fri, 26 Apr 2013 15:46:09 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261546.r3QFk9qP036650@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 15:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249931 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:46:10 -0000 Author: smh Date: Fri Apr 26 15:46:09 2013 New Revision: 249931 URL: http://svnweb.freebsd.org/changeset/base/249931 Log: Added Dataset Management defines to be used by TRIM in cam ata and scsi to calculate the size of blocks. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Fri Apr 26 15:43:24 2013 (r249930) +++ head/sys/sys/ata.h Fri Apr 26 15:46:09 2013 (r249931) @@ -269,6 +269,12 @@ struct ata_params { /*255*/ u_int16_t integrity; } __packed; +/* ATA Dataset Management */ +#define ATA_DSM_BLK_SIZE 512 +#define ATA_DSM_BLK_RANGES 64 +#define ATA_DSM_RANGE_SIZE 8 +#define ATA_DSM_RANGE_MAX 65535 + /* * ATA Device Register * From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:53:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 805F0442; Fri, 26 Apr 2013 15:53:23 +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 62D481FF5; Fri, 26 Apr 2013 15:53: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 r3QFrNEP039888; Fri, 26 Apr 2013 15:53:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QFrNMT039886; Fri, 26 Apr 2013 15:53:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261553.r3QFrNMT039886@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 15:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249933 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:53:23 -0000 Author: smh Date: Fri Apr 26 15:53:22 2013 New Revision: 249933 URL: http://svnweb.freebsd.org/changeset/base/249933 Log: Added the ability to send ATA identify and Data Set Management (DSM) TRIM commands to an ATA device attached via a SCSI control. sys/cam/scsi/scsi_all.c: - Added scsi_ata_identify, scsi_ata_trim Which use ATA Pass-Through to send commands to the attached disk. sys/cam/scsi/scsi_all.h: - Added defines for all missing ATA Pass-Through commands values. - Added scsi_ata_identify, scsi_ata_trim methods used in ATA TRIM support. - Added scsi_vpd_logical_block_prov structure used when querying for the supported sizes UNMAP commands. - Added scsi_vpd_block_limits structure used when querying for the supported sizes of the UNMAP command. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Apr 26 15:48:00 2013 (r249932) +++ head/sys/cam/scsi/scsi_all.c Fri Apr 26 15:53:22 2013 (r249933) @@ -5853,6 +5853,57 @@ scsi_write_same(struct ccb_scsiio *csio, } void +scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t *data_ptr, + u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + scsi_ata_pass_16(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_TDIR_FROM_DEV| + AP_FLAG_BYT_BLOK_BYTES|AP_FLAG_TLEN_SECT_CNT, + /*features*/0, + /*sector_count*/dxfer_len, + /*lba*/0, + /*command*/ATA_ATA_IDENTIFY, + /*control*/0, + data_ptr, + dxfer_len, + sense_len, + timeout); +} + +void +scsi_ata_trim(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int16_t block_count, + u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + scsi_ata_pass_16(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*protocol*/AP_EXTEND|AP_PROTO_DMA, + /*ata_flags*/AP_FLAG_TLEN_SECT_CNT|AP_FLAG_BYT_BLOK_BLOCKS, + /*features*/ATA_DSM_TRIM, + /*sector_count*/block_count, + /*lba*/0, + /*command*/ATA_DATA_SET_MANAGEMENT, + /*control*/0, + data_ptr, + dxfer_len, + sense_len, + timeout); +} + +void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Apr 26 15:48:00 2013 (r249932) +++ head/sys/cam/scsi/scsi_all.h Fri Apr 26 15:53:22 2013 (r249933) @@ -1429,6 +1429,61 @@ struct scsi_diag_page { uint8_t params[0]; }; +/* + * Logical Block Provisioning VPD Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_logical_block_prov +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_LBP 0xB2 + u_int8_t page_length[2]; +#define SVPD_LBP_PL_BASIC 0x04 + u_int8_t threshold_exponent; + u_int8_t flags; +#define SVPD_LBP_UNMAP 0x80 +#define SVPD_LBP_WS16 0x40 +#define SVPD_LBP_WS10 0x20 +#define SVPD_LBP_RZ 0x04 +#define SVPD_LBP_ANC_SUP 0x02 +#define SVPD_LBP_DP 0x01 + u_int8_t prov_type; +#define SVPD_LBP_RESOURCE 0x01 +#define SVPD_LBP_THIN 0x02 + u_int8_t reserved; + /* + * Provisioning Group Descriptor can be here if SVPD_LBP_DP is set + * Its size can be determined from page_length - 4 + */ +}; + +/* + * Block Limits VDP Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_block_limits +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_BLOCK_LIMITS 0xB0 + u_int8_t page_length[2]; +#define SVPD_BL_PL_BASIC 0x10 +#define SVPD_BL_PL_TP 0x3C + u_int8_t reserved1; + u_int8_t max_cmp_write_len; + u_int8_t opt_txfer_len_grain[2]; + u_int8_t max_txfer_len[4]; + u_int8_t opt_txfer_len[4]; + u_int8_t max_prefetch[4]; + u_int8_t max_unmap_lba_cnt[4]; + u_int8_t max_unmap_blk_cnt[4]; + u_int8_t opt_unmap_grain[4]; + u_int8_t unmap_grain_align[4]; + u_int8_t max_write_same_length[8]; + u_int8_t reserved2[20]; +}; + struct scsi_read_capacity { u_int8_t opcode; @@ -2396,6 +2451,18 @@ void scsi_write_same(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t *data_ptr, + u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_ata_trim(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int16_t block_count, + u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:59:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22ABC89A; Fri, 26 Apr 2013 15:59:20 +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 158791055; Fri, 26 Apr 2013 15:59: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 r3QFxJmB041104; Fri, 26 Apr 2013 15:59:19 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QFxJEM041103; Fri, 26 Apr 2013 15:59:19 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261559.r3QFxJEM041103@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 15:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249934 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:59:20 -0000 Author: smh Date: Fri Apr 26 15:59:19 2013 New Revision: 249934 URL: http://svnweb.freebsd.org/changeset/base/249934 Log: Updated TRIM calculations in cam/ata to be based off ATA_DSM_* defines Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Apr 26 15:53:22 2013 (r249933) +++ head/sys/cam/ata/ata_da.c Fri Apr 26 15:59:19 2013 (r249934) @@ -117,10 +117,10 @@ struct disk_params { }; #define TRIM_MAX_BLOCKS 8 -#define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * 64) +#define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * ATA_DSM_BLK_RANGES) #define TRIM_MAX_BIOS (TRIM_MAX_RANGES * 4) struct trim_request { - uint8_t data[TRIM_MAX_RANGES * 8]; + uint8_t data[TRIM_MAX_RANGES * ATA_DSM_RANGE_SIZE]; struct bio *bps[TRIM_MAX_BIOS]; }; @@ -1109,8 +1109,8 @@ adaregister(struct cam_periph *periph, v softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { softc->trim_max_ranges = - min(cgd->ident_data.max_dsm_blocks * 64, - softc->trim_max_ranges); + min(cgd->ident_data.max_dsm_blocks * + ATA_DSM_BLK_RANGES, softc->trim_max_ranges); } } if (cgd->ident_data.support.command2 & ATA_SUPPORT_CFA) @@ -1186,10 +1186,12 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags = 0; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - if ((softc->flags & ADA_FLAG_CAN_TRIM) || - ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT))) + if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + softc->disk->d_flags |= DISKFLAG_CANDELETE; + } if ((cpi.hba_misc & PIM_UNMAPPED) != 0) softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, @@ -1354,9 +1356,9 @@ adastart(struct cam_periph *periph, unio /* Try to extend the previous range. */ if (lba == lastlba) { - c = min(count, 0xffff - lastcount); + c = min(count, ATA_DSM_RANGE_MAX - lastcount); lastcount += c; - off = (ranges - 1) * 8; + off = (ranges - 1) * ATA_DSM_RANGE_SIZE; req->data[off + 6] = lastcount & 0xff; req->data[off + 7] = (lastcount >> 8) & 0xff; @@ -1365,8 +1367,8 @@ adastart(struct cam_periph *periph, unio } while (count > 0) { - c = min(count, 0xffff); - off = ranges * 8; + c = min(count, ATA_DSM_RANGE_MAX); + off = ranges * ATA_DSM_RANGE_SIZE; req->data[off + 0] = lba & 0xff; req->data[off + 1] = (lba >> 8) & 0xff; req->data[off + 2] = (lba >> 16) & 0xff; @@ -1379,6 +1381,11 @@ adastart(struct cam_periph *periph, unio count -= c; lastcount = c; ranges++; + /* + * Its the caller's responsibility to ensure the + * request will fit so we don't need to check for + * overrun here + */ } lastlba = lba; req->bps[bps++] = bp1; @@ -1386,7 +1393,8 @@ adastart(struct cam_periph *periph, unio if (bps >= TRIM_MAX_BIOS || bp1 == NULL || bp1->bio_bcount / softc->params.secsize > - (softc->trim_max_ranges - ranges) * 0xffff) + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX) break; } while (1); cam_fill_ataio(ataio, @@ -1395,10 +1403,12 @@ adastart(struct cam_periph *periph, unio CAM_DIR_OUT, 0, req->data, - ((ranges + 63) / 64) * 512, + ((ranges + ATA_DSM_BLK_RANGES - 1) / + ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, ada_default_timeout * 1000); ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, - ATA_DSM_TRIM, 0, (ranges + 63) / 64); + ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - + 1) / ATA_DSM_BLK_RANGES); start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; goto out; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 15:59:34 2013 Return-Path: Delivered-To: svn-src-head@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 86DA1A1C; Fri, 26 Apr 2013 15:59:34 +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 19EC71057; Fri, 26 Apr 2013 15:59:34 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 7307A3592E7; Fri, 26 Apr 2013 17:59:33 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 4D3DF28493; Fri, 26 Apr 2013 17:59:33 +0200 (CEST) Date: Fri, 26 Apr 2013 17:59:33 +0200 From: Jilles Tjoelker To: Bruce Evans Subject: Re: svn commit: r249859 - head/lib/libc/sys Message-ID: <20130426155933.GA24412@stack.nl> References: <201304242124.r3OLOZW5034818@svn.freebsd.org> <20130425204458.F1034@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130425204458.F1034@besplex.bde.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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 15:59:34 -0000 On Thu, Apr 25, 2013 at 09:56:01PM +1000, Bruce Evans wrote: > On Wed, 24 Apr 2013, Jilles Tjoelker wrote: > > Log: > > getdtablesize(2): Describe what this function actually does. > > getdtablesize() returns the limit on new file descriptors; this > > says nothing about existing descriptors. > It's still quite broken. > > Modified: head/lib/libc/sys/getdtablesize.2 > > ============================================================================== > > --- head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:21:03 2013 (r249858) > > +++ head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:24:35 2013 (r249859) > > @@ -28,12 +28,12 @@ > > .\" @(#)getdtablesize.2 8.1 (Berkeley) 6/4/93 > > .\" $FreeBSD$ > > .\" > > -.Dd June 4, 1993 > > +.Dd April 24, 2013 > > .Dt GETDTABLESIZE 2 > > .Os > > .Sh NAME > > .Nm getdtablesize > > -.Nd get descriptor table size > > +.Nd get file descriptor limit > Now its name doesn't match its description, and the reason for this is > not documented. This seems to be the case on most systems that have this function. > This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} > or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. There is a difference between sysconf(_SC_OPEN_MAX) and getdtablesize(): the latter also takes maxfilesperproc and rctl(8) rules into account. > I prepared to remove the broken definition of OPEN_MAX, but never committed > the final step. /usr/src has very few misuses of OPEN_MAX now, so removing > the definition wouldn't be too hard. Most uses are in compatibility > cruft. E.g., the following from > crypto/openssh/openbsd-compat/bsd-closefrom.c > which is confused about related things: > [snip] If that code is compiled at all, it is a bug. We have closefrom() and OpenSSH should use it. > ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for > the resource limit (sysconf() is a libc wrapper and getdtablesize() is > a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the > rlmint -- it is the min() of the rlimit and the global sysctl integer > maxfilesperproc. Here the bug is in the rlimit. For the rlimit, > maxfilesperproc is only used when the rlimit is set and when it is used > in the kernel. But when the rlimit is returned to userland, via > getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if > maxfileperproc was lowered after setting the rlimit. I don't like the idea of rlimits changing of "their own will". Changing maxfileperproc at run time is going to be a bit nasty in any case but seems not as bad as changing rlimits of running processes. > [snip] > > .Sh LIBRARY > > .Lb libc > > .Sh SYNOPSIS > > @@ -41,18 +41,20 @@ > > .Ft int > > .Fn getdtablesize void > > .Sh DESCRIPTION > > -Each process has a fixed size descriptor table, > Actually, each process has a variable size descriptor table, and > getdtablesize() doesn't give the size of this table. > > -which is guaranteed to have at least 20 slots. > Actually, {OPEN_MAX} is guaranteed by POSIX to be at least > {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these > guarantees and similar ones for stdio's FOPEN_MAX have always been > broken in FreeBSD, since anyone can reduce the rlimit below 20. > Privileged users can break the gurantee even more easily by setting > maxfilesperproc below 20. When POSIX standardized rlimits, it didn't > properly specify the behaviour for the interaction of the rlimit with > {OPEN_MAX}, at least initially. The 2001 version breaks its own > guarantee by just saying that if the rlimit is reduced to less than > {_POSIX_OPEN_MAX}, then "unexpected behaviour may occur". Reductions > from 707112 to less than 20 won't occur often in practice. Ones from > 707112 to less than the largest currently open fd (+1) are more common > in practice and cause similarly unexpected behaviours, but the 2001 > version of POSIX is even more underspecified for them. Recent versions of POSIX allow {OPEN_MAX} to be based on the rlimit. In that case, it may change when the rlimit is changed. I think the "unexpected behaviour may occur" is intended to allow both permitting an rlimit below 20 and forbidding such a change. In the former case, the execution environment is no longer POSIX compliant. In particular, on most systems, setting the rlimit to 0 disables all operations that need to open a new file descriptor and it is implementation-specific which operations are affected (in addition to those returning a file descriptor). > > -The entries in > > -the descriptor table are numbered with small integers starting at 0. > Still correct, though not very interesting. > > The > > .Fn getdtablesize > > -system call returns the size of this table. > > +system call returns the maximum number of file descriptors > > +that the current process may open. > Actually, the process may open more than this number, after raising its > (soft) rlimit, if this is possible. True, but this requires different function calls than just ones allocating file descriptors. > > +The maximum file descriptor number that the system may assign > > +is the return value minus one. > > +Existing file descriptor numbers may be higher > > +if the limit was lowered after they were opened. > > .Sh SEE ALSO > > .Xr close 2 , > > +.Xr closefrom 2 , > > .Xr dup 2 , > > -.Xr open 2 , > > -.Xr select 2 > > +.Xr getrlimit 2 , > > +.Xr sysconf 2 > > .Sh HISTORY > > The > > .Fn getdtablesize I suppose rctl(8) can be added here. > open(2) is probably still relevant. It seems to be the natuaral place to > document {OPEN_MAX}, but it says nothing about any spelling of OPEN_MAX. > (The closest that it gets is saying that [EMFILE] means that the process > has reached its limit for open file descriptors. Not sure if open(2) is indeed the right place. > apropos(1) gives nothing appropriate for OPEN_MAX. In fact, even > OPEN_MAX is not mentioned in any man page. Only _SC_OPEN_MAX is > mentioned (in sysconf(3)), and it is misdescribed as being the > maximum number of open files per user id.) Yes, wrong. > Some limits are better descrtibed than {OPEN_MAX}, in intro(2). I was > a little surprised to not find much about the file descriptor limits > there. In fact, there is a very incomplete description of them for > [EMFILE]. This says that the limit is the release one of 64 (that was > for the 4.4BSD-Lite* release) and that getdtablesize(2) will obtain the > current limit. Similar historical limits have been changed to POSIX > ones mainly for pathnames. Hmm, that sentence about a limit of 64 can go away. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 16:11:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0113113; Fri, 26 Apr 2013 16:11:04 +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 B2B6C10DB; Fri, 26 Apr 2013 16:11: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 r3QGB4At047145; Fri, 26 Apr 2013 16:11:04 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QGB4qj047141; Fri, 26 Apr 2013 16:11:04 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261611.r3QGB4qj047141@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 16:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249937 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 16:11:04 -0000 Author: smh Date: Fri Apr 26 16:11:03 2013 New Revision: 249937 URL: http://svnweb.freebsd.org/changeset/base/249937 Log: Refactored scsi_xpt use of device_has_vpd to generic scsi_vpd_supported_page so its available for use in generic scsi code. This is a pre-requirement for using VPD queries to determine available SCSI delete methods within scsi_da. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Apr 26 16:09:10 2013 (r249936) +++ head/sys/cam/scsi/scsi_all.c Fri Apr 26 16:11:03 2013 (r249937) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #else #include @@ -55,7 +58,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef _KERNEL + +#ifdef _KERNEL +#include +#include +#include +#include +#else #include #include @@ -6257,6 +6266,28 @@ scsi_devid_match(uint8_t *lhs, size_t lh } #ifdef _KERNEL +int +scsi_vpd_supported_page(struct cam_periph *periph, uint8_t page_id) +{ + struct cam_ed *device; + struct scsi_vpd_supported_pages *vpds; + int i, num_pages; + + device = periph->path->device; + vpds = (struct scsi_vpd_supported_pages *)device->supported_vpds; + + if (vpds != NULL) { + num_pages = device->supported_vpds_len - + SVPD_SUPPORTED_PAGES_HDR_LEN; + for (i = 0; i < num_pages; i++) { + if (vpds->page_list[i] == page_id) + return (1); + } + } + + return (0); +} + static void init_scsi_delay(void) { Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Apr 26 16:09:10 2013 (r249936) +++ head/sys/cam/scsi/scsi_all.h Fri Apr 26 16:11:03 2013 (r249937) @@ -2258,6 +2258,8 @@ int scsi_sense_sbuf(struct ccb_scsiio * char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len); void scsi_sense_print(struct ccb_scsiio *csio); +int scsi_vpd_supported_page(struct cam_periph *periph, + uint8_t page_id); #else /* _KERNEL */ int scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, struct sbuf *sb); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Fri Apr 26 16:09:10 2013 (r249936) +++ head/sys/cam/scsi/scsi_xpt.c Fri Apr 26 16:11:03 2013 (r249937) @@ -556,7 +556,6 @@ static const int scsi_quirk_table_size = static cam_status proberegister(struct cam_periph *periph, void *arg); static void probeschedule(struct cam_periph *probe_periph); -static int device_has_vpd(struct cam_ed *device, uint8_t page_id); static void probestart(struct cam_periph *periph, union ccb *start_ccb); static void proberequestdefaultnegotiation(struct cam_periph *periph); static int proberequestbackoff(struct cam_periph *periph, @@ -703,21 +702,6 @@ probeschedule(struct cam_periph *periph) xpt_schedule(periph, CAM_PRIORITY_XPT); } -static int -device_has_vpd(struct cam_ed *device, uint8_t page_id) -{ - int i, num_pages; - struct scsi_vpd_supported_pages *vpds; - - vpds = (struct scsi_vpd_supported_pages *)device->supported_vpds; - num_pages = device->supported_vpds_len - SVPD_SUPPORTED_PAGES_HDR_LEN; - for (i = 0;i < num_pages;i++) - if (vpds->page_list[i] == page_id) - return 1; - - return 0; -} - static void probestart(struct cam_periph *periph, union ccb *start_ccb) { @@ -905,11 +889,9 @@ again: case PROBE_DEVICE_ID: { struct scsi_vpd_device_id *devid; - struct cam_ed *device; devid = NULL; - device = periph->path->device; - if (device_has_vpd(device, SVPD_DEVICE_ID)) + if (scsi_vpd_supported_page(periph, SVPD_DEVICE_ID)) devid = malloc(SVPD_DEVICE_ID_MAX_SIZE, M_CAMXPT, M_NOWAIT | M_ZERO); @@ -947,7 +929,7 @@ again: device->serial_num_len = 0; } - if (device_has_vpd(device, SVPD_UNIT_SERIAL_NUMBER)) + if (scsi_vpd_supported_page(periph, SVPD_UNIT_SERIAL_NUMBER)) serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf), M_CAMXPT, M_NOWAIT|M_ZERO); From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 16:17:05 2013 Return-Path: Delivered-To: svn-src-head@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 46CF744B; Fri, 26 Apr 2013 16:17:05 +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 39548110E; Fri, 26 Apr 2013 16:17: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 r3QGH5gP048396; Fri, 26 Apr 2013 16:17:05 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QGH58Q048395; Fri, 26 Apr 2013 16:17:05 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261617.r3QGH58Q048395@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 16:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249939 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 16:17:05 -0000 Author: smh Date: Fri Apr 26 16:17:04 2013 New Revision: 249939 URL: http://svnweb.freebsd.org/changeset/base/249939 Log: Added available delete methods discovery during device probe, including the maximum sizes for said methods, which are used when processing BIO_DELETE requests. This includes updating UNMAP support discovery to be based on SBC-3 T10/1799-D Revision 31 specification. Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) sys/cam/scsi/scsi_da.c: - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) as a delete_method - Added four new probe states used to identity available methods and their limits for the processing of BIO_DELETE commands via both UNMAP and the new ATA TRIM commands. - Renamed Probe states to better indicate their use - Added delete method descriptions used when informing user of issues. - Added automatic calculation of the optimum delete mode based on which method presents the largest maximum request size as this is most likely to result in the best performance. - Added WRITE SAME max block limits - Updated UNMAP range generation to mirror that used by ATA TRIM, this optimises the generation of ranges and fixes a potential overflow issue in the count when combining multiple BIO_DELETE requests - Added output of warnings about short deletes. This should only ever be triggered on devices that fail to correctly advertise their supported delete modes / max sizes. - Fixed WS16 requests being incorrectly limited to 65535 in length. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:11:07 2013 (r249938) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:17:04 2013 (r249939) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #endif /* _KERNEL */ @@ -67,8 +68,11 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL typedef enum { - DA_STATE_PROBE, - DA_STATE_PROBE2, + DA_STATE_PROBE_RC, + DA_STATE_PROBE_RC16, + DA_STATE_PROBE_LBP, + DA_STATE_PROBE_BLK_LIMITS, + DA_STATE_PROBE_ATA, DA_STATE_NORMAL } da_state; @@ -96,29 +100,46 @@ typedef enum { } da_quirks; typedef enum { - DA_CCB_PROBE = 0x01, - DA_CCB_PROBE2 = 0x02, - DA_CCB_BUFFER_IO = 0x03, - DA_CCB_WAITING = 0x04, - DA_CCB_DUMP = 0x05, - DA_CCB_DELETE = 0x06, - DA_CCB_TUR = 0x07, + DA_CCB_PROBE_RC = 0x01, + DA_CCB_PROBE_RC16 = 0x02, + DA_CCB_PROBE_LBP = 0x03, + DA_CCB_PROBE_BLK_LIMITS = 0x04, + DA_CCB_PROBE_ATA = 0x05, + DA_CCB_BUFFER_IO = 0x06, + DA_CCB_WAITING = 0x07, + DA_CCB_DUMP = 0x08, + DA_CCB_DELETE = 0x0A, + DA_CCB_TUR = 0x0B, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; +/* + * Order here is important for method choice + * + * We prefer ATA_TRIM as tests run against a Sandforce 2281 SSD attached to + * LSI 2008 (mps) controller (FW: v12, Drv: v14) resulted 20% quicker deletes + * using ATA_TRIM than the corresponding UNMAP results for a real world mysql + * import taking 5mins. + * + */ typedef enum { DA_DELETE_NONE, DA_DELETE_DISABLE, - DA_DELETE_ZERO, - DA_DELETE_WS10, - DA_DELETE_WS16, + DA_DELETE_ATA_TRIM, DA_DELETE_UNMAP, - DA_DELETE_MAX = DA_DELETE_UNMAP + DA_DELETE_WS16, + DA_DELETE_WS10, + DA_DELETE_ZERO, + DA_DELETE_MIN = DA_DELETE_UNMAP, + DA_DELETE_MAX = DA_DELETE_ZERO } da_delete_methods; static const char *da_delete_method_names[] = - { "NONE", "DISABLE", "ZERO", "WS10", "WS16", "UNMAP" }; + { "NONE", "DISABLE", "UNMAP", "ATA_TRIM", "WS16", "WS10", "ZERO" }; +static const char *da_delete_method_desc[] = + { "NONE", "DISABLED", "UNMAP", "ATA TRIM", "WRITE SAME(16) with UNMAP", + "WRITE SAME(10) with UNMAP", "ZERO" }; /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 @@ -134,7 +155,17 @@ struct disk_params { u_int stripeoffset; }; -#define UNMAP_MAX_RANGES 512 +#define UNMAP_RANGE_MAX 0xffffffff +#define UNMAP_HEAD_SIZE 8 +#define UNMAP_RANGE_SIZE 16 +#define UNMAP_MAX_RANGES 2048 /* Protocol Max is 4095 */ +#define UNMAP_BUF_SIZE ((UNMAP_MAX_RANGES * UNMAP_RANGE_SIZE) + \ + UNMAP_HEAD_SIZE) + +#define WS10_MAX_BLKS 0xffff +#define WS16_MAX_BLKS 0xffffffff +#define ATA_TRIM_MAX_RANGES ((UNMAP_BUF_SIZE / \ + (ATA_DSM_RANGE_SIZE * ATA_DSM_BLK_SIZE)) * ATA_DSM_BLK_SIZE) struct da_softc { struct bio_queue_head bio_queue; @@ -150,11 +181,14 @@ struct da_softc { int error_inject; int ordered_tag_count; int outstanding_cmds; - int unmap_max_ranges; - int unmap_max_lba; + int trim_max_ranges; int delete_running; int tur; - da_delete_methods delete_method; + int delete_available; /* Delete methods possibly available */ + uint32_t unmap_max_ranges; + uint32_t unmap_max_lba; + uint64_t ws_max_blks; + da_delete_methods delete_method; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -163,11 +197,18 @@ struct da_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; uint64_t wwpn; - uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; + uint8_t unmap_buf[UNMAP_BUF_SIZE]; struct scsi_read_capacity_data_long rcaplong; struct callout mediapoll_c; }; +#define dadeleteflag(softc, delete_method, enable) \ + if (enable) { \ + softc->delete_available |= (1 << delete_method); \ + } else { \ + softc->delete_available &= ~(1 << delete_method); \ + } + struct da_quirk_entry { struct scsi_inquiry_pattern inq_pat; da_quirks quirks; @@ -870,6 +911,9 @@ static int dacmdsizesysctl(SYSCTL_HANDL static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); +static void dadeletemethodchoose(struct da_softc *softc, + da_delete_methods default_method); + static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -1581,6 +1625,26 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } +static void +dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method) +{ + int i, delete_method; + + delete_method = default_method; + + /* + * Use the pre-defined order to choose the best + * performing delete. + */ + for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) { + if (softc->delete_available & (1 << i)) { + dadeletemethodset(softc, i); + return; + } + } + dadeletemethodset(softc, delete_method); +} + static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) { @@ -1634,14 +1698,16 @@ daregister(struct cam_periph *periph, vo } LIST_INIT(&softc->pending_ccbs); - softc->state = DA_STATE_PROBE; + softc->state = DA_STATE_PROBE_RC; bioq_init(&softc->bio_queue); bioq_init(&softc->delete_queue); bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; softc->unmap_max_ranges = UNMAP_MAX_RANGES; - softc->unmap_max_lba = 1024*1024*2; + softc->unmap_max_lba = UNMAP_RANGE_MAX; + softc->ws_max_blks = WS16_MAX_BLKS; + softc->trim_max_ranges = ATA_TRIM_MAX_RANGES; softc->sort_io_queue = -1; periph->softc = softc; @@ -1718,7 +1784,7 @@ daregister(struct cam_periph *periph, vo /* Predict whether device may support READ CAPACITY(16). */ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) { softc->flags |= DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE2; + softc->state = DA_STATE_PROBE_RC16; } /* @@ -1820,6 +1886,7 @@ dastart(struct cam_periph *periph, union CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); +skipstate: switch (softc->state) { case DA_STATE_NORMAL: { @@ -1844,13 +1911,36 @@ dastart(struct cam_periph *periph, union if (!softc->delete_running && (bp = bioq_first(&softc->delete_queue)) != NULL) { uint64_t lba; - u_int count; + uint64_t count; /* forward compat with WS32 */ + + /* + * In each of the methods below, while its the caller's + * responsibility to ensure the request will fit into a + * single device request, we might have changed the delete + * method due to the device incorrectly advertising either + * its supported methods or limits. + * + * To prevent this causing further issues we validate the + * against the methods limits, and warn which would + * otherwise be unnecessary. + */ if (softc->delete_method == DA_DELETE_UNMAP) { uint8_t *buf = softc->unmap_buf; uint64_t lastlba = (uint64_t)-1; - uint32_t lastcount = 0; - int blocks = 0, off, ranges = 0; + uint32_t lastcount = 0, c; + uint64_t totalcount = 0; + uint32_t off, ranges = 0; + + /* + * Currently this doesn't take the UNMAP + * Granularity and Granularity Alignment + * fields into account. + * + * This could result in both unoptimal unmap + * requests as as well as UNMAP calls unmapping + * fewer LBA's than requested. + */ softc->delete_running = 1; bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); @@ -1864,22 +1954,44 @@ dastart(struct cam_periph *periph, union /* Try to extend the previous range. */ if (lba == lastlba) { - lastcount += count; - off = (ranges - 1) * 16 + 8; + c = min(count, softc->unmap_max_lba - + lastcount); + lastcount += c; + off = ((ranges - 1) * UNMAP_RANGE_SIZE) + + UNMAP_HEAD_SIZE; scsi_ulto4b(lastcount, &buf[off + 8]); - } else if (count > 0) { - off = ranges * 16 + 8; + count -= c; + lba +=c; + totalcount += c; + } + + while (count > 0) { + c = min(count, softc->unmap_max_lba); + if (totalcount + c > softc->unmap_max_lba || + ranges >= softc->unmap_max_ranges) { + xpt_print(periph->path, + "%s issuing short delete %ld > %ld" + "|| %d >= %d", + da_delete_method_desc[softc->delete_method], + totalcount + c, softc->unmap_max_lba, + ranges, softc->unmap_max_ranges); + break; + } + off = (ranges * UNMAP_RANGE_SIZE) + + UNMAP_HEAD_SIZE; scsi_u64to8b(lba, &buf[off + 0]); - scsi_ulto4b(count, &buf[off + 8]); - lastcount = count; + scsi_ulto4b(c, &buf[off + 8]); + lba += c; + totalcount += c; ranges++; + count -= c; + lastcount = c; } - blocks += count; - lastlba = lba + count; + lastlba = lba; bp1 = bioq_first(&softc->delete_queue); if (bp1 == NULL || ranges >= softc->unmap_max_ranges || - blocks + bp1->bio_bcount / + totalcount + bp1->bio_bcount / softc->params.secsize > softc->unmap_max_lba) break; } while (1); @@ -1897,9 +2009,87 @@ dastart(struct cam_periph *periph, union da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; goto out; + } else if (softc->delete_method == DA_DELETE_ATA_TRIM) { + uint8_t *buf = softc->unmap_buf; + uint64_t lastlba = (uint64_t)-1; + uint32_t lastcount = 0, c, requestcount; + int ranges = 0, off, block_count; + + softc->delete_running = 1; + bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + lba = bp1->bio_pblkno; + count = bp1->bio_bcount / softc->params.secsize; + requestcount = count; + + /* Try to extend the previous range. */ + if (lba == lastlba) { + c = min(count, ATA_DSM_RANGE_MAX - lastcount); + lastcount += c; + off = (ranges - 1) * 8; + buf[off + 6] = lastcount & 0xff; + buf[off + 7] = (lastcount >> 8) & 0xff; + count -= c; + lba += c; + } + + while (count > 0) { + c = min(count, ATA_DSM_RANGE_MAX); + off = ranges * 8; + + buf[off + 0] = lba & 0xff; + buf[off + 1] = (lba >> 8) & 0xff; + buf[off + 2] = (lba >> 16) & 0xff; + buf[off + 3] = (lba >> 24) & 0xff; + buf[off + 4] = (lba >> 32) & 0xff; + buf[off + 5] = (lba >> 40) & 0xff; + buf[off + 6] = c & 0xff; + buf[off + 7] = (c >> 8) & 0xff; + lba += c; + ranges++; + count -= c; + lastcount = c; + if (count != 0 && ranges == softc->trim_max_ranges) { + xpt_print(periph->path, + "%s issuing short delete %ld > %ld", + da_delete_method_desc[softc->delete_method], + requestcount, + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX); + break; + } + } + lastlba = lba; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + bp1->bio_bcount / softc->params.secsize > + (softc->trim_max_ranges - ranges) * + ATA_DSM_RANGE_MAX) + break; + } while (1); + + block_count = (ranges + ATA_DSM_BLK_RANGES - 1) / + ATA_DSM_BLK_RANGES; + scsi_ata_trim(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + block_count, + /*data_ptr*/buf, + /*dxfer_len*/block_count * ATA_DSM_BLK_SIZE, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; } else if (softc->delete_method == DA_DELETE_ZERO || softc->delete_method == DA_DELETE_WS10 || softc->delete_method == DA_DELETE_WS16) { + uint64_t ws_max_blks; + ws_max_blks = softc->ws_max_blks / softc->params.secsize; softc->delete_running = 1; lba = bp->bio_pblkno; count = 0; @@ -1909,11 +2099,19 @@ dastart(struct cam_periph *periph, union if (bp1 != bp) bioq_insert_tail(&softc->delete_run_queue, bp1); count += bp1->bio_bcount / softc->params.secsize; + if (count > ws_max_blks) { + count = min(count, ws_max_blks); + xpt_print(periph->path, + "%s issuing short delete %ld > %ld", + da_delete_method_desc[softc->delete_method], + count, ws_max_blks); + break; + } bp1 = bioq_first(&softc->delete_queue); if (bp1 == NULL || lba + count != bp1->bio_pblkno || count + bp1->bio_bcount / - softc->params.secsize > 0xffff) + softc->params.secsize > ws_max_blks) break; } while (1); @@ -2037,7 +2235,7 @@ out: daschedule(periph); break; } - case DA_STATE_PROBE: + case DA_STATE_PROBE_RC: { struct scsi_read_capacity_data *rcap; @@ -2056,11 +2254,11 @@ out: SSD_FULL_SIZE, /*timeout*/5000); start_ccb->ccb_h.ccb_bp = NULL; - start_ccb->ccb_h.ccb_state = DA_CCB_PROBE; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_RC; xpt_action(start_ccb); break; } - case DA_STATE_PROBE2: + case DA_STATE_PROBE_RC16: { struct scsi_read_capacity_data_long *rcaplong; @@ -2083,8 +2281,110 @@ out: /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ da_default_timeout * 1000); start_ccb->ccb_h.ccb_bp = NULL; - start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2; - xpt_action(start_ccb); + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_RC16; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_LBP: + { + struct scsi_vpd_logical_block_prov *lbp; + + if (!scsi_vpd_supported_page(periph, SVPD_LBP)) { + /* + * If we get here we don't support any SBC-3 delete + * methods with UNMAP as the Logical Block Provisioning + * VPD page support is required for devices which + * support it according to T10/1799-D Revision 31 + * however older revisions of the spec don't mandate + * this so we currently don't remove these methods + * from the available set. + */ + softc->state = DA_STATE_PROBE_BLK_LIMITS; + goto skipstate; + } + + lbp = (struct scsi_vpd_logical_block_prov *) + malloc(sizeof(*lbp), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (lbp == NULL) { + printf("dastart: Couldn't malloc lbp data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)lbp, + /*inq_len*/sizeof(*lbp), + /*evpd*/TRUE, + /*page_code*/SVPD_LBP, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_LBP; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_BLK_LIMITS: + { + struct scsi_vpd_block_limits *block_limits; + + if (!scsi_vpd_supported_page(periph, SVPD_BLOCK_LIMITS)) { + /* Not supported skip to next probe */ + softc->state = DA_STATE_PROBE_ATA; + goto skipstate; + } + + block_limits = (struct scsi_vpd_block_limits *) + malloc(sizeof(*block_limits), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (block_limits == NULL) { + printf("dastart: Couldn't malloc block_limits data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)block_limits, + /*inq_len*/sizeof(*block_limits), + /*evpd*/TRUE, + /*page_code*/SVPD_BLOCK_LIMITS, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_BLK_LIMITS; + xpt_action(start_ccb); + break; + } + case DA_STATE_PROBE_ATA: + { + struct ata_params *ata_params; + + ata_params = (struct ata_params*) + malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (ata_params == NULL) { + printf("dastart: Couldn't malloc ata_params data\n"); + /* da_free_periph??? */ + break; + } + + scsi_ata_identify(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*data_ptr*/(u_int8_t *)ata_params, + /*dxfer_len*/sizeof(*ata_params), + /*sense_len*/SSD_FULL_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_ATA; + xpt_action(start_ccb); break; } } @@ -2104,27 +2404,31 @@ cmd6workaround(union ccb *ccb) softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; if (ccb->ccb_h.ccb_state == DA_CCB_DELETE) { - if (softc->delete_method == DA_DELETE_UNMAP) { - xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " - "switching to WRITE SAME(16) with UNMAP.\n"); - dadeletemethodset(softc, DA_DELETE_WS16); - } else if (softc->delete_method == DA_DELETE_WS16) { - xpt_print(ccb->ccb_h.path, - "WRITE SAME(16) with UNMAP is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else if (softc->delete_method == DA_DELETE_WS10) { + da_delete_methods old_method = softc->delete_method; + + /* + * Typically there are two reasons for failure here + * 1. Delete method was detected as supported but isn't + * 2. Delete failed due to invalid params e.g. too big + * + * While we will attempt to choose an alternative delete method + * this may result in short deletes if the existing delete + * requests from geom are big for the new method choosen. + * + * This method assumes that the error which triggered this + * will not retry the io otherwise a panic will occur + */ + dadeleteflag(softc, old_method, 0); + dadeletemethodchoose(softc, DA_DELETE_DISABLE); + if (softc->delete_method == DA_DELETE_DISABLE) xpt_print(ccb->ccb_h.path, - "WRITE SAME(10) with UNMAP is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else if (softc->delete_method == DA_DELETE_ZERO) { + "%s failed, disabling BIO_DELETE\n", + da_delete_method_desc[old_method]); + else xpt_print(ccb->ccb_h.path, - "WRITE SAME(10) is not supported, " - "disabling BIO_DELETE.\n"); - dadeletemethodset(softc, DA_DELETE_DISABLE); - } else - dadeletemethodset(softc, DA_DELETE_DISABLE); + "%s failed, switching to %s BIO_DELETE\n", + da_delete_method_desc[old_method], + da_delete_method_desc[softc->delete_method]); if (DA_SIO) { while ((bp = bioq_takefirst(&softc->delete_run_queue)) @@ -2208,7 +2512,7 @@ dadone(struct cam_periph *periph, union error = daerror(done_ccb, CAM_RETRY_SELTO, sf); if (error == ERESTART) { /* - * A retry was scheuled, so + * A retry was scheduled, so * just return. */ return; @@ -2304,16 +2608,18 @@ dadone(struct cam_periph *periph, union biodone(bp); break; } - case DA_CCB_PROBE: - case DA_CCB_PROBE2: + case DA_CCB_PROBE_RC: + case DA_CCB_PROBE_RC16: { struct scsi_read_capacity_data *rdcap; struct scsi_read_capacity_data_long *rcaplong; char announce_buf[80]; + int lbp; + lbp = 0; rdcap = NULL; rcaplong = NULL; - if (state == DA_CCB_PROBE) + if (state == DA_CCB_PROBE_RC) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else rcaplong = (struct scsi_read_capacity_data_long *) @@ -2326,7 +2632,7 @@ dadone(struct cam_periph *periph, union u_int lbppbe; /* LB per physical block exponent. */ u_int lalba; /* Lowest aligned LBA. */ - if (state == DA_CCB_PROBE) { + if (state == DA_CCB_PROBE_RC) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); lbppbe = 0; @@ -2341,7 +2647,7 @@ dadone(struct cam_periph *periph, union * with the short version of the command. */ if (maxsector == 0xffffffff) { - softc->state = DA_STATE_PROBE2; + softc->state = DA_STATE_PROBE_RC16; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -2376,9 +2682,7 @@ dadone(struct cam_periph *periph, union */ dasetgeom(periph, block_size, maxsector, rcaplong, sizeof(*rcaplong)); - if ((lalba & SRC16_LBPME_A) - && softc->delete_method == DA_DELETE_NONE) - dadeletemethodset(softc, DA_DELETE_UNMAP); + lbp = (lalba & SRC16_LBPME_A); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2439,7 +2743,7 @@ dadone(struct cam_periph *periph, union * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). */ - if ((state == DA_CCB_PROBE2) && + if ((state == DA_CCB_PROBE_RC16) && (softc->flags & DA_FLAG_CAN_RC16) && (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || @@ -2447,7 +2751,7 @@ dadone(struct cam_periph *periph, union (error_code == SSD_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE; + softc->state = DA_STATE_PROBE_RC; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -2505,11 +2809,201 @@ dadone(struct cam_periph *periph, union taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); xpt_announce_periph(periph, announce_buf); + + if (lbp) { + /* + * Based on older SBC-3 spec revisions + * any of the UNMAP methods "may" be + * available via LBP given this flag so + * we flag all of them as availble and + * then remove those which further + * probes confirm aren't available + * later. + * + * We could also check readcap(16) p_type + * flag to exclude one or more invalid + * write same (X) types here + */ + dadeleteflag(softc, DA_DELETE_WS16, 1); + dadeleteflag(softc, DA_DELETE_WS10, 1); + dadeleteflag(softc, DA_DELETE_ZERO, 1); + dadeleteflag(softc, DA_DELETE_UNMAP, 1); + + softc->state = DA_STATE_PROBE_LBP; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } } else { xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); } } + + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_ATA; + xpt_schedule(periph, priority); + return; + } + case DA_CCB_PROBE_LBP: + { + struct scsi_vpd_logical_block_prov *lbp; + + lbp = (struct scsi_vpd_logical_block_prov *)csio->data_ptr; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* + * T10/1799-D Revision 31 states at least one of these + * must be supported but we don't currently enforce this. + */ + dadeleteflag(softc, DA_DELETE_WS16, + (lbp->flags & SVPD_LBP_WS16)); + dadeleteflag(softc, DA_DELETE_WS10, + (lbp->flags & SVPD_LBP_WS10)); + dadeleteflag(softc, DA_DELETE_ZERO, + (lbp->flags & SVPD_LBP_WS10)); + dadeleteflag(softc, DA_DELETE_UNMAP, + (lbp->flags & SVPD_LBP_UNMAP)); + + if (lbp->flags & SVPD_LBP_UNMAP) { + free(lbp, M_SCSIDA); + softc->state = DA_STATE_PROBE_BLK_LIMITS; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + + /* + * Failure indicates we don't support any SBC-3 + * delete methods with UNMAP + */ + } + } + + free(lbp, M_SCSIDA); + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_ATA; + xpt_schedule(periph, priority); + return; + } + case DA_CCB_PROBE_BLK_LIMITS: + { + struct scsi_vpd_block_limits *block_limits; + + block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + uint32_t max_unmap_lba_cnt = scsi_4btoul( + block_limits->max_unmap_lba_cnt); + uint32_t max_unmap_blk_cnt = scsi_4btoul( + block_limits->max_unmap_blk_cnt); + uint64_t ws_max_blks = scsi_8btou64( + block_limits->max_write_same_length); + /* + * We should already support UNMAP but we check lba + * and block count to be sure + */ + if (max_unmap_lba_cnt != 0x00L && + max_unmap_blk_cnt != 0x00L) { + softc->unmap_max_lba = max_unmap_lba_cnt; + softc->unmap_max_ranges = min(max_unmap_blk_cnt, + UNMAP_MAX_RANGES); + } else { + /* + * Unexpected UNMAP limits which means the + * device doesn't actually support UNMAP + */ + dadeleteflag(softc, DA_DELETE_UNMAP, 0); + } + + if (ws_max_blks != 0x00L) + softc->ws_max_blks = ws_max_blks; + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + + /* + * Failure here doesn't mean UNMAP is not + * supported as this is an optional page. + */ + softc->unmap_max_lba = 1; + softc->unmap_max_ranges = 1; + } + } + + free(block_limits, M_SCSIDA); + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_ATA; + xpt_schedule(periph, priority); + return; + } + case DA_CCB_PROBE_ATA: + { + int i; + struct ata_params *ata_params; + int16_t *ptr; + + ata_params = (struct ata_params *)csio->data_ptr; + ptr = (uint16_t *)ata_params; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + for (i = 0; i < sizeof(*ata_params) / 2; i++) + ptr[i] = le16toh(ptr[i]); + if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM) { + dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); + if (ata_params->max_dsm_blocks != 0) + softc->trim_max_ranges = min( + softc->trim_max_ranges, + ata_params->max_dsm_blocks * + ATA_DSM_BLK_RANGES); + } + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_QUIET_IR); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + } + + free(ata_params, M_SCSIDA); + dadeletemethodchoose(softc, DA_DELETE_NONE); /* * Since our peripheral may be invalidated by an error * above or an external event, we must release our CCB @@ -2580,9 +3074,9 @@ dareprobe(struct cam_periph *periph) ("dareprobe: cam_periph_acquire failed")); if (softc->flags & DA_FLAG_CAN_RC16) - softc->state = DA_STATE_PROBE2; + softc->state = DA_STATE_PROBE_RC16; else - softc->state = DA_STATE_PROBE; + softc->state = DA_STATE_PROBE_RC; xpt_schedule(periph, CAM_PRIORITY_DEV); } @@ -2805,10 +3299,6 @@ dasetgeom(struct cam_periph *periph, uin softc->disk->d_fwheads = softc->params.heads; softc->disk->d_devstat->block_size = softc->params.secsize; softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; - if (softc->delete_method > DA_DELETE_DISABLE) - softc->disk->d_flags |= DISKFLAG_CANDELETE; - else - softc->disk->d_flags &= ~DISKFLAG_CANDELETE; error = disk_resize(softc->disk, M_NOWAIT); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 16:22:55 2013 Return-Path: Delivered-To: svn-src-head@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 E77F2728; Fri, 26 Apr 2013 16:22:55 +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 D77C21141; Fri, 26 Apr 2013 16:22: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 r3QGMtQF051107; Fri, 26 Apr 2013 16:22:55 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QGMtkm051103; Fri, 26 Apr 2013 16:22:55 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261622.r3QGMtkm051103@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 16:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249940 - in head/sys: cam/ata cam/scsi geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 16:22:56 -0000 Author: smh Date: Fri Apr 26 16:22:54 2013 New Revision: 249940 URL: http://svnweb.freebsd.org/changeset/base/249940 Log: Teach GEOM and CAM about the difference between the max "size" of r/w and delete requests. sys/geom/geom_disk.h: - Added d_delmaxsize which represents the maximum size of individual device delete requests in bytes. This can be used by devices to inform geom of their size limitations regarding delete operations which are generally different from the read / write limits as data is not usually transferred from the host to physical device. sys/geom/geom_disk.c: - Use new d_delmaxsize to calculate the size of chunks passed through to the underlying strategy during deletes instead of using read / write optimised values. This defaults to d_maxsize if unset (0). - Moved d_maxsize default up so it can be used to default d_delmaxsize sys/cam/ata/ata_da.c: - Added d_delmaxsize calculations for TRIM and CFA sys/cam/scsi/scsi_da.c: - Added re-calculation of d_delmaxsize whenever delete_method is set. - Added kern.cam.da.X.delete_max sysctl which allows the max size for delete requests to be limited. This is useful in preventing timeouts on devices who's delete methods are slow. It should be noted that this limit is reset then the device delete method is changed and that it can only be lowered not increased from the device max. Reviewed by: mav Approved by: pjd (mentor) Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Apr 26 16:17:04 2013 (r249939) +++ head/sys/cam/ata/ata_da.c Fri Apr 26 16:22:54 2013 (r249940) @@ -1188,10 +1188,15 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * + softc->trim_max_ranges; } else if ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT)) { softc->disk->d_flags |= DISKFLAG_CANDELETE; - } + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:17:04 2013 (r249939) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:22:54 2013 (r249940) @@ -909,8 +909,11 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemaxsysctl(SYSCTL_HANDLER_ARGS); static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); +static off_t dadeletemaxsize(struct da_softc *softc, + da_delete_methods delete_method); static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method); @@ -1536,6 +1539,10 @@ dasysctlinit(void *context, int pending) softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_max", CTLTYPE_U64 | CTLFLAG_RW, + softc, 0, dadeletemaxsysctl, "Q", + "Maximum BIO_DELETE size"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1581,6 +1588,29 @@ dasysctlinit(void *context, int pending) } static int +dadeletemaxsysctl(SYSCTL_HANDLER_ARGS) +{ + int error; + uint64_t value; + struct da_softc *softc; + + softc = (struct da_softc *)arg1; + + value = softc->disk->d_delmaxsize; + error = sysctl_handle_64(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + /* only accept values smaller than the calculated value */ + if (value > softc->disk->d_delmaxsize) { + return (EINVAL); + } + softc->disk->d_delmaxsize = value; + + return (0); +} + +static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS) { int error, value; @@ -1618,6 +1648,7 @@ dadeletemethodset(struct da_softc *softc softc->delete_method = delete_method; + softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method); if (softc->delete_method > DA_DELETE_DISABLE) softc->disk->d_flags |= DISKFLAG_CANDELETE; @@ -1625,6 +1656,33 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } +static off_t +dadeletemaxsize(struct da_softc *softc, da_delete_methods delete_method) +{ + off_t sectors; + + switch(delete_method) { + case DA_DELETE_UNMAP: + sectors = (off_t)softc->unmap_max_lba * softc->unmap_max_ranges; + break; + case DA_DELETE_ATA_TRIM: + sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + break; + case DA_DELETE_WS16: + sectors = (off_t)min(softc->ws_max_blks, WS16_MAX_BLKS); + break; + case DA_DELETE_ZERO: + case DA_DELETE_WS10: + sectors = (off_t)min(softc->ws_max_blks, WS10_MAX_BLKS); + break; + default: + return 0; + } + + return (off_t)softc->params.secsize * + min(sectors, (off_t)softc->params.sectors); +} + static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method) { @@ -2088,8 +2146,13 @@ skipstate: } else if (softc->delete_method == DA_DELETE_ZERO || softc->delete_method == DA_DELETE_WS10 || softc->delete_method == DA_DELETE_WS16) { + /* + * We calculate ws_max_blks here based off d_delmaxsize instead + * of using softc->ws_max_blks as it is absolute max for the + * device not the protocol max which may well be lower + */ uint64_t ws_max_blks; - ws_max_blks = softc->ws_max_blks / softc->params.secsize; + ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize; softc->delete_running = 1; lba = bp->bio_pblkno; count = 0; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Apr 26 16:17:04 2013 (r249939) +++ head/sys/geom/geom_disk.c Fri Apr 26 16:22:54 2013 (r249940) @@ -141,14 +141,23 @@ g_disk_access(struct g_provider *pp, int } pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - pp->stripeoffset = dp->d_stripeoffset; - pp->stripesize = dp->d_stripesize; - dp->d_flags |= DISKFLAG_OPEN; if (dp->d_maxsize == 0) { printf("WARNING: Disk drive %s%d has no d_maxsize\n", dp->d_name, dp->d_unit); dp->d_maxsize = DFLTPHYS; } + if (dp->d_flags & DISKFLAG_CANDELETE) { + if (bootverbose && dp->d_delmaxsize == 0) { + printf("WARNING: Disk drive %s%d has no d_delmaxsize\n", + dp->d_name, dp->d_unit); + dp->d_delmaxsize = dp->d_maxsize; + } + } else { + dp->d_delmaxsize = 0; + } + pp->stripeoffset = dp->d_stripeoffset; + pp->stripesize = dp->d_stripesize; + dp->d_flags |= DISKFLAG_OPEN; } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { g_disk_lock_giant(dp); @@ -293,6 +302,10 @@ g_disk_start(struct bio *bp) break; } do { + off_t d_maxsize; + + d_maxsize = (bp->bio_cmd == BIO_DELETE) ? + dp->d_delmaxsize : dp->d_maxsize; bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -307,18 +320,20 @@ g_disk_start(struct bio *bp) bp2->bio_ma_offset %= PAGE_SIZE; bp2->bio_ma_n -= off / PAGE_SIZE; } - if (bp2->bio_length > dp->d_maxsize) { + if (bp2->bio_length > d_maxsize) { /* * XXX: If we have a stripesize we should really - * use it here. + * use it here. Care should be taken in the delete + * case if this is done as deletes can be very + * sensitive to size given how they are processed. */ - bp2->bio_length = dp->d_maxsize; + bp2->bio_length = d_maxsize; if ((bp->bio_flags & BIO_UNMAPPED) != 0) { bp2->bio_ma_n = howmany( bp2->bio_ma_offset + bp2->bio_length, PAGE_SIZE); } - off += dp->d_maxsize; + off += d_maxsize; /* * To avoid a race, we need to grab the next bio * before we schedule this one. See "notes". Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Fri Apr 26 16:17:04 2013 (r249939) +++ head/sys/geom/geom_disk.h Fri Apr 26 16:22:54 2013 (r249940) @@ -88,6 +88,7 @@ struct disk { u_int d_fwsectors; u_int d_fwheads; u_int d_maxsize; + off_t d_delmaxsize; u_int d_stripeoffset; u_int d_stripesize; char d_ident[DISK_IDENT_SIZE]; From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 16:31:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FB78BCB; Fri, 26 Apr 2013 16:31:04 +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 224F911A7; Fri, 26 Apr 2013 16:31: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 r3QGV4nN054219; Fri, 26 Apr 2013 16:31:04 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QGV32F054215; Fri, 26 Apr 2013 16:31:03 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304261631.r3QGV32F054215@svn.freebsd.org> From: Steven Hartland Date: Fri, 26 Apr 2013 16:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249941 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 16:31:04 -0000 Author: smh Date: Fri Apr 26 16:31:03 2013 New Revision: 249941 URL: http://svnweb.freebsd.org/changeset/base/249941 Log: Added automatic detection of non-rotating media which disables the use of BIO queue sorting, hence optimising performance for devices such as SSD's Reviewed by: scottl Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Apr 26 16:22:54 2013 (r249940) +++ head/sys/cam/ata/ata_da.c Fri Apr 26 16:31:03 2013 (r249941) @@ -1155,7 +1155,11 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); - softc->sort_io_queue = -1; + /* Disable queue sorting for non-rotatational media by default */ + if (cgd->ident_data.media_rotation_rate == 1) + softc->sort_io_queue = 0; + else + softc->sort_io_queue = -1; adagetparams(periph, cgd); softc->disk = disk_alloc(); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Apr 26 16:22:54 2013 (r249940) +++ head/sys/cam/scsi/scsi_all.h Fri Apr 26 16:31:03 2013 (r249941) @@ -1430,6 +1430,30 @@ struct scsi_diag_page { }; /* + * Block Device Characteristics VPD Page based on + * T10/1799-D Revision 31 + */ +struct scsi_vpd_block_characteristics +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_BDC 0xB1 + u_int8_t page_length[2]; + u_int8_t medium_rotation_rate[2]; +#define SVPD_BDC_RATE_NOT_REPORTED 0x00 +#define SVPD_BDC_RATE_NONE_ROTATING 0x01 + u_int8_t reserved1; + u_int8_t nominal_form_factor; +#define SVPD_BDC_FORM_NOT_REPORTED 0x00 +#define SVPD_BDC_FORM_5_25INCH 0x01 +#define SVPD_BDC_FORM_3_5INCH 0x02 +#define SVPD_BDC_FORM_2_5INCH 0x03 +#define SVPD_BDC_FORM_1_5INCH 0x04 +#define SVPD_BDC_FORM_LESSTHAN_1_5INCH 0x05 + u_int8_t reserved2[56]; +}; + +/* * Logical Block Provisioning VPD Page based on * T10/1799-D Revision 31 */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:22:54 2013 (r249940) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 26 16:31:03 2013 (r249941) @@ -72,6 +72,7 @@ typedef enum { DA_STATE_PROBE_RC16, DA_STATE_PROBE_LBP, DA_STATE_PROBE_BLK_LIMITS, + DA_STATE_PROBE_BDC, DA_STATE_PROBE_ATA, DA_STATE_NORMAL } da_state; @@ -104,12 +105,13 @@ typedef enum { DA_CCB_PROBE_RC16 = 0x02, DA_CCB_PROBE_LBP = 0x03, DA_CCB_PROBE_BLK_LIMITS = 0x04, - DA_CCB_PROBE_ATA = 0x05, - DA_CCB_BUFFER_IO = 0x06, - DA_CCB_WAITING = 0x07, - DA_CCB_DUMP = 0x08, - DA_CCB_DELETE = 0x0A, - DA_CCB_TUR = 0x0B, + DA_CCB_PROBE_BDC = 0x05, + DA_CCB_PROBE_ATA = 0x06, + DA_CCB_BUFFER_IO = 0x07, + DA_CCB_WAITING = 0x08, + DA_CCB_DUMP = 0x0A, + DA_CCB_DELETE = 0x0B, + DA_CCB_TUR = 0x0C, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; @@ -2424,6 +2426,39 @@ out: xpt_action(start_ccb); break; } + case DA_STATE_PROBE_BDC: + { + struct scsi_vpd_block_characteristics *bdc; + + if (!scsi_vpd_supported_page(periph, SVPD_BDC)) { + softc->state = DA_STATE_PROBE_ATA; + goto skipstate; + } + + bdc = (struct scsi_vpd_block_characteristics *) + malloc(sizeof(*bdc), M_SCSIDA, M_NOWAIT|M_ZERO); + + if (bdc == NULL) { + printf("dastart: Couldn't malloc bdc data\n"); + /* da_free_periph??? */ + break; + } + + scsi_inquiry(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*inq_buf*/(u_int8_t *)bdc, + /*inq_len*/sizeof(*bdc), + /*evpd*/TRUE, + /*page_code*/SVPD_BDC, + /*sense_len*/SSD_MIN_SIZE, + /*timeout*/da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_BDC; + xpt_action(start_ccb); + break; + } case DA_STATE_PROBE_ATA: { struct ata_params *ata_params; @@ -2904,7 +2939,7 @@ dadone(struct cam_periph *periph, union } xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); return; } @@ -3027,6 +3062,40 @@ dadone(struct cam_periph *periph, union xpt_schedule(periph, priority); return; } + case DA_CCB_PROBE_BDC: + { + struct scsi_vpd_block_characteristics *bdc; + + bdc = (struct scsi_vpd_block_characteristics *)csio->data_ptr; + + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + if (scsi_2btoul(bdc->medium_rotation_rate) == + SVPD_BDC_RATE_NONE_ROTATING) + softc->sort_io_queue = 0; + } else { + int error; + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + } + + free(bdc, M_SCSIDA); + softc->state = DA_STATE_PROBE_ATA; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } case DA_CCB_PROBE_ATA: { int i; @@ -3047,6 +3116,12 @@ dadone(struct cam_periph *periph, union ata_params->max_dsm_blocks * ATA_DSM_BLK_RANGES); } + /* + * Disable queue sorting for non-rotatational media + * by default + */ + if (ata_params->media_rotation_rate == 1) + softc->sort_io_queue = 0; } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:01:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B8D5AAE; Fri, 26 Apr 2013 17:01:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) by mx1.freebsd.org (Postfix) with ESMTP id D65A012F1; Fri, 26 Apr 2013 17:01:39 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id m6so859040wiv.9 for ; Fri, 26 Apr 2013 10:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=V0TGw55Y309JKNstWe0pWexdYORia1PES3SbyY04uqc=; b=lPveqnk52kDSwqU7+ujZXcMkwrVzJTs+eqfbJ5+/CFH3NAp2/iNzMJUGb38Q8wQMsC FsTqXH8bdmOFmdDfshjTjrMdoRnekQ/K2T8ceqETamhoef8P/bZKWRWOsPnKq0NwDAAG XPF4B5Ppd78wKQvs/AhrtXvwE9A+KcXQmwaoAm9tv+PmqpaHKzD7atVSbqLohD48IsjZ /cKfKlPTmpvB9HmicYbCA98TLQkwzC6iYV/8J7XYnf2be2Xxvj2SbDzA+g0L5wTC/Lcj DFCofRNN6K2VncVGqMsrqE5wJdB7RCQcgPgnl+pRu+Ay9u4CYzwt7g0L3kP/+0vr0tFG g8/Q== MIME-Version: 1.0 X-Received: by 10.194.93.68 with SMTP id cs4mr36375990wjb.17.1366995698994; Fri, 26 Apr 2013 10:01:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Fri, 26 Apr 2013 10:01:38 -0700 (PDT) In-Reply-To: <201304261250.r3QCoWPZ072780@svn.freebsd.org> References: <201304261250.r3QCoWPZ072780@svn.freebsd.org> Date: Fri, 26 Apr 2013 10:01:38 -0700 X-Google-Sender-Auth: M5yk1Le737vSYzQYVHo_INoySaA Message-ID: Subject: Re: svn commit: r249925 - in head/sys: dev/iicbus dev/lmc dev/ppbus dev/usb/net net net80211 netatalk netgraph netinet netinet6 netpfil/ipfw netpfil/pf From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-current@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:01:41 -0000 Hi, This breaks the ability to compile this stuff on -9. Like, you know, a bunch of vendors tend to do. It would have been nice for a quick review cycle when you change network APIs like this. Also, since you've changed an API, have you bumped FREEBSD_VERSION ? This is why I suggested you do it in two parts - first fix the const brokenness you introduced, then do up this patch with a review cycle. Thanks, Adrian On 26 April 2013 05:50, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Apr 26 12:50:32 2013 > New Revision: 249925 > URL: http://svnweb.freebsd.org/changeset/base/249925 > > Log: > Add const qualifier to the dst parameter of the ifnet if_output method. > > Modified: > head/sys/dev/iicbus/if_ic.c > head/sys/dev/lmc/if_lmc.c > head/sys/dev/lmc/if_lmc.h > head/sys/dev/ppbus/if_plip.c > head/sys/dev/usb/net/if_usie.c > head/sys/dev/usb/net/uhso.c > head/sys/net/ethernet.h > head/sys/net/if.c > head/sys/net/if_arc.h > head/sys/net/if_arcsubr.c > head/sys/net/if_atm.h > head/sys/net/if_atmsubr.c > head/sys/net/if_dead.c > head/sys/net/if_disc.c > head/sys/net/if_ef.c > head/sys/net/if_enc.c > head/sys/net/if_ethersubr.c > head/sys/net/if_faith.c > head/sys/net/if_fddisubr.c > head/sys/net/if_fwsubr.c > head/sys/net/if_gif.c > head/sys/net/if_gif.h > head/sys/net/if_gre.c > head/sys/net/if_iso88025subr.c > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > head/sys/net/if_loop.c > head/sys/net/if_spppsubr.c > head/sys/net/if_stf.c > head/sys/net/if_tun.c > head/sys/net/if_var.h > head/sys/net/iso88025.h > head/sys/net80211/ieee80211.c > head/sys/net80211/ieee80211_output.c > head/sys/net80211/ieee80211_proto.h > head/sys/net80211/ieee80211_var.h > head/sys/netatalk/aarp.c > head/sys/netatalk/aarp.h > head/sys/netatalk/at_control.c > head/sys/netatalk/at_extern.h > head/sys/netgraph/ng_fec.c > head/sys/netgraph/ng_iface.c > head/sys/netinet/if_atm.c > head/sys/netinet/if_atm.h > head/sys/netinet/if_ether.c > head/sys/netinet/if_ether.h > head/sys/netinet/ip_carp.c > head/sys/netinet/ip_carp.h > head/sys/netinet/ip_output.c > head/sys/netinet6/nd6.c > head/sys/netinet6/nd6.h > head/sys/netpfil/ipfw/ip_fw_log.c > head/sys/netpfil/pf/if_pflog.c > head/sys/netpfil/pf/if_pfsync.c > > Modified: head/sys/dev/iicbus/if_ic.c > ============================================================================== > --- head/sys/dev/iicbus/if_ic.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/iicbus/if_ic.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -99,7 +99,7 @@ static int icprobe(device_t); > static int icattach(device_t); > > static int icioctl(struct ifnet *, u_long, caddr_t); > -static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *, > +static int icoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > > static int icintr(device_t, int, char *); > @@ -351,7 +351,7 @@ icintr(device_t dev, int event, char *pt > * icoutput() > */ > static int > -icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +icoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > struct ic_softc *sc = ifp->if_softc; > > Modified: head/sys/dev/lmc/if_lmc.c > ============================================================================== > --- head/sys/dev/lmc/if_lmc.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/lmc/if_lmc.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -4587,7 +4587,7 @@ lmc_ifnet_start(struct ifnet *ifp) > /* Called from a syscall (user context; no spinlocks). */ > static int > lmc_raw_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > + const struct sockaddr *dst, struct route *ro) > { > softc_t *sc = IFP2SC(ifp); > int error = 0; > > Modified: head/sys/dev/lmc/if_lmc.h > ============================================================================== > --- head/sys/dev/lmc/if_lmc.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/lmc/if_lmc.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -1595,7 +1595,7 @@ static int lmc_raw_ioctl(struct ifnet *, > static int lmc_ifnet_ioctl(struct ifnet *, u_long, caddr_t); > static void lmc_ifnet_start(struct ifnet *); > static int lmc_raw_output(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *); > + const struct sockaddr *, struct route *); > # ifdef __OpenBSD__ > static int ifmedia_change(struct ifnet *); > static void ifmedia_status(struct ifnet *, struct ifmediareq *); > > Modified: head/sys/dev/ppbus/if_plip.c > ============================================================================== > --- head/sys/dev/ppbus/if_plip.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/ppbus/if_plip.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -173,7 +173,7 @@ static u_char *ctxmith; > /* Functions for the lp# interface */ > static int lpinittables(void); > static int lpioctl(struct ifnet *, u_long, caddr_t); > -static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, > +static int lpoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > static void lpstop(struct lp_data *); > static void lp_intr(void *); > @@ -682,7 +682,7 @@ lpoutbyte(u_char byte, int spin, device_ > } > > static int > -lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +lpoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > struct lp_data *sc = ifp->if_softc; > > Modified: head/sys/dev/usb/net/if_usie.c > ============================================================================== > --- head/sys/dev/usb/net/if_usie.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/usb/net/if_usie.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -121,7 +121,8 @@ static void usie_if_sync_cb(void *, int) > static void usie_if_status_cb(void *, int); > > static void usie_if_start(struct ifnet *); > -static int usie_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); > +static int usie_if_output(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > static void usie_if_init(void *); > static void usie_if_stop(struct usie_softc *); > static int usie_if_ioctl(struct ifnet *, u_long, caddr_t); > @@ -1181,7 +1182,7 @@ usie_if_start(struct ifnet *ifp) > } > > static int > -usie_if_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +usie_if_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > int err; > > Modified: head/sys/dev/usb/net/uhso.c > ============================================================================== > --- head/sys/dev/usb/net/uhso.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/dev/usb/net/uhso.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -467,8 +467,8 @@ static void uhso_if_init(void *); > static void uhso_if_start(struct ifnet *); > static void uhso_if_stop(struct uhso_softc *); > static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t); > -static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, > - struct route *); > +static int uhso_if_output(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > static void uhso_if_rxflush(void *); > > static device_probe_t uhso_probe; > @@ -1881,7 +1881,7 @@ uhso_if_init(void *priv) > } > > static int > -uhso_if_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, > +uhso_if_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, > struct route *ro) > { > int error; > > Modified: head/sys/net/ethernet.h > ============================================================================== > --- head/sys/net/ethernet.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/ethernet.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -375,8 +375,8 @@ extern void ether_demux(struct ifnet *, > extern void ether_ifattach(struct ifnet *, const u_int8_t *); > extern void ether_ifdetach(struct ifnet *); > extern int ether_ioctl(struct ifnet *, u_long, caddr_t); > -extern int ether_output(struct ifnet *, > - struct mbuf *, struct sockaddr *, struct route *); > +extern int ether_output(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > extern int ether_output_frame(struct ifnet *, struct mbuf *); > extern char *ether_sprintf(const u_int8_t *); > void ether_vlan_mtap(struct bpf_if *, struct mbuf *, > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -134,7 +134,7 @@ int (*carp_master_p)(struct ifaddr *); > #if defined(INET) || defined(INET6) > int (*carp_forus_p)(struct ifnet *ifp, u_char *dhost); > int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *sa); > + const struct sockaddr *sa); > int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *); > int (*carp_attach_p)(struct ifaddr *, int); > void (*carp_detach_p)(struct ifaddr *); > > Modified: head/sys/net/if_arc.h > ============================================================================== > --- head/sys/net/if_arc.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_arc.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -133,7 +133,7 @@ void arc_storelladdr(struct ifnet *, u_i > int arc_isphds(u_int8_t); > void arc_input(struct ifnet *, struct mbuf *); > int arc_output(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *); > + const struct sockaddr *, struct route *); > int arc_ioctl(struct ifnet *, u_long, caddr_t); > > void arc_frag_init(struct ifnet *); > > Modified: head/sys/net/if_arcsubr.c > ============================================================================== > --- head/sys/net/if_arcsubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_arcsubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -92,8 +92,8 @@ u_int8_t arcbroadcastaddr = 0; > #define ARC_LLADDR(ifp) (*(u_int8_t *)IF_LLADDR(ifp)) > > #define senderr(e) { error = (e); goto bad;} > -#define SIN(s) ((struct sockaddr_in *)s) > -#define SIPX(s) ((struct sockaddr_ipx *)s) > +#define SIN(s) ((const struct sockaddr_in *)(s)) > +#define SIPX(s) ((const struct sockaddr_ipx *)(s)) > > /* > * ARCnet output routine. > @@ -101,7 +101,7 @@ u_int8_t arcbroadcastaddr = 0; > * Assumes that ifp is actually pointer to arccom structure. > */ > int > -arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > struct arc_header *ah; > @@ -186,8 +186,11 @@ arc_output(struct ifnet *ifp, struct mbu > #endif > > case AF_UNSPEC: > + { > + const struct arc_header *ah; > + > loop_copy = -1; > - ah = (struct arc_header *)dst->sa_data; > + ah = (const struct arc_header *)dst->sa_data; > adst = ah->arc_dhost; > atype = ah->arc_type; > > @@ -207,7 +210,7 @@ arc_output(struct ifnet *ifp, struct mbu > #endif > } > break; > - > + } > default: > if_printf(ifp, "can't handle af%d\n", dst->sa_family); > senderr(EAFNOSUPPORT); > > Modified: head/sys/net/if_atm.h > ============================================================================== > --- head/sys/net/if_atm.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_atm.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -292,7 +292,7 @@ void atm_ifattach(struct ifnet *); > void atm_ifdetach(struct ifnet *); > void atm_input(struct ifnet *, struct atm_pseudohdr *, > struct mbuf *, void *); > -int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *, > +int atm_output(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int, > struct mtx *, int); > > Modified: head/sys/net/if_atmsubr.c > ============================================================================== > --- head/sys/net/if_atmsubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_atmsubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -121,7 +121,7 @@ static MALLOC_DEFINE(M_IFATM, "ifatm", " > * ro->ro_rt must also be NULL. > */ > int > -atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, > +atm_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, > struct route *ro) > { > u_int16_t etype = 0; /* if using LLC/SNAP */ > @@ -129,7 +129,7 @@ atm_output(struct ifnet *ifp, struct mbu > struct atm_pseudohdr atmdst, *ad; > struct mbuf *m = m0; > struct atmllc *atmllc; > - struct atmllc *llc_hdr = NULL; > + const struct atmllc *llc_hdr = NULL; > u_int32_t atm_flags; > > #ifdef MAC > @@ -173,7 +173,7 @@ atm_output(struct ifnet *ifp, struct mbu > * (atm pseudo header (4) + LLC/SNAP (8)) > */ > bcopy(dst->sa_data, &atmdst, sizeof(atmdst)); > - llc_hdr = (struct atmllc *)(dst->sa_data + > + llc_hdr = (const struct atmllc *)(dst->sa_data + > sizeof(atmdst)); > break; > > > Modified: head/sys/net/if_dead.c > ============================================================================== > --- head/sys/net/if_dead.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_dead.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); > #include > > static int > -ifdead_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, > +ifdead_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa, > struct route *ro) > { > > > Modified: head/sys/net/if_disc.c > ============================================================================== > --- head/sys/net/if_disc.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_disc.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -64,7 +64,7 @@ struct disc_softc { > }; > > static int discoutput(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *); > + const struct sockaddr *, struct route *); > static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *); > static int discioctl(struct ifnet *, u_long, caddr_t); > static int disc_clone_create(struct if_clone *, int, caddr_t); > @@ -155,7 +155,7 @@ static moduledata_t disc_mod = { > DECLARE_MODULE(if_disc, disc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > > static int > -discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > u_int32_t af; > @@ -163,15 +163,14 @@ discoutput(struct ifnet *ifp, struct mbu > M_ASSERTPKTHDR(m); > > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > + else > + af = dst->sa_family; > > - if (bpf_peers_present(ifp->if_bpf)) { > - u_int af = dst->sa_family; > + if (bpf_peers_present(ifp->if_bpf)) > bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); > - } > + > m->m_pkthdr.rcvif = ifp; > > ifp->if_opackets++; > > Modified: head/sys/net/if_ef.c > ============================================================================== > --- head/sys/net/if_ef.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_ef.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -102,7 +102,7 @@ static int efcount; > > extern int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m); > extern int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, > - struct sockaddr *dst, short *tp, int *hlen); > + const struct sockaddr *dst, short *tp, int *hlen); > > /* > static void ef_reset (struct ifnet *); > @@ -114,7 +114,7 @@ static int ef_ioctl(struct ifnet *, u_lo > static void ef_start(struct ifnet *); > static int ef_input(struct ifnet*, struct ether_header *, struct mbuf *); > static int ef_output(struct ifnet *ifp, struct mbuf **mp, > - struct sockaddr *dst, short *tp, int *hlen); > + const struct sockaddr *dst, short *tp, int *hlen); > > static int ef_load(void); > static int ef_unload(void); > @@ -386,8 +386,8 @@ ef_input(struct ifnet *ifp, struct ether > } > > static int > -ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, > - int *hlen) > +ef_output(struct ifnet *ifp, struct mbuf **mp, const struct sockaddr *dst, > + short *tp, int *hlen) > { > struct efnet *sc = (struct efnet*)ifp->if_softc; > struct mbuf *m = *mp; > > Modified: head/sys/net/if_enc.c > ============================================================================== > --- head/sys/net/if_enc.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_enc.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -88,7 +88,7 @@ struct enc_softc { > > static int enc_ioctl(struct ifnet *, u_long, caddr_t); > static int enc_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro); > + const struct sockaddr *dst, struct route *ro); > static int enc_clone_create(struct if_clone *, int, caddr_t); > static void enc_clone_destroy(struct ifnet *); > static struct if_clone *enc_cloner; > @@ -188,7 +188,7 @@ static moduledata_t enc_mod = { > DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); > > static int > -enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +enc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > m_freem(m); > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_ethersubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -83,7 +83,7 @@ > > int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m); > int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, > - struct sockaddr *dst, short *tp, int *hlen); > + const struct sockaddr *dst, short *tp, int *hlen); > > #ifdef NETATALK > #include > @@ -149,7 +149,7 @@ static MALLOC_DEFINE(M_ARPCOM, "arpcom", > */ > int > ether_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > + const struct sockaddr *dst, struct route *ro) > { > short type; > int error = 0, hdrcmplt = 0; > @@ -238,8 +238,8 @@ ether_output(struct ifnet *ifp, struct m > goto bad; > } else > type = htons(ETHERTYPE_IPX); > - bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host), > - (caddr_t)edst, sizeof (edst)); > + bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host, > + edst, sizeof (edst)); > break; > #endif > #ifdef NETATALK > @@ -247,9 +247,9 @@ ether_output(struct ifnet *ifp, struct m > { > struct at_ifaddr *aa; > > - if ((aa = at_ifawithnet((struct sockaddr_at *)dst)) == NULL) > + if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == NULL) > senderr(EHOSTUNREACH); /* XXX */ > - if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) { > + if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) { > ifa_free(&aa->aa_ifa); > return (0); > } > @@ -279,18 +279,21 @@ ether_output(struct ifnet *ifp, struct m > #endif /* NETATALK */ > > case pseudo_AF_HDRCMPLT: > + { > + const struct ether_header *eh; > + > hdrcmplt = 1; > - eh = (struct ether_header *)dst->sa_data; > + eh = (const struct ether_header *)dst->sa_data; > (void)memcpy(esrc, eh->ether_shost, sizeof (esrc)); > /* FALLTHROUGH */ > > case AF_UNSPEC: > loop_copy = 0; /* if this is for us, don't do it */ > - eh = (struct ether_header *)dst->sa_data; > + eh = (const struct ether_header *)dst->sa_data; > (void)memcpy(edst, eh->ether_dhost, sizeof (edst)); > type = eh->ether_type; > break; > - > + } > default: > if_printf(ifp, "can't handle af%d\n", dst->sa_family); > senderr(EAFNOSUPPORT); > > Modified: head/sys/net/if_faith.c > ============================================================================== > --- head/sys/net/if_faith.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_faith.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -84,7 +84,7 @@ struct faith_softc { > }; > > static int faithioctl(struct ifnet *, u_long, caddr_t); > -int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *, > +static int faithoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *); > #ifdef INET6 > @@ -184,12 +184,9 @@ faith_clone_destroy(ifp) > free(sc, M_FAITH); > } > > -int > -faithoutput(ifp, m, dst, ro) > - struct ifnet *ifp; > - struct mbuf *m; > - struct sockaddr *dst; > - struct route *ro; > +static int > +faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > int isr; > u_int32_t af; > @@ -200,15 +197,13 @@ faithoutput(ifp, m, dst, ro) > if (ro != NULL) > rt = ro->ro_rt; > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > - > - if (bpf_peers_present(ifp->if_bpf)) { > + else > af = dst->sa_family; > + > + if (bpf_peers_present(ifp->if_bpf)) > bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); > - } > > if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { > m_freem(m); > @@ -217,7 +212,7 @@ faithoutput(ifp, m, dst, ro) > } > ifp->if_opackets++; > ifp->if_obytes += m->m_pkthdr.len; > - switch (dst->sa_family) { > + switch (af) { > #ifdef INET > case AF_INET: > isr = NETISR_IP; > > Modified: head/sys/net/if_fddisubr.c > ============================================================================== > --- head/sys/net/if_fddisubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_fddisubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -96,7 +96,7 @@ static const u_char fddibroadcastaddr[FD > > static int fddi_resolvemulti(struct ifnet *, struct sockaddr **, > struct sockaddr *); > -static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *, > +static int fddi_output(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > static void fddi_input(struct ifnet *ifp, struct mbuf *m); > > @@ -110,11 +110,8 @@ static void fddi_input(struct ifnet *ifp > * Assumes that ifp is actually pointer to arpcom structure. > */ > static int > -fddi_output(ifp, m, dst, ro) > - struct ifnet *ifp; > - struct mbuf *m; > - struct sockaddr *dst; > - struct route *ro; > +fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > u_int16_t type; > int loop_copy = 0, error = 0, hdrcmplt = 0; > @@ -189,19 +186,19 @@ fddi_output(ifp, m, dst, ro) > #ifdef IPX > case AF_IPX: > type = htons(ETHERTYPE_IPX); > - bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host), > - (caddr_t)edst, FDDI_ADDR_LEN); > + bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host, > + edst, FDDI_ADDR_LEN); > break; > #endif /* IPX */ > #ifdef NETATALK > case AF_APPLETALK: { > struct at_ifaddr *aa; > - if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) > + if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) > return (0); > /* > * ifaddr is the first thing in at_ifaddr > */ > - if ((aa = at_ifawithnet( (struct sockaddr_at *)dst)) == 0) > + if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == 0) > goto bad; > > /* > @@ -229,19 +226,21 @@ fddi_output(ifp, m, dst, ro) > > case pseudo_AF_HDRCMPLT: > { > - struct ether_header *eh; > + const struct ether_header *eh; > + > hdrcmplt = 1; > - eh = (struct ether_header *)dst->sa_data; > - bcopy((caddr_t)eh->ether_shost, (caddr_t)esrc, FDDI_ADDR_LEN); > + eh = (const struct ether_header *)dst->sa_data; > + bcopy(eh->ether_shost, esrc, FDDI_ADDR_LEN); > /* FALLTHROUGH */ > } > > case AF_UNSPEC: > { > - struct ether_header *eh; > + const struct ether_header *eh; > + > loop_copy = -1; > - eh = (struct ether_header *)dst->sa_data; > - bcopy((caddr_t)eh->ether_dhost, (caddr_t)edst, FDDI_ADDR_LEN); > + eh = (const struct ether_header *)dst->sa_data; > + bcopy(eh->ether_dhost, edst, FDDI_ADDR_LEN); > if (*edst & 1) > m->m_flags |= (M_BCAST|M_MCAST); > type = eh->ether_type; > > Modified: head/sys/net/if_fwsubr.c > ============================================================================== > --- head/sys/net/if_fwsubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_fwsubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -75,7 +75,7 @@ struct fw_hwaddr firewire_broadcastaddr > }; > > static int > -firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > struct fw_com *fc = IFP2FWC(ifp); > > Modified: head/sys/net/if_gif.c > ============================================================================== > --- head/sys/net/if_gif.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_gif.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -422,11 +422,8 @@ gif_start(struct ifnet *ifp) > } > > int > -gif_output(ifp, m, dst, ro) > - struct ifnet *ifp; > - struct mbuf *m; > - struct sockaddr *dst; > - struct route *ro; > +gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > struct gif_softc *sc = ifp->if_softc; > struct m_tag *mtag; > @@ -482,11 +479,10 @@ gif_output(ifp, m, dst, ro) > > m->m_flags &= ~(M_BCAST|M_MCAST); > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > - af = dst->sa_family; > + else > + af = dst->sa_family; > /* > * Now save the af in the inbound pkt csum > * data, this is a cheat since we are using > > Modified: head/sys/net/if_gif.h > ============================================================================== > --- head/sys/net/if_gif.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_gif.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -112,7 +112,7 @@ struct etherip_header { > > /* Prototypes */ > void gif_input(struct mbuf *, int, struct ifnet *); > -int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *, > +int gif_output(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > int gif_ioctl(struct ifnet *, u_long, caddr_t); > int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *); > > Modified: head/sys/net/if_gre.c > ============================================================================== > --- head/sys/net/if_gre.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_gre.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -113,8 +113,8 @@ static void gre_clone_destroy(struct ifn > static struct if_clone *gre_cloner; > > static int gre_ioctl(struct ifnet *, u_long, caddr_t); > -static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *, > - struct route *ro); > +static int gre_output(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > > static int gre_compute_route(struct gre_softc *sc); > > @@ -241,7 +241,7 @@ gre_clone_destroy(ifp) > * given by sc->g_proto. See also RFC 1701 and RFC 2004 > */ > static int > -gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > int error = 0; > @@ -333,20 +333,18 @@ gre_output(struct ifnet *ifp, struct mbu > ip = NULL; > > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > - > - if (bpf_peers_present(ifp->if_bpf)) { > + else > af = dst->sa_family; > + > + if (bpf_peers_present(ifp->if_bpf)) > bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); > - } > > m->m_flags &= ~(M_BCAST|M_MCAST); > > if (sc->g_proto == IPPROTO_MOBILE) { > - if (dst->sa_family == AF_INET) { > + if (af == AF_INET) { > struct mbuf *m0; > int msiz; > > @@ -417,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbu > goto end; > } > } else if (sc->g_proto == IPPROTO_GRE) { > - switch (dst->sa_family) { > + switch (af) { > case AF_INET: > ip = mtod(m, struct ip *); > gre_ip_tos = ip->ip_tos; > > Modified: head/sys/net/if_iso88025subr.c > ============================================================================== > --- head/sys/net/if_iso88025subr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_iso88025subr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -231,11 +231,8 @@ iso88025_ioctl(struct ifnet *ifp, u_long > * ISO88025 encapsulation > */ > int > -iso88025_output(ifp, m, dst, ro) > - struct ifnet *ifp; > - struct mbuf *m; > - struct sockaddr *dst; > - struct route *ro; > +iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > u_int16_t snap_type = 0; > int loop_copy = 0, error = 0, rif_len = 0; > @@ -351,7 +348,7 @@ iso88025_output(ifp, m, dst, ro) > #endif /* IPX */ > case AF_UNSPEC: > { > - struct iso88025_sockaddr_data *sd; > + const struct iso88025_sockaddr_data *sd; > /* > * For AF_UNSPEC sockaddr.sa_data must contain all of the > * mac information needed to send the packet. This allows > @@ -361,13 +358,12 @@ iso88025_output(ifp, m, dst, ro) > * should be an iso88025_sockaddr_data structure see iso88025.h > */ > loop_copy = -1; > - sd = (struct iso88025_sockaddr_data *)dst->sa_data; > + sd = (const struct iso88025_sockaddr_data *)dst->sa_data; > gen_th.ac = sd->ac; > gen_th.fc = sd->fc; > - (void)memcpy((caddr_t)edst, (caddr_t)sd->ether_dhost, > - ISO88025_ADDR_LEN); > - (void)memcpy((caddr_t)gen_th.iso88025_shost, > - (caddr_t)sd->ether_shost, ISO88025_ADDR_LEN); > + (void)memcpy(edst, sd->ether_dhost, ISO88025_ADDR_LEN); > + (void)memcpy(gen_th.iso88025_shost, sd->ether_shost, > + ISO88025_ADDR_LEN); > rif_len = 0; > break; > } > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_lagg.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -99,7 +99,7 @@ static void lagg_linkstate(struct lagg_s > static void lagg_port_state(struct ifnet *, int); > static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); > static int lagg_port_output(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *); > + const struct sockaddr *, struct route *); > static void lagg_port_ifdetach(void *arg __unused, struct ifnet *); > #ifdef LAGG_PORT_STACKING > static int lagg_port_checkstacking(struct lagg_softc *); > @@ -787,7 +787,7 @@ fallback: > */ > static int > lagg_port_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > + const struct sockaddr *dst, struct route *ro) > { > struct lagg_port *lp = ifp->if_lagg; > > > Modified: head/sys/net/if_lagg.h > ============================================================================== > --- head/sys/net/if_lagg.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_lagg.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -245,8 +245,8 @@ struct lagg_port { > > /* Redirected callbacks */ > int (*lp_ioctl)(struct ifnet *, u_long, caddr_t); > - int (*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *, > - struct route *); > + int (*lp_output)(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > > SLIST_ENTRY(lagg_port) lp_entries; > }; > > Modified: head/sys/net/if_loop.c > ============================================================================== > --- head/sys/net/if_loop.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_loop.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -101,7 +101,7 @@ > int loioctl(struct ifnet *, u_long, caddr_t); > static void lortrequest(int, struct rtentry *, struct rt_addrinfo *); > int looutput(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro); > + const struct sockaddr *dst, struct route *ro); > static int lo_clone_create(struct if_clone *, int, caddr_t); > static void lo_clone_destroy(struct ifnet *); > > @@ -210,7 +210,7 @@ static moduledata_t loop_mod = { > DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); > > int > -looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, > +looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > struct route *ro) > { > u_int32_t af; > @@ -241,13 +241,13 @@ looutput(struct ifnet *ifp, struct mbuf > ifp->if_obytes += m->m_pkthdr.len; > > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > + else > + af = dst->sa_family; > > #if 1 /* XXX */ > - switch (dst->sa_family) { > + switch (af) { > case AF_INET: > if (ifp->if_capenable & IFCAP_RXCSUM) { > m->m_pkthdr.csum_data = 0xffff; > @@ -276,12 +276,12 @@ looutput(struct ifnet *ifp, struct mbuf > case AF_APPLETALK: > break; > default: > - printf("looutput: af=%d unexpected\n", dst->sa_family); > + printf("looutput: af=%d unexpected\n", af); > m_freem(m); > return (EAFNOSUPPORT); > } > #endif > - return (if_simloop(ifp, m, dst->sa_family, 0)); > + return (if_simloop(ifp, m, af, 0)); > } > > /* > > Modified: head/sys/net/if_spppsubr.c > ============================================================================== > --- head/sys/net/if_spppsubr.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_spppsubr.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -262,7 +262,7 @@ static const u_short interactive_ports[8 > int debug = ifp->if_flags & IFF_DEBUG > > static int sppp_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro); > + const struct sockaddr *dst, struct route *ro); > > static void sppp_cisco_send(struct sppp *sp, int type, long par1, long par2); > static void sppp_cisco_input(struct sppp *sp, struct mbuf *m); > @@ -785,8 +785,8 @@ sppp_ifstart(struct ifnet *ifp) > * Enqueue transmit packet. > */ > static int > -sppp_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > +sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > struct sppp *sp = IFP2SP(ifp); > struct ppp_header *h; > > Modified: head/sys/net/if_stf.c > ============================================================================== > --- head/sys/net/if_stf.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_stf.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -140,7 +140,7 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, perm > * XXX: Return a pointer with 16-bit aligned. Don't cast it to > * struct in_addr *; use bcopy() instead. > */ > -#define GET_V4(x) ((caddr_t)(&(x)->s6_addr16[1])) > +#define GET_V4(x) (&(x)->s6_addr16[1]) > > struct stf_softc { > struct ifnet *sc_ifp; > @@ -181,7 +181,7 @@ static char *stfnames[] = {"stf0", "stf" > static int stfmodevent(module_t, int, void *); > static int stf_encapcheck(const struct mbuf *, int, int, void *); > static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *); > -static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *, > +static int stf_output(struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > static int isrfc1918addr(struct in_addr *); > static int stf_checkaddr4(struct stf_softc *, struct in_addr *, > @@ -413,23 +413,19 @@ stf_getsrcifa6(ifp) > } > > static int > -stf_output(ifp, m, dst, ro) > - struct ifnet *ifp; > - struct mbuf *m; > - struct sockaddr *dst; > - struct route *ro; > +stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, > + struct route *ro) > { > struct stf_softc *sc; > - struct sockaddr_in6 *dst6; > + const struct sockaddr_in6 *dst6; > struct route *cached_route; > struct in_addr in4; > - caddr_t ptr; > + const void *ptr; > struct sockaddr_in *dst4; > u_int8_t tos; > struct ip *ip; > struct ip6_hdr *ip6; > struct in6_ifaddr *ia6; > - u_int32_t af; > int error; > > #ifdef MAC > @@ -441,7 +437,7 @@ stf_output(ifp, m, dst, ro) > #endif > > sc = ifp->if_softc; > - dst6 = (struct sockaddr_in6 *)dst; > + dst6 = (const struct sockaddr_in6 *)dst; > > /* just in case */ > if ((ifp->if_flags & IFF_UP) == 0) { > @@ -474,15 +470,6 @@ stf_output(ifp, m, dst, ro) > tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; > > /* > - * BPF writes need to be handled specially. > - * This is a null operation, nothing here checks dst->sa_family. > - */ > - if (dst->sa_family == AF_UNSPEC) { > - bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > - > - /* > * Pickup the right outer dst addr from the list of candidates. > * ip6_dst has priority as it may be able to give us shorter IPv4 hops. > */ > @@ -507,7 +494,7 @@ stf_output(ifp, m, dst, ro) > * will only read from the mbuf (i.e., it won't > * try to free it or keep a pointer a to it). > */ > - af = AF_INET6; > + u_int af = AF_INET6; > bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); > } > > > Modified: head/sys/net/if_tun.c > ============================================================================== > --- head/sys/net/if_tun.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_tun.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -128,8 +128,8 @@ static void tuncreate(const char *name, > static int tunifioctl(struct ifnet *, u_long, caddr_t); > static void tuninit(struct ifnet *); > static int tunmodevent(module_t, int, void *); > -static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *, > - struct route *ro); > +static int tunoutput(struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *ro); > static void tunstart(struct ifnet *); > > static int tun_clone_create(struct if_clone *, int, caddr_t); > @@ -575,7 +575,7 @@ tunifioctl(struct ifnet *ifp, u_long cmd > * tunoutput - queue packets from higher level ready to put out. > */ > static int > -tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, > +tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, > struct route *ro) > { > struct tun_softc *tp = ifp->if_softc; > @@ -609,15 +609,13 @@ tunoutput(struct ifnet *ifp, struct mbuf > } > > /* BPF writes need to be handled specially. */ > - if (dst->sa_family == AF_UNSPEC) { > + if (dst->sa_family == AF_UNSPEC) > bcopy(dst->sa_data, &af, sizeof(af)); > - dst->sa_family = af; > - } > - > - if (bpf_peers_present(ifp->if_bpf)) { > + else > af = dst->sa_family; > + > + if (bpf_peers_present(ifp->if_bpf)) > bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); > - } > > /* prepend sockaddr? this may abort if the mbuf allocation fails */ > if (cached_tun_flags & TUN_LMODE) { > @@ -644,10 +642,10 @@ tunoutput(struct ifnet *ifp, struct mbuf > ifp->if_oerrors++; > return (ENOBUFS); > } else > - *(u_int32_t *)m0->m_data = htonl(dst->sa_family); > + *(u_int32_t *)m0->m_data = htonl(af); > } else { > #ifdef INET > - if (dst->sa_family != AF_INET) > + if (af != AF_INET) > #endif > { > m_freem(m0); > > Modified: head/sys/net/if_var.h > ============================================================================== > --- head/sys/net/if_var.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/if_var.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -158,7 +158,7 @@ struct ifnet { > int if_amcount; /* number of all-multicast requests */ > /* procedure handles */ > int (*if_output) /* output routine (enqueue) */ > - (struct ifnet *, struct mbuf *, struct sockaddr *, > + (struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > void (*if_input) /* input routine (from h/w driver) */ > (struct ifnet *, struct mbuf *); > > Modified: head/sys/net/iso88025.h > ============================================================================== > --- head/sys/net/iso88025.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net/iso88025.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -165,8 +165,8 @@ struct iso88025_addr { > void iso88025_ifattach (struct ifnet *, const u_int8_t *, int); > void iso88025_ifdetach (struct ifnet *, int); > int iso88025_ioctl (struct ifnet *, u_long, caddr_t ); > -int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *, > - struct route *); > +int iso88025_output (struct ifnet *, struct mbuf *, > + const struct sockaddr *, struct route *); > void iso88025_input (struct ifnet *, struct mbuf *); > > #endif > > Modified: head/sys/net80211/ieee80211.c > ============================================================================== > --- head/sys/net80211/ieee80211.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net80211/ieee80211.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -243,7 +243,7 @@ null_transmit(struct ifnet *ifp, struct > > static int > null_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > + const struct sockaddr *dst, struct route *ro) > { > if_printf(ifp, "discard raw packet\n"); > return null_transmit(ifp, m); > > Modified: head/sys/net80211/ieee80211_output.c > ============================================================================== > --- head/sys/net80211/ieee80211_output.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net80211/ieee80211_output.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -450,7 +450,7 @@ ieee80211_raw_output(struct ieee80211vap > */ > int > ieee80211_output(struct ifnet *ifp, struct mbuf *m, > - struct sockaddr *dst, struct route *ro) > + const struct sockaddr *dst, struct route *ro) > { > #define senderr(e) do { error = (e); goto bad;} while (0) > struct ieee80211_node *ni = NULL; > > Modified: head/sys/net80211/ieee80211_proto.h > ============================================================================== > --- head/sys/net80211/ieee80211_proto.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net80211/ieee80211_proto.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -97,7 +97,7 @@ int ieee80211_mgmt_output(struct ieee802 > int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *, > const struct ieee80211_bpf_params *); > int ieee80211_output(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *ro); > + const struct sockaddr *, struct route *ro); > int ieee80211_raw_output(struct ieee80211vap *, struct ieee80211_node *, > struct mbuf *, const struct ieee80211_bpf_params *); > void ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int, > > Modified: head/sys/net80211/ieee80211_var.h > ============================================================================== > --- head/sys/net80211/ieee80211_var.h Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/net80211/ieee80211_var.h Fri Apr 26 12:50:32 2013 (r249925) > @@ -497,7 +497,7 @@ struct ieee80211vap { > enum ieee80211_state, int); > /* 802.3 output method for raw frame xmit */ > int (*iv_output)(struct ifnet *, struct mbuf *, > - struct sockaddr *, struct route *); > + const struct sockaddr *, struct route *); > uint64_t iv_spare[6]; > }; > MALLOC_DECLARE(M_80211_VAP); > > Modified: head/sys/netatalk/aarp.c > ============================================================================== > --- head/sys/netatalk/aarp.c Fri Apr 26 12:27:30 2013 (r249924) > +++ head/sys/netatalk/aarp.c Fri Apr 26 12:50:32 2013 (r249925) > @@ -147,7 +147,7 @@ aarptimer(void *ignored) > * unlocked variant returns a reference that the caller must dispose of. > */ > struct at_ifaddr * > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:06:37 2013 Return-Path: Delivered-To: svn-src-head@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 7B265E5A; Fri, 26 Apr 2013 17:06:37 +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 6E6EC134C; Fri, 26 Apr 2013 17:06: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 r3QH6bdS066548; Fri, 26 Apr 2013 17:06:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QH6bYn066547; Fri, 26 Apr 2013 17:06:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304261706.r3QH6bYn066547@svn.freebsd.org> From: Adrian Chadd Date: Fri, 26 Apr 2013 17:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249943 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:06:37 -0000 Author: adrian Date: Fri Apr 26 17:06:36 2013 New Revision: 249943 URL: http://svnweb.freebsd.org/changeset/base/249943 Log: Bump FreeBSD_version after glebius' changes. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 26 16:58:22 2013 (r249942) +++ head/sys/sys/param.h Fri Apr 26 17:06:36 2013 (r249943) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000030 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000031 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:27:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2271983; Fri, 26 Apr 2013 17:27:53 +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 D377A1468; Fri, 26 Apr 2013 17:27: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 r3QHRrVW073899; Fri, 26 Apr 2013 17:27:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QHRrof073896; Fri, 26 Apr 2013 17:27:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201304261727.r3QHRrof073896@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 26 Apr 2013 17:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249946 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:27:54 -0000 Author: gonzo Date: Fri Apr 26 17:27:53 2013 New Revision: 249946 URL: http://svnweb.freebsd.org/changeset/base/249946 Log: Move pinmux configuration to board-specific config. It will vary from board to board. Modified: head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Fri Apr 26 17:12:51 2013 (r249945) +++ head/sys/boot/fdt/dts/am335x.dtsi Fri Apr 26 17:27:53 2013 (r249946) @@ -51,85 +51,6 @@ scm@44e10000 { compatible = "ti,scm"; reg = < 0x44e10000 0x2000 >; - /* 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 */ - "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", - "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", - "GPMC_CLK", "gpio2_1", "input_pulldown", - "LCD_DATA0", "gpio2_6", "input_pulldown", - "LCD_DATA1", "gpio2_7", "input_pulldown", - "LCD_DATA2", "gpio2_8", "input_pulldown", - "LCD_DATA3", "gpio2_9", "input_pulldown", - "LCD_DATA4", "gpio2_10", "input_pulldown", - "LCD_DATA5", "gpio2_11", "input_pulldown", - "LCD_DATA6", "gpio2_12", "input_pulldown", - "LCD_DATA7", "gpio2_13", "input_pulldown", - "LCD_VSYNC", "gpio2_22", "input_pulldown", - "LCD_HSYNC", "gpio2_23", "input_pulldown", - "LCD_PCLK", "gpio2_24", "input_pulldown", - "LCD_AC_BIAS_EN", "gpio2_25", "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", - /* PWM */ - "GPMC_A2", "ehrpwm1A", "output", - "GPMC_A3", "ehrpwm1B", "output", - "GPMC_AD8", "ehrpwm2A", "output", - "GPMC_AD9", "ehrpwm2B", "output"; }; prcm@44E00000 { Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Fri Apr 26 17:12:51 2013 (r249945) +++ head/sys/boot/fdt/dts/beaglebone.dts Fri Apr 26 17:27:53 2013 (r249946) @@ -44,6 +44,88 @@ }; 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 */ + "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", + "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", + "GPMC_CLK", "gpio2_1", "input_pulldown", + "LCD_DATA0", "gpio2_6", "input_pulldown", + "LCD_DATA1", "gpio2_7", "input_pulldown", + "LCD_DATA2", "gpio2_8", "input_pulldown", + "LCD_DATA3", "gpio2_9", "input_pulldown", + "LCD_DATA4", "gpio2_10", "input_pulldown", + "LCD_DATA5", "gpio2_11", "input_pulldown", + "LCD_DATA6", "gpio2_12", "input_pulldown", + "LCD_DATA7", "gpio2_13", "input_pulldown", + "LCD_VSYNC", "gpio2_22", "input_pulldown", + "LCD_HSYNC", "gpio2_23", "input_pulldown", + "LCD_PCLK", "gpio2_24", "input_pulldown", + "LCD_AC_BIAS_EN", "gpio2_25", "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", + /* PWM */ + "GPMC_A2", "ehrpwm1A", "output", + "GPMC_A3", "ehrpwm1B", "output", + "GPMC_AD8", "ehrpwm2A", "output", + "GPMC_AD9", "ehrpwm2B", "output"; + }; + i2c@44e0b000 { pmic@24 { compatible = "ti,am335x-pmic"; From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:28:46 2013 Return-Path: Delivered-To: svn-src-head@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 44385B49; Fri, 26 Apr 2013 17:28:46 +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 365531488; Fri, 26 Apr 2013 17:28: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 r3QHSkDO074094; Fri, 26 Apr 2013 17:28:46 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QHSk27074093; Fri, 26 Apr 2013 17:28:46 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304261728.r3QHSk27074093@svn.freebsd.org> From: Sean Bruno Date: Fri, 26 Apr 2013 17:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249947 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:28:46 -0000 Author: sbruno Date: Fri Apr 26 17:28:45 2013 New Revision: 249947 URL: http://svnweb.freebsd.org/changeset/base/249947 Log: Adjust the min comparison to look at the adjust value after subtraction, don't subtract 1 from the chosen value if we are going to use the configued value. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Apr 26 17:27:53 2013 (r249946) +++ head/sys/dev/ciss/ciss.c Fri Apr 26 17:28:45 2013 (r249947) @@ -3005,7 +3005,7 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; - cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sc->ciss_cfg->max_sg_length) - 1) * PAGE_SIZE; + cpi->maxio = (min(CISS_MAX_SG_ELEMENTS - 1, sc->ciss_cfg->max_sg_length)) * PAGE_SIZE; ccb->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:45:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4384A2AE; Fri, 26 Apr 2013 17:45:39 +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 1B7D01593; Fri, 26 Apr 2013 17:45: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 r3QHjcHn080459; Fri, 26 Apr 2013 17:45:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QHjcCK080457; Fri, 26 Apr 2013 17:45:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304261745.r3QHjcCK080457@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Apr 2013 17:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249948 - head/bin/rm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:45:39 -0000 Author: eadler Date: Fri Apr 26 17:45:37 2013 New Revision: 249948 URL: http://svnweb.freebsd.org/changeset/base/249948 Log: Add -x option to avoid crossing mount points when removing a hierarchy. Discussed on: -hackers Inspired by: DragonflyBSD MFC After: 1 week Modified: head/bin/rm/rm.1 head/bin/rm/rm.c Modified: head/bin/rm/rm.1 ============================================================================== --- head/bin/rm/rm.1 Fri Apr 26 17:28:45 2013 (r249947) +++ head/bin/rm/rm.1 Fri Apr 26 17:45:37 2013 (r249948) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd April 25, 2013 .Dt RM 1 .Os .Sh NAME @@ -42,7 +42,7 @@ .Sh SYNOPSIS .Nm .Op Fl f | i -.Op Fl dIPRrvW +.Op Fl dIPRrvWx .Ar .Nm unlink .Ar file @@ -132,6 +132,8 @@ Attempt to undelete the named files. Currently, this option can only be used to recover files covered by whiteouts in a union file system (see .Xr undelete 2 ) . +.It Fl x +When removing a hierarchy, do not cross mount points. .El .Pp The Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Fri Apr 26 17:28:45 2013 (r249947) +++ head/bin/rm/rm.c Fri Apr 26 17:45:37 2013 (r249948) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include static int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; -static int rflag, Iflag; +static int rflag, Iflag, xflag; static uid_t uid; static volatile sig_atomic_t info; @@ -106,8 +106,8 @@ main(int argc, char *argv[]) exit(eval); } - Pflag = rflag = 0; - while ((ch = getopt(argc, argv, "dfiIPRrvW")) != -1) + Pflag = rflag = xflag = 0; + while ((ch = getopt(argc, argv, "dfiIPRrvWx")) != -1) switch(ch) { case 'd': dflag = 1; @@ -136,6 +136,9 @@ main(int argc, char *argv[]) case 'W': Wflag = 1; break; + case 'x': + xflag = 1; + break; default: usage(); } @@ -196,6 +199,8 @@ rm_tree(char **argv) flags |= FTS_NOSTAT; if (Wflag) flags |= FTS_WHITEOUT; + if (xflag) + flags |= FTS_XDEV; if (!(fts = fts_open(argv, flags, NULL))) { if (fflag && errno == ENOENT) return; @@ -624,7 +629,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: rm [-f | -i] [-dIPRrvW] file ...", + "usage: rm [-f | -i] [-dIPRrvWx] file ...", " unlink file"); exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:45:41 2013 Return-Path: Delivered-To: svn-src-head@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 2F5882AF; Fri, 26 Apr 2013 17:45:41 +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 07CB31594; Fri, 26 Apr 2013 17:45: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 r3QHjepN080498; Fri, 26 Apr 2013 17:45:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QHje7s080497; Fri, 26 Apr 2013 17:45:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304261745.r3QHje7s080497@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Apr 2013 17:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249949 - head/bin/rm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:45:41 -0000 Author: eadler Date: Fri Apr 26 17:45:40 2013 New Revision: 249949 URL: http://svnweb.freebsd.org/changeset/base/249949 Log: Take some improvements from DragonFlyBSD: - add const where appropriate - add static where appropriate - fix a whitespace issues Reviewed by: brooks Obtained from: DragonFlyBSD MFC After: 1 week Modified: head/bin/rm/rm.c Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Fri Apr 26 17:45:37 2013 (r249948) +++ head/bin/rm/rm.c Fri Apr 26 17:45:40 2013 (r249949) @@ -63,15 +63,15 @@ static int rflag, Iflag, xflag; static uid_t uid; static volatile sig_atomic_t info; -int check(char *, char *, struct stat *); -int check2(char **); -void checkdot(char **); -void checkslash(char **); -void rm_file(char **); -int rm_overwrite(char *, struct stat *); -void rm_tree(char **); +static int check(const char *, const char *, struct stat *); +static int check2(char **); +static void checkdot(char **); +static void checkslash(char **); +static void rm_file(char **); +static int rm_overwrite(const char *, struct stat *); +static void rm_tree(char **); static void siginfo(int __unused); -void usage(void); +static void usage(void); /* * rm -- @@ -173,7 +173,7 @@ main(int argc, char *argv[]) exit (eval); } -void +static void rm_tree(char **argv) { FTS *fts; @@ -418,7 +418,7 @@ rm_file(char **argv) * have kernel support. */ int -rm_overwrite(char *file, struct stat *sbp) +rm_overwrite(const char *file, struct stat *sbp) { struct stat sb, sb2; struct statfs fsb; @@ -484,8 +484,8 @@ err: eval = 1; } -int -check(char *path, char *name, struct stat *sp) +static int +check(const char *path, const char *name, struct stat *sp) { int ch, first; char modep[15], *flagsp; @@ -496,7 +496,7 @@ check(char *path, char *name, struct sta else { /* * If it's not a symbolic link and it's unwritable and we're - * talking to a terminal, ask. Symbolic links are excluded + * talking to a terminal, ask. Symbolic links are excluded * because their permissions are meaningless. Check stdin_ok * first because we may not have stat'ed the file. */ @@ -529,7 +529,7 @@ check(char *path, char *name, struct sta } #define ISSLASH(a) ((a)[0] == '/' && (a)[1] == '\0') -void +static void checkslash(char **argv) { char **t, **u; @@ -549,7 +549,7 @@ checkslash(char **argv) } } -int +static int check2(char **argv) { struct stat st; @@ -600,7 +600,7 @@ check2(char **argv) } #define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2]))) -void +static void checkdot(char **argv) { char *p, **save, **t; @@ -624,7 +624,7 @@ checkdot(char **argv) } } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 17:56:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B34E1C2C; Fri, 26 Apr 2013 17:56:36 +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 A54F61605; Fri, 26 Apr 2013 17:56: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 r3QHuahW084026; Fri, 26 Apr 2013 17:56:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QHua5v084025; Fri, 26 Apr 2013 17:56:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304261756.r3QHua5v084025@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Apr 2013 17:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249950 - head/bin/rm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 17:56:36 -0000 Author: eadler Date: Fri Apr 26 17:56:35 2013 New Revision: 249950 URL: http://svnweb.freebsd.org/changeset/base/249950 Log: Add two more 'static' qualifiers Modified: head/bin/rm/rm.c Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Fri Apr 26 17:45:40 2013 (r249949) +++ head/bin/rm/rm.c Fri Apr 26 17:56:35 2013 (r249950) @@ -340,7 +340,7 @@ err: fts_close(fts); } -void +static void rm_file(char **argv) { struct stat sb; @@ -417,7 +417,7 @@ rm_file(char **argv) * System V file system). In a logging or COW file system, you'll have to * have kernel support. */ -int +static int rm_overwrite(const char *file, struct stat *sbp) { struct stat sb, sb2; From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 18:37:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E288C6FA; Fri, 26 Apr 2013 18:37:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 6AB0B17ED; Fri, 26 Apr 2013 18:37:13 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r3QIaueP013094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 27 Apr 2013 04:37:02 +1000 Date: Sat, 27 Apr 2013 04:36:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r249859 - head/lib/libc/sys In-Reply-To: <20130426155933.GA24412@stack.nl> Message-ID: <20130427030857.L2680@besplex.bde.org> References: <201304242124.r3OLOZW5034818@svn.freebsd.org> <20130425204458.F1034@besplex.bde.org> <20130426155933.GA24412@stack.nl> 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=Gu4aYTJC c=1 sm=1 a=P_x8KVnH094A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=uiiGxAOqq18A:10 a=0qMOogwszCEQbqkq7PUA:9 a=CjuIK1q_8ugA:10 a=DoCJ9_kpjpoDdCIq:21 a=oUpQ4aSxQuHIGM3f:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 18:37:14 -0000 On Fri, 26 Apr 2013, Jilles Tjoelker wrote: > On Thu, Apr 25, 2013 at 09:56:01PM +1000, Bruce Evans wrote: >> On Wed, 24 Apr 2013, Jilles Tjoelker wrote: > >>> Log: >>> getdtablesize(2): Describe what this function actually does. >>> ... >>> .Sh NAME >>> .Nm getdtablesize >>> -.Nd get descriptor table size >>> +.Nd get file descriptor limit > >> Now its name doesn't match its description, and the reason for this is >> not documented. > > This seems to be the case on most systems that have this function. No reason not to document it. >> This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} >> or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. > > There is a difference between sysconf(_SC_OPEN_MAX) and getdtablesize(): > the latter also takes maxfilesperproc and rctl(8) rules into account. Yes, only sysconf(_SC_OPEN_MAX) (and getrlimit(..., RLIMIT_NOFILE)) are broken. I'm not familiar with rctl. It seems to break this some more: in kern_descrip.c, all the places that use the rlimit clamp it to maxfileperproc, so the effective rlimit is always the clamped value and this is what sysconf() and getrlimit() should return too. Now for rctl, only 1 of these places (namely getdtablesize()) clamps it further to the RACCT_NOFILE limit. Other places include do_dup(). do_dup() checks the RACCT_NOFILE much later. I think this gives the same limit, but at least the errno when the limit RACCT_NOFILE limit is exceeded but the others aren't is wrong in all cases. (The early errno for (new >= maxfd) is (flags & DUP_FCNTL ? EINVAL : EBADF). The later errno for racct_set(... RACCT_NOFILE, new + 1) is always EMFILE. EMFILE is not even a possible errno for dup2(). >> I prepared to remove the broken definition of OPEN_MAX, but never committed >> the final step. /usr/src has very few misuses of OPEN_MAX now, so removing >> the definition wouldn't be too hard. Most uses are in compatibility >> cruft. E.g., the following from >> crypto/openssh/openbsd-compat/bsd-closefrom.c >> which is confused about related things: > >> [snip] > If that code is compiled at all, it is a bug. We have closefrom() and > OpenSSH should use it. It almost certainly uses it. However, a quick grep for getdtablesize() shows many applications using it, and most of them use it to give the top of a close() loop. These should be converted to use something like closefrom(). getdtablesize() is used much more than sysconf() or getrlimit() for this. This is done mostly in old BSD applications. However, the worst uses that I noticed are in the relatively new ppp application. There are about 40 calls to getdtablesize() in /usr/src. 7 of these are in ppp. 1 of the 7 is for the close() loop. 4 of the 7 are for fcntl(... F_SETFD ...) loops. The other 2 are for a home made FD_SETSIZE and a home made FD_ZERO(). These essentially initialize FD_SETSIZE to the variable getdtablesize(). A table of bits of that size is allocated. A table of bits of that size is cleared. Since getdtablesize() is variable, buffer overruns and underruns occur if someone changes getdtablesize() while the process is running (it can be changed by the maxfileperproc sysctl and now by rctl). But the huge table is not always passed to select() (its size doesn't seem to be recorded anywhere, so it can also be overrun or underrun by FD_SET() on it, where the fd for FD_SET is acquired before or after getdtablesize() changes). >> ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for >> the resource limit (sysconf() is a libc wrapper and getdtablesize() is >> a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the >> rlmint -- it is the min() of the rlimit and the global sysctl integer >> maxfilesperproc. Here the bug is in the rlimit. For the rlimit, >> maxfilesperproc is only used when the rlimit is set and when it is used >> in the kernel. But when the rlimit is returned to userland, via >> getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if >> maxfileperproc was lowered after setting the rlimit. > > I don't like the idea of rlimits changing of "their own will". Changing > maxfileperproc at run time is going to be a bit nasty in any case but > seems not as bad as changing rlimits of running processes. I don't like this either. maxfileperproc wouldn't exist if my axe was sharper in 1995 when it was committed. rctl is less hackish, but causes similar problems. Anyway, since the effective limit does change, getrlimit() should keep up with the change like getdtablesize() does. Otherwise processes can't tell what the rlimit actually is, or needs to know that getdtablesize() must be used instead of getrlimit() to determine the actual limit. maxfileperproc and the rctl limit are only needed to prevent growth of the table. Once a large table has been allocated, it is not useful to prevent dup2() from using a large fd for which space has already been allocated. But the clamps to maxfileperproc prevent this. Maybe the clamps to the rctl limit don't prevent this, since they are applied later and only cause failure if the allocation fails. But then since they are applied at the same time in getdtablesize(), they prevent applications from knowing the actual limit in another way. I think this is now further complicated by sparse tables. >> Actually, {OPEN_MAX} is guaranteed by POSIX to be at least >> {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these >> guarantees and similar ones for stdio's FOPEN_MAX have always been >> broken in FreeBSD, since anyone can reduce the rlimit below 20. >> ... > Recent versions of POSIX allow {OPEN_MAX} to be based on the rlimit. In > that case, it may change when the rlimit is changed. I think this is more or less required (and implicit before). But how can anything work if it there is no API like closefrom() and there is no way to determine the maximum open fd. getdtablesize() would be more useful if it actually returned the table size. Then its old use of closing all files up to the table size (less 1) would keep working OK iff the table size is small. Of course, the table must remain large enough to keep holding the maximum open fd. If getdtablesize() did that, then it would match its name again. But it hasn't matched since 386BSD or earlier -- in FreeBSD-1, it returned essentially the same as now: (just the rlimit, so it doesn't cover the maximum open fd if anyone reduces the rlimit). >>> The >>> .Fn getdtablesize >>> -system call returns the size of this table. >>> +system call returns the maximum number of file descriptors >>> +that the current process may open. > >> Actually, the process may open more than this number, after raising its >> (soft) rlimit, if this is possible. > > True, but this requires different function calls than just ones > allocating file descriptors. Not too bad if the rlimit can only be changed by the process itself, but I'd still like this to be documented explicitly. POSIX doesn't have the complications of maxfileperproc or rctl. These are harder to document. About all you can say is that the results returned by getdtablesize(), getrlimit() and sysconf() are volatile so that they become unusable before they can be used :-(. >>> +.Xr closefrom 2 , >>> .Xr dup 2 , >>> -.Xr open 2 , >>> -.Xr select 2 >>> +.Xr getrlimit 2 , >>> +.Xr sysconf 2 >>> .Sh HISTORY >>> The >>> .Fn getdtablesize > > I suppose rctl(8) can be added here. dup(2) needs similar changes (I didn't notice if you changed it recently). It says that `oldd' must be < getdtablesize(), but actually, `oldd' must just be open. It doesn't say that `newd' must be < getdtablesize() (modulo complications for the rctl case), except indirectly in the ERRORS section, it says that EBADF occurs when `newd' exceeds the maximum allowable descriptor number. Here "allowable" has a wrong tense ("allowed" would make more sense), and what this maximum is is not described. POSIX uses better wording for this of course ("... when `fildes' is greater than or equal to {OPEN_MAX}"). This would be better still with "greater than or equal" spelled ">=". Bruce From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 19:49:37 2013 Return-Path: Delivered-To: svn-src-head@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 9D09E2CF; Fri, 26 Apr 2013 19:49:37 +0000 (UTC) (envelope-from asomers@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 8FF501B19; Fri, 26 Apr 2013 19:49: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 r3QJnbwt022893; Fri, 26 Apr 2013 19:49:37 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QJnbX4022892; Fri, 26 Apr 2013 19:49:37 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201304261949.r3QJnbX4022892@svn.freebsd.org> From: Alan Somers Date: Fri, 26 Apr 2013 19:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249951 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 19:49:37 -0000 Author: asomers Date: Fri Apr 26 19:49:37 2013 New Revision: 249951 URL: http://svnweb.freebsd.org/changeset/base/249951 Log: According to devctl(4), clients must read events whole; they may not piece them together from multiple reads(). It's as if /dev/devctl is a datagram device instead of a stream device. However, devd's internal buffer was too small (1025 bytes) to read an entire ereport.fs.zfs.checksum event (variable, up to ~1300 bytes). This commit enlarges the buffer to 8k. Reviewed by: imp Approved by: ken (mentor) MFC after: 2 weeks Modified: head/sbin/devd/devd.h Modified: head/sbin/devd/devd.h ============================================================================== --- head/sbin/devd/devd.h Fri Apr 26 17:56:35 2013 (r249950) +++ head/sbin/devd/devd.h Fri Apr 26 19:49:37 2013 (r249951) @@ -53,6 +53,6 @@ int yyparse(void); __END_DECLS #define PATH_DEVCTL "/dev/devctl" -#define DEVCTL_MAXBUF 1025 +#define DEVCTL_MAXBUF 8192 #endif /* DEVD_H */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 19:56:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4355D6E8; Fri, 26 Apr 2013 19:56:15 +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 34C0C1B61; Fri, 26 Apr 2013 19:56: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 r3QJuFt8025929; Fri, 26 Apr 2013 19:56:15 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QJuEPK025927; Fri, 26 Apr 2013 19:56:14 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304261956.r3QJuEPK025927@svn.freebsd.org> From: Bryan Drewery Date: Fri, 26 Apr 2013 19:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249952 - in head/share: examples/etc 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 19:56:15 -0000 Author: bdrewery (ports committer) Date: Fri Apr 26 19:56:14 2013 New Revision: 249952 URL: http://svnweb.freebsd.org/changeset/base/249952 Log: Fix examples for overriding INSTALL to not suggest hardcoding 'install' since it breaks buildworld after the introduction and use of 'install -l' in r245752. Overriding INSTALL causes /usr/bin/install to be used instead of the proper /usr/src/tools/install.sh which handles the new flag. Approved by: bapt MFC after: 2 weeks Modified: head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Fri Apr 26 19:49:37 2013 (r249951) +++ head/share/examples/etc/make.conf Fri Apr 26 19:56:14 2013 (r249952) @@ -97,7 +97,7 @@ #COPTFLAGS= -O -pipe # # Compare before install. -#INSTALL=install -C +#INSTALL+= -C # # Mtree will follow symlinks. #MTREE_FOLLOWS_SYMLINKS= -L Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Fri Apr 26 19:49:37 2013 (r249951) +++ head/share/man/man5/make.conf.5 Fri Apr 26 19:56:14 2013 (r249952) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd April 26, 2013 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -205,7 +205,7 @@ instead of the default install command. To install only files for which the target differs or does not exist, use .Bd -literal -offset indent -INSTALL="install -C" +INSTALL+= -C .Ed Note that some makefiles (including those in .Pa /usr/share/mk ) From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 20:02:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E72D990; Fri, 26 Apr 2013 20:02:06 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7C2291BA4; Fri, 26 Apr 2013 20:02:06 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 9B3F71A3C1A; Fri, 26 Apr 2013 12:54:45 -0700 (PDT) Message-ID: <517ADB77.9040203@mu.org> Date: Fri, 26 Apr 2013 12:54:31 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Steven Hartland Subject: Re: svn commit: r249921 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys References: <201304261124.r3QBOKIO042913@svn.freebsd.org> In-Reply-To: <201304261124.r3QBOKIO042913@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 20:02:06 -0000 This can not be MFC'd, it breaks API. Using a sysctl proc (or analogous method) to preserve the old sysctl mib would suffice. -Alfred On 4/26/13 4:24 AM, Steven Hartland wrote: > Author: smh > Date: Fri Apr 26 11:24:20 2013 > New Revision: 249921 > URL: http://svnweb.freebsd.org/changeset/base/249921 > > Log: > Changed ZFS TRIM sysctl from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled > Enabled ZFS TRIM by default > > Reviewed by: pjd (mentor) > Approved by: pjd (mentor) > MFC after: 2 weeks > > Modified: > head/UPDATING > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Fri Apr 26 07:00:49 2013 (r249920) > +++ head/UPDATING Fri Apr 26 11:24:20 2013 (r249921) > @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20130426: > + The sysctl which controls TRIM support under ZFS has been renamed > + from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been > + enabled by default. > + > 20130425: > The mergemaster command now uses the default MAKEOBJDIRPREFIX > rather than creating it's own in the temporary directory in > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 07:00:49 2013 (r249920) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 11:24:20 2013 (r249921) > @@ -46,7 +46,7 @@ typedef enum vdev_dtl_type { > } vdev_dtl_type_t; > > extern boolean_t zfs_nocacheflush; > -extern boolean_t zfs_notrim; > +extern boolean_t zfs_trim_enabled; > > extern int vdev_open(vdev_t *); > extern void vdev_open_children(vdev_t *); > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 07:00:49 2013 (r249920) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 11:24:20 2013 (r249921) > @@ -72,7 +72,7 @@ typedef struct trim_seg { > hrtime_t ts_time; /* Segment creation time. */ > } trim_seg_t; > > -extern boolean_t zfs_notrim; > +extern boolean_t zfs_trim_enabled; > > static u_int trim_txg_delay = 32; > static u_int trim_timeout = 30; > @@ -157,7 +157,7 @@ trim_map_create(vdev_t *vd) > > ASSERT(vd->vdev_ops->vdev_op_leaf); > > - if (zfs_notrim) > + if (!zfs_trim_enabled) > return; > > tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); > @@ -183,7 +183,7 @@ trim_map_destroy(vdev_t *vd) > > ASSERT(vd->vdev_ops->vdev_op_leaf); > > - if (zfs_notrim) > + if (!zfs_trim_enabled) > return; > > tm = vd->vdev_trimmap; > @@ -340,7 +340,7 @@ trim_map_free(vdev_t *vd, uint64_t offse > { > trim_map_t *tm = vd->vdev_trimmap; > > - if (zfs_notrim || vd->vdev_notrim || tm == NULL) > + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) > return; > > mutex_enter(&tm->tm_lock); > @@ -357,7 +357,7 @@ trim_map_write_start(zio_t *zio) > boolean_t left_over, right_over; > uint64_t start, end; > > - if (zfs_notrim || vd->vdev_notrim || tm == NULL) > + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) > return (B_TRUE); > > start = zio->io_offset; > @@ -404,7 +404,7 @@ trim_map_write_done(zio_t *zio) > * Don't check for vdev_notrim, since the write could have > * started before vdev_notrim was set. > */ > - if (zfs_notrim || tm == NULL) > + if (!zfs_trim_enabled || tm == NULL) > return; > > mutex_enter(&tm->tm_lock); > @@ -589,7 +589,7 @@ void > trim_thread_create(spa_t *spa) > { > > - if (zfs_notrim) > + if (!zfs_trim_enabled) > return; > > mutex_init(&spa->spa_trim_lock, NULL, MUTEX_DEFAULT, NULL); > @@ -604,7 +604,7 @@ void > trim_thread_destroy(spa_t *spa) > { > > - if (zfs_notrim) > + if (!zfs_trim_enabled) > return; > if (spa->spa_trim_thread == NULL) > return; > @@ -627,7 +627,7 @@ void > trim_thread_wakeup(spa_t *spa) > { > > - if (zfs_notrim) > + if (!zfs_trim_enabled) > return; > if (spa->spa_trim_thread == NULL) > return; > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 07:00:49 2013 (r249920) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 11:24:20 2013 (r249921) > @@ -729,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt > * Don't TRIM if removing so that we don't interfere with zpool > * disaster recovery. > */ > - if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || > + if (zfs_trim_enabled && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || > reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) > zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 07:00:49 2013 (r249920) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 11:24:20 2013 (r249921) > @@ -83,10 +83,11 @@ boolean_t zfs_nocacheflush = B_FALSE; > TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); > SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, > &zfs_nocacheflush, 0, "Disable cache flush"); > -boolean_t zfs_notrim = B_TRUE; > -TUNABLE_INT("vfs.zfs.trim_disable", &zfs_notrim); > -SYSCTL_INT(_vfs_zfs, OID_AUTO, trim_disable, CTLFLAG_RDTUN, &zfs_notrim, 0, > - "Disable trim"); > +boolean_t zfs_trim_enabled = B_TRUE; > +SYSCTL_DECL(_vfs_zfs_trim); > +TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); > +SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, > + "Enable ZFS TRIM"); > > static kmem_cache_t *zil_lwb_cache; > > From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 21:19:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CFB93A44; Fri, 26 Apr 2013 21:19:05 +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 C01731E70; Fri, 26 Apr 2013 21:19: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 r3QLJ59x054985; Fri, 26 Apr 2013 21:19:05 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QLJ5pW054983; Fri, 26 Apr 2013 21:19:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304262119.r3QLJ5pW054983@svn.freebsd.org> From: Devin Teske Date: Fri, 26 Apr 2013 21:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249954 - in head/usr.sbin/bsdconfig: share startup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 21:19:05 -0000 Author: dteske Date: Fri Apr 26 21:19:05 2013 New Revision: 249954 URL: http://svnweb.freebsd.org/changeset/base/249954 Log: Comments. Modified: head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/startup/rcdelete Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Apr 26 21:07:27 2013 (r249953) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Apr 26 21:19:05 2013 (r249954) @@ -639,7 +639,7 @@ f_device_menu() [ $retval -ne 2 ] && break # Otherwise, the Help button was pressed f_show_help "$helpfile" - # Loop back to menu + # ...then loop back to menu done f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Apr 26 21:07:27 2013 (r249953) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Apr 26 21:19:05 2013 (r249954) @@ -289,6 +289,8 @@ dialog_menu_confirm_delete() --menu \"\$prompt\" $size \ $menu_list \ 2> /dev/null + + # Menu choice ignored; status of above command returned } ############################################################ MAIN From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 21:28:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB67DD40; Fri, 26 Apr 2013 21:28:25 +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 9E9421EDA; Fri, 26 Apr 2013 21:28: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 r3QLSPq0058314; Fri, 26 Apr 2013 21:28:25 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QLSPaI058312; Fri, 26 Apr 2013 21:28:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304262128.r3QLSPaI058312@svn.freebsd.org> From: Devin Teske Date: Fri, 26 Apr 2013 21:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249955 - in head/usr.sbin/bsdconfig/share: . media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 21:28:25 -0000 Author: dteske Date: Fri Apr 26 21:28:24 2013 New Revision: 249955 URL: http://svnweb.freebsd.org/changeset/base/249955 Log: Properly sanitize --menu results (guards against Gtk library warnings from X11 side of things from bleeding into Xdialog(1) stderr output). It should be duely noted that such errors are not a by-product of anything in the Xdialog(1) utility or API, but optional libraries that it can link against (such as Gtk1 versus Gtk2; if you compile xdialog from ports against Gtk2 AND misconfigure your fonts or generally make Gtk2 unhappy, these warning messages can bleed into the captured stderr -- that is we we sanitize!). Modified: head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Apr 26 21:19:05 2013 (r249954) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Apr 26 21:28:24 2013 (r249955) @@ -645,7 +645,12 @@ f_device_menu() [ "$errexit" ] && set -e - [ $retval -eq 0 ] && echo "$mtag" >&2 + if [ $retval -eq 0 ]; then + # Clean up the output of [X]dialog(1) and return it + setvar DIALOG_MENU_$$ "$mtag" + mtag=$( f_dialog_menutag ) + echo "$mtag" >&2 + fi return $retval } Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Fri Apr 26 21:19:05 2013 (r249954) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Fri Apr 26 21:28:24 2013 (r249955) @@ -1399,6 +1399,8 @@ f_device_dialog_tcp() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? + setvar DIALOG_MENU_$$ "$cp" + cp=$( f_dialog_menutag ) f_dprintf "retval=%u mtag=[%s]" $retval "$cp" if [ $retval -eq 2 ]; then From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 21:43:43 2013 Return-Path: Delivered-To: svn-src-head@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 54F31169; Fri, 26 Apr 2013 21:43:43 +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 480EA1FCF; Fri, 26 Apr 2013 21:43: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 r3QLhhEx064176; Fri, 26 Apr 2013 21:43:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QLhhQB064175; Fri, 26 Apr 2013 21:43:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304262143.r3QLhhQB064175@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 26 Apr 2013 21:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249956 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 21:43:43 -0000 Author: jilles Date: Fri Apr 26 21:43:42 2013 New Revision: 249956 URL: http://svnweb.freebsd.org/changeset/base/249956 Log: sysconf(3): Correct the description of _SC_OPEN_MAX. Reported by: bde MFC after: 1 week Modified: head/lib/libc/gen/sysconf.3 Modified: head/lib/libc/gen/sysconf.3 ============================================================================== --- head/lib/libc/gen/sysconf.3 Fri Apr 26 21:28:24 2013 (r249955) +++ head/lib/libc/gen/sysconf.3 Fri Apr 26 21:43:42 2013 (r249956) @@ -28,7 +28,7 @@ .\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 13, 2011 +.Dd April 26, 2013 .Dt SYSCONF 3 .Os .Sh NAME @@ -82,7 +82,7 @@ The number of processors configured. .It Li _SC_NPROCESSORS_ONLN The number of processors currently online. .It Li _SC_OPEN_MAX -The maximum number of open files per user id. +One more than the maximum value the system may assign to a new file descriptor. .It Li _SC_PAGESIZE The size of a system page in bytes. .It Li _SC_PAGE_SIZE From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 21:48:19 2013 Return-Path: Delivered-To: svn-src-head@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 BD09F366; Fri, 26 Apr 2013 21:48:19 +0000 (UTC) (envelope-from prvs=1828e49ea6=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 05A9A1013; Fri, 26 Apr 2013 21:48:18 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003502721.msg; Fri, 26 Apr 2013 22:48:09 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Fri, 26 Apr 2013 22:48:09 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=1828e49ea6=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <00968EEBD1CA46928DCBDEB106664F22@multiplay.co.uk> From: "Steven Hartland" To: "Alfred Perlstein" References: <201304261124.r3QBOKIO042913@svn.freebsd.org> <517ADB77.9040203@mu.org> Subject: Re: svn commit: r249921 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Date: Fri, 26 Apr 2013 22:48:38 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 21:48:19 -0000 The entire ZFS TRIM work is only is on in current ATM so I assume this wont actually be an issue? Regards Steve ----- Original Message ----- From: "Alfred Perlstein" To: "Steven Hartland" Cc: ; ; Sent: Friday, April 26, 2013 8:54 PM Subject: Re: svn commit: r249921 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > > This can not be MFC'd, it breaks API. > > Using a sysctl proc (or analogous method) to preserve the old sysctl mib would suffice. > > -Alfred > > On 4/26/13 4:24 AM, Steven Hartland wrote: >> Author: smh >> Date: Fri Apr 26 11:24:20 2013 >> New Revision: 249921 >> URL: http://svnweb.freebsd.org/changeset/base/249921 >> >> Log: >> Changed ZFS TRIM sysctl from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled >> Enabled ZFS TRIM by default >> Reviewed by: pjd (mentor) >> Approved by: pjd (mentor) >> MFC after: 2 weeks >> >> Modified: >> head/UPDATING >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >> >> Modified: head/UPDATING >> ============================================================================== >> --- head/UPDATING Fri Apr 26 07:00:49 2013 (r249920) >> +++ head/UPDATING Fri Apr 26 11:24:20 2013 (r249921) >> @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 >> disable the most expensive debugging functionality run >> "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> +20130426: >> + The sysctl which controls TRIM support under ZFS has been renamed >> + from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been >> + enabled by default. >> + >> 20130425: >> The mergemaster command now uses the default MAKEOBJDIRPREFIX >> rather than creating it's own in the temporary directory in >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 07:00:49 2013 (r249920) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Fri Apr 26 11:24:20 2013 (r249921) >> @@ -46,7 +46,7 @@ typedef enum vdev_dtl_type { >> } vdev_dtl_type_t; >> extern boolean_t zfs_nocacheflush; >> -extern boolean_t zfs_notrim; >> +extern boolean_t zfs_trim_enabled; >> extern int vdev_open(vdev_t *); >> extern void vdev_open_children(vdev_t *); >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 07:00:49 2013 (r249920) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri Apr 26 11:24:20 2013 (r249921) >> @@ -72,7 +72,7 @@ typedef struct trim_seg { >> hrtime_t ts_time; /* Segment creation time. */ >> } trim_seg_t; >> -extern boolean_t zfs_notrim; >> +extern boolean_t zfs_trim_enabled; >> static u_int trim_txg_delay = 32; >> static u_int trim_timeout = 30; >> @@ -157,7 +157,7 @@ trim_map_create(vdev_t *vd) >> ASSERT(vd->vdev_ops->vdev_op_leaf); >> - if (zfs_notrim) >> + if (!zfs_trim_enabled) >> return; >> tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); >> @@ -183,7 +183,7 @@ trim_map_destroy(vdev_t *vd) >> ASSERT(vd->vdev_ops->vdev_op_leaf); >> - if (zfs_notrim) >> + if (!zfs_trim_enabled) >> return; >> tm = vd->vdev_trimmap; >> @@ -340,7 +340,7 @@ trim_map_free(vdev_t *vd, uint64_t offse >> { >> trim_map_t *tm = vd->vdev_trimmap; >> - if (zfs_notrim || vd->vdev_notrim || tm == NULL) >> + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) >> return; >> mutex_enter(&tm->tm_lock); >> @@ -357,7 +357,7 @@ trim_map_write_start(zio_t *zio) >> boolean_t left_over, right_over; >> uint64_t start, end; >> - if (zfs_notrim || vd->vdev_notrim || tm == NULL) >> + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) >> return (B_TRUE); >> start = zio->io_offset; >> @@ -404,7 +404,7 @@ trim_map_write_done(zio_t *zio) >> * Don't check for vdev_notrim, since the write could have >> * started before vdev_notrim was set. >> */ >> - if (zfs_notrim || tm == NULL) >> + if (!zfs_trim_enabled || tm == NULL) >> return; >> mutex_enter(&tm->tm_lock); >> @@ -589,7 +589,7 @@ void >> trim_thread_create(spa_t *spa) >> { >> - if (zfs_notrim) >> + if (!zfs_trim_enabled) >> return; >> mutex_init(&spa->spa_trim_lock, NULL, MUTEX_DEFAULT, NULL); >> @@ -604,7 +604,7 @@ void >> trim_thread_destroy(spa_t *spa) >> { >> - if (zfs_notrim) >> + if (!zfs_trim_enabled) >> return; >> if (spa->spa_trim_thread == NULL) >> return; >> @@ -627,7 +627,7 @@ void >> trim_thread_wakeup(spa_t *spa) >> { >> - if (zfs_notrim) >> + if (!zfs_trim_enabled) >> return; >> if (spa->spa_trim_thread == NULL) >> return; >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 07:00:49 2013 (r249920) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Apr 26 11:24:20 2013 (r249921) >> @@ -729,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt >> * Don't TRIM if removing so that we don't interfere with zpool >> * disaster recovery. >> */ >> - if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || >> + if (zfs_trim_enabled && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || >> reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) >> zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 07:00:49 2013 (r249920) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Apr 26 11:24:20 2013 (r249921) >> @@ -83,10 +83,11 @@ boolean_t zfs_nocacheflush = B_FALSE; >> TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); >> SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, >> &zfs_nocacheflush, 0, "Disable cache flush"); >> -boolean_t zfs_notrim = B_TRUE; >> -TUNABLE_INT("vfs.zfs.trim_disable", &zfs_notrim); >> -SYSCTL_INT(_vfs_zfs, OID_AUTO, trim_disable, CTLFLAG_RDTUN, &zfs_notrim, 0, >> - "Disable trim"); >> +boolean_t zfs_trim_enabled = B_TRUE; >> +SYSCTL_DECL(_vfs_zfs_trim); >> +TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); >> +SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, >> + "Enable ZFS TRIM"); >> static kmem_cache_t *zil_lwb_cache; >> > > ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 21:51:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7DFBE65E; Fri, 26 Apr 2013 21:51:18 +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 7027B1041; Fri, 26 Apr 2013 21:51: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 r3QLpIjG067189; Fri, 26 Apr 2013 21:51:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QLpIUD067188; Fri, 26 Apr 2013 21:51:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304262151.r3QLpIUD067188@svn.freebsd.org> From: Adrian Chadd Date: Fri, 26 Apr 2013 21:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249957 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 21:51:18 -0000 Author: adrian Date: Fri Apr 26 21:51:17 2013 New Revision: 249957 URL: http://svnweb.freebsd.org/changeset/base/249957 Log: Dump the entire TXQ descriptor contents during a reset, rather than only completed descriptors. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 26 21:43:42 2013 (r249956) +++ head/sys/dev/ath/if_ath.c Fri Apr 26 21:51:17 2013 (r249957) @@ -4500,6 +4500,30 @@ ath_stoptxdma(struct ath_softc *sc) return 1; } +static void +ath_tx_dump(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + int i = 0; + + if (! (sc->sc_debug & ATH_DEBUG_RESET)) + return; + + ATH_TX_LOCK_ASSERT(sc); + + device_printf(sc->sc_dev, "%s: Q%d: begin\n", + __func__, txq->axq_qnum); + TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { + ath_printtxbuf(sc, bf, txq->axq_qnum, i, + ath_hal_txprocdesc(ah, bf->bf_lastds, + &bf->bf_status.ds_txstat) == HAL_OK); + i++; + } + device_printf(sc->sc_dev, "%s: Q%d: end\n", + __func__, txq->axq_qnum); +} + /* * Drain the transmit queues and reclaim resources. */ @@ -4514,12 +4538,17 @@ ath_legacy_tx_drain(struct ath_softc *sc (void) ath_stoptxdma(sc); + /* + * Dump the queue contents + */ for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { /* * XXX TODO: should we just handle the completed TX frames * here, whether or not the reset is a full one or not? */ if (ATH_TXQ_SETUP(sc, i)) { + if (sc->sc_debug & ATH_DEBUG_RESET) + ath_tx_dump(sc, &sc->sc_txq[i]); if (reset_type == ATH_RESET_NOLOSS) ath_tx_processq(sc, &sc->sc_txq[i], 0); else From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 22:02:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 670E88B7; Fri, 26 Apr 2013 22:02:28 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 53EFE1097; Fri, 26 Apr 2013 22:02:27 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id EC6451A3C20; Fri, 26 Apr 2013 15:02:25 -0700 (PDT) Message-ID: <517AF964.80104@mu.org> Date: Fri, 26 Apr 2013 15:02:12 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Steven Hartland Subject: Re: svn commit: r249921 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys References: <201304261124.r3QBOKIO042913@svn.freebsd.org> <517ADB77.9040203@mu.org> <00968EEBD1CA46928DCBDEB106664F22@multiplay.co.uk> In-Reply-To: <00968EEBD1CA46928DCBDEB106664F22@multiplay.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 22:02:28 -0000 On 4/26/13 2:48 PM, Steven Hartland wrote: > The entire ZFS TRIM work is only is on in current ATM so I assume this > wont actually be an issue? Yes, that makes sense. I misunderstood that the change was a rename that was going to make it into -stable. thanks, -Alfred > > Regards > Steve > ----- Original Message ----- From: "Alfred Perlstein" > To: "Steven Hartland" > Cc: ; ; > > Sent: Friday, April 26, 2013 8:54 PM > Subject: Re: svn commit: r249921 - in head: . > sys/cddl/contrib/opensolaris/uts/common/fs/zfs > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > > >> >> This can not be MFC'd, it breaks API. >> >> Using a sysctl proc (or analogous method) to preserve the old sysctl >> mib would suffice. >> >> -Alfred >> >> On 4/26/13 4:24 AM, Steven Hartland wrote: >>> Author: smh >>> Date: Fri Apr 26 11:24:20 2013 >>> New Revision: 249921 >>> URL: http://svnweb.freebsd.org/changeset/base/249921 >>> >>> Log: >>> Changed ZFS TRIM sysctl from vfs.zfs.trim_disable -> >>> vfs.zfs.trim.enabled >>> Enabled ZFS TRIM by default >>> Reviewed by: pjd (mentor) >>> Approved by: pjd (mentor) >>> MFC after: 2 weeks >>> >>> Modified: >>> head/UPDATING >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >>> >>> Modified: head/UPDATING >>> ============================================================================== >>> >>> --- head/UPDATING Fri Apr 26 07:00:49 2013 (r249920) >>> +++ head/UPDATING Fri Apr 26 11:24:20 2013 (r249921) >>> @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 >>> disable the most expensive debugging functionality run >>> "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >>> +20130426: >>> + The sysctl which controls TRIM support under ZFS has been renamed >>> + from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been >>> + enabled by default. >>> + >>> 20130425: >>> The mergemaster command now uses the default MAKEOBJDIRPREFIX >>> rather than creating it's own in the temporary directory in >>> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >>> ============================================================================== >>> >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >>> Fri Apr 26 07:00:49 2013 (r249920) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h >>> Fri Apr 26 11:24:20 2013 (r249921) >>> @@ -46,7 +46,7 @@ typedef enum vdev_dtl_type { >>> } vdev_dtl_type_t; >>> extern boolean_t zfs_nocacheflush; >>> -extern boolean_t zfs_notrim; >>> +extern boolean_t zfs_trim_enabled; >>> extern int vdev_open(vdev_t *); >>> extern void vdev_open_children(vdev_t *); >>> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >>> ============================================================================== >>> >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >>> Fri Apr 26 07:00:49 2013 (r249920) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c >>> Fri Apr 26 11:24:20 2013 (r249921) >>> @@ -72,7 +72,7 @@ typedef struct trim_seg { >>> hrtime_t ts_time; /* Segment creation time. */ >>> } trim_seg_t; >>> -extern boolean_t zfs_notrim; >>> +extern boolean_t zfs_trim_enabled; >>> static u_int trim_txg_delay = 32; >>> static u_int trim_timeout = 30; >>> @@ -157,7 +157,7 @@ trim_map_create(vdev_t *vd) >>> ASSERT(vd->vdev_ops->vdev_op_leaf); >>> - if (zfs_notrim) >>> + if (!zfs_trim_enabled) >>> return; >>> tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); >>> @@ -183,7 +183,7 @@ trim_map_destroy(vdev_t *vd) >>> ASSERT(vd->vdev_ops->vdev_op_leaf); >>> - if (zfs_notrim) >>> + if (!zfs_trim_enabled) >>> return; >>> tm = vd->vdev_trimmap; >>> @@ -340,7 +340,7 @@ trim_map_free(vdev_t *vd, uint64_t offse >>> { >>> trim_map_t *tm = vd->vdev_trimmap; >>> - if (zfs_notrim || vd->vdev_notrim || tm == NULL) >>> + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) >>> return; >>> mutex_enter(&tm->tm_lock); >>> @@ -357,7 +357,7 @@ trim_map_write_start(zio_t *zio) >>> boolean_t left_over, right_over; >>> uint64_t start, end; >>> - if (zfs_notrim || vd->vdev_notrim || tm == NULL) >>> + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) >>> return (B_TRUE); >>> start = zio->io_offset; >>> @@ -404,7 +404,7 @@ trim_map_write_done(zio_t *zio) >>> * Don't check for vdev_notrim, since the write could have >>> * started before vdev_notrim was set. >>> */ >>> - if (zfs_notrim || tm == NULL) >>> + if (!zfs_trim_enabled || tm == NULL) >>> return; >>> mutex_enter(&tm->tm_lock); >>> @@ -589,7 +589,7 @@ void >>> trim_thread_create(spa_t *spa) >>> { >>> - if (zfs_notrim) >>> + if (!zfs_trim_enabled) >>> return; >>> mutex_init(&spa->spa_trim_lock, NULL, MUTEX_DEFAULT, NULL); >>> @@ -604,7 +604,7 @@ void >>> trim_thread_destroy(spa_t *spa) >>> { >>> - if (zfs_notrim) >>> + if (!zfs_trim_enabled) >>> return; >>> if (spa->spa_trim_thread == NULL) >>> return; >>> @@ -627,7 +627,7 @@ void >>> trim_thread_wakeup(spa_t *spa) >>> { >>> - if (zfs_notrim) >>> + if (!zfs_trim_enabled) >>> return; >>> if (spa->spa_trim_thread == NULL) >>> return; >>> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >>> ============================================================================== >>> >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >>> Fri Apr 26 07:00:49 2013 (r249920) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >>> Fri Apr 26 11:24:20 2013 (r249921) >>> @@ -729,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt >>> * Don't TRIM if removing so that we don't interfere with zpool >>> * disaster recovery. >>> */ >>> - if (!zfs_notrim && vdev_trim_on_init && (reason == >>> VDEV_LABEL_CREATE || >>> + if (zfs_trim_enabled && vdev_trim_on_init && (reason == >>> VDEV_LABEL_CREATE || >>> reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) >>> zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); >>> >>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >>> ============================================================================== >>> >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri >>> Apr 26 07:00:49 2013 (r249920) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri >>> Apr 26 11:24:20 2013 (r249921) >>> @@ -83,10 +83,11 @@ boolean_t zfs_nocacheflush = B_FALSE; >>> TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); >>> SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, >>> &zfs_nocacheflush, 0, "Disable cache flush"); >>> -boolean_t zfs_notrim = B_TRUE; >>> -TUNABLE_INT("vfs.zfs.trim_disable", &zfs_notrim); >>> -SYSCTL_INT(_vfs_zfs, OID_AUTO, trim_disable, CTLFLAG_RDTUN, >>> &zfs_notrim, 0, >>> - "Disable trim"); >>> +boolean_t zfs_trim_enabled = B_TRUE; >>> +SYSCTL_DECL(_vfs_zfs_trim); >>> +TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); >>> +SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, >>> &zfs_trim_enabled, 0, >>> + "Enable ZFS TRIM"); >>> static kmem_cache_t *zil_lwb_cache; >>> >> >> > > > ================================================ > This e.mail is private and confidential between Multiplay (UK) Ltd. > and the person or entity to whom it is addressed. In the event of > misdirection, the recipient is prohibited from using, copying, > printing or otherwise disseminating it or any information contained in > it. > In the event of misdirection, illegible or incomplete transmission > please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. > From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 22:22:39 2013 Return-Path: Delivered-To: svn-src-head@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 41A26E89; Fri, 26 Apr 2013 22:22:39 +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 342C91159; Fri, 26 Apr 2013 22:22: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 r3QMMd7p078263; Fri, 26 Apr 2013 22:22:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QMMdaB078262; Fri, 26 Apr 2013 22:22:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304262222.r3QMMdaB078262@svn.freebsd.org> From: Adrian Chadd Date: Fri, 26 Apr 2013 22:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249958 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 22:22:39 -0000 Author: adrian Date: Fri Apr 26 22:22:38 2013 New Revision: 249958 URL: http://svnweb.freebsd.org/changeset/base/249958 Log: Conditionally compile this only if ATH_DEBUG is defined. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 26 21:51:17 2013 (r249957) +++ head/sys/dev/ath/if_ath.c Fri Apr 26 22:22:38 2013 (r249958) @@ -4500,6 +4500,7 @@ ath_stoptxdma(struct ath_softc *sc) return 1; } +#ifdef ATH_DEBUG static void ath_tx_dump(struct ath_softc *sc, struct ath_txq *txq) { @@ -4523,6 +4524,7 @@ ath_tx_dump(struct ath_softc *sc, struct device_printf(sc->sc_dev, "%s: Q%d: end\n", __func__, txq->axq_qnum); } +#endif /* ATH_DEBUG */ /* * Drain the transmit queues and reclaim resources. @@ -4547,8 +4549,10 @@ ath_legacy_tx_drain(struct ath_softc *sc * here, whether or not the reset is a full one or not? */ if (ATH_TXQ_SETUP(sc, i)) { +#ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) ath_tx_dump(sc, &sc->sc_txq[i]); +#endif /* ATH_DEBUG */ if (reset_type == ATH_RESET_NOLOSS) ath_tx_processq(sc, &sc->sc_txq[i], 0); else From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 23:24:42 2013 Return-Path: Delivered-To: svn-src-head@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 3C02381E; Fri, 26 Apr 2013 23:24:42 +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 2CC4D131B; Fri, 26 Apr 2013 23:24: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 r3QNOgph099441; Fri, 26 Apr 2013 23:24:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3QNOfIk099439; Fri, 26 Apr 2013 23:24:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304262324.r3QNOfIk099439@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Apr 2013 23:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249959 - in head: share/mk tools/build/options tools/tools/sysbuild X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 23:24:42 -0000 Author: eadler Date: Fri Apr 26 23:24:41 2013 New Revision: 249959 URL: http://svnweb.freebsd.org/changeset/base/249959 Log: Remove the WITH_IDEA option and build it unconditionally. The European version of the patent expired in 2011. The US version of the patent expired in 2012 or prior. Reviewed by: des No objection from: cperciva, ehaupt Deleted: head/tools/build/options/WITH_IDEA Modified: head/share/mk/bsd.own.mk head/tools/tools/sysbuild/sysbuild.sh Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 26 22:22:38 2013 (r249958) +++ head/share/mk/bsd.own.mk Fri Apr 26 23:24:41 2013 (r249959) @@ -230,9 +230,6 @@ WITHOUT_${var}= .if defined(YES_HESIOD) WITH_HESIOD= .endif -.if defined(MAKE_IDEA) -WITH_IDEA= -.endif __DEFAULT_YES_OPTIONS = \ ACCT \ @@ -369,7 +366,6 @@ __DEFAULT_NO_OPTIONS = \ GPL_DTC \ HESIOD \ ICONV \ - IDEA \ INSTALL_AS_USER \ LDNS_UTILS \ NMTREE \ Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Fri Apr 26 22:22:38 2013 (r249958) +++ head/tools/tools/sysbuild/sysbuild.sh Fri Apr 26 23:24:41 2013 (r249959) @@ -91,7 +91,7 @@ SERCONS=false PORTS_WE_WANT=' ' -PORTS_OPTS="BATCH=YES MAKE_IDEA=YES A4=yes" +PORTS_OPTS="BATCH=YES A4=yes" CONFIGFILES=' ' From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 23:27:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B3A6A90; Fri, 26 Apr 2013 23:27:28 +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 30603132A; Fri, 26 Apr 2013 23:27:28 +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 D0BD123F804; Fri, 26 Apr 2013 19:27:26 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.2 onyx.glenbarber.us D0BD123F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 26 Apr 2013 19:27:24 -0400 From: Glen Barber To: Eitan Adler Subject: Re: svn commit: r249959 - in head: share/mk tools/build/options tools/tools/sysbuild Message-ID: <20130426232724.GB1611@glenbarber.us> References: <201304262324.r3QNOfIk099439@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hQiwHBbRI9kgIhsi" Content-Disposition: inline In-Reply-To: <201304262324.r3QNOfIk099439@svn.freebsd.org> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 23:27:28 -0000 --hQiwHBbRI9kgIhsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2013 at 11:24:41PM +0000, Eitan Adler wrote: > Author: eadler > Date: Fri Apr 26 23:24:41 2013 > New Revision: 249959 > URL: http://svnweb.freebsd.org/changeset/base/249959 >=20 > Log: > Remove the WITH_IDEA option and build it unconditionally. > The European version of the patent expired in 2011. > The US version of the patent expired in 2012 or prior. > =20 Please update src.conf(5). Glen --hQiwHBbRI9kgIhsi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRew1cAAoJEFJPDDeguUaj8rgH/17aTDyenxGJRnAlGcV6+6eS G+z5HJ3EEdCahxn6PG1gSRY52hRfAwhgsrmsy/ya77TfxaZv66iOu0eCSaJZqwxx 0wdyRMxotnj9dntSbK1kJrs3VGyTS/3CYpPvihGGSUtvER6MZqtq0a5dSvbBh3mI fdyqu02zexCsaqS5moL+Hg8XD88SoIG7MAtc8/y9d9HQI4rYcU1AuXE2qpjgwZTO CCrSTmbzX+clNPE7L5Y8ZbYsCGGJr/gcS1pWteejNYg3nxyOVyK4qIRUjRA4Gb/z tLkLgulO1Px0M1bXPtPVrYXAPWv/cbtY4cC0s2Gl5WQ7MhT77MkJLUIKbbBnEXQ= =yKUu -----END PGP SIGNATURE----- --hQiwHBbRI9kgIhsi-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 23:30:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60EDBC5E; Fri, 26 Apr 2013 23:30:48 +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 389A6133E; Fri, 26 Apr 2013 23:30:48 +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 5E51823F804; Fri, 26 Apr 2013 19:30:43 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.2 onyx.glenbarber.us 5E51823F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 26 Apr 2013 19:30:36 -0400 From: Glen Barber To: Eitan Adler Subject: Re: svn commit: r249959 - in head: share/mk tools/build/options tools/tools/sysbuild Message-ID: <20130426233036.GC1611@glenbarber.us> References: <201304262324.r3QNOfIk099439@svn.freebsd.org> <20130426232724.GB1611@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5QAgd0e35j3NYeGe" Content-Disposition: inline In-Reply-To: <20130426232724.GB1611@glenbarber.us> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 23:30:48 -0000 --5QAgd0e35j3NYeGe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2013 at 07:27:24PM -0400, Glen Barber wrote: > On Fri, Apr 26, 2013 at 11:24:41PM +0000, Eitan Adler wrote: > > Author: eadler > > Date: Fri Apr 26 23:24:41 2013 > > New Revision: 249959 > > URL: http://svnweb.freebsd.org/changeset/base/249959 > >=20 > > Log: > > Remove the WITH_IDEA option and build it unconditionally. > > The European version of the patent expired in 2011. > > The US version of the patent expired in 2012 or prior. > > =20 >=20 > Please update src.conf(5). >=20 Please also update tools/build/mk/OptionalObsoleteFiles.inc. Glen --5QAgd0e35j3NYeGe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRew4cAAoJEFJPDDeguUajM/kH/REN28Qol4cIPos637VErj8N e7roWQRL3az/MyfuDf6SUAhNKg7LikvMpwlL98MhelNQ+6koB3Q+EabtB9BHxZ5F 9aMDXaQgawsqbSbYrZSSMtop1XbNCDpdSmxl9dvozLalgpdJVo4wu3CIJ0IhJhvp xeOXpq5Fb6kSLMS/BCYmqH6WfgBsPg3uAGFq2ls9N7tqK2NVqwmqtSsd0NxtfAAQ WPg2CazQSipmfeLkY93fF8OkOet59xSkCZr9U2+q7H+8dIGXBDwzXtvvVmFwfrhu zcm1Pq5aVU27HDsgQdGVVRY5FyMDCXkhboU402MmCVNOgDjRx4MA7U855ENF2vs= =f3ro -----END PGP SIGNATURE----- --5QAgd0e35j3NYeGe-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 26 23:33:12 2013 Return-Path: Delivered-To: svn-src-head@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 5C83EE83 for ; Fri, 26 Apr 2013 23:33:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com [IPv6:2607:f8b0:400e:c01::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 36615136D for ; Fri, 26 Apr 2013 23:33:12 +0000 (UTC) Received: by mail-pb0-f44.google.com with SMTP id wz17so1304725pbc.31 for ; Fri, 26 Apr 2013 16:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Fkn6UwuhWqHFulZIMvnH6ENFYSO/2dpig6kEv2mFkPs=; b=ZWv2Rm5L8UhNZBNZjR96tHUaGa9uZ3rh9JLCIAzoAMVaob7Q8IwYYc4fyXiJzZD34I 9p05L+Fnjv88NhU3tL7xgLY9mCGDhoALkD8XF8lTy0+ovsvjz4nY1OL0lu4rfdJLtftf c/GRMNs1f8Vt2FrKn7n5n0zOvREU5NhuuWOQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received: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=Fkn6UwuhWqHFulZIMvnH6ENFYSO/2dpig6kEv2mFkPs=; b=aeQdWyUXGxsK6ohHrzY//VQguIngEWVg3dPSvu9CuxFWB6dWDICYwHfyZvJtXuHSMu sAT18VSuHNAJ8Xoep1unxCMu0zUQD7twX9sLfp5RlPH1wqllQAlLSSQLumTTQssB/qtd WnFu1HNMBSg1uRqmBjXiOdh90fr22t+6cuF0Lkb+r6pyXd8hgUhonVsHEUDAKJ6xoDM3 gmMd2iahKCnkmIDNmEPLmfryLag5PztaUWAsgFUZiXy3KlHVTdIh0JqQvkzK0CuQLLZe bCn1OCbEfYSPTLVSdqa91arsFtVqmKngE5y7pnVolmjTZsiGI2/sOHxKR30gIeumvRr3 QsZA== X-Received: by 10.66.102.65 with SMTP id fm1mr48596748pab.164.1367019191843; Fri, 26 Apr 2013 16:33:11 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 26 Apr 2013 16:32:41 -0700 (PDT) In-Reply-To: <20130426232724.GB1611@glenbarber.us> References: <201304262324.r3QNOfIk099439@svn.freebsd.org> <20130426232724.GB1611@glenbarber.us> From: Eitan Adler Date: Fri, 26 Apr 2013 19:32:41 -0400 X-Google-Sender-Auth: 0QdwK5hs-kJl_bRO0Ku-sgOxtrA Message-ID: Subject: Re: svn commit: r249959 - in head: share/mk tools/build/options tools/tools/sysbuild To: Glen Barber Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlj89+L/JtpGfoxsK/80wNaiIIcul2P+x3jqXin3cQdhB6TeCvbBPwBJ55E2V5FQsEEoQ0s Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 23:33:12 -0000 On 26 April 2013 19:27, Glen Barber wrote: > On Fri, Apr 26, 2013 at 11:24:41PM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Fri Apr 26 23:24:41 2013 >> New Revision: 249959 >> URL: http://svnweb.freebsd.org/changeset/base/249959 >> >> Log: >> Remove the WITH_IDEA option and build it unconditionally. >> The European version of the patent expired in 2011. >> The US version of the patent expired in 2012 or prior. >> > > Please update src.conf(5). I'm working on this now. Something got mangled on my end and I'm trying to work through some svn difficulties. On 26 April 2013 19:30, Glen Barber wrote: > On Fri, Apr 26, 2013 at 07:27:24PM -0400, Glen Barber wrote: >> On Fri, Apr 26, 2013 at 11:24:41PM +0000, Eitan Adler wrote: >> > Author: eadler >> > Date: Fri Apr 26 23:24:41 2013 >> > New Revision: 249959 >> > URL: http://svnweb.freebsd.org/changeset/base/249959 >> > >> > Log: >> > Remove the WITH_IDEA option and build it unconditionally. >> > The European version of the patent expired in 2011. >> > The US version of the patent expired in 2012 or prior. >> > >> >> Please update src.conf(5). >> > > Please also update tools/build/mk/OptionalObsoleteFiles.inc. And this -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 00:03:09 2013 Return-Path: Delivered-To: svn-src-head@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 20D7E3BA; Sat, 27 Apr 2013 00:03:09 +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 1366D14A9; Sat, 27 Apr 2013 00:03: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 r3R03857013132; Sat, 27 Apr 2013 00:03:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R038D0013130; Sat, 27 Apr 2013 00:03:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304270003.r3R038D0013130@svn.freebsd.org> From: Eitan Adler Date: Sat, 27 Apr 2013 00:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249960 - in head: . tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 00:03:09 -0000 Author: eadler Date: Sat Apr 27 00:03:07 2013 New Revision: 249960 URL: http://svnweb.freebsd.org/changeset/base/249960 Log: Remove IDEA from OptionalObsoleteFiles.inc Also add an UPDATING entry (requsted by gjb) Modified: head/UPDATING head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 26 23:24:41 2013 (r249959) +++ head/UPDATING Sat Apr 27 00:03:07 2013 (r249960) @@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20130426: + The WITHOUT_IDEA option has been removed because + the IDEA patent expired. + +20130426: The sysctl which controls TRIM support under ZFS has been renamed from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been enabled by default. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 26 23:24:41 2013 (r249959) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Apr 27 00:03:07 2013 (r249960) @@ -2220,10 +2220,6 @@ OLD_FILES+=usr/share/man/man5/hesiod.con # to be filled in #.endif -.if ${MK_IDEA} == no -OLD_FILES+=usr/include/openssl/idea.h -.endif - .if ${MK_INET6} == no OLD_FILES+=sbin/ping6 OLD_FILES+=sbin/rtsol From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 01:06:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 5FE7EDCE; Sat, 27 Apr 2013 01:06:28 +0000 (UTC) Date: Sat, 27 Apr 2013 01:06:28 +0000 From: Alexey Dokuchaev To: Steven Hartland Subject: Re: svn commit: r249930 - head/sys/geom Message-ID: <20130427010628.GA80130@FreeBSD.org> References: <201304261543.r3QFhOxU036016@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201304261543.r3QFhOxU036016@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 01:06:28 -0000 On Fri, Apr 26, 2013 at 03:43:24PM +0000, Steven Hartland wrote: > New Revision: 249930 > URL: http://svnweb.freebsd.org/changeset/base/249930 > > Log: > [...] > In tests on a Intel 520 120GB FW: 400i disk it improved the delete throughput > from 1.6GB/s to over 2.6GB/s on a full disk delete such as that done via > newfs -E > [...] > MFC after: 2 weeks Nice, Please don't forget about stable/8, thanks! ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 01:57:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 664E0449; Sat, 27 Apr 2013 01:57:46 +0000 (UTC) (envelope-from rpaulo@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 590AA1711; Sat, 27 Apr 2013 01:57: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 r3R1vkRC052597; Sat, 27 Apr 2013 01:57:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R1vkHQ052596; Sat, 27 Apr 2013 01:57:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304270157.r3R1vkHQ052596@svn.freebsd.org> From: Rui Paulo Date: Sat, 27 Apr 2013 01:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249965 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 01:57:46 -0000 Author: rpaulo Date: Sat Apr 27 01:57:45 2013 New Revision: 249965 URL: http://svnweb.freebsd.org/changeset/base/249965 Log: Fix the frambuffer issues by calling pmap_mapdev() in the attach routine. This will make the framebuffer region uncacheable and it will create a proper KVA -> RAM mapping. Modified: head/sys/powerpc/wii/wii_fb.c Modified: head/sys/powerpc/wii/wii_fb.c ============================================================================== --- head/sys/powerpc/wii/wii_fb.c Sat Apr 27 01:48:09 2013 (r249964) +++ head/sys/powerpc/wii/wii_fb.c Sat Apr 27 01:57:45 2013 (r249965) @@ -514,8 +514,12 @@ wiifb_configure(int flags) int progressive; sc = &wiifb_softc; - if (sc->sc_initialized) + if (sc->sc_initialized) { + /* XXX We should instead use bus_space */ + sc->sc_fb_addr = (intptr_t)pmap_mapdev(WIIFB_FB_ADDR, WIIFB_FB_LEN); + sc->sc_reg_addr = (intptr_t)pmap_mapdev(WIIFB_REG_ADDR, WIIFB_REG_LEN); return 0; + } sc->sc_console = 1; From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 04:09:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DE365E0; Sat, 27 Apr 2013 04:09:11 +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 10E741CAC; Sat, 27 Apr 2013 04:09: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 r3R49AgP099086; Sat, 27 Apr 2013 04:09:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R49A40099084; Sat, 27 Apr 2013 04:09:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304270409.r3R49A40099084@svn.freebsd.org> From: Eitan Adler Date: Sat, 27 Apr 2013 04:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249966 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 04:09:11 -0000 Author: eadler Date: Sat Apr 27 04:09:09 2013 New Revision: 249966 URL: http://svnweb.freebsd.org/changeset/base/249966 Log: Add a comma to satisfy Igor. Modified: head/tools/build/options/WITHOUT_JAIL head/tools/build/options/WITHOUT_LEGACY_CONSOLE Modified: head/tools/build/options/WITHOUT_JAIL ============================================================================== --- head/tools/build/options/WITHOUT_JAIL Sat Apr 27 01:57:45 2013 (r249965) +++ head/tools/build/options/WITHOUT_JAIL Sat Apr 27 04:09:09 2013 (r249966) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to not build tools for the support of jails; e.g. +Set to not build tools for the support of jails; e.g., .Xr jail 8 . Modified: head/tools/build/options/WITHOUT_LEGACY_CONSOLE ============================================================================== --- head/tools/build/options/WITHOUT_LEGACY_CONSOLE Sat Apr 27 01:57:45 2013 (r249965) +++ head/tools/build/options/WITHOUT_LEGACY_CONSOLE Sat Apr 27 04:09:09 2013 (r249966) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to not build programs that support a legacy PC console; e.g. +Set to not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 8 and .Xr vidcontrol 8 . From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 04:56:06 2013 Return-Path: Delivered-To: svn-src-head@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 5C009F79; Sat, 27 Apr 2013 04:56:06 +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 3C6F91E1D; Sat, 27 Apr 2013 04:56: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 r3R4u6nJ016213; Sat, 27 Apr 2013 04:56:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R4u2XN016191; Sat, 27 Apr 2013 04:56:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304270456.r3R4u2XN016191@svn.freebsd.org> From: Ed Schouten Date: Sat, 27 Apr 2013 04:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249968 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 04:56:06 -0000 Author: ed Date: Sat Apr 27 04:56:02 2013 New Revision: 249968 URL: http://svnweb.freebsd.org/changeset/base/249968 Log: Unbreak on ARM + Clang. Clang only supports atomic operations for ARMv6. For non-ARMv6, we still need to emit these functions. Clang's prototype for these functions slightly differs, as it is truly based on GCC's documentation. It requires the use of signed types, but also requires varargs. Still, we are not allowed to simply implement this function directly. Cleverly work around this by implementing it under a different name and using __strong_reference(). Modified: head/lib/libcompiler_rt/Makefile head/lib/libcompiler_rt/__sync_fetch_and_add_4.c head/lib/libcompiler_rt/__sync_fetch_and_add_8.c head/lib/libcompiler_rt/__sync_fetch_and_and_4.c head/lib/libcompiler_rt/__sync_fetch_and_and_8.c head/lib/libcompiler_rt/__sync_fetch_and_op_n.h head/lib/libcompiler_rt/__sync_fetch_and_or_4.c head/lib/libcompiler_rt/__sync_fetch_and_or_8.c head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/Makefile Sat Apr 27 04:56:02 2013 (r249968) @@ -156,9 +156,8 @@ SRCF+= divsi3 \ umodsi3 .endif -# FreeBSD-specific atomic intrinsics. Clang provides them as a builtin. -.if (${MACHINE_CPUARCH} == "arm" && ${COMPILER_TYPE} != "clang") || \ - ${MACHINE_CPUARCH} == "mips" +# FreeBSD-specific atomic intrinsics. +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" SRCF+= __sync_fetch_and_add_4 \ __sync_fetch_and_and_4 \ __sync_fetch_and_or_4 \ Modified: head/lib/libcompiler_rt/__sync_fetch_and_add_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_add_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_add_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_add_4 -#define TYPE uint32_t +#define TYPE int32_t #define FETCHADD(x, y) atomic_fetchadd_32(x, y) #include "__sync_fetch_and_op_n.h" Modified: head/lib/libcompiler_rt/__sync_fetch_and_add_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_add_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_add_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_add_8 -#define TYPE uint64_t +#define TYPE int64_t #define FETCHADD(x, y) atomic_fetchadd_64(x, y) #include "__sync_fetch_and_op_n.h" Modified: head/lib/libcompiler_rt/__sync_fetch_and_and_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_and_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_and_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_and_4 -#define TYPE uint32_t +#define TYPE int32_t #define CMPSET atomic_cmpset_32 #define EXPRESSION t & value Modified: head/lib/libcompiler_rt/__sync_fetch_and_and_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_and_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_and_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_and_8 -#define TYPE uint64_t +#define TYPE int64_t #define CMPSET atomic_cmpset_64 #define EXPRESSION t & value Modified: head/lib/libcompiler_rt/__sync_fetch_and_op_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Sat Apr 27 04:56:02 2013 (r249968) @@ -30,8 +30,13 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined __clang__ +static TYPE +atomic_func(volatile TYPE *ptr, TYPE value, ...) +#else TYPE NAME(volatile TYPE *ptr, TYPE value) +#endif { TYPE t; @@ -45,3 +50,7 @@ NAME(volatile TYPE *ptr, TYPE value) return (t); } + +#ifdef __clang__ +__strong_reference(atomic_func, NAME); +#endif Modified: head/lib/libcompiler_rt/__sync_fetch_and_or_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_or_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_or_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_or_4 -#define TYPE uint32_t +#define TYPE int32_t #define CMPSET atomic_cmpset_32 #define EXPRESSION t | value Modified: head/lib/libcompiler_rt/__sync_fetch_and_or_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_or_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_or_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_or_8 -#define TYPE uint64_t +#define TYPE int64_t #define CMPSET atomic_cmpset_64 #define EXPRESSION t | value Modified: head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_sub_4 -#define TYPE uint32_t +#define TYPE int32_t #define FETCHADD(x, y) atomic_fetchadd_32(x, -(y)) #include "__sync_fetch_and_op_n.h" Modified: head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_sub_8 -#define TYPE uint64_t +#define TYPE int64_t #define FETCHADD(x, y) atomic_fetchadd_64(x, -(y)) #include "__sync_fetch_and_op_n.h" Modified: head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_xor_4 -#define TYPE uint32_t +#define TYPE int32_t #define CMPSET atomic_cmpset_32 #define EXPRESSION t ^ value Modified: head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_fetch_and_xor_8 -#define TYPE uint64_t +#define TYPE int64_t #define CMPSET atomic_cmpset_64 #define EXPRESSION t ^ value Modified: head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_lock_test_and_set_4 -#define TYPE uint32_t +#define TYPE int32_t #define CMPSET atomic_cmpset_32 #define EXPRESSION value Modified: head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_lock_test_and_set_8 -#define TYPE uint64_t +#define TYPE int64_t #define CMPSET atomic_cmpset_64 #define EXPRESSION value Modified: head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c ============================================================================== --- head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_val_compare_and_swap_4 -#define TYPE uint32_t +#define TYPE int32_t #define CMPSET atomic_cmpset_32 #include "__sync_val_compare_and_swap_n.h" Modified: head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c ============================================================================== --- head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c Sat Apr 27 04:56:02 2013 (r249968) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define NAME __sync_val_compare_and_swap_8 -#define TYPE uint64_t +#define TYPE int64_t #define CMPSET atomic_cmpset_64 #include "__sync_val_compare_and_swap_n.h" Modified: head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Sat Apr 27 04:49:51 2013 (r249967) +++ head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Sat Apr 27 04:56:02 2013 (r249968) @@ -30,8 +30,13 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined __clang__ +static TYPE +atomic_func(volatile TYPE *ptr, TYPE oldval, TYPE newval, ...) +#else TYPE NAME(volatile TYPE *ptr, TYPE oldval, TYPE newval) +#endif { TYPE t; @@ -43,3 +48,7 @@ NAME(volatile TYPE *ptr, TYPE oldval, TY return (oldval); } + +#ifdef __clang__ +__strong_reference(atomic_func, NAME); +#endif From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 05:01:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC4B118C; Sat, 27 Apr 2013 05:01:29 +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 BE04F1E39; Sat, 27 Apr 2013 05:01: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 r3R51Te4018925; Sat, 27 Apr 2013 05:01:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R51TMK018923; Sat, 27 Apr 2013 05:01:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304270501.r3R51TMK018923@svn.freebsd.org> From: Ed Schouten Date: Sat, 27 Apr 2013 05:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249969 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 05:01:29 -0000 Author: ed Date: Sat Apr 27 05:01:29 2013 New Revision: 249969 URL: http://svnweb.freebsd.org/changeset/base/249969 Log: Use C11 instead of our non-standard . Reviewed by: pjd Modified: head/sbin/hastd/primary.c head/sbin/hastd/refcnt.h Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sat Apr 27 04:56:02 2013 (r249968) +++ head/sbin/hastd/primary.c Sat Apr 27 05:01:29 2013 (r249969) @@ -78,7 +78,7 @@ struct hio { * kernel. Each component has to decrease this counter by one * even on failure. */ - unsigned int hio_countdown; + refcnt_t hio_countdown; /* * Each component has a place to store its own error. * Once the request is handled by all components we can decide if the @@ -415,7 +415,7 @@ init_environment(struct hast_resource *r "Unable to allocate %zu bytes of memory for hio request.", sizeof(*hio)); } - hio->hio_countdown = 0; + refcnt_init(&hio->hio_countdown, 0); hio->hio_errors = malloc(sizeof(hio->hio_errors[0]) * ncomps); if (hio->hio_errors == NULL) { primary_exitx(EX_TEMPFAIL, @@ -1300,11 +1300,12 @@ ggate_recv_thread(void *arg) } pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); - hio->hio_countdown = ncomps; if (hio->hio_replication == HAST_REPLICATION_MEMSYNC && ggio->gctl_cmd == BIO_WRITE) { /* Each remote request needs two responses in memsync. */ - hio->hio_countdown++; + refcnt_init(&hio->hio_countdown, ncomps + 1); + } else { + refcnt_init(&hio->hio_countdown, ncomps); } for (ii = ncomp; ii < ncomps; ii++) QUEUE_INSERT1(hio, send, ii); @@ -2139,7 +2140,7 @@ sync_thread(void *arg __unused) ncomp = 1; } mtx_unlock(&metadata_lock); - hio->hio_countdown = 1; + refcnt_init(&hio->hio_countdown, 1); QUEUE_INSERT1(hio, send, ncomp); /* @@ -2189,7 +2190,7 @@ sync_thread(void *arg __unused) pjdlog_debug(2, "sync: (%p) Moving request to the send queue.", hio); - hio->hio_countdown = 1; + refcnt_init(&hio->hio_countdown, 1); QUEUE_INSERT1(hio, send, ncomp); /* Modified: head/sbin/hastd/refcnt.h ============================================================================== --- head/sbin/hastd/refcnt.h Sat Apr 27 04:56:02 2013 (r249968) +++ head/sbin/hastd/refcnt.h Sat Apr 27 05:01:29 2013 (r249969) @@ -32,24 +32,33 @@ #ifndef __REFCNT_H__ #define __REFCNT_H__ -#include +#include #include "pjdlog.h" +typedef atomic_uint refcnt_t; + +static __inline void +refcnt_init(refcnt_t *count, unsigned int v) +{ + + atomic_init(count, v); +} + static __inline void -refcnt_acquire(volatile unsigned int *count) +refcnt_acquire(refcnt_t *count) { - atomic_add_acq_int(count, 1); + atomic_fetch_add_explicit(count, 1, memory_order_acquire); } static __inline unsigned int -refcnt_release(volatile unsigned int *count) +refcnt_release(refcnt_t *count) { unsigned int old; /* XXX: Should this have a rel membar? */ - old = atomic_fetchadd_int(count, -1); + old = atomic_fetch_sub(count, 1); PJDLOG_ASSERT(old > 0); return (old - 1); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 05:06:26 2013 Return-Path: Delivered-To: svn-src-head@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 30CE9333; Sat, 27 Apr 2013 05:06:26 +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 225611E59; Sat, 27 Apr 2013 05:06: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 r3R56Qh5020013; Sat, 27 Apr 2013 05:06:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R56PaZ020012; Sat, 27 Apr 2013 05:06:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304270506.r3R56PaZ020012@svn.freebsd.org> From: Ed Schouten Date: Sat, 27 Apr 2013 05:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249970 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 05:06:26 -0000 Author: ed Date: Sat Apr 27 05:06:25 2013 New Revision: 249970 URL: http://svnweb.freebsd.org/changeset/base/249970 Log: Partially revert my last change. I forgot that I still had a locally applied patch to my copy of Clang that needs to be pushed in before we should use C11 atomics. Modified: head/sbin/hastd/refcnt.h Modified: head/sbin/hastd/refcnt.h ============================================================================== --- head/sbin/hastd/refcnt.h Sat Apr 27 05:01:29 2013 (r249969) +++ head/sbin/hastd/refcnt.h Sat Apr 27 05:06:25 2013 (r249970) @@ -32,24 +32,24 @@ #ifndef __REFCNT_H__ #define __REFCNT_H__ -#include +#include #include "pjdlog.h" -typedef atomic_uint refcnt_t; +typedef unsigned int refcnt_t; static __inline void refcnt_init(refcnt_t *count, unsigned int v) { - atomic_init(count, v); + *count = v; } static __inline void refcnt_acquire(refcnt_t *count) { - atomic_fetch_add_explicit(count, 1, memory_order_acquire); + atomic_add_acq_int(count, 1); } static __inline unsigned int @@ -58,7 +58,7 @@ refcnt_release(refcnt_t *count) unsigned int old; /* XXX: Should this have a rel membar? */ - old = atomic_fetch_sub(count, 1); + old = atomic_fetchadd_int(count, -1); PJDLOG_ASSERT(old > 0); return (old - 1); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 05:44:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 032CF667; Sat, 27 Apr 2013 05:44:41 +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 CF5BC1F21; Sat, 27 Apr 2013 05:44: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 r3R5ie4J033374; Sat, 27 Apr 2013 05:44:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R5idaX033370; Sat, 27 Apr 2013 05:44:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304270544.r3R5idaX033370@svn.freebsd.org> From: Ed Schouten Date: Sat, 27 Apr 2013 05:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249971 - in head/secure: . lib/libcrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 05:44:41 -0000 Author: ed Date: Sat Apr 27 05:44:39 2013 New Revision: 249971 URL: http://svnweb.freebsd.org/changeset/base/249971 Log: Remove references to MK_IDEA. As of r249959, we want to build with IDEA support enabled unconditionally. As this change removed the MK_IDEA flag, update these Makefiles accordingly. Modified: head/secure/Makefile.inc head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/Makefile.inc ============================================================================== --- head/secure/Makefile.inc Sat Apr 27 05:06:25 2013 (r249970) +++ head/secure/Makefile.inc Sat Apr 27 05:44:39 2013 (r249971) @@ -8,10 +8,6 @@ CRYPTOBJDIR= ${.CURDIR}/../../lib/libcry CRYPTOBJDIR= ${.CURDIR}/../../lib/libcrypt .endif -.if ${MK_IDEA} == "no" -CFLAGS+= -DNO_IDEA -.endif - .if ${MK_OPENSSH} != "no" SSHDIR= ${.CURDIR}/../../../crypto/openssh .endif Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Sat Apr 27 05:06:25 2013 (r249970) +++ head/secure/lib/libcrypto/Makefile Sat Apr 27 05:44:39 2013 (r249971) @@ -200,10 +200,8 @@ SRCS+= hm_ameth.c hm_pmeth.c hmac.c INCS+= hmac.h # idea -.if ${MK_IDEA} != "no" SRCS+= i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c INCS+= idea.h -.endif # krb5 INCS+= krb5_asn.h @@ -404,12 +402,6 @@ opensslconf.h: opensslconf-${MACHINE_CPU .endif cp -f ${.ALLSRC} ${.TARGET} -.if ${MK_IDEA} == "no" -evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h - sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET} -CLEANFILES+= evp.h -.endif - OLDSYMLINKS+= libdes.a libdes.so libdes.so.3 libdes_p.a afterinstall: @${ECHO} "Removing stale symlinks." @@ -430,10 +422,6 @@ afterinstall: _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm .endif -.if ${MK_IDEA} != "no" -_ideapath= ${LCRYPTO_SRC}/crypto/idea -.endif - .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes \ ${LCRYPTO_SRC}/crypto/asn1 \ @@ -459,7 +447,7 @@ _ideapath= ${LCRYPTO_SRC}/crypto/idea ${LCRYPTO_SRC}/crypto/err \ ${LCRYPTO_SRC}/crypto/evp \ ${LCRYPTO_SRC}/crypto/hmac \ - ${_ideapath} \ + ${LCRYPTO_SRC}/crypto/idea \ ${LCRYPTO_SRC}/crypto/krb5 \ ${LCRYPTO_SRC}/crypto/lhash \ ${LCRYPTO_SRC}/crypto/md4 \ Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Sat Apr 27 05:06:25 2013 (r249970) +++ head/secure/lib/libcrypto/Makefile.inc Sat Apr 27 05:44:39 2013 (r249971) @@ -13,10 +13,6 @@ CFLAGS+= -DTERMIOS -DANSI_SOURCE CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto -I${.OBJDIR} CFLAGS+= -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -.if ${MK_IDEA} == "no" -CFLAGS+= -DOPENSSL_NO_IDEA -.endif - .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 06:54:50 2013 Return-Path: Delivered-To: svn-src-head@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 EA867FD6; Sat, 27 Apr 2013 06:54:50 +0000 (UTC) (envelope-from rpaulo@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 DCC241095; Sat, 27 Apr 2013 06: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 r3R6sow2057592; Sat, 27 Apr 2013 06:54:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R6sov4057590; Sat, 27 Apr 2013 06:54:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304270654.r3R6sov4057590@svn.freebsd.org> From: Rui Paulo Date: Sat, 27 Apr 2013 06:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249973 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 06:54:51 -0000 Author: rpaulo Date: Sat Apr 27 06:54:49 2013 New Revision: 249973 URL: http://svnweb.freebsd.org/changeset/base/249973 Log: Add reset support to the Wii. Modified: head/sys/powerpc/wii/platform_wii.c head/sys/powerpc/wii/wii_bus.c Modified: head/sys/powerpc/wii/platform_wii.c ============================================================================== --- head/sys/powerpc/wii/platform_wii.c Sat Apr 27 06:09:13 2013 (r249972) +++ head/sys/powerpc/wii/platform_wii.c Sat Apr 27 06:54:49 2013 (r249973) @@ -58,9 +58,11 @@ static int wii_probe(platform_t); static int wii_attach(platform_t); static void wii_mem_regions(platform_t, struct mem_region **, int *, struct mem_region **, int *); -static unsigned long wii_timebase_freq(platform_t, struct cpuref *cpuref); +static unsigned long wii_timebase_freq(platform_t, struct cpuref *); static void wii_reset(platform_t); -static void wii_cpu_idle(sbintime_t sbt); +static void wii_cpu_idle(sbintime_t); + +extern void wiibus_reset_system(void); static platform_method_t wii_methods[] = { PLATFORMMETHOD(platform_probe, wii_probe), @@ -150,8 +152,10 @@ wii_timebase_freq(platform_t plat, struc } static void -wii_reset(platform_t plat) +wii_reset(platform_t plat __unused) { + + wiibus_reset_system(); } static void Modified: head/sys/powerpc/wii/wii_bus.c ============================================================================== --- head/sys/powerpc/wii/wii_bus.c Sat Apr 27 06:09:13 2013 (r249972) +++ head/sys/powerpc/wii/wii_bus.c Sat Apr 27 06:54:49 2013 (r249973) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,6 +52,21 @@ __FBSDID("$FreeBSD$"); #include #include +#define WIIBUS_CSR_ADDR 0x0d800100 +#define WIIBUS_CSR_LEN 0x300 +#define WIIBUS_CSR_RESET 0x94 + +struct wiibus_softc { + device_t sc_dev; + struct rman sc_rman; + bus_space_tag_t sc_tag; + bus_space_handle_t sc_handle; +}; + +static struct wiibus_softc *wiibus_sc = NULL; + +static uint32_t wiibus_csr_read(struct wiibus_softc *, uint16_t); +static void wiibus_csr_write(struct wiibus_softc *, uint16_t, uint32_t); static void wiibus_identify(driver_t *, device_t); static int wiibus_probe(device_t); static int wiibus_attach(device_t); @@ -61,6 +77,7 @@ static struct resource * unsigned int); static int wiibus_activate_resource(device_t, device_t, int, int, struct resource *); + void wiibus_reset_system(void); static device_method_t wiibus_methods[] = { /* Device interface */ @@ -79,11 +96,6 @@ static device_method_t wiibus_methods[] DEVMETHOD_END }; -struct wiibus_softc { - device_t sc_dev; - struct rman sc_rman; -}; - static MALLOC_DEFINE(M_WIIBUS, "wiibus", "Nintendo Wii system bus"); struct wiibus_devinfo { @@ -101,6 +113,21 @@ static devclass_t wiibus_devclass; DRIVER_MODULE(wiibus, nexus, wiibus_driver, wiibus_devclass, 0, 0); +static uint32_t +wiibus_csr_read(struct wiibus_softc *sc, uint16_t reg) +{ + + return (bus_space_read_4(sc->sc_tag, sc->sc_handle, reg)); +} + +static void +wiibus_csr_write(struct wiibus_softc *sc, uint16_t reg, + uint32_t val) +{ + + bus_space_write_4(sc->sc_tag, sc->sc_handle, reg, val); +} + static void wiibus_identify(driver_t *driver, device_t parent) { @@ -153,6 +180,8 @@ wiibus_attach(device_t self) sc->sc_rman.rm_type = RMAN_ARRAY; sc->sc_rman.rm_descr = "Wii Bus Memory Mapped I/O"; rman_init(&sc->sc_rman); + KASSERT(wiibus_sc == NULL, ("wiibus_sc already initialised")); + wiibus_sc = sc; /* Nintendo PIC */ dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); @@ -193,6 +222,11 @@ wiibus_attach(device_t self) cdev = BUS_ADD_CHILD(self, 0, "wiigpio", 0); device_set_ivars(cdev, dinfo); + /* The control registers */ + sc->sc_tag = &bs_be_tag; + sc->sc_handle = (bus_space_handle_t)pmap_mapdev(WIIBUS_CSR_ADDR, + WIIBUS_CSR_LEN); + return (bus_generic_attach(self)); } @@ -295,3 +329,12 @@ wiibus_activate_resource(device_t bus, d return (rman_activate_resource(res)); } +void +wiibus_reset_system(void) +{ + uint32_t r; + + r = wiibus_csr_read(wiibus_sc, WIIBUS_CSR_RESET); + r &= ~1; + wiibus_csr_write(wiibus_sc, WIIBUS_CSR_RESET, r); +} From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 06:57:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8CA911F8; Sat, 27 Apr 2013 06:57:39 +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 7F5D310B1; Sat, 27 Apr 2013 06:57: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 r3R6vdPp058171; Sat, 27 Apr 2013 06:57:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R6vd6I058170; Sat, 27 Apr 2013 06:57:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304270657.r3R6vd6I058170@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Apr 2013 06:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249974 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 06:57:39 -0000 Author: mav Date: Sat Apr 27 06:57:39 2013 New Revision: 249974 URL: http://svnweb.freebsd.org/changeset/base/249974 Log: Return "descr" field alike to "Intel RAID1 volume" for GEOM RAID to make it look better in bsdinstall. Modified: head/sys/geom/raid/g_raid.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sat Apr 27 06:54:49 2013 (r249973) +++ head/sys/geom/raid/g_raid.c Sat Apr 27 06:57:39 2013 (r249974) @@ -2357,6 +2357,10 @@ g_raid_dumpconf(struct sbuf *sb, const c vol = pp->private; g_topology_unlock(); sx_xlock(&sc->sc_lock); + sbuf_printf(sb, "%s%s %s volume\n", indent, + sc->sc_md->mdo_class->name, + g_raid_volume_level2str(vol->v_raid_level, + vol->v_raid_level_qualifier)); sbuf_printf(sb, "%s\n", indent, vol->v_name); sbuf_printf(sb, "%s%s\n", indent, From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 08:11:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54A6BCA9; Sat, 27 Apr 2013 08:11:49 +0000 (UTC) (envelope-from glebius@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 46C78124A; Sat, 27 Apr 2013 08:11: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 r3R8Bm3Q085205; Sat, 27 Apr 2013 08:11:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R8BmqC085204; Sat, 27 Apr 2013 08:11:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304270811.r3R8BmqC085204@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 27 Apr 2013 08:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249976 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 08:11:49 -0000 Author: glebius Date: Sat Apr 27 08:11:48 2013 New Revision: 249976 URL: http://svnweb.freebsd.org/changeset/base/249976 Log: Add const qualifier to the dst parameter of the ifnet if_output method. Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Apr 27 07:00:31 2013 (r249975) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Apr 27 08:11:48 2013 (r249976) @@ -88,7 +88,7 @@ static void ipoib_add_one(struct ib_devi static void ipoib_remove_one(struct ib_device *device); static void ipoib_start(struct ifnet *dev); static int ipoib_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro); + const struct sockaddr *dst, struct route *ro); static int ipoib_ioctl(struct ifnet *ifp, u_long command, caddr_t data); static void ipoib_input(struct ifnet *ifp, struct mbuf *m); @@ -1252,7 +1252,7 @@ ipoib_cleanup_module(void) */ static int ipoib_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + const struct sockaddr *dst, struct route *ro) { u_char edst[INFINIBAND_ALEN]; struct llentry *lle = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 08:40:38 2013 Return-Path: Delivered-To: svn-src-head@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 5EA763E6; Sat, 27 Apr 2013 08:40:38 +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 3710812FE; Sat, 27 Apr 2013 08:40: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 r3R8ec8Y093677; Sat, 27 Apr 2013 08:40:38 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3R8ecGv093676; Sat, 27 Apr 2013 08:40:38 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304270840.r3R8ecGv093676@svn.freebsd.org> From: Sean Bruno Date: Sat, 27 Apr 2013 08:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249977 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 08:40:38 -0000 Author: sbruno Date: Sat Apr 27 08:40:37 2013 New Revision: 249977 URL: http://svnweb.freebsd.org/changeset/base/249977 Log: Change maxio to reflect variable hardware configurations. If max_sg_length is 0, then we default to 16 If max_sg_length is less than CISS_MAX_SG_ELEMENTS, then we will set round the value of max_sg_length to the nearest power of 2 and use it to align maxio. Else, we will use CISS_MAX_SG_ELEMENTS for our calculations. Thanks to scottl for working me through the history and providing the basis for this patch. Submitted by: scott Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sat Apr 27 08:11:48 2013 (r249976) +++ head/sys/dev/ciss/ciss.c Sat Apr 27 08:40:37 2013 (r249977) @@ -2985,6 +2985,7 @@ ciss_cam_action(struct cam_sim *sim, uni case XPT_PATH_INQ: { struct ccb_pathinq *cpi = &ccb->cpi; + int sg_length; debug(1, "XPT_PATH_INQ %d:%d:%d", cam_sim_bus(sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun); @@ -3005,7 +3006,22 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; - cpi->maxio = (min(CISS_MAX_SG_ELEMENTS - 1, sc->ciss_cfg->max_sg_length)) * PAGE_SIZE; + if (sc->ciss_cfg->max_sg_length == 0) { + sg_length = 16; + } else { + /* XXX Fix for ZMR cards that advertise max_sg_length == 32 + * Confusing bit here. max_sg_length is usually a power of 2. We always + * need to subtract 1 to account for partial pages. Then we need to + * align on a valid PAGE_SIZE so we round down to the nearest power of 2. + * Add 1 so we can then subtract it out in the assignment to maxio. + * The reason for all these shenanigans is to create a maxio value that + * creates IO operations to volumes that yield consistent operations + * with good performance. + */ + sg_length = sc->ciss_cfg->max_sg_length - 1; + sg_length = (1 << (fls(sg_length) - 1)) + 1; + } + cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sg_length) - 1) * PAGE_SIZE; ccb->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 10:48:04 2013 Return-Path: Delivered-To: svn-src-head@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 99870D8C; Sat, 27 Apr 2013 10:48:04 +0000 (UTC) (envelope-from prvs=1829ff4ae6=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id C8516166A; Sat, 27 Apr 2013 10:48:03 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003508593.msg; Sat, 27 Apr 2013 11:48:00 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Sat, 27 Apr 2013 11:48:00 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=1829ff4ae6=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <517E85326B164E62AC9065015EF6BB80@multiplay.co.uk> From: "Steven Hartland" To: "Alexey Dokuchaev" References: <201304261543.r3QFhOxU036016@svn.freebsd.org> <20130427010628.GA80130@FreeBSD.org> Subject: Re: svn commit: r249930 - head/sys/geom Date: Sat, 27 Apr 2013 11:48:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 10:48:04 -0000 ----- Original Message ----- From: "Alexey Dokuchaev" To: "Steven Hartland" Cc: ; ; Sent: Saturday, April 27, 2013 2:06 AM Subject: Re: svn commit: r249930 - head/sys/geom > On Fri, Apr 26, 2013 at 03:43:24PM +0000, Steven Hartland wrote: >> New Revision: 249930 >> URL: http://svnweb.freebsd.org/changeset/base/249930 >> >> Log: >> [...] >> In tests on a Intel 520 120GB FW: 400i disk it improved the delete throughput >> from 1.6GB/s to over 2.6GB/s on a full disk delete such as that done via >> newfs -E >> [...] >> MFC after: 2 weeks > > Nice, > > Please don't forget about stable/8, thanks! Nope I wont :) Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 11:55:23 2013 Return-Path: Delivered-To: svn-src-head@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 DC1166EE; Sat, 27 Apr 2013 11:55:23 +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 CEA59179F; Sat, 27 Apr 2013 11:55: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 r3RBtNfJ064652; Sat, 27 Apr 2013 11:55:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RBtNXl064651; Sat, 27 Apr 2013 11:55:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304271155.r3RBtNXl064651@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 27 Apr 2013 11:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249979 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 11:55:23 -0000 Author: jilles Date: Sat Apr 27 11:55:23 2013 New Revision: 249979 URL: http://svnweb.freebsd.org/changeset/base/249979 Log: intro(2): Fix some errors in ENFILE and EMFILE descriptions. MFC after: 1 week Modified: head/lib/libc/sys/intro.2 Modified: head/lib/libc/sys/intro.2 ============================================================================== --- head/lib/libc/sys/intro.2 Sat Apr 27 11:28:00 2013 (r249978) +++ head/lib/libc/sys/intro.2 Sat Apr 27 11:55:23 2013 (r249979) @@ -28,7 +28,7 @@ .\" @(#)intro.2 8.5 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd February 27, 1995 +.Dd April 27, 2013 .Dt INTRO 2 .Os .Sh NAME @@ -189,12 +189,13 @@ or a .Xr kill 2 system call). .It Er 23 ENFILE Em "Too many open files in system" . -Maximum number of file descriptors allowable on the system -has been reached and a requests for an open cannot be satisfied +Maximum number of open files allowable on the system +has been reached and requests for an open cannot be satisfied until at least one has been closed. .It Er 24 EMFILE Em "Too many open files" . -(As released, the limit on the number of -open files per process is 64.) +Maximum number of file descriptors allowable in the process +has been reached and requests for an open cannot be satisfied +until at least one has been closed. The .Xr getdtablesize 2 system call will obtain the current limit. From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 12:39:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A963DE2; Sat, 27 Apr 2013 12:39:29 +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 747C91894; Sat, 27 Apr 2013 12:39: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 r3RCdThu082121; Sat, 27 Apr 2013 12:39:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RCdTlL082120; Sat, 27 Apr 2013 12:39:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304271239.r3RCdTlL082120@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Apr 2013 12:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249980 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 12:39:29 -0000 Author: mav Date: Sat Apr 27 12:39:28 2013 New Revision: 249980 URL: http://svnweb.freebsd.org/changeset/base/249980 Log: MFprojects/camlock r249541: Give periph validity flag own periph reference. That slightly simplifies the release logic and covers hypothetical case if lock is dropped inside the periph_oninval() method. Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sat Apr 27 11:55:23 2013 (r249979) +++ head/sys/cam/cam_periph.c Sat Apr 27 12:39:28 2013 (r249980) @@ -203,7 +203,7 @@ cam_periph_alloc(periph_ctor_t *periph_c periph->type = type; periph->periph_name = name; periph->immediate_priority = CAM_PRIORITY_NONE; - periph->refcount = 0; + periph->refcount = 1; /* Dropped by invalidation. */ periph->sim = sim; SLIST_INIT(&periph->ccb_list); status = xpt_create_path(&path, periph, path_id, target_id, lun_id); @@ -381,10 +381,8 @@ cam_periph_release_locked_buses(struct c mtx_assert(periph->sim->mtx, MA_OWNED); KASSERT(periph->refcount >= 1, ("periph->refcount >= 1")); - if (--periph->refcount == 0 - && (periph->flags & CAM_PERIPH_INVALID)) { + if (--periph->refcount == 0) camperiphfree(periph); - } } void @@ -579,23 +577,20 @@ void cam_periph_invalidate(struct cam_periph *periph) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); mtx_assert(periph->sim->mtx, MA_OWNED); /* * We only call this routine the first time a peripheral is * invalidated. */ - if (((periph->flags & CAM_PERIPH_INVALID) == 0) - && (periph->periph_oninval != NULL)) - periph->periph_oninval(periph); + if ((periph->flags & CAM_PERIPH_INVALID) != 0) + return; + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; - - xpt_lock_buses(); - if (periph->refcount == 0) - camperiphfree(periph); - xpt_unlock_buses(); + if (periph->periph_oninval != NULL) + periph->periph_oninval(periph); + cam_periph_release_locked(periph); } static void From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 12:46:05 2013 Return-Path: Delivered-To: svn-src-head@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 798CDF98; Sat, 27 Apr 2013 12:46:05 +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 5BE5118B6; Sat, 27 Apr 2013 12:46: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 r3RCk5rI084938; Sat, 27 Apr 2013 12:46:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RCk54H084936; Sat, 27 Apr 2013 12:46:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304271246.r3RCk54H084936@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Apr 2013 12:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249981 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 12:46:05 -0000 Author: mav Date: Sat Apr 27 12:46:04 2013 New Revision: 249981 URL: http://svnweb.freebsd.org/changeset/base/249981 Log: MFprojects/camlock r249542: Remove ADA_FLAG_PACK_INVALID flag. Since ATA disks have no concept of media change it only duplicates CAM_PERIPH_INVALID flag, so we can use last one. Slightly cleanup DA_FLAG_PACK_INVALID use. 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 Sat Apr 27 12:39:28 2013 (r249980) +++ head/sys/cam/ata/ata_da.c Sat Apr 27 12:46:04 2013 (r249981) @@ -74,7 +74,6 @@ typedef enum { } ada_state; typedef enum { - ADA_FLAG_PACK_INVALID = 0x0001, ADA_FLAG_CAN_48BIT = 0x0002, ADA_FLAG_CAN_FLUSHCACHE = 0x0004, ADA_FLAG_CAN_NCQ = 0x0008, @@ -538,16 +537,11 @@ adaopen(struct disk *dp) return (error); } - softc = (struct ada_softc *)periph->softc; - softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("adaopen\n")); - if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { - /* Invalidate our pack information. */ - softc->flags &= ~ADA_FLAG_PACK_INVALID; - } + softc = (struct ada_softc *)periph->softc; + softc->flags |= ADA_FLAG_OPEN; cam_periph_unhold(periph); cam_periph_unlock(periph); @@ -576,7 +570,7 @@ adaclose(struct disk *dp) /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && - (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -651,7 +645,7 @@ adastrategy(struct bio *bp) /* * If the device has been made invalid, error out */ - if ((softc->flags & ADA_FLAG_PACK_INVALID)) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_unlock(periph); biofinish(bp, NULL, ENXIO); return; @@ -702,7 +696,7 @@ adadump(void *arg, void *virtual, vm_off lba = offset / secsize; count = length / secsize; - if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_unlock(periph); return (ENXIO); } @@ -827,8 +821,6 @@ adaoninvalidate(struct cam_periph *perip */ xpt_register_async(0, adaasync, periph, periph->path); - softc->flags |= ADA_FLAG_PACK_INVALID; - /* * Return all queued I/O with ENXIO. * XXX Handle any transactions queued to the card @@ -990,7 +982,7 @@ adasysctlinit(void *context, int pending periph = (struct cam_periph *)context; /* periph was held for us when this task was enqueued */ - if (periph->flags & CAM_PERIPH_INVALID) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_release(periph); return; } @@ -1597,10 +1589,9 @@ out: case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { - if (softc->flags & ADA_FLAG_PACK_INVALID) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { softc->state = ADA_STATE_NORMAL; xpt_release_ccb(start_ccb); - adaschedule(periph); cam_periph_release_locked(periph); return; } @@ -1660,19 +1651,6 @@ adadone(struct cam_periph *periph, union return; } if (error != 0) { - if (error == ENXIO && - (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { - /* - * Catastrophic error. Mark our pack as - * invalid. - */ - /* - * XXX See if this is really a media - * XXX change first? - */ - xpt_print(path, "Invalidating pack\n"); - softc->flags |= ADA_FLAG_PACK_INVALID; - } bp->bio_error = error; bp->bio_resid = bp->bio_bcount; bp->bio_flags |= BIO_ERROR; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Apr 27 12:39:28 2013 (r249980) +++ head/sys/cam/scsi/scsi_da.c Sat Apr 27 12:46:04 2013 (r249981) @@ -1007,7 +1007,6 @@ daopen(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; - int unit; int error; periph = (struct cam_periph *)dp->d_drv1; @@ -1022,17 +1021,12 @@ daopen(struct disk *dp) return (error); } - unit = periph->unit_number; - softc = (struct da_softc *)periph->softc; - softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("daopen\n")); - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { - /* Invalidate our pack information. */ - softc->flags &= ~DA_FLAG_PACK_INVALID; - } + softc = (struct da_softc *)periph->softc; + softc->flags |= DA_FLAG_OPEN; + softc->flags &= ~DA_FLAG_PACK_INVALID; dareprobe(periph); @@ -2684,11 +2678,6 @@ dadone(struct cam_periph *periph, union if (softc->outstanding_cmds == 0) softc->flags |= DA_FLAG_WENT_IDLE; - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { - xpt_print(periph->path, "oustanding %d\n", - softc->outstanding_cmds); - } - if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) { From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 13:26:36 2013 Return-Path: Delivered-To: svn-src-head@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 39F89683; Sat, 27 Apr 2013 13:26:36 +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 2C8AF1AB2; Sat, 27 Apr 2013 13:26: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 r3RDQavq099152; Sat, 27 Apr 2013 13:26:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RDQaFC099151; Sat, 27 Apr 2013 13:26:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304271326.r3RDQaFC099151@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 27 Apr 2013 13:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249983 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 13:26:36 -0000 Author: jilles Date: Sat Apr 27 13:26:35 2013 New Revision: 249983 URL: http://svnweb.freebsd.org/changeset/base/249983 Log: syslogd: Use closefrom() instead of getdtablesize()/close() loop. When syslogd forks a process for '|' destinations, it closes all file descriptors greater than 2. Use closefrom() for this instead of a getdtablesize()/close() loop because it is both faster and avoids leaving file descriptors open because the limit was lowered after they were opened. MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Apr 27 12:50:07 2013 (r249982) +++ head/usr.sbin/syslogd/syslogd.c Sat Apr 27 13:26:35 2013 (r249983) @@ -2476,7 +2476,7 @@ validate(struct sockaddr *sa, const char static int p_open(const char *prog, pid_t *rpid) { - int pfd[2], nulldesc, i; + int pfd[2], nulldesc; pid_t pid; sigset_t omask, mask; char *argv[4]; /* sh -c cmd NULL */ @@ -2526,8 +2526,7 @@ p_open(const char *prog, pid_t *rpid) dup2(pfd[0], STDIN_FILENO); dup2(nulldesc, STDOUT_FILENO); dup2(nulldesc, STDERR_FILENO); - for (i = getdtablesize(); i > 2; i--) - (void)close(i); + closefrom(3); (void)execvp(_PATH_BSHELL, argv); _exit(255); From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 14:07:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 690A3DDC; Sat, 27 Apr 2013 14:07:26 +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 5B8631BC3; Sat, 27 Apr 2013 14:07: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 r3RE7QND013254; Sat, 27 Apr 2013 14:07:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RE7QI1013253; Sat, 27 Apr 2013 14:07:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304271407.r3RE7QI1013253@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 27 Apr 2013 14:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249984 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 14:07:26 -0000 Author: jilles Date: Sat Apr 27 14:07:25 2013 New Revision: 249984 URL: http://svnweb.freebsd.org/changeset/base/249984 Log: sh: Don't consider jobs -s/-p as reporting the status of jobs. This ensures that something like j=$(jobs -p) does not prevent any status from being written to the terminal. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Apr 27 13:26:35 2013 (r249983) +++ head/bin/sh/jobs.c Sat Apr 27 14:07:25 2013 (r249984) @@ -417,13 +417,15 @@ showjobs(int change, int mode) if (change && ! jp->changed) continue; showjob(jp, mode); - jp->changed = 0; - /* Hack: discard jobs for which $! has not been referenced - * in interactive mode when they terminate. - */ - if (jp->state == JOBDONE && !jp->remembered && - (iflag || jp != bgjob)) { - freejob(jp); + if (mode == SHOWJOBS_DEFAULT || mode == SHOWJOBS_VERBOSE) { + jp->changed = 0; + /* Hack: discard jobs for which $! has not been + * referenced in interactive mode when they terminate. + */ + if (jp->state == JOBDONE && !jp->remembered && + (iflag || jp != bgjob)) { + freejob(jp); + } } } } From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 14:21:36 2013 Return-Path: Delivered-To: svn-src-head@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 CFA5A8D9; Sat, 27 Apr 2013 14:21:36 +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 C2B661C4D; Sat, 27 Apr 2013 14:21: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 r3RELaYu019359; Sat, 27 Apr 2013 14:21:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RELaYc019358; Sat, 27 Apr 2013 14:21:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304271421.r3RELaYc019358@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 27 Apr 2013 14:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249985 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 14:21:36 -0000 Author: jilles Date: Sat Apr 27 14:21:36 2013 New Revision: 249985 URL: http://svnweb.freebsd.org/changeset/base/249985 Log: libthr: Fix a parameter name in an internal header file. Modified: head/lib/libthr/thread/thr_umtx.h Modified: head/lib/libthr/thread/thr_umtx.h ============================================================================== --- head/lib/libthr/thread/thr_umtx.h Sat Apr 27 14:07:25 2013 (r249984) +++ head/lib/libthr/thread/thr_umtx.h Sat Apr 27 14:21:36 2013 (r249985) @@ -56,7 +56,7 @@ int _thr_umtx_timedwait_uint(volatile u_ const struct timespec *timeout, int shared) __hidden; int _thr_umtx_wake(volatile void *mtx, int count, int shared) __hidden; int _thr_ucond_wait(struct ucond *cv, struct umutex *m, - const struct timespec *timeout, int check_unpaking) __hidden; + const struct timespec *timeout, int flags) __hidden; void _thr_ucond_init(struct ucond *cv) __hidden; int _thr_ucond_signal(struct ucond *cv) __hidden; int _thr_ucond_broadcast(struct ucond *cv) __hidden; From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 16:45:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42A89C86; Sat, 27 Apr 2013 16:45:00 +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 246F610DF; Sat, 27 Apr 2013 16:45: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 r3RGj0Lt069342; Sat, 27 Apr 2013 16:45:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RGj08r069331; Sat, 27 Apr 2013 16:45:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304271645.r3RGj08r069331@svn.freebsd.org> From: Alan Cox Date: Sat, 27 Apr 2013 16:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249986 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 16:45:00 -0000 Author: alc Date: Sat Apr 27 16:44:59 2013 New Revision: 249986 URL: http://svnweb.freebsd.org/changeset/base/249986 Log: Avoid some lookup restarts in vm_radix_lookup_{ge,le}(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sat Apr 27 14:21:36 2013 (r249985) +++ head/sys/vm/vm_radix.c Sat Apr 27 16:44:59 2013 (r249986) @@ -527,26 +527,26 @@ restart: maplevels[rnode->rn_clev] = TRUE; /* - * If the keys differ before the current bisection node - * the search key might rollback to the earliest - * available bisection node, or to the smaller value - * in the current domain (if the owner is bigger than the + * If the keys differ before the current bisection node, + * then the search key might rollback to the earliest + * available bisection node or to the smallest key + * in the current node (if the owner is bigger than the * search key). * The maplevels array records any node has been seen * at a given level. This aids the search for a valid * bisection node. */ if (vm_radix_keybarr(rnode, index)) { - difflev = vm_radix_keydiff(index, rnode->rn_owner); if (index > rnode->rn_owner) { + difflev = vm_radix_keydiff(index, + rnode->rn_owner); if (vm_radix_addlev(&index, maplevels, difflev) > 0) break; + rnode = vm_radix_getroot(rtree); + goto restart; } else - index = vm_radix_trimkey(rnode->rn_owner, - difflev); - rnode = vm_radix_getroot(rtree); - goto restart; + index = rnode->rn_owner; } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; @@ -628,26 +628,28 @@ restart: maplevels[rnode->rn_clev] = TRUE; /* - * If the keys differ before the current bisection node - * the search key might rollback to the earliest - * available bisection node, or to the higher value - * in the current domain (if the owner is smaller than the + * If the keys differ before the current bisection node, + * then the search key might rollback to the earliest + * available bisection node or to the largest key + * in the current node (if the owner is smaller than the * search key). * The maplevels array records any node has been seen * at a given level. This aids the search for a valid * bisection node. */ if (vm_radix_keybarr(rnode, index)) { - difflev = vm_radix_keydiff(index, rnode->rn_owner); if (index > rnode->rn_owner) { - index = vm_radix_trimkey(rnode->rn_owner, - difflev); - index |= VM_RADIX_UNITLEVEL(difflev) - 1; - } else if (vm_radix_declev(&index, maplevels, - difflev) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; + index = rnode->rn_owner + VM_RADIX_COUNT * + VM_RADIX_UNITLEVEL(rnode->rn_clev) - 1; + } else { + difflev = vm_radix_keydiff(index, + rnode->rn_owner); + if (vm_radix_declev(&index, maplevels, + difflev) > 0) + break; + rnode = vm_radix_getroot(rtree); + goto restart; + } } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 19:26:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5747C3B6; Sat, 27 Apr 2013 19:26:57 +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 301DA168B; Sat, 27 Apr 2013 19:26: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 r3RJQvWA028739; Sat, 27 Apr 2013 19:26:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RJQudf028737; Sat, 27 Apr 2013 19:26:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304271926.r3RJQudf028737@svn.freebsd.org> From: Dimitry Andric Date: Sat, 27 Apr 2013 19:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249993 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 19:26:57 -0000 Author: dim Date: Sat Apr 27 19:26:56 2013 New Revision: 249993 URL: http://svnweb.freebsd.org/changeset/base/249993 Log: Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3: * Don't call the _fast version of the TLS accessor in terminate() or unexpected(). 1) TLS may not have been set up yet. 2) When we're in one of these functions, Really Bad Stuff has happened and potentially saving a few cycles really isn't important. * Merge in fixes from FreeBSD trunk to make atomics work with recent clang. MFC after: 1 week Modified: head/contrib/libcxxrt/atomic.h head/contrib/libcxxrt/exception.cc Directory Properties: head/contrib/libcxxrt/ (props changed) Modified: head/contrib/libcxxrt/atomic.h ============================================================================== --- head/contrib/libcxxrt/atomic.h Sat Apr 27 18:34:51 2013 (r249992) +++ head/contrib/libcxxrt/atomic.h Sat Apr 27 19:26:56 2013 (r249993) @@ -9,7 +9,7 @@ * Swap macro that enforces a happens-before relationship with a corresponding * ATOMIC_LOAD. */ -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_exchange) #define ATOMIC_SWAP(addr, val)\ __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL) #elif __has_builtin(__sync_swap) @@ -20,7 +20,7 @@ __sync_lock_test_and_set(addr, val) #endif -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_load) #define ATOMIC_LOAD(addr)\ __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE) #else Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Sat Apr 27 18:34:51 2013 (r249992) +++ head/contrib/libcxxrt/exception.cc Sat Apr 27 19:26:56 2013 (r249993) @@ -1404,7 +1404,7 @@ namespace std */ void terminate() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->terminateHandler) { info->terminateHandler(); @@ -1421,7 +1421,7 @@ namespace std */ void unexpected() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->unexpectedHandler) { info->unexpectedHandler(); From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 21:18:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37477DA1; Sat, 27 Apr 2013 21:18:35 +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 297AD1B16; Sat, 27 Apr 2013 21:18: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 r3RLIZJv069703; Sat, 27 Apr 2013 21:18:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RLIZa0069702; Sat, 27 Apr 2013 21:18:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304272118.r3RLIZa0069702@svn.freebsd.org> From: Ed Schouten Date: Sat, 27 Apr 2013 21:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249995 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 21:18:35 -0000 Author: ed Date: Sat Apr 27 21:18:34 2013 New Revision: 249995 URL: http://svnweb.freebsd.org/changeset/base/249995 Log: Enable improved for Clang even when not using C11. By using __has_extension(c_generic_selections), we can explicitly test whether we're dealing with a version of Clang that supports _Generic(). That way we can use the improved code, even when not using -std=c11. This massively reduces the compilation time when invoking these functions. Modified: head/include/tgmath.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Sat Apr 27 20:24:30 2013 (r249994) +++ head/include/tgmath.h Sat Apr 27 21:18:34 2013 (r249995) @@ -60,7 +60,8 @@ * compilers use an inefficient yet reliable version. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + __has_extension(c_generic_selections) #define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ _Generic(x, \ long double _Complex: cfnl, \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 21:59:44 2013 Return-Path: Delivered-To: svn-src-head@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 B4A53276; Sat, 27 Apr 2013 21:59:44 +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 A7F101C4A; Sat, 27 Apr 2013 21:59: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 r3RLxi7B083212; Sat, 27 Apr 2013 21:59:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RLxiSD083211; Sat, 27 Apr 2013 21:59:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304272159.r3RLxiSD083211@svn.freebsd.org> From: Eitan Adler Date: Sat, 27 Apr 2013 21:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249996 - head/bin/mkdir X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 21:59:44 -0000 Author: eadler Date: Sat Apr 27 21:59:43 2013 New Revision: 249996 URL: http://svnweb.freebsd.org/changeset/base/249996 Log: Add missing static qualifiers Reviewed by: ed, jilles MFC After: 3 days Modified: head/bin/mkdir/mkdir.c Modified: head/bin/mkdir/mkdir.c ============================================================================== --- head/bin/mkdir/mkdir.c Sat Apr 27 21:18:34 2013 (r249995) +++ head/bin/mkdir/mkdir.c Sat Apr 27 21:59:43 2013 (r249996) @@ -135,7 +135,7 @@ main(int argc, char *argv[]) * Returns 1 if a directory has been created, * 2 if it already existed, and 0 on failure. */ -int +static int build(char *path, mode_t omode) { struct stat sb; @@ -208,7 +208,7 @@ build(char *path, mode_t omode) return (retval); } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 22:38:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3ACE1A24; Sat, 27 Apr 2013 22:38:31 +0000 (UTC) (envelope-from wkoszek@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 1D8D91DAA; Sat, 27 Apr 2013 22:38: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 r3RMcVNX097439; Sat, 27 Apr 2013 22:38:31 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RMcTCm097428; Sat, 27 Apr 2013 22:38:29 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201304272238.r3RMcTCm097428@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sat, 27 Apr 2013 22:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249997 - in head/sys: arm/conf arm/xilinx arm/xilinx/zedboard boot/fdt/dts dev/cadence dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 22:38:31 -0000 Author: wkoszek Date: Sat Apr 27 22:38:29 2013 New Revision: 249997 URL: http://svnweb.freebsd.org/changeset/base/249997 Log: Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port. Submitted by: Thomas Skibo Reviewed by: wkoszek, freebsd-arm@ (no objections raised) Added: head/sys/arm/conf/ZEDBOARD (contents, props changed) head/sys/arm/xilinx/ head/sys/arm/xilinx/files.zynq7 (contents, props changed) head/sys/arm/xilinx/std.zynq7 (contents, props changed) head/sys/arm/xilinx/uart_dev_cdnc.c (contents, props changed) head/sys/arm/xilinx/zedboard/ head/sys/arm/xilinx/zedboard/files.zedboard (contents, props changed) head/sys/arm/xilinx/zedboard/std.zedboard (contents, props changed) head/sys/arm/xilinx/zy7_bus_space.c (contents, props changed) head/sys/arm/xilinx/zy7_devcfg.c (contents, props changed) head/sys/arm/xilinx/zy7_ehci.c (contents, props changed) head/sys/arm/xilinx/zy7_gpio.c (contents, props changed) head/sys/arm/xilinx/zy7_l2cache.c (contents, props changed) head/sys/arm/xilinx/zy7_machdep.c (contents, props changed) head/sys/arm/xilinx/zy7_reg.h (contents, props changed) head/sys/arm/xilinx/zy7_slcr.c (contents, props changed) head/sys/arm/xilinx/zy7_slcr.h (contents, props changed) head/sys/boot/fdt/dts/zedboard.dts (contents, props changed) head/sys/dev/cadence/ head/sys/dev/cadence/if_cgem.c (contents, props changed) head/sys/dev/cadence/if_cgem_hw.h (contents, props changed) head/sys/dev/sdhci/sdhci_fdt.c (contents, props changed) Added: head/sys/arm/conf/ZEDBOARD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/ZEDBOARD Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,98 @@ +# ZEDBOARD -- Custom configuration for the Xilinx Zynq-7000 based +# ZedBoard (www.zedboard.org) +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident ZEDBOARD + +include "../xilinx/zedboard/std.zedboard" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +# options ROOTDEVNAME=\"ufs:mmcsd0s2a\" + +options NFSCL #Network Filesystem Client +# options NFSSD #Network Filesystem Server +# options NFSLOCKD #Network Lock Manager +# options NFS_ROOT #NFS usable as /, requires NFSCL +# options BOOTP_NFSROOT +# options BOOTP + +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options FREEBSD_BOOT_LOADER + +# Debugging +makeoptions DEBUG=-g +options DDB +options KDB +# options BREAK_TO_DEBUGGER + +# options INVARIANTS #Enable calls of extra sanity checking +# options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +# options WITNESS #Enable checks to detect deadlocks and cycles +# options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +device loop +device random +device ether +device if_cgem # Zynq-7000 gig ethernet device +device mii +device pty +device uart +device gpio + +device md +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci +device bpf # Berkeley packet filter + +# USB support +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +device ehci +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device axe # USB-Ethernet + + +# Flattened Device Tree +options FDT +# options FDT_DTB_STATIC +# makeoptions FDT_DTS_FILE=zedboard.dts + Added: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/files.zynq7 Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,31 @@ +# +# files.zynq7 +# +# $FreeBSD$ + +kern/kern_clocksource.c standard + +arm/arm/bus_space_generic.c standard +arm/arm/bus_space_asm_generic.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_arm10.S standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/irq_dispatch.S standard + +arm/arm/gic.c standard +arm/arm/mpcore_timer.c standard +arm/arm/pl310.c standard + +arm/xilinx/zy7_machdep.c standard +arm/xilinx/zy7_l2cache.c standard +arm/xilinx/zy7_bus_space.c standard +arm/xilinx/zy7_slcr.c standard +arm/xilinx/zy7_devcfg.c standard + +dev/cadence/if_cgem.c optional if_cgem +dev/sdhci/sdhci_fdt.c optional sdhci +arm/xilinx/zy7_ehci.c optional ehci +arm/xilinx/uart_dev_cdnc.c optional uart +arm/xilinx/zy7_gpio.c optional gpio + Added: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/std.zynq7 Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,23 @@ +# +# std.zynq7 - Generic configuration for Xilinx Zynq-7000 PS. +# +# $FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 + +files "../xilinx/files.zynq7" + +# Physical memory starts at 0x00000000. We assume images are loaded at +# 0x00100000, e.g. from u-boot with 'fatload mmc 0 0x100000 kernel.bin' +# +# +options PHYSADDR=0x00000000 +options KERNPHYSADDR=0x00100000 +makeoptions KERNPHYSADDR=0x00100000 +options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm +makeoptions KERNVIRTADDR=0xc0100000 + +options STARTUP_PAGETABLE_ADDR=0x000f0000 +options ARM_L2_PIPT + Added: head/sys/arm/xilinx/uart_dev_cdnc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/uart_dev_cdnc.c Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,684 @@ +/*- + * Copyright (c) 2005 M. Warner Losh + * Copyright (c) 2005 Olivier Houchard + * Copyright (c) 2012 Thomas Skibo + * 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 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 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. + */ + +/* A driver for the Cadence AMBA UART as used by the Xilinx Zynq-7000. + * + * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. + * (v1.4) November 16, 2012. Xilinx doc UG585. UART is covered in Ch. 19 + * and register definitions are in appendix B.33. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_global.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "uart_if.h" + +#define UART_FIFO_SIZE 64 + +#define RD4(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, uart_regofs((bas), (reg))) +#define WR4(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, uart_regofs((bas), (reg)), \ + (value)) + +/* Register definitions for Cadence UART Controller. + */ +#define CDNC_UART_CTRL_REG 0x00 /* Control Register. */ +#define CDNC_UART_CTRL_REG_STOPBRK (1<<8) +#define CDNC_UART_CTRL_REG_STARTBRK (1<<7) +#define CDNC_UART_CTRL_REG_TORST (1<<6) +#define CDNC_UART_CTRL_REG_TX_DIS (1<<5) +#define CDNC_UART_CTRL_REG_TX_EN (1<<4) +#define CDNC_UART_CTRL_REG_RX_DIS (1<<3) +#define CDNC_UART_CTRL_REG_RX_EN (1<<2) +#define CDNC_UART_CTRL_REG_TXRST (1<<1) +#define CDNC_UART_CTRL_REG_RXRST (1<<0) + +#define CDNC_UART_MODE_REG 0x04 /* Mode Register. */ +#define CDNC_UART_MODE_REG_CHMOD_R_LOOP (3<<8) /* [9:8] - channel mode */ +#define CDNC_UART_MODE_REG_CHMOD_L_LOOP (2<<8) +#define CDNC_UART_MODE_REG_CHMOD_AUTECHO (1<<8) +#define CDNC_UART_MODE_REG_STOP2 (2<<6) /* [7:6] - stop bits */ +#define CDNC_UART_MODE_REG_PAR_NONE (4<<3) /* [5:3] - parity type */ +#define CDNC_UART_MODE_REG_PAR_MARK (3<<3) +#define CDNC_UART_MODE_REG_PAR_SPACE (2<<3) +#define CDNC_UART_MODE_REG_PAR_ODD (1<<3) +#define CDNC_UART_MODE_REG_PAR_EVEN (0<<3) +#define CDNC_UART_MODE_REG_6BIT (3<<1) /* [2:1] - character len */ +#define CDNC_UART_MODE_REG_7BIT (2<<1) +#define CDNC_UART_MODE_REG_8BIT (0<<1) +#define CDNC_UART_MODE_REG_CLKSEL (1<<0) + +#define CDNC_UART_IEN_REG 0x08 /* Interrupt registers. */ +#define CDNC_UART_IDIS_REG 0x0C +#define CDNC_UART_IMASK_REG 0x10 +#define CDNC_UART_ISTAT_REG 0x14 +#define CDNC_UART_INT_TXOVR (1<<12) +#define CDNC_UART_INT_TXNRLYFUL (1<<11) /* tx "nearly" full */ +#define CDNC_UART_INT_TXTRIG (1<<10) +#define CDNC_UART_INT_DMSI (1<<9) /* delta modem status */ +#define CDNC_UART_INT_RXTMOUT (1<<8) +#define CDNC_UART_INT_PARITY (1<<7) +#define CDNC_UART_INT_FRAMING (1<<6) +#define CDNC_UART_INT_RXOVR (1<<5) +#define CDNC_UART_INT_TXFULL (1<<4) +#define CDNC_UART_INT_TXEMPTY (1<<3) +#define CDNC_UART_INT_RXFULL (1<<2) +#define CDNC_UART_INT_RXEMPTY (1<<1) +#define CDNC_UART_INT_RXTRIG (1<<0) +#define CDNC_UART_INT_ALL 0x1FFF + +#define CDNC_UART_BAUDGEN_REG 0x18 +#define CDNC_UART_RX_TIMEO_REG 0x1C +#define CDNC_UART_RX_WATER_REG 0x20 + +#define CDNC_UART_MODEM_CTRL_REG 0x24 +#define CDNC_UART_MODEM_CTRL_REG_FCM (1<<5) /* automatic flow control */ +#define CDNC_UART_MODEM_CTRL_REG_RTS (1<<1) +#define CDNC_UART_MODEM_CTRL_REG_DTR (1<<0) + +#define CDNC_UART_MODEM_STAT_REG 0x28 +#define CDNC_UART_MODEM_STAT_REG_FCMS (1<<8) /* flow control mode (rw) */ +#define CDNC_UART_MODEM_STAT_REG_DCD (1<<7) +#define CDNC_UART_MODEM_STAT_REG_RI (1<<6) +#define CDNC_UART_MODEM_STAT_REG_DSR (1<<5) +#define CDNC_UART_MODEM_STAT_REG_CTS (1<<4) +#define CDNC_UART_MODEM_STAT_REG_DDCD (1<<3) /* change in DCD (w1tc) */ +#define CDNC_UART_MODEM_STAT_REG_TERI (1<<2) /* trail edge ring (w1tc) */ +#define CDNC_UART_MODEM_STAT_REG_DDSR (1<<1) /* change in DSR (w1tc) */ +#define CDNC_UART_MODEM_STAT_REG_DCTS (1<<0) /* change in CTS (w1tc) */ + +#define CDNC_UART_CHAN_STAT_REG 0x2C /* Channel status register. */ +#define CDNC_UART_CHAN_STAT_REG_TXNRLYFUL (1<<14) /* tx "nearly" full */ +#define CDNC_UART_CHAN_STAT_REG_TXTRIG (1<<13) +#define CDNC_UART_CHAN_STAT_REG_FDELT (1<<12) +#define CDNC_UART_CHAN_STAT_REG_TXACTIVE (1<<11) +#define CDNC_UART_CHAN_STAT_REG_RXACTIVE (1<<10) +#define CDNC_UART_CHAN_STAT_REG_TXFULL (1<<4) +#define CDNC_UART_CHAN_STAT_REG_TXEMPTY (1<<3) +#define CDNC_UART_CHAN_STAT_REG_RXEMPTY (1<<1) +#define CDNC_UART_CHAN_STAT_REG_RXTRIG (1<<0) + +#define CDNC_UART_FIFO 0x30 /* Data FIFO (tx and rx) */ +#define CDNC_UART_BAUDDIV_REG 0x34 +#define CDNC_UART_FLOWDEL_REG 0x38 +#define CDNC_UART_TX_WATER_REG 0x44 + + +/* + * Low-level UART interface. + */ +static int cdnc_uart_probe(struct uart_bas *bas); +static void cdnc_uart_init(struct uart_bas *bas, int, int, int, int); +static void cdnc_uart_term(struct uart_bas *bas); +static void cdnc_uart_putc(struct uart_bas *bas, int); +static int cdnc_uart_rxready(struct uart_bas *bas); +static int cdnc_uart_getc(struct uart_bas *bas, struct mtx *mtx); + +extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + +static struct uart_ops cdnc_uart_ops = { + .probe = cdnc_uart_probe, + .init = cdnc_uart_init, + .term = cdnc_uart_term, + .putc = cdnc_uart_putc, + .rxready = cdnc_uart_rxready, + .getc = cdnc_uart_getc, +}; + +#define SIGCHG(c, i, s, d) \ + if (c) { \ + i |= (i & s) ? s : s | d; \ + } else { \ + i = (i & s) ? (i & ~s) | d : i; \ + } + +static int +cdnc_uart_probe(struct uart_bas *bas) +{ + + return (0); +} + +static int +cdnc_uart_set_baud(struct uart_bas *bas, int baudrate) +{ + uint32_t baudgen, bauddiv; + uint32_t best_bauddiv, best_baudgen, best_error; + uint32_t baud_out, err; + + best_bauddiv = 0; + best_baudgen = 0; + best_error = ~0; + + /* Try all possible bauddiv values and pick best match. */ + for (bauddiv = 4; bauddiv <= 255; bauddiv++) { + baudgen = (bas->rclk + (baudrate * (bauddiv + 1)) / 2) / + (baudrate * (bauddiv + 1)); + if (baudgen < 1 || baudgen > 0xffff) + continue; + + baud_out = bas->rclk / (baudgen * (bauddiv + 1)); + err = baud_out > baudrate ? + baud_out - baudrate : baudrate - baud_out; + + if (err < best_error) { + best_error = err; + best_bauddiv = bauddiv; + best_baudgen = baudgen; + } + } + + if (best_bauddiv > 0) { + WR4(bas, CDNC_UART_BAUDDIV_REG, best_bauddiv); + WR4(bas, CDNC_UART_BAUDGEN_REG, best_baudgen); + return (0); + } else + return (-1); /* out of range */ +} + +static int +cdnc_uart_set_params(struct uart_bas *bas, int baudrate, int databits, + int stopbits, int parity) +{ + uint32_t mode_reg_value = 0; + + switch (databits) { + case 6: + mode_reg_value |= CDNC_UART_MODE_REG_6BIT; + break; + case 7: + mode_reg_value |= CDNC_UART_MODE_REG_7BIT; + break; + case 8: + default: + mode_reg_value |= CDNC_UART_MODE_REG_8BIT; + break; + } + + if (stopbits == 2) + mode_reg_value |= CDNC_UART_MODE_REG_STOP2; + + switch (parity) { + case UART_PARITY_MARK: + mode_reg_value |= CDNC_UART_MODE_REG_PAR_MARK; + break; + case UART_PARITY_SPACE: + mode_reg_value |= CDNC_UART_MODE_REG_PAR_SPACE; + break; + case UART_PARITY_ODD: + mode_reg_value |= CDNC_UART_MODE_REG_PAR_ODD; + break; + case UART_PARITY_EVEN: + mode_reg_value |= CDNC_UART_MODE_REG_PAR_EVEN; + break; + case UART_PARITY_NONE: + default: + mode_reg_value |= CDNC_UART_MODE_REG_PAR_NONE; + break; + } + + WR4(bas, CDNC_UART_MODE_REG, mode_reg_value); + + if (baudrate > 0 && cdnc_uart_set_baud(bas, baudrate) < 0) + return (EINVAL); + + return(0); +} + +static void +cdnc_uart_hw_init(struct uart_bas *bas) +{ + + /* Reset RX and TX. */ + WR4(bas, CDNC_UART_CTRL_REG, + CDNC_UART_CTRL_REG_RXRST | CDNC_UART_CTRL_REG_TXRST); + + /* Interrupts all off. */ + WR4(bas, CDNC_UART_IDIS_REG, CDNC_UART_INT_ALL); + WR4(bas, CDNC_UART_ISTAT_REG, CDNC_UART_INT_ALL); + + /* Clear delta bits. */ + WR4(bas, CDNC_UART_MODEM_STAT_REG, + CDNC_UART_MODEM_STAT_REG_DDCD | CDNC_UART_MODEM_STAT_REG_TERI | + CDNC_UART_MODEM_STAT_REG_DDSR | CDNC_UART_MODEM_STAT_REG_DCTS); + + /* RX FIFO water level, stale timeout */ + WR4(bas, CDNC_UART_RX_WATER_REG, UART_FIFO_SIZE/2); + WR4(bas, CDNC_UART_RX_TIMEO_REG, 10); + + /* TX FIFO water level (not used.) */ + WR4(bas, CDNC_UART_TX_WATER_REG, UART_FIFO_SIZE/2); + + /* Bring RX and TX online. */ + WR4(bas, CDNC_UART_CTRL_REG, + CDNC_UART_CTRL_REG_RX_EN | CDNC_UART_CTRL_REG_TX_EN | + CDNC_UART_CTRL_REG_TORST | CDNC_UART_CTRL_REG_STOPBRK); + + /* Set DTR and RTS. */ + WR4(bas, CDNC_UART_MODEM_CTRL_REG, CDNC_UART_MODEM_CTRL_REG_DTR | + CDNC_UART_MODEM_CTRL_REG_RTS); +} + +/* + * Initialize this device for use as a console. + */ +static void +cdnc_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + + /* Initialize hardware. */ + cdnc_uart_hw_init(bas); + + /* Set baudrate, parameters. */ + (void)cdnc_uart_set_params(bas, baudrate, databits, stopbits, parity); +} + +/* + * Free resources now that we're no longer the console. This appears to + * be never called, and I'm unsure quite what to do if I am called. + */ +static void +cdnc_uart_term(struct uart_bas *bas) +{ + + /* XXX */ +} + +/* + * Put a character of console output (so we do it here polling rather than + * interrutp driven). + */ +static void +cdnc_uart_putc(struct uart_bas *bas, int c) +{ + + /* Wait for room. */ + while ((RD4(bas,CDNC_UART_CHAN_STAT_REG) & + CDNC_UART_CHAN_STAT_REG_TXFULL) != 0) + ; + + WR4(bas, CDNC_UART_FIFO, c); + + while ((RD4(bas,CDNC_UART_CHAN_STAT_REG) & + CDNC_UART_CHAN_STAT_REG_TXEMPTY) == 0) + ; +} + +/* + * Check for a character available. + */ +static int +cdnc_uart_rxready(struct uart_bas *bas) +{ + + return ((RD4(bas, CDNC_UART_CHAN_STAT_REG) & + CDNC_UART_CHAN_STAT_REG_RXEMPTY) == 0); +} + +/* + * Block waiting for a character. + */ +static int +cdnc_uart_getc(struct uart_bas *bas, struct mtx *mtx) +{ + int c; + + uart_lock(mtx); + + while ((RD4(bas, CDNC_UART_CHAN_STAT_REG) & + CDNC_UART_CHAN_STAT_REG_RXEMPTY) != 0) { + uart_unlock(mtx); + DELAY(4); + uart_lock(mtx); + } + + c = RD4(bas, CDNC_UART_FIFO); + + uart_unlock(mtx); + + c &= 0xff; + return (c); +} + +/*****************************************************************************/ +/* + * High-level UART interface. + */ + +static int cdnc_uart_bus_probe(struct uart_softc *sc); +static int cdnc_uart_bus_attach(struct uart_softc *sc); +static int cdnc_uart_bus_flush(struct uart_softc *, int); +static int cdnc_uart_bus_getsig(struct uart_softc *); +static int cdnc_uart_bus_ioctl(struct uart_softc *, int, intptr_t); +static int cdnc_uart_bus_ipend(struct uart_softc *); +static int cdnc_uart_bus_param(struct uart_softc *, int, int, int, int); +static int cdnc_uart_bus_receive(struct uart_softc *); +static int cdnc_uart_bus_setsig(struct uart_softc *, int); +static int cdnc_uart_bus_transmit(struct uart_softc *); + +static kobj_method_t cdnc_uart_bus_methods[] = { + KOBJMETHOD(uart_probe, cdnc_uart_bus_probe), + KOBJMETHOD(uart_attach, cdnc_uart_bus_attach), + KOBJMETHOD(uart_flush, cdnc_uart_bus_flush), + KOBJMETHOD(uart_getsig, cdnc_uart_bus_getsig), + KOBJMETHOD(uart_ioctl, cdnc_uart_bus_ioctl), + KOBJMETHOD(uart_ipend, cdnc_uart_bus_ipend), + KOBJMETHOD(uart_param, cdnc_uart_bus_param), + KOBJMETHOD(uart_receive, cdnc_uart_bus_receive), + KOBJMETHOD(uart_setsig, cdnc_uart_bus_setsig), + KOBJMETHOD(uart_transmit, cdnc_uart_bus_transmit), + + KOBJMETHOD_END +}; + +int +cdnc_uart_bus_probe(struct uart_softc *sc) +{ + + sc->sc_txfifosz = UART_FIFO_SIZE; + sc->sc_rxfifosz = UART_FIFO_SIZE; + sc->sc_hwiflow = 0; + sc->sc_hwoflow = 0; + + device_set_desc(sc->sc_dev, "Cadence UART"); + + return (0); +} + +static int +cdnc_uart_bus_attach(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + struct uart_devinfo *di; + + if (sc->sc_sysdev != NULL) { + di = sc->sc_sysdev; + (void)cdnc_uart_set_params(bas, di->baudrate, di->databits, + di->stopbits, di->parity); + } else + cdnc_uart_hw_init(bas); + + (void)cdnc_uart_bus_getsig(sc); + + /* Enable interrupts. */ + WR4(bas, CDNC_UART_IEN_REG, + CDNC_UART_INT_RXTRIG | CDNC_UART_INT_RXTMOUT | + CDNC_UART_INT_TXOVR | CDNC_UART_INT_RXOVR | + CDNC_UART_INT_DMSI); + + return (0); +} + +static int +cdnc_uart_bus_transmit(struct uart_softc *sc) +{ + int i; + struct uart_bas *bas = &sc->sc_bas; + + uart_lock(sc->sc_hwmtx); + + /* Clear sticky TXEMPTY status bit. */ + WR4(bas, CDNC_UART_ISTAT_REG, CDNC_UART_INT_TXEMPTY); + + for (i = 0; i < sc->sc_txdatasz; i++) + WR4(bas, CDNC_UART_FIFO, sc->sc_txbuf[i]); + + /* Enable TX empty interrupt. */ + WR4(bas, CDNC_UART_IEN_REG, CDNC_UART_INT_TXEMPTY); + sc->sc_txbusy = 1; + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +cdnc_uart_bus_setsig(struct uart_softc *sc, int sig) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t new, old, modem_ctrl; + + do { + old = sc->sc_hwsig; + new = old; + if (sig & SER_DDTR) { + SIGCHG(sig & SER_DTR, new, SER_DTR, SER_DDTR); + } + if (sig & SER_DRTS) { + SIGCHG(sig & SER_RTS, new, SER_RTS, SER_DRTS); + } + } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); + uart_lock(sc->sc_hwmtx); + modem_ctrl = RD4(bas, CDNC_UART_MODEM_CTRL_REG) & + ~(CDNC_UART_MODEM_CTRL_REG_DTR | CDNC_UART_MODEM_CTRL_REG_RTS); + if ((new & SER_DTR) != 0) + modem_ctrl |= CDNC_UART_MODEM_CTRL_REG_DTR; + if ((new & SER_RTS) != 0) + modem_ctrl |= CDNC_UART_MODEM_CTRL_REG_RTS; + WR4(bas, CDNC_UART_MODEM_CTRL_REG, modem_ctrl); + + uart_unlock(sc->sc_hwmtx); + return (0); +} + +static int +cdnc_uart_bus_receive(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t status; + int c, c_status = 0; + + uart_lock(sc->sc_hwmtx); + + /* Check for parity or framing errors and clear the status bits. */ + status = RD4(bas, CDNC_UART_ISTAT_REG); + if ((status & (CDNC_UART_INT_FRAMING | CDNC_UART_INT_PARITY)) != 0) { + WR4(bas, CDNC_UART_ISTAT_REG, + status & (CDNC_UART_INT_FRAMING | CDNC_UART_INT_PARITY)); + if ((status & CDNC_UART_INT_PARITY) != 0) + c_status |= UART_STAT_PARERR; + if ((status & CDNC_UART_INT_FRAMING) != 0) + c_status |= UART_STAT_FRAMERR; + } + + while ((RD4(bas, CDNC_UART_CHAN_STAT_REG) & + CDNC_UART_CHAN_STAT_REG_RXEMPTY) == 0) { + c = RD4(bas, CDNC_UART_FIFO) & 0xff; +#ifdef KDB + /* Detect break and drop into debugger. */ + if (c == 0 && (c_status & UART_STAT_FRAMERR) != 0 && + sc->sc_sysdev != NULL && + sc->sc_sysdev->type == UART_DEV_CONSOLE) { + kdb_break(); + WR4(bas, CDNC_UART_ISTAT_REG, CDNC_UART_INT_FRAMING); + } +#endif + uart_rx_put(sc, c | c_status); + } + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +cdnc_uart_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + + return (cdnc_uart_set_params(&sc->sc_bas, baudrate, + databits, stopbits, parity)); +} + +static int +cdnc_uart_bus_ipend(struct uart_softc *sc) +{ + int ipend = 0; + struct uart_bas *bas = &sc->sc_bas; + uint32_t istatus; + + uart_lock(sc->sc_hwmtx); + + istatus = RD4(bas, CDNC_UART_ISTAT_REG); + + /* Clear interrupt bits. */ + WR4(bas, CDNC_UART_ISTAT_REG, istatus & + (CDNC_UART_INT_RXTRIG | CDNC_UART_INT_RXTMOUT | + CDNC_UART_INT_TXOVR | CDNC_UART_INT_RXOVR | + CDNC_UART_INT_TXEMPTY | CDNC_UART_INT_DMSI)); + + /* Receive data. */ + if ((istatus & (CDNC_UART_INT_RXTRIG | CDNC_UART_INT_RXTMOUT)) != 0) + ipend |= SER_INT_RXREADY; + + /* Transmit fifo empty. */ + if (sc->sc_txbusy && (istatus & CDNC_UART_INT_TXEMPTY) != 0) { + /* disable txempty interrupt. */ + WR4(bas, CDNC_UART_IDIS_REG, CDNC_UART_INT_TXEMPTY); + ipend |= SER_INT_TXIDLE; + } + + /* TX Overflow. */ + if ((istatus & CDNC_UART_INT_TXOVR) != 0) + ipend |= SER_INT_OVERRUN; + + /* RX Overflow. */ + if ((istatus & CDNC_UART_INT_RXOVR) != 0) + ipend |= SER_INT_OVERRUN; + + /* Modem signal change. */ + if ((istatus & CDNC_UART_INT_DMSI) != 0) { + WR4(bas, CDNC_UART_MODEM_STAT_REG, + CDNC_UART_MODEM_STAT_REG_DDCD | + CDNC_UART_MODEM_STAT_REG_TERI | + CDNC_UART_MODEM_STAT_REG_DDSR | + CDNC_UART_MODEM_STAT_REG_DCTS); + ipend |= SER_INT_SIGCHG; + } + + uart_unlock(sc->sc_hwmtx); + return (ipend); +} + +static int +cdnc_uart_bus_flush(struct uart_softc *sc, int what) +{ + + return (0); +} + +static int +cdnc_uart_bus_getsig(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t new, old, sig; + uint8_t modem_status; + + do { + old = sc->sc_hwsig; + sig = old; + uart_lock(sc->sc_hwmtx); + modem_status = RD4(bas, CDNC_UART_MODEM_STAT_REG); + uart_unlock(sc->sc_hwmtx); + SIGCHG(modem_status & CDNC_UART_MODEM_STAT_REG_DSR, + sig, SER_DSR, SER_DDSR); + SIGCHG(modem_status & CDNC_UART_MODEM_STAT_REG_CTS, + sig, SER_CTS, SER_DCTS); + SIGCHG(modem_status & CDNC_UART_MODEM_STAT_REG_DCD, + sig, SER_DCD, SER_DDCD); + SIGCHG(modem_status & CDNC_UART_MODEM_STAT_REG_RI, + sig, SER_RI, SER_DRI); + new = sig & ~SER_MASK_DELTA; + } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); + return (sig); +} + +static int +cdnc_uart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t uart_ctrl, modem_ctrl; + int error = 0; + + uart_lock(sc->sc_hwmtx); + + switch (request) { + case UART_IOCTL_BREAK: + uart_ctrl = RD4(bas, CDNC_UART_CTRL_REG); + if (data) { + uart_ctrl |= CDNC_UART_CTRL_REG_STARTBRK; + uart_ctrl &= ~CDNC_UART_CTRL_REG_STOPBRK; + } else { + uart_ctrl |= CDNC_UART_CTRL_REG_STOPBRK; + uart_ctrl &= ~CDNC_UART_CTRL_REG_STARTBRK; + } + WR4(bas, CDNC_UART_CTRL_REG, uart_ctrl); + break; + case UART_IOCTL_IFLOW: + modem_ctrl = RD4(bas, CDNC_UART_MODEM_CTRL_REG); + if (data) + modem_ctrl |= CDNC_UART_MODEM_CTRL_REG_RTS; + else + modem_ctrl &= ~CDNC_UART_MODEM_CTRL_REG_RTS; + WR4(bas, CDNC_UART_MODEM_CTRL_REG, modem_ctrl); + break; + default: + error = EINVAL; + break; + } + + uart_unlock(sc->sc_hwmtx); + + return (error); +} + +struct uart_class uart_cdnc_class = { + "cdnc_uart", + cdnc_uart_bus_methods, + sizeof(struct uart_softc), + .uc_ops = &cdnc_uart_ops, + .uc_range = 8 +}; Added: head/sys/arm/xilinx/zedboard/files.zedboard ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zedboard/files.zedboard Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,9 @@ +# +# files.zedboard +# +# $FreeBSD$ + +# We'll need board specific files once we start implementing drivers +# for Zedboard PL peripherals such as HDMI, VGA, or Audio Codecs. For +# now, nothing is needed. +# Added: head/sys/arm/xilinx/zedboard/std.zedboard ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zedboard/std.zedboard Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,8 @@ +# +# std.zedboard +# +# $FreeBSD$ + +include "../xilinx/std.zynq7" +files "../xilinx/zedboard/files.zedboard" + Added: head/sys/arm/xilinx/zy7_bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_bus_space.c Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,113 @@ +/*- + * Copyright (C) 2012 FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY 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 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 + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space _base_tag = { + /* cookie */ + .bs_cookie = (void *) 0, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read (single) */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = NULL, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = NULL, + + /* read region */ + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = NULL, + + /* write (single) */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = NULL, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = NULL, + + /* write region */ + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = NULL, + + /* set multiple */ + /* XXX not implemented */ + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = NULL, + .bs_c_8 = NULL, +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Added: head/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_devcfg.c Sat Apr 27 22:38:29 2013 (r249997) @@ -0,0 +1,650 @@ +/*- + * Copyright (C) 2013, Thomas Skibo. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 22:47:55 2013 Return-Path: Delivered-To: svn-src-head@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 C775ACFD; Sat, 27 Apr 2013 22:47:55 +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 B9B401DE4; Sat, 27 Apr 2013 22:47: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 r3RMlt19000748; Sat, 27 Apr 2013 22:47:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RMlr6g000730; Sat, 27 Apr 2013 22:47:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304272247.r3RMlr6g000730@svn.freebsd.org> From: Dimitry Andric Date: Sat, 27 Apr 2013 22:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249998 - in head/contrib/libc++: . include include/ext src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 22:47:55 -0000 Author: dim Date: Sat Apr 27 22:47:52 2013 New Revision: 249998 URL: http://svnweb.freebsd.org/changeset/base/249998 Log: Merge libc++ trunk r180598. Contains several minor cleanups and bug fixes, no major changes. MFC after: 2 weeks Modified: head/contrib/libc++/CREDITS.TXT head/contrib/libc++/LICENSE.TXT head/contrib/libc++/include/__bit_reference head/contrib/libc++/include/__config head/contrib/libc++/include/__debug head/contrib/libc++/include/__functional_03 head/contrib/libc++/include/__functional_base head/contrib/libc++/include/__functional_base_03 head/contrib/libc++/include/__hash_table head/contrib/libc++/include/__locale head/contrib/libc++/include/__mutex_base head/contrib/libc++/include/__std_stream head/contrib/libc++/include/__tree head/contrib/libc++/include/__tuple head/contrib/libc++/include/__tuple_03 head/contrib/libc++/include/algorithm head/contrib/libc++/include/array head/contrib/libc++/include/bitset head/contrib/libc++/include/chrono head/contrib/libc++/include/codecvt head/contrib/libc++/include/complex head/contrib/libc++/include/condition_variable head/contrib/libc++/include/cstddef head/contrib/libc++/include/cstring head/contrib/libc++/include/cwchar head/contrib/libc++/include/deque head/contrib/libc++/include/exception head/contrib/libc++/include/ext/__hash head/contrib/libc++/include/ext/hash_map head/contrib/libc++/include/ext/hash_set head/contrib/libc++/include/forward_list head/contrib/libc++/include/fstream head/contrib/libc++/include/functional head/contrib/libc++/include/future head/contrib/libc++/include/initializer_list head/contrib/libc++/include/ios head/contrib/libc++/include/iosfwd head/contrib/libc++/include/iostream head/contrib/libc++/include/istream head/contrib/libc++/include/iterator head/contrib/libc++/include/limits head/contrib/libc++/include/list head/contrib/libc++/include/locale head/contrib/libc++/include/map head/contrib/libc++/include/memory head/contrib/libc++/include/mutex head/contrib/libc++/include/new head/contrib/libc++/include/ostream head/contrib/libc++/include/queue head/contrib/libc++/include/random head/contrib/libc++/include/ratio head/contrib/libc++/include/regex head/contrib/libc++/include/scoped_allocator head/contrib/libc++/include/set head/contrib/libc++/include/sstream head/contrib/libc++/include/stack head/contrib/libc++/include/streambuf head/contrib/libc++/include/string head/contrib/libc++/include/strstream head/contrib/libc++/include/system_error head/contrib/libc++/include/thread head/contrib/libc++/include/tuple head/contrib/libc++/include/type_traits head/contrib/libc++/include/typeindex head/contrib/libc++/include/unordered_map head/contrib/libc++/include/unordered_set head/contrib/libc++/include/utility head/contrib/libc++/include/valarray head/contrib/libc++/include/vector head/contrib/libc++/src/chrono.cpp head/contrib/libc++/src/debug.cpp head/contrib/libc++/src/exception.cpp head/contrib/libc++/src/hash.cpp head/contrib/libc++/src/iostream.cpp head/contrib/libc++/src/locale.cpp head/contrib/libc++/src/memory.cpp head/contrib/libc++/src/new.cpp head/contrib/libc++/src/stdexcept.cpp head/contrib/libc++/src/string.cpp head/contrib/libc++/src/strstream.cpp head/contrib/libc++/src/system_error.cpp head/contrib/libc++/src/thread.cpp head/contrib/libc++/src/typeinfo.cpp Directory Properties: head/contrib/libc++/ (props changed) Modified: head/contrib/libc++/CREDITS.TXT ============================================================================== --- head/contrib/libc++/CREDITS.TXT Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/CREDITS.TXT Sat Apr 27 22:47:52 2013 (r249998) @@ -8,69 +8,88 @@ beautification by scripts. The fields a (W), PGP key ID and fingerprint (P), description (D), and snail-mail address (S). -N: Howard Hinnant -E: hhinnant@apple.com -D: Architect and primary author of libc++ +N: Saleem Abdulrasool +E: compnerd@compnerd.org +D: Minor patches and Linux fixes. + +N: Dimitry Andric +E: dimitry@andric.com +D: Visibility fixes, minor FreeBSD portability patches. + +N: Holger Arnold +E: holgerar@gmail.com +D: Minor fix. + +N: Ruben Van Boxem +E: vanboxem dot ruben at gmail dot com +D: Initial Windows patches. + +N: David Chisnall +E: theraven at theravensnest dot org +D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. N: Marshall Clow E: mclow.lists@gmail.com E: marshall@idio.com D: Minor patches and bug fixes. -N: Bjorn Reese -E: breese@users.sourceforge.net -D: Initial regex prototype +N: Google Inc. +D: Copyright owner and contributor of the CityHash algorithm -N: David Chisnall -E: theraven at theravensnest dot org -D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of libc++ -N: Ruben Van Boxem -E: vanboxem dot ruben at gmail dot com -D: Initial Windows patches. +N: Hyeon-bin Jeong +E: tuhertz@gmail.com +D: Minor patches and bug fixes. + +N: Argyrios Kyrtzidis +E: kyrtzidis@apple.com +D: Bug fixes. + +N: Michel Morin +E: mimomorin@gmail.com +D: Minor patches to is_convertible. + +N: Andrew Morrow +E: andrew.c.morrow@gmail.com +D: Minor patches and Linux fixes. N: Arvid Picciani E: aep at exys dot org D: Minor patches and musl port. -N: Craig Silverstein -E: csilvers@google.com -D: Implemented Cityhash as the string hash function on 64-bit machines - -N: Google Inc. -D: Copyright owner and contributor of the CityHash algorithm - -N: Jeffrey Yasskin -E: jyasskin@gmail.com -E: jyasskin@google.com -D: Linux fixes. +N: Bjorn Reese +E: breese@users.sourceforge.net +D: Initial regex prototype N: Jonathan Sauer D: Minor patches, mostly related to constexpr +N: Craig Silverstein +E: csilvers@google.com +D: Implemented Cityhash as the string hash function on 64-bit machines + N: Richard Smith D: Minor patches. -N: Andrew Morrow -E: andrew.c.morrow@gmail.com -D: Minor patches and Linux fixes. +N: Michael van der Westhuizen +E: r1mikey at gmail dot com -N: Hyeon-bin Jeong -E: tuhertz@gmail.com -D: Minor patches and bug fixes. +N: Klaas de Vries +E: klaas at klaasgaaf dot nl +D: Minor bug fix. -N: Michel Morin -E: mimomorin@gmail.com -D: Minor patches to is_convertible. - -N: Dimitry Andric -E: dimitry@andric.com -D: Visibility fixes, minor FreeBSD portability patches. +N: Zhang Xiongpang +E: zhangxiongpang@gmail.com +D: Minor patches and bug fixes. -N: Holger Arnold -E: holgerar@gmail.com -D: Minor fix. +N: Jeffrey Yasskin +E: jyasskin@gmail.com +E: jyasskin@google.com +D: Linux fixes. -N: Argyrios Kyrtzidis -E: kyrtzidis@apple.com -D: Bug fixes. +N: Bruce Mitchener, Jr. +E: bruce.mitchener@gmail.com +D: Emscripten-related changes. Modified: head/contrib/libc++/LICENSE.TXT ============================================================================== --- head/contrib/libc++/LICENSE.TXT Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/LICENSE.TXT Sat Apr 27 22:47:52 2013 (r249998) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal Modified: head/contrib/libc++/include/__bit_reference ============================================================================== --- head/contrib/libc++/include/__bit_reference Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__bit_reference Sat Apr 27 22:47:52 2013 (r249998) @@ -81,6 +81,16 @@ class __bit_reference<_Cp, false> { }; +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + template _LIBCPP_INLINE_VISIBILITY inline void Modified: head/contrib/libc++/include/__config ============================================================================== --- head/contrib/libc++/include/__config Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__config Sat Apr 27 22:47:52 2013 (r249998) @@ -11,7 +11,7 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG -#if !_MSC_VER // explicit macro necessary because it is only defined below in this file +#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file #pragma GCC system_header #endif @@ -96,24 +96,27 @@ # endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) -#if _WIN32 +#ifdef _WIN32 // only really useful for a DLL #ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... # ifdef cxx_EXPORTS # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE __declspec(dllexport) +# define _LIBCPP_FUNC_VIS __declspec(dllexport) +# define _LIBCPP_TYPE_VIS __declspec(dllexport) # else # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE __declspec(dllimport) +# define _LIBCPP_FUNC_VIS __declspec(dllimport) +# define _LIBCPP_TYPE_VIS __declspec(dllimport) # endif #else # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE +# define _LIBCPP_FUNC_VIS +# define _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_INLINE_VISIBILITY -# if _MSC_VER +# ifdef _MSC_VER # define _LIBCPP_INLINE_VISIBILITY __forceinline # else // MinGW GCC and Clang # define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) @@ -121,11 +124,11 @@ #endif #ifndef _LIBCPP_EXCEPTION_ABI -#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_ALWAYS_INLINE -# if _MSC_VER +# ifdef _MSC_VER # define _LIBCPP_ALWAYS_INLINE __forceinline # endif #endif @@ -136,8 +139,16 @@ #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) #endif -#ifndef _LIBCPP_VISIBLE -#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default"))) +#ifndef _LIBCPP_FUNC_VIS +#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) +#endif + +#ifndef _LIBCPP_TYPE_VIS +# if __has_attribute(type_visibility) +# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) +# else +# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) +# endif #endif #ifndef _LIBCPP_INLINE_VISIBILITY @@ -145,7 +156,7 @@ #endif #ifndef _LIBCPP_EXCEPTION_ABI -#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_CANTTHROW @@ -261,7 +272,7 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CONSTEXPR #endif -#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) +#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES #endif @@ -424,7 +435,7 @@ template struct __static_asse #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx +#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ __lx __v_; \ _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ @@ -432,7 +443,7 @@ template struct __static_asse _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x +#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS @@ -440,18 +451,18 @@ template struct __static_asse #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; #endif -#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif -#if __FreeBSD__ +#ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 #endif -#if __APPLE__ || __FreeBSD__ +#if defined(__APPLE__) || defined(__FreeBSD__) #define _LIBCPP_HAS_DEFAULTRUNELOCALE #endif -#if __APPLE__ || __FreeBSD__ || __sun__ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) #define _LIBCPP_WCTYPE_IS_MASK #endif Modified: head/contrib/libc++/include/__debug ============================================================================== --- head/contrib/libc++/include/__debug Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__debug Sat Apr 27 22:47:52 2013 (r249998) @@ -16,7 +16,9 @@ # include # include # include -# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) +# ifndef _LIBCPP_ASSERT +# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) +# endif #endif @@ -24,9 +26,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD -struct _LIBCPP_VISIBLE __c_node; +struct _LIBCPP_TYPE_VIS __c_node; -struct _LIBCPP_VISIBLE __i_node +struct _LIBCPP_TYPE_VIS __i_node { void* __i_; __i_node* __next_; @@ -40,7 +42,7 @@ struct _LIBCPP_VISIBLE __i_node ~__i_node(); }; -struct _LIBCPP_VISIBLE __c_node +struct _LIBCPP_TYPE_VIS __c_node { void* __c_; __c_node* __next_; @@ -117,7 +119,7 @@ _C_node<_Cont>::__subscriptable(const vo return _Cp->__subscriptable(__j, __n); } -class _LIBCPP_VISIBLE __libcpp_db +class _LIBCPP_TYPE_VIS __libcpp_db { __c_node** __cbeg_; __c_node** __cend_; @@ -176,11 +178,11 @@ private: _LIBCPP_HIDDEN __i_node* __find_iterator(const void* __i) const; - friend _LIBCPP_VISIBLE __libcpp_db* __get_db(); + friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db(); }; -_LIBCPP_VISIBLE __libcpp_db* __get_db(); -_LIBCPP_VISIBLE const __libcpp_db* __get_const_db(); +_LIBCPP_FUNC_VIS __libcpp_db* __get_db(); +_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db(); _LIBCPP_END_NAMESPACE_STD Modified: head/contrib/libc++/include/__functional_03 ============================================================================== --- head/contrib/libc++/include/__functional_03 Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__functional_03 Sat Apr 27 22:47:52 2013 (r249998) @@ -203,7 +203,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function { }; -template class _LIBCPP_VISIBLE function; // undefined +template class _LIBCPP_TYPE_VIS function; // undefined namespace __function { @@ -644,7 +644,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>: } // __function template -class _LIBCPP_VISIBLE function<_Rp()> +class _LIBCPP_TYPE_VIS function<_Rp()> { typedef __function::__base<_Rp()> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -928,7 +928,7 @@ function<_Rp()>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_VISIBLE function<_Rp(_A0)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0)> : public unary_function<_A0, _Rp> { typedef __function::__base<_Rp(_A0)> __base; @@ -1230,7 +1230,7 @@ function<_Rp(_A0)>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_VISIBLE function<_Rp(_A0, _A1)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1)> : public binary_function<_A0, _A1, _Rp> { typedef __function::__base<_Rp(_A0, _A1)> __base; @@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1)>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_VISIBLE function<_Rp(_A0, _A1, _A2)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1, _A2)> { typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -1860,11 +1860,11 @@ swap(function<_Fp>& __x, function<_Fp>& {return __x.swap(__y);} template struct __is_bind_expression : public false_type {}; -template struct _LIBCPP_VISIBLE is_bind_expression +template struct _LIBCPP_TYPE_VIS is_bind_expression : public __is_bind_expression::type> {}; template struct __is_placeholder : public integral_constant {}; -template struct _LIBCPP_VISIBLE is_placeholder +template struct _LIBCPP_TYPE_VIS is_placeholder : public __is_placeholder::type> {}; namespace placeholders Modified: head/contrib/libc++/include/__functional_base ============================================================================== --- head/contrib/libc++/include/__functional_base Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__functional_base Sat Apr 27 22:47:52 2013 (r249998) @@ -23,21 +23,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -struct _LIBCPP_VISIBLE unary_function +struct _LIBCPP_TYPE_VIS unary_function { typedef _Arg argument_type; typedef _Result result_type; }; template -struct _LIBCPP_VISIBLE binary_function +struct _LIBCPP_TYPE_VIS binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; }; -template struct _LIBCPP_VISIBLE hash; +template struct _LIBCPP_TYPE_VIS hash; template struct __has_result_type @@ -51,7 +51,7 @@ public: }; template -struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TYPE_VIS less : binary_function<_Tp, _Tp, bool> { _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x < __y;} @@ -348,7 +348,7 @@ struct __invoke_return }; template -class _LIBCPP_VISIBLE reference_wrapper +class _LIBCPP_TYPE_VIS reference_wrapper : public __weak_result_type<_Tp> { public: Modified: head/contrib/libc++/include/__functional_base_03 ============================================================================== --- head/contrib/libc++/include/__functional_base_03 Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__functional_base_03 Sat Apr 27 22:47:52 2013 (r249998) @@ -996,7 +996,7 @@ struct __invoke_return2 }; template -class _LIBCPP_VISIBLE reference_wrapper +class _LIBCPP_TYPE_VIS reference_wrapper : public __weak_result_type<_Tp> { public: Modified: head/contrib/libc++/include/__hash_table ============================================================================== --- head/contrib/libc++/include/__hash_table Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__hash_table Sat Apr 27 22:47:52 2013 (r249998) @@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -_LIBCPP_VISIBLE +_LIBCPP_FUNC_VIS size_t __next_prime(size_t __n); template @@ -80,14 +80,14 @@ __next_pow2(size_t __n) } template class __hash_table; -template class _LIBCPP_VISIBLE __hash_const_iterator; -template class _LIBCPP_VISIBLE __hash_map_iterator; -template class _LIBCPP_VISIBLE __hash_map_const_iterator; +template class _LIBCPP_TYPE_VIS __hash_const_iterator; +template class _LIBCPP_TYPE_VIS __hash_map_iterator; +template class _LIBCPP_TYPE_VIS __hash_map_const_iterator; template - class _LIBCPP_VISIBLE unordered_map; + class _LIBCPP_TYPE_VIS unordered_map; template -class _LIBCPP_VISIBLE __hash_iterator +class _LIBCPP_TYPE_VIS __hash_iterator { typedef _NodePtr __node_pointer; @@ -142,14 +142,14 @@ private: {} template friend class __hash_table; - template friend class _LIBCPP_VISIBLE __hash_const_iterator; - template friend class _LIBCPP_VISIBLE __hash_map_iterator; - template friend class _LIBCPP_VISIBLE unordered_map; - template friend class _LIBCPP_VISIBLE unordered_multimap; + template friend class _LIBCPP_TYPE_VIS __hash_const_iterator; + template friend class _LIBCPP_TYPE_VIS __hash_map_iterator; + template friend class _LIBCPP_TYPE_VIS unordered_map; + template friend class _LIBCPP_TYPE_VIS unordered_multimap; }; template -class _LIBCPP_VISIBLE __hash_const_iterator +class _LIBCPP_TYPE_VIS __hash_const_iterator { typedef _ConstNodePtr __node_pointer; @@ -220,15 +220,15 @@ private: {} template friend class __hash_table; - template friend class _LIBCPP_VISIBLE __hash_map_const_iterator; - template friend class _LIBCPP_VISIBLE unordered_map; - template friend class _LIBCPP_VISIBLE unordered_multimap; + template friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator; + template friend class _LIBCPP_TYPE_VIS unordered_map; + template friend class _LIBCPP_TYPE_VIS unordered_multimap; }; -template class _LIBCPP_VISIBLE __hash_const_local_iterator; +template class _LIBCPP_TYPE_VIS __hash_const_local_iterator; template -class _LIBCPP_VISIBLE __hash_local_iterator +class _LIBCPP_TYPE_VIS __hash_local_iterator { typedef _NodePtr __node_pointer; @@ -294,12 +294,12 @@ private: } template friend class __hash_table; - template friend class _LIBCPP_VISIBLE __hash_const_local_iterator; - template friend class _LIBCPP_VISIBLE __hash_map_iterator; + template friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator; + template friend class _LIBCPP_TYPE_VIS __hash_map_iterator; }; template -class _LIBCPP_VISIBLE __hash_const_local_iterator +class _LIBCPP_TYPE_VIS __hash_const_local_iterator { typedef _ConstNodePtr __node_pointer; @@ -384,7 +384,7 @@ private: } template friend class __hash_table; - template friend class _LIBCPP_VISIBLE __hash_map_const_iterator; + template friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator; }; template Modified: head/contrib/libc++/include/__locale ============================================================================== --- head/contrib/libc++/include/__locale Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__locale Sat Apr 27 22:47:52 2013 (r249998) @@ -19,11 +19,11 @@ #include #include #include -#if _WIN32 +#ifdef _WIN32 # include -#elif (__GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__) +#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)) || defined(EMSCRIPTEN) # include -#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD_ +#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || EMSCRIPTEN #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -31,7 +31,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -class _LIBCPP_VISIBLE locale; +class _LIBCPP_TYPE_VIS locale; template _LIBCPP_INLINE_VISIBILITY @@ -43,12 +43,12 @@ _LIBCPP_INLINE_VISIBILITY const _Facet& use_facet(const locale&); -class _LIBCPP_VISIBLE locale +class _LIBCPP_TYPE_VIS locale { public: // types: - class _LIBCPP_VISIBLE facet; - class _LIBCPP_VISIBLE id; + class _LIBCPP_TYPE_VIS facet; + class _LIBCPP_TYPE_VIS id; typedef int category; static const category // values assigned here are for exposition only @@ -103,7 +103,7 @@ private: template friend const _Facet& use_facet(const locale&); }; -class _LIBCPP_VISIBLE locale::facet +class _LIBCPP_TYPE_VIS locale::facet : public __shared_count { protected: @@ -119,7 +119,7 @@ private: virtual void __on_zero_shared() _NOEXCEPT; }; -class _LIBCPP_VISIBLE locale::id +class _LIBCPP_TYPE_VIS locale::id { once_flag __flag_; int32_t __id_; @@ -175,7 +175,7 @@ use_facet(const locale& __l) // template class collate; template -class _LIBCPP_VISIBLE collate +class _LIBCPP_TYPE_VIS collate : public locale::facet { public: @@ -254,15 +254,15 @@ collate<_CharT>::do_hash(const char_type return static_cast(__h); } -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate) +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate) +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate) // template class collate_byname; -template class _LIBCPP_VISIBLE collate_byname; +template class _LIBCPP_TYPE_VIS collate_byname; template <> -class _LIBCPP_VISIBLE collate_byname +class _LIBCPP_TYPE_VIS collate_byname : public collate { locale_t __l; @@ -281,7 +281,7 @@ protected: }; template <> -class _LIBCPP_VISIBLE collate_byname +class _LIBCPP_TYPE_VIS collate_byname : public collate { locale_t __l; @@ -312,10 +312,10 @@ locale::operator()(const basic_string<_C // template class ctype -class _LIBCPP_VISIBLE ctype_base +class _LIBCPP_TYPE_VIS ctype_base { public: -#if __GLIBC__ +#ifdef __GLIBC__ typedef unsigned short mask; static const mask space = _ISspace; static const mask print = _ISprint; @@ -327,7 +327,7 @@ public: static const mask punct = _ISpunct; static const mask xdigit = _ISxdigit; static const mask blank = _ISblank; -#elif _WIN32 +#elif defined(_WIN32) typedef unsigned short mask; static const mask space = _SPACE; static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT; @@ -339,11 +339,13 @@ public: static const mask punct = _PUNCT; static const mask xdigit = _HEX; static const mask blank = _BLANK; -#elif (__APPLE__ || __FreeBSD__) -#if __APPLE__ +#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN) +#ifdef __APPLE__ typedef __uint32_t mask; -#elif __FreeBSD__ +#elif defined(__FreeBSD__) typedef unsigned long mask; +#elif defined(EMSCRIPTEN) + typedef unsigned short mask; #endif static const mask space = _CTYPE_S; static const mask print = _CTYPE_R; @@ -355,7 +357,7 @@ public: static const mask punct = _CTYPE_P; static const mask xdigit = _CTYPE_X; static const mask blank = _CTYPE_B; -#elif __sun__ +#elif defined(__sun__) typedef unsigned int mask; static const mask space = _ISSPACE; static const mask print = _ISPRINT; @@ -367,7 +369,7 @@ public: static const mask punct = _ISPUNCT; static const mask xdigit = _ISXDIGIT; static const mask blank = _ISBLANK; -#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __sun__ +#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__ typedef unsigned long mask; static const mask space = 1<<0; static const mask print = 1<<1; @@ -386,10 +388,10 @@ public: _LIBCPP_ALWAYS_INLINE ctype_base() {} }; -template class _LIBCPP_VISIBLE ctype; +template class _LIBCPP_TYPE_VIS ctype; template <> -class _LIBCPP_VISIBLE ctype +class _LIBCPP_TYPE_VIS ctype : public locale::facet, public ctype_base { @@ -491,7 +493,7 @@ protected: }; template <> -class _LIBCPP_VISIBLE ctype +class _LIBCPP_TYPE_VIS ctype : public locale::facet, public ctype_base { const mask* __tab_; @@ -590,7 +592,7 @@ public: #endif _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;} static const mask* classic_table() _NOEXCEPT; -#if defined(__GLIBC__) +#if defined(__GLIBC__) || defined(EMSCRIPTEN) static const int* __classic_upper_table() _NOEXCEPT; static const int* __classic_lower_table() _NOEXCEPT; #endif @@ -609,10 +611,10 @@ protected: // template class ctype_byname; -template class _LIBCPP_VISIBLE ctype_byname; +template class _LIBCPP_TYPE_VIS ctype_byname; template <> -class _LIBCPP_VISIBLE ctype_byname +class _LIBCPP_TYPE_VIS ctype_byname : public ctype { locale_t __l; @@ -630,7 +632,7 @@ protected: }; template <> -class _LIBCPP_VISIBLE ctype_byname +class _LIBCPP_TYPE_VIS ctype_byname : public ctype { locale_t __l; @@ -761,7 +763,7 @@ tolower(_CharT __c, const locale& __loc) // codecvt_base -class _LIBCPP_VISIBLE codecvt_base +class _LIBCPP_TYPE_VIS codecvt_base { public: _LIBCPP_ALWAYS_INLINE codecvt_base() {} @@ -770,12 +772,12 @@ public: // template class codecvt; -template class _LIBCPP_VISIBLE codecvt; +template class _LIBCPP_TYPE_VIS codecvt; // template <> class codecvt template <> -class _LIBCPP_VISIBLE codecvt +class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { @@ -861,7 +863,7 @@ protected: // template <> class codecvt template <> -class _LIBCPP_VISIBLE codecvt +class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { @@ -944,7 +946,7 @@ protected: // template <> class codecvt template <> -class _LIBCPP_VISIBLE codecvt +class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { @@ -1030,7 +1032,7 @@ protected: // template <> class codecvt template <> -class _LIBCPP_VISIBLE codecvt +class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { @@ -1116,7 +1118,7 @@ protected: // template class codecvt_byname template -class _LIBCPP_VISIBLE codecvt_byname +class _LIBCPP_TYPE_VIS codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { public: @@ -1140,7 +1142,7 @@ _LIBCPP_EXTERN_TEMPLATE(class codecvt_by _LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) _LIBCPP_EXTERN_TEMPLATE(class codecvt_byname) -_LIBCPP_VISIBLE void __throw_runtime_error(const char*); +_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); template struct __narrow_to_utf8 @@ -1324,10 +1326,10 @@ struct __widen_from_utf8<32> // template class numpunct -template class _LIBCPP_VISIBLE numpunct; +template class _LIBCPP_TYPE_VIS numpunct; template <> -class _LIBCPP_VISIBLE numpunct +class _LIBCPP_TYPE_VIS numpunct : public locale::facet { public: @@ -1358,7 +1360,7 @@ protected: }; template <> -class _LIBCPP_VISIBLE numpunct +class _LIBCPP_TYPE_VIS numpunct : public locale::facet { public: @@ -1390,10 +1392,10 @@ protected: // template class numpunct_byname -template class _LIBCPP_VISIBLE numpunct_byname; +template class _LIBCPP_TYPE_VIS numpunct_byname; template <> -class _LIBCPP_VISIBLE numpunct_byname +class _LIBCPP_TYPE_VIS numpunct_byname : public numpunct { public: @@ -1411,7 +1413,7 @@ private: }; template <> -class _LIBCPP_VISIBLE numpunct_byname +class _LIBCPP_TYPE_VIS numpunct_byname : public numpunct { public: Modified: head/contrib/libc++/include/__mutex_base ============================================================================== --- head/contrib/libc++/include/__mutex_base Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__mutex_base Sat Apr 27 22:47:52 2013 (r249998) @@ -32,7 +32,7 @@ template class upgrade_lo _LIBCPP_BEGIN_NAMESPACE_STD -class _LIBCPP_VISIBLE mutex +class _LIBCPP_TYPE_VIS mutex { pthread_mutex_t __m_; @@ -58,9 +58,9 @@ public: _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} }; -struct _LIBCPP_VISIBLE defer_lock_t {}; -struct _LIBCPP_VISIBLE try_to_lock_t {}; -struct _LIBCPP_VISIBLE adopt_lock_t {}; +struct _LIBCPP_TYPE_VIS defer_lock_t {}; +struct _LIBCPP_TYPE_VIS try_to_lock_t {}; +struct _LIBCPP_TYPE_VIS adopt_lock_t {}; #if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX) @@ -77,7 +77,7 @@ constexpr adopt_lock_t adopt_lock = ad #endif template -class _LIBCPP_VISIBLE lock_guard +class _LIBCPP_TYPE_VIS lock_guard { public: typedef _Mutex mutex_type; @@ -101,7 +101,7 @@ private: }; template -class _LIBCPP_VISIBLE unique_lock +class _LIBCPP_TYPE_VIS unique_lock { public: typedef _Mutex mutex_type; @@ -285,7 +285,7 @@ void swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT {__x.swap(__y);} -struct _LIBCPP_VISIBLE cv_status +struct _LIBCPP_TYPE_VIS cv_status { enum __lx { no_timeout, @@ -299,7 +299,7 @@ struct _LIBCPP_VISIBLE cv_status }; -class _LIBCPP_VISIBLE condition_variable +class _LIBCPP_TYPE_VIS condition_variable { pthread_cond_t __cv_; public: Modified: head/contrib/libc++/include/__std_stream ============================================================================== --- head/contrib/libc++/include/__std_stream Sat Apr 27 22:38:29 2013 (r249997) +++ head/contrib/libc++/include/__std_stream Sat Apr 27 22:47:52 2013 (r249998) @@ -41,7 +41,7 @@ public: typedef typename traits_type::off_type off_type; typedef typename traits_type::state_type state_type; - explicit __stdinbuf(FILE* __fp); + __stdinbuf(FILE* __fp, state_type* __st); protected: virtual int_type underflow(); @@ -53,7 +53,7 @@ private: FILE* __file_; const codecvt* __cv_; - state_type __st_; + state_type* __st_; int __encoding_; bool __always_noconv_; @@ -64,9 +64,9 @@ private: }; template -__stdinbuf<_CharT>::__stdinbuf(FILE* __fp) +__stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st) : __file_(__fp), - __st_() + __st_(__st) { imbue(this->getloc()); } @@ -119,15 +119,15 @@ __stdinbuf<_CharT>::__getchar(bool __con codecvt_base::result __r; do { - state_type __sv_st = __st_; - __r = __cv_->in(__st_, __extbuf, __extbuf + __nread, __enxt, + state_type __sv_st = *__st_; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 23:07:52 2013 Return-Path: Delivered-To: svn-src-head@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 52EFF159; Sat, 27 Apr 2013 23:07:52 +0000 (UTC) (envelope-from wkoszek@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 2EAD11E5D; Sat, 27 Apr 2013 23:07: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 r3RN7p4t007743; Sat, 27 Apr 2013 23:07:51 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RN7ouh007734; Sat, 27 Apr 2013 23:07:50 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201304272307.r3RN7ouh007734@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sat, 27 Apr 2013 23:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249999 - in head: share/man/man4/man4.arm sys/arm/arm sys/arm/include sys/dev/mmc sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 23:07:52 -0000 Author: wkoszek Date: Sat Apr 27 23:07:49 2013 New Revision: 249999 URL: http://svnweb.freebsd.org/changeset/base/249999 Log: Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port. Submitted by: Thomas Skibo Tested by: wkoszek (ZedBoard) Reviewed by: wkoszek, freebsd-arm@ (no objections raised) Added: head/share/man/man4/man4.arm/devcfg.4 (contents, props changed) Modified: head/share/man/man4/man4.arm/Makefile head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu.c head/sys/arm/include/armreg.h head/sys/dev/mmc/mmc.c head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Sat Apr 27 22:47:52 2013 (r249998) +++ head/share/man/man4/man4.arm/Makefile Sat Apr 27 23:07:49 2013 (r249999) @@ -1,6 +1,6 @@ # $FreeBSD$ -MAN= mge.4 npe.4 +MAN= mge.4 npe.4 devcfg.4 MLINKS= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 Added: head/share/man/man4/man4.arm/devcfg.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/devcfg.4 Sat Apr 27 23:07:49 2013 (r249999) @@ -0,0 +1,84 @@ +.\" +.\" Copyright (c) 2013 Thomas Skibo +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 28, 2013 +.Dt DEVCFG 4 +.Os +.Sh NAME +.Nm devcfg +.Nd Zynq PL device config interface +.Sh SYNOPSIS +.Cd device devcfg +.Sh DESCRIPTION +The special file +.Pa /dev/devcfg +can be used to configure the PL (FPGA) section of the Xilinx Zynq-7000. +.Pp +On the first write to the character device at file offset 0, the devcfg driver +asserts the top-level PL reset signals, disables the PS-PL level shifters, +and clears the PL configuration. Write data is sent to +the PCAP (processor configuration access port). When the PL asserts the +DONE signal, the devcfg driver will enable the level shifters and release +the top-level PL reset signals. +.Pp +The PL (FPGA) can be configured by writing the bitstream to the +character device like this: +.Bd -literal -offset indent +cat design.bit.bin > /dev/devcfg +.Ed +.Pp +The file should not be confused with the .bit file output by the FPGA +design tools. It is the binary form of the configuration bitstream. +The Xilinx +.Pa promgen +tool can do the conversion: +.Bd -literal -offset indent +promgen -b -w -p bin -data_width 32 -u 0 design.bit -o design.bit.bin +.Ed +.Sh SYSCTL VARIABLES +The devcfg driver provides the following +.Xr sysctl 8 +variables: +.Bl -tag -width 12 +.It Va hw.fpga.pl_done +.Pp +This variable always reflects the status of the PL's DONE signal. A 1 +means the PL section has been properly programmed. +.It Va hw.fpga.en_level_shifters +.Pp +This variable controls if the PS-PL level shifters are enabled after the +PL section has been reconfigured. This variable is 1 by default but setting +it to 0 allows the PL section to be programmed with configurations that +don't interface to the PS section of the part. Changing this value has no +effect on the level shifters until the next device reconfiguration. +.Sh FILES +/dev/devcfg Character device for +.Nm +driver. +.Sh AUTHORS +Thomas Skibo +.Sh SEE ALSO +Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585) Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/arm/arm/cpufunc.c Sat Apr 27 23:07:49 2013 (r249999) @@ -1480,7 +1480,8 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA8R2 || cputype == CPU_ID_CORTEXA8R3 || cputype == CPU_ID_CORTEXA9R1 || - cputype == CPU_ID_CORTEXA9R2) { + cputype == CPU_ID_CORTEXA9R2 || + cputype == CPU_ID_CORTEXA9R3) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/arm/arm/identcpu.c Sat Apr 27 23:07:49 2013 (r249999) @@ -246,6 +246,8 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA9R2, CPU_CLASS_CORTEXA, "Cortex A9-r2", generic_steppings }, + { CPU_ID_CORTEXA9R3, CPU_CLASS_CORTEXA, "Cortex A9-r3", + generic_steppings }, { CPU_ID_SA110, CPU_CLASS_SA1, "SA-110", sa110_steppings }, Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/arm/include/armreg.h Sat Apr 27 23:07:49 2013 (r249999) @@ -152,6 +152,7 @@ #define CPU_ID_CORTEXA8R3 0x413fc080 #define CPU_ID_CORTEXA9R1 0x411fc090 #define CPU_ID_CORTEXA9R2 0x412fc090 +#define CPU_ID_CORTEXA9R3 0x413fc090 #define CPU_ID_SA110 0x4401a100 #define CPU_ID_SA1100 0x4401a110 #define CPU_ID_TI925T 0x54029250 Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/dev/mmc/mmc.c Sat Apr 27 23:07:49 2013 (r249999) @@ -1734,3 +1734,4 @@ DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/dev/uart/uart.h Sat Apr 27 23:07:49 2013 (r249999) @@ -72,6 +72,7 @@ extern struct uart_class uart_sbbc_class extern struct uart_class uart_z8530_class __attribute__((weak)); extern struct uart_class uart_lpc_class __attribute__((weak)); extern struct uart_class uart_pl011_class __attribute__((weak)); +extern struct uart_class uart_cdnc_class __attribute__((weak)); #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sat Apr 27 22:47:52 2013 (r249998) +++ head/sys/dev/uart/uart_bus_fdt.c Sat Apr 27 23:07:49 2013 (r249999) @@ -109,6 +109,8 @@ uart_fdt_probe(device_t dev) sc->sc_class = &uart_imx_class; else if (ofw_bus_is_compatible(dev, "arm,pl011")) sc->sc_class = &uart_pl011_class; + else if (ofw_bus_is_compatible(dev, "cadence,uart")) + sc->sc_class = &uart_cdnc_class; else return (ENXIO); @@ -196,6 +198,8 @@ uart_cpu_getdev(int devtype, struct uart class = &uart_ns8250_class; if (fdt_is_compatible(node, "arm,pl011")) class = &uart_pl011_class; + if (fdt_is_compatible(node, "cadence,uart")) + class = &uart_cdnc_class; di->bas.chan = 0; di->bas.regshft = (u_int)shift; From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 23:36:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D209748B; Sat, 27 Apr 2013 23:36:02 +0000 (UTC) (envelope-from cperciva@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 6250D1EEF; Sat, 27 Apr 2013 23: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 r3RNa1cn017720; Sat, 27 Apr 2013 23:36:01 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RNa1p9017719; Sat, 27 Apr 2013 23:36:01 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201304272336.r3RNa1p9017719@svn.freebsd.org> From: Colin Percival Date: Sat, 27 Apr 2013 23:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250000 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 23:36:02 -0000 Author: cperciva Date: Sat Apr 27 23:36:01 2013 New Revision: 250000 URL: http://svnweb.freebsd.org/changeset/base/250000 Log: Move IPPROTO_IPV6 from #ifdef __BSD_VISIBLE to #if __POSIX_VISIBLE >= 201112 since POSIX 2001 states that it shall be defined. Reported by: sbruno Reviewed by: jilles MFC after: 1 week Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Sat Apr 27 23:07:49 2013 (r249999) +++ head/sys/netinet/in.h Sat Apr 27 23:36:01 2013 (r250000) @@ -123,6 +123,7 @@ __END_DECLS #endif /* !_KERNEL && __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200112 +#define IPPROTO_IPV6 41 /* IP6 header */ #define IPPROTO_RAW 255 /* raw IP packet */ #define INET_ADDRSTRLEN 16 #endif @@ -174,7 +175,6 @@ __END_DECLS #define IPPROTO_CMTP 38 /* Control Message Transport */ #define IPPROTO_TPXX 39 /* TP++ Transport */ #define IPPROTO_IL 40 /* IL transport protocol */ -#define IPPROTO_IPV6 41 /* IP6 header */ #define IPPROTO_SDRP 42 /* Source Demand Routing */ #define IPPROTO_ROUTING 43 /* IP6 routing header */ #define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 23:40:28 2013 Return-Path: Delivered-To: svn-src-head@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 6850573E; Sat, 27 Apr 2013 23:40:28 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id DA6501F22; Sat, 27 Apr 2013 23:40:27 +0000 (UTC) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by freebsd.czest.pl (8.14.5/8.14.5) with ESMTP id r3RNdjSB087560; Sat, 27 Apr 2013 23:39:45 GMT (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.5/8.14.5/Submit) id r3RNdjq7087559; Sat, 27 Apr 2013 23:39:45 GMT (envelope-from wkoszek) Date: Sat, 27 Apr 2013 23:39:45 +0000 From: "Wojciech A. Koszek" To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r249997 - in head/sys: arm/conf arm/xilinx arm/xilinx/zedboard boot/fdt/dts dev/cadence dev/sdhci Message-ID: <20130427233945.GD85673@FreeBSD.org> References: <201304272238.r3RMcTCm097428@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <201304272238.r3RMcTCm097428@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-0.4 required=5.0 tests=RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on freebsd.czest.pl X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (freebsd.czest.pl [212.87.224.105]); Sat, 27 Apr 2013 23:39:48 +0000 (UTC) Cc: ThomasSkibo@sbcglobal.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 23:40:28 -0000 On Sat, Apr 27, 2013 at 10:38:29PM +0000, Wojciech A. Koszek wrote: > Author: wkoszek > Date: Sat Apr 27 22:38:29 2013 > New Revision: 249997 > URL: http://svnweb.freebsd.org/changeset/base/249997 > > Log: > Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port. > > Submitted by: Thomas Skibo > Reviewed by: wkoszek, freebsd-arm@ (no objections raised) > Thomas, Was 3-clause BSD license in some of the files used purposefully, or it's a copy&paste thing? If you'd be OK with that, I'd like to fix some stuff with copyrights: http://people.freebsd.org/~wkoszek/patches/zynq_copyright.diff Are you OK with that? -- Wojciech A. Koszek wkoszek@FreeBSD.czest.pl http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-head@FreeBSD.ORG Sat Apr 27 23:59:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C829AB9; Sat, 27 Apr 2013 23:59:16 +0000 (UTC) (envelope-from wkoszek@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 E89FA1FB5; Sat, 27 Apr 2013 23:59: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 r3RNxFYA025030; Sat, 27 Apr 2013 23:59:15 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RNxFQM025029; Sat, 27 Apr 2013 23:59:15 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201304272359.r3RNxFQM025029@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sat, 27 Apr 2013 23:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250001 - head/share/man/man4/man4.arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 23:59:16 -0000 Author: wkoszek Date: Sat Apr 27 23:59:15 2013 New Revision: 250001 URL: http://svnweb.freebsd.org/changeset/base/250001 Log: Polish devcfg(4) slightly: add \n after the end of every sentence. Modified: head/share/man/man4/man4.arm/devcfg.4 Modified: head/share/man/man4/man4.arm/devcfg.4 ============================================================================== --- head/share/man/man4/man4.arm/devcfg.4 Sat Apr 27 23:36:01 2013 (r250000) +++ head/share/man/man4/man4.arm/devcfg.4 Sat Apr 27 23:59:15 2013 (r250001) @@ -39,19 +39,20 @@ can be used to configure the PL (FPGA) s .Pp On the first write to the character device at file offset 0, the devcfg driver asserts the top-level PL reset signals, disables the PS-PL level shifters, -and clears the PL configuration. Write data is sent to -the PCAP (processor configuration access port). When the PL asserts the -DONE signal, the devcfg driver will enable the level shifters and release -the top-level PL reset signals. +and clears the PL configuration. +Write data is sent to the PCAP (processor configuration access port). +When the PL asserts the DONE signal, the devcfg driver will enable the level +shifters and release the top-level PL reset signals. .Pp -The PL (FPGA) can be configured by writing the bitstream to the -character device like this: +The PL (FPGA) can be configured by writing the bitstream to the character +device like this: .Bd -literal -offset indent cat design.bit.bin > /dev/devcfg .Ed .Pp The file should not be confused with the .bit file output by the FPGA -design tools. It is the binary form of the configuration bitstream. +design tools. +It is the binary form of the configuration bitstream. The Xilinx .Pa promgen tool can do the conversion: @@ -65,15 +66,17 @@ variables: .Bl -tag -width 12 .It Va hw.fpga.pl_done .Pp -This variable always reflects the status of the PL's DONE signal. A 1 -means the PL section has been properly programmed. +This variable always reflects the status of the PL's DONE signal. +A 1 means the PL section has been properly programmed. .It Va hw.fpga.en_level_shifters .Pp This variable controls if the PS-PL level shifters are enabled after the -PL section has been reconfigured. This variable is 1 by default but setting -it to 0 allows the PL section to be programmed with configurations that -don't interface to the PS section of the part. Changing this value has no -effect on the level shifters until the next device reconfiguration. +PL section has been reconfigured. +This variable is 1 by default but setting it to 0 allows the PL section to be +programmed with configurations that don't interface to the PS section of the +part. +Changing this value has no effect on the level shifters until the next device +reconfiguration. .Sh FILES /dev/devcfg Character device for .Nm